public enum ResType extends java.lang.Enum<ResType>
Prop
can receive resources of a corresponding
Android resource type as values. In addition or instead of usual builder methods this will
trigger generation of methods which expect Android resource values or ids as parameter values.
For example:
If a CharSequence
prop named title
is marked as STRING
, this will
generate not only method title(CharSequence title)
in the component builder, but also
various methods that enable initializing the prop from a string resource or attribute:
titleRes(@StringRes int resId)
titleRes(@StringRes int resId, Object... formatArgs)
titleAttr(@AttrRes int attrResId)
titleAttr(@AttrRes int attrResId, @StringRes int defResId)
And if an int
prop named size
is marked as DIMEN_SIZE
, this will
not generate a size(int size)
method, but will add a bunch of other methods that accept
resources:
sizePx(@Px int sizePx)
sizeRes(@DimenRes int resId)
sizeDip(@Dimension(unit = Dimension.DP) float dip)
sizeAttr(@AttrRes int attrResId)
sizeAttr(@AttrRes int attrResId, @DimenRes int defResId)
Prop
,
PropDefault
,
ArrayRes
,
BoolRes
,
IntegerRes
,
StringRes
,
DimenRes
,
Dimension
,
DrawableRes
,
ColorRes
,
ColorInt
,
AttrRes
Enum Constant and Description |
---|
BOOL
Prop's value can be set from a
BoolRes resource. |
COLOR
Prop's value can be set from a
ColorRes resource or as a ColorInt value. |
DIMEN_OFFSET
Prop's value can be set from a
DimenRes resource or as a Dimension#DP , Dimension#SP or Dimension#PX value. |
DIMEN_SIZE
Prop's value can be set from a
DimenRes resource or as a Dimension#DP or Dimension#PX value. |
DIMEN_TEXT
Prop's value can be set from a
DimenRes resource or as a Dimension#DP , Dimension#SP or Dimension#PX value. |
DRAWABLE
Prop's value can be set from a
DrawableRes resource. |
FLOAT
Prop's value can be set from a
DimenRes resource. |
INT
Prop's value can be set from an
IntegerRes resource. |
INT_ARRAY
Prop's value can be set from an
ArrayRes resource which contains IntegerRes s. |
NONE
Prop is not related to Android resources.
|
STRING
Prop's value can be set from a
StringRes resource. |
STRING_ARRAY
Prop's value can be set from an
ArrayRes resource which contains StringRes s. |
Modifier and Type | Method and Description |
---|---|
static ResType |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static ResType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ResType NONE
public static final ResType STRING
StringRes
resource.public static final ResType STRING_ARRAY
ArrayRes
resource which contains StringRes
s.public static final ResType INT
IntegerRes
resource.public static final ResType INT_ARRAY
ArrayRes
resource which contains IntegerRes
s.public static final ResType BOOL
BoolRes
resource.public static final ResType COLOR
ColorRes
resource or as a ColorInt
value.public static final ResType DIMEN_SIZE
DimenRes
resource or as a Dimension#DP
or Dimension#PX
value.public static final ResType DIMEN_OFFSET
DimenRes
resource or as a Dimension#DP
, Dimension#SP
or Dimension#PX
value.public static final ResType DIMEN_TEXT
DimenRes
resource or as a Dimension#DP
, Dimension#SP
or Dimension#PX
value.public static final ResType FLOAT
DimenRes
resource.public static final ResType DRAWABLE
DrawableRes
resource.public static ResType[] values()
for (ResType c : ResType.values()) System.out.println(c);
public static ResType valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null