summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/dragndrop/DragController.java
diff options
context:
space:
mode:
authorJoey <joey@lineageos.org>2018-02-04 11:36:32 +0100
committerJoey <joey@lineageos.org>2018-12-27 12:42:40 +0100
commit514e4c750ffe8e9049f64fe86c61a7e5d6872f15 (patch)
treeeccbbac3cd51f533b96a2f69316997805ef31edc /src/com/android/launcher3/dragndrop/DragController.java
parentfe9c56fe329cc7c8f01aef929cb66fe0904dea1a (diff)
downloadandroid_packages_apps_Trebuchet-514e4c750ffe8e9049f64fe86c61a7e5d6872f15.tar.gz
android_packages_apps_Trebuchet-514e4c750ffe8e9049f64fe86c61a7e5d6872f15.tar.bz2
android_packages_apps_Trebuchet-514e4c750ffe8e9049f64fe86c61a7e5d6872f15.zip
Trebuchet: allow disabling workspace edit
Change-Id: I503e19cbc512eac0e4a8c8bccc16a6ccc0e805da Signed-off-by: Joey <joey@lineageos.org>
Diffstat (limited to 'src/com/android/launcher3/dragndrop/DragController.java')
-rw-r--r--src/com/android/launcher3/dragndrop/DragController.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/com/android/launcher3/dragndrop/DragController.java b/src/com/android/launcher3/dragndrop/DragController.java
index 8a216fc17..97c0fa916 100644
--- a/src/com/android/launcher3/dragndrop/DragController.java
+++ b/src/com/android/launcher3/dragndrop/DragController.java
@@ -37,6 +37,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;
@@ -407,10 +408,18 @@ public class DragController implements DragDriver.EventListener, TouchController
* Call this from a drag source view.
*/
public boolean onControllerInterceptTouchEvent(MotionEvent ev) {
+ boolean isEditDisabled = !Utilities.isWorkspaceEditAllowed(
+ mLauncher.getApplicationContext());
+
if (mOptions != null && mOptions.isAccessibleDrag) {
return false;
}
+ if (isEditDisabled) {
+ cancelDrag();
+ return false;
+ }
+
// Update the velocity tracker
mFlingToDeleteHelper.recordMotionEvent(ev);