- Joined
- Dec 28, 2009
- Messages
- 5,354
- Reaction score
- 0
Ok -- just some ideas
I'm realizing that although I understand in general the concept of xml files, when it would come to creating an entry -- I'm really clueless. Wow a good tutorial would help (but how do I hate eclipse)!
Anyway just wondering what others have found along with questions:
Two xml files and one image directory jump out on review of the data:
/res/drawable/stat_sys_battery.xml:<item android:drawable="@drawable/stat_sys_battery_0" android:maxLevel="4" />/res/values/public.xml:
<item android:drawable="@drawable/stat_sys_battery_10" android:maxLevel="14" />
<item android:drawable="@drawable/stat_sys_battery_20" android:maxLevel="29" />
<item android:drawable="@drawable/stat_sys_battery_40" android:maxLevel="49" />
<item android:drawable="@drawable/stat_sys_battery_60" android:maxLevel="69" />
<item android:drawable="@drawable/stat_sys_battery_80" android:maxLevel="89" />
<item android:drawable="@drawable/stat_sys_battery_100" android:maxLevel="100" />
<public type="drawable" name="stat_sys_battery_0" id="0x01080293" />And of course the /res/drawable-hdpi-v4 folder where the images are located.
<public type="drawable" name="stat_sys_battery_10" id="0x01080294" />
<public type="drawable" name="stat_sys_battery_100" id="0x01080295" />
<public type="drawable" name="stat_sys_battery_20" id="0x01080296" />
<public type="drawable" name="stat_sys_battery_40" id="0x01080297" />
<public type="drawable" name="stat_sys_battery_60" id="0x01080298" />
<public type="drawable" name="stat_sys_battery_80" id="0x01080299" />
Although /res/layout/battery_status.xml refers to the battery layout style I dont think this file is relevant although I don't quite fully understand this file unless its the text that is overlayed over the battery -- Not sure about this one.
Ok the big question -- when declaring new images -- am I ok with just arbitrarily picking IDs? A suggestion was to make them consecutive to the last drawable ID values, however if I look at the last 3 ID drawable values they seem not to be consecutive (these are found in res/values/public.xml):
<public type="drawable" name="usb_android_connected" id="0x01080358" />
<public type="drawable" name="bottombar_565" id="0x010800af" />
<public type="drawable" name="btn_lock_normal" id="0x010800fd" />
Thanks for any input!!!
@kevdog - sorry for the delay in getting back to you - it's been crazy since 4.7 came out!!
The only xml you need to change should be stat_sys_battery.xml; however ... the ID's that you are referencing (public.xml) are likely compile-time generated; I am truly not sure if you can do it this way or not ... I only get mine working because I compile from source and the id's are generated for me ...