Default [GUIDE][MOD][Holo]Change colour of Battery Chart and Application Bar

Le Holofy

Disclaimer:

I do not hold responsibilty for any mishap that may or may not happen to your device by trying of this modification. By trying this mod, you agree that you and you only are responsible for any harm done to your phone, society, or UNESCO

Though this guide is made for Gingerbread, the exactly same method will work in ICS, JB, Kitkat. Though on ICS+, Application Bar already is Holo Blue and nothing needs to be changed there
Holofy Battery Chart

Original:

Modded:



 
1. First decompile your Settings.apk
2. Go to /smali/com/android/settings/fuelgauge/BatteryHistoryChart.smali
3. Chart Background

Search for
Code:
Select Code
iget-object v0, v0, Lcom/android/settings/fuelgauge/BatteryHistoryChart;->mBatteryBackgroundPaint:Landroid/graphics/Paint;

You should see code like this below:

Code:
Select Code
move-object/from16 v20, v0

    const/16 v21, 0xff

    const/16 v22, 0x80

    const/16 v23, 0x80

    const/16 v24, 0x80
IMPORTANT: Read carefully, this will not be explained again in this guide!

Combining the bold and red, blue, green code, we get ff808080, which is the hex code for grey color of the battery chart background

More conceptually
alpha (Meaning the transparency, ff means completely opaque, 00 means completely transparent)
red
green
blue

Since, the code is ff808080
ff(opaque)+red(80)=green(80)=blue(80) makes a grey color. This is how a hex color code works!

Now, we will make it translucent holo blue, hex color 7c33b5e5

So, replace ff by 7c, 80 by 33, 80 by b5, and 80 by e5

Final code will look like this:
Code:
Select Code
move-object/from16 v20, v0

    const/16 v21, 0x7c

    const/16 v22, 0x33

    const/16 v23, 0xb5

    const/16 v24, 0xe5
Similarly, we can break any hex code.
Eg:
fff7ab17 is color code of orange

We'll follow same routine throughout this guide.

4. We had changed the battery chart background in previous step, now we will change
Good Lining

Good Lining is the green lining on the border of battery chart showing the battery is above 30%(I guess) and there is nothing to worry about.

Search for
Code:
Select Code
iget-object v0, v0, Lcom/android/settings/fuelgauge/BatteryHistoryChart;->mBatteryGoodPaint:Landroid/graphics/Paint;
You should see code like this below:

Code:
Select Code
move-object/from16 v20, v0

		const/16 v21, 0x80

		const/16 v22, 0x0

		const/16 v23, 0xff

		const/16 v24, 0x0
Combining the bold and red, blue, green code, we get 800ff0, which is the hex code for green color of the good lining

We change it to ff33b5e5 for uniform look of Holo Battery Chart, you can change it to any color you want
Warn Lining

Warn Lining is the yellow lining on the border of battery chart showing the battery is below 30% and there is something to worry about.

Search for
Code:
Select Code
iget-object v0, v0, Lcom/android/settings/fuelgauge/BatteryHistoryChart;->mBatteryWarnPaint:Landroid/graphics/Paint;
You should see code like this below:

Code:
Select Code
move-object/from16 v20, v0

			const/16 v21, 0x80

			const/16 v22, 0xff

			const/16 v23, 0xff

			const/16 v24, 0x0
Combining the bold and red, blue, green code, we get 80ffff0, which is the hex code for yellow color of the warn lining

We change it to ff33b5e5 for uniform look of Holo Battery Chart, you can change it to any color you want
Critical Lining

Critical Lining is the red lining on the border of battery chart showing the battery is below 15% and to stop plying Ingress and grab a charger as soon as possible.

Search for
Code:
Select Code
iget-object v0, v0, Lcom/android/settings/fuelgauge/BatteryHistoryChart;->mBatteryCriticalPaint:Landroid/graphics/Paint;
You should see code like this below:

Code:
Select Code
move-object/from16 v20, v0

			const/16 v21, 0xc0

			const/16 v22, 0xff

			const/16 v23, 0x0

			const/16 v24, 0x0
Combining the bold and red, blue, green code, we get c0ff00, which is the hex code for red color of the critical lining

We change it to ff33b5e5 for uniform look of Holo Battery Chart, you can change it to any color you want
Charging Lining

Charging Lining is the green lining on the border of battery chart(and below on the charge bar too) showing the battery is charging and compensating the juice Ingress drained.

Search for
Code:
Select Code
iget-object v0, v0, Lcom/android/settings/fuelgauge/BatteryHistoryChart;->mChargingPaint:Landroid/graphics/Paint;
You should see code like this below:

Code:
Select Code
move-object/from16 v20, v0

			const/16 v21, 0x80

			const/16 v22, 0x0

			const/16 v23, 0xff

			const/16 v24, 0x0
Combining the bold and red, blue, green code, we get 800ff0, which is the hex code for green color of the charging lining

We change it to ff33b5e5 for uniform look of Holo Battery Chart, you can change it to any color you want
5. Our work is complete . Save the file
6. Recompile the Settings.apk
Push the app in system. If the Settings app doesnt appear in App Drawer, hot reboot via EPM or:
Code:
Select Code
adb shell killall system_server
7. Enjoy


Holofy Application Bar

