I am developping an app, with some menus, and I can't manage easily my layouts, drawable and shapes for the menus.
Here's my layout
<layout id="layoutSettingsChoixSourceBG">
<drawable id="backgroundGrey" />
<label x="50%" y="24%" text="NigthScout" font="Gfx.FONT_MEDIUM" color="Gfx.COLOR_WHITE" justification="Gfx.TEXT_JUSTIFY_CENTER" />
<label x="50%" y="45%" text="AAPS" font="Gfx.FONT_MEDIUM" color="Gfx.COLOR_WHITE" justification="Gfx.TEXT_JUSTIFY_CENTER" />
<label x="50%" y="65%" text="Xdrip" font="Gfx.FONT_MEDIUM" color="Gfx.COLOR_WHITE" justification="Gfx.TEXT_JUSTIFY_CENTER" />
<button x="0" y="0" width="800" height="800" >
<state id="stateDefault" bitmap="@Drawables.BoutonVide" />
</button>
<button x="22%" y="24%" width="59%" height="16%">
<state id="stateDefault" drawable="@Drawables.settingsChoixBG1" />
<state id="stateHighlighted" drawable="@Drawables.settingsChoixBGActive1" />
<state id="stateDisabled" color="Graphics.COLOR_BLACK" />
<param name="behavior">nigthscout</param>
</button>
<button x="22%" y="44%" width="59%" height="16%" >
<state id="stateDefault" drawable="@Drawables.settingsChoixBG2" />
<state id="stateHighlighted" drawable="@Drawables.settingsChoixBGActive2" />
<state id="stateDisabled" color="Graphics.COLOR_BLACK" />
<param name="behavior">aaps</param>
</button>
<button x="22%" y="64%" width="59%" height="16%" >
<state id="stateDefault" drawable="@Drawables.settingsChoixBG3" />
<state id="stateHighlighted" drawable="@Drawables.settingsChoixBGActive3" />
<state id="stateDisabled" color="Graphics.COLOR_BLACK" />
<param name="behavior">xdrip</param>
</button>
</layout>
And here is my drawables :
<drawables>
<drawable-list id="settingsChoixBG1">
<shape type="rectangle" x="22%" y="24%" width="59%" height="16%" corner_radius="5" color="Gfx.COLOR_TRANSPARENT" border_color="Gfx.COLOR_WHITE" border_width="5" ></shape>
</drawable-list>
<drawable-list id="settingsChoixBG2">
<shape type="rectangle" x="22%" y="44%" width="59%" height="16%" corner_radius="5" color="Gfx.COLOR_TRANSPARENT" border_color="Gfx.COLOR_WHITE" border_width="5" ></shape>
</drawable-list>
<drawable-list id="settingsChoixBG3">
<shape type="rectangle" x="22%" y="64%" width="59%" height="16%" corner_radius="5" color="Gfx.COLOR_TRANSPARENT" border_color="Gfx.COLOR_WHITE" border_width="5" ></shape>
</drawable-list>
<drawable-list id="settingsChoixBGActive1">
<shape type="rectangle" x="22%" y="24%" width="59%" height="16%" corner_radius="5" color="Gfx.COLOR_TRANSPARENT" border_color="Gfx.COLOR_RED" border_width="5" ></shape>
</drawable-list>
<drawable-list id="settingsChoixBGActive2">
<shape type="rectangle" x="22%" y="44%" width="59%" height="16%" corner_radius="5" color="Gfx.COLOR_TRANSPARENT" border_color="Gfx.COLOR_RED" border_width="5" ></shape>
</drawable-list>
<drawable-list id="settingsChoixBGActive3">
<shape type="rectangle" x="22%" y="64%" width="59%" height="16%" corner_radius="5" color="Gfx.COLOR_TRANSPARENT" border_color="Gfx.COLOR_RED" border_width="5" ></shape>
</drawable-list>
</drawables>
There are 1 drawable for 1 button, but they are all the same, except for the position wich is already in the layout button
And I would't use png because I have many menus and many watch resolution (218, 240, 260 etc ....),
Then for my layouts, I would like to use the same drawable/shape, and adapt its position (locX and locY) with java code, instead of having as many drawable/shape as buttons ? Or perhaps another way to do this ?
I also have looked in the Selectable example, but it's with png, and I I didn't manage to adapt it with shapes.
Your help would be welcome