Merge "Show empty options in shortcut chooser dialog if shortPreference is unchecked." into rvc-dev
This commit is contained in:
@@ -83,6 +83,8 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
|
|||||||
protected CharSequence mPackageName;
|
protected CharSequence mPackageName;
|
||||||
protected Uri mImageUri;
|
protected Uri mImageUri;
|
||||||
protected CharSequence mHtmlDescription;
|
protected CharSequence mHtmlDescription;
|
||||||
|
// Used to restore the edit dialog status.
|
||||||
|
protected int mUserShortcutTypeCache = UserShortcutType.EMPTY;
|
||||||
private static final String DRAWABLE_FOLDER = "drawable";
|
private static final String DRAWABLE_FOLDER = "drawable";
|
||||||
protected static final String KEY_USE_SERVICE_PREFERENCE = "use_service";
|
protected static final String KEY_USE_SERVICE_PREFERENCE = "use_service";
|
||||||
protected static final String KEY_GENERAL_CATEGORY = "general_categories";
|
protected static final String KEY_GENERAL_CATEGORY = "general_categories";
|
||||||
@@ -91,8 +93,6 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
|
|||||||
private static final String EXTRA_SHORTCUT_TYPE = "shortcut_type";
|
private static final String EXTRA_SHORTCUT_TYPE = "shortcut_type";
|
||||||
private TouchExplorationStateChangeListener mTouchExplorationStateChangeListener;
|
private TouchExplorationStateChangeListener mTouchExplorationStateChangeListener;
|
||||||
private int mUserShortcutType = UserShortcutType.EMPTY;
|
private int mUserShortcutType = UserShortcutType.EMPTY;
|
||||||
// Used to restore the edit dialog status.
|
|
||||||
private int mUserShortcutTypeCache = UserShortcutType.EMPTY;
|
|
||||||
private CheckBox mSoftwareTypeCheckBox;
|
private CheckBox mSoftwareTypeCheckBox;
|
||||||
private CheckBox mHardwareTypeCheckBox;
|
private CheckBox mHardwareTypeCheckBox;
|
||||||
|
|
||||||
@@ -473,8 +473,10 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateAlertDialogCheckState() {
|
private void updateAlertDialogCheckState() {
|
||||||
updateCheckStatus(mSoftwareTypeCheckBox, UserShortcutType.SOFTWARE);
|
if (mUserShortcutTypeCache != UserShortcutType.EMPTY) {
|
||||||
updateCheckStatus(mHardwareTypeCheckBox, UserShortcutType.HARDWARE);
|
updateCheckStatus(mSoftwareTypeCheckBox, UserShortcutType.SOFTWARE);
|
||||||
|
updateCheckStatus(mHardwareTypeCheckBox, UserShortcutType.HARDWARE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateCheckStatus(CheckBox checkBox, @UserShortcutType int type) {
|
private void updateCheckStatus(CheckBox checkBox, @UserShortcutType int type) {
|
||||||
@@ -658,7 +660,10 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSettingsClicked(ShortcutPreference preference) {
|
public void onSettingsClicked(ShortcutPreference preference) {
|
||||||
mUserShortcutTypeCache = getUserShortcutType(getPrefContext(), UserShortcutType.SOFTWARE);
|
// Do not restore shortcut in shortcut chooser dialog when shortcutPreference is turned off.
|
||||||
|
mUserShortcutTypeCache = mShortcutPreference.isChecked()
|
||||||
|
? getUserShortcutType(getPrefContext(), UserShortcutType.SOFTWARE)
|
||||||
|
: UserShortcutType.EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createFooterPreference(CharSequence title) {
|
private void createFooterPreference(CharSequence title) {
|
||||||
|
@@ -71,8 +71,6 @@ public class ToggleScreenMagnificationPreferenceFragment extends
|
|||||||
private static final String KEY_SHORTCUT_PREFERENCE = "shortcut_preference";
|
private static final String KEY_SHORTCUT_PREFERENCE = "shortcut_preference";
|
||||||
private TouchExplorationStateChangeListener mTouchExplorationStateChangeListener;
|
private TouchExplorationStateChangeListener mTouchExplorationStateChangeListener;
|
||||||
private int mUserShortcutType = UserShortcutType.EMPTY;
|
private int mUserShortcutType = UserShortcutType.EMPTY;
|
||||||
// Used to restore the edit dialog status.
|
|
||||||
private int mUserShortcutTypeCache = UserShortcutType.EMPTY;
|
|
||||||
private CheckBox mSoftwareTypeCheckBox;
|
private CheckBox mSoftwareTypeCheckBox;
|
||||||
private CheckBox mHardwareTypeCheckBox;
|
private CheckBox mHardwareTypeCheckBox;
|
||||||
private CheckBox mTripleTapTypeCheckBox;
|
private CheckBox mTripleTapTypeCheckBox;
|
||||||
@@ -283,9 +281,11 @@ public class ToggleScreenMagnificationPreferenceFragment extends
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateAlertDialogCheckState() {
|
private void updateAlertDialogCheckState() {
|
||||||
updateCheckStatus(mSoftwareTypeCheckBox, UserShortcutType.SOFTWARE);
|
if (mUserShortcutTypeCache != UserShortcutType.EMPTY) {
|
||||||
updateCheckStatus(mHardwareTypeCheckBox, UserShortcutType.HARDWARE);
|
updateCheckStatus(mSoftwareTypeCheckBox, UserShortcutType.SOFTWARE);
|
||||||
updateCheckStatus(mTripleTapTypeCheckBox, UserShortcutType.TRIPLETAP);
|
updateCheckStatus(mHardwareTypeCheckBox, UserShortcutType.HARDWARE);
|
||||||
|
updateCheckStatus(mTripleTapTypeCheckBox, UserShortcutType.TRIPLETAP);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateCheckStatus(CheckBox checkBox, @UserShortcutType int type) {
|
private void updateCheckStatus(CheckBox checkBox, @UserShortcutType int type) {
|
||||||
@@ -457,7 +457,10 @@ public class ToggleScreenMagnificationPreferenceFragment extends
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSettingsClicked(ShortcutPreference preference) {
|
public void onSettingsClicked(ShortcutPreference preference) {
|
||||||
mUserShortcutTypeCache = getUserShortcutType(getPrefContext(), UserShortcutType.SOFTWARE);
|
// Do not restore shortcut in shortcut chooser dialog when shortcutPreference is turned off.
|
||||||
|
mUserShortcutTypeCache = mShortcutPreference.isChecked()
|
||||||
|
? getUserShortcutType(getPrefContext(), UserShortcutType.SOFTWARE)
|
||||||
|
: UserShortcutType.EMPTY;
|
||||||
showDialog(DialogEnums.MAGNIFICATION_EDIT_SHORTCUT);
|
showDialog(DialogEnums.MAGNIFICATION_EDIT_SHORTCUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user