summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/dragndrop
diff options
context:
space:
mode:
authorJoey <joey@lineageos.org>2018-02-04 11:36:32 +0100
committerJoey <joey@lineageos.org>2018-02-05 19:54:40 +0000
commit1b2f8875b149fa27f80b6945cb51a5476e709a8b (patch)
tree296e016387f4813a96aca6b6f92d7e60ef7704f9 /src/com/android/launcher3/dragndrop
parent8463529145791249bb7118fe96482a5e8e58eac4 (diff)
downloadandroid_packages_apps_Trebuchet-1b2f8875b149fa27f80b6945cb51a5476e709a8b.tar.gz
android_packages_apps_Trebuchet-1b2f8875b149fa27f80b6945cb51a5476e709a8b.tar.bz2
android_packages_apps_Trebuchet-1b2f8875b149fa27f80b6945cb51a5476e709a8b.zip
Trebuchet: allow disabling workspace edit
Change-Id: I503e19cbc512eac0e4a8c8bccc16a6ccc0e805da Signed-off-by: Joey <joey@lineageos.org>
Diffstat (limited to 'src/com/android/launcher3/dragndrop')
-rw-r--r--src/com/android/launcher3/dragndrop/DragController.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/com/android/launcher3/dragndrop/DragController.java b/src/com/android/launcher3/dragndrop/DragController.java
index b8527148b..4341e8bbe 100644
--- a/src/com/android/launcher3/dragndrop/DragController.java
+++ b/src/com/android/launcher3/dragndrop/DragController.java
@@ -35,6 +35,7 @@ import com.android.launcher3.ItemInfo;
import com.android.launcher3.Launcher;
import com.android.launcher3.R;
import com.android.launcher3.ShortcutInfo;
+import com.android.launcher3.Utilities;
import com.android.launcher3.accessibility.DragViewStateAnnouncer;
import com.android.launcher3.util.ItemInfoMatcher;
import com.android.launcher3.util.Thunk;
@@ -391,7 +392,14 @@ public class DragController implements DragDriver.EventListener, TouchController
* Call this from a drag source view.
*/
public boolean onControllerInterceptTouchEvent(MotionEvent ev) {
- if (mOptions != null && mOptions.isAccessibleDrag) {
+ boolean isEditDisabled = !Utilities.isWorkspaceEditAllowed(
+ mLauncher.getApplicationContext());
+
+ if ((mOptions != null && mOptions.isAccessibleDrag) || isEditDisabled) {
+ if (isEditDisabled) {
+ cancelDrag();
+ }
+
return false;
}