Merge "Provides TC ID for shortcut title in AccessibilityShortcutPreferenceFragment" into sc-v2-dev am: 77b8431156 am: 7c011ae5c0

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15297637

Change-Id: Ib1bbfc97929be4de656a70e1afa0e353c5ac6c88
This commit is contained in:
Menghan Li
2021-07-16 06:20:43 +00:00
committed by Automerger Merge Worker
3 changed files with 14 additions and 2 deletions

View File

@@ -11799,6 +11799,8 @@
<string name="one_handed_title">One-handed mode</string> <string name="one_handed_title">One-handed mode</string>
<!-- Preference Switch for enabling one handed [CHAR LIMIT=60] --> <!-- Preference Switch for enabling one handed [CHAR LIMIT=60] -->
<string name="one_handed_mode_enabled">Use one-handed mode</string> <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] --> <!-- Search keywords for "One-Handed" settings [CHAR_LIMIT=NONE] -->
<string name="keywords_one_handed">reachability</string> <string name="keywords_one_handed">reachability</string>
<!-- Category title for one handed swipe down [CHAR_LIMIT=60] --> <!-- Category title for one handed swipe down [CHAR_LIMIT=60] -->

View File

@@ -115,8 +115,7 @@ public abstract class AccessibilityShortcutPreferenceFragment extends DashboardF
mShortcutPreference.setKey(getShortcutPreferenceKey()); mShortcutPreference.setKey(getShortcutPreferenceKey());
mShortcutPreference.setOnClickCallback(this); mShortcutPreference.setOnClickCallback(this);
final CharSequence title = getString(R.string.accessibility_shortcut_title, getLabelName()); updateShortcutTitle(mShortcutPreference);
mShortcutPreference.setTitle(title);
getPreferenceScreen().addPreference(mShortcutPreference); getPreferenceScreen().addPreference(mShortcutPreference);
mTouchExplorationStateChangeListener = isTouchExplorationEnabled -> { 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 @Override
public int getDialogMetricsCategory(int dialogId) { public int getDialogMetricsCategory(int dialogId) {
switch (dialogId) { switch (dialogId) {

View File

@@ -26,6 +26,7 @@ import android.os.UserHandle;
import com.android.internal.accessibility.AccessibilityShortcutController; import com.android.internal.accessibility.AccessibilityShortcutController;
import com.android.settings.R; import com.android.settings.R;
import com.android.settings.accessibility.AccessibilityShortcutPreferenceFragment; import com.android.settings.accessibility.AccessibilityShortcutPreferenceFragment;
import com.android.settings.accessibility.ShortcutPreference;
import com.android.settings.search.BaseSearchIndexProvider; import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settingslib.widget.IllustrationPreference; import com.android.settingslib.widget.IllustrationPreference;
@@ -76,6 +77,11 @@ public class OneHandedSettings extends AccessibilityShortcutPreferenceFragment {
return ONE_HANDED_SHORTCUT_KEY; return ONE_HANDED_SHORTCUT_KEY;
} }
@Override
protected void updateShortcutTitle(ShortcutPreference shortcutPreference) {
shortcutPreference.setTitle(R.string.one_handed_mode_shortcut_title);
}
@Override @Override
protected boolean showGeneralCategory() { protected boolean showGeneralCategory() {
return true; return true;