Tuned anti-falsing thresholds on the lockscreen
Also added logic to provide nicer animations when falsing.
In addition adapted the clock scale slightly if dragging
in the void.
Bug: 15433087
Change-Id: I4d8eb26cc81d22647ef4d2eca1e69b4994a7f1e2
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
index e818d23..a31984f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
@@ -479,7 +479,7 @@
* @return whether a fling should expands the panel; contracts otherwise
*/
protected boolean flingExpands(float vel, float vectorVel) {
- if (!mTouchAboveFalsingThreshold && mStatusBar.isFalsingThresholdNeeded()) {
+ if (isBelowFalsingThreshold()) {
return true;
}
if (Math.abs(vectorVel) < mFlingAnimationUtils.getMinVelocityPxPerSecond()) {
@@ -489,6 +489,10 @@
}
}
+ private boolean isBelowFalsingThreshold() {
+ return !mTouchAboveFalsingThreshold && mStatusBar.isFalsingThresholdNeeded();
+ }
+
protected void fling(float vel, boolean expand) {
cancelPeek();
float target = expand ? getMaxPanelHeight() : 0.0f;
@@ -509,7 +513,14 @@
mOverExpandedBeforeFling = getOverExpansionAmount() > 0f;
ValueAnimator animator = createHeightAnimator(target);
if (expand) {
+ boolean belowFalsingThreshold = isBelowFalsingThreshold();
+ if (belowFalsingThreshold) {
+ vel = 0;
+ }
mFlingAnimationUtils.apply(animator, mExpandedHeight, target, vel, getHeight());
+ if (belowFalsingThreshold) {
+ animator.setDuration(350);
+ }
} else {
mFlingAnimationUtils.applyDismissing(animator, mExpandedHeight, target, vel,
getHeight());