Jim Miller | 0b31970 | 2010-02-05 18:51:59 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 Google Inc. |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| 5 | * use this file except in compliance with the License. You may obtain a copy of |
| 6 | * the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 13 | * License for the specific language governing permissions and limitations under |
| 14 | * the License. |
| 15 | */ |
| 16 | |
| 17 | package com.android.internal.widget; |
| 18 | |
| 19 | import android.content.Context; |
Jim Miller | 281a80d | 2010-02-18 19:54:22 -0800 | [diff] [blame] | 20 | import android.content.res.Resources; |
Jim Miller | 0b31970 | 2010-02-05 18:51:59 -0800 | [diff] [blame] | 21 | import android.inputmethodservice.Keyboard; |
| 22 | import android.inputmethodservice.KeyboardView; |
| 23 | import android.inputmethodservice.KeyboardView.OnKeyboardActionListener; |
Jim Miller | 0b31970 | 2010-02-05 18:51:59 -0800 | [diff] [blame] | 24 | import android.os.SystemClock; |
Jim Miller | 280b602 | 2010-02-09 19:05:02 -0800 | [diff] [blame] | 25 | import android.provider.Settings; |
Jim Miller | 281a80d | 2010-02-18 19:54:22 -0800 | [diff] [blame] | 26 | import android.util.Log; |
Jim Miller | aef555b | 2011-10-12 16:41:30 -0700 | [diff] [blame] | 27 | import android.view.HapticFeedbackConstants; |
Jim Miller | 0b31970 | 2010-02-05 18:51:59 -0800 | [diff] [blame] | 28 | import android.view.KeyCharacterMap; |
| 29 | import android.view.KeyEvent; |
| 30 | import android.view.View; |
Jim Miller | 79a02b1 | 2011-07-29 18:07:32 -0700 | [diff] [blame] | 31 | import android.view.ViewGroup; |
Jim Miller | 3af630c | 2012-09-26 14:29:18 -0700 | [diff] [blame] | 32 | import android.view.ViewGroup.LayoutParams; |
Dianne Hackborn | 6dd005b | 2011-07-18 13:22:50 -0700 | [diff] [blame] | 33 | import android.view.ViewRootImpl; |
Jim Miller | 0b31970 | 2010-02-05 18:51:59 -0800 | [diff] [blame] | 34 | import com.android.internal.R; |
| 35 | |
| 36 | public class PasswordEntryKeyboardHelper implements OnKeyboardActionListener { |
| 37 | |
| 38 | public static final int KEYBOARD_MODE_ALPHA = 0; |
| 39 | public static final int KEYBOARD_MODE_NUMERIC = 1; |
| 40 | private static final int KEYBOARD_STATE_NORMAL = 0; |
| 41 | private static final int KEYBOARD_STATE_SHIFTED = 1; |
| 42 | private static final int KEYBOARD_STATE_CAPSLOCK = 2; |
Jim Miller | 281a80d | 2010-02-18 19:54:22 -0800 | [diff] [blame] | 43 | private static final String TAG = "PasswordEntryKeyboardHelper"; |
Jim Miller | 0b31970 | 2010-02-05 18:51:59 -0800 | [diff] [blame] | 44 | private int mKeyboardMode = KEYBOARD_MODE_ALPHA; |
| 45 | private int mKeyboardState = KEYBOARD_STATE_NORMAL; |
| 46 | private PasswordEntryKeyboard mQwertyKeyboard; |
| 47 | private PasswordEntryKeyboard mQwertyKeyboardShifted; |
| 48 | private PasswordEntryKeyboard mSymbolsKeyboard; |
| 49 | private PasswordEntryKeyboard mSymbolsKeyboardShifted; |
| 50 | private PasswordEntryKeyboard mNumericKeyboard; |
Ben Komalo | 51ea88a | 2011-10-03 10:53:26 -0700 | [diff] [blame] | 51 | private final Context mContext; |
| 52 | private final View mTargetView; |
| 53 | private final KeyboardView mKeyboardView; |
Jim Miller | 281a80d | 2010-02-18 19:54:22 -0800 | [diff] [blame] | 54 | private long[] mVibratePattern; |
Jim Miller | aef555b | 2011-10-12 16:41:30 -0700 | [diff] [blame] | 55 | private boolean mEnableHaptics = false; |
Jim Miller | 0b31970 | 2010-02-05 18:51:59 -0800 | [diff] [blame] | 56 | |
Jim Miller | 3af630c | 2012-09-26 14:29:18 -0700 | [diff] [blame] | 57 | private static final int NUMERIC = 0; |
| 58 | private static final int QWERTY = 1; |
| 59 | private static final int QWERTY_SHIFTED = 2; |
| 60 | private static final int SYMBOLS = 3; |
| 61 | private static final int SYMBOLS_SHIFTED = 4; |
| 62 | |
| 63 | int mLayouts[] = new int[] { |
| 64 | R.xml.password_kbd_numeric, |
| 65 | R.xml.password_kbd_qwerty, |
| 66 | R.xml.password_kbd_qwerty_shifted, |
| 67 | R.xml.password_kbd_symbols, |
| 68 | R.xml.password_kbd_symbols_shift |
| 69 | }; |
| 70 | |
| 71 | private boolean mUsingScreenWidth; |
| 72 | |
Jim Miller | 0b31970 | 2010-02-05 18:51:59 -0800 | [diff] [blame] | 73 | public PasswordEntryKeyboardHelper(Context context, KeyboardView keyboardView, View targetView) { |
Jim Miller | 3af630c | 2012-09-26 14:29:18 -0700 | [diff] [blame] | 74 | this(context, keyboardView, targetView, true, null); |
Jae Yong Sung | 8171b51 | 2010-08-05 10:44:27 -0700 | [diff] [blame] | 75 | } |
| 76 | |
| 77 | public PasswordEntryKeyboardHelper(Context context, KeyboardView keyboardView, View targetView, |
| 78 | boolean useFullScreenWidth) { |
Jim Miller | 3af630c | 2012-09-26 14:29:18 -0700 | [diff] [blame] | 79 | this(context, keyboardView, targetView, useFullScreenWidth, null); |
| 80 | } |
| 81 | |
| 82 | public PasswordEntryKeyboardHelper(Context context, KeyboardView keyboardView, View targetView, |
| 83 | boolean useFullScreenWidth, int layouts[]) { |
Jim Miller | 0b31970 | 2010-02-05 18:51:59 -0800 | [diff] [blame] | 84 | mContext = context; |
| 85 | mTargetView = targetView; |
| 86 | mKeyboardView = keyboardView; |
Jim Miller | 0b31970 | 2010-02-05 18:51:59 -0800 | [diff] [blame] | 87 | mKeyboardView.setOnKeyboardActionListener(this); |
Jim Miller | 3af630c | 2012-09-26 14:29:18 -0700 | [diff] [blame] | 88 | mUsingScreenWidth = useFullScreenWidth; |
| 89 | if (layouts != null) { |
| 90 | if (layouts.length != mLayouts.length) { |
| 91 | throw new RuntimeException("Wrong number of layouts"); |
| 92 | } |
| 93 | for (int i = 0; i < mLayouts.length; i++) { |
| 94 | mLayouts[i] = layouts[i]; |
| 95 | } |
| 96 | } |
| 97 | createKeyboards(); |
| 98 | } |
| 99 | |
| 100 | public void createKeyboards() { |
| 101 | LayoutParams lp = mKeyboardView.getLayoutParams(); |
| 102 | if (mUsingScreenWidth || lp.width == ViewGroup.LayoutParams.MATCH_PARENT) { |
| 103 | createKeyboardsWithDefaultWidth(); |
| 104 | } else { |
| 105 | createKeyboardsWithSpecificSize(lp.width, lp.height); |
| 106 | } |
Jim Miller | aef555b | 2011-10-12 16:41:30 -0700 | [diff] [blame] | 107 | } |
| 108 | |
| 109 | public void setEnableHaptics(boolean enabled) { |
| 110 | mEnableHaptics = enabled; |
Jim Miller | 0b31970 | 2010-02-05 18:51:59 -0800 | [diff] [blame] | 111 | } |
| 112 | |
| 113 | public boolean isAlpha() { |
| 114 | return mKeyboardMode == KEYBOARD_MODE_ALPHA; |
| 115 | } |
| 116 | |
Jim Miller | 3af630c | 2012-09-26 14:29:18 -0700 | [diff] [blame] | 117 | private void createKeyboardsWithSpecificSize(int width, int height) { |
| 118 | mNumericKeyboard = new PasswordEntryKeyboard(mContext, mLayouts[NUMERIC], width, height); |
| 119 | mQwertyKeyboard = new PasswordEntryKeyboard(mContext, mLayouts[QWERTY], R.id.mode_normal, |
| 120 | width, height); |
Jae Yong Sung | 8171b51 | 2010-08-05 10:44:27 -0700 | [diff] [blame] | 121 | mQwertyKeyboard.enableShiftLock(); |
| 122 | |
Jim Miller | 3af630c | 2012-09-26 14:29:18 -0700 | [diff] [blame] | 123 | mQwertyKeyboardShifted = new PasswordEntryKeyboard(mContext, mLayouts[QWERTY_SHIFTED], |
| 124 | R.id.mode_normal, width, height); |
Jae Yong Sung | 8171b51 | 2010-08-05 10:44:27 -0700 | [diff] [blame] | 125 | mQwertyKeyboardShifted.enableShiftLock(); |
| 126 | mQwertyKeyboardShifted.setShifted(true); // always shifted. |
| 127 | |
Jim Miller | 3af630c | 2012-09-26 14:29:18 -0700 | [diff] [blame] | 128 | mSymbolsKeyboard = new PasswordEntryKeyboard(mContext, mLayouts[SYMBOLS], width, height); |
Jae Yong Sung | 8171b51 | 2010-08-05 10:44:27 -0700 | [diff] [blame] | 129 | mSymbolsKeyboard.enableShiftLock(); |
| 130 | |
Jim Miller | 3af630c | 2012-09-26 14:29:18 -0700 | [diff] [blame] | 131 | mSymbolsKeyboardShifted = new PasswordEntryKeyboard(mContext, mLayouts[SYMBOLS_SHIFTED], |
| 132 | width, height); |
Jae Yong Sung | 8171b51 | 2010-08-05 10:44:27 -0700 | [diff] [blame] | 133 | mSymbolsKeyboardShifted.enableShiftLock(); |
| 134 | mSymbolsKeyboardShifted.setShifted(true); // always shifted |
| 135 | } |
| 136 | |
Jim Miller | 3af630c | 2012-09-26 14:29:18 -0700 | [diff] [blame] | 137 | private void createKeyboardsWithDefaultWidth() { |
| 138 | mNumericKeyboard = new PasswordEntryKeyboard(mContext, mLayouts[NUMERIC]); |
| 139 | mQwertyKeyboard = new PasswordEntryKeyboard(mContext, mLayouts[QWERTY], R.id.mode_normal); |
Jim Miller | 0b31970 | 2010-02-05 18:51:59 -0800 | [diff] [blame] | 140 | mQwertyKeyboard.enableShiftLock(); |
| 141 | |
Jim Miller | 3af630c | 2012-09-26 14:29:18 -0700 | [diff] [blame] | 142 | mQwertyKeyboardShifted = new PasswordEntryKeyboard(mContext, mLayouts[QWERTY_SHIFTED], |
Jim Miller | 0b31970 | 2010-02-05 18:51:59 -0800 | [diff] [blame] | 143 | R.id.mode_normal); |
| 144 | mQwertyKeyboardShifted.enableShiftLock(); |
| 145 | mQwertyKeyboardShifted.setShifted(true); // always shifted. |
| 146 | |
Jim Miller | 3af630c | 2012-09-26 14:29:18 -0700 | [diff] [blame] | 147 | mSymbolsKeyboard = new PasswordEntryKeyboard(mContext, mLayouts[SYMBOLS]); |
Jim Miller | 0b31970 | 2010-02-05 18:51:59 -0800 | [diff] [blame] | 148 | mSymbolsKeyboard.enableShiftLock(); |
| 149 | |
Jim Miller | 3af630c | 2012-09-26 14:29:18 -0700 | [diff] [blame] | 150 | mSymbolsKeyboardShifted = new PasswordEntryKeyboard(mContext, mLayouts[SYMBOLS_SHIFTED]); |
Jim Miller | 0b31970 | 2010-02-05 18:51:59 -0800 | [diff] [blame] | 151 | mSymbolsKeyboardShifted.enableShiftLock(); |
| 152 | mSymbolsKeyboardShifted.setShifted(true); // always shifted |
| 153 | } |
| 154 | |
| 155 | public void setKeyboardMode(int mode) { |
| 156 | switch (mode) { |
| 157 | case KEYBOARD_MODE_ALPHA: |
| 158 | mKeyboardView.setKeyboard(mQwertyKeyboard); |
| 159 | mKeyboardState = KEYBOARD_STATE_NORMAL; |
Jim Miller | 280b602 | 2010-02-09 19:05:02 -0800 | [diff] [blame] | 160 | final boolean visiblePassword = Settings.System.getInt( |
| 161 | mContext.getContentResolver(), |
| 162 | Settings.System.TEXT_SHOW_PASSWORD, 1) != 0; |
Jim Miller | 7dd879a | 2011-01-23 16:18:01 -0800 | [diff] [blame] | 163 | final boolean enablePreview = false; // TODO: grab from configuration |
| 164 | mKeyboardView.setPreviewEnabled(visiblePassword && enablePreview); |
Jim Miller | 0b31970 | 2010-02-05 18:51:59 -0800 | [diff] [blame] | 165 | break; |
| 166 | case KEYBOARD_MODE_NUMERIC: |
| 167 | mKeyboardView.setKeyboard(mNumericKeyboard); |
| 168 | mKeyboardState = KEYBOARD_STATE_NORMAL; |
Jim Miller | 280b602 | 2010-02-09 19:05:02 -0800 | [diff] [blame] | 169 | mKeyboardView.setPreviewEnabled(false); // never show popup for numeric keypad |
Jim Miller | 0b31970 | 2010-02-05 18:51:59 -0800 | [diff] [blame] | 170 | break; |
| 171 | } |
| 172 | mKeyboardMode = mode; |
| 173 | } |
| 174 | |
Joe Onorato | 1653775 | 2010-03-17 22:19:51 -0700 | [diff] [blame] | 175 | private void sendKeyEventsToTarget(int character) { |
Jeff Brown | a175a5b | 2012-02-15 19:18:31 -0800 | [diff] [blame] | 176 | ViewRootImpl viewRootImpl = mTargetView.getViewRootImpl(); |
Jeff Brown | 6b53e8d | 2010-11-10 16:03:06 -0800 | [diff] [blame] | 177 | KeyEvent[] events = KeyCharacterMap.load(KeyCharacterMap.VIRTUAL_KEYBOARD).getEvents( |
Joe Onorato | 1653775 | 2010-03-17 22:19:51 -0700 | [diff] [blame] | 178 | new char[] { (char) character }); |
Jim Miller | 0b31970 | 2010-02-05 18:51:59 -0800 | [diff] [blame] | 179 | if (events != null) { |
Joe Onorato | 1653775 | 2010-03-17 22:19:51 -0700 | [diff] [blame] | 180 | final int N = events.length; |
| 181 | for (int i=0; i<N; i++) { |
| 182 | KeyEvent event = events[i]; |
| 183 | event = KeyEvent.changeFlags(event, event.getFlags() |
| 184 | | KeyEvent.FLAG_SOFT_KEYBOARD | KeyEvent.FLAG_KEEP_TOUCH_MODE); |
keunyoung | 30f420f | 2013-08-02 14:23:10 -0700 | [diff] [blame] | 185 | viewRootImpl.dispatchInputEvent(event); |
Jim Miller | 0b31970 | 2010-02-05 18:51:59 -0800 | [diff] [blame] | 186 | } |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | public void sendDownUpKeyEvents(int keyEventCode) { |
| 191 | long eventTime = SystemClock.uptimeMillis(); |
Jeff Brown | a175a5b | 2012-02-15 19:18:31 -0800 | [diff] [blame] | 192 | ViewRootImpl viewRootImpl = mTargetView.getViewRootImpl(); |
| 193 | viewRootImpl.dispatchKeyFromIme( |
Jeff Brown | 6b53e8d | 2010-11-10 16:03:06 -0800 | [diff] [blame] | 194 | new KeyEvent(eventTime, eventTime, KeyEvent.ACTION_DOWN, keyEventCode, 0, 0, |
| 195 | KeyCharacterMap.VIRTUAL_KEYBOARD, 0, |
Jeff Brown | a175a5b | 2012-02-15 19:18:31 -0800 | [diff] [blame] | 196 | KeyEvent.FLAG_SOFT_KEYBOARD|KeyEvent.FLAG_KEEP_TOUCH_MODE)); |
| 197 | viewRootImpl.dispatchKeyFromIme( |
Jeff Brown | 6b53e8d | 2010-11-10 16:03:06 -0800 | [diff] [blame] | 198 | new KeyEvent(eventTime, eventTime, KeyEvent.ACTION_UP, keyEventCode, 0, 0, |
| 199 | KeyCharacterMap.VIRTUAL_KEYBOARD, 0, |
Jeff Brown | a175a5b | 2012-02-15 19:18:31 -0800 | [diff] [blame] | 200 | KeyEvent.FLAG_SOFT_KEYBOARD|KeyEvent.FLAG_KEEP_TOUCH_MODE)); |
Jim Miller | 0b31970 | 2010-02-05 18:51:59 -0800 | [diff] [blame] | 201 | } |
| 202 | |
| 203 | public void onKey(int primaryCode, int[] keyCodes) { |
Jim Miller | 0b31970 | 2010-02-05 18:51:59 -0800 | [diff] [blame] | 204 | if (primaryCode == Keyboard.KEYCODE_DELETE) { |
| 205 | handleBackspace(); |
| 206 | } else if (primaryCode == Keyboard.KEYCODE_SHIFT) { |
| 207 | handleShift(); |
| 208 | } else if (primaryCode == Keyboard.KEYCODE_CANCEL) { |
| 209 | handleClose(); |
| 210 | return; |
| 211 | } else if (primaryCode == Keyboard.KEYCODE_MODE_CHANGE && mKeyboardView != null) { |
| 212 | handleModeChange(); |
| 213 | } else { |
| 214 | handleCharacter(primaryCode, keyCodes); |
| 215 | // Switch back to old keyboard if we're not in capslock mode |
| 216 | if (mKeyboardState == KEYBOARD_STATE_SHIFTED) { |
| 217 | // skip to the unlocked state |
| 218 | mKeyboardState = KEYBOARD_STATE_CAPSLOCK; |
| 219 | handleShift(); |
| 220 | } |
| 221 | } |
| 222 | } |
| 223 | |
Jim Miller | 281a80d | 2010-02-18 19:54:22 -0800 | [diff] [blame] | 224 | /** |
| 225 | * Sets and enables vibrate pattern. If id is 0 (or can't be loaded), vibrate is disabled. |
| 226 | * @param id resource id for array containing vibrate pattern. |
| 227 | */ |
| 228 | public void setVibratePattern(int id) { |
| 229 | int[] tmpArray = null; |
| 230 | try { |
| 231 | tmpArray = mContext.getResources().getIntArray(id); |
| 232 | } catch (Resources.NotFoundException e) { |
| 233 | if (id != 0) { |
| 234 | Log.e(TAG, "Vibrate pattern missing", e); |
| 235 | } |
| 236 | } |
| 237 | if (tmpArray == null) { |
| 238 | mVibratePattern = null; |
| 239 | return; |
| 240 | } |
| 241 | mVibratePattern = new long[tmpArray.length]; |
| 242 | for (int i = 0; i < tmpArray.length; i++) { |
| 243 | mVibratePattern[i] = tmpArray[i]; |
| 244 | } |
| 245 | } |
| 246 | |
Jim Miller | 0b31970 | 2010-02-05 18:51:59 -0800 | [diff] [blame] | 247 | private void handleModeChange() { |
| 248 | final Keyboard current = mKeyboardView.getKeyboard(); |
| 249 | Keyboard next = null; |
| 250 | if (current == mQwertyKeyboard || current == mQwertyKeyboardShifted) { |
| 251 | next = mSymbolsKeyboard; |
| 252 | } else if (current == mSymbolsKeyboard || current == mSymbolsKeyboardShifted) { |
| 253 | next = mQwertyKeyboard; |
| 254 | } |
| 255 | if (next != null) { |
| 256 | mKeyboardView.setKeyboard(next); |
| 257 | mKeyboardState = KEYBOARD_STATE_NORMAL; |
| 258 | } |
| 259 | } |
| 260 | |
Ben Komalo | 51ea88a | 2011-10-03 10:53:26 -0700 | [diff] [blame] | 261 | public void handleBackspace() { |
Jim Miller | 0b31970 | 2010-02-05 18:51:59 -0800 | [diff] [blame] | 262 | sendDownUpKeyEvents(KeyEvent.KEYCODE_DEL); |
Jim Miller | aef555b | 2011-10-12 16:41:30 -0700 | [diff] [blame] | 263 | performHapticFeedback(); |
Jim Miller | 0b31970 | 2010-02-05 18:51:59 -0800 | [diff] [blame] | 264 | } |
| 265 | |
| 266 | private void handleShift() { |
| 267 | if (mKeyboardView == null) { |
| 268 | return; |
| 269 | } |
| 270 | Keyboard current = mKeyboardView.getKeyboard(); |
| 271 | PasswordEntryKeyboard next = null; |
| 272 | final boolean isAlphaMode = current == mQwertyKeyboard |
| 273 | || current == mQwertyKeyboardShifted; |
| 274 | if (mKeyboardState == KEYBOARD_STATE_NORMAL) { |
| 275 | mKeyboardState = isAlphaMode ? KEYBOARD_STATE_SHIFTED : KEYBOARD_STATE_CAPSLOCK; |
| 276 | next = isAlphaMode ? mQwertyKeyboardShifted : mSymbolsKeyboardShifted; |
| 277 | } else if (mKeyboardState == KEYBOARD_STATE_SHIFTED) { |
| 278 | mKeyboardState = KEYBOARD_STATE_CAPSLOCK; |
| 279 | next = isAlphaMode ? mQwertyKeyboardShifted : mSymbolsKeyboardShifted; |
| 280 | } else if (mKeyboardState == KEYBOARD_STATE_CAPSLOCK) { |
| 281 | mKeyboardState = KEYBOARD_STATE_NORMAL; |
| 282 | next = isAlphaMode ? mQwertyKeyboard : mSymbolsKeyboard; |
| 283 | } |
| 284 | if (next != null) { |
| 285 | if (next != current) { |
| 286 | mKeyboardView.setKeyboard(next); |
| 287 | } |
| 288 | next.setShiftLocked(mKeyboardState == KEYBOARD_STATE_CAPSLOCK); |
| 289 | mKeyboardView.setShifted(mKeyboardState != KEYBOARD_STATE_NORMAL); |
| 290 | } |
| 291 | } |
| 292 | |
| 293 | private void handleCharacter(int primaryCode, int[] keyCodes) { |
| 294 | // Maybe turn off shift if not in capslock mode. |
| 295 | if (mKeyboardView.isShifted() && primaryCode != ' ' && primaryCode != '\n') { |
| 296 | primaryCode = Character.toUpperCase(primaryCode); |
| 297 | } |
| 298 | sendKeyEventsToTarget(primaryCode); |
| 299 | } |
| 300 | |
| 301 | private void handleClose() { |
| 302 | |
| 303 | } |
| 304 | |
| 305 | public void onPress(int primaryCode) { |
Jim Miller | aef555b | 2011-10-12 16:41:30 -0700 | [diff] [blame] | 306 | performHapticFeedback(); |
| 307 | } |
| 308 | |
| 309 | private void performHapticFeedback() { |
| 310 | if (mEnableHaptics) { |
| 311 | mKeyboardView.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY, |
| 312 | HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING |
| 313 | | HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING); |
Jim Miller | 281a80d | 2010-02-18 19:54:22 -0800 | [diff] [blame] | 314 | } |
Jim Miller | 0b31970 | 2010-02-05 18:51:59 -0800 | [diff] [blame] | 315 | } |
| 316 | |
| 317 | public void onRelease(int primaryCode) { |
| 318 | |
| 319 | } |
| 320 | |
| 321 | public void onText(CharSequence text) { |
| 322 | |
| 323 | } |
| 324 | |
| 325 | public void swipeDown() { |
| 326 | |
| 327 | } |
| 328 | |
| 329 | public void swipeLeft() { |
| 330 | |
| 331 | } |
| 332 | |
| 333 | public void swipeRight() { |
| 334 | |
| 335 | } |
| 336 | |
| 337 | public void swipeUp() { |
| 338 | |
| 339 | } |
| 340 | }; |