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

Search This thread

mastaan

Senior Member
Oct 15, 2013
76
23
Well, there's a few way to do it.

But I'll only explain how I did it.
First, use 7zip to open framework-res.apk and go to res/drawable-nodpi ( if I'm not wrong ) and look for a image, named holo dark background ( I don't really remember the name, but it supposed to be holo_dark_XXXXX.png/jpg ) and you can download any image and named it same as the holo dark background name, and replace it. Just in case you want my image ( the cybertron image ) , I can provide it to you. :D

Good luck. I hope you understand what I'm talking about because I'm kinda rush here, I got no time to elaborate too much. :)

Thank you @limyuyang

In fact, when I looked at your screenshots it was on a mobile phone, I had not seen that the texture was the texture of the background of the menus :silly:, not that of the chart only.
But the info is interesting and will serve me. Thank you again :good:

In fact, I do not know if a thread on this topic exists on xda, but it would be interesting to have a database to know what is the purpose of each image. There are an impressive number of images in the applications which is never seen on the phone screen.
Maybe someone knows a link? :confused:
 
Last edited:

mastaan

Senior Member
Oct 15, 2013
76
23
Gradients

Hi @iamareebjamal
In this case :
A47aon


iget-object v9, p0, Lcom/android/settings/applications/LinearColorBar;->mEdgeGradientPaint:Landroid/graphics/Paint;

new-instance v0, Landroid/graphics/LinearGradient;

div-int/lit8 v2, v8, 0x2

int-to-float v4, v2

const v5, 0xa0a0a0

const v6, -0x5f5f60

It seems that it is a gradient. So, can I use two different colors to obtain a gradient? Thank
 
Last edited:

mastaan

Senior Member
Oct 15, 2013
76
23
About gauges

Hi @m4RinKo2,
I try to change my gauges. You say in one of your posts that it is a .png ,but it is not in my ROM and I can not find a color code that matches. Can you give me your setting.apk and your framwork, maybe it can help me. Thank you :)
 

Attachments

  • Screenshot_2014-02-12-16-01-24.png
    Screenshot_2014-02-12-16-01-24.png
    81.2 KB · Views: 80

D2Y aka E

Senior Member
Feb 4, 2014
306
73
muara wahau (borneo)
sir please help me let the same be the same orange color made in smali color hex code how because I equate with the hex color in color so different xml..

sorry my bad english
 

Attachments

  • HiShoot-1393463636322.png
    HiShoot-1393463636322.png
    226.2 KB · Views: 75

mastaan

Senior Member
Oct 15, 2013
76
23
sir please help me let the same be the same orange color made in smali color hex code how because I equate with the hex color in color so different xml..

sorry my bad english

Hi @D2Y aka E
The orange code seems to be ffce5508.
As you can see at the previous post, I try to change the color of gauges that are orange on your ROM.
Is it you who has changed them? If so, how?
If not, can you post me your setting.apk and your framwork? Or, if you do not know how, tell me the exact name of your ROM
Thank you :good:
 
  • Like
Reactions: D2Y aka E

D2Y aka E

Senior Member
Feb 4, 2014
306
73
muara wahau (borneo)
Hi @D2Y aka E
The orange code seems to be ffce5508.
As you can see at the previous post, I try to change the color of gauges that are orange on your ROM.
Is it you who has changed them? If so, how?
If not, can you post me your setting.apk and your framwork? Or, if you do not know how, tell me the exact name of your ROM
Thank you :good:

sorry my lord but not user friendly young galaxy 2 galaxy mini tutorial I try to apply this to the rom that I use .. okay I'll try there first color codes provide that no change I will upload the framework and setting.apk of custom rom that I use .. thank you for quotenya I will give thanks to your feet ..
 

iamareebjamal

Senior Member
Aug 7, 2012
3,703
5,127
27
Batcave
www.facebook.com
When u are coming back?

Sent from my GT-S5570I

I may pop up in between as I did today but I may come back completely free after May only.

