From: Damyan Ivanov Date: Thu, 28 Feb 2019 07:09:35 +0000 (+0000) Subject: make the color tag trigger drag too X-Git-Tag: v0.7~35 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=b7fa29fbf8a74287c2b25bf0dbd820be4653f09e;p=mobile-ledger.git make the color tag trigger drag too --- 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