Most visited

Recently visited

Added in API level 1

ViewConfiguration

public class ViewConfiguration
extends Object

java.lang.Object
   ↳ android.view.ViewConfiguration


包含在UI中用于超时,大小和距离的标准常量的方法。

Summary

Public constructors

ViewConfiguration()

此构造函数在API级别3中已弃用。请改为使用get(android.content.Context)

Public methods

static ViewConfiguration get(Context context)

返回指定上下文的配置。

static long getDefaultActionModeHideDuration()
static int getDoubleTapTimeout()
static int getEdgeSlop()

此方法在API级别3中已弃用。请改为使用getScaledEdgeSlop()

static int getFadingEdgeLength()

此方法在API级别3中已弃用。请改为使用getScaledFadingEdgeLength()

static long getGlobalActionKeyTimeout()

此方法在API级别20中已弃用。此超时不应由应用程序使用

static int getJumpTapTimeout()
static int getKeyRepeatDelay()
static int getKeyRepeatTimeout()
static int getLongPressTimeout()
static int getMaximumDrawingCacheSize()

此方法在API级别3中已弃用。请改为使用getScaledMaximumDrawingCacheSize()

static int getMaximumFlingVelocity()

此方法在API级别4中已弃用。请改为使用getScaledMaximumFlingVelocity()

static int getMinimumFlingVelocity()

此方法在API级别3中已弃用。请改为使用getScaledMinimumFlingVelocity()

static int getPressedStateDuration()
int getScaledDoubleTapSlop()
int getScaledEdgeSlop()
int getScaledFadingEdgeLength()
int getScaledMaximumDrawingCacheSize()

最大绘图高速缓存大小以字节表示。

int getScaledMaximumFlingVelocity()
int getScaledMinimumFlingVelocity()
int getScaledOverflingDistance()
int getScaledOverscrollDistance()
int getScaledPagingTouchSlop()
int getScaledScrollBarSize()
int getScaledTouchSlop()
int getScaledWindowTouchSlop()
static int getScrollBarFadeDuration()
static int getScrollBarSize()

此方法在API级别3中已弃用。请改为使用getScaledScrollBarSize()

static int getScrollDefaultDelay()
static float getScrollFriction()

滚动和甩动的摩擦量。

static int getTapTimeout()
static int getTouchSlop()

此方法在API级别3中已弃用。请改为使用getScaledTouchSlop()

static int getWindowTouchSlop()

此方法在API级别3中已弃用。请改为使用getScaledWindowTouchSlop()

static long getZoomControlsTimeout()

屏幕上应显示缩放控件的时间量,以毫秒为单位。

boolean hasPermanentMenuKey()

报告设备是否有可用于用户的永久菜单密钥。

Inherited methods

From class java.lang.Object

Public constructors

ViewConfiguration

Added in API level 1
ViewConfiguration ()

此构造函数在API级别3中已弃用。
改为使用get(android.content.Context)

Public methods

get

Added in API level 3
ViewConfiguration get (Context context)

返回指定上下文的配置。 配置取决于上下文的各种参数,如显示器的尺寸或显示器的密度。

Parameters
context Context: The application context used to initialize the view configuration.
Returns
ViewConfiguration

getDefaultActionModeHideDuration

Added in API level 23
long getDefaultActionModeHideDuration ()

Returns
long the default duration in milliseconds for hide(long).

getDoubleTapTimeout

Added in API level 3
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

Added in API level 1
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

Added in API level 1
int getFadingEdgeLength ()

此方法在API级别3中已被弃用。
改为使用getScaledFadingEdgeLength()

Returns
int the length of the fading edges in dips

getGlobalActionKeyTimeout

Added in API level 1
long getGlobalActionKeyTimeout ()

此方法在API级别20中已被弃用。
这个超时不应该被应用程序使用

用户需要按下相关键以调出全局操作对话框的时间量。

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

getJumpTapTimeout

Added in API level 1
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

Added in API level 12
int getKeyRepeatDelay ()

