aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/android/inputmethod/latin/LatinKeyboard.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/inputmethod/latin/LatinKeyboard.java')
-rw-r--r--src/com/android/inputmethod/latin/LatinKeyboard.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/com/android/inputmethod/latin/LatinKeyboard.java b/src/com/android/inputmethod/latin/LatinKeyboard.java
index 8527d9cd5..9b04aa264 100644
--- a/src/com/android/inputmethod/latin/LatinKeyboard.java
+++ b/src/com/android/inputmethod/latin/LatinKeyboard.java
@@ -37,20 +37,23 @@ public class LatinKeyboard extends Keyboard {
private static final int SHIFT_LOCKED = 2;
private int mShiftState = SHIFT_OFF;
-
+
+ static int sSpacebarVerticalCorrection;
+
public LatinKeyboard(Context context, int xmlLayoutResId) {
this(context, xmlLayoutResId, 0);
}
public LatinKeyboard(Context context, int xmlLayoutResId, int mode) {
super(context, xmlLayoutResId, mode);
- mShiftLockIcon = context.getResources()
- .getDrawable(R.drawable.sym_keyboard_shift_locked);
- mShiftLockPreviewIcon = context.getResources()
- .getDrawable(R.drawable.sym_keyboard_feedback_shift_locked);
+ Resources res = context.getResources();
+ mShiftLockIcon = res.getDrawable(R.drawable.sym_keyboard_shift_locked);
+ mShiftLockPreviewIcon = res.getDrawable(R.drawable.sym_keyboard_feedback_shift_locked);
mShiftLockPreviewIcon.setBounds(0, 0,
mShiftLockPreviewIcon.getIntrinsicWidth(),
mShiftLockPreviewIcon.getIntrinsicHeight());
+ sSpacebarVerticalCorrection = res.getDimensionPixelOffset(
+ R.dimen.spacebar_vertical_correction);
}
public LatinKeyboard(Context context, int layoutTemplateResId,
@@ -225,6 +228,8 @@ public class LatinKeyboard extends Keyboard {
y -= height / 10;
if (code == KEYCODE_SHIFT) x += width / 6;
if (code == KEYCODE_DELETE) x -= width / 6;
+ } else if (code == LatinIME.KEYCODE_SPACE) {
+ y += LatinKeyboard.sSpacebarVerticalCorrection;
}
return super.isInside(x, y);
}