public class StyleResourceValue extends ResourceValueImpl
ResourceValue.mNamespaceResolver| Constructor and Description |
|---|
StyleResourceValue(ResourceNamespace namespace,
ResourceType type,
java.lang.String name,
java.lang.String parentStyle,
java.lang.String libraryName)
Creates a new
StyleResourceValue. |
StyleResourceValue(ResourceReference reference,
java.lang.String parentStyle,
java.lang.String libraryName)
Creates a new
StyleResourceValue. |
| Modifier and Type | Method and Description |
|---|---|
void |
addItem(StyleItemResourceValue item) |
java.util.Collection<StyleItemResourceValue> |
getDefinedItems()
Returns a list of all items defined in this Style.
|
StyleItemResourceValueImpl |
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).
|
StyleItemResourceValueImpl |
getItem(ResourceReference attr)
Finds the item for the given attr in this style (if it's defined in this style).
|
ResourceReference |
getParentStyle()
Returns a reference to the parent style, if it can be determined based on the explicit parent
reference in XML or by splitting the name of this
StyleResourceValue by dots. |
java.lang.String |
getParentStyleName()
Returns value of the
parent XML attribute of this style. |
void |
replaceWith(ResourceValue style)
Sets the value from another resource.
|
asReference, equals, getLibraryName, getName, getNamespace, getNamespaceResolver, getRawXmlValue, getReference, getResourceType, getResourceUrl, getValue, hashCode, isFramework, isUserDefined, setNamespaceLookup, setNamespaceResolver, setValue, toStringpublic StyleResourceValue(@NonNull
ResourceReference reference,
@Nullable
java.lang.String parentStyle,
@Nullable
java.lang.String libraryName)
StyleResourceValue.public StyleResourceValue(@NonNull
ResourceNamespace namespace,
@NonNull
ResourceType type,
@NonNull
java.lang.String name,
@Nullable
java.lang.String parentStyle,
@Nullable
java.lang.String libraryName)
StyleResourceValue.
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.
@Nullable public java.lang.String getParentStyleName()
parent XML attribute of this style. Does not look at the name of
the style itself or dots in it.@Nullable public ResourceReference getParentStyle()
StyleResourceValue by dots.@Nullable public StyleItemResourceValueImpl getItem(@NonNull ResourceNamespace namespace, @NonNull java.lang.String name)
@Nullable public StyleItemResourceValueImpl getItem(@NonNull ResourceReference attr)
public void addItem(StyleItemResourceValue item)
public void replaceWith(@NonNull
ResourceValue style)
ResourceValuereplaceWith in interface ResourceValueTempreplaceWith in class ResourceValuestyle - the resource valuepublic java.util.Collection<StyleItemResourceValue> getDefinedItems()