public enum Density extends java.lang.Enum<Density> implements ResourceEnum
This is used in the manifest in the uses-configuration node and in the resource folder names as well as other places needing to know the density values.
Enum Constant and Description |
---|
ANYDPI |
DPI_260 |
DPI_280 |
DPI_300 |
DPI_340 |
DPI_360 |
DPI_400 |
DPI_420 |
DPI_560 |
HIGH |
LOW |
MEDIUM |
NODPI |
TV |
XHIGH |
XXHIGH |
XXXHIGH |
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_DENSITY |
Modifier and Type | Method and Description |
---|---|
static Density |
getByIndex(int index) |
int |
getDpiValue() |
static Density |
getEnum(int value)
Returns the enum matching the given density value
|
static Density |
getEnum(java.lang.String value)
Returns the enum matching the provided qualifier value.
|
static int |
getIndex(Density value) |
java.lang.String |
getLongDisplayValue()
Returns a long string for display value.
|
static java.util.Set<Density> |
getRecommendedValuesForDevice()
Returns all densities which are recommended and valid for a device.
|
java.lang.String |
getResourceValue()
Returns the resource string.
|
java.lang.String |
getShortDisplayValue()
Returns a short string for display value.
|
boolean |
isFakeValue()
Whether the value is neither used for device nor resources.
|
boolean |
isRecommended()
Returns true if this density is relevant for app developers (e.g.
|
boolean |
isValidValueForDevice()
Whether the value actually used on device.
|
int |
since() |
static Density |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Density[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Density XXXHIGH
public static final Density DPI_560
public static final Density XXHIGH
public static final Density DPI_420
public static final Density DPI_400
public static final Density DPI_360
public static final Density XHIGH
public static final Density DPI_260
public static final Density DPI_280
public static final Density DPI_300
public static final Density DPI_340
public static final Density HIGH
public static final Density TV
public static final Density MEDIUM
public static final Density LOW
public static final Density ANYDPI
public static final Density NODPI
public static final int DEFAULT_DENSITY
public static Density[] values()
for (Density c : Density.values()) System.out.println(c);
public static Density valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static Density getEnum(java.lang.String value)
value
- The qualifier value.public static Density getEnum(int value)
value
- The density value.public java.lang.String getResourceValue()
ResourceEnum
getResourceValue
in interface ResourceEnum
public int getDpiValue()
public int since()
public java.lang.String getShortDisplayValue()
ResourceEnum
For instance "exposed", which can be the value for the keyboard state or the navigation state, would be valid since something else in the UI is expected to show if this is about the keyboard or the navigation state.
getShortDisplayValue
in interface ResourceEnum
ResourceEnum.getLongDisplayValue()
public java.lang.String getLongDisplayValue()
ResourceEnum
For instance "Exposed keyboard", and "Export navigation", as "exposed" would not be enough to know what qualifier the value is about.
getLongDisplayValue
in interface ResourceEnum
ResourceEnum.getShortDisplayValue()
public static int getIndex(Density value)
public static Density getByIndex(int index)
public static java.util.Set<Density> getRecommendedValuesForDevice()
isRecommended()
,
isValidValueForDevice()
public boolean isRecommended()
public boolean isFakeValue()
ResourceEnum
isFakeValue
in interface ResourceEnum
public boolean isValidValueForDevice()
ResourceEnum
isValidValueForDevice
in interface ResourceEnum