Hide toolbar icons in PostDetailRecyclerViewAdapterNew when item width drops below threshold.

This commit is contained in:
Docile-Alligator
2026-07-27 18:32:42 -04:00
parent 12f777b98b
commit 59fce4fced

View File

@ -929,47 +929,47 @@ public class PostDetailRecyclerViewAdapterNew extends RecyclerView.Adapter<Recyc
((PostDetailGalleryViewHolder) holder).adapter.setBlurImage(
(mPost.isNSFW() && mNeedBlurNsfw && !(mDoNotBlurNsfwInNsfwSubreddits && mFragment != null && mFragment.getIsNsfwSubreddit())) || (mPost.isSpoiler() && mNeedBlurSpoiler));
}
}
if (itemWidth < 250) {
if (((PostDetailGalleryViewHolder) holder).commentsCountButton != null) {
((PostDetailGalleryViewHolder) holder).commentsCountButton.setVisibility(View.GONE);
}
if (((PostDetailGalleryViewHolder) holder).saveButton != null) {
((PostDetailGalleryViewHolder) holder).saveButton.setVisibility(View.GONE);
}
if (((PostDetailGalleryViewHolder) holder).shareButton != null) {
((PostDetailGalleryViewHolder) holder).shareButton.setVisibility(View.GONE);
}
} else if (itemWidth < 316) {
if (((PostDetailGalleryViewHolder) holder).commentsCountButton != null) {
((PostDetailGalleryViewHolder) holder).commentsCountButton.setVisibility(View.GONE);
}
if (((PostDetailGalleryViewHolder) holder).saveButton != null) {
((PostDetailGalleryViewHolder) holder).saveButton.setVisibility(View.VISIBLE);
}
if (((PostDetailGalleryViewHolder) holder).shareButton != null) {
((PostDetailGalleryViewHolder) holder).shareButton.setVisibility(View.GONE);
}
} else if (itemWidth < 420) {
if (((PostDetailGalleryViewHolder) holder).commentsCountButton != null) {
((PostDetailGalleryViewHolder) holder).commentsCountButton.setVisibility(View.GONE);
}
if (((PostDetailGalleryViewHolder) holder).saveButton != null) {
((PostDetailGalleryViewHolder) holder).saveButton.setVisibility(View.VISIBLE);
}
if (((PostDetailGalleryViewHolder) holder).shareButton != null) {
((PostDetailGalleryViewHolder) holder).shareButton.setVisibility(View.VISIBLE);
}
} else {
if (((PostDetailGalleryViewHolder) holder).commentsCountButton != null) {
((PostDetailGalleryViewHolder) holder).commentsCountButton.setVisibility(View.VISIBLE);
}
if (((PostDetailGalleryViewHolder) holder).saveButton != null) {
((PostDetailGalleryViewHolder) holder).saveButton.setVisibility(View.VISIBLE);
}
if (((PostDetailGalleryViewHolder) holder).shareButton != null) {
((PostDetailGalleryViewHolder) holder).shareButton.setVisibility(View.VISIBLE);
}
if (itemWidth < 250) {
if (((PostDetailBaseViewHolder) holder).commentsCountButton != null) {
((PostDetailBaseViewHolder) holder).commentsCountButton.setVisibility(View.GONE);
}
if (((PostDetailBaseViewHolder) holder).saveButton != null) {
((PostDetailBaseViewHolder) holder).saveButton.setVisibility(View.GONE);
}
if (((PostDetailBaseViewHolder) holder).shareButton != null) {
((PostDetailBaseViewHolder) holder).shareButton.setVisibility(View.GONE);
}
} else if (itemWidth < 316) {
if (((PostDetailBaseViewHolder) holder).commentsCountButton != null) {
((PostDetailBaseViewHolder) holder).commentsCountButton.setVisibility(View.GONE);
}
if (((PostDetailBaseViewHolder) holder).saveButton != null) {
((PostDetailBaseViewHolder) holder).saveButton.setVisibility(View.VISIBLE);
}
if (((PostDetailBaseViewHolder) holder).shareButton != null) {
((PostDetailBaseViewHolder) holder).shareButton.setVisibility(View.GONE);
}
} else if (itemWidth < 420) {
if (((PostDetailBaseViewHolder) holder).commentsCountButton != null) {
((PostDetailBaseViewHolder) holder).commentsCountButton.setVisibility(View.GONE);
}
if (((PostDetailBaseViewHolder) holder).saveButton != null) {
((PostDetailBaseViewHolder) holder).saveButton.setVisibility(View.VISIBLE);
}
if (((PostDetailBaseViewHolder) holder).shareButton != null) {
((PostDetailBaseViewHolder) holder).shareButton.setVisibility(View.VISIBLE);
}
} else {
if (((PostDetailBaseViewHolder) holder).commentsCountButton != null) {
((PostDetailBaseViewHolder) holder).commentsCountButton.setVisibility(View.VISIBLE);
}
if (((PostDetailBaseViewHolder) holder).saveButton != null) {
((PostDetailBaseViewHolder) holder).saveButton.setVisibility(View.VISIBLE);
}
if (((PostDetailBaseViewHolder) holder).shareButton != null) {
((PostDetailBaseViewHolder) holder).shareButton.setVisibility(View.VISIBLE);
}
}
}