5,599,190 Members 35,264 Now Online
XDA Developers Android and Mobile Development Forum

[HOWTO] Add ICS 'Recent Apps' button (or other softkeys) to Status bar

Tip us?
 
evilisto
Old
(Last edited by evilisto; 21st March 2012 at 07:42 PM.)
#1  
evilisto's Avatar
Senior Member - OP
Thanks Meter 2333
Posts: 486
Join Date: Nov 2010
Default [HOWTO] Add ICS 'Recent Apps' button (or other softkeys) to Status bar

Preview :






this mod is originally posted in nexus s forum.

[MOD] Add ICS 'Recent Apps' button to Status bar

i added just 'recent apps' button only but you can add other buttons what you want. like this :




anyway, if you want to add 'recent apps' button..

1) fix "APP_SWITCH" keycode to call ICS Recent Apps dialog.
- basically, same process to this mod : [HOWTO] Remap hardware button to ICS recent apps

platform/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

from :
Code:
        } else if (keyCode == KeyEvent.KEYCODE_APP_SWITCH) {
            if (down && repeatCount == 0) {
                showOrHideRecentAppsDialog(RECENT_APPS_BEHAVIOR_SHOW_OR_DISMISS);
            }
            return -1;
        }

to :
Code:
        } else if (keyCode == KeyEvent.KEYCODE_APP_SWITCH) {
            if (down && repeatCount == 0 && !keyguardOn) {
            try {
                mStatusBarService.toggleRecentApps();
            } catch (RemoteException e) {
                Slog.e(TAG, "RemoteException when showing recent apps", e);
            }
        }
            return -1;
        }

2) modifiy Expanded Status bar layout

- decompile SystemUI.apk -> /res/layout/status_bar_expanded.xml
..or..
- platform/frameworks/base/packages/SystemUI/res/layout/status_bar_expanded.xml


from :

Code:
    <RelativeLayout android:background="@drawable/notification_header_bg" android:paddingTop="3.0dip" android:paddingRight="3.0dip" android:paddingBottom="5.0dip" android:layout_width="fill_parent" android:layout_height="52.0dip">
        <com.android.systemui.statusbar.policy.DateView android:textAppearance="@style/TextAppearance.StatusBar.Date" android:gravity="left|center" android:id="@id/date" android:paddingLeft="16.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_alignParentLeft="true" />
        <ImageView android:id="@id/settings_button" android:paddingLeft="8.0dip" android:paddingRight="8.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/ic_notify_quicksettings" android:layout_toRightOf="@id/date" android:contentDescription="@string/accessibility_settings_button" />
        <ImageView android:id="@id/clear_all_button" android:paddingLeft="8.0dip" android:paddingRight="8.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/ic_notify_clear" android:layout_alignParentRight="true" android:contentDescription="@string/accessibility_clear_all" />
    </RelativeLayout>
to :

Code:
    <RelativeLayout android:background="@drawable/notification_header_bg" android:paddingTop="3.0dip" android:paddingRight="3.0dip" android:paddingBottom="5.0dip" android:layout_width="fill_parent" android:layout_height="52.0dip">
        <com.android.systemui.statusbar.policy.DateView android:textAppearance="@style/TextAppearance.StatusBar.Date" android:gravity="left|center" android:id="@id/date" android:paddingLeft="16.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_alignParentLeft="true" />
        <ImageView android:id="@id/settings_button" android:paddingLeft="8.0dip" android:paddingRight="4.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/ic_notify_quicksettings" android:layout_toRightOf="@id/date" android:contentDescription="@string/accessibility_settings_button" />
        <com.android.systemui.statusbar.policy.KeyButtonView android:paddingLeft="4.0dip" android:paddingRight="4.0dip" android:id="@id/recent_apps" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_recent" android:layout_toRightOf="@id/settings_button" android:contentDescription="@string/accessibility_recent" systemui:keyCode="187" systemui:glowBackground="@drawable/ic_sysbar_highlight" />
        <ImageView android:id="@id/clear_all_button" android:paddingLeft="8.0dip" android:paddingRight="8.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/ic_notify_clear" android:layout_alignParentRight="true" android:contentDescription="@string/accessibility_clear_all" />
    </RelativeLayout>

