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 0ee87da..5b935df 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