ViewConfiguration
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.
Summary
Public constructors | |
|---|---|
ViewConfiguration()
This constructor was deprecated
in API level 3.
Use |
|
Public methods | |
|---|---|
static
ViewConfiguration
|
get(Context context)
Returns a configuration for the specified context. |
static
long
|
getDefaultActionModeHideDuration()
|
static
int
|
getDoubleTapTimeout()
|
static
int
|
getEdgeSlop()
This method was deprecated
in API level 3.
Use |
static
int
|
getFadingEdgeLength()
This method was deprecated
in API level 3.
Use |
static
long
|
getGlobalActionKeyTimeout()
This method was deprecated in API level 20. 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 was deprecated
in API level 3.
Use |
static
int
|
getMaximumFlingVelocity()
This method was deprecated
in API level 4.
Use |
static
int
|
getMinimumFlingVelocity()
This method was deprecated
in API level 3.
Use |
static
int
|
getPressedStateDuration()
|
int
|
getScaledDoubleTapSlop()
|
int
|
getScaledEdgeSlop()
|
int
|
getScaledFadingEdgeLength()
|
float
|
getScaledHorizontalScrollFactor()
|
int
|
getScaledMaximumDrawingCacheSize()
The maximum drawing cache size expressed in bytes. |
int
|
getScaledMaximumFlingVelocity()
|
int
|
getScaledMinimumFlingVelocity()
|
int
|
getScaledOverflingDistance()
|
int
|
getScaledOverscrollDistance()
|
int
|
getScaledPagingTouchSlop()
|
int
|
getScaledScrollBarSize()
|
int
|
getScaledTouchSlop()
|
float
|
getScaledVerticalScrollFactor()
|
int
|
getScaledWindowTouchSlop()
|
static
int
|
getScrollBarFadeDuration()
|
static
int
|
getScrollBarSize()
This method was deprecated
in API level 3.
Use |
static
int
|
getScrollDefaultDelay()
|
static
float
|
getScrollFriction()
The amount of friction applied to scrolls and flings. |
static
int
|
getTapTimeout()
|
static
int
|
getTouchSlop()
This method was deprecated
in API level 3.
Use |
static
int
|
getWindowTouchSlop()
This method was deprecated
in API level 3.
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. |
Inherited methods | |
|---|---|
java.lang.Object
| |
Public constructors
ViewConfiguration
ViewConfiguration ()
This constructor was deprecated
in API level 3.
Use get(android.content.Context) instead.
Public methods
get
ViewConfiguration get (Context context)
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 |
Context: The application context used to initialize the view configuration.
|
| Returns | |
|---|---|
ViewConfiguration |
|
getDefaultActionModeHideDuration
long getDefaultActionModeHideDuration ()
| Returns | |
|---|---|
long |
the default duration in milliseconds for hide(long).
|
getDoubleTapTimeout
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. |
getEdgeSlop
int getEdgeSlop ()
This method was deprecated
in API level 3.
Use getScaledEdgeSlop() instead.
| Returns | |
|---|---|
int |
Inset in dips to look for touchable content when the user touches the edge of the screen |
getFadingEdgeLength
int getFadingEdgeLength ()
This method was deprecated
in API level 3.
Use getScaledFadingEdgeLength() instead.
| Returns | |
|---|---|
int |
the length of the fading edges in dips |
getGlobalActionKeyTimeout
long getGlobalActionKeyTimeout ()
This method was deprecated
in API level 20.
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. |
getJumpTapTimeout
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. |
getKeyRepeatDelay
int getKeyRepeatDelay ()
| Returns | |
|---|---|
int |
the time between successive key repeats in milliseconds. |
getKeyRepeatTimeout
int getKeyRepeatTimeout ()
| Returns | |
|---|---|
int |
the time before the first key repeat in milliseconds. |
getLongPressTimeout
int getLongPressTimeout ()
| Returns | |
|---|---|
int |
the duration in milliseconds before a press turns into a long press |
getMaximumDrawingCacheSize
int getMaximumDrawingCacheSize ()
This method was deprecated
in API level 3.
Use getScaledMaximumDrawingCacheSize() instead.
The maximum drawing cache size expressed in bytes.
| Returns | |
|---|---|
int |
the maximum size of View's drawing cache expressed in bytes |
getMaximumFlingVelocity
int getMaximumFlingVelocity ()
This method was deprecated
in API level 4.
Use getScaledMaximumFlingVelocity() instead.
| Returns | |
|---|---|
int |
Maximum velocity to initiate a fling, as measured in dips per second. |
getMinimumFlingVelocity
int getMinimumFlingVelocity ()
This method was deprecated
in API level 3.
Use getScaledMinimumFlingVelocity() instead.
| Returns | |
|---|---|
int |
Minimum velocity to initiate a fling, as measured in dips per second. |
getPressedStateDuration
int getPressedStateDuration ()
| Returns | |
|---|---|
int |
the duration in milliseconds of the pressed state in child components. |
getScaledDoubleTapSlop
int getScaledDoubleTapSlop ()
| Returns | |
|---|---|
int |
Distance in pixels between the first touch and second touch to still be considered a double tap |
getScaledEdgeSlop
int getScaledEdgeSlop ()
| Returns | |
|---|---|
int |
Inset in pixels to look for touchable content when the user touches the edge of the screen |
getScaledFadingEdgeLength
int getScaledFadingEdgeLength ()
| Returns | |
|---|---|
int |
the length of the fading edges in pixels |
getScaledHorizontalScrollFactor
float getScaledHorizontalScrollFactor ()
| Returns | |
|---|---|
float |
Amount to scroll in response to a horizontal ACTION_SCROLL event.
Multiply this by the event's axis value to obtain the number of pixels to be scrolled.
|
getScaledMaximumDrawingCacheSize
int getScaledMaximumDrawingCacheSize ()
The maximum drawing cache size expressed in bytes.
| Returns | |
|---|---|
int |
the maximum size of View's drawing cache expressed in bytes |
getScaledMaximumFlingVelocity
int getScaledMaximumFlingVelocity ()
| Returns | |
|---|---|
int |
Maximum velocity to initiate a fling, as measured in pixels per second. |
getScaledMinimumFlingVelocity
int getScaledMinimumFlingVelocity ()
| Returns | |
|---|---|
int |
Minimum velocity to initiate a fling, as measured in pixels per second. |
getScaledOverflingDistance
int getScaledOverflingDistance ()
| Returns | |
|---|---|
int |
The maximum distance a View should overfling by when showing edge effects (in pixels). |
getScaledOverscrollDistance
int getScaledOverscrollDistance ()
| Returns | |
|---|---|
int |
The maximum distance a View should overscroll by when showing edge effects (in pixels). |
getScaledPagingTouchSlop
int getScaledPagingTouchSlop ()
| Returns | |
|---|---|
int |
Distance in pixels a touch can wander before we think the user is scrolling a full page |
getScaledScrollBarSize
int getScaledScrollBarSize ()
| Returns | |
|---|---|
int |
The width of the horizontal scrollbar and the height of the vertical scrollbar in pixels |
getScaledTouchSlop
int getScaledTouchSlop ()
| Returns | |
|---|---|
int |
Distance in pixels a touch can wander before we think the user is scrolling |
getScaledVerticalScrollFactor
float getScaledVerticalScrollFactor ()
| Returns | |
|---|---|
float |
Amount to scroll in response to a vertical ACTION_SCROLL event.
Multiply this by the event's axis value to obtain the number of pixels to be scrolled.
|
getScaledWindowTouchSlop
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. |
getScrollBarFadeDuration
int getScrollBarFadeDuration ()
| Returns | |
|---|---|
int |
Duration of the fade when scrollbars fade away in milliseconds |
getScrollBarSize
int getScrollBarSize ()
This method was deprecated
in API level 3.
Use getScaledScrollBarSize() instead.
| Returns | |
|---|---|
int |
The width of the horizontal scrollbar and the height of the vertical scrollbar in dips |
getScrollDefaultDelay
int getScrollDefaultDelay ()
| Returns | |
|---|---|
int |
Default delay before the scrollbars fade in milliseconds |
getScrollFriction
float getScrollFriction ()
The amount of friction applied to scrolls and flings.
| Returns | |
|---|---|
float |
A scalar dimensionless value representing the coefficient of friction. |
getTapTimeout
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. |
getTouchSlop
int getTouchSlop ()
This method was deprecated
in API level 3.
Use getScaledTouchSlop() instead.
| Returns | |
|---|---|
int |
Distance in dips a touch can wander before we think the user is scrolling |
getWindowTouchSlop
int getWindowTouchSlop ()
This method was deprecated
in API level 3.
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. |
getZoomControlsTimeout
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. |
hasPermanentMenuKey
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. |
Annotations
Interfaces
- ActionMode.Callback
- ActionProvider.VisibilityListener
- Choreographer.FrameCallback
- CollapsibleActionView
- ContextMenu
- ContextMenu.ContextMenuInfo
- GestureDetector.OnContextClickListener
- GestureDetector.OnDoubleTapListener
- GestureDetector.OnGestureListener
- InputQueue.Callback
- KeyEvent.Callback
- LayoutInflater.Factory
- LayoutInflater.Factory2
- LayoutInflater.Filter
- Menu
- MenuItem
- MenuItem.OnActionExpandListener
- MenuItem.OnMenuItemClickListener
- PixelCopy.OnPixelCopyFinishedListener
- ScaleGestureDetector.OnScaleGestureListener
- SubMenu
- SurfaceHolder
- SurfaceHolder.Callback
- SurfaceHolder.Callback2
- TextureView.SurfaceTextureListener
- View.OnApplyWindowInsetsListener
- View.OnAttachStateChangeListener
- View.OnCapturedPointerListener
- View.OnClickListener
- View.OnContextClickListener
- View.OnCreateContextMenuListener
- View.OnDragListener
- View.OnFocusChangeListener
- View.OnGenericMotionListener
- View.OnHoverListener
- View.OnKeyListener
- View.OnLayoutChangeListener
- View.OnLongClickListener
- View.OnScrollChangeListener
- View.OnSystemUiVisibilityChangeListener
- View.OnTouchListener
- ViewGroup.OnHierarchyChangeListener
- ViewManager
- ViewParent
- ViewStub.OnInflateListener
- ViewTreeObserver.OnDrawListener
- ViewTreeObserver.OnGlobalFocusChangeListener
- ViewTreeObserver.OnGlobalLayoutListener
- ViewTreeObserver.OnPreDrawListener
- ViewTreeObserver.OnScrollChangedListener
- ViewTreeObserver.OnTouchModeChangeListener
- ViewTreeObserver.OnWindowAttachListener
- ViewTreeObserver.OnWindowFocusChangeListener
- Window.Callback
- Window.OnFrameMetricsAvailableListener
- Window.OnRestrictedCaptionAreaChangedListener
- WindowManager
Classes
- AbsSavedState
- ActionMode
- ActionMode.Callback2
- ActionProvider
- Choreographer
- ContextThemeWrapper
- Display
- Display.HdrCapabilities
- Display.Mode
- DragAndDropPermissions
- DragEvent
- FocusFinder
- FrameMetrics
- FrameStats
- GestureDetector
- GestureDetector.SimpleOnGestureListener
- Gravity
- HapticFeedbackConstants
- InputDevice
- InputDevice.MotionRange
- InputEvent
- InputQueue
- KeyboardShortcutGroup
- KeyboardShortcutInfo
- KeyCharacterMap
- KeyCharacterMap.KeyData
- KeyEvent
- KeyEvent.DispatcherState
- LayoutInflater
- MenuInflater
- MotionEvent
- MotionEvent.PointerCoords
- MotionEvent.PointerProperties
- OrientationEventListener
- OrientationListener
- PixelCopy
- PointerIcon
- ScaleGestureDetector
- ScaleGestureDetector.SimpleOnScaleGestureListener
- SearchEvent
- SoundEffectConstants
- Surface
- SurfaceView
- TextureView
- TouchDelegate
- VelocityTracker
- View
- View.AccessibilityDelegate
- View.BaseSavedState
- View.DragShadowBuilder
- View.MeasureSpec
- ViewAnimationUtils
- ViewConfiguration
- ViewDebug
- ViewGroup
- ViewGroup.LayoutParams
- ViewGroup.MarginLayoutParams
- ViewGroupOverlay
- ViewOutlineProvider
- ViewOverlay
- ViewPropertyAnimator
- ViewStructure
- ViewStructure.HtmlInfo
- ViewStructure.HtmlInfo.Builder
- ViewStub
- ViewTreeObserver
- Window
- WindowAnimationFrameStats
- WindowContentFrameStats
- WindowId
- WindowId.FocusObserver
- WindowInsets
- WindowManager.LayoutParams
Enums
Exceptions


