Update udfps fade + padding

- Make sure udfps doesn't overlap notification shade
by giving it a 48dp buffer from the notification shade
- Start fading out the udfps icon faster when swiping
up to the bouncer
- Include now playing text in the buffer for the lock icon position

Test: manual
Bug: 192926771
Fixes: 193193900
Change-Id: I3faf73548c9990886237c28d28e7e8b0f9e8686e
This commit is contained in:
Beverly
2021-07-08 17:38:49 -04:00
committed by Beverly Tai
parent 1d2cbb6f50
commit b7ce2600b4
4 changed files with 25 additions and 7 deletions

View File

@@ -681,6 +681,9 @@
<!-- The height of the divider between the individual notifications. -->
<dimen name="notification_divider_height">2dp</dimen>
<!-- The min distance the notifications should be from the lock icon on the lock screen. -->
<dimen name="min_lock_icon_padding">48dp</dimen>
<!-- The corner radius of the shadow behind the notification. -->
<dimen name="notification_shadow_radius">0dp</dimen>

View File

@@ -98,7 +98,8 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
private float mHeightPixels;
private float mWidthPixels;
private float mDensity;
private int mKgBottomAreaHeight;
private int mAmbientIndicationHeight; // in pixels
private int mKgIndicationHeight; // in pixels
private boolean mShowUnlockIcon;
private boolean mShowLockIcon;
@@ -280,7 +281,7 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
mWidthPixels = metrics.widthPixels;
mHeightPixels = metrics.heightPixels;
mDensity = metrics.density;
mKgBottomAreaHeight = mView.getContext().getResources().getDimensionPixelSize(
mKgIndicationHeight = mView.getContext().getResources().getDimensionPixelSize(
R.dimen.keyguard_indication_margin_bottom)
+ mView.getContext().getResources().getDimensionPixelSize(
R.dimen.keyguard_indication_bottom_padding);
@@ -295,15 +296,24 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
} else {
final float distAboveKgBottomArea = 12 * mDensity;
final float radius = 36 * mDensity;
final int kgBottomAreaHeight = Math.max(mKgIndicationHeight, mAmbientIndicationHeight);
mView.setCenterLocation(
new PointF(mWidthPixels / 2,
mHeightPixels - mKgBottomAreaHeight - distAboveKgBottomArea
mHeightPixels - kgBottomAreaHeight - distAboveKgBottomArea
- radius / 2), (int) radius);
}
mView.getHitRect(mSensorTouchLocation);
}
/**
* Set the location of ambient indication if showing (ie: now playing)
*/
public void setAmbientIndicationBottomPadding(int ambientIndicationBottomPadding) {
mAmbientIndicationHeight = ambientIndicationBottomPadding;
updateLockIconLocation();
}
@Override
public void dump(@NonNull FileDescriptor fd, @NonNull PrintWriter pw, @NonNull String[] args) {
pw.println("mUdfpsEnrolled: " + mUdfpsEnrolled);

View File

@@ -41,6 +41,7 @@ import com.android.systemui.util.concurrency.DelayableExecutor;
import java.io.FileDescriptor;
import java.io.PrintWriter;
/**
* Class that coordinates non-HBM animations during keyguard authentication.
*
@@ -207,7 +208,7 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud
return true;
}
if (mInputBouncerHiddenAmount < .4f || mIsBouncerVisible) {
if (mInputBouncerHiddenAmount < .5f || mIsBouncerVisible) {
return true;
}
@@ -279,8 +280,9 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud
private void updateAlpha() {
// fade icon on transition to showing bouncer
int alpha = mShowingUdfpsBouncer ? 255
: Math.abs((int) MathUtils.constrainedMap(0f, 255f, .4f, .7f,
mInputBouncerHiddenAmount));
: (int) MathUtils.constrain(
MathUtils.map(.5f, .9f, 0f, 255f, mInputBouncerHiddenAmount),
0f, 255f);
alpha *= (1.0f - mTransitionToFullShadeProgress);
mView.setUnpausedAlpha(alpha);
}

View File

@@ -1350,7 +1350,8 @@ public class NotificationPanelViewController extends PanelViewController {
float lockIconPadding = 0;
if (mLockIconViewController.getTop() != 0) {
lockIconPadding = mStatusBar.getDisplayHeight() - mLockIconViewController.getTop();
lockIconPadding = mStatusBar.getDisplayHeight() - mLockIconViewController.getTop()
+ mResources.getDimensionPixelSize(R.dimen.min_lock_icon_padding);
}
float bottomPadding = Math.max(mIndicationBottomPadding, mAmbientIndicationBottomPadding);
@@ -3627,6 +3628,8 @@ public class NotificationPanelViewController extends PanelViewController {
public void setAmbientIndicationBottomPadding(int ambientIndicationBottomPadding) {
if (mAmbientIndicationBottomPadding != ambientIndicationBottomPadding) {
mAmbientIndicationBottomPadding = ambientIndicationBottomPadding;
mLockIconViewController.setAmbientIndicationBottomPadding(
mAmbientIndicationBottomPadding);
updateMaxDisplayedNotifications(true);
}
}