public enum Density extends java.lang.Enum<Density> implements ResourceEnum
This enum is used in the manifest in the uses-configuration node and in the resource folder names as well as in other places that need to know the density values.
| Enum Constant and Description |
|---|
ANYDPI |
DPI_140 |
DPI_180 |
DPI_200 |
DPI_220 |
DPI_260 |
DPI_280 |
DPI_300 |
DPI_340 |
DPI_360 |
DPI_400 |
DPI_420 |
DPI_440 |
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 dpiValue)
Returns the enum matching the given DPI 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_440
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 DPI_220
public static final Density TV
public static final Density DPI_200
public static final Density DPI_180
public static final Density MEDIUM
public static final Density DPI_140
public static final Density LOW
public static final Density ANYDPI
public static final Density NODPI
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 null@Nullable public static Density getEnum(@Nullable java.lang.String value)
value - The qualifier value.@Nullable public static Density getEnum(int dpiValue)
dpiValue - The density value.@NonNull public java.lang.String getResourceValue()
ResourceEnumgetResourceValue in interface ResourceEnumpublic int getDpiValue()
public int since()
@NonNull public java.lang.String getShortDisplayValue()
ResourceEnumFor 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 ResourceEnumResourceEnum.getLongDisplayValue()@NonNull public java.lang.String getLongDisplayValue()
ResourceEnumFor instance "Exposed keyboard", and "Export navigation", as "exposed" would not be enough to know what qualifier the value is about.
getLongDisplayValue in interface ResourceEnumResourceEnum.getShortDisplayValue()public static int getIndex(@Nullable
Density value)
@Nullable public static Density getByIndex(int index)
@NonNull public static java.util.Set<Density> getRecommendedValuesForDevice()
isRecommended(),
isValidValueForDevice()public boolean isRecommended()
public boolean isFakeValue()
ResourceEnumisFakeValue in interface ResourceEnumpublic boolean isValidValueForDevice()
ResourceEnumisValidValueForDevice in interface ResourceEnum