Returns
int the time between successive key repeats in milliseconds.

getKeyRepeatTimeout

Added in API level 12
int getKeyRepeatTimeout ()

Returns
int the time before the first key repeat in milliseconds.

getLongPressTimeout

Added in API level 1
int getLongPressTimeout ()

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

getMaximumDrawingCacheSize

Added in API level 1
int getMaximumDrawingCacheSize ()

此方法在API级别3中已被弃用。
改为使用getScaledMaximumDrawingCacheSize()

最大绘图高速缓存大小以字节表示。

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

getMaximumFlingVelocity

Added in API level 4
int getMaximumFlingVelocity ()

此方法在API级别4中已弃用。
改为使用getScaledMaximumFlingVelocity()

Returns
int Maximum velocity to initiate a fling, as measured in dips per second.

getMinimumFlingVelocity

Added in API level 1
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

Added in API level 1
int getPressedStateDuration ()

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

getScaledDoubleTapSlop

Added in API level 3
int getScaledDoubleTapSlop ()

Returns
int Distance in pixels between the first touch and second touch to still be considered a double tap

getScaledEdgeSlop

Added in API level 3
int getScaledEdgeSlop ()

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

getScaledFadingEdgeLength

Added in API level 3
int getScaledFadingEdgeLength ()

Returns
int the length of the fading edges in pixels

getScaledMaximumDrawingCacheSize

Added in API level 3
int getScaledMaximumDrawingCacheSize ()

最大绘图高速缓存大小以字节表示。

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

getScaledMaximumFlingVelocity

Added in API level 4
int getScaledMaximumFlingVelocity ()

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

getScaledMinimumFlingVelocity

Added in API level 3
int getScaledMinimumFlingVelocity ()

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

getScaledOverflingDistance

Added in API level 9
int getScaledOverflingDistance ()

Returns
int The maximum distance a View should overfling by when showing edge effects (in pixels).

getScaledOverscrollDistance

Added in API level 9
int getScaledOverscrollDistance ()

Returns
int The maximum distance a View should overscroll by when showing edge effects (in pixels).

getScaledPagingTouchSlop

Added in API level 8
int getScaledPagingTouchSlop ()

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

getScaledScrollBarSize

Added in API level 3
int getScaledScrollBarSize ()

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

getScaledTouchSlop

Added in API level 3
int getScaledTouchSlop ()

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

getScaledWindowTouchSlop

Added in API level 3
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

Added in API level 5
int getScrollBarFadeDuration ()

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

getScrollBarSize

Added in API level 1
int getScrollBarSize ()

此方法在API级别3中已被弃用。
改为使用getScaledScrollBarSize()

Returns
int The width of the horizontal scrollbar and the height of the vertical scrollbar in dips

getScrollDefaultDelay

Added in API level 5
int getScrollDefaultDelay ()

Returns
int Default delay before the scrollbars fade in milliseconds

getScrollFriction

Added in API level 1
float getScrollFriction ()

滚动和甩动的摩擦量。

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

getTapTimeout

Added in API level 1
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

Added in API level 1
int getTouchSlop ()

此方法在API级别3中已被弃用。
改为使用getScaledTouchSlop()

Returns
int Distance in dips a touch can wander before we think the user is scrolling

getWindowTouchSlop

Added in API level 1
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

Added in API level 1
long getZoomControlsTimeout ()

屏幕上应显示缩放控件的时间量,以毫秒为单位。

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

hasPermanentMenuKey

Added in API level 14
boolean hasPermanentMenuKey ()

报告设备是否有可用于用户的永久菜单密钥。

从Android 3.0开始,设备可能没有可用的永久菜单键。 应用程序应该使用操作栏向用户呈现菜单选项。 但是,有些应用程序的操作栏不合适或不受欢迎。 该方法可用于检测菜单键是否存在。 否则,应用程序应该提供另一个屏幕上的可访问功能。

Returns
boolean true if a permanent menu key is present, false otherwise.

Hooray!