How to change the Battery Icon


katerpanne

Members
Apr 19, 2014
1,319
307
Hello together,

there are a lot of guys who ask how to change the battery icon. There are several ways to do it
  • Theme Editors - if they running with Android Q themes
  • do it by your own manually "quick and dirty"
  • do it by your own and learn how to decompile/compile "complex" method
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Theme by @Superwitchi:
import it to theme app, go to My account, customize theme and apply statusbar
Tap my account -> themes -> List themes down -> tap import
DefaultDark.mtz
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Quick and dirty
Attention: This is not the correct way, but many people asked and I am not ready with the better way description
1. install the old firmware with newer battery icons (or download the corresponding MiuiSystemUI.apk)
2. adb pull /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk
3. install the new firmware with the older battery icons
4. copy from point 2. -> "MiuiSystemUI.apk" to "/system/priv-app/MiuiSystemUI/MiuiSystemUI.apk"
5. overwrite the old one (root explorer or twrp -> /system must be mounted as r/w)
6. perhaps your phone will crash... then hit the power button for a longer time
7. reboot

You can download "MiuiSystemUI.apk" from the older firmware with new styled battery icons so you dont have to install older firmware:
https://drive.google.com/open?id=1kqhiu2bYQSLToWlEKQOUpX5atzD0y1U-
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Better way but a little bit complexer
You need the following tools:
  • Apktool or Apk-Multi-Tool
  • Texteditor as example NotePad++ (for editing XML and Smali lines)
  • Image editing software if you want to create your own icons
  • 7-Zip, Winrar or Total Commander
description will follow... but now I am on vacation :)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
26815


26816


Happy day, Regards Kater
 
Last edited:

Igor Eisberg

Developer
Staff member
Oct 6, 2016
5,572
322
That's incorrect. The battery icon is not stored in MiuiAod, but rather in MiuiSystemUi, as a vector whose path data js stored as a string. Look for battery_meter_* string resources.
Also, many dimens have to be accurately set to ensure all of the indicator elements are in correct size, alignment and scaling.
 

katerpanne

Members
Apr 19, 2014
1,319
307
ah... ok. thank you ! There are many webp- and xml-files for the battery indicator. And if we replace all of them as well :)

edit: that is the way ... it is still working :cool:
 
Last edited:
  • Like
Reactions: iamme729

truelutti

Members
Oct 2, 2019
86
30
If there are two popular choices for the battery icon why not just have both in and have a way to switch between the icons in the settings? I figure this can't be too big of a programming task for the team?
 

Igor Eisberg

Developer
Staff member
Oct 6, 2016
5,572
322
If there are two popular choices for the battery icon why not just have both in and have a way to switch between the icons in the settings? I figure this can't be too big of a programming task for the team?
Yes it is, not only are there is a lot of code to make this happen, it will also break theme support.
 

truelutti

Members
Oct 2, 2019
86
30
Yes it is, not only are there is a lot of code to make this happen, it will also break theme support.
Figured the battery icon was just a few files one could just replace but well i don't know so sad to hear it's impossible. Then it seems that the most requested feature will be the old look or the new look of the battery icon in the future as well. I also noticed i have never used the theme feature before. It's a set of visual settings i guess so i don't think i'll try it since i like to set them individually. What a waste not to be able to fiddle with those small things.
 

aguslarca

Members
Oct 25, 2019
26
25
I think devs should create a poll asking to people which battery icon do they prefer, the new one or the old one and let the majority decides. I remember that they changed it just because some people in the forum complained about the new icon. But now a lot of people want the new one back, I think it would be very democratic if the majority chooses.
 
Last edited:
  • Like
Reactions: brusk

Igor Eisberg

Developer
Staff member
Oct 6, 2016
5,572
322
Figured the battery icon was just a few files one could just replace but well i don't know so sad to hear it's impossible.
Not files, resources (including strings and dimens). Replacing them requires decompilation. Making a switch between the two styles requires a lot more than that.
 
  • Like
Reactions: truelutti

LOLO9393

Members
Feb 8, 2016
2,365
322
Not files, resources (including strings and dimens). Replacing them requires decompilation. Making a switch between the two styles requires a lot more than that.
May be simpler, delete it for ever and that stop cries and tears.
Have a good night!
 
Last edited:

truelutti

Members
Oct 2, 2019
86
30
Nope, but Igor Eisberg does. He has an answer for you, exactly what I'm explaining :)
Well if you are not i don't see a reason you get to decide what i can say to the developers. (even if you were you wouldn't get a say in what i could say or what i couldn't)
Also it WAS "just a few files" but for what i got from the explanation was that they can't be switched on the go.
The whole reason a forum like this exists is to have a conversation about what the users want and what is possible and so on. I'd say that's exactly what was going on here.
 
  • Haha
Reactions: LOLO9393

katerpanne

Members
Apr 19, 2014
1,319
307
Hello together, in this thread I want to show how to change the icons.

Please switch to annother channel if you want to discuss why there are these icons in the firmware, why the user dont have the option to choose and so on.

This thread is the wrong place.

Thank you, regards Kater
 

frofa

Members
Mar 31, 2017
648
102
Hello together, in this thread I want to show how to change the icons.

Please switch to annother channel if you want to discuss why there are these icons in the firmware, why the user dont have the option to choose and so on.

This thread is the wrong place.

Thank you, regards Kater
Kater, the more people write in this thread, the oftener it is at the top of the thread list. Nothing to complain about, right?
 
  • Like
Reactions: katerpanne

katerpanne

Members
Apr 19, 2014
1,319
307
you are right, but this was not my attention... I only want to help.... and on the next days I will explain how to decompile...
but I have to work... I have no so much time, but I want to describe it in detail as always... see on my other threads.
 
  • Like
Reactions: MeiGuddet

Samuel100

Members
Nov 21, 2019
3
3
It would be much much better if the admin of someone who has a lot of experience of the tech and error handling on the mobile just post a new thread in which they explain the solutions of all the errors that are coming and each and every member here on the community can be helped. IMHO Tho!
 
  • Haha
Reactions: LOLO9393