Merge "Fix inconsistent shortcut strings on accessibility setting and edit dialog" into tm-dev
This commit is contained in:
@@ -132,8 +132,8 @@ public abstract class AccessibilityShortcutPreferenceFragment extends DashboardF
|
||||
mShortcutPreference.setPersistent(false);
|
||||
mShortcutPreference.setKey(getShortcutPreferenceKey());
|
||||
mShortcutPreference.setOnClickCallback(this);
|
||||
mShortcutPreference.setTitle(getShortcutTitle());
|
||||
|
||||
updateShortcutTitle(mShortcutPreference);
|
||||
getPreferenceScreen().addPreference(mShortcutPreference);
|
||||
|
||||
mTouchExplorationStateChangeListener = isTouchExplorationEnabled -> {
|
||||
@@ -192,13 +192,11 @@ public abstract class AccessibilityShortcutPreferenceFragment extends DashboardF
|
||||
final Dialog dialog;
|
||||
switch (dialogId) {
|
||||
case DialogEnums.EDIT_SHORTCUT:
|
||||
final CharSequence dialogTitle = getPrefContext().getString(
|
||||
R.string.accessibility_shortcut_title, getLabelName());
|
||||
final int dialogType = WizardManagerHelper.isAnySetupWizard(getIntent())
|
||||
? AccessibilityDialogUtils.DialogType.EDIT_SHORTCUT_GENERIC_SUW :
|
||||
AccessibilityDialogUtils.DialogType.EDIT_SHORTCUT_GENERIC;
|
||||
dialog = AccessibilityDialogUtils.showEditShortcutDialog(
|
||||
getPrefContext(), dialogType, dialogTitle,
|
||||
getPrefContext(), dialogType, getShortcutTitle(),
|
||||
this::callOnAlertDialogCheckboxClicked);
|
||||
setupEditShortcutDialog(dialog);
|
||||
return dialog;
|
||||
@@ -213,9 +211,8 @@ public abstract class AccessibilityShortcutPreferenceFragment extends DashboardF
|
||||
}
|
||||
}
|
||||
|
||||
protected void updateShortcutTitle(ShortcutPreference shortcutPreference) {
|
||||
final CharSequence title = getString(R.string.accessibility_shortcut_title, getLabelName());
|
||||
shortcutPreference.setTitle(title);
|
||||
protected CharSequence getShortcutTitle() {
|
||||
return getString(R.string.accessibility_shortcut_title, getLabelName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -75,8 +75,8 @@ public class ToggleColorInversionPreferenceFragment extends ToggleFeaturePrefere
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateShortcutTitle(ShortcutPreference shortcutPreference) {
|
||||
shortcutPreference.setTitle(R.string.accessibility_display_inversion_shortcut_title);
|
||||
protected CharSequence getShortcutTitle() {
|
||||
return getText(R.string.accessibility_display_inversion_shortcut_title);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -185,8 +185,8 @@ public final class ToggleDaltonizerPreferenceFragment extends ToggleFeaturePrefe
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateShortcutTitle(ShortcutPreference shortcutPreference) {
|
||||
shortcutPreference.setTitle(R.string.accessibility_daltonizer_shortcut_title);
|
||||
protected CharSequence getShortcutTitle() {
|
||||
return getText(R.string.accessibility_daltonizer_shortcut_title);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -271,12 +271,10 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
|
||||
public Dialog onCreateDialog(int dialogId) {
|
||||
switch (dialogId) {
|
||||
case DialogEnums.EDIT_SHORTCUT:
|
||||
final CharSequence dialogTitle = getPrefContext().getString(
|
||||
R.string.accessibility_shortcut_title, mPackageName);
|
||||
final int dialogType = WizardManagerHelper.isAnySetupWizard(getIntent())
|
||||
? DialogType.EDIT_SHORTCUT_GENERIC_SUW : DialogType.EDIT_SHORTCUT_GENERIC;
|
||||
mDialog = AccessibilityDialogUtils.showEditShortcutDialog(
|
||||
getPrefContext(), dialogType, dialogTitle,
|
||||
getPrefContext(), dialogType, getShortcutTitle(),
|
||||
this::callOnAlertDialogCheckboxClicked);
|
||||
setupEditShortcutDialog(mDialog);
|
||||
return mDialog;
|
||||
@@ -341,9 +339,8 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
|
||||
switchPreference.setTitle(title);
|
||||
}
|
||||
|
||||
protected void updateShortcutTitle(ShortcutPreference shortcutPreference) {
|
||||
final CharSequence title = getString(R.string.accessibility_shortcut_title, mPackageName);
|
||||
shortcutPreference.setTitle(title);
|
||||
protected CharSequence getShortcutTitle() {
|
||||
return getString(R.string.accessibility_shortcut_title, mPackageName);
|
||||
}
|
||||
|
||||
protected void onPreferenceToggled(String preferenceKey, boolean enabled) {
|
||||
@@ -516,8 +513,7 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
|
||||
mShortcutPreference.setPersistent(false);
|
||||
mShortcutPreference.setKey(getShortcutPreferenceKey());
|
||||
mShortcutPreference.setOnClickCallback(this);
|
||||
|
||||
updateShortcutTitle(mShortcutPreference);
|
||||
mShortcutPreference.setTitle(getShortcutTitle());
|
||||
|
||||
final PreferenceCategory generalCategory = findPreference(KEY_GENERAL_CATEGORY);
|
||||
generalCategory.addPreference(mShortcutPreference);
|
||||
|
@@ -168,8 +168,8 @@ public class ToggleReduceBrightColorsPreferenceFragment extends ToggleFeaturePre
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateShortcutTitle(ShortcutPreference shortcutPreference) {
|
||||
shortcutPreference.setTitle(R.string.reduce_bright_colors_shortcut_title);
|
||||
protected CharSequence getShortcutTitle() {
|
||||
return getText(R.string.reduce_bright_colors_shortcut_title);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -479,8 +479,8 @@ public class ToggleScreenMagnificationPreferenceFragment extends
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateShortcutTitle(ShortcutPreference shortcutPreference) {
|
||||
shortcutPreference.setTitle(R.string.accessibility_screen_magnification_shortcut_title);
|
||||
protected CharSequence getShortcutTitle() {
|
||||
return getText(R.string.accessibility_screen_magnification_shortcut_title);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -27,7 +27,6 @@ import com.android.internal.accessibility.AccessibilityShortcutController;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.accessibility.AccessibilityShortcutPreferenceFragment;
|
||||
import com.android.settings.accessibility.AccessibilityUtil.QuickSettingsTooltipType;
|
||||
import com.android.settings.accessibility.ShortcutPreference;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settingslib.widget.IllustrationPreference;
|
||||
import com.android.settingslib.widget.MainSwitchPreference;
|
||||
@@ -88,8 +87,8 @@ public class OneHandedSettings extends AccessibilityShortcutPreferenceFragment {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateShortcutTitle(ShortcutPreference shortcutPreference) {
|
||||
shortcutPreference.setTitle(R.string.one_handed_mode_shortcut_title);
|
||||
protected CharSequence getShortcutTitle() {
|
||||
return getText(R.string.one_handed_mode_shortcut_title);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user