belongs to Maven artifact androidx.core:core:1.0.0-alpha1

ViewConfigurationCompat

public final class ViewConfigurationCompat
extends Object

java.lang.Object
   ↳ androidx.core.view.ViewConfigurationCompat


Helper for accessing features in ViewConfiguration.

Summary

Public methods

static float getScaledHorizontalScrollFactor(ViewConfiguration config, Context context)
static int getScaledHoverSlop(ViewConfiguration config)
static int getScaledPagingTouchSlop(ViewConfiguration config)

This method is deprecated. Call ViewConfiguration.getScaledPagingTouchSlop() directly. This method will be removed in a future release.

static float getScaledVerticalScrollFactor(ViewConfiguration config, Context context)
static boolean hasPermanentMenuKey(ViewConfiguration config)

This method is deprecated. Use ViewConfiguration.hasPermanentMenuKey() directly.

static boolean shouldShowMenuShortcutsWhenKeyboardPresent(ViewConfiguration config, Context context)

Check if shortcuts should be displayed in menus.

Inherited methods

Public methods

getScaledHorizontalScrollFactor

float getScaledHorizontalScrollFactor (ViewConfiguration config, 
                Context context)

Parameters
config ViewConfiguration: Used to get the scaling factor directly from the ViewConfiguration.

context Context: Used to locate a resource value.

Returns
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

int getScaledHoverSlop (ViewConfiguration config)

Parameters
config ViewConfiguration: Used to get the hover slop directly from the ViewConfiguration.

Returns
int The hover slop value.

getScaledPagingTouchSlop

int getScaledPagingTouchSlop (ViewConfiguration config)

This method is deprecated.
Call ViewConfiguration.getScaledPagingTouchSlop() directly. This method will be removed in a future release.

Call ViewConfiguration.getScaledPagingTouchSlop().

Parameters
config ViewConfiguration

Returns
int

getScaledVerticalScrollFactor

float getScaledVerticalScrollFactor (ViewConfiguration config, 
                Context context)

Parameters
config ViewConfiguration: Used to get the scaling factor directly from the ViewConfiguration.

context Context: Used to locate a resource value.

Returns
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

boolean hasPermanentMenuKey (ViewConfiguration config)

This method is deprecated.
Use ViewConfiguration.hasPermanentMenuKey() directly.

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

Parameters
config ViewConfiguration

Returns
boolean

shouldShowMenuShortcutsWhenKeyboardPresent

boolean shouldShowMenuShortcutsWhenKeyboardPresent (ViewConfiguration config, 
                Context context)

Check if shortcuts should be displayed in menus.

Parameters
config ViewConfiguration

context Context

Returns
boolean True if shortcuts should be displayed in menus.