Tweak spacebar target area between landscape and portrait.
parent
ffa3fdd819
commit
6a001f58da
|
@ -21,4 +21,5 @@
|
|||
<resources>
|
||||
<dimen name="key_height">47dip</dimen>
|
||||
<dimen name="candidate_strip_height">38dip</dimen>
|
||||
<dimen name="spacebar_vertical_correction">2dip</dimen>
|
||||
</resources>
|
|
@ -22,4 +22,5 @@
|
|||
<dimen name="key_height">54dip</dimen>
|
||||
<dimen name="bubble_pointer_offset">22dip</dimen>
|
||||
<dimen name="candidate_strip_height">42dip</dimen>
|
||||
<dimen name="spacebar_vertical_correction">4dip</dimen>
|
||||
</resources>
|
|
@ -38,19 +38,22 @@ public class LatinKeyboard extends Keyboard {
|
|||
|
||||
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,
|
||||
|
@ -226,7 +229,7 @@ public class LatinKeyboard extends Keyboard {
|
|||
if (code == KEYCODE_SHIFT) x += width / 6;
|
||||
if (code == KEYCODE_DELETE) x -= width / 6;
|
||||
} else if (code == LatinIME.KEYCODE_SPACE) {
|
||||
y += 5;
|
||||
y += LatinKeyboard.sSpacebarVerticalCorrection;
|
||||
}
|
||||
return super.isInside(x, y);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue