Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 23b95b41 authored by Milton Wu's avatar Milton Wu
Browse files

Recreate fingerprint setup if degree 0 to 180

Recreate animation on fingerprint setup page when screen orientation is
changed from 0 to 180, or 180 to 0.

Bug: 232187001
Test: Manually rotate screen for 4 orientation, and make sure animation
      orientation is correct
Change-Id: I75687bc8500cf5a48be6da6ef4245b12b63e774e
parent d3754562
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -111,6 +111,11 @@ public class FingerprintEnrollFindSensor extends BiometricEnrollBase implements
                    lottieAnimationView.setVisibility(View.GONE);
                    lottieAnimationViewPortrait.setVisibility(View.VISIBLE);
                    break;
                case Surface.ROTATION_180:
                    lottieAnimationView.setVisibility(View.VISIBLE);
                    lottieAnimationView.setRotation(180);
                    lottieAnimationViewPortrait.setVisibility(View.GONE);
                    break;
                case Surface.ROTATION_270:
                    lottieAnimationView.setVisibility(View.GONE);
                    lottieAnimationViewPortrait.setVisibility(View.VISIBLE);
@@ -342,10 +347,7 @@ public class FingerprintEnrollFindSensor extends BiometricEnrollBase implements
            @Override
            public void onOrientationChanged(int orientation) {
                final int currentRotation = getDisplay().getRotation();
                if ((mPreviousRotation == Surface.ROTATION_90
                        && currentRotation == Surface.ROTATION_270) || (
                        mPreviousRotation == Surface.ROTATION_270
                                && currentRotation == Surface.ROTATION_90)) {
                if ((currentRotation + 2) % 4 == mPreviousRotation) {
                    mPreviousRotation = currentRotation;
                    recreate();
                }