You know more than 18+ hour activity on XDA, Whatsapp, etc as it was previously is only possible after all the exams and competitions are over :(


And well, I apologize to everyone for derailing the thread from topic :p
 

m4RinKo2

Senior Member
Oct 5, 2012
947
512
24
I may pop up in between as I did today but I may come back completely free after May only.

You know more than 18+ hour activity on XDA, Whatsapp, etc as it was previously is only possible after all the exams and competitions are over :(


And well, I apologize to everyone for derailing the thread from topic :p

See ya then

Sent from my GT-S5570I
 

icedventimocha

Senior Member
Hahaha

Fun was mine, when I was creating the App...

But seriously, I can sit straight 6 hours scratching my head trying to figure out smali but a 5 minute exercise of inverting pisses me off(dunno why) . That's why I created this utterly useless for others app :p

Was just joking, this app will come in handy for many. Good work man!

Sent from my Galaxy Note II
 
  • Like
Reactions: iamareebjamal

TheStart101

Member
Mar 25, 2014
28
7
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​

View attachment 2525390

I am running CM11 (KK) And this is very eay to do...However When i edit the the smali and recompilte the apk useing mutli-tool and put the setting.apk in the priv-sys,zip, and flash settings disappear?! Do you have any expert input for me?. The only difference i notice is "move-object/from16 v21, v0" instead of the "move-object/from16 v20, v0"
 

nicholi2789

Senior Member
Mar 19, 2013
681
183
Newport
I am running CM11 (KK) And this is very eay to do...However When i edit the the smali and recompilte the apk useing mutli-tool and put the setting.apk in the priv-sys,zip, and flash settings disappear?! Do you have any expert input for me?. The only difference i notice is "move-object/from16 v21, v0" instead of the "move-object/from16 v20, v0"
After you compile it again, don't push the newly compiled one to your phone, just take the classes.dex folder out of it and drop it into the original one using 7zip. Then push it to your phone. Making a zip over complicates it too if you ask me. Just use the adb remount command, then adb push to /system/app, then adb reboot. No flash or anything. Way easier and always works.
 
Last edited:
  • Like
Reactions: iamareebjamal

Top Liked Posts

  • There are no posts matching your filters.
  • 31
    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:
    p4b9.png

    Modded:
    pcg6.png



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

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


    You should see code like this below:

    Code:
    move-object/from16 v20, v0
    
        const/16 v21, 0x[b]ff[/b]
    
        const/16 v22, 0x[color=red]80[/color]
    
        const/16 v23, 0x[color=green]80[/color]
    
        const/16 v24, 0x[color=blue]80[/color]

    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:
    move-object/from16 v20, v0
    
        const/16 v21, 0x[b]7c[/b]
    
        const/16 v22, 0x[color=red]33[/color]
    
        const/16 v23, 0x[color=green]b5[/color]
    
        const/16 v24, 0x[color=blue]e5[/color]

    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:
    iget-object v0, v0, Lcom/android/settings/fuelgauge/BatteryHistoryChart;->mBatteryGoodPaint:Landroid/graphics/Paint;

    You should see code like this below:

    Code:
    move-object/from16 v20, v0
    
    		const/16 v21, 0x[b]80[/b]
    
    		const/16 v22, 0x[color=red]0[/color]
    
    		const/16 v23, 0x[color=green]ff[/color]
    
    		const/16 v24, 0x[color=blue]0[/color]

    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:
    iget-object v0, v0, Lcom/android/settings/fuelgauge/BatteryHistoryChart;->mBatteryWarnPaint:Landroid/graphics/Paint;

    You should see code like this below:

    Code:
    move-object/from16 v20, v0
    
    			const/16 v21, 0x[b]80[/b]
    
    			const/16 v22, 0x[color=red]ff[/color]
    
    			const/16 v23, 0x[color=green]ff[/color]
    
    			const/16 v24, 0x[color=blue]0[/color]

    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:
    iget-object v0, v0, Lcom/android/settings/fuelgauge/BatteryHistoryChart;->mBatteryCriticalPaint:Landroid/graphics/Paint;

    You should see code like this below:

    Code:
    move-object/from16 v20, v0
    
    			const/16 v21, 0x[b]c0[/b]
    
    			const/16 v22, 0x[color=red]ff[/color]
    
    			const/16 v23, 0x[color=green]0[/color]
    
    			const/16 v24, 0x[color=blue]0[/color]

    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:
    iget-object v0, v0, Lcom/android/settings/fuelgauge/BatteryHistoryChart;->mChargingPaint:Landroid/graphics/Paint;

    You should see code like this below:

    Code:
    move-object/from16 v20, v0
    
    			const/16 v21, 0x[b]80[/b]
    
    			const/16 v22, 0x[color=red]0[/color]
    
    			const/16 v23, 0x[color=green]ff[/color]
    
    			const/16 v24, 0x[color=blue]0[/color]

    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 :D. 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:
    adb shell killall system_server
    7. Enjoy :D

    Holofy Application Bar

    Original:
    zper.png

    Modded:
    l1b5.png

    cbwk.png



    1. Decompile your Settings.apk
    2. Go to /smali/com/android/settings/applications/LinearColorBar.smali
    3. Search for
    Code:
    .method private updateIndicator()V

    You will see code like this below:
    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

    mi70.png

    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:
    		.locals 12
    
    		.prologue
    		const v11, 0x33b5e5
    
    		const/4 v3, 0x2
    
    		const v10, -0xcc4a1a
    
    		const/4 v1, 0x0
    4. Search for
    Code:
    iget-object v9, p0, Lcom/android/settings/applications/LinearColorBar;->mColorGradientPaint:Landroid/graphics/Paint;

    You will see code like this below:
    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:
    		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:
    invoke-virtual {v3, v4}, Landroid/graphics/Paint;->setColor(I)V
    You will get 3 results

    First one will look like this:
    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
    
    		[i]invoke-virtual {v3, v4}, Landroid/graphics/Paint;->setColor(I)V[/i]

    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:
    		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
    
    		[i]invoke-virtual {v3, v4}, Landroid/graphics/Paint;->setColor(I)V[/i]

    Second one will look like this:
    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
    
    		[i]invoke-virtual {v3, v4}, Landroid/graphics/Paint;->setColor(I)V[/i]

    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:
    		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
    
    		[i]invoke-virtual {v3, v4}, Landroid/graphics/Paint;->setColor(I)V[/i]

    Third one will look like this:
    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
    
    		[i]invoke-virtual {v3, v4}, Landroid/graphics/Paint;->setColor(I)V[/i]

    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:
    		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
    
    		[i]invoke-virtual {v3, v4}, Landroid/graphics/Paint;->setColor(I)V[/i]

    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:
    adb shell killall system_server
    8. Enjoy :)

    I am attaching the final smalis so you can compare changes
    View attachment smali.zip
    1
    cool !! \m/
    1
    Yes that is a png. app_gauge.9
    1
    I have to admit this looks amazing and many thanks for the tutorial, but being lazy as I am (aka stuck at work) is there any way to create a flashable zip of this procedure?

    Sir, that would be incompatible with not even every device except one but even on ROMs

    I was thinking of creating a Xposed Module but :curses: exams came and I can't do it, so sorry, but there is no generalised way of doing it except for modding it manually :(