diff --git a/TMessagesProj/src/main/java/androidx/recyclerview/widget/ItemTouchHelper.java b/TMessagesProj/src/main/java/androidx/recyclerview/widget/ItemTouchHelper.java index 78f569481e..03111cb667 100644 --- a/TMessagesProj/src/main/java/androidx/recyclerview/widget/ItemTouchHelper.java +++ b/TMessagesProj/src/main/java/androidx/recyclerview/widget/ItemTouchHelper.java @@ -40,11 +40,13 @@ import androidx.recyclerview.widget.RecyclerView.ViewHolder; import org.telegram.messenger.AndroidUtilities; +import org.telegram.ui.Cells.DialogCell; import java.util.ArrayList; import java.util.List; import tw.nekomimi.nekogram.NekoConfig; +import xyz.nextalone.nagram.NaConfig; /** * This is a utility class to add swipe to dismiss and drag & drop support to RecyclerView. @@ -1257,6 +1259,11 @@ public boolean isIdle() { } public int checkHorizontalSwipe(ViewHolder viewHolder, int flags) { + if (viewHolder != null && viewHolder.itemView instanceof DialogCell) { + if (((DialogCell) viewHolder.itemView).getCurrentDialogFolderId() == 0 && NaConfig.INSTANCE.getDoNotUnarchiveBySwipe().Bool()) { + return 0; + } + } if ((flags & (LEFT | RIGHT)) != 0) { final int dirFlag = mDx > 0 ? RIGHT : LEFT; if (mVelocityTracker != null && mActivePointerId > -1) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java index 302d98a32f..ff76dda15b 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java @@ -2688,12 +2688,6 @@ public long getAnimationDuration(RecyclerView recyclerView, int animationType, f @Override public float getSwipeThreshold(RecyclerView.ViewHolder viewHolder) { - if (viewHolder != null && viewHolder.itemView instanceof DialogCell) { - if (((DialogCell) viewHolder.itemView).getCurrentDialogFolderId() == 0 - && NaConfig.INSTANCE.getDoNotUnarchiveBySwipe().Bool()) { - return 1.0f; - } - } return 0.45f; }