summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/DragLayer.java
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2014-04-08 15:34:17 -0700
committerAdam Cohen <adamcohen@google.com>2014-04-08 16:56:09 -0700
commitb670f195ffb7b4a0519fd0b337b68f7412159414 (patch)
tree4a510cbbf77c61c60b794af00abab76c33d5d4a7 /src/com/android/launcher3/DragLayer.java
parent2d783ce2f4b2e507bead0d723f0edcdf902dbd46 (diff)
downloadandroid_packages_apps_Trebuchet-b670f195ffb7b4a0519fd0b337b68f7412159414.tar.gz
android_packages_apps_Trebuchet-b670f195ffb7b4a0519fd0b337b68f7412159414.tar.bz2
android_packages_apps_Trebuchet-b670f195ffb7b4a0519fd0b337b68f7412159414.zip
Ensure the intro view is always the top view in the draglayer if it is present
-> On devices post-api-16, we can achieve this just with child drawing order but on level 16 devices, child drawing order doesn't give us touch dispatch which is problematic for the intro screen. issue 13796017 Change-Id: Ibf89ae91d8489f2de1eb9c8f235a0e6e6aed1847
Diffstat (limited to 'src/com/android/launcher3/DragLayer.java')
-rw-r--r--src/com/android/launcher3/DragLayer.java23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/com/android/launcher3/DragLayer.java b/src/com/android/launcher3/DragLayer.java
index cd51c96e1..c54db0127 100644
--- a/src/com/android/launcher3/DragLayer.java
+++ b/src/com/android/launcher3/DragLayer.java
@@ -122,10 +122,14 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang
setInsets(child, mInsets, new Rect());
}
- public void showOverlayView(View introScreen) {
+ public void showOverlayView(View overlayView) {
LayoutParams lp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
- mOverlayView = introScreen;
- addView(introScreen, lp);
+ mOverlayView = overlayView;
+ addView(overlayView, lp);
+
+ // ensure that the overlay view stays on top. we can't use drawing order for this
+ // because in API level 16 touch dispatch doesn't respect drawing order.
+ mOverlayView.bringToFront();
}
public void dismissOverlayView() {
@@ -774,6 +778,11 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang
@Override
public void onChildViewAdded(View parent, View child) {
+ if (mOverlayView != null) {
+ // ensure that the overlay view stays on top. we can't use drawing order for this
+ // because in API level 16 touch dispatch doesn't respect drawing order.
+ mOverlayView.bringToFront();
+ }
updateChildIndices();
}
@@ -785,6 +794,11 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang
@Override
public void bringChildToFront(View child) {
super.bringChildToFront(child);
+ if (child != mOverlayView && mOverlayView != null) {
+ // ensure that the overlay view stays on top. we can't use drawing order for this
+ // because in API level 16 touch dispatch doesn't respect drawing order.
+ mOverlayView.bringToFront();
+ }
updateChildIndices();
}
@@ -792,8 +806,7 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang
mTopViewIndex = -1;
int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
- if (getChildAt(i) instanceof DragView ||
- getChildAt(i) == mOverlayView) {
+ if (getChildAt(i) instanceof DragView) {
mTopViewIndex = i;
}
}