diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2019-03-28 15:35:32 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2019-03-29 09:36:45 -0700 |
commit | 5743f8635b6d5cc980a8fa15ce7036e55f282b97 (patch) | |
tree | a5dfa5fc2010a677a896f47c012b137a85bdb0b0 /src/com/android/launcher3/Launcher.java | |
parent | 814b615b62a4eb69b70e1f52525ee9d6294909f8 (diff) | |
download | android_packages_apps_Trebuchet-5743f8635b6d5cc980a8fa15ce7036e55f282b97.tar.gz android_packages_apps_Trebuchet-5743f8635b6d5cc980a8fa15ce7036e55f282b97.tar.bz2 android_packages_apps_Trebuchet-5743f8635b6d5cc980a8fa15ce7036e55f282b97.zip |
Making navigation mode listener a singleton so that the change is dispatched
everywhere synchronously.
Change-Id: Iee8c5957d78dfad3fb03e814de0367adcaa0c98b
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 867001ab4..89236aaa2 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -257,6 +257,7 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns, public ViewGroupFocusHelper mFocusHandler; private RotationHelper mRotationHelper; + private Runnable mCancelTouchController; final Handler mHandler = new Handler(); private final Runnable mHandleDeferredResume = this::handleDeferredResume; @@ -946,7 +947,7 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns, // Setup the drag layer mDragLayer.setup(mDragController, mWorkspace); - UiFactory.setOnTouchControllersChangedListener(this, mDragLayer::recreateControllers); + mCancelTouchController = UiFactory.enableLiveTouchControllerChanges(mDragLayer); mWorkspace.setup(mDragController); // Until the workspace is bound, ensure that we keep the wallpaper offset locked to the @@ -1318,7 +1319,10 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns, unregisterReceiver(mScreenOffReceiver); mWorkspace.removeFolderListeners(); - UiFactory.setOnTouchControllersChangedListener(this, null); + if (mCancelTouchController != null) { + mCancelTouchController.run(); + mCancelTouchController = null; + } // Stop callbacks from LauncherModel // It's possible to receive onDestroy after a new Launcher activity has |