1

I have a China-branded tablet running Android 4.2. The tablet has the "new" Jellybean 4.2 home screen button layout where the software buttons are centered on the screen, rather than aligned left as in common desktop operating systems such as Windows and Linux (with the KDE or Gnome 2 desktop).

The problem is that the button layout in my tablet differs in a slight, but annoying way from the Android 4.2 default, which is to put the home button at center, surrounded by the back button at the left and the recent apps button at the right. Instead, my tablet has the home button displaced one position left of center, which is occupied by the recent apps button followed by the two volume buttons (down/up).

Is there a way to edit the layout/order of the software buttons of the Android home screen? My ideal would be this sequence: volume down, back, home, recent apps, volume up. (Such a layout would retain the volume buttons, while keeping the home button in the familiar center slot.)

I know that Cyanogenmod has a settings tab precisely for fixing this problem. However there's no Cyanogenmod port for my tablet, its main saving grace being that it comes "pre-rooted", which allows me in theory to mess with any system settings if only I knew how.

  • 1
    I don't think there's a setting for this, so you'd have to replace the System UI (which is a system app, effectively) with a new one that has the behaviour you want. – Dan Hulme Aug 12 '13 at 8:05
1

The comment above about replacing System UI is correct. However there's a hack that overlays Android's built-in navigation bar with a "customizable navbar-like panel". The real navbar is hidden but still exists.

If you're still interested in a hard fix you need to unpack, modify and repack SystemUI.apk. This can be done using the apktool utility, which unzips the apk in editable form. In the resulting file tree, look for and edit res/layout/system_bar.xml using a plain text editor. Add the keymap and icons for volume control:

<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/sub" android:layout_width="@dimen/navigation_key_width" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_volume_down" systemui:keyCode="25" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/add" android:layout_width="@dimen/navigation_key_width" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_volume_up" systemui:keyCode="24" systemui:glowBackground="@drawable/ic_sysbar_highlight" />

The exact placement of the code probably depends on the customization done by the ROM vendor. But a likely spot is to search and place it after the line that contains the text "android:src="@drawable/ic_sysbar_recent".

After inserting the references, you need to copy the icons themselves to the right folder:

res/drawable-mdpi/ic_sysbar_volume_down.png
res/drawable-mdpi/ic_sysbar_volume_up_land.png
res/drawable-mdpi/ic_sysbar_volume_down_land.png
res/drawable-mdpi/ic_sysbar_volume_up.png

The final step is to repack the edited system_bar.xml and new icons along with the rest of the unpacked SystemUI.apk.

I'm sure my instructions are incomplete. So remember to keep a good (and tested) backup and recovery tool at hand before attempting to install your hacked apk!

  • Whoops. Stupidly failed to read that you just want to rearrange the navbar icons not create new ones. In which case just rearrange the lines containing @drawable/ic_sysbar_back, @drawable/ic_sysbar_home, @drawable/ic_sysbar_recent, @drawable/ic_sysbar_volume_down, @drawable/ic_sysbar_volume_up and ignore the part about copying icons to the right folder. – rootuser Sep 17 '13 at 1:52
  • Why don't you modify your answer, based on your comments? That would be better than posting it as a comment. :) – geffchang Sep 17 '13 at 3:09
0

See this article

With USB debugging enabled and adb installed on a connected computer, run

adb shell settings put secure sysui_nav_bar "space,recent;home;back,space"

Note: On my device, with ADB from Windows, I had to run adb shell seperately and then run settings put secure sysui_nav_bar "space,recent;home;back,space" due to quoting issues.

The article gives details on adding custom buttons.

You might be able to read out the settings from your device with the desired configuration using

adb shell settings get secure sysui_nav_bar # Some devices gives "null"

Both devices need to run Android >= 4.2

  • (Volume buttons can be done with the custom buttons, the question in the title ask about layout changes, so I'm leaving additional buttons to the link) – Gert van den Berg Nov 6 '18 at 8:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.