public final class ConfigurationHelper extends Object
Configuration
in
a backward compatible fashion.Modifier and Type | Method and Description |
---|---|
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.
|
public static int getScreenHeightDp(@NonNull Resources resources)
Uses Configuration.screenHeightDp
when available, otherwise an approximation
is computed and returned.
public static int getScreenWidthDp(@NonNull Resources resources)
Uses Configuration.screenWidthDp
when available, otherwise an approximation
is computed and returned.
public static int getSmallestScreenWidthDp(@NonNull Resources resources)
Uses Configuration.smallestScreenWidthDp
when available, otherwise an
approximation is computed and returned.