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/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
index d3c3f56..4956f88 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
@@ -551,7 +551,7 @@
}
private boolean flingExpandsQs(float vel) {
- if (!mQsTouchAboveFalsingThreshold && mStatusBarState == StatusBarState.KEYGUARD) {
+ if (isBelowFalsingThreshold()) {
return false;
}
if (Math.abs(vel) < mFlingAnimationUtils.getMinVelocityPxPerSecond()) {
@@ -561,6 +561,10 @@
}
}
+ private boolean isBelowFalsingThreshold() {
+ return !mQsTouchAboveFalsingThreshold && mStatusBar.isFalsingThresholdNeeded();
+ }
+
private float getQsExpansionFraction() {
return Math.min(1f, (mQsExpansionHeight - mQsMinExpansionHeight)
/ (getTempQsMaxExpansion() - mQsMinExpansionHeight));
@@ -1125,9 +1129,16 @@
}
return;
}
+ boolean belowFalsingThreshold = isBelowFalsingThreshold();
+ if (belowFalsingThreshold) {
+ vel = 0;
+ }
mScrollView.setBlockFlinging(true);
ValueAnimator animator = ValueAnimator.ofFloat(mQsExpansionHeight, target);
mFlingAnimationUtils.apply(animator, mQsExpansionHeight, target, vel);
+ if (belowFalsingThreshold) {
+ animator.setDuration(350);
+ }
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
@@ -1732,9 +1743,9 @@
}
public void setEmptyDragAmount(float amount) {
- float factor = 1f;
+ float factor = 0.8f;
if (mNotificationStackScroller.getNotGoneChildCount() > 0) {
- factor = 0.6f;
+ factor = 0.4f;
} else if (!mStatusBar.hasActiveNotifications()) {
factor = 0.4f;
}