public interface StyleResourceValue extends ResourceValue
ResourceValue.| Modifier and Type | Method and Description |
|---|---|
java.util.Collection<StyleItemResourceValue> |
getDefinedItems()
Returns a list of all items defined in this Style.
|
StyleItemResourceValue |
getItem(ResourceNamespace namespace,
java.lang.String name)
Finds the item for the given qualified attr name in this style (if it's defined in this
style).
|
StyleItemResourceValue |
getItem(ResourceReference attr)
Finds the item for the given attr in this style (if it's defined in this style).
|
default ResourceReference |
getParentStyle()
Returns a reference to the parent style, if it can be determined based on the explicit parent
reference in XML, or by using the part of the name of this style before the last dot.
|
java.lang.String |
getParentStyleName()
Returns value of the
parent XML attribute of this style. |
static boolean |
isDefaultParentStyleName(java.lang.String parentStyleName,
java.lang.String styleName) |
asReference, getLibraryName, getName, getNamespace, getNamespaceResolver, getRawXmlValue, getReference, getResourceType, getResourceUrl, getValue, isFramework, isUserDefined, setValue@Nullable java.lang.String getParentStyleName()
parent XML attribute of this style. Unlike
getParentStyle(), does not try to determine the name of the parent style by
removing the last component of the name of this style.@Nullable default ResourceReference getParentStyle()
Note that names of styles have more meaning than other resources: if the parent attribute
is not set, aapt looks for a dot in the style name and treats the string up to the last dot
as the name of a parent style. So <style name="Foo.Bar.Baz"> has an implicit parent
called Foo.Bar. Setting the parent XML attribute disables this feature, even
if it's set to an empty string. See ResourceParser::ParseStyle in aapt for details.
static boolean isDefaultParentStyleName(@NonNull
java.lang.String parentStyleName,
@NonNull
java.lang.String styleName)
@Nullable StyleItemResourceValue getItem(@NonNull ResourceNamespace namespace, @NonNull java.lang.String name)
@Nullable StyleItemResourceValue getItem(@NonNull ResourceReference attr)
@NonNull java.util.Collection<StyleItemResourceValue> getDefinedItems()