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

Commit 52817360 authored by tom hsu's avatar tom hsu Committed by Tom Hsu
Browse files

[Panlingual] Add a description for per app language.

 - This is to notify some app may not support to user.

Bug: 228415129
Test: local
Change-Id: I6205e0b5fdb3ee42a22ae4995c99e9d8dc5e0a2d
parent 58a5338c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@
    android:layout_height="wrap_content"
    android:gravity="center_horizontal" >
    <TextView
        android:id="@id/description"
        android:id="@+id/description"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="15dip"
+3 −0
Original line number Diff line number Diff line
@@ -524,6 +524,9 @@
    <!-- Description for the app without any supported languages. [CHAR LIMIT=NONE]-->
    <string name="desc_no_available_supported_locale">Language selection for this app isn\u2019t available from Settings.</string>
    <!-- Description for the disclaimer of per app language. [CHAR LIMIT=NONE]-->
    <string name="desc_app_locale_disclaimer">Language may differ from languages available in the app. Some apps may not support this setting.</string>
    <!-- The title of the confirmation dialog shown when the user selects one / several languages and tries to remove them [CHAR LIMIT=60] -->
    <plurals name="dlg_remove_locales_title">
        <item quantity="one">Remove selected language?</item>
+6 −0
Original line number Diff line number Diff line
@@ -19,14 +19,20 @@
    xmlns:settings="http://schemas.android.com/apk/res-auto"
    android:title="@string/app_locale_picker_title">

    <com.android.settingslib.widget.TopIntroPreference
        android:title="@string/desc_app_locale_disclaimer"
        android:order="1"/>

    <com.android.settingslib.widget.BannerMessagePreference
        android:key="key_warnings"
        android:order="20"
        android:icon="@drawable/ic_error_outline"
        android:title="@string/warnings_title"
        android:summary="@string/warnings_summary"/>

    <com.android.settingslib.widget.LayoutPreference
        android:key="app_locale_description"
        android:order="30"
        android:layout="@layout/app_locale_details_description"
        android:selectable="false"
        android:visibility="gone"
+1 −0
Original line number Diff line number Diff line
@@ -146,6 +146,7 @@ public class AppLocaleDetails extends SettingsPreferenceFragment {
                .setUid(mApplicationInfo.uid)
                .setHasAppInfoLink(true)
                .setButtonActions(ActionType.ACTION_NONE, ActionType.ACTION_NONE)
                .setOrder(10)
                .done(activity, getPrefContext());
        getPreferenceScreen().addPreference(pref);
    }
+10 −3
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ public class EntityHeaderController {
    private Lifecycle mLifecycle;
    private RecyclerView mRecyclerView;
    private Drawable mIcon;
    private int mPrefOrder = -1000;
    private String mIconContentDescription;
    private CharSequence mLabel;
    private CharSequence mSummary;
@@ -214,12 +215,18 @@ public class EntityHeaderController {
    }

    public EntityHeaderController setIsInstantApp(boolean isInstantApp) {
        this.mIsInstantApp = isInstantApp;
        mIsInstantApp = isInstantApp;
        return this;
    }

    public EntityHeaderController setEditListener(View.OnClickListener listener) {
        this.mEditOnClickListener = listener;
        mEditOnClickListener = listener;
        return this;
    }

    /** Sets this preference order. */
    public EntityHeaderController setOrder(int order) {
        mPrefOrder = order;
        return this;
    }

@@ -229,7 +236,7 @@ public class EntityHeaderController {
    public LayoutPreference done(Activity activity, Context uiContext) {
        final LayoutPreference pref = new LayoutPreference(uiContext, done(activity));
        // Makes sure it's the first preference onscreen.
        pref.setOrder(-1000);
        pref.setOrder(mPrefOrder);
        pref.setSelectable(false);
        pref.setKey(PREF_KEY_APP_HEADER);
        pref.setAllowDividerBelow(true);