Hello.
I'm now reading about layers and I'd like to create a common layer for devices. I wanted to put battery information in the upper side of the screen. So I need some drawable to draw there.
I tried this code:
<layout id="DeviceLayout">
<drawable id="BatteryDrawable" x="30%" y="10%" />
</layout>
So I can get "BatteryDrawable" and draw there.
But the compiler says me:
BUILD: ERROR: Problem validating a resource file: cvc-complex-type.3.2.2: Attribute 'x' is not allowed to appear in element 'drawable'.
Meanwhile in documentation I read:
The following attributes are supported by the drawable tag:
x |
The X coordinate of the top left corner in relation to the parent element | pixel value, a relative position using ‘%’, center, left, right, or start |
0 |
The question is: what's wrong? What is the best way to define some drawable area with specified coordinates? I'd not like to hardcode then in code.
Thanks.
