ViewConfiguration
open class ViewConfiguration
Contains methods to standard constants used in the UI for timeouts, sizes, and distances.
Summary
| Public methods |
| open static ViewConfiguration! |
Returns a configuration for the specified visual Context.
|
| open static Float |
The multiplication factor for inhibiting default gestures.
|
| open static Long |
|
| open static Int |
|
| open static Int |
|
| open static Int |
|
| open static Long |
The amount of time a user needs to press the relevant key to bring up the global actions dialog.
|
| open static Int |
|
| open static Int |
|
| open static Int |
|
| open static Int |
|
| open static Int |
The maximum drawing cache size expressed in bytes.
|
| open static Int |
|
| open static Int |
|
| open static Int |
|
| open static Int |
|
| open Float |
The multiplication factor for inhibiting default gestures.
|
| open Int |
|
| open Int |
|
| open Int |
|
| open Float |
|
| open Int |
|
| open Int |
The maximum drawing cache size expressed in bytes.
|
| open Int |
|
| open Int |
|
| open Int |
Retrieves the distance in pixels between touches that must be reached for a gesture to be interpreted as scaling.
|
| open Int |
|
| open Int |
|
| open Int |
|
| open Int |
|
| open Int |
|
| open Float |
|
| open Int |
|
| open static Int |
|
| open static Int |
|
| open static Int |
|
| open static Float |
The amount of friction applied to scrolls and flings.
|
| open static Int |
|
| open static Int |
|
| open static Int |
|
| open static Long |
The amount of time that the zoom controls should be displayed on the screen expressed in milliseconds.
|
| open Boolean |
Report if the device has a permanent menu key available to the user.
|
| open Boolean |
Check if shortcuts should be displayed in menus.
|
Public constructors
Public methods
get
open static fun get(context: Context!): ViewConfiguration!
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.
getAmbiguousGestureMultiplier
open static fun getAmbiguousGestureMultiplier(): Float
Deprecated: Use getScaledAmbiguousGestureMultiplier().
The multiplication factor for inhibiting default gestures. If a MotionEvent has android.view.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.
| Return |
Float |
Value is 1.0 or greater |
getDefaultActionModeHideDuration
open static fun getDefaultActionModeHideDuration(): Long
getDoubleTapTimeout
open static fun getDoubleTapTimeout(): Int
| Return |
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. |
getEdgeSlop
open static fun getEdgeSlop(): Int
Deprecated: Use getScaledEdgeSlop() instead.
| Return |
Int |
Inset in dips to look for touchable content when the user touches the edge of the screen |
getFadingEdgeLength
open static fun getFadingEdgeLength(): Int
Deprecated: Use getScaledFadingEdgeLength() instead.
| Return |
Int |
the length of the fading edges in dips |
getGlobalActionKeyTimeout
open static fun getGlobalActionKeyTimeout(): Long
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.
| Return |
Long |
how long a user needs to press the relevant key to bring up the global actions dialog. |
getJumpTapTimeout
open static fun getJumpTapTimeout(): Int
| Return |
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. |
getKeyRepeatDelay
open static fun getKeyRepeatDelay(): Int
| Return |
Int |
the time between successive key repeats in milliseconds. |
getKeyRepeatTimeout
open static fun getKeyRepeatTimeout(): Int
| Return |
Int |
the time before the first key repeat in milliseconds. |
getLongPressTimeout
open static fun getLongPressTimeout(): Int
| Return |
Int |
the duration in milliseconds before a press turns into a long press |
getMaximumDrawingCacheSize
open static fun getMaximumDrawingCacheSize(): Int
Deprecated: Use getScaledMaximumDrawingCacheSize() instead.
The maximum drawing cache size expressed in bytes.
| Return |
Int |
the maximum size of View's drawing cache expressed in bytes |
getMaximumFlingVelocity
open static fun getMaximumFlingVelocity(): Int
Deprecated: Use getScaledMaximumFlingVelocity() instead.
| Return |
Int |
Maximum velocity to initiate a fling, as measured in dips per second. |
getMinimumFlingVelocity
open static fun getMinimumFlingVelocity(): Int
Deprecated: Use getScaledMinimumFlingVelocity() instead.
| Return |
Int |
Minimum velocity to initiate a fling, as measured in dips per second. |
getMultiPressTimeout
open static fun getMultiPressTimeout(): Int
| Return |
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 part of the same multi-press. |
getPressedStateDuration
open static fun getPressedStateDuration(): Int
| Return |
Int |
the duration in milliseconds of the pressed state in child components. |
getScaledAmbiguousGestureMultiplier
open fun getScaledAmbiguousGestureMultiplier(): Float
The multiplication factor for inhibiting default gestures. If a MotionEvent has android.view.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.
| Return |
Float |
Value is 1.0 or greater |
getScaledDoubleTapSlop
open fun getScaledDoubleTapSlop(): Int
| Return |
Int |
Distance in pixels between the first touch and second touch to still be considered a double tap |
getScaledEdgeSlop
open fun getScaledEdgeSlop(): Int
| Return |
Int |
Inset in pixels to look for touchable content when the user touches the edge of the screen |
getScaledFadingEdgeLength
open fun getScaledFadingEdgeLength(): Int
| Return |
Int |
the length of the fading edges in pixels |
open fun getScaledHorizontalScrollFactor(): Float
| Return |
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. |
getScaledHoverSlop
open fun getScaledHoverSlop(): Int
| Return |
Int |
Distance in pixels a hover can wander while it is still considered "stationary". |
getScaledMaximumDrawingCacheSize
open fun getScaledMaximumDrawingCacheSize(): Int
The maximum drawing cache size expressed in bytes.
| Return |
Int |
the maximum size of View's drawing cache expressed in bytes |
getScaledMaximumFlingVelocity
open fun getScaledMaximumFlingVelocity(): Int
| Return |
Int |
Maximum velocity to initiate a fling, as measured in pixels per second. |
getScaledMinimumFlingVelocity
open fun getScaledMinimumFlingVelocity(): Int
| Return |
Int |
Minimum velocity to initiate a fling, as measured in pixels per second. |
getScaledMinimumScalingSpan
open fun getScaledMinimumScalingSpan(): Int
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.
| Return |
Int |
The distance in pixels |
| Exceptions |
java.lang.IllegalStateException |
if this method is called on a ViewConfiguration that was instantiated using a constructor with no Context parameter. |
getScaledOverflingDistance
open fun getScaledOverflingDistance(): Int
| Return |
Int |
The maximum distance a View should overfling by when showing edge effects (in pixels). |
open fun getScaledOverscrollDistance(): Int
| Return |
Int |
The maximum distance a View should overscroll by when showing edge effects (in pixels). |
getScaledPagingTouchSlop
open fun getScaledPagingTouchSlop(): Int
| Return |
Int |
Distance in pixels a touch can wander before we think the user is scrolling a full page |
open fun getScaledScrollBarSize(): Int
| Return |
Int |
The width of the horizontal scrollbar and the height of the vertical scrollbar in pixels |
getScaledTouchSlop
open fun getScaledTouchSlop(): Int
| Return |
Int |
Distance in pixels a touch can wander before we think the user is scrolling |
open fun getScaledVerticalScrollFactor(): Float
| Return |
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. |
getScaledWindowTouchSlop
open fun getScaledWindowTouchSlop(): Int
| Return |
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. |
open static fun getScrollBarFadeDuration(): Int
| Return |
Int |
Duration of the fade when scrollbars fade away in milliseconds |
open static fun getScrollBarSize(): Int
Deprecated: Use getScaledScrollBarSize() instead.
| Return |
Int |
The width of the horizontal scrollbar and the height of the vertical scrollbar in dips |
open static fun getScrollDefaultDelay(): Int
| Return |
Int |
Default delay before the scrollbars fade in milliseconds |
open static fun getScrollFriction(): Float
The amount of friction applied to scrolls and flings.
| Return |
Float |
A scalar dimensionless value representing the coefficient of friction. |
getTapTimeout
open static fun getTapTimeout(): Int
| Return |
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. |
getTouchSlop
open static fun getTouchSlop(): Int
Deprecated: Use getScaledTouchSlop() instead.
| Return |
Int |
Distance in dips a touch can wander before we think the user is scrolling |
getWindowTouchSlop
open static fun getWindowTouchSlop(): Int
Deprecated: Use getScaledWindowTouchSlop() instead.
| Return |
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. |
getZoomControlsTimeout
open static fun getZoomControlsTimeout(): Long
The amount of time that the zoom controls should be displayed on the screen expressed in milliseconds.
| Return |
Long |
the time the zoom controls should be visible expressed in milliseconds. |
open fun hasPermanentMenuKey(): Boolean
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.
| Return |
Boolean |
true if a permanent menu key is present, false otherwise. |
open fun shouldShowMenuShortcutsWhenKeyboardPresent(): Boolean
Check if shortcuts should be displayed in menus.
| Return |
Boolean |
True if shortcuts should be displayed in menus. |