[MOD][TUTORIAL] Customize NavigationBar height

Flextrick

Senior Member
May 14, 2012
1,161
2,235
0
Hello,
In this tutorial I´ll show you how to change the height of your NavBar.

This Tutorial works for any Rom!

Requirements
  • Text-Editor, e.g. Notepad++
  • WinRar/WinZip/Bandzip
  • Apktool (Download)
  • installed Java (Download)
  • JDK (Download)
  • root on your Nexus 4
  • a FileManager like ES File Explorer or Root Explorer
  • your framework-res.apk
  • some Cmd experience (just a little)
  • .. and some time/nerves

.. let´s go

Before getting started, make a Nandroid Backup (if you get Bootoop etc)!

The decompliling:

First you need to create a new folder like "C:\apktool". Download Apktool and extract the files to C:\apktool
  • copy your framework-res.apk to C:\apktool
  • open Cmd
  • navigate to your apktool (with "cd C:\apktool")
  • type in: java -jar apktool.jar if framework-res.apk [enter] (...installation of your framework)
  • type in: java -jar apktool.jar d framework-res.apk [enter]
  • finished!

Now you should have a new folder named framework-res. That´s your decompiled framework-res.apk.


The customizing of your NavBar height:
  • Navigate to /res/values
  • open dimens.xml in your Text-Editor
  • search the 3 lines which include navigation_bar_height, navigation_bar_height_landscape, und navigation_bar_width
  • type in your desired dpi number (for default it´s 48dpi)
  • CAUTION: At width, you should calculate the numeral proportion of the height to the width.
  • If you got that, save!

The (Re-)compiling:
  • Cmd (if you have not left it open, you must navigate again to C:\apktool
  • type in: java -jar apktool.jar b framework-res [enter]
  • The newly compiled framework-res.apk is located in C:\apktool\framework-res\dist
  • CAUTION: Copy the META-INF folder and the AndroidManifest.xml from your old framework-res.apk to your newly compiled one! Otherwise you´ll get Bootloop.

Now copy your framework-res.apk with a file manager to /system/framework. After that reboot immediately!

Finished! Have fun with your smaller/higher NavBar.


If there are some question, ask in this thread, I´ll help you as good as possible. Please don´t write me PM´s with support requests.


The "small-print":
Neither XDA-Developers.com, nor me are responible for any damages on your device!
 
Last edited:

NoLunchBox_

Senior Member
May 17, 2011
285
105
0
Boston
I'm pretty sure this is the same for changing your Navigation Bar white or any color you want?

But instead I think its the navbar.xml that you need to edit correct?

Sent from my Nexus 4 using xda app-developers app
 

350d

Senior Member
Jan 17, 2011
270
15
0
Hello,
In this tutorial I´ll show you how to change the height of your NavBar.

This Tutorial works for any Rom!

Requirements
  • Text-Editor, e.g. Notepad++
  • WinRar/WinZip/Bandzip
  • Apktool (Download)
  • installed Java (Download)
  • JDK (Download)
  • root on your Nexus 4
  • a FileManager like ES File Explorer or Root Explorer
  • your framework-res.apk
  • some Cmd experience (just a little)
  • .. and some time/nerves

.. let´s go

Before getting started, make a Nandroid Backup (if you get Bootoop etc)!

The decompliling:

First you need to create a new folder like "C:\apktool". Download Apktool and extract the files to C:\apktool
  • copy your framework-res.apk to C:\apktool
  • open Cmd
  • navigate to your apktool (with "cd C:\apktool")
  • type in: java -jar apktool.jar if framework-res.apk [enter] (...installation of your framework)
  • type in: java -jar apktool.jar d framework-res.apk [enter]
  • finished!

Now you should have a new folder named framework-res. That´s your decompiled framework-res.apk.


The customizing of your NavBar height:
  • Navigate to /res/values
  • open dimens.xml in your Text-Editor
  • search the 3 lines which include navigation_bar_height, navigation_bar_height_landscape, und navigation_bar_width
  • type in your desired dpi number (for default it´s 48dpi)
  • CAUTION: At width, you should calculate the numeral proportion of the height to the width.
  • If you got that, save!

The (Re-)compiling:
  • Cmd (if you have not left it open, you must navigate again to C:\apktool
  • type in: java -jar apktool.jar b framework-res [enter]
  • The newly compiled framework-res.apk is located in C:\apktool\framework-res\dist
  • CAUTION: Copy the META-INF folder and the AndroidManifest.xml from your old framework-res.apk to your newly compiled one! Otherwise you´ll get Bootloop.

Now copy your framework-res.apk with a file manager to /system/framework. After that reboot immediately!

Finished! Have fun with your smaller/higher NavBar.


If there are some question, ask in this thread, I´ll help you as good as possible. Please don´t write me PM´s with support requests.


The "small-print":
Neither XDA-Developers.com, nor me are responible for any damages on your device!
Thanks dude!

"CAUTION: At width, you should calculate the numeral proportion of the height to the width."

What's the scale? I set 36dpi both on height and landsape_hight, what's the width should I do? And I want the background of navigation to more smaller...
 
Last edited:

Flextrick

Senior Member
May 14, 2012
1,161
2,235
0
First of all, please delete fullquote :) Second: Proportion is like 48:42=36:x (x is width, just calculate). And third: Which background do you mean?

~ via Nexus
 
Last edited:

paperecho

Senior Member
May 22, 2010
352
55
48
I am attempting this but its not working.

I have apktool, java, and JDK installed.

When I run the commands I get this...

Code:
 c:\apktool>java -jar apktool.jar if framework-res.apk
Exception in thread "main" brut.androlib.AndrolibException: Multiple resources:
spec=0x01080294 drawable/ic_ab_back_holo_dark, config=-xhdpi
        at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:65)
        at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:58)
        at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:196)

        at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:165
)
        at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:130)
        at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:10
5)
        at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:82)
        at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:48)
        at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:39)
        at brut.androlib.res.AndrolibResources.installFramework(AndrolibResource
s.java:384)
        at brut.androlib.Androlib.installFramework(Androlib.java:365)
        at brut.apktool.Main.cmdInstallFramework(Main.java:193)
        at brut.apktool.Main.main(Main.java:69)

c:\apktool>java -jar apktool.jar d framework-res.apk
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Multiple resources:
spec=0x01080294 drawable/ic_ab_back_holo_dark, config=-xhdpi
        at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:65)
        at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:58)
        at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:196)

        at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:165
)
        at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:130)
        at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:10
5)
        at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:82)
        at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:48)
        at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibRes
ources.java:315)
        at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.jav
a:50)
        at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.jav
a:43)
        at brut.androlib.Androlib.getResTable(Androlib.java:44)
        at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:148)
        at brut.androlib.ApkDecoder.decode(ApkDecoder.java:98)
        at brut.apktool.Main.cmdDecode(Main.java:128)
        at brut.apktool.Main.main(Main.java:65)

c:\apktool>
Any help would be great.

Or if someone wants to set my dpi to 24 that would be great as well. 24/24/24

framework-res.apk
 

InflexibIe

Member
Nov 1, 2011
11
5
0
Is it possible to set the alignment of the softkeys to the left side (especially for the Nexus 7/10)?

Thanks in advance

Sent from my Nexus 4 using xda premium
 

Flextrick

Senior Member
May 14, 2012
1,161
2,235
0
Maybe you guys should download the newest apktool version and replace it with the one in my folder. I think this should solve your problem
 

endleesss

Senior Member
Feb 19, 2011
117
15
0
Does anyone know what values they use to make the softkeys stay vertical when the phone is in landscape mode? I'm trying to do that with my tablets. Thanks