Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,811,995 Members 48,322 Now Online
XDA Developers Android and Mobile Development Forum

[GUIDE] [MOD] How to add battery % in Stock ROM

Tip us?
 
ramon20
Old
#1  
ramon20's Avatar
Senior Member - OP
Thanks Meter 70
Posts: 116
Join Date: Apr 2014
Location: Teresina-PI
Post [GUIDE] [MOD] How to add battery % in Stock ROM

Hi, i will learn how to add battery porcentage for Stock 4.4.2 ROM of Moto X, works with others roms too!

Screenshot:
 


Requires:
Code:
- SystemUI.apk deodexed
- apktool v2.0.0b9
Let's start:

1 - Decompile SystemUI.apk

2 - Download this smalis > click here

3 - Put the folder "erryy" in "SystemUI > smali > com"

4 - Go to "SystemUI > res > layout" and open "status_bar.xml"

5 - Find this line:
Code:
<include android:id="@id/signal_cluster"
6- Below this line put this line of code:
Code:
<com.erryy.BatteryText android:textSize="12.0dip" android:textColor="#ffffffff" android:gravity="center" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:paddingStart="2.0dip" />
7 - Now, find this line:
Code:
<com.android.systemui.BatteryMeterView
and replace the entire line for this line:
Code:
<com.android.systemui.BatteryMeterView android:id="@id/battery" android:layout_width="6.0dip" android:layout_height="15.0dip" android:layout_marginBottom="0.33000004dip" android:layout_marginStart="4.0dip" />
8 - Compile the SystemUI.

That's all!
The Following User Says Thank You to ramon20 For This Useful Post: [ Click to Expand ]
 
Tenigima
Old
#2  
Junior Member
Thanks Meter 0
Posts: 5
Join Date: Jul 2013
Very Good!!
 
ramon20
Old
#3  
ramon20's Avatar
Senior Member - OP
Thanks Meter 70
Posts: 116
Join Date: Apr 2014
Location: Teresina-PI
Quote:
Originally Posted by Tenigima View Post
Very Good!!
Thanks
 
Schaweet
Old
#4  
Senior Member
Thanks Meter 159
Posts: 633
Join Date: Aug 2010
Nice work, but why not just install gravity box?

Sent from my Dev Edition Moto X
 
ramon20
Old
#5  
ramon20's Avatar
Senior Member - OP
Thanks Meter 70
Posts: 116
Join Date: Apr 2014
Location: Teresina-PI
Quote:
Originally Posted by Schaweet View Post
Nice work, but why not just install gravity box?

Sent from my Dev Edition Moto X
This is for we devs! We work for the users just install our custom rom and use it, we don't want that the user set a lot of things! and i don't like the xposed and gravity
 
EVOSerb
Old
#6  
EVOSerb's Avatar
Senior Member
Thanks Meter 29
Posts: 156
Join Date: Jan 2011
Location: Chicago
https://play.google.com/store/apps/d...oid4batpercent

It's not same as this but it works for non rooted devices.
Sent from my XT1056 using XDA Free mobile app
The Following User Says Thank You to EVOSerb For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Compile Your Own Kernel From Source with Comprehensive Tutorial

One glance at any developer section of any device forum on XDA and youll find … more

WowWee Mip – Android Accessory Review – XDA Developer TV

The holidays will be here in no time, so why not start thinking about … more

Stream Your Media Files with the New Version of Droid Sync Manager

Android is a Linux-based operating system, but this fact doesn’t put … more

Old but Gold Internet Browser is a Blast from the Past

A Web browser is one of these applications that we can’t live without. We useit … more