public class Configuration extends Object
You can use ResourceManager.getConfiguration()
to obtain the configuration and
ResourceManager.updateConfiguration(Configuration, DeviceCapability)
to update the configuration.
ResourceManager| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
AUTO_MODE |
Indicates that the color mode is automatically set or undefined.
|
int |
colorMode |
Indicates the current color mode of your application.
|
static int |
DARK_MODE |
Indicates the dark color mode.
|
int |
direction |
Indicates the target direction.
|
static int |
DIRECTION_HORIZONTAL |
Indicates the horizontal direction.
|
static int |
DIRECTION_UNDEFINED |
Indicates that the direction is undefined.
|
static int |
DIRECTION_VERTICAL |
Indicates the vertical direction.
|
float |
fontRatio |
Indicates the user-preferred font size relative to the base screen density.
|
boolean |
isLayoutRTL |
Specifies whether the screen layout is from right to left.
|
static int |
LIGHT_MODE |
Indicates the light color mode.
|
int |
mcc |
Indicates the mobile country code (MCC).
|
static int |
MCC_UNDEFINED |
Indicates the default MCC.
|
int |
mnc |
Indicates the mobile network code (MNC).
|
static int |
MNC_UNDEFINED |
Indicates the default MNC.
|
static float |
SCALE_UNDEFINED |
Indicates that the scale is not specified.
|
| 构造器 | 说明 |
|---|---|
Configuration() |
Default constructor used to create a
Configuration instance. |
Configuration(Configuration config) |
A constructor used to create a
Configuration instance using an existing Configuration object. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
boolean |
equals(Object object) |
Check whether the provided object is equal to the current Configuration or not.
|
Locale |
getFirstLocale() |
Obtains the first locale in the array of locales from
LocaleProfile. |
LocaleProfile |
getLocaleProfile() |
Obtains the
LocaleProfile variable. |
int |
getSystemColorMode() |
Obtains the current system color mode.
|
int |
hashCode() |
Obtains hashcode of current Configuration.
|
void |
setLocaleProfile(LocaleProfile localeProfile) |
Sets the
LocaleProfile variable. |
String |
toString() |
Returns the attribute value of the current configuration.
|
public static final int AUTO_MODE
public static final int DARK_MODE
public static final int DIRECTION_HORIZONTAL
public static final int DIRECTION_UNDEFINED
public static final int DIRECTION_VERTICAL
public static final int LIGHT_MODE
public static final int MCC_UNDEFINED
0.public static final int MNC_UNDEFINED
0.public static final float SCALE_UNDEFINED
public int colorMode
AUTO_MODE, LIGHT_MODE,
or DARK_MODE.public int direction
public float fontRatio
public boolean isLayoutRTL
true indicates the
right-to-left layout, and false indicates the left-to-right layout.public int mcc
public int mnc
public Configuration()
Configuration instance.public Configuration(Configuration config)
Configuration instance using an existing Configuration object.config - Indicates the existing Configuration object.public LocaleProfile getLocaleProfile()
LocaleProfile variable.LocaleProfile variable.public void setLocaleProfile(LocaleProfile localeProfile)
LocaleProfile variable.localeProfile - Indicates the LocaleProfile variable to set.public Locale getFirstLocale()
LocaleProfile.public boolean equals(Object object)
equals 在类中 Objectobject - the provided objectObject.hashCode(),
HashMappublic int hashCode()
hashCode 在类中 ObjectObject.equals(java.lang.Object),
System.identityHashCode(java.lang.Object)public int getSystemColorMode()
LIGHT_MODE or DARK_MODE.