blob: 2a74eb773d7d3566d12ae7c84299242eb4cd1fa8 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
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
17package android.view;
18
Svetoslav Ganov54d068e2011-03-02 12:58:40 -080019import android.app.AppGlobals;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080020import android.content.Context;
Dianne Hackbornff801ec2011-01-22 18:05:38 -080021import android.content.res.Configuration;
Svetoslav Ganov54d068e2011-03-02 12:58:40 -080022import android.os.Bundle;
23import android.provider.Settings;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080024import android.util.DisplayMetrics;
25import android.util.SparseArray;
26
27/**
28 * Contains methods to standard constants used in the UI for timeouts, sizes, and distances.
29 */
30public class ViewConfiguration {
31 /**
Romain Guydbc26d22010-10-11 17:58:29 -070032 * Expected bit depth of the display panel.
33 *
34 * @hide
35 */
36 public static final float PANEL_BIT_DEPTH = 24;
37
38 /**
39 * Minimum alpha required for a view to draw.
40 *
41 * @hide
42 */
43 public static final float ALPHA_THRESHOLD = 0.5f / PANEL_BIT_DEPTH;
Romain Guy909cbaf2010-10-13 18:19:48 -070044 /**
45 * @hide
46 */
47 public static final float ALPHA_THRESHOLD_INT = 0x7f / PANEL_BIT_DEPTH;
48
Romain Guydbc26d22010-10-11 17:58:29 -070049 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080050 * Defines the width of the horizontal scrollbar and the height of the vertical scrollbar in
51 * pixels
52 */
53 private static final int SCROLL_BAR_SIZE = 10;
54
55 /**
Mike Cleronf116bf82009-09-27 19:14:12 -070056 * Duration of the fade when scrollbars fade away in milliseconds
57 */
58 private static final int SCROLL_BAR_FADE_DURATION = 250;
59
60 /**
61 * Default delay before the scrollbars fade in milliseconds
62 */
63 private static final int SCROLL_BAR_DEFAULT_DELAY = 300;
64
65 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080066 * Defines the length of the fading edges in pixels
67 */
68 private static final int FADING_EDGE_LENGTH = 12;
69
70 /**
71 * Defines the duration in milliseconds of the pressed state in child
72 * components.
73 */
Adam Powelle14579b2009-12-16 18:39:52 -080074 private static final int PRESSED_STATE_DURATION = 125;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080075
76 /**
Jeff Browna4547672011-03-02 21:38:11 -080077 * Defines the default duration in milliseconds before a press turns into
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080078 * a long press
79 */
Jeff Browna4547672011-03-02 21:38:11 -080080 private static final int DEFAULT_LONG_PRESS_TIMEOUT = 500;
81
82 /**
83 * Defines the time between successive key repeats in milliseconds.
84 */
85 private static final int KEY_REPEAT_DELAY = 50;
86
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080087 /**
88 * Defines the duration in milliseconds a user needs to hold down the
89 * appropriate button to bring up the global actions dialog (power off,
90 * lock screen, etc).
91 */
92 private static final int GLOBAL_ACTIONS_KEY_TIMEOUT = 500;
93
94 /**
95 * Defines the duration in milliseconds we will wait to see if a touch event
96 * is a tap or a scroll. If the user does not move within this interval, it is
97 * considered to be a tap.
98 */
Adam Powelle14579b2009-12-16 18:39:52 -080099 private static final int TAP_TIMEOUT = 115;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800100
101 /**
102 * Defines the duration in milliseconds we will wait to see if a touch event
103 * is a jump tap. If the user does not complete the jump tap within this interval, it is
104 * considered to be a tap.
105 */
106 private static final int JUMP_TAP_TIMEOUT = 500;
107
108 /**
109 * Defines the duration in milliseconds between the first tap's up event and
110 * the second tap's down event for an interaction to be considered a
111 * double-tap.
112 */
113 private static final int DOUBLE_TAP_TIMEOUT = 300;
114
115 /**
116 * Defines the duration in milliseconds we want to display zoom controls in response
117 * to a user panning within an application.
118 */
119 private static final int ZOOM_CONTROLS_TIMEOUT = 3000;
120
121 /**
122 * Inset in pixels to look for touchable content when the user touches the edge of the screen
123 */
124 private static final int EDGE_SLOP = 12;
125
126 /**
127 * Distance a touch can wander before we think the user is scrolling in pixels
128 */
Dianne Hackborn3e2ac882009-09-25 01:34:28 -0700129 private static final int TOUCH_SLOP = 16;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800130
131 /**
Masanori Ogino40209532011-01-14 13:24:20 +0900132 * Distance a touch can wander before we think the user is the first touch
133 * in a sequence of double tap
134 */
135 private static final int LARGE_TOUCH_SLOP = 18;
136
137 /**
Adam Powellde8d0832010-03-09 17:11:30 -0800138 * Distance a touch can wander before we think the user is attempting a paged scroll
139 * (in dips)
140 */
Adam Powellb7ef1d92010-03-11 10:25:24 -0800141 private static final int PAGING_TOUCH_SLOP = TOUCH_SLOP * 2;
Adam Powellde8d0832010-03-09 17:11:30 -0800142
143 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800144 * Distance between the first touch and second touch to still be considered a double tap
145 */
146 private static final int DOUBLE_TAP_SLOP = 100;
147
148 /**
149 * Distance a touch needs to be outside of a window's bounds for it to
150 * count as outside for purposes of dismissing the window.
151 */
152 private static final int WINDOW_TOUCH_SLOP = 16;
153
154 /**
155 * Minimum velocity to initiate a fling, as measured in pixels per second
156 */
157 private static final int MINIMUM_FLING_VELOCITY = 50;
Romain Guy4296fc42009-07-06 11:48:52 -0700158
159 /**
160 * Maximum velocity to initiate a fling, as measured in pixels per second
161 */
Adam Powell637d3372010-08-25 14:37:03 -0700162 private static final int MAXIMUM_FLING_VELOCITY = 8000;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800163
164 /**
165 * The maximum size of View's drawing cache, expressed in bytes. This size
166 * should be at least equal to the size of the screen in ARGB888 format.
167 */
168 @Deprecated
Romain Guy0211a0a2011-02-14 16:34:59 -0800169 private static final int MAXIMUM_DRAWING_CACHE_SIZE = 480 * 800 * 4; // ARGB8888
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800170
171 /**
172 * The coefficient of friction applied to flings/scrolls.
173 */
Romain Guy0211a0a2011-02-14 16:34:59 -0800174 private static final float SCROLL_FRICTION = 0.015f;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800175
Adam Powell637d3372010-08-25 14:37:03 -0700176 /**
177 * Max distance to overscroll for edge effects
178 */
179 private static final int OVERSCROLL_DISTANCE = 0;
180
181 /**
182 * Max distance to overfling for edge effects
183 */
Gilles Debunne8ce7aab2011-01-25 11:23:30 -0800184 private static final int OVERFLING_DISTANCE = 6;
Adam Powell637d3372010-08-25 14:37:03 -0700185
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800186 private final int mEdgeSlop;
187 private final int mFadingEdgeLength;
188 private final int mMinimumFlingVelocity;
Romain Guy4296fc42009-07-06 11:48:52 -0700189 private final int mMaximumFlingVelocity;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800190 private final int mScrollbarSize;
191 private final int mTouchSlop;
Masanori Ogino40209532011-01-14 13:24:20 +0900192 private final int mLargeTouchSlop;
Adam Powellde8d0832010-03-09 17:11:30 -0800193 private final int mPagingTouchSlop;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800194 private final int mDoubleTapSlop;
195 private final int mWindowTouchSlop;
196 private final int mMaximumDrawingCacheSize;
Adam Powell637d3372010-08-25 14:37:03 -0700197 private final int mOverscrollDistance;
198 private final int mOverflingDistance;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800199
200 private static final SparseArray<ViewConfiguration> sConfigurations =
201 new SparseArray<ViewConfiguration>(2);
202
203 /**
204 * @deprecated Use {@link android.view.ViewConfiguration#get(android.content.Context)} instead.
205 */
206 @Deprecated
207 public ViewConfiguration() {
208 mEdgeSlop = EDGE_SLOP;
209 mFadingEdgeLength = FADING_EDGE_LENGTH;
210 mMinimumFlingVelocity = MINIMUM_FLING_VELOCITY;
Romain Guy4296fc42009-07-06 11:48:52 -0700211 mMaximumFlingVelocity = MAXIMUM_FLING_VELOCITY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800212 mScrollbarSize = SCROLL_BAR_SIZE;
213 mTouchSlop = TOUCH_SLOP;
Masanori Ogino40209532011-01-14 13:24:20 +0900214 mLargeTouchSlop = LARGE_TOUCH_SLOP;
Adam Powellde8d0832010-03-09 17:11:30 -0800215 mPagingTouchSlop = PAGING_TOUCH_SLOP;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800216 mDoubleTapSlop = DOUBLE_TAP_SLOP;
217 mWindowTouchSlop = WINDOW_TOUCH_SLOP;
218 //noinspection deprecation
219 mMaximumDrawingCacheSize = MAXIMUM_DRAWING_CACHE_SIZE;
Adam Powell637d3372010-08-25 14:37:03 -0700220 mOverscrollDistance = OVERSCROLL_DISTANCE;
221 mOverflingDistance = OVERFLING_DISTANCE;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800222 }
223
224 /**
225 * Creates a new configuration for the specified context. The configuration depends on
226 * various parameters of the context, like the dimension of the display or the density
227 * of the display.
228 *
229 * @param context The application context used to initialize this view configuration.
230 *
231 * @see #get(android.content.Context)
232 * @see android.util.DisplayMetrics
233 */
234 private ViewConfiguration(Context context) {
235 final DisplayMetrics metrics = context.getResources().getDisplayMetrics();
236 final float density = metrics.density;
Dianne Hackbornff801ec2011-01-22 18:05:38 -0800237 final float sizeAndDensity;
238 if (context.getResources().getConfiguration().isLayoutSizeAtLeast(
239 Configuration.SCREENLAYOUT_SIZE_XLARGE)) {
240 sizeAndDensity = density * 1.5f;
241 } else {
242 sizeAndDensity = density;
243 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800244
Dianne Hackbornff801ec2011-01-22 18:05:38 -0800245 mEdgeSlop = (int) (sizeAndDensity * EDGE_SLOP + 0.5f);
246 mFadingEdgeLength = (int) (sizeAndDensity * FADING_EDGE_LENGTH + 0.5f);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800247 mMinimumFlingVelocity = (int) (density * MINIMUM_FLING_VELOCITY + 0.5f);
Romain Guy4296fc42009-07-06 11:48:52 -0700248 mMaximumFlingVelocity = (int) (density * MAXIMUM_FLING_VELOCITY + 0.5f);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800249 mScrollbarSize = (int) (density * SCROLL_BAR_SIZE + 0.5f);
Dianne Hackbornff801ec2011-01-22 18:05:38 -0800250 mTouchSlop = (int) (sizeAndDensity * TOUCH_SLOP + 0.5f);
Conley Owensa3dcd0a2011-04-29 17:49:06 -0700251 mLargeTouchSlop = (int) (sizeAndDensity * LARGE_TOUCH_SLOP + 0.5f);
Dianne Hackbornff801ec2011-01-22 18:05:38 -0800252 mPagingTouchSlop = (int) (sizeAndDensity * PAGING_TOUCH_SLOP + 0.5f);
253 mDoubleTapSlop = (int) (sizeAndDensity * DOUBLE_TAP_SLOP + 0.5f);
254 mWindowTouchSlop = (int) (sizeAndDensity * WINDOW_TOUCH_SLOP + 0.5f);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800255
256 // Size of the screen in bytes, in ARGB_8888 format
257 mMaximumDrawingCacheSize = 4 * metrics.widthPixels * metrics.heightPixels;
Adam Powell637d3372010-08-25 14:37:03 -0700258
Dianne Hackbornff801ec2011-01-22 18:05:38 -0800259 mOverscrollDistance = (int) (sizeAndDensity * OVERSCROLL_DISTANCE + 0.5f);
260 mOverflingDistance = (int) (sizeAndDensity * OVERFLING_DISTANCE + 0.5f);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800261 }
262
263 /**
264 * Returns a configuration for the specified context. The configuration depends on
265 * various parameters of the context, like the dimension of the display or the
266 * density of the display.
267 *
268 * @param context The application context used to initialize the view configuration.
269 */
270 public static ViewConfiguration get(Context context) {
271 final DisplayMetrics metrics = context.getResources().getDisplayMetrics();
272 final int density = (int) (100.0f * metrics.density);
273
274 ViewConfiguration configuration = sConfigurations.get(density);
275 if (configuration == null) {
276 configuration = new ViewConfiguration(context);
277 sConfigurations.put(density, configuration);
278 }
279
280 return configuration;
281 }
282
283 /**
284 * @return The width of the horizontal scrollbar and the height of the vertical
285 * scrollbar in pixels
286 *
287 * @deprecated Use {@link #getScaledScrollBarSize()} instead.
288 */
289 @Deprecated
290 public static int getScrollBarSize() {
291 return SCROLL_BAR_SIZE;
292 }
293
294 /**
295 * @return The width of the horizontal scrollbar and the height of the vertical
296 * scrollbar in pixels
297 */
298 public int getScaledScrollBarSize() {
299 return mScrollbarSize;
300 }
301
302 /**
Mike Cleronf116bf82009-09-27 19:14:12 -0700303 * @return Duration of the fade when scrollbars fade away in milliseconds
304 */
305 public static int getScrollBarFadeDuration() {
306 return SCROLL_BAR_FADE_DURATION;
307 }
308
309 /**
310 * @return Default delay before the scrollbars fade in milliseconds
311 */
312 public static int getScrollDefaultDelay() {
313 return SCROLL_BAR_DEFAULT_DELAY;
314 }
315
316 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800317 * @return the length of the fading edges in pixels
318 *
319 * @deprecated Use {@link #getScaledFadingEdgeLength()} instead.
320 */
321 @Deprecated
322 public static int getFadingEdgeLength() {
323 return FADING_EDGE_LENGTH;
324 }
325
326 /**
327 * @return the length of the fading edges in pixels
328 */
329 public int getScaledFadingEdgeLength() {
330 return mFadingEdgeLength;
331 }
332
333 /**
334 * @return the duration in milliseconds of the pressed state in child
335 * components.
336 */
337 public static int getPressedStateDuration() {
338 return PRESSED_STATE_DURATION;
339 }
Svetoslav Ganov54d068e2011-03-02 12:58:40 -0800340
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800341 /**
342 * @return the duration in milliseconds before a press turns into
343 * a long press
344 */
345 public static int getLongPressTimeout() {
Svetoslav Ganov54d068e2011-03-02 12:58:40 -0800346 return AppGlobals.getIntCoreSetting(Settings.Secure.LONG_PRESS_TIMEOUT,
Jeff Browna4547672011-03-02 21:38:11 -0800347 DEFAULT_LONG_PRESS_TIMEOUT);
348 }
349
350 /**
351 * @return the time before the first key repeat in milliseconds.
352 */
353 public static int getKeyRepeatTimeout() {
354 return getLongPressTimeout();
355 }
356
357 /**
358 * @return the time between successive key repeats in milliseconds.
359 */
360 public static int getKeyRepeatDelay() {
361 return KEY_REPEAT_DELAY;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800362 }
Svetoslav Ganov54d068e2011-03-02 12:58:40 -0800363
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800364 /**
365 * @return the duration in milliseconds we will wait to see if a touch event
366 * is a tap or a scroll. If the user does not move within this interval, it is
367 * considered to be a tap.
368 */
369 public static int getTapTimeout() {
370 return TAP_TIMEOUT;
371 }
372
373 /**
374 * @return the duration in milliseconds we will wait to see if a touch event
375 * is a jump tap. If the user does not move within this interval, it is
376 * considered to be a tap.
377 */
378 public static int getJumpTapTimeout() {
379 return JUMP_TAP_TIMEOUT;
380 }
381
382 /**
383 * @return the duration in milliseconds between the first tap's up event and
384 * the second tap's down event for an interaction to be considered a
385 * double-tap.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800386 */
387 public static int getDoubleTapTimeout() {
388 return DOUBLE_TAP_TIMEOUT;
389 }
390
391 /**
392 * @return Inset in pixels to look for touchable content when the user touches the edge of the
393 * screen
394 *
395 * @deprecated Use {@link #getScaledEdgeSlop()} instead.
396 */
397 @Deprecated
398 public static int getEdgeSlop() {
399 return EDGE_SLOP;
400 }
401
402 /**
403 * @return Inset in pixels to look for touchable content when the user touches the edge of the
404 * screen
405 */
406 public int getScaledEdgeSlop() {
407 return mEdgeSlop;
408 }
409
410 /**
411 * @return Distance a touch can wander before we think the user is scrolling in pixels
412 *
413 * @deprecated Use {@link #getScaledTouchSlop()} instead.
414 */
415 @Deprecated
416 public static int getTouchSlop() {
417 return TOUCH_SLOP;
418 }
419
420 /**
421 * @return Distance a touch can wander before we think the user is scrolling in pixels
422 */
423 public int getScaledTouchSlop() {
424 return mTouchSlop;
425 }
Adam Powellde8d0832010-03-09 17:11:30 -0800426
427 /**
Masanori Ogino40209532011-01-14 13:24:20 +0900428 * @return Distance a touch can wander before we think the user is the first touch
429 * in a sequence of double tap
430 */
431 public int getScaledLargeTouchSlop() {
432 return mLargeTouchSlop;
433 }
434
435 /**
Adam Powellde8d0832010-03-09 17:11:30 -0800436 * @return Distance a touch can wander before we think the user is scrolling a full page
437 * in dips
438 */
439 public int getScaledPagingTouchSlop() {
440 return mPagingTouchSlop;
441 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800442
443 /**
444 * @return Distance between the first touch and second touch to still be
445 * considered a double tap
446 * @deprecated Use {@link #getScaledDoubleTapSlop()} instead.
447 * @hide The only client of this should be GestureDetector, which needs this
448 * for clients that still use its deprecated constructor.
449 */
450 @Deprecated
451 public static int getDoubleTapSlop() {
452 return DOUBLE_TAP_SLOP;
453 }
454
455 /**
456 * @return Distance between the first touch and second touch to still be
457 * considered a double tap
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800458 */
459 public int getScaledDoubleTapSlop() {
460 return mDoubleTapSlop;
461 }
462
463 /**
464 * @return Distance a touch must be outside the bounds of a window for it
465 * to be counted as outside the window for purposes of dismissing that
466 * window.
467 *
468 * @deprecated Use {@link #getScaledWindowTouchSlop()} instead.
469 */
470 @Deprecated
471 public static int getWindowTouchSlop() {
472 return WINDOW_TOUCH_SLOP;
473 }
474
475 /**
476 * @return Distance a touch must be outside the bounds of a window for it
477 * to be counted as outside the window for purposes of dismissing that
478 * window.
479 */
480 public int getScaledWindowTouchSlop() {
481 return mWindowTouchSlop;
482 }
483
484 /**
485 * @return Minimum velocity to initiate a fling, as measured in pixels per second.
486 *
487 * @deprecated Use {@link #getScaledMinimumFlingVelocity()} instead.
488 */
489 @Deprecated
490 public static int getMinimumFlingVelocity() {
491 return MINIMUM_FLING_VELOCITY;
492 }
493
494 /**
495 * @return Minimum velocity to initiate a fling, as measured in pixels per second.
496 */
497 public int getScaledMinimumFlingVelocity() {
498 return mMinimumFlingVelocity;
499 }
500
501 /**
Romain Guy4296fc42009-07-06 11:48:52 -0700502 * @return Maximum velocity to initiate a fling, as measured in pixels per second.
503 *
504 * @deprecated Use {@link #getScaledMaximumFlingVelocity()} instead.
505 */
506 @Deprecated
507 public static int getMaximumFlingVelocity() {
508 return MAXIMUM_FLING_VELOCITY;
509 }
510
511 /**
512 * @return Maximum velocity to initiate a fling, as measured in pixels per second.
513 */
514 public int getScaledMaximumFlingVelocity() {
515 return mMaximumFlingVelocity;
516 }
517
518 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800519 * The maximum drawing cache size expressed in bytes.
520 *
521 * @return the maximum size of View's drawing cache expressed in bytes
522 *
523 * @deprecated Use {@link #getScaledMaximumDrawingCacheSize()} instead.
524 */
525 @Deprecated
526 public static int getMaximumDrawingCacheSize() {
527 //noinspection deprecation
528 return MAXIMUM_DRAWING_CACHE_SIZE;
529 }
530
531 /**
532 * The maximum drawing cache size expressed in bytes.
533 *
534 * @return the maximum size of View's drawing cache expressed in bytes
535 */
536 public int getScaledMaximumDrawingCacheSize() {
537 return mMaximumDrawingCacheSize;
538 }
539
540 /**
Adam Powell637d3372010-08-25 14:37:03 -0700541 * @return The maximum distance a View should overscroll by when showing edge effects.
542 */
543 public int getScaledOverscrollDistance() {
544 return mOverscrollDistance;
545 }
546
547 /**
548 * @return The maximum distance a View should overfling by when showing edge effects.
549 */
550 public int getScaledOverflingDistance() {
551 return mOverflingDistance;
552 }
553
554 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800555 * The amount of time that the zoom controls should be
556 * displayed on the screen expressed in milliseconds.
557 *
558 * @return the time the zoom controls should be visible expressed
559 * in milliseconds.
560 */
561 public static long getZoomControlsTimeout() {
562 return ZOOM_CONTROLS_TIMEOUT;
563 }
564
565 /**
566 * The amount of time a user needs to press the relevant key to bring up
567 * the global actions dialog.
568 *
569 * @return how long a user needs to press the relevant key to bring up
570 * the global actions dialog.
571 */
572 public static long getGlobalActionKeyTimeout() {
573 return GLOBAL_ACTIONS_KEY_TIMEOUT;
574 }
575
576 /**
577 * The amount of friction applied to scrolls and flings.
578 *
579 * @return A scalar dimensionless value representing the coefficient of
580 * friction.
581 */
582 public static float getScrollFriction() {
583 return SCROLL_FRICTION;
584 }
585}