Skip to content

Commit

Permalink
Fix cgeo#6724, Description of GC15GV4 unreadable
Browse files Browse the repository at this point in the history
add detecting problematic text colors in style attributes
  • Loading branch information
rsudev committed Sep 8, 2017
1 parent 91f40c2 commit 90cfa51
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions main/src/cgeo/geocaching/CacheDetailActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,21 @@ public class CacheDetailActivity extends AbstractViewPagerActivity<CacheDetailAc
private static final int MESSAGE_SUCCEEDED = 1;

private static final Pattern[] DARK_COLOR_PATTERNS = {
// html attributes
Pattern.compile("((?<!bg)color)=\"#" + "(0[0-9]){3}" + "\"", Pattern.CASE_INSENSITIVE),
Pattern.compile("((?<!bg)color)=\"" + "black" + "\"", Pattern.CASE_INSENSITIVE),
Pattern.compile("((?<!bg)color)=\"#" + "000080" + "\"", Pattern.CASE_INSENSITIVE) };
Pattern.compile("((?<!bg)color)=\"#" + "000080" + "\"", Pattern.CASE_INSENSITIVE),
// styles
Pattern.compile("((?<!background-)color):#" + "(0[0-9]){3}" + "(;|\")", Pattern.CASE_INSENSITIVE),
Pattern.compile("((?<!background-)color):" + "black" + "(;|\")", Pattern.CASE_INSENSITIVE),
Pattern.compile("((?<!background-)color):#" + "000080" + "(;|\")", Pattern.CASE_INSENSITIVE) };
private static final Pattern[] LIGHT_COLOR_PATTERNS = {
// html attributes
Pattern.compile("((?<!bg)color)=\"#" + "([F][6-9A-F]){3}" + "\"", Pattern.CASE_INSENSITIVE),
Pattern.compile("((?<!bg)color)=\"" + "white" + "\"", Pattern.CASE_INSENSITIVE) };
Pattern.compile("((?<!bg)color)=\"" + "white" + "\"", Pattern.CASE_INSENSITIVE),
// styles
Pattern.compile("((?<!background-)color):#" + "([F][6-9A-F]){3}" + "(;|\")", Pattern.CASE_INSENSITIVE),
Pattern.compile("((?<!background-)color):" + "white" + "(;|\")", Pattern.CASE_INSENSITIVE) };
public static final String STATE_PAGE_INDEX = "cgeo.geocaching.pageIndex";

// Store Geocode here, as 'cache' is loaded Async.
Expand Down

0 comments on commit 90cfa51

Please sign in to comment.