I have the following situation:
in styles.xml
:
<style name="fooStyle">
<item name="android:padding">?fooView.padding</item>
<item name="android:background">?fooView.background</item>
<item name="android:gravity">?fooView.gravity</item>
</style>
in attrs.xml
:
<attr name="fooView.padding" format="dimension" />
<attr name="fooView.background" format="color|reference" />
<attr name="fooView.gravity" format="????"/>
in themes.xml
:
<style name="fooViewTheme" parent="android:Theme">
<item name="fooView.padding" >2dip</item>
<item name="fooView.background" >#AA000000</item>
<item name="fooView.gravity">right|bottom</item>
</style>
The problem is that I cannot figure out what the format for the fooView.gravity
should be. I've already tried with string
, enum
and flag
but none seem to work: I always get a java.lang.NumberFormatException: unable to parse 'right|bottom' as integer
as soon as the view that uses this theme gets loaded.
All answers are appreciated.