public class AttributeSetBuilderImpl extends java.lang.Object implements AttributeSetBuilder
Modifier and Type | Class and Description |
---|---|
static class |
AttributeSetBuilderImpl.ArscResourceResolver |
static class |
AttributeSetBuilderImpl.LegacyResourceResolver |
static interface |
AttributeSetBuilderImpl.ResourceResolver |
Modifier | Constructor and Description |
---|---|
protected |
AttributeSetBuilderImpl(AttributeSetBuilderImpl.ResourceResolver resourceResolver) |
Modifier and Type | Method and Description |
---|---|
AttributeSetBuilder |
addAttribute(int resId,
java.lang.String value)
Set an attribute to the given value.
|
android.util.AttributeSet |
build()
Build an
AttributeSet with the antecedent attributes. |
AttributeSetBuilder |
setClassAttribute(java.lang.String value)
Set the class attribute to the given value.
|
AttributeSetBuilder |
setIdAttribute(java.lang.String value)
Set the id attribute to the given value.
|
AttributeSetBuilder |
setStyleAttribute(java.lang.String value)
Set the style attribute to the given value.
|
protected AttributeSetBuilderImpl(AttributeSetBuilderImpl.ResourceResolver resourceResolver)
public AttributeSetBuilder addAttribute(int resId, java.lang.String value)
AttributeSetBuilder
Set an attribute to the given value.
The value will be interpreted according to the attribute’s format.
addAttribute
in interface AttributeSetBuilder
addAttribute
in interface Robolectric.AttributeSetBuilder
resId
- The attribute resource id to set.value
- The value to set.AttributeSetBuilder
.public AttributeSetBuilder setStyleAttribute(java.lang.String value)
AttributeSetBuilder
Set the style attribute to the given value.
The value will be interpreted as a resource reference.
setStyleAttribute
in interface AttributeSetBuilder
setStyleAttribute
in interface Robolectric.AttributeSetBuilder
value
- The value for the specified attribute in this AttributeSet
.AttributeSetBuilder
.public AttributeSetBuilder setClassAttribute(java.lang.String value)
AttributeSetBuilder
Set the class attribute to the given value.
The value will be interpreted as a class name.
setClassAttribute
in interface AttributeSetBuilder
value
- The value for this AttributeSet
’s class
attribute.AttributeSetBuilder
.public AttributeSetBuilder setIdAttribute(java.lang.String value)
AttributeSetBuilder
Set the id attribute to the given value.
The value will be interpreted as an element id name.
setIdAttribute
in interface AttributeSetBuilder
value
- The value for this AttributeSet
’s id
attribute.AttributeSetBuilder
.public android.util.AttributeSet build()
AttributeSetBuilder
Build an AttributeSet
with the antecedent attributes.
build
in interface AttributeSetBuilder
build
in interface Robolectric.AttributeSetBuilder
AttributeSet
.