Merge "Add a reverse landscape layout for UDFPS" into sc-dev
This commit is contained in:
@@ -24,6 +24,7 @@ import android.content.Intent;
|
||||
import android.content.IntentSender;
|
||||
import android.os.storage.StorageManager;
|
||||
import android.util.Log;
|
||||
import android.view.Surface;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -241,4 +242,14 @@ public class BiometricUtils {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@code true} if the screen is going into a landscape mode and the angle is equal to
|
||||
* 270.
|
||||
* @param context Context that we use to get the display this context is associated with
|
||||
* @return True if the angle of the rotation is equal to 270.
|
||||
*/
|
||||
public static boolean isReverseLandscape(@NonNull Context context) {
|
||||
return context.getDisplay().getRotation() == Surface.ROTATION_270;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ import androidx.appcompat.app.AlertDialog;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.biometrics.BiometricEnrollSidecar;
|
||||
import com.android.settings.biometrics.BiometricErrorDialog;
|
||||
import com.android.settings.biometrics.BiometricUtils;
|
||||
import com.android.settings.biometrics.BiometricsEnrollEnrolling;
|
||||
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
|
||||
|
||||
@@ -98,6 +99,7 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
|
||||
private boolean mCanAssumeUdfps;
|
||||
@Nullable private ProgressBar mProgressBar;
|
||||
private ObjectAnimator mProgressAnim;
|
||||
private TextView mDescriptionText;
|
||||
private TextView mErrorText;
|
||||
private Interpolator mFastOutSlowInInterpolator;
|
||||
private Interpolator mLinearOutSlowInInterpolator;
|
||||
@@ -145,7 +147,11 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
|
||||
mCanAssumeUdfps = props.size() == 1 && props.get(0).isAnyUdfpsType();
|
||||
|
||||
if (mCanAssumeUdfps) {
|
||||
setContentView(R.layout.udfps_enroll_enrolling);
|
||||
if (BiometricUtils.isReverseLandscape(getApplicationContext())) {
|
||||
setContentView(R.layout.udfps_enroll_enrolling_land);
|
||||
} else {
|
||||
setContentView(R.layout.udfps_enroll_enrolling);
|
||||
}
|
||||
setDescriptionText(R.string.security_settings_udfps_enroll_start_message);
|
||||
} else {
|
||||
setContentView(R.layout.fingerprint_enroll_enrolling);
|
||||
|
||||
@@ -112,7 +112,11 @@ public class FingerprintEnrollFindSensor extends BiometricEnrollBase {
|
||||
|
||||
protected int getContentView() {
|
||||
if (mCanAssumeUdfps) {
|
||||
return R.layout.udfps_enroll_find_sensor_layout;
|
||||
if (BiometricUtils.isReverseLandscape(getApplicationContext())) {
|
||||
return R.layout.udfps_enroll_find_sensor_land;
|
||||
} else {
|
||||
return R.layout.udfps_enroll_find_sensor_layout;
|
||||
}
|
||||
}
|
||||
return R.layout.fingerprint_enroll_find_sensor;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user