diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2017-09-28 13:43:24 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2017-10-02 16:18:52 -0700 |
commit | 37920966888587900885c88a63785cb16567684c (patch) | |
tree | d4c0688a9d703afb1099061f2f316ac4752dd0ff /src/com/android/launcher3/popup/PopupContainerWithArrow.java | |
parent | 326403e958344751539cefec62ecbc6d28abd2ce (diff) | |
download | android_packages_apps_Trebuchet-37920966888587900885c88a63785cb16567684c.tar.gz android_packages_apps_Trebuchet-37920966888587900885c88a63785cb16567684c.tar.bz2 android_packages_apps_Trebuchet-37920966888587900885c88a63785cb16567684c.zip |
Allowing the widgetBottomSheet to be dragged
even when the touch is started from outside the panel
Removing various instanceOf checks in onNewIntent and onBackPress
and moving all the corresponding logging in the FloatingView
This simplifies handling of panel specific log and avoids
missing a particular panel type in the if-else statement.
Bug: 64751884
Bug: 64751923
Change-Id: I98f5aae18560a64be73c9efcf495479740d49a00
Diffstat (limited to 'src/com/android/launcher3/popup/PopupContainerWithArrow.java')
-rw-r--r-- | src/com/android/launcher3/popup/PopupContainerWithArrow.java | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/src/com/android/launcher3/popup/PopupContainerWithArrow.java b/src/com/android/launcher3/popup/PopupContainerWithArrow.java index 8441598cf..409e5aefd 100644 --- a/src/com/android/launcher3/popup/PopupContainerWithArrow.java +++ b/src/com/android/launcher3/popup/PopupContainerWithArrow.java @@ -16,6 +16,11 @@ package com.android.launcher3.popup; +import static com.android.launcher3.popup.PopupPopulator.MAX_SHORTCUTS_IF_NOTIFICATIONS; +import static com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType; +import static com.android.launcher3.userevent.nano.LauncherLogProto.ItemType; +import static com.android.launcher3.userevent.nano.LauncherLogProto.Target; + import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; @@ -66,6 +71,7 @@ import com.android.launcher3.dragndrop.DragLayer; import com.android.launcher3.dragndrop.DragOptions; import com.android.launcher3.graphics.IconPalette; import com.android.launcher3.graphics.TriangleShape; +import com.android.launcher3.logging.LoggerUtils; import com.android.launcher3.notification.NotificationItemView; import com.android.launcher3.notification.NotificationKeyData; import com.android.launcher3.shortcuts.DeepShortcutManager; @@ -81,11 +87,6 @@ import java.util.List; import java.util.Map; import java.util.Set; -import static com.android.launcher3.popup.PopupPopulator.MAX_SHORTCUTS_IF_NOTIFICATIONS; -import static com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType; -import static com.android.launcher3.userevent.nano.LauncherLogProto.ItemType; -import static com.android.launcher3.userevent.nano.LauncherLogProto.Target; - /** * A container for shortcuts to deep links within apps. */ @@ -593,11 +594,6 @@ public class PopupContainerWithArrow extends AbstractFloatingView implements Dra return arrowView; } - @Override - public View getExtendedTouchView() { - return mOriginalIcon; - } - /** * Determines when the deferred drag should be started. * @@ -950,7 +946,25 @@ public class PopupContainerWithArrow extends AbstractFloatingView implements Dra } @Override - public int getLogContainerType() { - return ContainerType.DEEPSHORTCUTS; + public void logActionCommand(int command) { + mLauncher.getUserEventDispatcher().logActionCommand( + command, mOriginalIcon, ContainerType.DEEPSHORTCUTS); + } + + @Override + public boolean onControllerInterceptTouchEvent(MotionEvent ev) { + if (ev.getAction() == MotionEvent.ACTION_DOWN) { + DragLayer dl = mLauncher.getDragLayer(); + if (!dl.isEventOverView(this, ev)) { + mLauncher.getUserEventDispatcher().logActionTapOutside( + LoggerUtils.newContainerTarget(ContainerType.DEEPSHORTCUTS)); + close(true); + + // We let touches on the original icon go through so that users can launch + // the app with one tap if they don't find a shortcut they want. + return mOriginalIcon == null || !dl.isEventOverView(mOriginalIcon, ev); + } + } + return false; } } |