aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2019-01-21 09:32:21 +0000
committerAlex Ning <chineseperson5@gmail.com>2019-01-21 09:32:21 +0000
commitebc2cac0a6bf61ec4a161aa907cf68f751d03071 (patch)
tree4989adc2a6ff2ae4c6d87e694a99b7b55acc3ff0 /app/src/main/java
parent86bc381906684da561998ff4dff429253d6b692e (diff)
downloadinfinity-for-reddit-ebc2cac0a6bf61ec4a161aa907cf68f751d03071.tar
infinity-for-reddit-ebc2cac0a6bf61ec4a161aa907cf68f751d03071.tar.gz
infinity-for-reddit-ebc2cac0a6bf61ec4a161aa907cf68f751d03071.tar.bz2
infinity-for-reddit-ebc2cac0a6bf61ec4a161aa907cf68f751d03071.tar.lz
infinity-for-reddit-ebc2cac0a6bf61ec4a161aa907cf68f751d03071.tar.xz
infinity-for-reddit-ebc2cac0a6bf61ec4a161aa907cf68f751d03071.tar.zst
infinity-for-reddit-ebc2cac0a6bf61ec4a161aa907cf68f751d03071.zip
Click user names in comment to view the user's details. Minor visual redesign.
Diffstat (limited to '')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/CommentMultiLevelRecyclerViewAdapter.java9
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java2
2 files changed, 10 insertions, 1 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/CommentMultiLevelRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/CommentMultiLevelRecyclerViewAdapter.java
index 89ecf3bf..935826c6 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/CommentMultiLevelRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/CommentMultiLevelRecyclerViewAdapter.java
@@ -68,7 +68,14 @@ class CommentMultiLevelRecyclerViewAdapter extends MultiLevelAdapter {
public void onBindViewHolder(final RecyclerView.ViewHolder holder, int position) {
final CommentData commentItem = mCommentData.get(position);
- ((CommentViewHolder) holder).authorTextView.setText(commentItem.getAuthor());
+ String authorPrefixed = "u/" + commentItem.getAuthor();
+ ((CommentViewHolder) holder).authorTextView.setText(authorPrefixed);
+ ((CommentViewHolder) holder).authorTextView.setOnClickListener(view -> {
+ Intent intent = new Intent(mContext, ViewUserDetailActivity.class);
+ intent.putExtra(ViewUserDetailActivity.EXTRA_USER_NAME_KEY, commentItem.getAuthor());
+ mContext.startActivity(intent);
+ });
+
((CommentViewHolder) holder).commentTimeTextView.setText(commentItem.getCommentTime());
SpannableConfiguration spannableConfiguration = SpannableConfiguration.builder(mContext).linkResolver((view, link) -> {
if(link.startsWith("/u/")) {
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java
index 46a0ac66..a789b03b 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java
@@ -222,6 +222,7 @@ class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView.ViewHo
}
});
+ ((DataViewHolder) holder).subredditNameTextView.setTextColor(mContext.getResources().getColor(R.color.colorAccent));
((DataViewHolder) holder).subredditNameTextView.setText(subredditNamePrefixed);
((DataViewHolder) holder).subredditNameTextView.setOnClickListener(view -> {
@@ -305,6 +306,7 @@ class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView.ViewHo
}
});
+ ((DataViewHolder) holder).subredditNameTextView.setTextColor(mContext.getResources().getColor(R.color.colorPrimaryDark));
((DataViewHolder) holder).subredditNameTextView.setText(author);
((DataViewHolder) holder).subredditNameTextView.setOnClickListener(view -> {