diff options
author | Vadim Tryshev <vadimt@google.com> | 2018-11-15 15:13:53 -0800 |
---|---|---|
committer | Vadim Tryshev <vadimt@google.com> | 2018-11-26 14:30:52 -0800 |
commit | fdfeb6dd3bcd737c5f7ba513f0e45ab343e20d5f (patch) | |
tree | 1cd4cef660f6119fcc0e6fe031d6ddfc2cc97dbc /src/com/android/launcher3/popup/PopupContainerWithArrow.java | |
parent | b2f9c1f0c12d730bcd94e9b7028c2b3b98fb1ba9 (diff) | |
download | android_packages_apps_Trebuchet-fdfeb6dd3bcd737c5f7ba513f0e45ab343e20d5f.tar.gz android_packages_apps_Trebuchet-fdfeb6dd3bcd737c5f7ba513f0e45ab343e20d5f.tar.bz2 android_packages_apps_Trebuchet-fdfeb6dd3bcd737c5f7ba513f0e45ab343e20d5f.zip |
Moving Pause button to the left of the context menu header
See this mock:
https://www.google.com/url?q=https://docs.google.com/presentation/d/1AepsnLeKcRhjMW35SkB5yMKO3u6waigug8Tyfe0LO5o/edit%23slide%3Did.g455d187f2a_0_45&sa=D&ust=1542320415002000&usg=AFQjCNH-jsy5THG1WqxjeYbj628QFMJKvQ
Bug: 117888000
Test: Manual
Change-Id: I1edbc569347f09f0806ad6749735c3dec198277a
Diffstat (limited to 'src/com/android/launcher3/popup/PopupContainerWithArrow.java')
-rw-r--r-- | src/com/android/launcher3/popup/PopupContainerWithArrow.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/com/android/launcher3/popup/PopupContainerWithArrow.java b/src/com/android/launcher3/popup/PopupContainerWithArrow.java index 12319f75e..37a000da2 100644 --- a/src/com/android/launcher3/popup/PopupContainerWithArrow.java +++ b/src/com/android/launcher3/popup/PopupContainerWithArrow.java @@ -391,7 +391,8 @@ public class PopupContainerWithArrow extends ArrowPopup implements DragSource, } private void initializeSystemShortcut(int resId, ViewGroup container, SystemShortcut info) { - View view = inflateAndAdd(resId, container); + View view = inflateAndAdd( + resId, container, getInsertIndexForSystemShortcut(container, info)); if (view instanceof DeepShortcutView) { // Expanded system shortcut, with both icon and text shown on white background. final DeepShortcutView shortcutView = (DeepShortcutView) view; @@ -406,6 +407,17 @@ public class PopupContainerWithArrow extends ArrowPopup implements DragSource, } /** + * Returns an index for inserting a shortcut into a container. + */ + private int getInsertIndexForSystemShortcut(ViewGroup container, SystemShortcut shortcut) { + final View separator = container.findViewById(R.id.separator); + + return separator != null && shortcut.isLeftGroup() ? + container.indexOfChild(separator) : + container.getChildCount(); + } + + /** * Determines when the deferred drag should be started. * * Current behavior: |