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 HapticFeedbackConstants()25 private HapticFeedbackConstants() {} 26 27 /** 28 * The user has performed a long press on an object that is resulting 29 * in an action being performed. 30 */ 31 public static final int LONG_PRESS = 0; 32 33 /** 34 * The user has pressed on a virtual on-screen key. 35 */ 36 public static final int VIRTUAL_KEY = 1; 37 38 /** 39 * The user has pressed a soft keyboard key. 40 */ 41 public static final int KEYBOARD_TAP = 3; 42 43 /** 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 /** 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 /** 55 * The user has performed a context click on an object. 56 */ 57 public static final int CONTEXT_CLICK = 6; 58 59 /** 60 * The user has pressed a virtual or software keyboard key. 61 */ 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; 73 74 /** 75 * The user has performed a selection/insertion handle move on text field. 76 */ 77 public static final int TEXT_HANDLE_MOVE = 9; 78 79 /** 80 * The phone has booted with safe mode enabled. 81 * This is a private constant. Feel free to renumber as desired. 82 * @hide 83 */ 84 public static final int SAFE_MODE_ENABLED = 10001; 85 86 /** 87 * Flag for {@link View#performHapticFeedback(int, int) 88 * View.performHapticFeedback(int, int)}: Ignore the setting in the 89 * view for whether to perform haptic feedback, do it always. 90 */ 91 public static final int FLAG_IGNORE_VIEW_SETTING = 0x0001; 92 93 /** 94 * Flag for {@link View#performHapticFeedback(int, int) 95 * View.performHapticFeedback(int, int)}: Ignore the global setting 96 * for whether to perform haptic feedback, do it always. 97 */ 98 public static final int FLAG_IGNORE_GLOBAL_SETTING = 0x0002; 99 } 100