public class

ViewConfiguration

extends Object
java.lang.Object
   ↳ android.view.ViewConfiguration

Class Overview

Contains methods to standard constants used in the UI for timeouts, sizes, and distances.

Summary

Public Constructors
ViewConfiguration()
This constructor is deprecated. Use get(android.content.Context) instead.
Public Methods
static ViewConfiguration get(Context context)
Returns a configuration for the specified context.
static int getDoubleTapTimeout()
static int getEdgeSlop()
This method is deprecated. Use getScaledEdgeSlop() instead.
static int getFadingEdgeLength()
This method is deprecated. Use getScaledFadingEdgeLength() instead.
static long getGlobalActionKeyTimeout()
The amount of time a user needs to press the relevant key to bring up the global actions dialog.
static int getJumpTapTimeout()
static int getLongPressTimeout()
static int getMaximumDrawingCacheSize()
This method is deprecated. Use getScaledMaximumDrawingCacheSize() instead.
static int getMaximumFlingVelocity()
This method is deprecated. Use getScaledMaximumFlingVelocity() instead.
static int getMinimumFlingVelocity()
This method is deprecated. Use getScaledMinimumFlingVelocity() instead.
static int getPressedStateDuration()
int getScaledDoubleTapSlop()
int getScaledEdgeSlop()
int getScaledFadingEdgeLength()
int getScaledMaximumDrawingCacheSize()
The maximum drawing cache size expressed in bytes.
int getScaledMaximumFlingVelocity()
int getScaledMinimumFlingVelocity()
int getScaledOverflingDistance()
int getScaledOverscrollDistance()
int getScaledPagingTouchSlop()
int getScaledScrollBarSize()
int getScaledTouchSlop()
int getScaledWindowTouchSlop()
static int getScrollBarFadeDuration()
static int getScrollBarSize()
This method is deprecated. Use getScaledScrollBarSize() instead.
static int getScrollDefaultDelay()
static float getScrollFriction()
The amount of friction applied to scrolls and flings.
static int getTapTimeout()
static int getTouchSlop()
This method is deprecated. Use getScaledTouchSlop() instead.
static int getWindowTouchSlop()
This method is deprecated. Use getScaledWindowTouchSlop() instead.
static long getZoomControlsTimeout()
The amount of time that the zoom controls should be displayed on the screen expressed in milliseconds.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ViewConfiguration ()

Since: API Level 1

This constructor is deprecated.
Use get(android.content.Context) instead.

Public Methods

public static ViewConfiguration get (Context context)

Since: API Level 3

Returns a configuration for the specified context. The configuration depends on various parameters of the context, like the dimension of the display or the density of the display.

Parameters
context The application context used to initialize the view configuration.

public static int getDoubleTapTimeout ()

Since: API Level 3

Returns
  • the duration in milliseconds between the first tap's up event and the second tap's down event for an interaction to be considered a double-tap.

public static int getEdgeSlop ()

Since: API Level 1

This method is deprecated.
Use getScaledEdgeSlop() instead.

Returns
  • Inset in pixels to look for touchable content when the user touches the edge of the screen

public static int getFadingEdgeLength ()

Since: API Level 1

This method is deprecated.
Use getScaledFadingEdgeLength() instead.

Returns
  • the length of the fading edges in pixels

public static long getGlobalActionKeyTimeout ()

Since: API Level 1

The amount of time a user needs to press the relevant key to bring up the global actions dialog.

Returns
  • how long a user needs to press the relevant key to bring up the global actions dialog.

public static int getJumpTapTimeout ()

Since: API Level 1

Returns
  • the duration in milliseconds we will wait to see if a touch event is a jump tap. If the user does not move within this interval, it is considered to be a tap.

public static int getLongPressTimeout ()

Since: API Level 1

Returns
  • the duration in milliseconds before a press turns into a long press

public static int getMaximumDrawingCacheSize ()

Since: API Level 1

This method is deprecated.
Use getScaledMaximumDrawingCacheSize() instead.

