public class ScreenSizeQualifier extends ResourceQualifier
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME |
Constructor and Description |
---|
ScreenSizeQualifier() |
ScreenSizeQualifier(com.android.resources.ScreenSize value) |
Modifier and Type | Method and Description |
---|---|
boolean |
checkAndSet(java.lang.String value,
FolderConfiguration config)
Check if the value is valid for this qualifier, and if so sets the value into a Folder
Configuration.
|
boolean |
equals(java.lang.Object qualifier)
Returns
true if both objects are equal. |
java.lang.String |
getFolderSegment()
Returns the string used to represent this qualifier in the folder name.
|
java.lang.String |
getLongDisplayValue()
Returns a string formatted for display purpose.
|
java.lang.String |
getName()
Returns the human readable name of the qualifier.
|
ScreenSizeQualifier |
getNullQualifier()
Returns the qualifier that can be used in
ResourceQualifier.isBetterMatchThan(ResourceQualifier,
ResourceQualifier) when no qualifier is present in the config. |
java.lang.String |
getShortDisplayValue()
Returns a string formatted for display purpose.
|
java.lang.String |
getShortName()
Returns a shorter human readable name for the qualifier.
|
com.android.resources.ScreenSize |
getValue() |
boolean |
hasFakeValue()
Returns whether the qualifier has a fake value.
|
int |
hashCode()
Returns a hash code value for the object.
|
boolean |
isBetterMatchThan(ResourceQualifier compareTo,
ResourceQualifier reference)
Returns true if the receiver (this) is a better match for the given
reference than
the given compareTo comparable. |
boolean |
isMatchFor(ResourceQualifier qualifier)
Returns whether the given qualifier is a match for the receiver.
|
boolean |
isValid()
Returns whether the qualifier has a valid filter value.
|
int |
since()
Returns the API level when this qualifier was added to Android.
|
compareTo, deprecated, isValid, toString
public static final java.lang.String NAME
public ScreenSizeQualifier()
public ScreenSizeQualifier(com.android.resources.ScreenSize value)
public com.android.resources.ScreenSize getValue()
public java.lang.String getName()
ResourceQualifier
getName
in class ResourceQualifier
public java.lang.String getShortName()
ResourceQualifier
getShortName
in class ResourceQualifier
ResourceQualifier.getName()
public int since()
ResourceQualifier
since
in class ResourceQualifier
public boolean checkAndSet(java.lang.String value, FolderConfiguration config)
ResourceQualifier
checkAndSet
in class ResourceQualifier
value
- The value to check and set. Must not be null.config
- The folder configuration to receive the value. Must not be null.public ScreenSizeQualifier getNullQualifier()
ResourceQualifier
ResourceQualifier.isBetterMatchThan(ResourceQualifier,
ResourceQualifier)
when no qualifier is present in the config.
null has a special meaning when trying to match the best config (it's the worst qualifier,
unless not other alternative matches). If a qualifier type has a different definition of best
in regards to the null qualifier, this method should be subclassed and a special value should
be returned from here, which can then be used to call (ResourceQualifier, ResourceQualifier)
which can implement the custom logic.getNullQualifier
in class ResourceQualifier
public boolean isMatchFor(ResourceQualifier qualifier)
ResourceQualifier
ResourceQualifier.equals(Object)
.
Children class that re-implements this must implement (ResourceQualifier, ResourceQualifier)
too.isMatchFor
in class ResourceQualifier
qualifier
- the reference qualifierpublic boolean isValid()
ResourceQualifier
public boolean isBetterMatchThan(@Nullable ResourceQualifier compareTo, @NonNull ResourceQualifier reference)
ResourceQualifier
reference
than
the given compareTo
comparable.isBetterMatchThan
in class ResourceQualifier
compareTo
- The ResourceQualifier
to compare to.reference
- The reference qualifier value for which the match is (from phone's
folderConfig).public boolean hasFakeValue()
ResourceQualifier
hasFakeValue
in class ResourceQualifier
public boolean equals(java.lang.Object qualifier)
ResourceQualifier
true
if both objects are equal.
This is declared as abstract to force children classes to implement it.equals
in class ResourceQualifier
public int hashCode()
ResourceQualifier
hashCode
in class ResourceQualifier
public final java.lang.String getFolderSegment()
getFolderSegment
in class ResourceQualifier
public java.lang.String getShortDisplayValue()
ResourceQualifier
getShortDisplayValue
in class ResourceQualifier
public java.lang.String getLongDisplayValue()
ResourceQualifier
getLongDisplayValue
in class ResourceQualifier