Merge "Remove unused method"
This commit is contained in:
commit
34400204a5
1 changed files with 5 additions and 13 deletions
|
@ -329,36 +329,28 @@ public class PointerTracker {
|
||||||
return mKeyDetector.getKeyIndexAndNearbyCodes(x, y, null);
|
return mKeyDetector.getKeyIndexAndNearbyCodes(x, y, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSpaceKey(int keyIndex) {
|
|
||||||
Key key = getKey(keyIndex);
|
|
||||||
return key != null && key.mCode == Keyboard.CODE_SPACE;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setReleasedKeyGraphics(int keyIndex) {
|
private void setReleasedKeyGraphics(int keyIndex) {
|
||||||
mDrawingProxy.dismissKeyPreview(this);
|
mDrawingProxy.dismissKeyPreview(this);
|
||||||
final Key key = getKey(keyIndex);
|
final Key key = getKey(keyIndex);
|
||||||
if (key != null) {
|
if (key != null && key.isEnabled()) {
|
||||||
key.onReleased();
|
key.onReleased();
|
||||||
mDrawingProxy.invalidateKey(key);
|
mDrawingProxy.invalidateKey(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setPressedKeyGraphics(int keyIndex) {
|
private void setPressedKeyGraphics(int keyIndex) {
|
||||||
if (isKeyPreviewRequired(keyIndex)) {
|
|
||||||
mDrawingProxy.showKeyPreview(keyIndex, this);
|
|
||||||
}
|
|
||||||
final Key key = getKey(keyIndex);
|
final Key key = getKey(keyIndex);
|
||||||
if (key != null && key.isEnabled()) {
|
if (key != null && key.isEnabled()) {
|
||||||
|
if (isKeyPreviewRequired(key)) {
|
||||||
|
mDrawingProxy.showKeyPreview(keyIndex, this);
|
||||||
|
}
|
||||||
key.onPressed();
|
key.onPressed();
|
||||||
mDrawingProxy.invalidateKey(key);
|
mDrawingProxy.invalidateKey(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// The modifier key, such as shift key, should not show its key preview.
|
// The modifier key, such as shift key, should not show its key preview.
|
||||||
private boolean isKeyPreviewRequired(int keyIndex) {
|
private static boolean isKeyPreviewRequired(Key key) {
|
||||||
final Key key = getKey(keyIndex);
|
|
||||||
if (key == null || !key.isEnabled())
|
|
||||||
return false;
|
|
||||||
final int code = key.mCode;
|
final int code = key.mCode;
|
||||||
if (isModifierCode(code) || code == Keyboard.CODE_DELETE
|
if (isModifierCode(code) || code == Keyboard.CODE_DELETE
|
||||||
|| code == Keyboard.CODE_ENTER || code == Keyboard.CODE_SPACE)
|
|| code == Keyboard.CODE_ENTER || code == Keyboard.CODE_SPACE)
|
||||||
|
|
Loading…
Reference in a new issue