Imporve UI of system langauge list

Bug: b/274721595
Test: Manual test
Change-Id: I951de80de4ac40df48829d3f23c0f1c8d98e0137
This commit is contained in:
tom hsu
2023-03-23 00:23:10 +08:00
parent fced4027ab
commit 99037a8bf8
3 changed files with 46 additions and 43 deletions

View File

@@ -15,21 +15,24 @@
-->
<com.android.settings.localepicker.LocaleDragCell
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:listPreferredItemHeight"
android:background="?android:colorBackground"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:layoutDirection="locale"
android:textDirection="locale">
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:listPreferredItemHeight"
android:background="?android:colorBackground"
android:layout_marginTop="12dp"
android:layout_marginBottom="12dp"
android:layoutDirection="locale"
android:textDirection="locale">
<CheckBox
android:id="@+id/checkbox"
style="@style/LanguageCheckboxAndLabel"
android:paddingStart="24dp"
android:layout_toStartOf="@+id/dragHandle"/>
android:layout_toStartOf="@+id/dragHandle"
android:layout_alignTop="@+id/miniLabel"
android:layout_alignBottom="@+id/miniLabel" />
<TextView
android:id="@+id/miniLabel"
@@ -38,37 +41,44 @@
android:textColor="?android:attr/colorAccent"
android:minWidth="24sp"
android:gravity="center_vertical|center_horizontal"
android:layout_alignTop="@id/checkbox"
android:layout_alignBottom="@id/checkbox"/>
android:layout_centerVertical="true"/>
<LinearLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:minHeight="?android:listPreferredItemHeight"
android:paddingStart="56dp"
android:layout_toStartOf="@+id/dragHandle">
<TextView
android:id="@+id/label"
style="@style/LanguageCheckboxAndLabel"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent">
<TextView
android:id="@+id/label"
style="@style/LanguageCheckboxAndLabel" />
<TextView
android:id="@+id/l10nWarn"
style="@style/LanguageCheckboxAndLabel"
android:textAppearance="?android:attr/textAppearanceListItemSecondary"
android:textColor="?android:textColorSecondary"
android:layout_marginBottom="4dp"
android:text="@string/locale_not_translated"/>
<TextView
android:id="@+id/l10nWarn"
style="@style/LanguageCheckboxAndLabel"
android:textAppearance="?android:attr/textAppearanceListItemSecondary"
android:textColor="?android:textColorSecondary"
android:layout_marginTop="4dp"
android:text="@string/locale_not_translated"/>
<TextView
android:id="@+id/default_locale"
style="@style/LanguageCheckboxAndLabel"
android:textAppearance="?android:attr/textAppearanceListItemSecondary"
android:textColor="?android:textColorSecondary"
android:layout_marginBottom="4dp"
android:text="@string/desc_current_default_language"/>
<TextView
android:id="@+id/default_locale"
style="@style/LanguageCheckboxAndLabel"
android:textAppearance="?android:attr/textAppearanceListItemSecondary"
android:textColor="?android:textColorSecondary"
android:layout_marginTop="4dp"
android:text="@string/desc_current_default_language"/>
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<ImageView
android:id="@+id/dragHandle"
@@ -80,13 +90,6 @@
android:src="@drawable/drag_handle"
android:importantForAccessibility="no"
android:layout_alignParentEnd="true"
android:layout_alignTop="@id/checkbox"
android:layout_alignBottom="@id/checkbox"/>
android:layout_centerVertical="true"/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/listDivider"
android:layout_alignParentBottom="true"/>
</com.android.settings.localepicker.LocaleDragCell>
</com.android.settings.localepicker.LocaleDragCell>

View File

@@ -368,7 +368,7 @@
<string name="desc_notice_of_language_picker">To select a language for each app, go to app language settings.</string>
<!-- Title for locale helper page [CHAR LIMIT=NONE] -->
<string name="desc_locale_helper_footer_general">Learn more about languages</string>
<string name="desc_locale_helper_footer_general">Learn more about app languages</string>
<!-- Link for Locale helper page. [CHAR LIMIT=NONE]-->
<string name="link_locale_picker_footer_learn_more" translatable="false">https://support.google.com/android?p=per_language_app_settings</string>

View File

@@ -165,7 +165,7 @@ class LocaleDragAndDropAdapter
dragCell.setLabelAndDescription(label, description);
dragCell.setLocalized(feedItem.isTranslated());
dragCell.setCurrentDefault(feedItem.getLocale().equals(Locale.getDefault()));
dragCell.setCurrentDefault(feedItem.getLocale().equals(LocalePicker.getLocales().get(0)));
dragCell.setMiniLabel(mNumberFormatter.format(i + 1));
dragCell.setShowCheckbox(mRemoveMode);
dragCell.setShowMiniLabel(!mRemoveMode);