Original:

Modded:



 

1. Decompile your Settings.apk
2. Go to /smali/com/android/settings/applications/LinearColorBar.smali
3. Search for
Code:
Select Code
.method private updateIndicator()V
You will see code like this below:
Code:
Select Code
		.locals 12

		.prologue
		const v11, 0xa0a0a0

		const/4 v3, 0x2

		const v10, -0x5f5f60

		const/4 v1, 0x0
First we see a0a0a0, which is hex code of grey colour, which we have to change to holo blue, so we replace it by 33b5e5
Second code is 5f5f60, which, unfortunately, is not a normal hex code but an inverse hex code. Consider this table:

NEW: Or try this app by me, much much easier - Invertase


We re-invert the inverse hex code to original form by this table, which comes out to be a0a09f, which again is grey and we have to convert it to holo blue, but we cannot just write 33b5e5 there, we must first invert it through that table.
Inverted code of 33b5e5 : cc4a1a
So, we replace 5f5f60 by cc4a1a

Final code will look like this:
Code:
Select Code
		.locals 12

		.prologue
		const v11, 0x33b5e5

		const/4 v3, 0x2

		const v10, -0xcc4a1a

		const/4 v1, 0x0
4. Search for
Code:
Select Code
iget-object v9, p0, Lcom/android/settings/applications/LinearColorBar;->mColorGradientPaint:Landroid/graphics/Paint;
You will see code like this below:
Code:
Select Code
		new-instance v0, Landroid/graphics/LinearGradient;

		sub-int v2, v8, v3

		int-to-float v4, v2

		const v5, 0xa0c0a0

		const v6, -0x5f3f60
First we see a0c0a0, which is hex code of green color, which we have to change to grey, so we replace it by a0a0a0
Second code is 5f3f60, which is inverse hex code of a0c09f, which is again green colour which we have to change to grey colour a0a09f
Inverted code of a0a09f : 5f5f60
So we replace 5f3f60 by 5f5f60

Final code will look like
Code:
Select Code
		new-instance v0, Landroid/graphics/LinearGradient;

		sub-int v2, v8, v3

		int-to-float v4, v2

		const v5, 0xa0a0a0

		const v6, -0x5f5f60
5. Search for
Code:
Select Code
invoke-virtual {v3, v4}, Landroid/graphics/Paint;->setColor(I)V
You will get 3 results

First one will look like this:
Code:
Select Code
		move-object/from16 v0, p0

		iget-object v0, v0, Lcom/android/settings/applications/LinearColorBar;->mPaint:Landroid/graphics/Paint;

		move-object v3, v0

		const v4, -0x5f5f60

		invoke-virtual {v3, v4}, Landroid/graphics/Paint;->setColor(I)V
See just above the searched code, it is 5f5f60, which is again inverse code of grey, so we replace it by inverse code of blue, which is cc4a1a


Final code will look like
Code:
Select Code
		move-object/from16 v0, p0

		iget-object v0, v0, Lcom/android/settings/applications/LinearColorBar;->mPaint:Landroid/graphics/Paint;

		move-object v3, v0

		const v4, -0xcc4a1a

		invoke-virtual {v3, v4}, Landroid/graphics/Paint;->setColor(I)V
Second one will look like this:
Code:
Select Code
		move-object/from16 v0, p0

		iget-object v0, v0, Lcom/android/settings/applications/LinearColorBar;->mPaint:Landroid/graphics/Paint;

		move-object v3, v0

		const v4, -0x5f5f60

		invoke-virtual {v3, v4}, Landroid/graphics/Paint;->setColor(I)V
See just above the searched code, it is 5f5f60, which is again inverse code of grey, so we replace it by inverse code of blue, which is cc4a1a


Final code will look like
Code:
Select Code
		move-object/from16 v0, p0

		iget-object v0, v0, Lcom/android/settings/applications/LinearColorBar;->mPaint:Landroid/graphics/Paint;

		move-object v3, v0

		const v4, -0xcc4a1a

		invoke-virtual {v3, v4}, Landroid/graphics/Paint;->setColor(I)V
Third one will look like this:
Code:
Select Code
		move-object/from16 v0, p0

		iget-object v0, v0, Lcom/android/settings/applications/LinearColorBar;->mPaint:Landroid/graphics/Paint;

		move-object v3, v0

		const v4, -0x5f3f60

		invoke-virtual {v3, v4}, Landroid/graphics/Paint;->setColor(I)V
See just above the searched code, it is 5f3f60, which is again inverse code of green, so we replace it by inverse code of grey, which is 5f5f60


Final code will look like
Code:
Select Code
		move-object/from16 v0, p0

		iget-object v0, v0, Lcom/android/settings/applications/LinearColorBar;->mPaint:Landroid/graphics/Paint;

		move-object v3, v0

		const v4, -0x5f5f60

		invoke-virtual {v3, v4}, Landroid/graphics/Paint;->setColor(I)V
6. You can change these colours to any one of your choice, it up to you.
Save the file when you are done
7. Recompile Settings.apk and push it in system
If it does not appear in App Drawer, hot reboot your phone wither by EPM or by this command:
Code:
Select Code
adb shell killall system_server
8. Enjoy

I am attaching the final smalis so you can compare changes
smali.zip