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

Commit 580fd5de authored by Zoey Chen's avatar Zoey Chen Committed by Android (Google) Code Review
Browse files

Merge "[Settings] Show intro preference in numbering system as well" into main

parents 162c250e 41a7b5ee
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -531,6 +531,7 @@
    <string name="title_change_system_locale_region">Change region to %s ?</string>
    <!-- Message for asking to change system locale region or not. [CHAR LIMIT=50]-->
    <string name="body_change_system_locale_region">Your device will keep %s as a system language</string>
    <string name="top_intro_numbering_system_title">The digits used will be dependent on the numbering system</string>
    <!-- Regional Preferences begin -->
    <!-- The title of the menu entry of regional preferences. [CHAR LIMIT=50] -->
+1 −2
Original line number Diff line number Diff line
@@ -22,8 +22,7 @@

    <com.android.settingslib.widget.TopIntroPreference
        android:key="top_intro_region"
        android:title="@string/top_intro_region_title"
        settings:isPreferenceVisible="false"/>
        android:title="@string/top_intro_region_title"/>

    <PreferenceCategory
        android:key="system_language_suggested_category"
+3 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.settings.localepicker;
import static com.android.settings.localepicker.LocaleListEditor.EXTRA_RESULT_LOCALE;
import static com.android.settings.localepicker.RegionAndNumberingSystemPickerFragment.EXTRA_IS_NUMBERING_SYSTEM;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.os.LocaleList;
@@ -178,7 +179,9 @@ public abstract class LocalePickerBaseListPreferenceController extends
            pref.setTitle(localeName);
            pref.setKey(locale.toString());
            pref.setOnPreferenceClickListener(clickedPref -> {
                // TODO: b/390347399 - Should pop up a dialog when changes the region.
                switchFragment(locale);
                ((Activity) mContext).finish();
                return true;
            });
            mPreferences.put(locale.getId(), pref);
+2 −2
Original line number Diff line number Diff line
@@ -116,8 +116,8 @@ public class RegionAndNumberingSystemPickerFragment extends DashboardFragment im
        }

        TopIntroPreference topIntroPreference = findPreference(KEY_TOP_INTRO_PREFERENCE);
        if (topIntroPreference != null) {
            topIntroPreference.setVisible(!mIsNumberingMode);
        if (topIntroPreference != null && mIsNumberingMode) {
            topIntroPreference.setTitle(R.string.top_intro_numbering_system_title);
        }

        if (mSystemLocaleAllListPreferenceController != null) {
+12 −5
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settingslib.core.AbstractPreferenceController;
import com.android.settingslib.core.lifecycle.Lifecycle;
import com.android.settingslib.widget.TopIntroPreference;

import com.google.android.material.appbar.AppBarLayout;

@@ -71,14 +72,13 @@ public class SystemLocalePickerFragment extends DashboardFragment implements
    private static final String KEY_PREFERENCE_SYSTEM_LOCALE_LIST = "system_locale_list";
    private static final String KEY_PREFERENCE_SYSTEM_LOCALE_SUGGESTED_LIST =
            "system_locale_suggested_list";
    private static final String KEY_TOP_INTRO_PREFERENCE = "top_intro_region";

    @Nullable
    private SearchView mSearchView = null;
    @Nullable
    private SearchFilter mSearchFilter = null;
    @Nullable
    private Set<LocaleStore.LocaleInfo> mLocaleList;
    @Nullable
    private List<LocaleStore.LocaleInfo> mLocaleOptions;
    @Nullable
    private List<LocaleStore.LocaleInfo> mOriginalLocaleInfos;
@@ -106,8 +106,15 @@ public class SystemLocalePickerFragment extends DashboardFragment implements
        }

        SystemLocaleCollector systemLocaleCollector = new SystemLocaleCollector(getContext(), null);
        mLocaleList = systemLocaleCollector.getSupportedLocaleList(null, false, false);
        mLocaleOptions = new ArrayList<>(mLocaleList.size());
        Set<LocaleStore.LocaleInfo> localeList = systemLocaleCollector.getSupportedLocaleList(null,
                false, false);
        mLocaleOptions = new ArrayList<>(localeList.size());

        TopIntroPreference topIntroPreference = findPreference(KEY_TOP_INTRO_PREFERENCE);
        if (topIntroPreference != null) {
            topIntroPreference.setVisible(false);
        }

    }

    @Override
@@ -175,7 +182,7 @@ public class SystemLocalePickerFragment extends DashboardFragment implements
            FilterResults results = new FilterResults();

            if (mOriginalLocaleInfos == null) {
                mOriginalLocaleInfos = new ArrayList<>(mLocaleList);
                mOriginalLocaleInfos = new ArrayList<>(mLocaleOptions);
            }

            if (TextUtils.isEmpty(prefix)) {