From b7fa29fbf8a74287c2b25bf0dbd820be4653f09e Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Thu, 28 Feb 2019 07:09:35 +0000 Subject: [PATCH] make the color tag trigger drag too --- .../ui/profiles/ProfilesRecyclerViewAdapter.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfilesRecyclerViewAdapter.java b/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfilesRecyclerViewAdapter.java index 0ee87da1..5b935df9 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfilesRecyclerViewAdapter.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfilesRecyclerViewAdapter.java @@ -148,10 +148,15 @@ public class ProfilesRecyclerViewAdapter view.setAlpha(sameProfile ? 1 : 0.5f); }); - holder.mRearrangeHandle.setOnTouchListener((v, event) -> { - rearrangeHelper.startDrag(holder); - return true; - }); + View.OnTouchListener dragStarter = (v, event) -> { + if (rearrangeHelper != null && editingProfiles.get()) { + rearrangeHelper.startDrag(holder); + return true; + } + return false; + }; + holder.mRearrangeHandle.setOnTouchListener(dragStarter); + holder.mColorTag.setOnTouchListener(dragStarter); return holder; } @Override -- 2.39.5