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

Commit 6c7b52b7 authored by menghanli's avatar menghanli
Browse files

Provides TC ID for shortcut title in AccessibilityShortcutPreferenceFragment

Goal: Improve readability which is a bit difficult because of string concatenation for accurate translation.
Root cause: In some locales, framework features name would be a word rather than a product name. Hence it need to be in the different position in a sentence.
Solution: Use whole sentence to translate instead of concatenating the string could solve this issue.

Bug: 185478543
Test: Manually testing
Change-Id: Iced1fe7db81e4e78ddfed30ab947d449b5f9c735
parent 7f907d35
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -11798,6 +11798,8 @@
    <string name="one_handed_title">One-handed mode</string>
    <!-- Preference Switch for enabling one handed [CHAR LIMIT=60] -->
    <string name="one_handed_mode_enabled">Use one-handed mode</string>
    <!-- Title for accessibility shortcut preference for enabling one handed. [CHAR LIMIT=60] -->
    <string name="one_handed_mode_shortcut_title">One-handed mode shortcut</string>
    <!-- Search keywords for "One-Handed" settings [CHAR_LIMIT=NONE] -->
    <string name="keywords_one_handed">reachability</string>
    <!-- Category title for one handed swipe down [CHAR_LIMIT=60] -->
+6 −2
Original line number Diff line number Diff line
@@ -115,8 +115,7 @@ public abstract class AccessibilityShortcutPreferenceFragment extends DashboardF
        mShortcutPreference.setKey(getShortcutPreferenceKey());
        mShortcutPreference.setOnClickCallback(this);

        final CharSequence title = getString(R.string.accessibility_shortcut_title, getLabelName());
        mShortcutPreference.setTitle(title);
        updateShortcutTitle(mShortcutPreference);
        getPreferenceScreen().addPreference(mShortcutPreference);

        mTouchExplorationStateChangeListener = isTouchExplorationEnabled -> {
@@ -182,6 +181,11 @@ public abstract class AccessibilityShortcutPreferenceFragment extends DashboardF
        }
    }

    protected void updateShortcutTitle(ShortcutPreference shortcutPreference) {
        final CharSequence title = getString(R.string.accessibility_shortcut_title, getLabelName());
        shortcutPreference.setTitle(title);
    }

    @Override
    public int getDialogMetricsCategory(int dialogId) {
        switch (dialogId) {
+6 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import android.os.UserHandle;
import com.android.internal.accessibility.AccessibilityShortcutController;
import com.android.settings.R;
import com.android.settings.accessibility.AccessibilityShortcutPreferenceFragment;
import com.android.settings.accessibility.ShortcutPreference;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settingslib.widget.IllustrationPreference;

@@ -76,6 +77,11 @@ public class OneHandedSettings extends AccessibilityShortcutPreferenceFragment {
        return ONE_HANDED_SHORTCUT_KEY;
    }

    @Override
    protected void updateShortcutTitle(ShortcutPreference shortcutPreference) {
        shortcutPreference.setTitle(R.string.one_handed_mode_shortcut_title);
    }

    @Override
    protected boolean showGeneralCategory() {
        return true;