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.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ViewConfigurationReturns a configuration for the specified visualContext.static intstatic intstatic intstatic intstatic intintintfloatintintintintintintintintintfloatstatic intstatic intstatic floatThe amount of friction applied to scrolls and flings.static int
-
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 height of the horizontal scrollbar and the width 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
-
getScaledPagingTouchSlop
public int getScaledPagingTouchSlop()- Returns:
- Distance in pixels a touch can wander before we think the user is scrolling a full page
-
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_SCROLLevent. 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_SCROLLevent. Multiply this by the event's axis value to obtain the number of pixels to be scrolled.
-
getScrollFriction
public static float getScrollFriction()The amount of friction applied to scrolls and flings.- Returns:
- A scalar dimensionless value representing the coefficient of friction.
-
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.
-