ViewConfiguration
public class ViewConfiguration
extends Object
包含在UI中用于超时,大小和距离的标准常量的方法。
Summary
Public constructors
Public methods
get
ViewConfiguration get (Context context)
返回指定上下文的配置。 配置取决于上下文的各种参数,如显示器的尺寸或显示器的密度。
Parameters |
context |
Context : The application context used to initialize the view configuration. |
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 ()
此方法在API级别3中已被弃用。
改为使用getScaledEdgeSlop()
。
Returns |
int |
Inset in dips to look for touchable content when the user touches the edge of the screen |
getFadingEdgeLength
int getFadingEdgeLength ()
此方法在API级别3中已被弃用。
改为使用getScaledFadingEdgeLength()
。
Returns |
int |
the length of the fading edges in dips |
getGlobalActionKeyTimeout
long getGlobalActionKeyTimeout ()
此方法在API级别20中已被弃用。
这个超时不应该被应用程序使用
用户需要按下相关键以调出全局操作对话框的时间量。
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 ()
此方法在API级别3中已被弃用。
改为使用getScaledMaximumDrawingCacheSize()
。
最大绘图高速缓存大小以字节表示。
Returns |
int |
the maximum size of View's drawing cache expressed in bytes |
getMaximumFlingVelocity
int getMaximumFlingVelocity ()
此方法在API级别4中已弃用。
改为使用getScaledMaximumFlingVelocity()
。
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 |
getScaledMaximumDrawingCacheSize
int getScaledMaximumDrawingCacheSize ()
最大绘图高速缓存大小以字节表示。
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 |
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 ()
此方法在API级别3中已被弃用。
改为使用getScaledScrollBarSize()
。
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 ()
滚动和甩动的摩擦量。
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 ()
此方法在API级别3中已被弃用。
改为使用getScaledTouchSlop()
。
Returns |
int |
Distance in dips a touch can wander before we think the user is scrolling |
getWindowTouchSlop
int getWindowTouchSlop ()
此方法在API级别3中已被弃用。
改为使用getScaledWindowTouchSlop()
。
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 ()
屏幕上应显示缩放控件的时间量,以毫秒为单位。
Returns |
long |
the time the zoom controls should be visible expressed in milliseconds. |
hasPermanentMenuKey
boolean hasPermanentMenuKey ()
报告设备是否有可用于用户的永久菜单密钥。
从Android 3.0开始,设备可能没有可用的永久菜单键。 应用程序应该使用操作栏向用户呈现菜单选项。 但是,有些应用程序的操作栏不合适或不受欢迎。 该方法可用于检测菜单键是否存在。 否则,应用程序应该提供另一个屏幕上的可访问功能。
Returns |
boolean |
true if a permanent menu key is present, false otherwise. |