3) you'd better replace /res/drawable-****/ic_sysbar_recent.png with smaller one...
mine(in above preview - for hdpi) is here : http://www.mediafire.com/?qxy9l1emmeofa4s


-----------------------------------------------------------------------------

and caution
- when i tested this on stock rom, search button works only when long pressed (=voice search).
- adding some kind of button like menu or back is meaningless.. (surely)
- and at least on my phone(nexus s), ICS blue(#33b1e1) doesn't look same color to date and quick settings button.. (don't know why)
- and do not use this mod with tablet ui or onscreen softkeys mod.

- and if you cannot compile android.policy.jar for some reason, try with my files instead.
you can find my files in these thread :
[MOD] Search key to ICS recent apps
[MOD] Add ICS 'Recent Apps' button to Status bar
and be careful. you should use suitable version to your rom. so if your cm9 rom was built few weeks ago, do not try with latest version of my mod.
| Google+ |
The Following 23 Users Say Thank You to evilisto For This Useful Post: [ Click to Expand ]
 
pdppdp
Old
#2  
Senior Member
Thanks Meter 78
Posts: 379
Join Date: Feb 2011
I've been looking for this quite a while because my homebutton doesn't work that good anymore.
I'm running a Samsung galaxy s with teamhacksung ICS build 17.
Is there any chance you could make a flashable zip for this because I have absolutely no clue in coding. I'm just consuming these incredible things here on xda
 
ylqiu
Old
#3  
Member
Thanks Meter 5
Posts: 33
Join Date: Jul 2011
Location: Chengdu
It is very beautiful, thank you for your doing!

Sent from my MotoA953
 
rashid.fairus
Old
#4  
rashid.fairus's Avatar
Senior Member
Thanks Meter 229
Posts: 1,057
Join Date: Dec 2011
Location: Klang
I read all post from nexus because I'm using cm9 and they have made wonderful mod for it,but no guide at all,but you're really awesome because you made a guide and was really helping me port it to my phone,thanks!!!

from the ARC
 
chucksaysblah
Old
#5  
Member
Thanks Meter 3
Posts: 45
Join Date: Oct 2011
Location: Orlando fl
Just flashed this and it seems to be working fine on the LG optimus v.
 
F.West98
Old
#6  
Senior Member
Thanks Meter 76
Posts: 153
Join Date: Jan 2012
Location: Zuidhorn (Groningen)
Where can I find the .java file in SystemUI.apk?
I want to include that in my own update.zip
 
evilisto
Old
#7  
evilisto's Avatar
Senior Member - OP
Thanks Meter 2333
Posts: 486
Join Date: Nov 2010
Quote:
Originally Posted by F.West98 View Post
Where can I find the .java file in SystemUI.apk?
I want to include that in my own update.zip
sorry but you have to compile from source code..
https://github.com/android/platform_...owManager.java
| Google+ |
 
F.West98
Old
#8  
Senior Member
Thanks Meter 76
Posts: 153
Join Date: Jan 2012
Location: Zuidhorn (Groningen)
What to do with that file?
I don't know exactly, it's my first own mod
 
evilisto
Old
#9  
evilisto's Avatar
Senior Member - OP
Thanks Meter 2333
Posts: 486
Join Date: Nov 2010
Quote:
Originally Posted by F.West98 View Post
What to do with that file?
I don't know exactly, it's my first own mod
apply above fix related to "APP_SWITCH" keycode and compile android.policy.jar.
you have to download entire ics source code to compile this..

maybe same thing can be done simply by smali editing but sorry, i don't know how..
| Google+ |
The Following User Says Thank You to evilisto For This Useful Post: [ Click to Expand ]
 
F.West98
Old
(Last edited by F.West98; 18th March 2012 at 04:55 PM.)
#10  
Senior Member
Thanks Meter 76
Posts: 153
Join Date: Jan 2012
Location: Zuidhorn (Groningen)
But then it isn't CM9 anymore, is it?
Can't I download only the needed files from Github? And how to make it flashable?

Ah I understand something
I can place the .jar file (compiled) into the folder 'frameworks' in my flashable zip, there is also an apk (framework-res)
I have to download the complete source code and I only have to change the file (.java), which I compile as the .jar

Correct?
(but why do I need the whole source code, I'm on Windows...)

Tags
ics recent softkeys multitask statusbar
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes