diff options
Diffstat (limited to 'app/src/main/java')
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); |