Loading app/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/MessageListSwipeCallback.kt +4 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,10 @@ class MessageListSwipeCallback( swipeLeftLayout = layoutInflater.inflate(R.layout.swipe_left_action, null, false) } override fun isFlingEnabled(): Boolean { return false } override fun getMovementFlags(recyclerView: RecyclerView, viewHolder: ViewHolder): Int { if (viewHolder !is MessageViewHolder) return 0 Loading ui-utils/ItemTouchHelper/src/main/java/app/k9mail/ui/utils/itemtouchhelper/ItemTouchHelper.java +7 −2 Original line number Diff line number Diff line Loading @@ -1299,7 +1299,7 @@ public class ItemTouchHelper extends RecyclerView.ItemDecoration private int checkHorizontalSwipe(ViewHolder viewHolder, int flags) { if ((flags & (LEFT | RIGHT)) != 0) { final int dirFlag = mDx > 0 ? RIGHT : LEFT; if (mVelocityTracker != null && mActivePointerId > -1) { if (mCallback.isFlingEnabled() && mVelocityTracker != null && mActivePointerId > -1) { mVelocityTracker.computeCurrentVelocity(PIXELS_PER_SECOND, mCallback.getSwipeVelocityThreshold(mMaxSwipeVelocity)); final float xVelocity = mVelocityTracker.getXVelocity(mActivePointerId); Loading @@ -1326,7 +1326,7 @@ public class ItemTouchHelper extends RecyclerView.ItemDecoration private int checkVerticalSwipe(ViewHolder viewHolder, int flags) { if ((flags & (UP | DOWN)) != 0) { final int dirFlag = mDy > 0 ? DOWN : UP; if (mVelocityTracker != null && mActivePointerId > -1) { if (mCallback.isFlingEnabled() && mVelocityTracker != null && mActivePointerId > -1) { mVelocityTracker.computeCurrentVelocity(PIXELS_PER_SECOND, mCallback.getSwipeVelocityThreshold(mMaxSwipeVelocity)); final float xVelocity = mVelocityTracker.getXVelocity(mActivePointerId); Loading Loading @@ -2280,6 +2280,11 @@ public class ItemTouchHelper extends RecyclerView.ItemDecoration public void onSwipeEnded(@NonNull ViewHolder viewHolder) { } public boolean isFlingEnabled() { return true; } } /** Loading Loading
app/ui/legacy/src/main/java/com/fsck/k9/ui/messagelist/MessageListSwipeCallback.kt +4 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,10 @@ class MessageListSwipeCallback( swipeLeftLayout = layoutInflater.inflate(R.layout.swipe_left_action, null, false) } override fun isFlingEnabled(): Boolean { return false } override fun getMovementFlags(recyclerView: RecyclerView, viewHolder: ViewHolder): Int { if (viewHolder !is MessageViewHolder) return 0 Loading
ui-utils/ItemTouchHelper/src/main/java/app/k9mail/ui/utils/itemtouchhelper/ItemTouchHelper.java +7 −2 Original line number Diff line number Diff line Loading @@ -1299,7 +1299,7 @@ public class ItemTouchHelper extends RecyclerView.ItemDecoration private int checkHorizontalSwipe(ViewHolder viewHolder, int flags) { if ((flags & (LEFT | RIGHT)) != 0) { final int dirFlag = mDx > 0 ? RIGHT : LEFT; if (mVelocityTracker != null && mActivePointerId > -1) { if (mCallback.isFlingEnabled() && mVelocityTracker != null && mActivePointerId > -1) { mVelocityTracker.computeCurrentVelocity(PIXELS_PER_SECOND, mCallback.getSwipeVelocityThreshold(mMaxSwipeVelocity)); final float xVelocity = mVelocityTracker.getXVelocity(mActivePointerId); Loading @@ -1326,7 +1326,7 @@ public class ItemTouchHelper extends RecyclerView.ItemDecoration private int checkVerticalSwipe(ViewHolder viewHolder, int flags) { if ((flags & (UP | DOWN)) != 0) { final int dirFlag = mDy > 0 ? DOWN : UP; if (mVelocityTracker != null && mActivePointerId > -1) { if (mCallback.isFlingEnabled() && mVelocityTracker != null && mActivePointerId > -1) { mVelocityTracker.computeCurrentVelocity(PIXELS_PER_SECOND, mCallback.getSwipeVelocityThreshold(mMaxSwipeVelocity)); final float xVelocity = mVelocityTracker.getXVelocity(mActivePointerId); Loading Loading @@ -2280,6 +2280,11 @@ public class ItemTouchHelper extends RecyclerView.ItemDecoration public void onSwipeEnded(@NonNull ViewHolder viewHolder) { } public boolean isFlingEnabled() { return true; } } /** Loading