AttributeSetBuilder
, Robolectric.AttributeSetBuilder
public class AttributeSetBuilderImpl extends Object implements AttributeSetBuilder
Modifier and Type | Class | Description |
---|---|---|
static class |
AttributeSetBuilderImpl.ArscResourceResolver |
|
static class |
AttributeSetBuilderImpl.LegacyResourceResolver |
|
static interface |
AttributeSetBuilderImpl.ResourceResolver |
Modifier | Constructor | Description |
---|---|---|
protected |
AttributeSetBuilderImpl(AttributeSetBuilderImpl.ResourceResolver resourceResolver) |
Modifier and Type | Method | 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
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
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
setClassAttribute
in interface AttributeSetBuilder
value
- The value for this AttributeSet
's class
attribute.AttributeSetBuilder
.public AttributeSetBuilder setIdAttribute(String value)
AttributeSetBuilder
setIdAttribute
in interface AttributeSetBuilder
value
- The value for this AttributeSet
's id
attribute.AttributeSetBuilder
.public AttributeSet build()
AttributeSetBuilder
AttributeSet
with the antecedent attributes.build
in interface AttributeSetBuilder
build
in interface Robolectric.AttributeSetBuilder
AttributeSet
.