Package icyllis.modernui.view
Class ViewConfiguration
java.lang.Object
icyllis.modernui.view.ViewConfiguration
Contains methods to standard constants used in the UI for timeouts, sizes, and distances.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final float
Amount to scroll in response to a horizontalMotionEvent.ACTION_SCROLL
event, in dips per axis value.static final int
Maximum velocity to initiate a fling, as measured in dips per secondstatic final int
Defines the minimum size of the touch target for a scrollbar in dipsstatic final int
Minimum velocity to initiate a fling, as measured in dips per secondstatic final int
Max distance in dips to overfling for edge effectsstatic final int
Max distance in dips to overscroll for edge effectsstatic final int
Defines the width of the horizontal scrollbar and the height of the vertical scrollbar in dipsstatic final int
Distance a touch can wander before we think the user is scrolling in dips.static final float
Amount to scroll in response to a verticalMotionEvent.ACTION_SCROLL
event, in dips per axis value. -
Method Summary
Modifier and TypeMethodDescriptionstatic ViewConfiguration
Returns a configuration for the specified visualContext
.static int
static int
static int
static int
static int
int
int
float
int
int
int
int
int
int
int
int
float
static int
static int
static int
-
Field Details
-
SCROLL_BAR_SIZE
public static final int SCROLL_BAR_SIZEDefines the width of the horizontal scrollbar and the height of the vertical scrollbar in dips- See Also:
-
TOUCH_SLOP
public static final int TOUCH_SLOPDistance a touch can wander before we think the user is scrolling in dips. Note that this value defined here is only used as a fallback by legacy/misbehaving applications that do not provide a Context for determining density/configuration-dependent values.- See Also:
-
MIN_SCROLLBAR_TOUCH_TARGET
public static final int MIN_SCROLLBAR_TOUCH_TARGETDefines the minimum size of the touch target for a scrollbar in dips- See Also:
-
MINIMUM_FLING_VELOCITY
public static final int MINIMUM_FLING_VELOCITYMinimum velocity to initiate a fling, as measured in dips per second- See Also:
-
MAXIMUM_FLING_VELOCITY
public static final int MAXIMUM_FLING_VELOCITYMaximum velocity to initiate a fling, as measured in dips per second- See Also:
-
OVERSCROLL_DISTANCE
public static final int OVERSCROLL_DISTANCEMax distance in dips to overscroll for edge effects- See Also:
-
OVERFLING_DISTANCE
public static final int OVERFLING_DISTANCEMax distance in dips to overfling for edge effects- See Also:
-
HORIZONTAL_SCROLL_FACTOR
public static final float HORIZONTAL_SCROLL_FACTORAmount to scroll in response to a horizontalMotionEvent.ACTION_SCROLL
event, in dips per axis value.- See Also:
-
VERTICAL_SCROLL_FACTOR
public static final float VERTICAL_SCROLL_FACTORAmount to scroll in response to a verticalMotionEvent.ACTION_SCROLL
event, in dips per axis value.- See Also:
-
-
Method Details
-
get
Returns a configuration for the specified visualContext
. The configuration depends on various parameters of theContext
, like the dimension of the display or the density of the display.- Returns:
- the view configuration
-
getScrollBarFadeDuration
public static int getScrollBarFadeDuration()- Returns:
- Duration of the fade when scrollbars fade away in milliseconds
-
getScrollDefaultDelay
public static int getScrollDefaultDelay()- Returns:
- Default delay before the scrollbars fade in milliseconds
-
getPressedStateDuration
public static int getPressedStateDuration()- Returns:
- the duration in milliseconds of the pressed state in child components.
-
getLongPressTimeout
public static int getLongPressTimeout()- Returns:
- the duration in milliseconds before a press turns into a long press
-
getTapTimeout
public static int getTapTimeout()- Returns:
- 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.
-
getScaledScrollbarSize
public int getScaledScrollbarSize()- Returns:
- The width of the horizontal scrollbar and the height of the vertical scrollbar in pixels
-
getScaledEdgeSlop
public int getScaledEdgeSlop()- Returns:
- Inset in pixels to look for touchable content when the user touches the edge of the screen
-
getScaledFadingEdgeLength
public int getScaledFadingEdgeLength()- Returns:
- the length of the fading edges in pixels
-
getScaledTouchSlop
public int getScaledTouchSlop()- Returns:
- Distance in pixels a touch can wander before we think the user is scrolling
-
getScaledHoverSlop
public int getScaledHoverSlop()- Returns:
- Distance in pixels a hover can wander while it is still considered "stationary".
-
getScaledMinScrollbarTouchTarget
public int getScaledMinScrollbarTouchTarget()- Returns:
- the minimum size of the scrollbar thumb's touch target in pixels
-
getScaledMinimumFlingVelocity
public int getScaledMinimumFlingVelocity()- Returns:
- Minimum velocity to initiate a fling, as measured in pixels per second.
-
getScaledMaximumFlingVelocity
public int getScaledMaximumFlingVelocity()- Returns:
- Maximum velocity to initiate a fling, as measured in pixels per second.
-
getScaledOverscrollDistance
public int getScaledOverscrollDistance()- Returns:
- The maximum distance a View should overscroll by when showing edge effects (in pixels).
-
getScaledOverflingDistance
public int getScaledOverflingDistance()- Returns:
- The maximum distance a View should overfling by when showing edge effects (in pixels).
-
getScaledVerticalScrollFactor
public float getScaledVerticalScrollFactor()- Returns:
- 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.
-
getScaledHorizontalScrollFactor
public float getScaledHorizontalScrollFactor()- Returns:
- 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.
-
getLongPressTooltipHideTimeout
@Internal public static int getLongPressTooltipHideTimeout()- Returns:
- the duration in milliseconds before an end of a long press causes a tooltip to be hidden
-
getHoverTooltipShowTimeout
@Internal public static int getHoverTooltipShowTimeout()- Returns:
- the duration in milliseconds before a hover event causes a tooltip to be shown
-
getHoverTooltipHideTimeout
@Internal public static int getHoverTooltipHideTimeout()- Returns:
- the duration in milliseconds before mouse inactivity causes a tooltip to be hidden.
-