Skip to content
Snippets Groups Projects
Commit b428e8cc authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka Committed by Android (Google) Code Review
Browse files

Merge "Disable popup preview and long press on disabled key"

parents 299e366b 967d6073
No related branches found
No related tags found
No related merge requests found
...@@ -379,7 +379,7 @@ public class Key { ...@@ -379,7 +379,7 @@ public class Key {
* @see android.graphics.drawable.StateListDrawable#setState(int[]) * @see android.graphics.drawable.StateListDrawable#setState(int[])
*/ */
public int[] getCurrentDrawableState() { public int[] getCurrentDrawableState() {
final boolean pressed = mEnabled && mPressed; final boolean pressed = mPressed;
if (!mSticky && mFunctional) { if (!mSticky && mFunctional) {
if (pressed) { if (pressed) {
return KEY_STATE_FUNCTIONAL_PRESSED; return KEY_STATE_FUNCTIONAL_PRESSED;
......
...@@ -546,6 +546,9 @@ public class PointerTracker { ...@@ -546,6 +546,9 @@ public class PointerTracker {
} }
private void showKeyPreviewAndUpdateKeyGraphics(int keyIndex) { private void showKeyPreviewAndUpdateKeyGraphics(int keyIndex) {
final Key key = getKey(keyIndex);
if (key != null && !key.mEnabled)
return;
updateKeyGraphics(keyIndex); updateKeyGraphics(keyIndex);
// The modifier key, such as shift key, should not be shown as preview when multi-touch is // The modifier key, such as shift key, should not be shown as preview when multi-touch is
// supported. On the other hand, if multi-touch is not supported, the modifier key should // supported. On the other hand, if multi-touch is not supported, the modifier key should
...@@ -565,6 +568,8 @@ public class PointerTracker { ...@@ -565,6 +568,8 @@ public class PointerTracker {
return; return;
} }
Key key = getKey(keyIndex); Key key = getKey(keyIndex);
if (!key.mEnabled)
return;
if (key.mCode == Keyboard.CODE_SHIFT) { if (key.mCode == Keyboard.CODE_SHIFT) {
mHandler.startLongPressShiftTimer(mLongPressShiftKeyTimeout, keyIndex, this); mHandler.startLongPressShiftTimer(mLongPressShiftKeyTimeout, keyIndex, this);
} else if (key.mManualTemporaryUpperCaseCode != Keyboard.CODE_DUMMY } else if (key.mManualTemporaryUpperCaseCode != Keyboard.CODE_DUMMY
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment