DO NOT MERGE Fix Keyboard Shortcut Helper requires pressing META+/ twice
am: 9fe1077b05
* commit '9fe1077b0506f7b425ae3ca355dbc4c62df16aad':
DO NOT MERGE Fix Keyboard Shortcut Helper requires pressing META+/ twice
Change-Id: I6cdb2a8206baa3334542f2bdbaa2001d38890b98
This commit is contained in:
@@ -72,7 +72,6 @@ public final class KeyboardShortcuts {
|
|||||||
private static final String TAG = KeyboardShortcuts.class.getSimpleName();
|
private static final String TAG = KeyboardShortcuts.class.getSimpleName();
|
||||||
private static final Object sLock = new Object();
|
private static final Object sLock = new Object();
|
||||||
private static KeyboardShortcuts sInstance;
|
private static KeyboardShortcuts sInstance;
|
||||||
private static boolean sIsShowing;
|
|
||||||
|
|
||||||
private final SparseArray<String> mSpecialCharacterNames = new SparseArray<>();
|
private final SparseArray<String> mSpecialCharacterNames = new SparseArray<>();
|
||||||
private final SparseArray<String> mModifierNames = new SparseArray<>();
|
private final SparseArray<String> mModifierNames = new SparseArray<>();
|
||||||
@@ -131,13 +130,12 @@ public final class KeyboardShortcuts {
|
|||||||
dismiss();
|
dismiss();
|
||||||
}
|
}
|
||||||
getInstance(context).showKeyboardShortcuts(deviceId);
|
getInstance(context).showKeyboardShortcuts(deviceId);
|
||||||
sIsShowing = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void toggle(Context context, int deviceId) {
|
public static void toggle(Context context, int deviceId) {
|
||||||
synchronized (sLock) {
|
synchronized (sLock) {
|
||||||
if (sIsShowing) {
|
if (isShowing()) {
|
||||||
dismiss();
|
dismiss();
|
||||||
} else {
|
} else {
|
||||||
show(context, deviceId);
|
show(context, deviceId);
|
||||||
@@ -151,10 +149,14 @@ public final class KeyboardShortcuts {
|
|||||||
sInstance.dismissKeyboardShortcuts();
|
sInstance.dismissKeyboardShortcuts();
|
||||||
sInstance = null;
|
sInstance = null;
|
||||||
}
|
}
|
||||||
sIsShowing = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static boolean isShowing() {
|
||||||
|
return sInstance != null && sInstance.mKeyboardShortcutsDialog != null
|
||||||
|
&& sInstance.mKeyboardShortcutsDialog.isShowing();
|
||||||
|
}
|
||||||
|
|
||||||
private void loadResources(Context context) {
|
private void loadResources(Context context) {
|
||||||
mSpecialCharacterNames.put(
|
mSpecialCharacterNames.put(
|
||||||
KeyEvent.KEYCODE_HOME, context.getString(R.string.keyboard_key_home));
|
KeyEvent.KEYCODE_HOME, context.getString(R.string.keyboard_key_home));
|
||||||
|
|||||||
Reference in New Issue
Block a user