Skip to content

Commit

Permalink
Use the correct post listing option when initializing a new PostOptio…
Browse files Browse the repository at this point in the history
…nsBottomSheetFragment instance in PostDetailRecyclerViewAdapter.
  • Loading branch information
Docile-Alligator committed Jan 10, 2025
1 parent 2b52783 commit 3edea6a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1261,10 +1261,10 @@ void setBaseView(AspectRatioGifImageView iconGifImageView,
PostOptionsBottomSheetFragment postOptionsBottomSheetFragment;
if (mPost.getPostType() == Post.GALLERY_TYPE && this instanceof PostDetailGalleryViewHolder) {
postOptionsBottomSheetFragment = PostOptionsBottomSheetFragment.newInstance(mPost,
getBindingAdapterPosition(),
mFragment.getPostListPosition(),
((LinearLayoutManagerBugFixed) ((PostDetailGalleryViewHolder) this).binding.galleryRecyclerViewItemPostDetailGallery.getLayoutManager()).findFirstVisibleItemPosition());
} else {
postOptionsBottomSheetFragment = PostOptionsBottomSheetFragment.newInstance(mPost, getBindingAdapterPosition());
postOptionsBottomSheetFragment = PostOptionsBottomSheetFragment.newInstance(mPost, mFragment.getPostListPosition());
}
postOptionsBottomSheetFragment.show(mActivity.getSupportFragmentManager(), postOptionsBottomSheetFragment.getTag());
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1883,6 +1883,10 @@ public boolean getIsNsfwSubreddit() {
return false;
}

public int getPostListPosition() {
return postListPosition;
}

@Subscribe
public void onPostUpdateEvent(PostUpdateEventToPostDetailFragment event) {
if (mPost.getId().equals(event.post.getId())) {
Expand Down

0 comments on commit 3edea6a

Please sign in to comment.