Stay organized with collections Save and categorize content based on your preferences.

ViewConfigurationCompat

public final class ViewConfigurationCompat


Helper for accessing features in ViewConfiguration.

Summary

Public methods

static float
static int
static int

This method is deprecated.

Call getScaledPagingTouchSlop directly.

static float
static boolean

This method is deprecated.

Use hasPermanentMenuKey directly.

static boolean

Check if shortcuts should be displayed in menus.

Public methods

getScaledHorizontalScrollFactor

public static float getScaledHorizontalScrollFactor(
    @NonNull ViewConfiguration config,
    @NonNull Context context
)
Parameters
@NonNull ViewConfiguration config

Used to get the scaling factor directly from the ViewConfiguration.

@NonNull Context context

Used to locate a resource value.

Returns
float

Amount to scroll in response to a horizontal ACTION_SCROLL event. Multiply this by the event's axis value to obtain the number of pixels to be scrolled.

getScaledHoverSlop

public static int getScaledHoverSlop(@NonNull ViewConfiguration config)
Parameters
@NonNull ViewConfiguration config

Used to get the hover slop directly from the ViewConfiguration.

Returns
int

The hover slop value.

getScaledPagingTouchSlop

public static int getScaledPagingTouchSlop(ViewConfiguration config)

Call getScaledPagingTouchSlop.

getScaledVerticalScrollFactor

public static float getScaledVerticalScrollFactor(
    @NonNull ViewConfiguration config,
    @NonNull Context context
)
Parameters
@NonNull ViewConfiguration config

Used to get the scaling factor directly from the ViewConfiguration.

@NonNull Context context

Used to locate a resource value.

Returns
float

Amount to scroll in response to a vertical ACTION_SCROLL event. Multiply this by the event's axis value to obtain the number of pixels to be scrolled.

hasPermanentMenuKey

public static boolean hasPermanentMenuKey(ViewConfiguration config)

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

shouldShowMenuShortcutsWhenKeyboardPresent

public static boolean shouldShowMenuShortcutsWhenKeyboardPresent(
    @NonNull ViewConfiguration config,
    @NonNull Context context
)

Check if shortcuts should be displayed in menus.

Returns
boolean

True if shortcuts should be displayed in menus.