Most visited

Recently visited

ConfigurationHelper

public final class ConfigurationHelper
extends Object

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


助手类允许以向后兼容的方式访问 Configuration属性。

摘要(Summary)

公共方法(Public methods)

static int getDensityDpi(Resources resources)

返回正在渲染的目标屏幕密度。

static int getScreenHeightDp(Resources resources)

以dp为单位返回可用屏幕空间的当前高度。

static int getScreenWidthDp(Resources resources)

以dp为单位返回可用屏幕空间的当前宽度。

static int getSmallestScreenWidthDp(Resources resources)

返回应用程序在正常操作中看到的最小屏幕尺寸,单位为dp。

继承方法(Inherited methods)

From class java.lang.Object

公共方法(Public methods)

getDensityDpi

int getDensityDpi (Resources resources)

返回正在渲染的目标屏幕密度。

在可用时使用 Configuration.densityDpi ,否则计算并返回近似值。

参数(Parameters)
resources Resources
返回(Returns)
int

getScreenHeightDp

int getScreenHeightDp (Resources resources)

以dp为单位返回可用屏幕空间的当前高度。

在可用时使用 Configuration.screenHeightDp ,否则计算并返回近似值。

参数(Parameters)
resources Resources
返回(Returns)
int

getScreenWidthDp

int getScreenWidthDp (Resources resources)

以dp为单位返回可用屏幕空间的当前宽度。

在可用时使用 Configuration.screenWidthDp ,否则计算并返回近似值。

参数(Parameters)
resources Resources
返回(Returns)
int

getSmallestScreenWidthDp

int getSmallestScreenWidthDp (Resources resources)

返回应用程序在正常操作中看到的最小屏幕尺寸,单位为dp。

在可用时使用 Configuration.smallestScreenWidthDp ,否则计算并返回近似值。

参数(Parameters)
resources Resources
返回(Returns)
int

Hooray!