The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2009 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of 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, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package android.view; |
| 18 | |
| 19 | /** |
| 20 | * Constants to be used to perform haptic feedback effects via |
| 21 | * {@link View#performHapticFeedback(int)} |
| 22 | */ |
| 23 | public class HapticFeedbackConstants { |
| 24 | |
| 25 | private HapticFeedbackConstants() {} |
| 26 | |
Dianne Hackborn | ddca3ee | 2009-07-23 19:01:31 -0700 | [diff] [blame] | 27 | /** |
| 28 | * The user has performed a long press on an object that is resulting |
| 29 | * in an action being performed. |
| 30 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 31 | public static final int LONG_PRESS = 0; |
Michael Wright | e14b064 | 2017-06-02 19:13:58 +0100 | [diff] [blame] | 32 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 33 | /** |
Dianne Hackborn | ddca3ee | 2009-07-23 19:01:31 -0700 | [diff] [blame] | 34 | * The user has pressed on a virtual on-screen key. |
| 35 | */ |
| 36 | public static final int VIRTUAL_KEY = 1; |
Michael Wright | e14b064 | 2017-06-02 19:13:58 +0100 | [diff] [blame] | 37 | |
Adam Powell | 0b8bb42 | 2010-02-08 14:30:45 -0800 | [diff] [blame] | 38 | /** |
Amith Yamasani | 0499498 | 2010-02-10 15:24:49 -0800 | [diff] [blame] | 39 | * The user has pressed a soft keyboard key. |
| 40 | */ |
| 41 | public static final int KEYBOARD_TAP = 3; |
| 42 | |
| 43 | /** |
Fabrice Di Meglio | eeff63a | 2013-08-05 12:07:24 -0700 | [diff] [blame] | 44 | * The user has pressed either an hour or minute tick of a Clock. |
| 45 | */ |
| 46 | public static final int CLOCK_TICK = 4; |
| 47 | |
| 48 | /** |
Fabrice Di Meglio | bd9152f | 2013-10-01 11:21:31 -0700 | [diff] [blame] | 49 | * The user has pressed either a day or month or year date of a Calendar. |
| 50 | * @hide |
| 51 | */ |
| 52 | public static final int CALENDAR_DATE = 5; |
| 53 | |
| 54 | /** |
Mady Mellor | e860891 | 2015-06-05 09:02:55 -0700 | [diff] [blame] | 55 | * The user has performed a context click on an object. |
Mady Mellor | e82067b | 2015-04-30 09:58:35 -0700 | [diff] [blame] | 56 | */ |
Mady Mellor | e860891 | 2015-06-05 09:02:55 -0700 | [diff] [blame] | 57 | public static final int CONTEXT_CLICK = 6; |
Mady Mellor | e82067b | 2015-04-30 09:58:35 -0700 | [diff] [blame] | 58 | |
| 59 | /** |
Yohei Yukawa | 262dadf | 2017-08-24 10:51:00 -0700 | [diff] [blame] | 60 | * The user has pressed a virtual or software keyboard key. |
Michael Wright | e14b064 | 2017-06-02 19:13:58 +0100 | [diff] [blame] | 61 | */ |
Yohei Yukawa | 262dadf | 2017-08-24 10:51:00 -0700 | [diff] [blame] | 62 | public static final int KEYBOARD_PRESS = KEYBOARD_TAP; |
| 63 | |
| 64 | /** |
| 65 | * The user has released a virtual keyboard key. |
| 66 | */ |
| 67 | public static final int KEYBOARD_RELEASE = 7; |
| 68 | |
| 69 | /** |
| 70 | * The user has released a virtual key. |
| 71 | */ |
| 72 | public static final int VIRTUAL_KEY_RELEASE = 8; |
Michael Wright | e14b064 | 2017-06-02 19:13:58 +0100 | [diff] [blame] | 73 | |
| 74 | /** |
Yohei Yukawa | da5b4a3 | 2017-06-09 12:01:51 -0700 | [diff] [blame] | 75 | * The user has performed a selection/insertion handle move on text field. |
Yohei Yukawa | da5b4a3 | 2017-06-09 12:01:51 -0700 | [diff] [blame] | 76 | */ |
Yohei Yukawa | 262dadf | 2017-08-24 10:51:00 -0700 | [diff] [blame] | 77 | public static final int TEXT_HANDLE_MOVE = 9; |
Yohei Yukawa | da5b4a3 | 2017-06-09 12:01:51 -0700 | [diff] [blame] | 78 | |
| 79 | /** |
Alexey Kuzmin | cd0d27a | 2018-03-20 18:05:12 +0000 | [diff] [blame] | 80 | * The user unlocked the device |
| 81 | * @hide |
| 82 | */ |
| 83 | public static final int ENTRY_BUMP = 10; |
| 84 | |
| 85 | /** |
| 86 | * The user has moved the dragged object within a droppable area. |
| 87 | * @hide |
| 88 | */ |
| 89 | public static final int DRAG_CROSSING = 11; |
| 90 | |
| 91 | /** |
| 92 | * The user has started a gesture (e.g. on the soft keyboard). |
Alexey Kuzmin | cd0d27a | 2018-03-20 18:05:12 +0000 | [diff] [blame] | 93 | */ |
| 94 | public static final int GESTURE_START = 12; |
| 95 | |
| 96 | /** |
| 97 | * The user has finished a gesture (e.g. on the soft keyboard). |
Alexey Kuzmin | cd0d27a | 2018-03-20 18:05:12 +0000 | [diff] [blame] | 98 | */ |
| 99 | public static final int GESTURE_END = 13; |
| 100 | |
| 101 | /** |
| 102 | * The user's squeeze crossed the gesture's initiation threshold. |
| 103 | * @hide |
| 104 | */ |
| 105 | public static final int EDGE_SQUEEZE = 14; |
| 106 | |
| 107 | /** |
| 108 | * The user's squeeze crossed the gesture's release threshold. |
| 109 | * @hide |
| 110 | */ |
| 111 | public static final int EDGE_RELEASE = 15; |
| 112 | |
| 113 | /** |
| 114 | * A haptic effect to signal the confirmation or successful completion of a user |
| 115 | * interaction. |
Alexey Kuzmin | cd0d27a | 2018-03-20 18:05:12 +0000 | [diff] [blame] | 116 | */ |
| 117 | public static final int CONFIRM = 16; |
| 118 | |
| 119 | /** |
| 120 | * A haptic effect to signal the rejection or failure of a user interaction. |
Alexey Kuzmin | cd0d27a | 2018-03-20 18:05:12 +0000 | [diff] [blame] | 121 | */ |
| 122 | public static final int REJECT = 17; |
| 123 | |
| 124 | /** |
Michael Wright | 33d6c08 | 2017-07-21 16:40:58 +0100 | [diff] [blame] | 125 | * The phone has booted with safe mode enabled. |
Dianne Hackborn | 6af0d50 | 2009-09-28 13:25:46 -0700 | [diff] [blame] | 126 | * This is a private constant. Feel free to renumber as desired. |
| 127 | * @hide |
| 128 | */ |
| 129 | public static final int SAFE_MODE_ENABLED = 10001; |
Michael Wright | e14b064 | 2017-06-02 19:13:58 +0100 | [diff] [blame] | 130 | |
Dianne Hackborn | 6af0d50 | 2009-09-28 13:25:46 -0700 | [diff] [blame] | 131 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 132 | * Flag for {@link View#performHapticFeedback(int, int) |
| 133 | * View.performHapticFeedback(int, int)}: Ignore the setting in the |
| 134 | * view for whether to perform haptic feedback, do it always. |
| 135 | */ |
| 136 | public static final int FLAG_IGNORE_VIEW_SETTING = 0x0001; |
Michael Wright | e14b064 | 2017-06-02 19:13:58 +0100 | [diff] [blame] | 137 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 138 | /** |
| 139 | * Flag for {@link View#performHapticFeedback(int, int) |
| 140 | * View.performHapticFeedback(int, int)}: Ignore the global setting |
| 141 | * for whether to perform haptic feedback, do it always. |
| 142 | */ |
| 143 | public static final int FLAG_IGNORE_GLOBAL_SETTING = 0x0002; |
| 144 | } |