summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/Launcher.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2016-07-21 18:57:21 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2016-07-21 18:57:21 +0000
commit4a44b6e59fc662568a92da36725e940e1dd844db (patch)
tree2386b84711d4ab58a10fe7db22ae01b20a6b4242 /src/com/android/launcher3/Launcher.java
parent5aa2714959405043639cb2d0b8d9ab8c6eef0bd2 (diff)
parent71b3d1c38e028d7c1f625543a30993af1193b321 (diff)
downloadandroid_packages_apps_Trebuchet-4a44b6e59fc662568a92da36725e940e1dd844db.tar.gz
android_packages_apps_Trebuchet-4a44b6e59fc662568a92da36725e940e1dd844db.tar.bz2
android_packages_apps_Trebuchet-4a44b6e59fc662568a92da36725e940e1dd844db.zip
Merge "Optimizing open shortcuts container lookep" into ub-launcher3-calgary
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r--src/com/android/launcher3/Launcher.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index f57753bde..f8b7c279c 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -3133,7 +3133,15 @@ public class Launcher extends Activity
* @return The open shortcuts container, or null if there is none
*/
public DeepShortcutsContainer getOpenShortcutsContainer() {
- return (DeepShortcutsContainer) mDragLayer.findViewById(R.id.deep_shortcuts_container);
+ // Iterate in reverse order. Shortcuts container is added later to the dragLayer,
+ // and will be one of the last views.
+ for (int i = mDragLayer.getChildCount() - 1; i >= 0; i--) {
+ View child = mDragLayer.getChildAt(i);
+ if (child instanceof DeepShortcutsContainer) {
+ return (DeepShortcutsContainer) child;
+ }
+ }
+ return null;
}
@Override