The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2006 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 | |
Vladislav Kaznacheev | f847ee3 | 2016-11-21 14:11:00 -0800 | [diff] [blame] | 19 | import android.annotation.TestApi; |
Mathew Inwood | e5ad598 | 2018-08-17 15:07:52 +0100 | [diff] [blame] | 20 | import android.annotation.UnsupportedAppUsage; |
Svetoslav Ganov | 54d068e | 2011-03-02 12:58:40 -0800 | [diff] [blame] | 21 | import android.app.AppGlobals; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 22 | import android.content.Context; |
Dianne Hackborn | ff801ec | 2011-01-22 18:05:38 -0800 | [diff] [blame] | 23 | import android.content.res.Configuration; |
Adam Powell | 8c47062 | 2011-06-30 18:19:51 -0700 | [diff] [blame] | 24 | import android.content.res.Resources; |
Jeff Brown | a8b9def | 2012-07-23 14:22:49 -0700 | [diff] [blame] | 25 | import android.graphics.Point; |
Adam Powell | 8c47062 | 2011-06-30 18:19:51 -0700 | [diff] [blame] | 26 | import android.os.RemoteException; |
Svetoslav Ganov | 54d068e | 2011-03-02 12:58:40 -0800 | [diff] [blame] | 27 | import android.provider.Settings; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 28 | import android.util.DisplayMetrics; |
| 29 | import android.util.SparseArray; |
| 30 | |
| 31 | /** |
| 32 | * Contains methods to standard constants used in the UI for timeouts, sizes, and distances. |
| 33 | */ |
| 34 | public class ViewConfiguration { |
| 35 | /** |
| 36 | * Defines the width of the horizontal scrollbar and the height of the vertical scrollbar in |
Gilles Debunne | 006fa48 | 2011-10-27 17:23:36 -0700 | [diff] [blame] | 37 | * dips |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 38 | */ |
Tarun Lohani | 8c89baa | 2017-06-16 17:21:04 +0000 | [diff] [blame] | 39 | private static final int SCROLL_BAR_SIZE = 4; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 40 | |
| 41 | /** |
Mike Cleron | f116bf8 | 2009-09-27 19:14:12 -0700 | [diff] [blame] | 42 | * Duration of the fade when scrollbars fade away in milliseconds |
| 43 | */ |
| 44 | private static final int SCROLL_BAR_FADE_DURATION = 250; |
| 45 | |
| 46 | /** |
| 47 | * Default delay before the scrollbars fade in milliseconds |
| 48 | */ |
| 49 | private static final int SCROLL_BAR_DEFAULT_DELAY = 300; |
| 50 | |
| 51 | /** |
Gilles Debunne | 006fa48 | 2011-10-27 17:23:36 -0700 | [diff] [blame] | 52 | * Defines the length of the fading edges in dips |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 53 | */ |
| 54 | private static final int FADING_EDGE_LENGTH = 12; |
| 55 | |
| 56 | /** |
| 57 | * Defines the duration in milliseconds of the pressed state in child |
| 58 | * components. |
| 59 | */ |
Daisuke Miyakawa | c19895f | 2012-04-03 12:25:26 -0700 | [diff] [blame] | 60 | private static final int PRESSED_STATE_DURATION = 64; |
| 61 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 62 | /** |
Jeff Brown | a454767 | 2011-03-02 21:38:11 -0800 | [diff] [blame] | 63 | * Defines the default duration in milliseconds before a press turns into |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 64 | * a long press |
| 65 | */ |
Jeff Brown | a454767 | 2011-03-02 21:38:11 -0800 | [diff] [blame] | 66 | private static final int DEFAULT_LONG_PRESS_TIMEOUT = 500; |
| 67 | |
| 68 | /** |
Anthony Hugh | 96e9cc5 | 2016-07-12 15:17:24 -0700 | [diff] [blame] | 69 | * Defines the default duration in milliseconds between the first tap's up event and the second |
| 70 | * tap's down event for an interaction to be considered part of the same multi-press. |
| 71 | */ |
| 72 | private static final int DEFAULT_MULTI_PRESS_TIMEOUT = 300; |
| 73 | |
| 74 | /** |
Jeff Brown | a454767 | 2011-03-02 21:38:11 -0800 | [diff] [blame] | 75 | * Defines the time between successive key repeats in milliseconds. |
| 76 | */ |
| 77 | private static final int KEY_REPEAT_DELAY = 50; |
| 78 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 79 | /** |
| 80 | * Defines the duration in milliseconds a user needs to hold down the |
| 81 | * appropriate button to bring up the global actions dialog (power off, |
| 82 | * lock screen, etc). |
| 83 | */ |
| 84 | private static final int GLOBAL_ACTIONS_KEY_TIMEOUT = 500; |
Daisuke Miyakawa | c19895f | 2012-04-03 12:25:26 -0700 | [diff] [blame] | 85 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 86 | /** |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 87 | * Defines the duration in milliseconds a user needs to hold down the |
Eugene Susla | 5f19cd3 | 2017-10-19 14:00:59 -0700 | [diff] [blame] | 88 | * appropriate button to bring up the accessibility shortcut for the first time |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 89 | */ |
| 90 | private static final int A11Y_SHORTCUT_KEY_TIMEOUT = 3000; |
| 91 | |
| 92 | /** |
Eugene Susla | 5f19cd3 | 2017-10-19 14:00:59 -0700 | [diff] [blame] | 93 | * Defines the duration in milliseconds a user needs to hold down the |
| 94 | * appropriate button to enable the accessibility shortcut once it's configured. |
| 95 | */ |
Eugene Susla | c884158 | 2017-10-31 17:10:41 -0700 | [diff] [blame] | 96 | private static final int A11Y_SHORTCUT_KEY_TIMEOUT_AFTER_CONFIRMATION = 1000; |
Eugene Susla | 5f19cd3 | 2017-10-19 14:00:59 -0700 | [diff] [blame] | 97 | |
| 98 | /** |
Daisuke Miyakawa | c19895f | 2012-04-03 12:25:26 -0700 | [diff] [blame] | 99 | * Defines the duration in milliseconds we will wait to see if a touch event |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 100 | * is a tap or a scroll. If the user does not move within this interval, it is |
Daisuke Miyakawa | c19895f | 2012-04-03 12:25:26 -0700 | [diff] [blame] | 101 | * considered to be a tap. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 102 | */ |
Alan Viverette | 97d9b65 | 2014-03-17 15:33:05 -0700 | [diff] [blame] | 103 | private static final int TAP_TIMEOUT = 100; |
Daisuke Miyakawa | c19895f | 2012-04-03 12:25:26 -0700 | [diff] [blame] | 104 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 105 | /** |
Daisuke Miyakawa | c19895f | 2012-04-03 12:25:26 -0700 | [diff] [blame] | 106 | * Defines the duration in milliseconds we will wait to see if a touch event |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 107 | * is a jump tap. If the user does not complete the jump tap within this interval, it is |
Daisuke Miyakawa | c19895f | 2012-04-03 12:25:26 -0700 | [diff] [blame] | 108 | * considered to be a tap. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 109 | */ |
| 110 | private static final int JUMP_TAP_TIMEOUT = 500; |
| 111 | |
| 112 | /** |
| 113 | * Defines the duration in milliseconds between the first tap's up event and |
| 114 | * the second tap's down event for an interaction to be considered a |
| 115 | * double-tap. |
| 116 | */ |
| 117 | private static final int DOUBLE_TAP_TIMEOUT = 300; |
Jeff Brown | bb3fcba0c | 2011-06-06 19:23:05 -0700 | [diff] [blame] | 118 | |
| 119 | /** |
Adam Powell | af1785f | 2013-09-05 13:44:45 -0700 | [diff] [blame] | 120 | * Defines the minimum duration in milliseconds between the first tap's up event and |
| 121 | * the second tap's down event for an interaction to be considered a |
| 122 | * double-tap. |
| 123 | */ |
| 124 | private static final int DOUBLE_TAP_MIN_TIME = 40; |
| 125 | |
| 126 | /** |
Jeff Brown | bb3fcba0c | 2011-06-06 19:23:05 -0700 | [diff] [blame] | 127 | * Defines the maximum duration in milliseconds between a touch pad |
| 128 | * touch and release for a given touch to be considered a tap (click) as |
| 129 | * opposed to a hover movement gesture. |
| 130 | */ |
| 131 | private static final int HOVER_TAP_TIMEOUT = 150; |
| 132 | |
| 133 | /** |
| 134 | * Defines the maximum distance in pixels that a touch pad touch can move |
| 135 | * before being released for it to be considered a tap (click) as opposed |
| 136 | * to a hover movement gesture. |
| 137 | */ |
| 138 | private static final int HOVER_TAP_SLOP = 20; |
| 139 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 140 | /** |
Daisuke Miyakawa | c19895f | 2012-04-03 12:25:26 -0700 | [diff] [blame] | 141 | * Defines the duration in milliseconds we want to display zoom controls in response |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 142 | * to a user panning within an application. |
| 143 | */ |
| 144 | private static final int ZOOM_CONTROLS_TIMEOUT = 3000; |
| 145 | |
| 146 | /** |
Gilles Debunne | 006fa48 | 2011-10-27 17:23:36 -0700 | [diff] [blame] | 147 | * Inset in dips to look for touchable content when the user touches the edge of the screen |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 148 | */ |
| 149 | private static final int EDGE_SLOP = 12; |
Daisuke Miyakawa | c19895f | 2012-04-03 12:25:26 -0700 | [diff] [blame] | 150 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 151 | /** |
Adam Powell | 7d39f85 | 2011-12-05 19:26:54 -0800 | [diff] [blame] | 152 | * Distance a touch can wander before we think the user is scrolling in dips. |
| 153 | * Note that this value defined here is only used as a fallback by legacy/misbehaving |
| 154 | * applications that do not provide a Context for determining density/configuration-dependent |
| 155 | * values. |
| 156 | * |
| 157 | * To alter this value, see the configuration resource config_viewConfigurationTouchSlop |
| 158 | * in frameworks/base/core/res/res/values/config.xml or the appropriate device resource overlay. |
| 159 | * It may be appropriate to tweak this on a device-specific basis in an overlay based on |
| 160 | * the characteristics of the touch panel and firmware. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 161 | */ |
Adam Powell | 6720a87 | 2011-12-07 17:35:32 -0800 | [diff] [blame] | 162 | private static final int TOUCH_SLOP = 8; |
Daisuke Miyakawa | c19895f | 2012-04-03 12:25:26 -0700 | [diff] [blame] | 163 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 164 | /** |
Vladislav Kaznacheev | 4d2c6014 | 2017-02-07 17:11:54 -0800 | [diff] [blame] | 165 | * Defines the minimum size of the touch target for a scrollbar in dips |
| 166 | */ |
| 167 | private static final int MIN_SCROLLBAR_TOUCH_TARGET = 48; |
| 168 | |
| 169 | /** |
Gilles Debunne | 006fa48 | 2011-10-27 17:23:36 -0700 | [diff] [blame] | 170 | * Distance the first touch can wander before we stop considering this event a double tap |
| 171 | * (in dips) |
| 172 | */ |
| 173 | private static final int DOUBLE_TAP_TOUCH_SLOP = TOUCH_SLOP; |
| 174 | |
| 175 | /** |
Adam Powell | de8d083 | 2010-03-09 17:11:30 -0800 | [diff] [blame] | 176 | * Distance a touch can wander before we think the user is attempting a paged scroll |
| 177 | * (in dips) |
Adam Powell | 7d39f85 | 2011-12-05 19:26:54 -0800 | [diff] [blame] | 178 | * |
| 179 | * Note that this value defined here is only used as a fallback by legacy/misbehaving |
| 180 | * applications that do not provide a Context for determining density/configuration-dependent |
| 181 | * values. |
| 182 | * |
| 183 | * See the note above on {@link #TOUCH_SLOP} regarding the dimen resource |
| 184 | * config_viewConfigurationTouchSlop. ViewConfiguration will report a paging touch slop of |
| 185 | * config_viewConfigurationTouchSlop * 2 when provided with a Context. |
Adam Powell | de8d083 | 2010-03-09 17:11:30 -0800 | [diff] [blame] | 186 | */ |
Adam Powell | b7ef1d9 | 2010-03-11 10:25:24 -0800 | [diff] [blame] | 187 | private static final int PAGING_TOUCH_SLOP = TOUCH_SLOP * 2; |
Daisuke Miyakawa | c19895f | 2012-04-03 12:25:26 -0700 | [diff] [blame] | 188 | |
Adam Powell | de8d083 | 2010-03-09 17:11:30 -0800 | [diff] [blame] | 189 | /** |
Gilles Debunne | 006fa48 | 2011-10-27 17:23:36 -0700 | [diff] [blame] | 190 | * Distance in dips between the first touch and second touch to still be considered a double tap |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 191 | */ |
| 192 | private static final int DOUBLE_TAP_SLOP = 100; |
Daisuke Miyakawa | c19895f | 2012-04-03 12:25:26 -0700 | [diff] [blame] | 193 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 194 | /** |
Gilles Debunne | 006fa48 | 2011-10-27 17:23:36 -0700 | [diff] [blame] | 195 | * Distance in dips a touch needs to be outside of a window's bounds for it to |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 196 | * count as outside for purposes of dismissing the window. |
| 197 | */ |
| 198 | private static final int WINDOW_TOUCH_SLOP = 16; |
| 199 | |
| 200 | /** |
Gilles Debunne | 006fa48 | 2011-10-27 17:23:36 -0700 | [diff] [blame] | 201 | * Minimum velocity to initiate a fling, as measured in dips per second |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 202 | */ |
| 203 | private static final int MINIMUM_FLING_VELOCITY = 50; |
Daisuke Miyakawa | c19895f | 2012-04-03 12:25:26 -0700 | [diff] [blame] | 204 | |
Romain Guy | 4296fc4 | 2009-07-06 11:48:52 -0700 | [diff] [blame] | 205 | /** |
Gilles Debunne | 006fa48 | 2011-10-27 17:23:36 -0700 | [diff] [blame] | 206 | * Maximum velocity to initiate a fling, as measured in dips per second |
Romain Guy | 4296fc4 | 2009-07-06 11:48:52 -0700 | [diff] [blame] | 207 | */ |
Adam Powell | 637d337 | 2010-08-25 14:37:03 -0700 | [diff] [blame] | 208 | private static final int MAXIMUM_FLING_VELOCITY = 8000; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 209 | |
| 210 | /** |
Svetoslav Ganov | a015617 | 2011-06-26 17:55:44 -0700 | [diff] [blame] | 211 | * Delay before dispatching a recurring accessibility event in milliseconds. |
| 212 | * This delay guarantees that a recurring event will be send at most once |
| 213 | * during the {@link #SEND_RECURRING_ACCESSIBILITY_EVENTS_INTERVAL_MILLIS} time |
| 214 | * frame. |
| 215 | */ |
Svetoslav Ganov | e15ccb9 | 2012-05-16 15:48:55 -0700 | [diff] [blame] | 216 | private static final long SEND_RECURRING_ACCESSIBILITY_EVENTS_INTERVAL_MILLIS = 100; |
Svetoslav Ganov | a015617 | 2011-06-26 17:55:44 -0700 | [diff] [blame] | 217 | |
| 218 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 219 | * The maximum size of View's drawing cache, expressed in bytes. This size |
| 220 | * should be at least equal to the size of the screen in ARGB888 format. |
| 221 | */ |
| 222 | @Deprecated |
Romain Guy | 0211a0a | 2011-02-14 16:34:59 -0800 | [diff] [blame] | 223 | private static final int MAXIMUM_DRAWING_CACHE_SIZE = 480 * 800 * 4; // ARGB8888 |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 224 | |
| 225 | /** |
| 226 | * The coefficient of friction applied to flings/scrolls. |
| 227 | */ |
Mathew Inwood | e5ad598 | 2018-08-17 15:07:52 +0100 | [diff] [blame] | 228 | @UnsupportedAppUsage |
Romain Guy | 0211a0a | 2011-02-14 16:34:59 -0800 | [diff] [blame] | 229 | private static final float SCROLL_FRICTION = 0.015f; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 230 | |
Adam Powell | 637d337 | 2010-08-25 14:37:03 -0700 | [diff] [blame] | 231 | /** |
Gilles Debunne | 006fa48 | 2011-10-27 17:23:36 -0700 | [diff] [blame] | 232 | * Max distance in dips to overscroll for edge effects |
Adam Powell | 637d337 | 2010-08-25 14:37:03 -0700 | [diff] [blame] | 233 | */ |
| 234 | private static final int OVERSCROLL_DISTANCE = 0; |
| 235 | |
| 236 | /** |
Gilles Debunne | 006fa48 | 2011-10-27 17:23:36 -0700 | [diff] [blame] | 237 | * Max distance in dips to overfling for edge effects |
Adam Powell | 637d337 | 2010-08-25 14:37:03 -0700 | [diff] [blame] | 238 | */ |
Gilles Debunne | 8ce7aab | 2011-01-25 11:23:30 -0800 | [diff] [blame] | 239 | private static final int OVERFLING_DISTANCE = 6; |
Adam Powell | 637d337 | 2010-08-25 14:37:03 -0700 | [diff] [blame] | 240 | |
Adam Powell | cc84ff4 | 2013-12-04 11:15:29 -0800 | [diff] [blame] | 241 | /** |
Aaron Whyte | f830652 | 2017-03-22 16:30:58 -0700 | [diff] [blame] | 242 | * Amount to scroll in response to a horizontal {@link MotionEvent#ACTION_SCROLL} event, |
| 243 | * in dips per axis value. |
Ned Burns | 69af432 | 2016-08-17 17:30:25 -0400 | [diff] [blame] | 244 | */ |
Aaron Whyte | f830652 | 2017-03-22 16:30:58 -0700 | [diff] [blame] | 245 | private static final float HORIZONTAL_SCROLL_FACTOR = 64; |
| 246 | |
| 247 | /** |
| 248 | * Amount to scroll in response to a vertical {@link MotionEvent#ACTION_SCROLL} event, |
| 249 | * in dips per axis value. |
| 250 | */ |
| 251 | private static final float VERTICAL_SCROLL_FACTOR = 64; |
Ned Burns | 69af432 | 2016-08-17 17:30:25 -0400 | [diff] [blame] | 252 | |
| 253 | /** |
Abodunrinwa Toki | 9e21128 | 2015-06-05 02:46:57 +0100 | [diff] [blame] | 254 | * Default duration to hide an action mode for. |
Abodunrinwa Toki | fd3a3a1 | 2015-05-05 20:04:34 +0100 | [diff] [blame] | 255 | */ |
Abodunrinwa Toki | 9e21128 | 2015-06-05 02:46:57 +0100 | [diff] [blame] | 256 | private static final long ACTION_MODE_HIDE_DURATION_DEFAULT = 2000; |
Abodunrinwa Toki | fd3a3a1 | 2015-05-05 20:04:34 +0100 | [diff] [blame] | 257 | |
| 258 | /** |
Vladislav Kaznacheev | f847ee3 | 2016-11-21 14:11:00 -0800 | [diff] [blame] | 259 | * Defines the duration in milliseconds before an end of a long press causes a tooltip to be |
| 260 | * hidden. |
| 261 | */ |
| 262 | private static final int LONG_PRESS_TOOLTIP_HIDE_TIMEOUT = 1500; |
| 263 | |
| 264 | /** |
| 265 | * Defines the duration in milliseconds before a hover event causes a tooltip to be shown. |
| 266 | */ |
| 267 | private static final int HOVER_TOOLTIP_SHOW_TIMEOUT = 500; |
| 268 | |
| 269 | /** |
| 270 | * Defines the duration in milliseconds before mouse inactivity causes a tooltip to be hidden. |
| 271 | * (default variant to be used when {@link View#SYSTEM_UI_FLAG_LOW_PROFILE} is not set). |
| 272 | */ |
| 273 | private static final int HOVER_TOOLTIP_HIDE_TIMEOUT = 15000; |
| 274 | |
| 275 | /** |
| 276 | * Defines the duration in milliseconds before mouse inactivity causes a tooltip to be hidden |
| 277 | * (short version to be used when {@link View#SYSTEM_UI_FLAG_LOW_PROFILE} is set). |
| 278 | */ |
| 279 | private static final int HOVER_TOOLTIP_HIDE_SHORT_TIMEOUT = 3000; |
| 280 | |
| 281 | /** |
Adam Powell | cc84ff4 | 2013-12-04 11:15:29 -0800 | [diff] [blame] | 282 | * Configuration values for overriding {@link #hasPermanentMenuKey()} behavior. |
| 283 | * These constants must match the definition in res/values/config.xml. |
| 284 | */ |
| 285 | private static final int HAS_PERMANENT_MENU_KEY_AUTODETECT = 0; |
| 286 | private static final int HAS_PERMANENT_MENU_KEY_TRUE = 1; |
| 287 | private static final int HAS_PERMANENT_MENU_KEY_FALSE = 2; |
| 288 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 289 | private final int mEdgeSlop; |
| 290 | private final int mFadingEdgeLength; |
| 291 | private final int mMinimumFlingVelocity; |
Romain Guy | 4296fc4 | 2009-07-06 11:48:52 -0700 | [diff] [blame] | 292 | private final int mMaximumFlingVelocity; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 293 | private final int mScrollbarSize; |
| 294 | private final int mTouchSlop; |
Vladislav Kaznacheev | 556ac61 | 2017-12-07 11:02:08 -0800 | [diff] [blame] | 295 | private final int mHoverSlop; |
Vladislav Kaznacheev | 4d2c6014 | 2017-02-07 17:11:54 -0800 | [diff] [blame] | 296 | private final int mMinScrollbarTouchTarget; |
Gilles Debunne | 006fa48 | 2011-10-27 17:23:36 -0700 | [diff] [blame] | 297 | private final int mDoubleTapTouchSlop; |
Adam Powell | de8d083 | 2010-03-09 17:11:30 -0800 | [diff] [blame] | 298 | private final int mPagingTouchSlop; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 299 | private final int mDoubleTapSlop; |
| 300 | private final int mWindowTouchSlop; |
| 301 | private final int mMaximumDrawingCacheSize; |
Adam Powell | 637d337 | 2010-08-25 14:37:03 -0700 | [diff] [blame] | 302 | private final int mOverscrollDistance; |
| 303 | private final int mOverflingDistance; |
Mathew Inwood | e5ad598 | 2018-08-17 15:07:52 +0100 | [diff] [blame] | 304 | @UnsupportedAppUsage |
Romain Guy | 6805545 | 2011-08-02 16:33:02 -0700 | [diff] [blame] | 305 | private final boolean mFadingMarqueeEnabled; |
Justin Koh | feabd2c | 2014-05-02 10:02:44 -0700 | [diff] [blame] | 306 | private final long mGlobalActionsKeyTimeout; |
Aaron Whyte | f830652 | 2017-03-22 16:30:58 -0700 | [diff] [blame] | 307 | private final float mVerticalScrollFactor; |
| 308 | private final float mHorizontalScrollFactor; |
Vladislav Kaznacheev | a725df9 | 2018-02-26 16:22:34 -0800 | [diff] [blame] | 309 | private final boolean mShowMenuShortcutsWhenKeyboardPresent; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 310 | |
Mathew Inwood | e5ad598 | 2018-08-17 15:07:52 +0100 | [diff] [blame] | 311 | @UnsupportedAppUsage |
Adam Powell | 8c47062 | 2011-06-30 18:19:51 -0700 | [diff] [blame] | 312 | private boolean sHasPermanentMenuKey; |
Mathew Inwood | e5ad598 | 2018-08-17 15:07:52 +0100 | [diff] [blame] | 313 | @UnsupportedAppUsage |
Adam Powell | 8c47062 | 2011-06-30 18:19:51 -0700 | [diff] [blame] | 314 | private boolean sHasPermanentMenuKeySet; |
| 315 | |
Mathew Inwood | e5ad598 | 2018-08-17 15:07:52 +0100 | [diff] [blame] | 316 | @UnsupportedAppUsage |
Xavier Ducrohet | 7f9f99ea | 2011-08-11 10:16:17 -0700 | [diff] [blame] | 317 | static final SparseArray<ViewConfiguration> sConfigurations = |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 318 | new SparseArray<ViewConfiguration>(2); |
| 319 | |
| 320 | /** |
| 321 | * @deprecated Use {@link android.view.ViewConfiguration#get(android.content.Context)} instead. |
| 322 | */ |
| 323 | @Deprecated |
| 324 | public ViewConfiguration() { |
| 325 | mEdgeSlop = EDGE_SLOP; |
| 326 | mFadingEdgeLength = FADING_EDGE_LENGTH; |
| 327 | mMinimumFlingVelocity = MINIMUM_FLING_VELOCITY; |
Romain Guy | 4296fc4 | 2009-07-06 11:48:52 -0700 | [diff] [blame] | 328 | mMaximumFlingVelocity = MAXIMUM_FLING_VELOCITY; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 329 | mScrollbarSize = SCROLL_BAR_SIZE; |
| 330 | mTouchSlop = TOUCH_SLOP; |
Vladislav Kaznacheev | 556ac61 | 2017-12-07 11:02:08 -0800 | [diff] [blame] | 331 | mHoverSlop = TOUCH_SLOP / 2; |
Vladislav Kaznacheev | 4d2c6014 | 2017-02-07 17:11:54 -0800 | [diff] [blame] | 332 | mMinScrollbarTouchTarget = MIN_SCROLLBAR_TOUCH_TARGET; |
Gilles Debunne | 006fa48 | 2011-10-27 17:23:36 -0700 | [diff] [blame] | 333 | mDoubleTapTouchSlop = DOUBLE_TAP_TOUCH_SLOP; |
Adam Powell | de8d083 | 2010-03-09 17:11:30 -0800 | [diff] [blame] | 334 | mPagingTouchSlop = PAGING_TOUCH_SLOP; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 335 | mDoubleTapSlop = DOUBLE_TAP_SLOP; |
| 336 | mWindowTouchSlop = WINDOW_TOUCH_SLOP; |
| 337 | //noinspection deprecation |
| 338 | mMaximumDrawingCacheSize = MAXIMUM_DRAWING_CACHE_SIZE; |
Adam Powell | 637d337 | 2010-08-25 14:37:03 -0700 | [diff] [blame] | 339 | mOverscrollDistance = OVERSCROLL_DISTANCE; |
| 340 | mOverflingDistance = OVERFLING_DISTANCE; |
Romain Guy | 6805545 | 2011-08-02 16:33:02 -0700 | [diff] [blame] | 341 | mFadingMarqueeEnabled = true; |
Justin Koh | feabd2c | 2014-05-02 10:02:44 -0700 | [diff] [blame] | 342 | mGlobalActionsKeyTimeout = GLOBAL_ACTIONS_KEY_TIMEOUT; |
Aaron Whyte | f830652 | 2017-03-22 16:30:58 -0700 | [diff] [blame] | 343 | mHorizontalScrollFactor = HORIZONTAL_SCROLL_FACTOR; |
| 344 | mVerticalScrollFactor = VERTICAL_SCROLL_FACTOR; |
Vladislav Kaznacheev | a725df9 | 2018-02-26 16:22:34 -0800 | [diff] [blame] | 345 | mShowMenuShortcutsWhenKeyboardPresent = false; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 346 | } |
| 347 | |
| 348 | /** |
| 349 | * Creates a new configuration for the specified context. The configuration depends on |
| 350 | * various parameters of the context, like the dimension of the display or the density |
| 351 | * of the display. |
| 352 | * |
| 353 | * @param context The application context used to initialize this view configuration. |
| 354 | * |
Daisuke Miyakawa | c19895f | 2012-04-03 12:25:26 -0700 | [diff] [blame] | 355 | * @see #get(android.content.Context) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 356 | * @see android.util.DisplayMetrics |
| 357 | */ |
| 358 | private ViewConfiguration(Context context) { |
Adam Powell | 8c47062 | 2011-06-30 18:19:51 -0700 | [diff] [blame] | 359 | final Resources res = context.getResources(); |
| 360 | final DisplayMetrics metrics = res.getDisplayMetrics(); |
| 361 | final Configuration config = res.getConfiguration(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 362 | final float density = metrics.density; |
Dianne Hackborn | ff801ec | 2011-01-22 18:05:38 -0800 | [diff] [blame] | 363 | final float sizeAndDensity; |
Adam Powell | 8c47062 | 2011-06-30 18:19:51 -0700 | [diff] [blame] | 364 | if (config.isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_XLARGE)) { |
Dianne Hackborn | ff801ec | 2011-01-22 18:05:38 -0800 | [diff] [blame] | 365 | sizeAndDensity = density * 1.5f; |
| 366 | } else { |
| 367 | sizeAndDensity = density; |
| 368 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 369 | |
Dianne Hackborn | ff801ec | 2011-01-22 18:05:38 -0800 | [diff] [blame] | 370 | mEdgeSlop = (int) (sizeAndDensity * EDGE_SLOP + 0.5f); |
| 371 | mFadingEdgeLength = (int) (sizeAndDensity * FADING_EDGE_LENGTH + 0.5f); |
Tarun Lohani | 8c89baa | 2017-06-16 17:21:04 +0000 | [diff] [blame] | 372 | mScrollbarSize = res.getDimensionPixelSize( |
| 373 | com.android.internal.R.dimen.config_scrollbarSize); |
Dianne Hackborn | ff801ec | 2011-01-22 18:05:38 -0800 | [diff] [blame] | 374 | mDoubleTapSlop = (int) (sizeAndDensity * DOUBLE_TAP_SLOP + 0.5f); |
| 375 | mWindowTouchSlop = (int) (sizeAndDensity * WINDOW_TOUCH_SLOP + 0.5f); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 376 | |
| 377 | // Size of the screen in bytes, in ARGB_8888 format |
Jeff Brown | 98365d7 | 2012-08-19 20:30:52 -0700 | [diff] [blame] | 378 | final WindowManager win = (WindowManager)context.getSystemService(Context.WINDOW_SERVICE); |
| 379 | final Display display = win.getDefaultDisplay(); |
Jeff Brown | a8b9def | 2012-07-23 14:22:49 -0700 | [diff] [blame] | 380 | final Point size = new Point(); |
| 381 | display.getRealSize(size); |
| 382 | mMaximumDrawingCacheSize = 4 * size.x * size.y; |
Adam Powell | 637d337 | 2010-08-25 14:37:03 -0700 | [diff] [blame] | 383 | |
Dianne Hackborn | ff801ec | 2011-01-22 18:05:38 -0800 | [diff] [blame] | 384 | mOverscrollDistance = (int) (sizeAndDensity * OVERSCROLL_DISTANCE + 0.5f); |
| 385 | mOverflingDistance = (int) (sizeAndDensity * OVERFLING_DISTANCE + 0.5f); |
Adam Powell | 8c47062 | 2011-06-30 18:19:51 -0700 | [diff] [blame] | 386 | |
| 387 | if (!sHasPermanentMenuKeySet) { |
Adam Powell | cc84ff4 | 2013-12-04 11:15:29 -0800 | [diff] [blame] | 388 | final int configVal = res.getInteger( |
| 389 | com.android.internal.R.integer.config_overrideHasPermanentMenuKey); |
| 390 | |
| 391 | switch (configVal) { |
| 392 | default: |
| 393 | case HAS_PERMANENT_MENU_KEY_AUTODETECT: { |
| 394 | IWindowManager wm = WindowManagerGlobal.getWindowManagerService(); |
| 395 | try { |
| 396 | sHasPermanentMenuKey = !wm.hasNavigationBar(); |
| 397 | sHasPermanentMenuKeySet = true; |
| 398 | } catch (RemoteException ex) { |
| 399 | sHasPermanentMenuKey = false; |
| 400 | } |
| 401 | } |
| 402 | break; |
| 403 | |
| 404 | case HAS_PERMANENT_MENU_KEY_TRUE: |
| 405 | sHasPermanentMenuKey = true; |
| 406 | sHasPermanentMenuKeySet = true; |
| 407 | break; |
| 408 | |
| 409 | case HAS_PERMANENT_MENU_KEY_FALSE: |
| 410 | sHasPermanentMenuKey = false; |
| 411 | sHasPermanentMenuKeySet = true; |
| 412 | break; |
Adam Powell | 8c47062 | 2011-06-30 18:19:51 -0700 | [diff] [blame] | 413 | } |
| 414 | } |
Romain Guy | 6805545 | 2011-08-02 16:33:02 -0700 | [diff] [blame] | 415 | |
| 416 | mFadingMarqueeEnabled = res.getBoolean( |
| 417 | com.android.internal.R.bool.config_ui_enableFadingMarquee); |
Adam Powell | 7d39f85 | 2011-12-05 19:26:54 -0800 | [diff] [blame] | 418 | mTouchSlop = res.getDimensionPixelSize( |
| 419 | com.android.internal.R.dimen.config_viewConfigurationTouchSlop); |
Vladislav Kaznacheev | 556ac61 | 2017-12-07 11:02:08 -0800 | [diff] [blame] | 420 | mHoverSlop = res.getDimensionPixelSize( |
| 421 | com.android.internal.R.dimen.config_viewConfigurationHoverSlop); |
Vladislav Kaznacheev | 4d2c6014 | 2017-02-07 17:11:54 -0800 | [diff] [blame] | 422 | mMinScrollbarTouchTarget = res.getDimensionPixelSize( |
| 423 | com.android.internal.R.dimen.config_minScrollbarTouchTarget); |
Adam Powell | 7d39f85 | 2011-12-05 19:26:54 -0800 | [diff] [blame] | 424 | mPagingTouchSlop = mTouchSlop * 2; |
Adam Powell | e4b8ff8 | 2011-12-06 16:40:49 -0800 | [diff] [blame] | 425 | |
| 426 | mDoubleTapTouchSlop = mTouchSlop; |
Mindy Pereira | 23ffc73 | 2014-04-30 17:09:35 -0700 | [diff] [blame] | 427 | |
| 428 | mMinimumFlingVelocity = res.getDimensionPixelSize( |
| 429 | com.android.internal.R.dimen.config_viewMinFlingVelocity); |
| 430 | mMaximumFlingVelocity = res.getDimensionPixelSize( |
| 431 | com.android.internal.R.dimen.config_viewMaxFlingVelocity); |
Justin Koh | feabd2c | 2014-05-02 10:02:44 -0700 | [diff] [blame] | 432 | mGlobalActionsKeyTimeout = res.getInteger( |
| 433 | com.android.internal.R.integer.config_globalActionsKeyTimeout); |
Aaron Whyte | f830652 | 2017-03-22 16:30:58 -0700 | [diff] [blame] | 434 | |
| 435 | mHorizontalScrollFactor = res.getDimensionPixelSize( |
| 436 | com.android.internal.R.dimen.config_horizontalScrollFactor); |
| 437 | mVerticalScrollFactor = res.getDimensionPixelSize( |
| 438 | com.android.internal.R.dimen.config_verticalScrollFactor); |
Vladislav Kaznacheev | a725df9 | 2018-02-26 16:22:34 -0800 | [diff] [blame] | 439 | |
| 440 | mShowMenuShortcutsWhenKeyboardPresent = res.getBoolean( |
| 441 | com.android.internal.R.bool.config_showMenuShortcutsWhenKeyboardPresent); |
| 442 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 443 | } |
| 444 | |
| 445 | /** |
| 446 | * Returns a configuration for the specified context. The configuration depends on |
| 447 | * various parameters of the context, like the dimension of the display or the |
| 448 | * density of the display. |
| 449 | * |
| 450 | * @param context The application context used to initialize the view configuration. |
| 451 | */ |
| 452 | public static ViewConfiguration get(Context context) { |
| 453 | final DisplayMetrics metrics = context.getResources().getDisplayMetrics(); |
| 454 | final int density = (int) (100.0f * metrics.density); |
| 455 | |
| 456 | ViewConfiguration configuration = sConfigurations.get(density); |
| 457 | if (configuration == null) { |
| 458 | configuration = new ViewConfiguration(context); |
| 459 | sConfigurations.put(density, configuration); |
| 460 | } |
| 461 | |
| 462 | return configuration; |
| 463 | } |
| 464 | |
| 465 | /** |
| 466 | * @return The width of the horizontal scrollbar and the height of the vertical |
Gilles Debunne | 006fa48 | 2011-10-27 17:23:36 -0700 | [diff] [blame] | 467 | * scrollbar in dips |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 468 | * |
| 469 | * @deprecated Use {@link #getScaledScrollBarSize()} instead. |
| 470 | */ |
| 471 | @Deprecated |
| 472 | public static int getScrollBarSize() { |
| 473 | return SCROLL_BAR_SIZE; |
| 474 | } |
| 475 | |
| 476 | /** |
| 477 | * @return The width of the horizontal scrollbar and the height of the vertical |
| 478 | * scrollbar in pixels |
| 479 | */ |
| 480 | public int getScaledScrollBarSize() { |
| 481 | return mScrollbarSize; |
| 482 | } |
| 483 | |
| 484 | /** |
Vladislav Kaznacheev | 4d2c6014 | 2017-02-07 17:11:54 -0800 | [diff] [blame] | 485 | * @return the minimum size of the scrollbar thumb's touch target in pixels |
| 486 | * @hide |
| 487 | */ |
| 488 | public int getScaledMinScrollbarTouchTarget() { |
| 489 | return mMinScrollbarTouchTarget; |
| 490 | } |
| 491 | |
| 492 | /** |
Mike Cleron | f116bf8 | 2009-09-27 19:14:12 -0700 | [diff] [blame] | 493 | * @return Duration of the fade when scrollbars fade away in milliseconds |
| 494 | */ |
| 495 | public static int getScrollBarFadeDuration() { |
| 496 | return SCROLL_BAR_FADE_DURATION; |
| 497 | } |
| 498 | |
| 499 | /** |
Alan Viverette | 25f0e61 | 2015-02-27 12:34:30 -0800 | [diff] [blame] | 500 | * @return Default delay before the scrollbars fade in milliseconds |
Mike Cleron | f116bf8 | 2009-09-27 19:14:12 -0700 | [diff] [blame] | 501 | */ |
| 502 | public static int getScrollDefaultDelay() { |
| 503 | return SCROLL_BAR_DEFAULT_DELAY; |
| 504 | } |
Daisuke Miyakawa | c19895f | 2012-04-03 12:25:26 -0700 | [diff] [blame] | 505 | |
Mike Cleron | f116bf8 | 2009-09-27 19:14:12 -0700 | [diff] [blame] | 506 | /** |
Gilles Debunne | 006fa48 | 2011-10-27 17:23:36 -0700 | [diff] [blame] | 507 | * @return the length of the fading edges in dips |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 508 | * |
| 509 | * @deprecated Use {@link #getScaledFadingEdgeLength()} instead. |
| 510 | */ |
| 511 | @Deprecated |
| 512 | public static int getFadingEdgeLength() { |
| 513 | return FADING_EDGE_LENGTH; |
| 514 | } |
| 515 | |
| 516 | /** |
| 517 | * @return the length of the fading edges in pixels |
| 518 | */ |
| 519 | public int getScaledFadingEdgeLength() { |
| 520 | return mFadingEdgeLength; |
| 521 | } |
| 522 | |
| 523 | /** |
| 524 | * @return the duration in milliseconds of the pressed state in child |
| 525 | * components. |
| 526 | */ |
| 527 | public static int getPressedStateDuration() { |
| 528 | return PRESSED_STATE_DURATION; |
| 529 | } |
Svetoslav Ganov | 54d068e | 2011-03-02 12:58:40 -0800 | [diff] [blame] | 530 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 531 | /** |
| 532 | * @return the duration in milliseconds before a press turns into |
| 533 | * a long press |
| 534 | */ |
| 535 | public static int getLongPressTimeout() { |
Svetoslav Ganov | 54d068e | 2011-03-02 12:58:40 -0800 | [diff] [blame] | 536 | return AppGlobals.getIntCoreSetting(Settings.Secure.LONG_PRESS_TIMEOUT, |
Jeff Brown | a454767 | 2011-03-02 21:38:11 -0800 | [diff] [blame] | 537 | DEFAULT_LONG_PRESS_TIMEOUT); |
| 538 | } |
| 539 | |
| 540 | /** |
Anthony Hugh | 96e9cc5 | 2016-07-12 15:17:24 -0700 | [diff] [blame] | 541 | * @return the duration in milliseconds between the first tap's up event and the second tap's |
| 542 | * down event for an interaction to be considered part of the same multi-press. |
| 543 | * @hide |
| 544 | */ |
| 545 | public static int getMultiPressTimeout() { |
| 546 | return AppGlobals.getIntCoreSetting(Settings.Secure.MULTI_PRESS_TIMEOUT, |
| 547 | DEFAULT_MULTI_PRESS_TIMEOUT); |
| 548 | } |
| 549 | |
| 550 | /** |
Jeff Brown | a454767 | 2011-03-02 21:38:11 -0800 | [diff] [blame] | 551 | * @return the time before the first key repeat in milliseconds. |
| 552 | */ |
| 553 | public static int getKeyRepeatTimeout() { |
| 554 | return getLongPressTimeout(); |
| 555 | } |
| 556 | |
| 557 | /** |
| 558 | * @return the time between successive key repeats in milliseconds. |
| 559 | */ |
| 560 | public static int getKeyRepeatDelay() { |
| 561 | return KEY_REPEAT_DELAY; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 562 | } |
Svetoslav Ganov | 54d068e | 2011-03-02 12:58:40 -0800 | [diff] [blame] | 563 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 564 | /** |
| 565 | * @return the duration in milliseconds we will wait to see if a touch event |
| 566 | * is a tap or a scroll. If the user does not move within this interval, it is |
Daisuke Miyakawa | c19895f | 2012-04-03 12:25:26 -0700 | [diff] [blame] | 567 | * considered to be a tap. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 568 | */ |
| 569 | public static int getTapTimeout() { |
| 570 | return TAP_TIMEOUT; |
| 571 | } |
Jeff Brown | bb3fcba0c | 2011-06-06 19:23:05 -0700 | [diff] [blame] | 572 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 573 | /** |
| 574 | * @return the duration in milliseconds we will wait to see if a touch event |
| 575 | * is a jump tap. If the user does not move within this interval, it is |
Daisuke Miyakawa | c19895f | 2012-04-03 12:25:26 -0700 | [diff] [blame] | 576 | * considered to be a tap. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 577 | */ |
| 578 | public static int getJumpTapTimeout() { |
| 579 | return JUMP_TAP_TIMEOUT; |
| 580 | } |
Daisuke Miyakawa | c19895f | 2012-04-03 12:25:26 -0700 | [diff] [blame] | 581 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 582 | /** |
| 583 | * @return the duration in milliseconds between the first tap's up event and |
| 584 | * the second tap's down event for an interaction to be considered a |
| 585 | * double-tap. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 586 | */ |
| 587 | public static int getDoubleTapTimeout() { |
| 588 | return DOUBLE_TAP_TIMEOUT; |
| 589 | } |
Jeff Brown | bb3fcba0c | 2011-06-06 19:23:05 -0700 | [diff] [blame] | 590 | |
| 591 | /** |
Adam Powell | af1785f | 2013-09-05 13:44:45 -0700 | [diff] [blame] | 592 | * @return the minimum duration in milliseconds between the first tap's |
| 593 | * up event and the second tap's down event for an interaction to be considered a |
| 594 | * double-tap. |
| 595 | * |
| 596 | * @hide |
| 597 | */ |
Mathew Inwood | e5ad598 | 2018-08-17 15:07:52 +0100 | [diff] [blame] | 598 | @UnsupportedAppUsage |
Adam Powell | af1785f | 2013-09-05 13:44:45 -0700 | [diff] [blame] | 599 | public static int getDoubleTapMinTime() { |
| 600 | return DOUBLE_TAP_MIN_TIME; |
| 601 | } |
| 602 | |
| 603 | /** |
Jeff Brown | bb3fcba0c | 2011-06-06 19:23:05 -0700 | [diff] [blame] | 604 | * @return the maximum duration in milliseconds between a touch pad |
| 605 | * touch and release for a given touch to be considered a tap (click) as |
| 606 | * opposed to a hover movement gesture. |
| 607 | * @hide |
| 608 | */ |
| 609 | public static int getHoverTapTimeout() { |
| 610 | return HOVER_TAP_TIMEOUT; |
| 611 | } |
| 612 | |
| 613 | /** |
| 614 | * @return the maximum distance in pixels that a touch pad touch can move |
| 615 | * before being released for it to be considered a tap (click) as opposed |
| 616 | * to a hover movement gesture. |
| 617 | * @hide |
| 618 | */ |
Mathew Inwood | e5ad598 | 2018-08-17 15:07:52 +0100 | [diff] [blame] | 619 | @UnsupportedAppUsage |
Jeff Brown | bb3fcba0c | 2011-06-06 19:23:05 -0700 | [diff] [blame] | 620 | public static int getHoverTapSlop() { |
| 621 | return HOVER_TAP_SLOP; |
| 622 | } |
| 623 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 624 | /** |
Gilles Debunne | 006fa48 | 2011-10-27 17:23:36 -0700 | [diff] [blame] | 625 | * @return Inset in dips to look for touchable content when the user touches the edge of the |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 626 | * screen |
| 627 | * |
| 628 | * @deprecated Use {@link #getScaledEdgeSlop()} instead. |
| 629 | */ |
| 630 | @Deprecated |
| 631 | public static int getEdgeSlop() { |
| 632 | return EDGE_SLOP; |
| 633 | } |
| 634 | |
| 635 | /** |
| 636 | * @return Inset in pixels to look for touchable content when the user touches the edge of the |
| 637 | * screen |
| 638 | */ |
| 639 | public int getScaledEdgeSlop() { |
| 640 | return mEdgeSlop; |
| 641 | } |
| 642 | |
| 643 | /** |
Gilles Debunne | 006fa48 | 2011-10-27 17:23:36 -0700 | [diff] [blame] | 644 | * @return Distance in dips a touch can wander before we think the user is scrolling |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 645 | * |
| 646 | * @deprecated Use {@link #getScaledTouchSlop()} instead. |
| 647 | */ |
| 648 | @Deprecated |
| 649 | public static int getTouchSlop() { |
| 650 | return TOUCH_SLOP; |
| 651 | } |
| 652 | |
| 653 | /** |
Gilles Debunne | 006fa48 | 2011-10-27 17:23:36 -0700 | [diff] [blame] | 654 | * @return Distance in pixels a touch can wander before we think the user is scrolling |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 655 | */ |
| 656 | public int getScaledTouchSlop() { |
| 657 | return mTouchSlop; |
| 658 | } |
Daisuke Miyakawa | c19895f | 2012-04-03 12:25:26 -0700 | [diff] [blame] | 659 | |
Adam Powell | de8d083 | 2010-03-09 17:11:30 -0800 | [diff] [blame] | 660 | /** |
Vladislav Kaznacheev | 556ac61 | 2017-12-07 11:02:08 -0800 | [diff] [blame] | 661 | * @return Distance in pixels a hover can wander while it is still considered "stationary". |
| 662 | * |
| 663 | */ |
| 664 | public int getScaledHoverSlop() { |
| 665 | return mHoverSlop; |
| 666 | } |
| 667 | |
| 668 | /** |
Gilles Debunne | 006fa48 | 2011-10-27 17:23:36 -0700 | [diff] [blame] | 669 | * @return Distance in pixels the first touch can wander before we do not consider this a |
| 670 | * potential double tap event |
| 671 | * @hide |
| 672 | */ |
Mathew Inwood | e5ad598 | 2018-08-17 15:07:52 +0100 | [diff] [blame] | 673 | @UnsupportedAppUsage |
Gilles Debunne | 006fa48 | 2011-10-27 17:23:36 -0700 | [diff] [blame] | 674 | public int getScaledDoubleTapTouchSlop() { |
| 675 | return mDoubleTapTouchSlop; |
| 676 | } |
| 677 | |
| 678 | /** |
| 679 | * @return Distance in pixels a touch can wander before we think the user is scrolling a full |
| 680 | * page |
Adam Powell | de8d083 | 2010-03-09 17:11:30 -0800 | [diff] [blame] | 681 | */ |
| 682 | public int getScaledPagingTouchSlop() { |
| 683 | return mPagingTouchSlop; |
| 684 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 685 | |
| 686 | /** |
Gilles Debunne | 006fa48 | 2011-10-27 17:23:36 -0700 | [diff] [blame] | 687 | * @return Distance in dips between the first touch and second touch to still be |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 688 | * considered a double tap |
| 689 | * @deprecated Use {@link #getScaledDoubleTapSlop()} instead. |
| 690 | * @hide The only client of this should be GestureDetector, which needs this |
| 691 | * for clients that still use its deprecated constructor. |
| 692 | */ |
| 693 | @Deprecated |
Mathew Inwood | e5ad598 | 2018-08-17 15:07:52 +0100 | [diff] [blame] | 694 | @UnsupportedAppUsage |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 695 | public static int getDoubleTapSlop() { |
| 696 | return DOUBLE_TAP_SLOP; |
| 697 | } |
Daisuke Miyakawa | c19895f | 2012-04-03 12:25:26 -0700 | [diff] [blame] | 698 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 699 | /** |
Gilles Debunne | 006fa48 | 2011-10-27 17:23:36 -0700 | [diff] [blame] | 700 | * @return Distance in pixels between the first touch and second touch to still be |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 701 | * considered a double tap |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 702 | */ |
| 703 | public int getScaledDoubleTapSlop() { |
| 704 | return mDoubleTapSlop; |
| 705 | } |
| 706 | |
| 707 | /** |
Svetoslav Ganov | a015617 | 2011-06-26 17:55:44 -0700 | [diff] [blame] | 708 | * Interval for dispatching a recurring accessibility event in milliseconds. |
| 709 | * This interval guarantees that a recurring event will be send at most once |
| 710 | * during the {@link #getSendRecurringAccessibilityEventsInterval()} time frame. |
| 711 | * |
| 712 | * @return The delay in milliseconds. |
| 713 | * |
| 714 | * @hide |
| 715 | */ |
| 716 | public static long getSendRecurringAccessibilityEventsInterval() { |
| 717 | return SEND_RECURRING_ACCESSIBILITY_EVENTS_INTERVAL_MILLIS; |
| 718 | } |
| 719 | |
| 720 | /** |
Gilles Debunne | 006fa48 | 2011-10-27 17:23:36 -0700 | [diff] [blame] | 721 | * @return Distance in dips a touch must be outside the bounds of a window for it |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 722 | * to be counted as outside the window for purposes of dismissing that |
| 723 | * window. |
| 724 | * |
| 725 | * @deprecated Use {@link #getScaledWindowTouchSlop()} instead. |
| 726 | */ |
| 727 | @Deprecated |
| 728 | public static int getWindowTouchSlop() { |
| 729 | return WINDOW_TOUCH_SLOP; |
| 730 | } |
| 731 | |
| 732 | /** |
Gilles Debunne | 006fa48 | 2011-10-27 17:23:36 -0700 | [diff] [blame] | 733 | * @return Distance in pixels a touch must be outside the bounds of a window for it |
| 734 | * to be counted as outside the window for purposes of dismissing that window. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 735 | */ |
| 736 | public int getScaledWindowTouchSlop() { |
| 737 | return mWindowTouchSlop; |
| 738 | } |
Daisuke Miyakawa | c19895f | 2012-04-03 12:25:26 -0700 | [diff] [blame] | 739 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 740 | /** |
Gilles Debunne | 006fa48 | 2011-10-27 17:23:36 -0700 | [diff] [blame] | 741 | * @return Minimum velocity to initiate a fling, as measured in dips per second. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 742 | * |
| 743 | * @deprecated Use {@link #getScaledMinimumFlingVelocity()} instead. |
| 744 | */ |
| 745 | @Deprecated |
| 746 | public static int getMinimumFlingVelocity() { |
| 747 | return MINIMUM_FLING_VELOCITY; |
| 748 | } |
| 749 | |
| 750 | /** |
| 751 | * @return Minimum velocity to initiate a fling, as measured in pixels per second. |
| 752 | */ |
| 753 | public int getScaledMinimumFlingVelocity() { |
| 754 | return mMinimumFlingVelocity; |
| 755 | } |
| 756 | |
| 757 | /** |
Gilles Debunne | 006fa48 | 2011-10-27 17:23:36 -0700 | [diff] [blame] | 758 | * @return Maximum velocity to initiate a fling, as measured in dips per second. |
Romain Guy | 4296fc4 | 2009-07-06 11:48:52 -0700 | [diff] [blame] | 759 | * |
| 760 | * @deprecated Use {@link #getScaledMaximumFlingVelocity()} instead. |
| 761 | */ |
| 762 | @Deprecated |
| 763 | public static int getMaximumFlingVelocity() { |
| 764 | return MAXIMUM_FLING_VELOCITY; |
| 765 | } |
| 766 | |
| 767 | /** |
| 768 | * @return Maximum velocity to initiate a fling, as measured in pixels per second. |
| 769 | */ |
| 770 | public int getScaledMaximumFlingVelocity() { |
| 771 | return mMaximumFlingVelocity; |
| 772 | } |
Daisuke Miyakawa | c19895f | 2012-04-03 12:25:26 -0700 | [diff] [blame] | 773 | |
Romain Guy | 4296fc4 | 2009-07-06 11:48:52 -0700 | [diff] [blame] | 774 | /** |
Ned Burns | 69af432 | 2016-08-17 17:30:25 -0400 | [diff] [blame] | 775 | * @return Amount to scroll in response to a {@link MotionEvent#ACTION_SCROLL} event. Multiply |
| 776 | * this by the event's axis value to obtain the number of pixels to be scrolled. |
Aaron Whyte | f830652 | 2017-03-22 16:30:58 -0700 | [diff] [blame] | 777 | * |
| 778 | * @removed |
Ned Burns | 69af432 | 2016-08-17 17:30:25 -0400 | [diff] [blame] | 779 | */ |
| 780 | public int getScaledScrollFactor() { |
Aaron Whyte | f830652 | 2017-03-22 16:30:58 -0700 | [diff] [blame] | 781 | return (int) mVerticalScrollFactor; |
| 782 | } |
| 783 | |
| 784 | /** |
| 785 | * @return Amount to scroll in response to a horizontal {@link MotionEvent#ACTION_SCROLL} event. |
| 786 | * Multiply this by the event's axis value to obtain the number of pixels to be scrolled. |
| 787 | */ |
| 788 | public float getScaledHorizontalScrollFactor() { |
| 789 | return mHorizontalScrollFactor; |
| 790 | } |
| 791 | |
| 792 | /** |
| 793 | * @return Amount to scroll in response to a vertical {@link MotionEvent#ACTION_SCROLL} event. |
| 794 | * Multiply this by the event's axis value to obtain the number of pixels to be scrolled. |
| 795 | */ |
| 796 | public float getScaledVerticalScrollFactor() { |
| 797 | return mVerticalScrollFactor; |
Ned Burns | 69af432 | 2016-08-17 17:30:25 -0400 | [diff] [blame] | 798 | } |
| 799 | |
| 800 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 801 | * The maximum drawing cache size expressed in bytes. |
| 802 | * |
| 803 | * @return the maximum size of View's drawing cache expressed in bytes |
| 804 | * |
| 805 | * @deprecated Use {@link #getScaledMaximumDrawingCacheSize()} instead. |
| 806 | */ |
| 807 | @Deprecated |
| 808 | public static int getMaximumDrawingCacheSize() { |
| 809 | //noinspection deprecation |
| 810 | return MAXIMUM_DRAWING_CACHE_SIZE; |
| 811 | } |
| 812 | |
| 813 | /** |
| 814 | * The maximum drawing cache size expressed in bytes. |
| 815 | * |
| 816 | * @return the maximum size of View's drawing cache expressed in bytes |
| 817 | */ |
| 818 | public int getScaledMaximumDrawingCacheSize() { |
| 819 | return mMaximumDrawingCacheSize; |
| 820 | } |
| 821 | |
| 822 | /** |
Gilles Debunne | 006fa48 | 2011-10-27 17:23:36 -0700 | [diff] [blame] | 823 | * @return The maximum distance a View should overscroll by when showing edge effects (in |
| 824 | * pixels). |
Adam Powell | 637d337 | 2010-08-25 14:37:03 -0700 | [diff] [blame] | 825 | */ |
| 826 | public int getScaledOverscrollDistance() { |
| 827 | return mOverscrollDistance; |
| 828 | } |
| 829 | |
| 830 | /** |
Gilles Debunne | 006fa48 | 2011-10-27 17:23:36 -0700 | [diff] [blame] | 831 | * @return The maximum distance a View should overfling by when showing edge effects (in |
| 832 | * pixels). |
Adam Powell | 637d337 | 2010-08-25 14:37:03 -0700 | [diff] [blame] | 833 | */ |
| 834 | public int getScaledOverflingDistance() { |
| 835 | return mOverflingDistance; |
| 836 | } |
| 837 | |
| 838 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 839 | * The amount of time that the zoom controls should be |
| 840 | * displayed on the screen expressed in milliseconds. |
Daisuke Miyakawa | c19895f | 2012-04-03 12:25:26 -0700 | [diff] [blame] | 841 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 842 | * @return the time the zoom controls should be visible expressed |
| 843 | * in milliseconds. |
| 844 | */ |
| 845 | public static long getZoomControlsTimeout() { |
| 846 | return ZOOM_CONTROLS_TIMEOUT; |
| 847 | } |
| 848 | |
| 849 | /** |
| 850 | * The amount of time a user needs to press the relevant key to bring up |
| 851 | * the global actions dialog. |
| 852 | * |
| 853 | * @return how long a user needs to press the relevant key to bring up |
| 854 | * the global actions dialog. |
Justin Koh | 8031fa0 | 2014-05-05 16:28:49 -0700 | [diff] [blame] | 855 | * @deprecated This timeout should not be used by applications |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 856 | */ |
Justin Koh | 1aa59f8 | 2014-05-04 12:13:25 -0700 | [diff] [blame] | 857 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 858 | public static long getGlobalActionKeyTimeout() { |
| 859 | return GLOBAL_ACTIONS_KEY_TIMEOUT; |
| 860 | } |
| 861 | |
| 862 | /** |
Justin Koh | feabd2c | 2014-05-02 10:02:44 -0700 | [diff] [blame] | 863 | * The amount of time a user needs to press the relevant key to bring up |
| 864 | * the global actions dialog. |
| 865 | * |
| 866 | * @return how long a user needs to press the relevant key to bring up |
| 867 | * the global actions dialog. |
Justin Koh | 1aa59f8 | 2014-05-04 12:13:25 -0700 | [diff] [blame] | 868 | * @hide |
Justin Koh | feabd2c | 2014-05-02 10:02:44 -0700 | [diff] [blame] | 869 | */ |
Mathew Inwood | e5ad598 | 2018-08-17 15:07:52 +0100 | [diff] [blame] | 870 | @UnsupportedAppUsage |
Justin Koh | feabd2c | 2014-05-02 10:02:44 -0700 | [diff] [blame] | 871 | public long getDeviceGlobalActionKeyTimeout() { |
| 872 | return mGlobalActionsKeyTimeout; |
| 873 | } |
| 874 | |
| 875 | /** |
Phil Weaver | 106fe73 | 2016-11-22 18:18:39 -0800 | [diff] [blame] | 876 | * The amount of time a user needs to press the relevant keys to activate the accessibility |
| 877 | * shortcut. |
| 878 | * |
| 879 | * @return how long a user needs to press the relevant keys to activate the accessibility |
| 880 | * shortcut. |
| 881 | * @hide |
| 882 | */ |
| 883 | public long getAccessibilityShortcutKeyTimeout() { |
| 884 | return A11Y_SHORTCUT_KEY_TIMEOUT; |
| 885 | } |
| 886 | |
| 887 | /** |
Eugene Susla | 5f19cd3 | 2017-10-19 14:00:59 -0700 | [diff] [blame] | 888 | * @return The amount of time a user needs to press the relevant keys to activate the |
| 889 | * accessibility shortcut after it's confirmed that accessibility shortcut is used. |
| 890 | * @hide |
| 891 | */ |
| 892 | public long getAccessibilityShortcutKeyTimeoutAfterConfirmation() { |
| 893 | return A11Y_SHORTCUT_KEY_TIMEOUT_AFTER_CONFIRMATION; |
| 894 | } |
| 895 | |
| 896 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 897 | * The amount of friction applied to scrolls and flings. |
Daisuke Miyakawa | c19895f | 2012-04-03 12:25:26 -0700 | [diff] [blame] | 898 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 899 | * @return A scalar dimensionless value representing the coefficient of |
| 900 | * friction. |
| 901 | */ |
| 902 | public static float getScrollFriction() { |
| 903 | return SCROLL_FRICTION; |
| 904 | } |
Adam Powell | 8c47062 | 2011-06-30 18:19:51 -0700 | [diff] [blame] | 905 | |
| 906 | /** |
Abodunrinwa Toki | 9e21128 | 2015-06-05 02:46:57 +0100 | [diff] [blame] | 907 | * @return the default duration in milliseconds for {@link ActionMode#hide(long)}. |
Abodunrinwa Toki | fd3a3a1 | 2015-05-05 20:04:34 +0100 | [diff] [blame] | 908 | */ |
Abodunrinwa Toki | 9e21128 | 2015-06-05 02:46:57 +0100 | [diff] [blame] | 909 | public static long getDefaultActionModeHideDuration() { |
| 910 | return ACTION_MODE_HIDE_DURATION_DEFAULT; |
Abodunrinwa Toki | fd3a3a1 | 2015-05-05 20:04:34 +0100 | [diff] [blame] | 911 | } |
| 912 | |
| 913 | /** |
Adam Powell | 8c47062 | 2011-06-30 18:19:51 -0700 | [diff] [blame] | 914 | * Report if the device has a permanent menu key available to the user. |
| 915 | * |
| 916 | * <p>As of Android 3.0, devices may not have a permanent menu key available. |
| 917 | * Apps should use the action bar to present menu options to users. |
| 918 | * However, there are some apps where the action bar is inappropriate |
| 919 | * or undesirable. This method may be used to detect if a menu key is present. |
| 920 | * If not, applications should provide another on-screen affordance to access |
| 921 | * functionality. |
| 922 | * |
| 923 | * @return true if a permanent menu key is present, false otherwise. |
| 924 | */ |
| 925 | public boolean hasPermanentMenuKey() { |
| 926 | return sHasPermanentMenuKey; |
| 927 | } |
Romain Guy | 6805545 | 2011-08-02 16:33:02 -0700 | [diff] [blame] | 928 | |
| 929 | /** |
Vladislav Kaznacheev | a725df9 | 2018-02-26 16:22:34 -0800 | [diff] [blame] | 930 | * Check if shortcuts should be displayed in menus. |
| 931 | * |
| 932 | * @return {@code True} if shortcuts should be displayed in menus. |
| 933 | */ |
| 934 | public boolean shouldShowMenuShortcutsWhenKeyboardPresent() { |
| 935 | return mShowMenuShortcutsWhenKeyboardPresent; |
| 936 | } |
| 937 | |
| 938 | /** |
Romain Guy | 6805545 | 2011-08-02 16:33:02 -0700 | [diff] [blame] | 939 | * @hide |
| 940 | * @return Whether or not marquee should use fading edges. |
| 941 | */ |
Mathew Inwood | e5ad598 | 2018-08-17 15:07:52 +0100 | [diff] [blame] | 942 | @UnsupportedAppUsage |
Romain Guy | 6805545 | 2011-08-02 16:33:02 -0700 | [diff] [blame] | 943 | public boolean isFadingMarqueeEnabled() { |
| 944 | return mFadingMarqueeEnabled; |
| 945 | } |
Vladislav Kaznacheev | f847ee3 | 2016-11-21 14:11:00 -0800 | [diff] [blame] | 946 | |
| 947 | /** |
| 948 | * @return the duration in milliseconds before an end of a long press causes a tooltip to be |
| 949 | * hidden |
| 950 | * @hide |
| 951 | */ |
| 952 | @TestApi |
| 953 | public static int getLongPressTooltipHideTimeout() { |
| 954 | return LONG_PRESS_TOOLTIP_HIDE_TIMEOUT; |
| 955 | } |
| 956 | |
| 957 | /** |
| 958 | * @return the duration in milliseconds before a hover event causes a tooltip to be shown |
| 959 | * @hide |
| 960 | */ |
| 961 | @TestApi |
| 962 | public static int getHoverTooltipShowTimeout() { |
| 963 | return HOVER_TOOLTIP_SHOW_TIMEOUT; |
| 964 | } |
| 965 | |
| 966 | /** |
| 967 | * @return the duration in milliseconds before mouse inactivity causes a tooltip to be hidden |
| 968 | * (default variant to be used when {@link View#SYSTEM_UI_FLAG_LOW_PROFILE} is not set). |
| 969 | * @hide |
| 970 | */ |
| 971 | @TestApi |
| 972 | public static int getHoverTooltipHideTimeout() { |
| 973 | return HOVER_TOOLTIP_HIDE_TIMEOUT; |
| 974 | } |
| 975 | |
| 976 | /** |
| 977 | * @return the duration in milliseconds before mouse inactivity causes a tooltip to be hidden |
| 978 | * (shorter variant to be used when {@link View#SYSTEM_UI_FLAG_LOW_PROFILE} is set). |
| 979 | * @hide |
| 980 | */ |
| 981 | @TestApi |
| 982 | public static int getHoverTooltipHideShortTimeout() { |
| 983 | return HOVER_TOOLTIP_HIDE_SHORT_TIMEOUT; |
| 984 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 985 | } |