From 03d88c0b1fe382118d37896b78add3bccfb8d52c Mon Sep 17 00:00:00 2001 From: satok Date: Fri, 4 Jun 2010 10:15:50 +0900 Subject: [PATCH] Show a current locale in the space bar Change-Id: I317a0b0b20c3065f2e7454f7b44654a34b97500d --- .../inputmethod/latin/LatinKeyboard.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboard.java b/java/src/com/android/inputmethod/latin/LatinKeyboard.java index 1a9350a83..2dd03389c 100644 --- a/java/src/com/android/inputmethod/latin/LatinKeyboard.java +++ b/java/src/com/android/inputmethod/latin/LatinKeyboard.java @@ -292,9 +292,6 @@ public class LatinKeyboard extends Keyboard { if (mF1Key != null) { mF1Key.icon = mMicIcon; } - if (mSpaceKey != null) { - mSpaceKey.icon = mSpaceIcon; - } } else { mShiftLockIcon = mRes.getDrawable(R.drawable.sym_keyboard_shift_locked); mSpaceIcon = mRes.getDrawable(R.drawable.sym_keyboard_space); @@ -303,9 +300,10 @@ public class LatinKeyboard extends Keyboard { if (mF1Key != null) { mF1Key.icon = mMicIcon; } - if (mSpaceKey != null) { - mSpaceKey.icon = mSpaceIcon; - } + } + if (mSpaceKey != null) { + mSpaceKey.icon = mSpaceIcon; + updateSpaceBarForLocale(f); } } @@ -346,7 +344,7 @@ public class LatinKeyboard extends Keyboard { } } - private void updateSpaceBarForLocale() { + private void updateSpaceBarForLocale(boolean isBlack) { if (mLocale != null) { // Create the graphic for spacebar Bitmap buffer = Bitmap.createBitmap(mSpaceKey.width, mSpaceIcon.getIntrinsicHeight(), @@ -356,7 +354,8 @@ public class LatinKeyboard extends Keyboard { mSpaceKey.icon = new BitmapDrawable(mRes, buffer); mSpaceKey.repeatable = mLanguageSwitcher.getLocaleCount() < 2; } else { - mSpaceKey.icon = mRes.getDrawable(R.drawable.sym_keyboard_space); + mSpaceKey.icon = isBlack ? mRes.getDrawable(R.drawable.sym_bkeyboard_space) + : mRes.getDrawable(R.drawable.sym_keyboard_space); mSpaceKey.repeatable = true; } } @@ -461,7 +460,7 @@ public class LatinKeyboard extends Keyboard { } if (mLocale != null && mLocale.equals(locale)) return; mLocale = locale; - updateSpaceBarForLocale(); + updateSpaceBarForLocale(mIsBlackSym); } boolean isCurrentlyInSpace() {