Most visited

Recently visited

ConfigurationHelper

public final class ConfigurationHelper
extends Object

java.lang.Object
   ↳ android.support.v4.content.res.ConfigurationHelper


Helper class which allows access to properties of Configuration in a backward compatible fashion.

Summary

Public methods

static int getDensityDpi(Resources resources)

Returns the target screen density being rendered to.

static int getScreenHeightDp(Resources resources)

Returns the current height of the available screen space, in dp units.

static int getScreenWidthDp(Resources resources)

Returns the current width of the available screen space, in dp units.

static int getSmallestScreenWidthDp(Resources resources)

Returns The smallest screen size an application will see in normal operation, in dp units.

Inherited methods

From class java.lang.Object

Public methods

getDensityDpi

int getDensityDpi (Resources resources)

Returns the target screen density being rendered to.

Uses Configuration.densityDpi when available, otherwise an approximation is computed and returned.

Parameters
resources Resources
Returns
int

getScreenHeightDp

int getScreenHeightDp (Resources resources)

Returns the current height of the available screen space, in dp units.

Uses Configuration.screenHeightDp when available, otherwise an approximation is computed and returned.

Parameters
resources Resources
Returns
int

getScreenWidthDp

int getScreenWidthDp (Resources resources)

Returns the current width of the available screen space, in dp units.

Uses Configuration.screenWidthDp when available, otherwise an approximation is computed and returned.

Parameters
resources Resources
Returns
int

getSmallestScreenWidthDp

int getSmallestScreenWidthDp (Resources resources)

Returns The smallest screen size an application will see in normal operation, in dp units.

Uses Configuration.smallestScreenWidthDp when available, otherwise an approximation is computed and returned.

Parameters
resources Resources
Returns
int

Hooray!