[Eee Pad Transformer Android Development] ricardopvz:
How to create user icons for Megatron ROM

In Megatron 1.1.0, i introduced a new feature that allows you to install custom icons and choose them in Megatron Parts. Eg: you install some packages that has some icons, and then you can choose the navbar icons from one package, the quick apps icon from other, and so on. For now it only lets you customise navbar icons, quick apps icons, battery icons and dock battery icons.

So here's how to make one of that package:

First you have to have an eclipse environment with android sdk installed (if you don't have, search it. AdamOutler made some videos how to make this).

Create a new android project but don't create an activity (untick the "Create Activity" in the wizard)

After you have created the project, you have to edit the res/strings.xml file

Copy and pase this:

<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="megatron_mod_name">Test Mod</string>
<string name="megatron_mod_version">1.0</string>
<string name="megatron_mod_creator">ricardopvz</string>

</resources>

And change the values to what you want.

Now create a new file names bools.xml in the same folder with this content:

<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="batteryIcon">true</bool>
<bool name="dockBatteryIcon">true</bool>
<bool name="navbarButtonsIcons">true</bool>
<bool name="quickAppsIcon">true</bool>

</resources>

This defines what icons you package will have. So you have to insert "true" if it contains the specified icon, or "false" if it doesn't.

Now open the AndroidManifest.xml file and change the "@string/app_name" to "@string/megatron_mod_name"

Now for the icons:

if you want to have a custom quick apps icon, there must be a png file in the drawable folder with the name "mod_quickapps_icon.png"

if you want to have custom navbar icons, there must be this png files in the drawable folder: "mod_navbar_back.png", "mod_navbar_home.png", "mod_navbar_recent.png" and "mod_navbar_menu.png". You should know what this icons are for.

if you what custom battery icons, you must have this 2 files in the drawable folder:

"mod_battery.xml"

<?xml version="1.0" encoding="utf-8"?>
<level-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:maxLevel="4" android:drawable="@drawable/battery_0" />
<item android:maxLevel="15" android:drawable="@drawable/battery_15" />
<item android:maxLevel="35" android:drawable="@drawable/battery_28" />
<item android:maxLevel="49" android:drawable="@drawable/battery_43" />
<item android:maxLevel="60" android:drawable="@drawable/battery_57" />
<item android:maxLevel="75" android:drawable="@drawable/battery_71" />
<item android:maxLevel="90" android:drawable="@drawable/battery_85" />
<item android:maxLevel="100" android:drawable="@drawable/battery_100" />
</level-list>

(you can add more levels if you want)

"mod_battery_charge.xml"

<?xml version="1.0" encoding="utf-8"?>
<level-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:maxLevel="4" android:drawable="@drawable/battery_charge_anim0" />
<item android:maxLevel="15" android:drawable="@drawable/battery_charge_anim15" />
<item android:maxLevel="35" android:drawable="@drawable/battery_charge_anim28" />
<item android:maxLevel="49" android:drawable="@drawable/battery_charge_anim43" />
<item android:maxLevel="60" android:drawable="@drawable/battery_charge_anim57" />
<item android:maxLevel="75" android:drawable="@drawable/battery_charge_anim71" />
<item android:maxLevel="90" android:drawable="@drawable/battery_charge_anim85" />
<item android:maxLevel="100" android:drawable="@drawable/battery_charge_anim100" />
</level-list>

(you can add more levels if you want)

now you have to insert the battery icons in the drawable folder with the names specified in these xml files.

For the dock battery is exctly the same but with this 2 files:

"mod_dock_battery.xml"

<?xml version="1.0" encoding="utf-8"?>
<level-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/kb_battery_0" android:maxLevel="4" />
<item android:drawable="@drawable/kb_battery_15" android:maxLevel="15" />
<item android:drawable="@drawable/kb_battery_28" android:maxLevel="35" />
<item android:drawable="@drawable/kb_battery_43" android:maxLevel="49" />
<item android:drawable="@drawable/kb_battery_57" android:maxLevel="60" />
<item android:drawable="@drawable/kb_battery_71" android:maxLevel="75" />
<item android:drawable="@drawable/kb_battery_85" android:maxLevel="90" />
<item android:drawable="@drawable/kb_battery_100" android:maxLevel="100" />
</level-list>

and "mod_dock_battery_charge.xml"

<?xml version="1.0" encoding="utf-8"?>
<level-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/kb_battery_charge_anim0" android:maxLevel="4" />
<item android:drawable="@drawable/kb_battery_charge_anim15" android:maxLevel="15" />
<item android:drawable="@drawable/kb_battery_charge_anim28" android:maxLevel="35" />
<item android:drawable="@drawable/kb_battery_charge_anim43" android:maxLevel="49" />
<item android:drawable="@drawable/kb_battery_charge_anim57" android:maxLevel="60" />
<item android:drawable="@drawable/kb_battery_charge_anim71" android:maxLevel="75" />
<item android:drawable="@drawable/kb_battery_charge_anim85" android:maxLevel="90" />
<item android:drawable="@drawable/kb_battery_charge_anim100" android:maxLevel="100" />
</level-list>

The names in the dock battery xml's can also point to the same png's as the normal battery xml's

Hope you understood all this.

If you have any questions just ask me.