Enable/Resize NavigationBar for Android>=4

m11kkaa

Recognized Developer / Inactive Recognized Contrib
Jan 20, 2011
1,259
2,145
0
I wrote an script to enable NavigationBar and to change it's size.
Everything started in Defy-Forum:
http://forum.xda-developers.com/showthread.php?t=1495002

Requirements:
- Python
- some console-knowledge
- adb will be useful to push/pull framework-res.apk but you can copy it via sdcard and rootexplorer if you prefer that

Source/Download:
https://github.com/M1cha/android_navbarenabler

Usage:
usage: patch-framework.py [-h] [-d] [-w WIDTH] [-s HEIGHT] [-sl HEIGHT_LANDSCAPE] framework frameworkNew

enable/disable NavigationBar and change their size.

positional arguments:
framework
frameworkNew

optional arguments:
-h, --help show this help message and exit
-d Disable NavigationBar instead of enabling
-w WIDTH Set NavigationBar-width to WIDTH
-s HEIGHT Set NavigationBar-height to HEIGHT
-sl HEIGHT_LANDSCAPE Set NavigationBar-height to HEIGHT_LANDSCAPE
 
Last edited:

marhensa

Senior Member
Dec 17, 2010
2,017
1,174
0
Bogor

DONE.. AWESOME.. :D
Code:
[FONT="Courier New"]patch-framework.py -w ??.?dip -s ??.?dip -sl ??.?dip framework-res.apk framework-res_edit.apk[/FONT]

but.. and um...
small problem here
on windows, using phyton 2.7 (phyton 2.7 which packed from ArcGIS, a mapping software)
inside new patched framework apk, you forgot to rename the files and folder?


it should be: assets, meta-inf, res, resources.arsc, androidmanifest.xml right?

maybe it's windows problem thing..
i'll inform you later it's booting or not.
 
Last edited:
  • Like
Reactions: AlexGraves

ktmbikerman

Senior Member
May 7, 2011
1,990
656
0
51
Cape Town
I've flashed marhensa's patch for the latest quarx CM10 build and it looks great... only problem is the buttons are very small, is there an easy way of playing with the button size in the zip?
 

marhensa

Senior Member
Dec 17, 2010
2,017
1,174
0
Bogor
I've flashed marhensa's patch for the latest quarx CM10 build and it looks great... only problem is the buttons are very small, is there an easy way of playing with the button size in the zip?
yes, the purpose of this m11kkaa phyton script is to make custom size of navigation bar much easier.

but if you can live with big default navigation bar (like 10% of the screen)
you just could simply add this line to the build.prop (credits to m11kkaa which found it)
qemu.hw.mainkeys=0
then flash the revert zip I give to get the default height value.

Sent from TapaTalk | MotoDEFY - Android Jelly Bean 4.1.1
 
  • Like
Reactions: ktmbikerman

ktmbikerman

Senior Member
May 7, 2011
1,990
656
0
51
Cape Town
yes, the purpose of this m11kkaa phyton script is to make custom size of navigation bar much easier.

but if you can live with big default navigation bar (like 10% of the screen)
you just could simply add this line to the build.prop (credits to m11kkaa which found it)
qemu.hw.mainkeys=0
then flash the revert zip I give to get the default height value.

Sent from TapaTalk | MotoDEFY - Android Jelly Bean 4.1.1
Thanks, thats much better... I must have big fingers :)
 

moflolo

Member
Sep 15, 2011
17
9
0
After some debugging I got the script working for my Nexus 4 and Android 4.2.2

First thing: You need apktool.jar in the same directory as the script. It can be downloaded from http://code.google.com/p/android-apktool/
Maybe you should mention it in your description.

Then I had to modify the script a little bit. I dont know if its new in the new android versions or you just forgot it ;)
In the lines where you change the entries for dimes.xml you wrote
Code:
<dimen name=navigation_bar_height_landscape>"+size+"</dimen>
but for android 4.2.2 it seems like it has to be
Code:
<dimen name=navigation_bar_height_landscape>"+size+"dip</dimen>
Then it worked fine. Thank you for the script!

Btw: I attached the modified script for those you dont know how to do it on your own :)
 

Attachments

Last edited:
  • Like
Reactions: S0bes

m11kkaa

Recognized Developer / Inactive Recognized Contrib
Jan 20, 2011
1,259
2,145
0
Re: Enable/Resize NavigationBar for Android&gt;=4

I did not forget it. You have to specify the unit via console parameter.

Sent from my MI 2 using xda app-developers app