Register now for Android Dev Summit 2019!

ViewConfigurationCompat

class ViewConfigurationCompat
kotlin.Any
   ↳ androidx.core.view.ViewConfigurationCompat

Helper for accessing features in ViewConfiguration.

Summary

Public methods

static Float
getScaledHorizontalScrollFactor(@NonNull config: ViewConfiguration, @NonNull context: Context)

static Int

static Int

Call ViewConfiguration#getScaledPagingTouchSlop().

static Float
getScaledVerticalScrollFactor(@NonNull config: ViewConfiguration, @NonNull context: Context)

static Boolean

Report if the device has a permanent menu key available to the user, in a backwards compatible way.

static Boolean

Check if shortcuts should be displayed in menus.

Public methods

getScaledHorizontalScrollFactor

static fun getScaledHorizontalScrollFactor(@NonNull config: ViewConfiguration, @NonNull context: Context): Float
Parameters
config ViewConfiguration: Used to get the scaling factor directly from the ViewConfiguration.
context ViewConfiguration: Used to locate a resource value.
Return
Float: Amount to scroll in response to a horizontal MotionEventCompat#ACTION_SCROLL event. Multiply this by the event's axis value to obtain the number of pixels to be scrolled.

getScaledHoverSlop

static fun getScaledHoverSlop(config: ViewConfiguration!): Int
Parameters
config ViewConfiguration!: Used to get the hover slop directly from the ViewConfiguration.
Return
Int: The hover slop value.

getScaledPagingTouchSlop

static fun getScaledPagingTouchSlop(config: ViewConfiguration!): Int

Deprecated: Call ViewConfiguration#getScaledPagingTouchSlop() directly. This method will be removed in a future release.

Call ViewConfiguration#getScaledPagingTouchSlop().

getScaledVerticalScrollFactor

static fun getScaledVerticalScrollFactor(@NonNull config: ViewConfiguration, @NonNull context: Context): Float
Parameters
config ViewConfiguration: Used to get the scaling factor directly from the ViewConfiguration.
context ViewConfiguration: Used to locate a resource value.
Return
Float: Amount to scroll in response to a vertical MotionEventCompat#ACTION_SCROLL event. Multiply this by the event's axis value to obtain the number of pixels to be scrolled.

hasPermanentMenuKey

static fun hasPermanentMenuKey(config: ViewConfiguration!): Boolean

Deprecated: Use ViewConfiguration#hasPermanentMenuKey() directly.

Report if the device has a permanent menu key available to the user, in a backwards compatible way.

shouldShowMenuShortcutsWhenKeyboardPresent

static fun shouldShowMenuShortcutsWhenKeyboardPresent(config: ViewConfiguration!, @NonNull context: Context): Boolean

Check if shortcuts should be displayed in menus.

Return
Boolean: True if shortcuts should be displayed in menus.