aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2021-03-30 16:18:31 +0000
committerAlex Ning <chineseperson5@gmail.com>2021-03-30 16:18:31 +0000
commit5976999131859779900181db222c68b60f8a9888 (patch)
treeb1e752e2999327617281ce2da07d7a5df526c0af /app/src/main/java
parent57a8e69eb122a6cba4bb1e0d37f0fc31c5d14bea (diff)
downloadinfinity-for-reddit-5976999131859779900181db222c68b60f8a9888.tar
infinity-for-reddit-5976999131859779900181db222c68b60f8a9888.tar.gz
infinity-for-reddit-5976999131859779900181db222c68b60f8a9888.tar.bz2
infinity-for-reddit-5976999131859779900181db222c68b60f8a9888.tar.lz
infinity-for-reddit-5976999131859779900181db222c68b60f8a9888.tar.xz
infinity-for-reddit-5976999131859779900181db222c68b60f8a9888.tar.zst
infinity-for-reddit-5976999131859779900181db222c68b60f8a9888.zip
Fix wrong subreddit creation time. Swap sort and search icons in several activities. Fix crashing when comparing exclude domains with posts.
Diffstat (limited to '')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/ParseSubscribedThing.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/postfilter/PostFilter.java5
2 files changed, 4 insertions, 3 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ParseSubscribedThing.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ParseSubscribedThing.java
index 68efd8c0..f5164ebd 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/ParseSubscribedThing.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ParseSubscribedThing.java
@@ -99,7 +99,7 @@ class ParseSubscribedThing {
String description = data.getString(JSONUtils.PUBLIC_DESCRIPTION_KEY).trim();
String sidebarDescription = data.getString(JSONUtils.DESCRIPTION_KEY);
int nSubscribers = data.getInt(JSONUtils.SUBSCRIBERS_KEY);
- long createdUTC = data.getLong(JSONUtils.CREATED_UTC_KEY);
+ long createdUTC = data.getLong(JSONUtils.CREATED_UTC_KEY) * 1000;
String suggestedCommentSort = data.getString(JSONUtils.SUGGESTED_COMMENT_SORT_KEY);
boolean isNSFW = data.getBoolean(JSONUtils.OVER18_KEY);
newSubscribedSubredditData.add(new SubscribedSubredditData(id, name, iconUrl, accountName, isFavorite));
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 f61ecc46..87185b19 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/postfilter/PostFilter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/postfilter/PostFilter.java
@@ -202,10 +202,11 @@ public class PostFilter implements Parcelable {
}
}
}
- if (postFilter.excludeDomains != null && !postFilter.excludeDomains.equals("")) {
+ if (post.getUrl() != null && postFilter.excludeDomains != null && !postFilter.excludeDomains.equals("")) {
String[] domains = postFilter.excludeDomains.split(",", 0);
+ String url = post.getUrl().toLowerCase();
for (String f : domains) {
- if (!f.trim().equals("") && post.getUrl().toLowerCase().contains(f.trim().toLowerCase())) {
+ if (!f.trim().equals("") && url.contains(f.trim().toLowerCase())) {
return false;
}
}