From b95fe8c83d75fc944a09a26d10c701718b56aca1 Mon Sep 17 00:00:00 2001 From: ThomasSession Date: Mon, 2 Sep 2024 15:21:40 +1000 Subject: [PATCH] Fixing scrolling issues in emoji reactions --- .../reactions/ReactionsDialogFragment.java | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/reactions/ReactionsDialogFragment.java b/app/src/main/java/org/thoughtcrime/securesms/reactions/ReactionsDialogFragment.java index f871be0010..eb9947e428 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/reactions/ReactionsDialogFragment.java +++ b/app/src/main/java/org/thoughtcrime/securesms/reactions/ReactionsDialogFragment.java @@ -103,7 +103,9 @@ public final class ReactionsDialogFragment extends BottomSheetDialogFragment imp ViewCompat.setOnApplyWindowInsetsListener(container, (v, insets) -> insets.consumeSystemWindowInsets()); - TabLayoutMediator mediator = new TabLayoutMediator(emojiTabs, recipientPagerView, (tab, position) -> { + TabLayoutMediator mediator = new TabLayoutMediator( + emojiTabs, recipientPagerView, true, false, + (tab, position) -> { tab.setCustomView(R.layout.reactions_pill_large); View customView = Objects.requireNonNull(tab.getCustomView()); @@ -141,21 +143,6 @@ public final class ReactionsDialogFragment extends BottomSheetDialogFragment imp private void setUpRecipientsRecyclerView() { recipientsAdapter = new ReactionViewPagerAdapter(this); - - recipientPagerView.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() { - @Override - public void onPageSelected(int position) { - recipientPagerView.post(() -> recipientsAdapter.enableNestedScrollingForPosition(position)); - } - - @Override - public void onPageScrollStateChanged(int state) { - if (state == ViewPager2.SCROLL_STATE_IDLE) { - recipientPagerView.requestLayout(); - } - } - }); - recipientPagerView.setAdapter(recipientsAdapter); }