There's precious little documentation about the declare-styleable
tag by which we can declare custom styles for components. I did find this list of valid values for the format
attribute of the attr
tag. While that's nice as far as it goes, it doesn't explain how to use some of those values. Browsing attr.xml (the Android source for the standard attributes), I discovered that you can do things like:
The format
attribute can evidently be set to a combination of values. Presumably the format
attribute helps the parser interpret an actual style value. Then I discovered this in attr.xml:
Both of these seem to declare a set of allowed values for the indicated style.
So I have two questions:
enum
values and one that can take on a set of flag
values?declare-styleable
works (other than reverse engineering the Android source code)?