public class AttributeSetBuilderImpl extends 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,
String value)
Set an attribute to the given value.
|
AttributeSet |
build()
Build an
AttributeSet with the antecedent attributes. |
AttributeSetBuilder |
setClassAttribute(String value)
Set the class attribute to the given value.
|
AttributeSetBuilder |
setIdAttribute(String value)
Set the id attribute to the given value.
|
AttributeSetBuilder |
setStyleAttribute(String value)
Set the style attribute to the given value.
|
protected AttributeSetBuilderImpl(AttributeSetBuilderImpl.ResourceResolver resourceResolver)
public AttributeSetBuilder addAttribute(int resId, 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(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(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(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 AttributeSet build()
AttributeSetBuilder
Build an AttributeSet
with the antecedent attributes.
build
in interface AttributeSetBuilder
build
in interface Robolectric.AttributeSetBuilder
AttributeSet
.