aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/android/inputmethod/latin/LatinKeyboard.java
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2010-01-28 07:33:27 -0800
committerAmith Yamasani <yamasani@google.com>2010-01-28 07:33:27 -0800
commitb1cd7016028f5770da2688f1ec51e0601fc5b9eb (patch)
treed861b93464852a52345ce4197db7bafef3c3c261 /src/com/android/inputmethod/latin/LatinKeyboard.java
parent7a722cbfc8bbb8a7b260895266a0fd3a9baf1994 (diff)
downloadlatinime-b1cd7016028f5770da2688f1ec51e0601fc5b9eb.tar.gz
latinime-b1cd7016028f5770da2688f1ec51e0601fc5b9eb.tar.xz
latinime-b1cd7016028f5770da2688f1ec51e0601fc5b9eb.zip
Setting to move microphone to secondary keyboard.
Microphone button can be optionally moved to the symbols keyboard to get your comma back. You can also completely disable voice input. Now you can get your comma back but still use the swipe gesture to activate voice input.
Diffstat (limited to 'src/com/android/inputmethod/latin/LatinKeyboard.java')
-rw-r--r--src/com/android/inputmethod/latin/LatinKeyboard.java48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/com/android/inputmethod/latin/LatinKeyboard.java b/src/com/android/inputmethod/latin/LatinKeyboard.java
index df38358d6..f876af709 100644
--- a/src/com/android/inputmethod/latin/LatinKeyboard.java
+++ b/src/com/android/inputmethod/latin/LatinKeyboard.java
@@ -38,6 +38,10 @@ public class LatinKeyboard extends Keyboard {
private Drawable mOldShiftIcon;
private Drawable mOldShiftPreviewIcon;
private Drawable mSpaceIcon;
+ private Drawable mMicIcon;
+ private Drawable mMicPreviewIcon;
+ private Drawable m123MicIcon;
+ private Drawable m123MicPreviewIcon;
private Key mShiftKey;
private Key mEnterKey;
private Key mF1Key;
@@ -45,6 +49,7 @@ public class LatinKeyboard extends Keyboard {
/* package */ Locale mLocale;
private Resources mRes;
private int mMode;
+ private boolean mHasVoice;
private int mExtensionResId;
@@ -57,22 +62,26 @@ public class LatinKeyboard extends Keyboard {
static int sSpacebarVerticalCorrection;
public LatinKeyboard(Context context, int xmlLayoutResId) {
- this(context, xmlLayoutResId, 0);
+ this(context, xmlLayoutResId, 0, false);
}
- public LatinKeyboard(Context context, int xmlLayoutResId, int mode) {
+ public LatinKeyboard(Context context, int xmlLayoutResId, int mode, boolean hasVoice) {
super(context, xmlLayoutResId, mode);
final Resources res = context.getResources();
mMode = mode;
mRes = res;
+ mHasVoice = hasVoice;
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());
mSpaceIcon = res.getDrawable(R.drawable.sym_keyboard_space);
+ mMicIcon = res.getDrawable(R.drawable.sym_keyboard_mic);
+ mMicPreviewIcon = res.getDrawable(R.drawable.sym_keyboard_feedback_mic);
sSpacebarVerticalCorrection = res.getDimensionPixelOffset(
R.dimen.spacebar_vertical_correction);
+ setF1Key();
}
public LatinKeyboard(Context context, int layoutTemplateResId,
@@ -227,28 +236,19 @@ public class LatinKeyboard extends Keyboard {
}
private void setF1Key() {
- // TODO
-// else {
-// mSpaceKey.icon = mRes.getDrawable(R.drawable.sym_keyboard_space);
-// switch (mMode) {
-// case KeyboardSwitcher.KEYBOARDMODE_NORMAL:
-// case KeyboardSwitcher.KEYBOARDMODE_IM:
-// mF1Key.label = ",";
-// mF1Key.codes = new int[] { ',' };
-// mF1Key.icon = null;
-// mF1Key.iconPreview = null;
-// break;
-// case KeyboardSwitcher.KEYBOARDMODE_EMAIL:
-// case KeyboardSwitcher.KEYBOARDMODE_URL:
-// mF1Key.label = mRes.getString(R.string.popular_domain_0);
-// mF1Key.codes = new int[] { '.' };
-// mF1Key.text = mF1Key.label;
-// mF1Key.icon = null;
-// mF1Key.iconPreview = null;
-// mF1Key.popupResId = R.xml.popup_domains;
-// break;
-// }
-// }
+ if (mF1Key == null) return;
+ System.err.println("Setting F1 key");
+ if (!mHasVoice) {
+ mF1Key.label = ",";
+ mF1Key.codes = new int[] { ',' };
+ mF1Key.icon = null;
+ mF1Key.iconPreview = null;
+ } else {
+ mF1Key.codes = new int[] { LatinKeyboardView.KEYCODE_VOICE };
+ mF1Key.label = null;
+ mF1Key.icon = mMicIcon;
+ mF1Key.iconPreview = mMicPreviewIcon;
+ }
}
private void updateSpaceBarForLocale() {