aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/ml
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2019-08-26 09:06:50 +0000
committerAlex Ning <chineseperson5@gmail.com>2019-08-26 09:06:50 +0000
commitb29bbf4321205a665ed74ecf05b54205d34d0840 (patch)
tree091285ed853b05061c3ee2f766fdef5ef0e20a59 /app/src/main/java/ml
parent1da0e08552fbd5564eb7df539ec0d15d8201c1fa (diff)
downloadinfinity-for-reddit-b29bbf4321205a665ed74ecf05b54205d34d0840.tar
infinity-for-reddit-b29bbf4321205a665ed74ecf05b54205d34d0840.tar.gz
infinity-for-reddit-b29bbf4321205a665ed74ecf05b54205d34d0840.tar.bz2
infinity-for-reddit-b29bbf4321205a665ed74ecf05b54205d34d0840.tar.lz
infinity-for-reddit-b29bbf4321205a665ed74ecf05b54205d34d0840.tar.xz
infinity-for-reddit-b29bbf4321205a665ed74ecf05b54205d34d0840.tar.zst
infinity-for-reddit-b29bbf4321205a665ed74ecf05b54205d34d0840.zip
Display an archived icon if the post is archived. Display a locked icon if the post is locked.
Diffstat (limited to 'app/src/main/java/ml')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/CommentAndPostRecyclerViewAdapter.java16
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java10
2 files changed, 26 insertions, 0 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/CommentAndPostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/CommentAndPostRecyclerViewAdapter.java
index ec46235d..095abbaa 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/CommentAndPostRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/CommentAndPostRecyclerViewAdapter.java
@@ -331,6 +331,14 @@ class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie
((PostDetailViewHolder) holder).mGildedNumberTextView.setText(gildedNumber);
}
+ if(mPost.isArchived()) {
+ ((PostDetailViewHolder) holder).mArchivedImageView.setVisibility(View.VISIBLE);
+ }
+
+ if(mPost.isLocked()) {
+ ((PostDetailViewHolder) holder).mLockedImageView.setVisibility(View.VISIBLE);
+ }
+
if(mPost.isSpoiler() || mPost.getFlair() != null) {
((PostDetailViewHolder) holder).spoilerFlairlinearLayout.setVisibility(View.VISIBLE);
}
@@ -555,6 +563,12 @@ class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie
android.graphics.PorterDuff.Mode.SRC_IN);
}
+ if(mPost.isLocked()) {
+ ((CommentViewHolder) holder).replyButton
+ .setColorFilter(ContextCompat.getColor(mActivity, R.color.voteAndReplyUnavailableVoteButtonColor),
+ android.graphics.PorterDuff.Mode.SRC_IN);
+ }
+
((CommentViewHolder) holder).replyButton.setOnClickListener(view -> {
if(mAccessToken == null) {
Toast.makeText(mActivity, R.string.login_first, Toast.LENGTH_SHORT).show();
@@ -989,6 +1003,8 @@ class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie
@BindView(R.id.gilded_image_view_item_post_detail) ImageView mGildedImageView;
@BindView(R.id.gilded_number_text_view_item_post_detail) TextView mGildedNumberTextView;
@BindView(R.id.crosspost_image_view_item_post_detail) ImageView mCrosspostImageView;
+ @BindView(R.id.archived_image_view_item_post_detail) ImageView mArchivedImageView;
+ @BindView(R.id.locked_image_view_item_post_detail) ImageView mLockedImageView;
@BindView(R.id.nsfw_text_view_item_post_detail) Chip mNSFWChip;
@BindView(R.id.spoiler_flair_linear_layout_item_post_detail) LinearLayout spoilerFlairlinearLayout;
@BindView(R.id.spoiler_custom_text_view_item_post_detail) CustomTextView spoilerTextView;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java
index 9747542a..5a1ec974 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java
@@ -305,6 +305,10 @@ class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView.ViewHo
((DataViewHolder) holder).gildedNumberTextView.setText(gildedNumber);
}
+ if(post.isLocked()) {
+ ((DataViewHolder) holder).lockedImageView.setVisibility(View.VISIBLE);
+ }
+
if(nsfw) {
((DataViewHolder) holder).nsfwChip.setVisibility(View.VISIBLE);
}
@@ -350,6 +354,8 @@ class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView.ViewHo
}
if(isArchived) {
+ ((DataViewHolder) holder).archivedImageView.setVisibility(View.VISIBLE);
+
((DataViewHolder) holder).upvoteButton
.setColorFilter(ContextCompat.getColor(mContext, R.color.voteAndReplyUnavailableVoteButtonColor), android.graphics.PorterDuff.Mode.SRC_IN);
((DataViewHolder) holder).downvoteButton
@@ -691,6 +697,8 @@ class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView.ViewHo
@BindView(R.id.type_text_view_item_post) Chip typeChip;
@BindView(R.id.gilded_image_view_item_post) ImageView gildedImageView;
@BindView(R.id.gilded_number_text_view_item_post) TextView gildedNumberTextView;
+ @BindView(R.id.archived_image_view_item_post) ImageView archivedImageView;
+ @BindView(R.id.locked_image_view_item_post) ImageView lockedImageView;
@BindView(R.id.crosspost_image_view_item_post) ImageView crosspostImageView;
@BindView(R.id.nsfw_text_view_item_post) Chip nsfwChip;
@BindView(R.id.spoiler_flair_linear_layout_item_post) LinearLayout spoilerFlairLinearLayout;
@@ -745,6 +753,8 @@ class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView.ViewHo
((DataViewHolder) holder).gildedImageView.setVisibility(View.GONE);
((DataViewHolder) holder).gildedNumberTextView.setVisibility(View.GONE);
((DataViewHolder) holder).crosspostImageView.setVisibility(View.GONE);
+ ((DataViewHolder) holder).archivedImageView.setVisibility(View.GONE);
+ ((DataViewHolder) holder).lockedImageView.setVisibility(View.GONE);
((DataViewHolder) holder).nsfwChip.setVisibility(View.GONE);
((DataViewHolder) holder).spoilerFlairLinearLayout.setVisibility(View.GONE);
((DataViewHolder) holder).spoilerTextView.setVisibility(View.GONE);