Loading packages/SystemUI/res/values/dimens.xml +3 −0 Original line number Diff line number Diff line Loading @@ -450,6 +450,9 @@ <!-- TrustDrawable: Thickness of the circle --> <dimen name="trust_circle_thickness">2dp</dimen> <!-- How much two taps can be apart to still be recognized as a double tap on the lockscreen --> <dimen name="double_tap_slop">32dp</dimen> <!-- Margin on the right side of the system icon group on Keyguard. --> <fraction name="battery_button_height_fraction">10.5%</fraction> Loading packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java +5 −1 Original line number Diff line number Diff line Loading @@ -313,7 +313,11 @@ public class FalsingManager implements SensorEventListener { mDataCollector.onNotificationActive(); } public void onNotificationDoubleTap() { public void onNotificationDoubleTap(boolean accepted, float dx, float dy) { if (FalsingLog.ENABLED) { FalsingLog.i("onNotificationDoubleTap", "accepted=" + accepted + " dx=" + dx + " dy=" + dy + " (px)"); } mDataCollector.onNotificationDoubleTap(); } Loading packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java +29 −3 Original line number Diff line number Diff line Loading @@ -110,6 +110,10 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView private float mDownY; private final float mTouchSlop; private float mActivationX; private float mActivationY; private final float mDoubleTapSlop; private OnActivatedListener mOnActivatedListener; private final Interpolator mSlowOutFastInInterpolator; Loading Loading @@ -171,6 +175,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView public ActivatableNotificationView(Context context, AttributeSet attrs) { super(context, attrs); mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop(); mDoubleTapSlop = context.getResources().getDimension(R.dimen.double_tap_slop); mSlowOutFastInInterpolator = new PathInterpolator(0.8f, 0.0f, 0.6f, 1.0f); mSlowOutLinearInInterpolator = new PathInterpolator(0.8f, 0.0f, 1.0f, 1.0f); setClipChildren(false); Loading Loading @@ -232,7 +237,6 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView boolean wasActivated = mActivated; result = handleTouchEventDimmed(event); if (wasActivated && result && event.getAction() == MotionEvent.ACTION_UP) { mFalsingManager.onNotificationDoubleTap(); removeCallbacks(mTapTimeoutRunnable); } } else { Loading Loading @@ -283,10 +287,22 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView if (!mActivated) { makeActive(); postDelayed(mTapTimeoutRunnable, DOUBLETAP_TIMEOUT_MS); mActivationX = event.getX(); mActivationY = event.getY(); } else { boolean withinDoubleTapSlop = isWithinDoubleTapSlop(event); mFalsingManager.onNotificationDoubleTap( withinDoubleTapSlop, event.getX() - mActivationX, event.getY() - mActivationY); if (withinDoubleTapSlop) { if (!performClick()) { return false; } } else { makeInactive(true /* animate */); mTrackTouch = false; } } } else { makeInactive(true /* animate */); Loading Loading @@ -393,6 +409,16 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView && Math.abs(event.getY() - mDownY) < mTouchSlop; } private boolean isWithinDoubleTapSlop(MotionEvent event) { if (!mActivated) { // If we're not activated there's no double tap slop to satisfy. return true; } return Math.abs(event.getX() - mActivationX) < mDoubleTapSlop && Math.abs(event.getY() - mActivationY) < mDoubleTapSlop; } public void setDimmed(boolean dimmed, boolean fade) { if (mDimmed != dimmed) { mDimmed = dimmed; Loading Loading
packages/SystemUI/res/values/dimens.xml +3 −0 Original line number Diff line number Diff line Loading @@ -450,6 +450,9 @@ <!-- TrustDrawable: Thickness of the circle --> <dimen name="trust_circle_thickness">2dp</dimen> <!-- How much two taps can be apart to still be recognized as a double tap on the lockscreen --> <dimen name="double_tap_slop">32dp</dimen> <!-- Margin on the right side of the system icon group on Keyguard. --> <fraction name="battery_button_height_fraction">10.5%</fraction> Loading
packages/SystemUI/src/com/android/systemui/classifier/FalsingManager.java +5 −1 Original line number Diff line number Diff line Loading @@ -313,7 +313,11 @@ public class FalsingManager implements SensorEventListener { mDataCollector.onNotificationActive(); } public void onNotificationDoubleTap() { public void onNotificationDoubleTap(boolean accepted, float dx, float dy) { if (FalsingLog.ENABLED) { FalsingLog.i("onNotificationDoubleTap", "accepted=" + accepted + " dx=" + dx + " dy=" + dy + " (px)"); } mDataCollector.onNotificationDoubleTap(); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java +29 −3 Original line number Diff line number Diff line Loading @@ -110,6 +110,10 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView private float mDownY; private final float mTouchSlop; private float mActivationX; private float mActivationY; private final float mDoubleTapSlop; private OnActivatedListener mOnActivatedListener; private final Interpolator mSlowOutFastInInterpolator; Loading Loading @@ -171,6 +175,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView public ActivatableNotificationView(Context context, AttributeSet attrs) { super(context, attrs); mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop(); mDoubleTapSlop = context.getResources().getDimension(R.dimen.double_tap_slop); mSlowOutFastInInterpolator = new PathInterpolator(0.8f, 0.0f, 0.6f, 1.0f); mSlowOutLinearInInterpolator = new PathInterpolator(0.8f, 0.0f, 1.0f, 1.0f); setClipChildren(false); Loading Loading @@ -232,7 +237,6 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView boolean wasActivated = mActivated; result = handleTouchEventDimmed(event); if (wasActivated && result && event.getAction() == MotionEvent.ACTION_UP) { mFalsingManager.onNotificationDoubleTap(); removeCallbacks(mTapTimeoutRunnable); } } else { Loading Loading @@ -283,10 +287,22 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView if (!mActivated) { makeActive(); postDelayed(mTapTimeoutRunnable, DOUBLETAP_TIMEOUT_MS); mActivationX = event.getX(); mActivationY = event.getY(); } else { boolean withinDoubleTapSlop = isWithinDoubleTapSlop(event); mFalsingManager.onNotificationDoubleTap( withinDoubleTapSlop, event.getX() - mActivationX, event.getY() - mActivationY); if (withinDoubleTapSlop) { if (!performClick()) { return false; } } else { makeInactive(true /* animate */); mTrackTouch = false; } } } else { makeInactive(true /* animate */); Loading Loading @@ -393,6 +409,16 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView && Math.abs(event.getY() - mDownY) < mTouchSlop; } private boolean isWithinDoubleTapSlop(MotionEvent event) { if (!mActivated) { // If we're not activated there's no double tap slop to satisfy. return true; } return Math.abs(event.getX() - mActivationX) < mDoubleTapSlop && Math.abs(event.getY() - mActivationY) < mDoubleTapSlop; } public void setDimmed(boolean dimmed, boolean fade) { if (mDimmed != dimmed) { mDimmed = dimmed; Loading