The maximum drawing cache size expressed in bytes.

Returns
  • the maximum size of View's drawing cache expressed in bytes

public static int getMaximumFlingVelocity ()

Since: API Level 4

This method is deprecated.
Use getScaledMaximumFlingVelocity() instead.

Returns
  • Maximum velocity to initiate a fling, as measured in pixels per second.

public static int getMinimumFlingVelocity ()

Since: API Level 1

This method is deprecated.
Use getScaledMinimumFlingVelocity() instead.

Returns
  • Minimum velocity to initiate a fling, as measured in pixels per second.

public static int getPressedStateDuration ()

Since: API Level 1

Returns
  • the duration in milliseconds of the pressed state in child components.

public int getScaledDoubleTapSlop ()

Since: API Level 3

Returns
  • Distance between the first touch and second touch to still be considered a double tap

public int getScaledEdgeSlop ()

Since: API Level 3

Returns
  • Inset in pixels to look for touchable content when the user touches the edge of the screen

public int getScaledFadingEdgeLength ()

Since: API Level 3

Returns
  • the length of the fading edges in pixels

public int getScaledMaximumDrawingCacheSize ()

Since: API Level 3

The maximum drawing cache size expressed in bytes.

Returns
  • the maximum size of View's drawing cache expressed in bytes

public int getScaledMaximumFlingVelocity ()

Since: API Level 4

Returns
  • Maximum velocity to initiate a fling, as measured in pixels per second.

public int getScaledMinimumFlingVelocity ()

Since: API Level 3

Returns
  • Minimum velocity to initiate a fling, as measured in pixels per second.

public int getScaledOverflingDistance ()

Since: API Level 9

Returns
  • The maximum distance a View should overfling by when showing edge effects.

public int getScaledOverscrollDistance ()

Since: API Level 9

Returns
  • The maximum distance a View should overscroll by when showing edge effects.

public int getScaledPagingTouchSlop ()

Since: API Level 8

Returns
  • Distance a touch can wander before we think the user is scrolling a full page in dips

public int getScaledScrollBarSize ()

Since: API Level 3

Returns
  • The width of the horizontal scrollbar and the height of the vertical scrollbar in pixels

public int getScaledTouchSlop ()

Since: API Level 3

Returns
  • Distance a touch can wander before we think the user is scrolling in pixels

public int getScaledWindowTouchSlop ()

Since: API Level 3

Returns
  • Distance a touch must be outside the bounds of a window for it to be counted as outside the window for purposes of dismissing that window.

public static int getScrollBarFadeDuration ()

Since: API Level 5

Returns
  • Duration of the fade when scrollbars fade away in milliseconds

public static int getScrollBarSize ()

Since: API Level 1

This method is deprecated.
Use getScaledScrollBarSize() instead.

Returns
  • The width of the horizontal scrollbar and the height of the vertical scrollbar in pixels

public static int getScrollDefaultDelay ()

Since: API Level 5

Returns
  • Default delay before the scrollbars fade in milliseconds

public static float getScrollFriction ()

Since: API Level 1

The amount of friction applied to scrolls and flings.

Returns
  • A scalar dimensionless value representing the coefficient of friction.

public static int getTapTimeout ()

Since: API Level 1

Returns
  • the duration in milliseconds we will wait to see if a touch event is a tap or a scroll. If the user does not move within this interval, it is considered to be a tap.

public static int getTouchSlop ()

Since: API Level 1

This method is deprecated.
Use getScaledTouchSlop() instead.

Returns
  • Distance a touch can wander before we think the user is scrolling in pixels

public static int getWindowTouchSlop ()

Since: API Level 1

This method is deprecated.
Use getScaledWindowTouchSlop() instead.

Returns
  • Distance a touch must be outside the bounds of a window for it to be counted as outside the window for purposes of dismissing that window.

public static long getZoomControlsTimeout ()

Since: API Level 1

The amount of time that the zoom controls should be displayed on the screen expressed in milliseconds.

Returns
  • the time the zoom controls should be visible expressed in milliseconds.