From f8d9e899dc835e2a0308cea7af81fae4dbdaa67d Mon Sep 17 00:00:00 2001 From: Danesh M Date: Wed, 6 Apr 2016 14:18:05 -0700 Subject: Lockscreen target fixes - Ensure icon's raw screen coordinates are used to calculate intersection. - Ensure we expand/collapse when running hint animation for unlock due to bounce. - Ensure we don't animate window bound changes. Change-Id: Id18e2237c1ce9bfb2bcaa669934a4b3af4341521 --- .../android/systemui/statusbar/phone/KeyguardAffordanceHelper.java | 7 ++++--- .../android/systemui/statusbar/phone/KeyguardBottomAreaView.java | 2 ++ .../android/systemui/statusbar/phone/NotificationPanelView.java | 3 +-- .../src/com/android/systemui/statusbar/phone/PhoneStatusBar.java | 1 + 4 files changed, 8 insertions(+), 5 deletions(-) (limited to 'packages/SystemUI') diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java index d0e8fbd..e71d165 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java @@ -128,7 +128,7 @@ public class KeyguardAffordanceHelper { if (mMotionCancelled && action != MotionEvent.ACTION_DOWN) { return false; } - final float y = event.getY(); + final float y = event.getRawY(); final float x = event.getX(); boolean isUp = false; @@ -146,7 +146,7 @@ public class KeyguardAffordanceHelper { } startSwiping(targetView); mInitialTouchX = x; - mInitialTouchYRaw = event.getRawY(); + mInitialTouchYRaw = y; mTranslationOnDown = mTranslation; initVelocityTracker(); trackMovement(event); @@ -211,8 +211,9 @@ public class KeyguardAffordanceHelper { } private boolean isOnIcon(View icon, float x, float y) { + int[] location = icon.getLocationOnScreen(); float iconX = icon.getX() + icon.getWidth() / 2.0f; - float iconY = icon.getY() + icon.getHeight() / 2.0f; + float iconY = location[1] + icon.getHeight() / 2.0f; double distance = Math.hypot(x - iconX, y - iconY); return distance <= mTouchTargetSize / 2; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java index 5303377..31b8f34 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java @@ -217,6 +217,8 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL mWindowLayoutParams.flags = WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; + mWindowLayoutParams.privateFlags = + WindowManager.LayoutParams.PRIVATE_FLAG_NO_MOVE_ANIMATION; mWindowLayoutParams.width = WindowManager.LayoutParams.MATCH_PARENT; mWindowLayoutParams.height = WindowManager.LayoutParams.WRAP_CONTENT; mWindowLayoutParams.format = PixelFormat.TRANSPARENT; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java index 15f3d2c..5aa6416 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -453,7 +453,6 @@ public class NotificationPanelView extends PanelView implements // Ensure we collapse and clear fade if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) { - mKeyguardBottomArea.expand(false); mKeyguardBottomArea.setBackground(null); } @@ -967,7 +966,6 @@ public class NotificationPanelView extends PanelView implements int action = event.getActionMasked(); if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) { - mKeyguardBottomArea.expand(false); mKeyguardBottomArea.setBackground(null); } @@ -2280,6 +2278,7 @@ public class NotificationPanelView extends PanelView implements @Override protected void startUnlockHintAnimation() { + mKeyguardBottomArea.expand(true); super.startUnlockHintAnimation(); startHighlightIconAnimation(getCenterIcon()); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index 20ecf6d..ca3d1bf 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -4751,6 +4751,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, public void onHintFinished() { // Delay the reset a bit so the user can read the text. mKeyguardIndicationController.hideTransientIndicationDelayed(HINT_RESET_DELAY_MS); + mKeyguardBottomArea.expand(false); } public void onCameraHintStarted(String hint) { -- cgit v1.1