Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f8d9e899 authored by Danesh M's avatar Danesh M Committed by Gerrit Code Review
Browse files

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
parent 71dec8d0
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -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;
    }
+2 −0
Original line number Diff line number Diff line
@@ -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;
+1 −2
Original line number Diff line number Diff line
@@ -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());
    }
+1 −0
Original line number Diff line number Diff line
@@ -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) {