]> git.ktnx.net Git - mobile-ledger.git/commitdiff
make the color tag trigger drag too
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 28 Feb 2019 07:09:35 +0000 (07:09 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 28 Feb 2019 07:09:35 +0000 (07:09 +0000)
app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfilesRecyclerViewAdapter.java

index 0ee87da1157177718218a5a2636c66a27c577183..5b935df98b9954b398bd7143a14210d3cc5fcc6b 100644 (file)
@@ -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