Merge "Fix the title of the HW "Edit shortcuts" menu is truncated when the device is folded." into sc-v2-dev
This commit is contained in:
@@ -47,6 +47,8 @@ import java.util.List;
|
|||||||
public class AccessibilityShortcutChooserActivity extends Activity {
|
public class AccessibilityShortcutChooserActivity extends Activity {
|
||||||
@ShortcutType
|
@ShortcutType
|
||||||
private final int mShortcutType = ACCESSIBILITY_SHORTCUT_KEY;
|
private final int mShortcutType = ACCESSIBILITY_SHORTCUT_KEY;
|
||||||
|
private static final String KEY_ACCESSIBILITY_SHORTCUT_MENU_MODE =
|
||||||
|
"accessibility_shortcut_menu_mode";
|
||||||
private final List<AccessibilityTarget> mTargets = new ArrayList<>();
|
private final List<AccessibilityTarget> mTargets = new ArrayList<>();
|
||||||
private AlertDialog mMenuDialog;
|
private AlertDialog mMenuDialog;
|
||||||
private AlertDialog mPermissionDialog;
|
private AlertDialog mPermissionDialog;
|
||||||
@@ -66,14 +68,30 @@ public class AccessibilityShortcutChooserActivity extends Activity {
|
|||||||
mMenuDialog = createMenuDialog();
|
mMenuDialog = createMenuDialog();
|
||||||
mMenuDialog.setOnShowListener(dialog -> updateDialogListeners());
|
mMenuDialog.setOnShowListener(dialog -> updateDialogListeners());
|
||||||
mMenuDialog.show();
|
mMenuDialog.show();
|
||||||
|
|
||||||
|
if (savedInstanceState != null) {
|
||||||
|
final int restoreShortcutMenuMode =
|
||||||
|
savedInstanceState.getInt(KEY_ACCESSIBILITY_SHORTCUT_MENU_MODE,
|
||||||
|
ShortcutMenuMode.LAUNCH);
|
||||||
|
if (restoreShortcutMenuMode == ShortcutMenuMode.EDIT) {
|
||||||
|
onEditButtonClicked();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
|
mMenuDialog.setOnDismissListener(null);
|
||||||
mMenuDialog.dismiss();
|
mMenuDialog.dismiss();
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onSaveInstanceState(Bundle outState) {
|
||||||
|
super.onSaveInstanceState(outState);
|
||||||
|
outState.putInt(KEY_ACCESSIBILITY_SHORTCUT_MENU_MODE, mTargetAdapter.getShortcutMenuMode());
|
||||||
|
}
|
||||||
|
|
||||||
private void onTargetSelected(AdapterView<?> parent, View view, int position, long id) {
|
private void onTargetSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
final AccessibilityTarget target = mTargets.get(position);
|
final AccessibilityTarget target = mTargets.get(position);
|
||||||
target.onSelected();
|
target.onSelected();
|
||||||
|
|||||||
@@ -5876,7 +5876,6 @@
|
|||||||
android:excludeFromRecents="true"
|
android:excludeFromRecents="true"
|
||||||
android:documentLaunchMode="never"
|
android:documentLaunchMode="never"
|
||||||
android:relinquishTaskIdentity="true"
|
android:relinquishTaskIdentity="true"
|
||||||
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation|keyboard|keyboardHidden"
|
|
||||||
android:process=":ui"
|
android:process=":ui"
|
||||||
android:visibleToInstantApps="true">
|
android:visibleToInstantApps="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
|||||||
Reference in New Issue
Block a user