aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinKeyboard.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2010-11-23 23:59:56 -0800
committerTadashi G. Takaoka <takaoka@google.com>2010-11-25 00:11:21 -0800
commit7f0befe1f0e346ec6468f229f337eda32e19f6d8 (patch)
tree63ec28b201708fca18c4da3eb5340fdd508d8d77 /java/src/com/android/inputmethod/latin/LatinKeyboard.java
parent79efbed76f638be298493107fa2d0cd1b5eb529e (diff)
downloadlatinime-7f0befe1f0e346ec6468f229f337eda32e19f6d8.tar.gz
latinime-7f0befe1f0e346ec6468f229f337eda32e19f6d8.tar.xz
latinime-7f0befe1f0e346ec6468f229f337eda32e19f6d8.zip
Update tablet keyboard layout to the latest design
This change introduces shiftedIcon attribute for Key which specifies icon to draw the shift key while the key is in shifted state. This change also intriduces new configurable dimension value key_label_horizontal_alignment_padding which represents horizontal padding for left or right alignment of key label. Bug: 3216592 Bug: 3201839 Change-Id: I3aa7392227ce573c404517678e6340a8d1fcb328
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinKeyboard.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinKeyboard.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboard.java b/java/src/com/android/inputmethod/latin/LatinKeyboard.java
index c6e911680..cae0b10b3 100644
--- a/java/src/com/android/inputmethod/latin/LatinKeyboard.java
+++ b/java/src/com/android/inputmethod/latin/LatinKeyboard.java
@@ -37,6 +37,7 @@ import android.view.ViewConfiguration;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
+import java.util.Map;
public class LatinKeyboard extends BaseKeyboard {
@@ -45,7 +46,6 @@ public class LatinKeyboard extends BaseKeyboard {
private static final int OPACITY_FULLY_OPAQUE = 255;
private static final int SPACE_LED_LENGTH_PERCENT = 80;
- private final Drawable mShiftedIcon;
private Drawable mShiftLockPreviewIcon;
private final HashMap<Key, Drawable> mNormalShiftIcons = new HashMap<Key, Drawable>();
private Drawable mSpaceIcon;
@@ -89,11 +89,9 @@ public class LatinKeyboard extends BaseKeyboard {
mContext = context;
mRes = res;
if (id.mColorScheme == BaseKeyboardView.COLOR_SCHEME_BLACK) {
- mShiftedIcon = res.getDrawable(R.drawable.sym_bkeyboard_shift_locked);
mSpaceBarTextShadowColor = res.getColor(
R.color.latinkeyboard_bar_language_shadow_black);
} else { // default color scheme is BaseKeyboardView.COLOR_SCHEME_WHITE
- mShiftedIcon = res.getDrawable(R.drawable.sym_keyboard_shift_locked);
mSpaceBarTextShadowColor = res.getColor(
R.color.latinkeyboard_bar_language_shadow_white);
}
@@ -132,9 +130,10 @@ public class LatinKeyboard extends BaseKeyboard {
}
public boolean setShiftLocked(boolean newShiftLockState) {
+ final Map<Key, Drawable> shiftedIcons = getShiftedIcons();
for (final Key key : getShiftKeys()) {
key.on = newShiftLockState;
- key.icon = newShiftLockState ? mShiftedIcon : mNormalShiftIcons.get(key);
+ key.icon = newShiftLockState ? shiftedIcons.get(key) : mNormalShiftIcons.get(key);
}
mShiftState.setShiftLocked(newShiftLockState);
return true;
@@ -149,11 +148,12 @@ public class LatinKeyboard extends BaseKeyboard {
if (getShiftKeys().size() == 0)
return super.setShifted(newShiftState);
+ final Map<Key, Drawable> shiftedIcons = getShiftedIcons();
for (final Key key : getShiftKeys()) {
if (!newShiftState && !mShiftState.isShiftLocked()) {
key.icon = mNormalShiftIcons.get(key);
} else if (newShiftState && !mShiftState.isShiftedOrShiftLocked()) {
- key.icon = mShiftedIcon;
+ key.icon = shiftedIcons.get(key);
}
}
return mShiftState.setShifted(newShiftState);