Loading packages/SystemUI/src/com/android/systemui/biometrics/UdfpsAnimation.java +14 −0 Original line number Diff line number Diff line Loading @@ -52,4 +52,18 @@ public abstract class UdfpsAnimation extends Drawable { public void setAlpha(int alpha) { mFingerprintDrawable.setAlpha(alpha); } /** * @return The amount of padding that's needed on each side of the sensor, in pixels. */ public int getPaddingX() { return 0; } /** * @return The amount of padding that's needed on each side of the sensor, in pixels. */ public int getPaddingY() { return 0; } } packages/SystemUI/src/com/android/systemui/biometrics/UdfpsAnimationEnroll.java +15 −0 Original line number Diff line number Diff line Loading @@ -70,6 +70,9 @@ public class UdfpsAnimationEnroll extends UdfpsAnimation { @Override public void draw(@NonNull Canvas canvas) { canvas.save(); canvas.translate(getPaddingX(), getPaddingY()); final boolean isNightMode = (mContext.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_YES) != 0; if (!isNightMode) { Loading @@ -78,6 +81,18 @@ public class UdfpsAnimationEnroll extends UdfpsAnimation { } } mFingerprintDrawable.draw(canvas); canvas.restore(); } @Override public int getPaddingX() { return (int) Math.ceil(SHADOW_RADIUS); } @Override public int getPaddingY() { return (int) Math.ceil(SHADOW_RADIUS); } @Override Loading packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java +11 −7 Original line number Diff line number Diff line Loading @@ -242,12 +242,15 @@ public class UdfpsController implements DozeReceiver, HbmCallback { } } private WindowManager.LayoutParams computeLayoutParams() { private WindowManager.LayoutParams computeLayoutParams(@Nullable UdfpsAnimation animation) { final int paddingX = animation != null ? animation.getPaddingX() : 0; final int paddingY = animation != null ? animation.getPaddingY() : 0; // Default dimensions assume portrait mode. mCoreLayoutParams.x = mSensorProps.sensorLocationX - mSensorProps.sensorRadius; mCoreLayoutParams.y = mSensorProps.sensorLocationY - mSensorProps.sensorRadius; mCoreLayoutParams.height = 2 * mSensorProps.sensorRadius; mCoreLayoutParams.width = 2 * mSensorProps.sensorRadius; mCoreLayoutParams.x = mSensorProps.sensorLocationX - mSensorProps.sensorRadius - paddingX; mCoreLayoutParams.y = mSensorProps.sensorLocationY - mSensorProps.sensorRadius - paddingY; mCoreLayoutParams.height = 2 * mSensorProps.sensorRadius + 2 * paddingX; mCoreLayoutParams.width = 2 * mSensorProps.sensorRadius + 2 * paddingY; Point p = new Point(); // Gets the size based on the current rotation of the display. Loading Loading @@ -289,8 +292,9 @@ public class UdfpsController implements DozeReceiver, HbmCallback { if (!mIsOverlayShowing) { try { Log.v(TAG, "showUdfpsOverlay | adding window"); mView.setUdfpsAnimation(getUdfpsAnimationForReason(reason)); mWindowManager.addView(mView, computeLayoutParams()); final UdfpsAnimation animation = getUdfpsAnimationForReason(reason); mView.setUdfpsAnimation(animation); mWindowManager.addView(mView, computeLayoutParams(animation)); mView.setOnTouchListener(mOnTouchListener); mIsOverlayShowing = true; } catch (RuntimeException e) { Loading packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.java +0 −1 Original line number Diff line number Diff line Loading @@ -56,7 +56,6 @@ public class UdfpsView extends FrameLayout implements DozeReceiver, UdfpsIllumin @NonNull private final RectF mSensorRect; @NonNull private final Paint mDebugTextPaint; // Used to obtain the sensor location. @NonNull private FingerprintSensorPropertiesInternal mSensorProps; Loading Loading
packages/SystemUI/src/com/android/systemui/biometrics/UdfpsAnimation.java +14 −0 Original line number Diff line number Diff line Loading @@ -52,4 +52,18 @@ public abstract class UdfpsAnimation extends Drawable { public void setAlpha(int alpha) { mFingerprintDrawable.setAlpha(alpha); } /** * @return The amount of padding that's needed on each side of the sensor, in pixels. */ public int getPaddingX() { return 0; } /** * @return The amount of padding that's needed on each side of the sensor, in pixels. */ public int getPaddingY() { return 0; } }
packages/SystemUI/src/com/android/systemui/biometrics/UdfpsAnimationEnroll.java +15 −0 Original line number Diff line number Diff line Loading @@ -70,6 +70,9 @@ public class UdfpsAnimationEnroll extends UdfpsAnimation { @Override public void draw(@NonNull Canvas canvas) { canvas.save(); canvas.translate(getPaddingX(), getPaddingY()); final boolean isNightMode = (mContext.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_YES) != 0; if (!isNightMode) { Loading @@ -78,6 +81,18 @@ public class UdfpsAnimationEnroll extends UdfpsAnimation { } } mFingerprintDrawable.draw(canvas); canvas.restore(); } @Override public int getPaddingX() { return (int) Math.ceil(SHADOW_RADIUS); } @Override public int getPaddingY() { return (int) Math.ceil(SHADOW_RADIUS); } @Override Loading
packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java +11 −7 Original line number Diff line number Diff line Loading @@ -242,12 +242,15 @@ public class UdfpsController implements DozeReceiver, HbmCallback { } } private WindowManager.LayoutParams computeLayoutParams() { private WindowManager.LayoutParams computeLayoutParams(@Nullable UdfpsAnimation animation) { final int paddingX = animation != null ? animation.getPaddingX() : 0; final int paddingY = animation != null ? animation.getPaddingY() : 0; // Default dimensions assume portrait mode. mCoreLayoutParams.x = mSensorProps.sensorLocationX - mSensorProps.sensorRadius; mCoreLayoutParams.y = mSensorProps.sensorLocationY - mSensorProps.sensorRadius; mCoreLayoutParams.height = 2 * mSensorProps.sensorRadius; mCoreLayoutParams.width = 2 * mSensorProps.sensorRadius; mCoreLayoutParams.x = mSensorProps.sensorLocationX - mSensorProps.sensorRadius - paddingX; mCoreLayoutParams.y = mSensorProps.sensorLocationY - mSensorProps.sensorRadius - paddingY; mCoreLayoutParams.height = 2 * mSensorProps.sensorRadius + 2 * paddingX; mCoreLayoutParams.width = 2 * mSensorProps.sensorRadius + 2 * paddingY; Point p = new Point(); // Gets the size based on the current rotation of the display. Loading Loading @@ -289,8 +292,9 @@ public class UdfpsController implements DozeReceiver, HbmCallback { if (!mIsOverlayShowing) { try { Log.v(TAG, "showUdfpsOverlay | adding window"); mView.setUdfpsAnimation(getUdfpsAnimationForReason(reason)); mWindowManager.addView(mView, computeLayoutParams()); final UdfpsAnimation animation = getUdfpsAnimationForReason(reason); mView.setUdfpsAnimation(animation); mWindowManager.addView(mView, computeLayoutParams(animation)); mView.setOnTouchListener(mOnTouchListener); mIsOverlayShowing = true; } catch (RuntimeException e) { Loading
packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.java +0 −1 Original line number Diff line number Diff line Loading @@ -56,7 +56,6 @@ public class UdfpsView extends FrameLayout implements DozeReceiver, UdfpsIllumin @NonNull private final RectF mSensorRect; @NonNull private final Paint mDebugTextPaint; // Used to obtain the sensor location. @NonNull private FingerprintSensorPropertiesInternal mSensorProps; Loading