Fixed the color issue of Wi-Fi password EditText

- Use Material3 theme preset colors

Bug: 397878305
Flag: EXEMPT resource file only update
Test: Manual testing
Change-Id: I196db3c50a6f5edd8556073e12f4d3f6790f3bff
This commit is contained in:
Weng Su
2025-03-07 16:01:47 +08:00
parent dde80ef88b
commit de56c24ac0
2 changed files with 39 additions and 24 deletions

View File

@@ -17,12 +17,12 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:theme="@style/Theme.Network"
android:id="@+id/l_wifidialog"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="8dip"
android:theme="@style/Theme.AppCompat.DayNight">
android:paddingBottom="8dip">
<LinearLayout android:id="@+id/wep_warning_layout"
android:layout_width="match_parent"
@@ -58,19 +58,14 @@
android:orientation="horizontal">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/ssid_layout"
android:layout_width="0dp"
android:layout_height="wrap_content"
style="@style/Widget.Network.TextInputLayout.WifiConfig"
android:layout_weight="1"
android:hint="@string/wifi_ssid"
android:theme="@style/Theme.Settings"
android:textDirection="locale"
app:endIconMode="clear_text"
app:errorEnabled="true">
app:endIconMode="clear_text">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/ssid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/Widget.Network.TextInputLayout.WifiConfig.EditText"
android:inputType="textNoSuggestions"
android:singleLine="true"/>
</com.google.android.material.textfield.TextInputLayout>
@@ -346,18 +341,17 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/wifi_item">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/wifi_item_label"
android:text="@string/wifi_password"/>
<EditText android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/wifi_item_edit_content"
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/password_input_layout"
style="@style/Widget.Network.TextInputLayout.WifiConfig"
android:hint="@string/wifi_password"
app:endIconMode="password_toggle">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/password"
style="@style/Widget.Network.TextInputLayout.WifiConfig.EditText"
android:inputType="textPassword"
android:singleLine="true"/>
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
<LinearLayout android:id="@+id/show_password_layout"
@@ -368,13 +362,15 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/wifi_item_label"/>
style="@style/wifi_item_label"
android:visibility="gone"/>
<CheckBox android:id="@+id/show_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/wifi_item_content"
android:text="@string/wifi_show_password"/>
android:text="@string/wifi_show_password"
android:visibility="gone"/>
</LinearLayout>
</LinearLayout>

View File

@@ -69,6 +69,25 @@
<item name="android:scrollbarStyle">outsideOverlay</item>
</style>
<style name="Theme.Network" parent="@style/Theme.Material3.DynamicColors.DayNight">
<item name="textInputStyle">@style/Widget.Network.TextInputLayout</item>
</style>
<style name="Widget.Network.TextInputLayout"
parent="Widget.Material3.TextInputLayout.FilledBox"/>
<style name="Widget.Network.TextInputLayout.WifiConfig">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textAppearance">@android:style/TextAppearance.Material.Medium</item>
<item name="android:textAlignment">viewStart</item>
</style>
<style name="Widget.Network.TextInputLayout.WifiConfig.EditText">
<item name="android:textAppearance">@android:style/TextAppearance.Material.Body1</item>
<item name="android:maxLength">500</item>
</style>
<style name="wifi_item">
<item name="android:layout_marginTop">8dip</item>
<item name="android:layout_marginStart">8dip</item>