Change symbol to use black icons
Change-Id: I834efd322b4ef6e99707028d38223d837a3d4e36
BIN
java/res/drawable-hdpi/sym_bkeyboard_123_mic.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
java/res/drawable-hdpi/sym_bkeyboard_delete.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
java/res/drawable-hdpi/sym_bkeyboard_done.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
java/res/drawable-hdpi/sym_bkeyboard_globe.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
java/res/drawable-hdpi/sym_bkeyboard_mic.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
java/res/drawable-hdpi/sym_bkeyboard_num0.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
java/res/drawable-hdpi/sym_bkeyboard_num1.png
Normal file
After Width: | Height: | Size: 792 B |
BIN
java/res/drawable-hdpi/sym_bkeyboard_num2.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
java/res/drawable-hdpi/sym_bkeyboard_num3.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
java/res/drawable-hdpi/sym_bkeyboard_num4.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
java/res/drawable-hdpi/sym_bkeyboard_num5.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
java/res/drawable-hdpi/sym_bkeyboard_num6.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
java/res/drawable-hdpi/sym_bkeyboard_num7.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
java/res/drawable-hdpi/sym_bkeyboard_num8.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
java/res/drawable-hdpi/sym_bkeyboard_num9.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
java/res/drawable-hdpi/sym_bkeyboard_numalt.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
java/res/drawable-hdpi/sym_bkeyboard_numpound.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
java/res/drawable-hdpi/sym_bkeyboard_numstar.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
java/res/drawable-hdpi/sym_bkeyboard_return.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
java/res/drawable-hdpi/sym_bkeyboard_search.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
java/res/drawable-hdpi/sym_bkeyboard_shift.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
java/res/drawable-hdpi/sym_bkeyboard_shift_locked.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
java/res/drawable-hdpi/sym_bkeyboard_space.png
Normal file
After Width: | Height: | Size: 358 B |
BIN
java/res/drawable-hdpi/sym_bkeyboard_tab.png
Normal file
After Width: | Height: | Size: 1008 B |
BIN
java/res/drawable-hdpi/sym_bkeyboard_tabprev.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 859 B After Width: | Height: | Size: 859 B |
BIN
java/res/drawable-mdpi/sym_bkeyboard_123_mic.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
java/res/drawable-mdpi/sym_bkeyboard_delete.png
Normal file
After Width: | Height: | Size: 800 B |
BIN
java/res/drawable-mdpi/sym_bkeyboard_done.png
Normal file
After Width: | Height: | Size: 775 B |
BIN
java/res/drawable-mdpi/sym_bkeyboard_globe.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
java/res/drawable-mdpi/sym_bkeyboard_mic.png
Normal file
After Width: | Height: | Size: 838 B |
BIN
java/res/drawable-mdpi/sym_bkeyboard_num0.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
java/res/drawable-mdpi/sym_bkeyboard_num1.png
Normal file
After Width: | Height: | Size: 493 B |
BIN
java/res/drawable-mdpi/sym_bkeyboard_num2.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
java/res/drawable-mdpi/sym_bkeyboard_num3.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
java/res/drawable-mdpi/sym_bkeyboard_num4.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
java/res/drawable-mdpi/sym_bkeyboard_num5.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
java/res/drawable-mdpi/sym_bkeyboard_num6.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
java/res/drawable-mdpi/sym_bkeyboard_num7.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
java/res/drawable-mdpi/sym_bkeyboard_num8.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
java/res/drawable-mdpi/sym_bkeyboard_num9.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
java/res/drawable-mdpi/sym_bkeyboard_numalt.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
java/res/drawable-mdpi/sym_bkeyboard_numpound.png
Normal file
After Width: | Height: | Size: 910 B |
BIN
java/res/drawable-mdpi/sym_bkeyboard_numstar.png
Normal file
After Width: | Height: | Size: 943 B |
BIN
java/res/drawable-mdpi/sym_bkeyboard_return.png
Normal file
After Width: | Height: | Size: 834 B |
BIN
java/res/drawable-mdpi/sym_bkeyboard_search.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
java/res/drawable-mdpi/sym_bkeyboard_shift.png
Normal file
After Width: | Height: | Size: 998 B |
BIN
java/res/drawable-mdpi/sym_bkeyboard_shift_locked.png
Normal file
After Width: | Height: | Size: 787 B |
BIN
java/res/drawable-mdpi/sym_bkeyboard_space.png
Normal file
After Width: | Height: | Size: 411 B |
BIN
java/res/drawable-mdpi/sym_bkeyboard_tab.png
Normal file
After Width: | Height: | Size: 627 B |
BIN
java/res/drawable-mdpi/sym_bkeyboard_tabprev.png
Normal file
After Width: | Height: | Size: 605 B |
@ -227,6 +227,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
|
||||
LatinKeyboard keyboard = new LatinKeyboard(
|
||||
mContext, id.mXml, id.mKeyboardMode);
|
||||
keyboard.setVoiceMode(hasVoiceButton(id.mXml == R.xml.kbd_symbols), mHasVoice);
|
||||
keyboard.setBlackFlag(isBlackSym());
|
||||
keyboard.setLanguageSwitcher(mLanguageSwitcher);
|
||||
if (id.mKeyboardMode == KEYBOARDMODE_NORMAL
|
||||
|| id.mKeyboardMode == KEYBOARDMODE_URL
|
||||
@ -250,6 +251,8 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
|
||||
|
||||
private KeyboardId getKeyboardId(int mode, int imeOptions, boolean isSymbols) {
|
||||
boolean hasVoice = hasVoiceButton(isSymbols);
|
||||
// TODO: generalize for any KeyboardId
|
||||
int keyboardRowsResId = isBlackSym() ? R.xml.kbd_qwerty_black : R.xml.kbd_qwerty;
|
||||
if (isSymbols) {
|
||||
return (mode == MODE_PHONE)
|
||||
? new KeyboardId(R.xml.kbd_phone_symbols, hasVoice)
|
||||
@ -258,7 +261,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
|
||||
switch (mode) {
|
||||
case MODE_TEXT:
|
||||
if (mTextMode == MODE_TEXT_QWERTY) {
|
||||
return new KeyboardId(R.xml.kbd_qwerty, KEYBOARDMODE_NORMAL, true, hasVoice);
|
||||
return new KeyboardId(keyboardRowsResId, KEYBOARDMODE_NORMAL, true, hasVoice);
|
||||
} else if (mTextMode == MODE_TEXT_ALPHA) {
|
||||
return new KeyboardId(R.xml.kbd_alpha, KEYBOARDMODE_NORMAL, true, hasVoice);
|
||||
}
|
||||
@ -268,13 +271,13 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
|
||||
case MODE_PHONE:
|
||||
return new KeyboardId(R.xml.kbd_phone, hasVoice);
|
||||
case MODE_URL:
|
||||
return new KeyboardId(R.xml.kbd_qwerty, KEYBOARDMODE_URL, true, hasVoice);
|
||||
return new KeyboardId(keyboardRowsResId, KEYBOARDMODE_URL, true, hasVoice);
|
||||
case MODE_EMAIL:
|
||||
return new KeyboardId(R.xml.kbd_qwerty, KEYBOARDMODE_EMAIL, true, hasVoice);
|
||||
return new KeyboardId(keyboardRowsResId, KEYBOARDMODE_EMAIL, true, hasVoice);
|
||||
case MODE_IM:
|
||||
return new KeyboardId(R.xml.kbd_qwerty, KEYBOARDMODE_IM, true, hasVoice);
|
||||
return new KeyboardId(keyboardRowsResId, KEYBOARDMODE_IM, true, hasVoice);
|
||||
case MODE_WEB:
|
||||
return new KeyboardId(R.xml.kbd_qwerty, KEYBOARDMODE_WEB, true, hasVoice);
|
||||
return new KeyboardId(keyboardRowsResId, KEYBOARDMODE_WEB, true, hasVoice);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -397,4 +400,9 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
|
||||
Integer.valueOf(sharedPreferences.getString(key, DEFAULT_LAYOUT_ID)), false);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Generalize for any theme
|
||||
public boolean isBlackSym () {
|
||||
return (mLayoutId == 6 && mLanguageSwitcher.getInputLanguage().indexOf("en_") >= 0);
|
||||
}
|
||||
}
|
||||
|
@ -81,8 +81,10 @@ public class LatinKeyboard extends Keyboard {
|
||||
private int mPrefLetterY;
|
||||
private int mPrefDistance;
|
||||
|
||||
private int mExtensionResId;
|
||||
|
||||
private int mExtensionResId;
|
||||
// TODO: generalize for any keyboardId
|
||||
private boolean mIsBlackSym;
|
||||
|
||||
private static final int SHIFT_OFF = 0;
|
||||
private static final int SHIFT_ON = 1;
|
||||
private static final int SHIFT_LOCKED = 2;
|
||||
@ -177,8 +179,8 @@ public class LatinKeyboard extends Keyboard {
|
||||
case EditorInfo.IME_ACTION_SEARCH:
|
||||
mEnterKey.iconPreview = res.getDrawable(
|
||||
R.drawable.sym_keyboard_feedback_search);
|
||||
mEnterKey.icon = res.getDrawable(
|
||||
R.drawable.sym_keyboard_search);
|
||||
mEnterKey.icon = res.getDrawable(mIsBlackSym ?
|
||||
R.drawable.sym_bkeyboard_search : R.drawable.sym_keyboard_search);
|
||||
mEnterKey.label = null;
|
||||
break;
|
||||
case EditorInfo.IME_ACTION_SEND:
|
||||
@ -196,8 +198,8 @@ public class LatinKeyboard extends Keyboard {
|
||||
} else {
|
||||
mEnterKey.iconPreview = res.getDrawable(
|
||||
R.drawable.sym_keyboard_feedback_return);
|
||||
mEnterKey.icon = res.getDrawable(
|
||||
R.drawable.sym_keyboard_return);
|
||||
mEnterKey.icon = res.getDrawable(mIsBlackSym ?
|
||||
R.drawable.sym_bkeyboard_return : R.drawable.sym_keyboard_return);
|
||||
mEnterKey.label = null;
|
||||
}
|
||||
break;
|
||||
@ -279,6 +281,23 @@ public class LatinKeyboard extends Keyboard {
|
||||
return mExtensionResId;
|
||||
}
|
||||
|
||||
public void setBlackFlag(boolean f) {
|
||||
mIsBlackSym = f;
|
||||
if (f) {
|
||||
mShiftLockIcon = mRes.getDrawable(R.drawable.sym_bkeyboard_shift_locked);
|
||||
mSpaceIcon = mRes.getDrawable(R.drawable.sym_bkeyboard_space);
|
||||
mMicIcon = mRes.getDrawable(R.drawable.sym_bkeyboard_mic);
|
||||
m123MicIcon = mRes.getDrawable(R.drawable.sym_bkeyboard_123_mic);
|
||||
mF1Key.icon = mRes.getDrawable(R.drawable.sym_bkeyboard_mic);
|
||||
} else {
|
||||
mShiftLockIcon = mRes.getDrawable(R.drawable.sym_keyboard_shift_locked);
|
||||
mSpaceIcon = mRes.getDrawable(R.drawable.sym_keyboard_space);
|
||||
mMicIcon = mRes.getDrawable(R.drawable.sym_keyboard_mic);
|
||||
m123MicIcon = mRes.getDrawable(R.drawable.sym_keyboard_123_mic);
|
||||
mF1Key.icon = mRes.getDrawable(R.drawable.sym_keyboard_mic);
|
||||
}
|
||||
}
|
||||
|
||||
private void setDefaultBounds(Drawable drawable) {
|
||||
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
|
||||
}
|
||||
|