added in version 1.0.0
belongs to Maven artifact androidx.core:core:1.0.0-beta01

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 was deprecated in API level 1.0.0. 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 was deprecated in API level 1.0.0. Use ViewConfiguration.hasPermanentMenuKey() directly.

static boolean shouldShowMenuShortcutsWhenKeyboardPresent(ViewConfiguration config, Context context)

Check if shortcuts should be displayed in menus.

Inherited methods

Public methods

getScaledHorizontalScrollFactor

added in version 1.0.0
public static 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

added in version 1.0.0
public static int getScaledHoverSlop (ViewConfiguration config)

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

Returns
int The hover slop value.

getScaledPagingTouchSlop

added in version 1.0.0
public static int getScaledPagingTouchSlop (ViewConfiguration config)

This method was deprecated in API level 1.0.0.
Call ViewConfiguration.getScaledPagingTouchSlop() directly. This method will be removed in a future release.

Call ViewConfiguration.getScaledPagingTouchSlop().

Parameters
config ViewConfiguration

Returns
int

getScaledVerticalScrollFactor

added in version 1.0.0
public static 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

added in version 1.0.0
public static boolean hasPermanentMenuKey (ViewConfiguration config)

This method was deprecated in API level 1.0.0.
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

added in version 1.0.0
public static 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.