Merge "Fix SensorRect location" into sc-dev
This commit is contained in:
@@ -69,9 +69,6 @@ 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) {
|
||||
@@ -80,8 +77,6 @@ public class UdfpsAnimationEnroll extends UdfpsAnimation {
|
||||
}
|
||||
}
|
||||
mFingerprintDrawable.draw(canvas);
|
||||
|
||||
canvas.restore();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -114,4 +114,18 @@ public class UdfpsAnimationView extends View implements DozeReceiver,
|
||||
((UdfpsAnimationEnroll) mUdfpsAnimation).onEnrollmentHelp();
|
||||
}
|
||||
}
|
||||
|
||||
public int getPaddingX() {
|
||||
if (mUdfpsAnimation == null) {
|
||||
return 0;
|
||||
}
|
||||
return mUdfpsAnimation.getPaddingX();
|
||||
}
|
||||
|
||||
public int getPaddingY() {
|
||||
if (mUdfpsAnimation == null) {
|
||||
return 0;
|
||||
}
|
||||
return mUdfpsAnimation.getPaddingY();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +140,11 @@ public class UdfpsView extends FrameLayout implements DozeReceiver, UdfpsIllumin
|
||||
@Override
|
||||
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
|
||||
super.onLayout(changed, left, top, right, bottom);
|
||||
mSensorRect.set(0, 0, 2 * mSensorProps.sensorRadius, 2 * mSensorProps.sensorRadius);
|
||||
mSensorRect.set(0 + mAnimationView.getPaddingX(),
|
||||
0 + mAnimationView.getPaddingY(),
|
||||
2 * mSensorProps.sensorRadius + mAnimationView.getPaddingX(),
|
||||
2 * mSensorProps.sensorRadius + mAnimationView.getPaddingY());
|
||||
|
||||
mHbmSurfaceView.onSensorRectUpdated(new RectF(mSensorRect));
|
||||
mAnimationView.onSensorRectUpdated(new RectF(mSensorRect));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user