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

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

Merge "[Settings] The subtitle should be moved one layer up and placed after...

Merge "[Settings] The subtitle should be moved one layer up and placed after "Choose the language for each app."" into main
parents ccb402a7 8903d722
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -445,7 +445,7 @@
    <string name="app_locales_picker_menu_title">App languages</string>
    <!-- Summary for the app's locale picker activity. [CHAR LIMIT=50]-->
    <string name="app_locale_picker_summary">Set the language for each app</string>
    <string name="app_locale_picker_summary">Choose the language for each app</string>
    <!-- Title for the App's locale picker activity. [CHAR LIMIT=50]-->
    <string name="app_locale_picker_title">App language</string>
@@ -484,7 +484,9 @@
    <string name="desc_app_locale_disclaimer">Language may differ from languages available in the app. Some apps may not support this setting.</string>
    <!-- Description for introduction of the locale selection supported of app list [CHAR LIMIT=NONE]-->
    <string name="desc_app_locale_selection_supported">Set the language for each app.</string>
    <string name="desc_app_locale_selection_supported">Choose the language for each app.</string>
    <!-- Description for introduction of the locale selection supported of app list with disclaimer if the feature is in opt-out mode [CHAR LIMIT=NONE]-->
    <string name="desc_app_locale_selection_supported_with_disclaimer">Choose the language for each app. Language may differ from languages available in the app. Some apps may not support this setting.</string>
    <!-- Description for the introduction to language picker activity. [CHAR LIMIT=NONE]-->
    <string name="desc_introduction_of_language_picker">Your device, apps, and websites use the first supported language from your preferred language list.\n\nMany apps will also use the region from your preferred language to format dates, numbers, and units. To change your region, add a language, then choose your preferred region.</string>
+0 −6
Original line number Diff line number Diff line
@@ -20,12 +20,6 @@
    android:title="@string/app_locale_picker_title"
    android:key="key_app_language_picker_page">

    <com.android.settingslib.widget.TopIntroPreference
        android:key="app_locale_disclaimer"
        android:title="@string/desc_app_locale_disclaimer"
        settings:isPreferenceVisible="false"
        android:order="1"/>

    <com.android.settingslib.widget.IntroPreference
        android:key="app_intro"
        android:order="2"/>
+0 −9
Original line number Diff line number Diff line
@@ -82,7 +82,6 @@ public class AppLocalePickerFragment extends DashboardFragment implements
    private static final String KEY_PREFERENCE_APP_LOCALE_LIST = "app_locale_list";
    private static final String KEY_PREFERENCE_APP_LOCALE_SUGGESTED_LIST =
            "app_locale_suggested_list";
    private static final String KEY_PREFERENCE_APP_DISCLAIMER = "app_locale_disclaimer";
    private static final String KEY_PREFERENCE_APP_INTRO = "app_intro";
    private static final String KEY_PREFERENCE_APP_DESCRIPTION = "app_locale_description";

@@ -136,7 +135,6 @@ public class AppLocalePickerFragment extends DashboardFragment implements
        mPreferenceScreen = getPreferenceScreen();
        setHasOptionsMenu(true);
        mApplicationInfo = getApplicationInfo(mPackageName, mUid);
        setupDisclaimerPreference();
        setupIntroPreference();
        setupDescriptionPreference();
        mExpandSearch = mActivity.getIntent().getBooleanExtra(EXTRA_EXPAND_SEARCH_VIEW, false);
@@ -200,13 +198,6 @@ public class AppLocalePickerFragment extends DashboardFragment implements
        }
    }

    private void setupDisclaimerPreference() {
        final Preference pref = mPreferenceScreen.findPreference(KEY_PREFERENCE_APP_DISCLAIMER);
        boolean shouldShowPref = pref != null && FeatureFlagUtils.isEnabled(
                mActivity, FeatureFlagUtils.SETTINGS_APP_LOCALE_OPT_IN_ENABLED);
        pref.setVisible(shouldShowPref);
    }

    private void setupIntroPreference() {
        final Preference pref = mPreferenceScreen.findPreference(KEY_PREFERENCE_APP_INTRO);
        if (pref != null && mApplicationInfo != null) {
+14 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.settings.spa.system

import android.os.Bundle
import android.util.FeatureFlagUtils
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
@@ -24,6 +25,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import com.android.settings.R
import com.android.settingslib.spa.framework.common.SettingsPageProvider
import com.android.settingslib.spa.framework.common.SpaEnvironmentFactory
import com.android.settingslib.spa.framework.compose.navigator
import com.android.settingslib.spa.framework.compose.rememberContext
import com.android.settingslib.spa.framework.theme.SettingsDimension
@@ -43,7 +45,18 @@ object AppLanguagesPageProvider : SettingsPageProvider {
            noMoreOptions = true,
            header = {
                Box(Modifier.padding(SettingsDimension.itemPadding)) {
                    SettingsBody(stringResource(R.string.desc_app_locale_selection_supported))
                    // if the feature is in opt-out mode, show the disclaimer.
                    val titleId =
                        if (FeatureFlagUtils.isEnabled(
                                SpaEnvironmentFactory.instance.appContext,
                                FeatureFlagUtils.SETTINGS_APP_LOCALE_OPT_IN_ENABLED
                            )
                        ) {
                            R.string.desc_app_locale_selection_supported
                        } else {
                            R.string.desc_app_locale_selection_supported_with_disclaimer
                        }
                    SettingsBody(stringResource(titleId))
                }
            },
        )