From 36a06290ef08290c2ca3d1f58839fdb258fbad3c Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Tue, 29 Oct 2019 22:33:53 +0800 Subject: Fixed UI issues in posts and comments. Version 1.4.0. --- .../infinityforreddit/Activity/LinkResolverActivity.java | 4 ++-- .../Adapter/CommentAndPostRecyclerViewAdapter.java | 8 ++++++++ .../infinityforreddit/Adapter/PostRecyclerViewAdapter.java | 13 ++++++++----- .../ml/docilealligator/infinityforreddit/CommentData.java | 10 +++++++++- .../ml/docilealligator/infinityforreddit/JSONUtils.java | 1 + .../ml/docilealligator/infinityforreddit/ParseComment.java | 12 +++++++++--- 6 files changed, 37 insertions(+), 11 deletions(-) (limited to 'app/src/main/java/ml') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LinkResolverActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LinkResolverActivity.java index 8a2dfb89..a6e130b8 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LinkResolverActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LinkResolverActivity.java @@ -36,9 +36,9 @@ public class LinkResolverActivity extends AppCompatActivity { private static final String POST_PATTERN = "/r/\\w+/comments/\\w+/{0,1}\\w+/{0,1}"; private static final String COMMENT_PATTERN = "/r/\\w+/comments/\\w+/{0,1}\\w+/\\w+/{0,1}"; - private static final String SUBREDDIT_PATTERN = "/r/\\w+/{0,1}"; + private static final String SUBREDDIT_PATTERN = "/[rR]/\\w+/{0,1}"; private static final String USER_PATTERN_1 = "/user/\\w+/{0,1}"; - private static final String USER_PATTERN_2 = "/u/\\w+/{0,1}"; + private static final String USER_PATTERN_2 = "/[uU]/\\w+/{0,1}"; @Inject SharedPreferences mSharedPreferences; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java index 97c7fb98..12f06260 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java @@ -582,6 +582,11 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter { + ((DataViewHolder) holder).nameTextView.setOnClickListener(view -> { if (canStartActivity) { canStartActivity = false; if (post.getSubredditNamePrefixed().startsWith("u/")) { @@ -263,6 +262,9 @@ public class PostRecyclerViewAdapter extends PagedListAdapter + ((DataViewHolder) holder).nameTextView.performClick()); } else { if (post.getAuthorIconUrl() == null) { String authorName = post.getAuthor().equals("[deleted]") ? post.getSubredditNamePrefixed().substring(2) : post.getAuthor(); @@ -300,7 +302,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter { + ((DataViewHolder) holder).nameTextView.setOnClickListener(view -> { if (canStartActivity) { canStartActivity = false; Intent intent = new Intent(mContext, ViewUserDetailActivity.class); @@ -308,6 +310,9 @@ public class PostRecyclerViewAdapter extends PagedListAdapter + ((DataViewHolder) holder).nameTextView.performClick()); } ((DataViewHolder) holder).postTimeTextView.setText(postTime); @@ -807,8 +812,6 @@ public class PostRecyclerViewAdapter extends PagedListAdapter