diff options
author | Alex Ning <chineseperson5@gmail.com> | 2020-12-26 15:40:26 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2020-12-26 15:40:26 +0000 |
commit | 7b154f4d31a59cce78007a9e1c3e44ca55465b6a (patch) | |
tree | 4ad5f6decec9916c86dcd9a39392ddf6275090cb /app/src/main/java/ml | |
parent | bb3f76c9655ff3740816fc926d7d16539c9621a1 (diff) | |
download | infinity-for-reddit-7b154f4d31a59cce78007a9e1c3e44ca55465b6a.tar infinity-for-reddit-7b154f4d31a59cce78007a9e1c3e44ca55465b6a.tar.gz infinity-for-reddit-7b154f4d31a59cce78007a9e1c3e44ca55465b6a.tar.bz2 infinity-for-reddit-7b154f4d31a59cce78007a9e1c3e44ca55465b6a.tar.lz infinity-for-reddit-7b154f4d31a59cce78007a9e1c3e44ca55465b6a.tar.xz infinity-for-reddit-7b154f4d31a59cce78007a9e1c3e44ca55465b6a.tar.zst infinity-for-reddit-7b154f4d31a59cce78007a9e1c3e44ca55465b6a.zip |
Version 4.2.0-beta1. Fix regex in post filter. Fix UI issues.
Diffstat (limited to 'app/src/main/java/ml')
3 files changed, 11 insertions, 7 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostFilterPreferenceActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostFilterPreferenceActivity.java index ebcc8453..f75f08f7 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostFilterPreferenceActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostFilterPreferenceActivity.java @@ -59,6 +59,8 @@ public class PostFilterPreferenceActivity extends BaseActivity { protected void onCreate(Bundle savedInstanceState) { ((Infinity) getApplication()).getAppComponent().inject(this); + setImmersiveModeNotApplicable(); + super.onCreate(savedInstanceState); setContentView(R.layout.activity_post_filter_preference); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostFilterUsageListingActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostFilterUsageListingActivity.java index 482b1171..daf9a704 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostFilterUsageListingActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostFilterUsageListingActivity.java @@ -70,6 +70,8 @@ public class PostFilterUsageListingActivity extends BaseActivity { protected void onCreate(Bundle savedInstanceState) { ((Infinity) getApplication()).getAppComponent().inject(this); + setImmersiveModeNotApplicable(); + super.onCreate(savedInstanceState); setContentView(R.layout.activity_post_filter_application); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/postfilter/PostFilter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/postfilter/PostFilter.java index 63e26ee3..5eaf70bc 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/postfilter/PostFilter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/postfilter/PostFilter.java @@ -118,8 +118,8 @@ public class PostFilter implements Parcelable { return false; } if (postFilter.postTitleExcludesRegex != null && !postFilter.postTitleExcludesRegex.equals("")) { - Pattern spoilerPattern = Pattern.compile(postFilter.postTitleExcludesRegex); - Matcher matcher = spoilerPattern.matcher(postFilter.postTitleExcludesRegex); + Pattern pattern = Pattern.compile(postFilter.postTitleExcludesRegex); + Matcher matcher = pattern.matcher(post.getTitle()); if (matcher.find()) { return false; } @@ -127,7 +127,7 @@ public class PostFilter implements Parcelable { if (postFilter.postTitleExcludesStrings != null && !postFilter.postTitleExcludesStrings.equals("")) { String[] titles = postFilter.postTitleExcludesStrings.split(",", 0); for (String t : titles) { - if (post.getTitle().contains(t)) { + if (!t.equals("") && post.getTitle().contains(t)) { return false; } } @@ -135,7 +135,7 @@ public class PostFilter implements Parcelable { if (postFilter.excludeSubreddits != null && !postFilter.excludeSubreddits.equals("")) { String[] subreddits = postFilter.excludeSubreddits.split(",", 0); for (String s : subreddits) { - if (post.getSubredditName().equalsIgnoreCase(s)) { + if (!s.equals("") && post.getSubredditName().equalsIgnoreCase(s)) { return false; } } @@ -143,7 +143,7 @@ public class PostFilter implements Parcelable { if (postFilter.excludeUsers != null && !postFilter.excludeUsers.equals("")) { String[] users = postFilter.excludeUsers.split(",", 0); for (String u : users) { - if (post.getAuthor().equalsIgnoreCase(u)) { + if (!u.equals("") && post.getAuthor().equalsIgnoreCase(u)) { return false; } } @@ -151,7 +151,7 @@ public class PostFilter implements Parcelable { if (postFilter.excludeFlairs != null && !postFilter.excludeFlairs.equals("")) { String[] flairs = postFilter.excludeFlairs.split(",", 0); for (String f : flairs) { - if (post.getFlair().equalsIgnoreCase(f)) { + if (!f.equals("") && post.getFlair().equalsIgnoreCase(f)) { return false; } } @@ -159,7 +159,7 @@ public class PostFilter implements Parcelable { if (postFilter.containFlairs != null && !postFilter.containFlairs.equals("")) { String[] flairs = postFilter.containFlairs.split(",", 0); for (String f : flairs) { - if (post.getFlair().equalsIgnoreCase(f)) { + if (!f.equals("") && post.getFlair().equalsIgnoreCase(f)) { return false; } } |