File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
libraries/sdk/src/main/java/com/fastcomments/sdk Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -65,21 +65,25 @@ class ImageViewHolder extends RecyclerView.ViewHolder {
6565 imageView = itemView .findViewById (R .id .postImageView );
6666 playButton = itemView .findViewById (R .id .playButton );
6767
68- // Set click listener to show full image gallery
69- itemView .setOnClickListener (v -> {
68+ // Set click listener on both itemView and imageView to ensure taps work
69+ // This is necessary because ViewPager2's gesture detection can intercept taps on the container
70+ View .OnClickListener clickListener = v -> {
7071 int position = getAdapterPosition ();
7172 if (position != RecyclerView .NO_POSITION ) {
7273 FeedPostMediaItem mediaItem = mediaItems .get (position );
73-
74+
7475 // Show gallery mode starting at the clicked image position
7576 new FullImageDialog (context , mediaItems , position ).show ();
76-
77+
7778 // Also notify the listener if set
7879 if (listener != null ) {
7980 listener .onImageClick (mediaItem );
8081 }
8182 }
82- });
83+ };
84+
85+ itemView .setOnClickListener (clickListener );
86+ imageView .setOnClickListener (clickListener );
8387 }
8488
8589 void bind (FeedPostMediaItem mediaItem ) {
You can’t perform that action at this time.
0 commit comments