summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/popup
diff options
context:
space:
mode:
authorTony <twickham@google.com>2017-05-23 12:19:09 -0700
committerTony <twickham@google.com>2017-05-24 10:50:41 -0700
commit17b7f9bdf40b015db9f262b3221c4e46ae1b430b (patch)
tree2a2c269244914888f7138f3eaa7609c137ce8981 /src/com/android/launcher3/popup
parent8c26cec587cf811ebce69d2600ccc83f13755166 (diff)
downloadandroid_packages_apps_Trebuchet-17b7f9bdf40b015db9f262b3221c4e46ae1b430b.tar.gz
android_packages_apps_Trebuchet-17b7f9bdf40b015db9f262b3221c4e46ae1b430b.tar.bz2
android_packages_apps_Trebuchet-17b7f9bdf40b015db9f262b3221c4e46ae1b430b.zip
Don't hide text in pre-drag when opening popup above icon
Bug: 38468930 Change-Id: Id03162af829a00442d1db0a93f7e9d8bcb998b1a
Diffstat (limited to 'src/com/android/launcher3/popup')
-rw-r--r--src/com/android/launcher3/popup/PopupContainerWithArrow.java19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/com/android/launcher3/popup/PopupContainerWithArrow.java b/src/com/android/launcher3/popup/PopupContainerWithArrow.java
index ccead37dc..b373a1766 100644
--- a/src/com/android/launcher3/popup/PopupContainerWithArrow.java
+++ b/src/com/android/launcher3/popup/PopupContainerWithArrow.java
@@ -530,6 +530,7 @@ public class PopupContainerWithArrow extends AbstractFloatingView implements Dra
*/
public DragOptions.PreDragCondition createPreDragCondition() {
return new DragOptions.PreDragCondition() {
+
@Override
public boolean shouldStartDrag(double distanceDragged) {
return distanceDragged > mStartDragThreshold;
@@ -537,15 +538,27 @@ public class PopupContainerWithArrow extends AbstractFloatingView implements Dra
@Override
public void onPreDragStart(DropTarget.DragObject dragObject) {
- mOriginalIcon.setVisibility(INVISIBLE);
+ if (mIsAboveIcon) {
+ // Hide only the icon, keep the text visible.
+ mOriginalIcon.setIconVisible(false);
+ mOriginalIcon.setVisibility(VISIBLE);
+ } else {
+ // Hide both the icon and text.
+ mOriginalIcon.setVisibility(INVISIBLE);
+ }
}
@Override
public void onPreDragEnd(DropTarget.DragObject dragObject, boolean dragStarted) {
- if (!dragStarted) {
- mOriginalIcon.setVisibility(VISIBLE);
+ mOriginalIcon.setIconVisible(true);
+ if (dragStarted) {
+ // Make sure we keep the original icon hidden while it is being dragged.
+ mOriginalIcon.setVisibility(INVISIBLE);
+ } else {
mLauncher.getUserEventDispatcher().logDeepShortcutsOpen(mOriginalIcon);
if (!mIsAboveIcon) {
+ // Show the icon but keep the text hidden.
+ mOriginalIcon.setVisibility(VISIBLE);
mOriginalIcon.setTextVisibility(false);
}
}