# Print output for @column tags ?>
public
class
ViewConfiguration
extends Object
java.lang.Object | |
↳ | android.view.ViewConfiguration |
Contains methods to standard constants used in the UI for timeouts, sizes, and distances.
Public constructors | |
---|---|
ViewConfiguration()
This constructor is deprecated.
Use |
Public methods | |
---|---|
static
ViewConfiguration
|
get(Context context)
Returns a configuration for the specified visual |
static
float
|
getAmbiguousGestureMultiplier()
This method is deprecated.
Use |
static
long
|
getDefaultActionModeHideDuration()
|
static
int
|
getDoubleTapTimeout()
|
static
int
|
getEdgeSlop()
This method is deprecated.
Use |
static
int
|
getFadingEdgeLength()
This method is deprecated.
Use |
static
long
|
getGlobalActionKeyTimeout()
This method is deprecated. This timeout should not be used by applications |
static
int
|
getJumpTapTimeout()
|
static
int
|
getKeyRepeatDelay()
|
static
int
|
getKeyRepeatTimeout()
|
static
int
|
getLongPressTimeout()
|
static
int
|
getMaximumDrawingCacheSize()
This method is deprecated.
Use |
static
int
|
getMaximumFlingVelocity()
This method is deprecated.
Use |
static
int
|
getMinimumFlingVelocity()
This method is deprecated.
Use |
static
int
|
getPressedStateDuration()
|
float
|
getScaledAmbiguousGestureMultiplier()
The multiplication factor for inhibiting default gestures. |
int
|
getScaledDoubleTapSlop()
|
int
|
getScaledEdgeSlop()
|
int
|
getScaledFadingEdgeLength()
|
float
|
getScaledHorizontalScrollFactor()
|
int
|
getScaledHoverSlop()
|
int
|
getScaledMaximumDrawingCacheSize()
The maximum drawing cache size expressed in bytes. |
int
|
getScaledMaximumFlingVelocity()
|
int
|
getScaledMinimumFlingVelocity()
|
int
|
getScaledMinimumScalingSpan()
Retrieves the distance in pixels between touches that must be reached for a gesture to be interpreted as scaling. |
int
|
getScaledOverflingDistance()
|
int
|
getScaledOverscrollDistance()
|
int
|
getScaledPagingTouchSlop()
|
int
|
getScaledScrollBarSize()
|
int
|
getScaledTouchSlop()
|
float
|
getScaledVerticalScrollFactor()
|
int
|
getScaledWindowTouchSlop()
|
static
int
|
getScrollBarFadeDuration()
|
static
int
|
getScrollBarSize()
This method is deprecated.
Use |
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 |
static
int
|
getWindowTouchSlop()
This method is deprecated.
Use |
static
long
|
getZoomControlsTimeout()
The amount of time that the zoom controls should be displayed on the screen expressed in milliseconds. |
boolean
|
hasPermanentMenuKey()
Report if the device has a permanent menu key available to the user. |
boolean
|
shouldShowMenuShortcutsWhenKeyboardPresent()
Check if shortcuts should be displayed in menus. |
Inherited methods | |
---|---|
public ViewConfiguration ()
This constructor is deprecated.
Use get(android.content.Context)
instead.
public static ViewConfiguration get (Context context)
Returns a configuration for the specified visual Context
. The configuration depends
on various parameters of the Context
, like the dimension of the display or the
density of the display.
Parameters | |
---|---|
context |
Context : A visual Context used to initialize the view configuration. It must
be Activity or other Context created with
Context#createWindowContext(int, Bundle) . |
Returns | |
---|---|
ViewConfiguration |
public static float getAmbiguousGestureMultiplier ()
This method is deprecated.
Use getScaledAmbiguousGestureMultiplier()
.
The multiplication factor for inhibiting default gestures.
If a MotionEvent has MotionEvent.CLASSIFICATION_AMBIGUOUS_GESTURE
set,
then certain actions, such as scrolling, will be inhibited. However, to account for the
possibility of an incorrect classification, existing gesture thresholds (e.g. scrolling
touch slop and the long-press timeout) should be scaled by this factor and remain in effect.
Returns | |
---|---|
float |
Value is 1.0 or greater |
public static long getDefaultActionModeHideDuration ()
Returns | |
---|---|
long |
the default duration in milliseconds for ActionMode#hide(long) . |
public static int getDoubleTapTimeout ()
Returns | |
---|---|
int |
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 ()
This method is deprecated.
Use getScaledEdgeSlop()
instead.
Returns | |
---|---|
int |
Inset in dips to look for touchable content when the user touches the edge of the screen |
public static int getFadingEdgeLength ()
This method is deprecated.
Use getScaledFadingEdgeLength()
instead.
Returns | |
---|---|
int |
the length of the fading edges in dips |
public static long getGlobalActionKeyTimeout ()
This method is deprecated.
This timeout should not be used by applications
The amount of time a user needs to press the relevant key to bring up the global actions dialog.
Returns | |
---|---|
long |
how long a user needs to press the relevant key to bring up the global actions dialog. |
public static int getJumpTapTimeout ()
Returns | |
---|---|
int |
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 getKeyRepeatDelay ()
Returns | |
---|---|
int |
the time between successive key repeats in milliseconds. |
public static int getKeyRepeatTimeout ()
Returns | |
---|---|
int |
the time before the first key repeat in milliseconds. |
public static int getLongPressTimeout ()
Returns | |
---|---|
int |
the duration in milliseconds before a press turns into a long press |
public static int getMaximumDrawingCacheSize ()
This method is deprecated.
Use getScaledMaximumDrawingCacheSize()
instead.
The maximum drawing cache size expressed in bytes.
Returns | |
---|---|
int |
the maximum size of View's drawing cache expressed in bytes |
public static int getMaximumFlingVelocity ()
This method is deprecated.
Use getScaledMaximumFlingVelocity()
instead.
Returns | |
---|---|
int |
Maximum velocity to initiate a fling, as measured in dips per second. |
public static int getMinimumFlingVelocity ()
This method is deprecated.
Use getScaledMinimumFlingVelocity()
instead.
Returns | |
---|---|
int |
Minimum velocity to initiate a fling, as measured in dips per second. |
public static int getPressedStateDuration ()
Returns | |
---|---|
int |
the duration in milliseconds of the pressed state in child components. |
public float getScaledAmbiguousGestureMultiplier ()
The multiplication factor for inhibiting default gestures.
If a MotionEvent has MotionEvent.CLASSIFICATION_AMBIGUOUS_GESTURE
set,
then certain actions, such as scrolling, will be inhibited. However, to account for the
possibility of an incorrect classification, existing gesture thresholds (e.g. scrolling
touch slop and the long-press timeout) should be scaled by this factor and remain in effect.
Returns | |
---|---|
float |
Value is 1.0 or greater |
public int getScaledDoubleTapSlop ()
Returns | |
---|---|
int |
Distance in pixels between the first touch and second touch to still be considered a double tap |
public int getScaledEdgeSlop ()
Returns | |
---|---|
int |
Inset in pixels to look for touchable content when the user touches the edge of the screen |
public int getScaledFadingEdgeLength ()
Returns | |
---|---|
int |
the length of the fading edges in pixels |
public float getScaledHorizontalScrollFactor ()
Returns | |
---|---|
float |
Amount to scroll in response to a horizontal MotionEvent#ACTION_SCROLL event.
Multiply this by the event's axis value to obtain the number of pixels to be scrolled. |
public int getScaledHoverSlop ()
Returns | |
---|---|
int |
Distance in pixels a hover can wander while it is still considered "stationary". |
public int getScaledMaximumDrawingCacheSize ()
The maximum drawing cache size expressed in bytes.
Returns | |
---|---|
int |
the maximum size of View's drawing cache expressed in bytes |
public int getScaledMaximumFlingVelocity ()
Returns | |
---|---|
int |
Maximum velocity to initiate a fling, as measured in pixels per second. |
public int getScaledMinimumFlingVelocity ()
Returns | |
---|---|
int |
Minimum velocity to initiate a fling, as measured in pixels per second. |
public int getScaledMinimumScalingSpan ()
Retrieves the distance in pixels between touches that must be reached for a gesture to be interpreted as scaling. In general, scaling shouldn't start until this distance has been met or surpassed, and scaling should end when the distance in pixels between touches drops below this distance.
Returns | |
---|---|
int |
The distance in pixels |
Throws | |
---|---|
IllegalStateException |
if this method is called on a ViewConfiguration that was instantiated using a constructor with no Context parameter. |
public int getScaledOverflingDistance ()
Returns | |
---|---|
int |
The maximum distance a View should overfling by when showing edge effects (in pixels). |
public int getScaledOverscrollDistance ()
Returns | |
---|---|
int |
The maximum distance a View should overscroll by when showing edge effects (in pixels). |
public int getScaledPagingTouchSlop ()
Returns | |
---|---|
int |
Distance in pixels a touch can wander before we think the user is scrolling a full page |
public int getScaledScrollBarSize ()
Returns | |
---|---|
int |
The width of the horizontal scrollbar and the height of the vertical scrollbar in pixels |
public int getScaledTouchSlop ()
Returns | |
---|---|
int |
Distance in pixels a touch can wander before we think the user is scrolling |
public float getScaledVerticalScrollFactor ()
Returns | |
---|---|
float |
Amount to scroll in response to a vertical MotionEvent#ACTION_SCROLL event.
Multiply this by the event's axis value to obtain the number of pixels to be scrolled. |
public int getScaledWindowTouchSlop ()
Returns | |
---|---|
int |
Distance in pixels 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 ()
Returns | |
---|---|
int |
Duration of the fade when scrollbars fade away in milliseconds |
public static int getScrollBarSize ()
This method is deprecated.
Use getScaledScrollBarSize()
instead.
Returns | |
---|---|
int |
The width of the horizontal scrollbar and the height of the vertical scrollbar in dips |
public static int getScrollDefaultDelay ()
Returns | |
---|---|
int |
Default delay before the scrollbars fade in milliseconds |
public static float getScrollFriction ()
The amount of friction applied to scrolls and flings.
Returns | |
---|---|
float |
A scalar dimensionless value representing the coefficient of friction. |
public static int getTapTimeout ()
Returns | |
---|---|
int |
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 ()
This method is deprecated.
Use getScaledTouchSlop()
instead.
Returns | |
---|---|
int |
Distance in dips a touch can wander before we think the user is scrolling |
public static int getWindowTouchSlop ()
This method is deprecated.
Use getScaledWindowTouchSlop()
instead.
Returns | |
---|---|
int |
Distance in dips 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 ()
The amount of time that the zoom controls should be displayed on the screen expressed in milliseconds.
Returns | |
---|---|
long |
the time the zoom controls should be visible expressed in milliseconds. |
public boolean hasPermanentMenuKey ()
Report if the device has a permanent menu key available to the user.
As of Android 3.0, devices may not have a permanent menu key available. Apps should use the action bar to present menu options to users. However, there are some apps where the action bar is inappropriate or undesirable. This method may be used to detect if a menu key is present. If not, applications should provide another on-screen affordance to access functionality.
Returns | |
---|---|
boolean |
true if a permanent menu key is present, false otherwise. |
public boolean shouldShowMenuShortcutsWhenKeyboardPresent ()
Check if shortcuts should be displayed in menus.
Returns | |
---|---|
boolean |
True if shortcuts should be displayed in menus. |