From 8e1f1be0f3cfce4ed0623d3d137f53f034f5b718 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Fri, 1 Oct 2010 16:42:13 +0900 Subject: [PATCH] Long press mic/comma key bring mini keyboard with settings Bug: 3050703 Change-Id: I090b2bfebfb48e5ec461615d4c911024ea6d130a --- java/res/values/keycodes.xml | 1 + java/res/xml-da/kbd_qwerty.xml | 12 ------ java/res/xml-da/kbd_qwerty_black.xml | 24 +++-------- java/res/xml-de/kbd_qwerty.xml | 12 ------ java/res/xml-de/kbd_qwerty_black.xml | 24 +++-------- java/res/xml-fr/kbd_qwerty.xml | 12 ------ java/res/xml-fr/kbd_qwerty_black.xml | 24 +++-------- java/res/xml-iw/kbd_qwerty.xml | 12 ------ java/res/xml-iw/kbd_qwerty_black.xml | 24 +++-------- java/res/xml-nb/kbd_qwerty.xml | 12 ------ java/res/xml-nb/kbd_qwerty_black.xml | 24 +++-------- java/res/xml-ru/kbd_qwerty.xml | 12 ------ java/res/xml-ru/kbd_qwerty_black.xml | 24 +++-------- java/res/xml-sr/kbd_qwerty.xml | 12 ------ java/res/xml-sr/kbd_qwerty_black.xml | 24 +++-------- java/res/xml-sv/kbd_qwerty.xml | 12 ------ java/res/xml-sv/kbd_qwerty_black.xml | 24 +++-------- java/res/xml/kbd_qwerty.xml | 12 ------ java/res/xml/kbd_qwerty_black.xml | 24 +++-------- java/res/xml/popup_comma.xml | 39 ++++++++++++++++++ java/res/xml/popup_mic.xml | 40 +++++++++++++++++++ .../inputmethod/latin/LatinKeyboard.java | 2 + .../inputmethod/latin/LatinKeyboardView.java | 10 ----- 23 files changed, 136 insertions(+), 280 deletions(-) create mode 100644 java/res/xml/popup_comma.xml create mode 100644 java/res/xml/popup_mic.xml diff --git a/java/res/values/keycodes.xml b/java/res/values/keycodes.xml index 9dded508a..c5d5b3cd1 100644 --- a/java/res/values/keycodes.xml +++ b/java/res/values/keycodes.xml @@ -27,5 +27,6 @@ -5 -100 + -102 -103 diff --git a/java/res/xml-da/kbd_qwerty.xml b/java/res/xml-da/kbd_qwerty.xml index a17d604bf..084795463 100644 --- a/java/res/xml-da/kbd_qwerty.xml +++ b/java/res/xml-da/kbd_qwerty.xml @@ -176,8 +176,6 @@ android:keyEdgeFlags="left" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + android:codes="@integer/key_f1" /> + + + + + + + + diff --git a/java/res/xml/popup_mic.xml b/java/res/xml/popup_mic.xml new file mode 100644 index 000000000..f3cc63817 --- /dev/null +++ b/java/res/xml/popup_mic.xml @@ -0,0 +1,40 @@ + + + + + + + + + diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboard.java b/java/src/com/android/inputmethod/latin/LatinKeyboard.java index 14a503bc3..43d0a7beb 100644 --- a/java/src/com/android/inputmethod/latin/LatinKeyboard.java +++ b/java/src/com/android/inputmethod/latin/LatinKeyboard.java @@ -367,11 +367,13 @@ public class LatinKeyboard extends Keyboard { mF1Key.label = null; mF1Key.icon = mMicIcon; mF1Key.iconPreview = mMicPreviewIcon; + mF1Key.popupResId = R.xml.popup_mic; } else { mF1Key.label = ","; mF1Key.codes = new int[] { ',' }; mF1Key.icon = null; mF1Key.iconPreview = null; + mF1Key.popupResId = R.xml.popup_comma; } } diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboardView.java b/java/src/com/android/inputmethod/latin/LatinKeyboardView.java index c4afd9a27..22d39f7aa 100644 --- a/java/src/com/android/inputmethod/latin/LatinKeyboardView.java +++ b/java/src/com/android/inputmethod/latin/LatinKeyboardView.java @@ -17,7 +17,6 @@ package com.android.inputmethod.latin; import android.content.Context; -import android.content.res.Resources; import android.graphics.Canvas; import android.graphics.Paint; import android.inputmethodservice.Keyboard; @@ -42,8 +41,6 @@ public class LatinKeyboardView extends LatinKeyboardBaseView { private Keyboard mPhoneKeyboard; - private final boolean mLongPressCommaForSettingsEnabled; - /** Whether we've started dropping move events because we found a big jump */ private boolean mDroppingEvents; /** @@ -62,10 +59,6 @@ public class LatinKeyboardView extends LatinKeyboardBaseView { public LatinKeyboardView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); - - Resources res = context.getResources(); - mLongPressCommaForSettingsEnabled = res.getBoolean( - R.bool.config_long_press_comma_for_settings_enabled); } public void setPhoneKeyboard(Keyboard phoneKeyboard) { @@ -101,9 +94,6 @@ public class LatinKeyboardView extends LatinKeyboardBaseView { } else if (primaryCode == '0' && getKeyboard() == mPhoneKeyboard) { // Long pressing on 0 in phone number keypad gives you a '+'. return invokeOnKey('+'); - } else if (primaryCode == KEYCODE_VOICE - || (primaryCode == ',' && mLongPressCommaForSettingsEnabled)) { - return invokeOnKey(KEYCODE_OPTIONS); } else { return super.onLongPress(key); }