Change symbol to use black icons
Change-Id: I834efd322b4ef6e99707028d38223d837a3d4e36main
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 792 B |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 358 B |
After Width: | Height: | Size: 1008 B |
After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 859 B After Width: | Height: | Size: 859 B |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 775 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 838 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 493 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 910 B |
After Width: | Height: | Size: 943 B |
After Width: | Height: | Size: 834 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 998 B |
After Width: | Height: | Size: 787 B |
After Width: | Height: | Size: 411 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 605 B |
|
@ -227,6 +227,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
|
||||||
LatinKeyboard keyboard = new LatinKeyboard(
|
LatinKeyboard keyboard = new LatinKeyboard(
|
||||||
mContext, id.mXml, id.mKeyboardMode);
|
mContext, id.mXml, id.mKeyboardMode);
|
||||||
keyboard.setVoiceMode(hasVoiceButton(id.mXml == R.xml.kbd_symbols), mHasVoice);
|
keyboard.setVoiceMode(hasVoiceButton(id.mXml == R.xml.kbd_symbols), mHasVoice);
|
||||||
|
keyboard.setBlackFlag(isBlackSym());
|
||||||
keyboard.setLanguageSwitcher(mLanguageSwitcher);
|
keyboard.setLanguageSwitcher(mLanguageSwitcher);
|
||||||
if (id.mKeyboardMode == KEYBOARDMODE_NORMAL
|
if (id.mKeyboardMode == KEYBOARDMODE_NORMAL
|
||||||
|| id.mKeyboardMode == KEYBOARDMODE_URL
|
|| id.mKeyboardMode == KEYBOARDMODE_URL
|
||||||
|
@ -250,6 +251,8 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
|
||||||
|
|
||||||
private KeyboardId getKeyboardId(int mode, int imeOptions, boolean isSymbols) {
|
private KeyboardId getKeyboardId(int mode, int imeOptions, boolean isSymbols) {
|
||||||
boolean hasVoice = hasVoiceButton(isSymbols);
|
boolean hasVoice = hasVoiceButton(isSymbols);
|
||||||
|
// TODO: generalize for any KeyboardId
|
||||||
|
int keyboardRowsResId = isBlackSym() ? R.xml.kbd_qwerty_black : R.xml.kbd_qwerty;
|
||||||
if (isSymbols) {
|
if (isSymbols) {
|
||||||
return (mode == MODE_PHONE)
|
return (mode == MODE_PHONE)
|
||||||
? new KeyboardId(R.xml.kbd_phone_symbols, hasVoice)
|
? new KeyboardId(R.xml.kbd_phone_symbols, hasVoice)
|
||||||
|
@ -258,7 +261,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case MODE_TEXT:
|
case MODE_TEXT:
|
||||||
if (mTextMode == MODE_TEXT_QWERTY) {
|
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) {
|
} else if (mTextMode == MODE_TEXT_ALPHA) {
|
||||||
return new KeyboardId(R.xml.kbd_alpha, KEYBOARDMODE_NORMAL, true, hasVoice);
|
return new KeyboardId(R.xml.kbd_alpha, KEYBOARDMODE_NORMAL, true, hasVoice);
|
||||||
}
|
}
|
||||||
|
@ -268,13 +271,13 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
|
||||||
case MODE_PHONE:
|
case MODE_PHONE:
|
||||||
return new KeyboardId(R.xml.kbd_phone, hasVoice);
|
return new KeyboardId(R.xml.kbd_phone, hasVoice);
|
||||||
case MODE_URL:
|
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:
|
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:
|
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:
|
case MODE_WEB:
|
||||||
return new KeyboardId(R.xml.kbd_qwerty, KEYBOARDMODE_WEB, true, hasVoice);
|
return new KeyboardId(keyboardRowsResId, KEYBOARDMODE_WEB, true, hasVoice);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -397,4 +400,9 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
|
||||||
Integer.valueOf(sharedPreferences.getString(key, DEFAULT_LAYOUT_ID)), false);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,6 +82,8 @@ public class LatinKeyboard extends Keyboard {
|
||||||
private int mPrefDistance;
|
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_OFF = 0;
|
||||||
private static final int SHIFT_ON = 1;
|
private static final int SHIFT_ON = 1;
|
||||||
|
@ -177,8 +179,8 @@ public class LatinKeyboard extends Keyboard {
|
||||||
case EditorInfo.IME_ACTION_SEARCH:
|
case EditorInfo.IME_ACTION_SEARCH:
|
||||||
mEnterKey.iconPreview = res.getDrawable(
|
mEnterKey.iconPreview = res.getDrawable(
|
||||||
R.drawable.sym_keyboard_feedback_search);
|
R.drawable.sym_keyboard_feedback_search);
|
||||||
mEnterKey.icon = res.getDrawable(
|
mEnterKey.icon = res.getDrawable(mIsBlackSym ?
|
||||||
R.drawable.sym_keyboard_search);
|
R.drawable.sym_bkeyboard_search : R.drawable.sym_keyboard_search);
|
||||||
mEnterKey.label = null;
|
mEnterKey.label = null;
|
||||||
break;
|
break;
|
||||||
case EditorInfo.IME_ACTION_SEND:
|
case EditorInfo.IME_ACTION_SEND:
|
||||||
|
@ -196,8 +198,8 @@ public class LatinKeyboard extends Keyboard {
|
||||||
} else {
|
} else {
|
||||||
mEnterKey.iconPreview = res.getDrawable(
|
mEnterKey.iconPreview = res.getDrawable(
|
||||||
R.drawable.sym_keyboard_feedback_return);
|
R.drawable.sym_keyboard_feedback_return);
|
||||||
mEnterKey.icon = res.getDrawable(
|
mEnterKey.icon = res.getDrawable(mIsBlackSym ?
|
||||||
R.drawable.sym_keyboard_return);
|
R.drawable.sym_bkeyboard_return : R.drawable.sym_keyboard_return);
|
||||||
mEnterKey.label = null;
|
mEnterKey.label = null;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -279,6 +281,23 @@ public class LatinKeyboard extends Keyboard {
|
||||||
return mExtensionResId;
|
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) {
|
private void setDefaultBounds(Drawable drawable) {
|
||||||
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
|
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
|
||||||
}
|
}
|
||||||
|
|