Fix forgot password layout text alignment and change theme to show
correct text colour in night mode
Test: manual test
Fixes: b/206761685
Change-Id: Idccf40357a6b5f33ece89bc2772fa6ca51e4596a
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index a3a6fcf..699047f 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -2313,7 +2313,7 @@
android:theme="@style/GlifTheme.Light"/>
<activity android:name=".password.ForgotPasswordActivity"
- android:theme="@style/GlifV3Theme.Light"
+ android:theme="@style/GlifV3Theme.DayNight"
android:exported="false"/>
<activity android:name=".biometrics.face.FaceEnrollParentalConsent"
diff --git a/res/layout/forgot_password_activity.xml b/res/layout/forgot_password_activity.xml
index 7973251..d58ce24 100644
--- a/res/layout/forgot_password_activity.xml
+++ b/res/layout/forgot_password_activity.xml
@@ -35,7 +35,6 @@
android:id="@+id/forgot_password_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:gravity="center"
android:text="@string/forgot_password_text" />
</LinearLayout>
</com.google.android.setupdesign.GlifLayout>
diff --git a/src/com/android/settings/password/ForgotPasswordActivity.java b/src/com/android/settings/password/ForgotPasswordActivity.java
index d9db335..9afda18 100644
--- a/src/com/android/settings/password/ForgotPasswordActivity.java
+++ b/src/com/android/settings/password/ForgotPasswordActivity.java
@@ -33,6 +33,8 @@
import com.google.android.setupcompat.template.FooterBarMixin;
import com.google.android.setupcompat.template.FooterButton;
import com.google.android.setupdesign.GlifLayout;
+import com.google.android.setupdesign.util.ContentStyler;
+import com.google.android.setupdesign.util.ThemeHelper;
/**
* An activity that asks the user to contact their admin to get assistance with forgotten password.
@@ -65,6 +67,11 @@
.build()
);
+ if (ThemeHelper.shouldApplyMaterialYouStyle(this)) {
+ ContentStyler.applyBodyPartnerCustomizationStyle(
+ layout.findViewById(R.id.forgot_password_text));
+ }
+
layout.setHeaderText(devicePolicyManager.getResources().getString(
FORGOT_PASSWORD_TITLE, () -> getString(R.string.forgot_password_title)));