From 99fc6e7ba63418587c734ca901bcacfb212adad0 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Wed, 7 Feb 2024 12:31:18 +0800 Subject: [PATCH] fix: ProfileGalleryView Click and Swip --- .../org/telegram/ui/AvatarPreviewPagerIndicator.java | 4 ---- .../org/telegram/ui/Components/ProfileGalleryView.java | 10 ++++++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/TMessagesProj/src/main/java/org/telegram/ui/AvatarPreviewPagerIndicator.java b/TMessagesProj/src/main/java/org/telegram/ui/AvatarPreviewPagerIndicator.java index 20f4d72fdc..27b2f804c3 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/AvatarPreviewPagerIndicator.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/AvatarPreviewPagerIndicator.java @@ -364,10 +364,6 @@ public void onRelease() { postInvalidateOnAnimation(); } - @Override - public void onClick() { - } - @Override public void onPhotosLoaded() { } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/ProfileGalleryView.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/ProfileGalleryView.java index 982da733d8..5029eda48e 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/ProfileGalleryView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/ProfileGalleryView.java @@ -41,6 +41,8 @@ import java.util.ArrayList; +import tw.nekomimi.nekogram.NekoConfig; + public class ProfileGalleryView extends CircularViewPager implements NotificationCenter.NotificationCenterDelegate { private final PointF downPoint = new PointF(); @@ -129,7 +131,7 @@ public interface Callback { void onRelease(); - void onClick(); + default void onClick() {}; void onPhotosLoaded(); @@ -1227,9 +1229,9 @@ public void onAnimationReady(ImageReceiver imageReceiver) { item.imageView.setRoundRadius(roundTopRadius, roundTopRadius, roundBottomRadius, roundBottomRadius); - item.imageView.setOnClickListener(__ -> { - callback.onClick(); - }); + if (NekoConfig.disablePhotoSideAction.Bool()) { + item.imageView.setOnClickListener(__ -> callback.onClick()); + } item.imageView.setTag(realPosition);