Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

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

OP evilisto

15th March 2012, 04:00 PM   |  #1  
evilisto's Avatar
OP Senior Member
Thanks Meter: 2,349
 
486 posts
Join Date:Joined: Nov 2010
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.
Last edited by evilisto; 21st March 2012 at 08:42 PM.
The Following 23 Users Say Thank You to evilisto For This Useful Post: [ View ]
15th March 2012, 04:30 PM   |  #2  
Senior Member
Thanks Meter: 82
 
375 posts
Join Date:Joined: 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
16th March 2012, 07:37 AM   |  #3  
Member
Flag Chengdu
Thanks Meter: 5
 
33 posts
Join Date:Joined: Jul 2011
More
It is very beautiful, thank you for your doing!

Sent from my MotoA953
16th March 2012, 08:10 PM   |  #4  
rashid.fairus's Avatar
Senior Member
Flag Klang
Thanks Meter: 232
 
1,065 posts
Join Date:Joined: Dec 2011
More
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
17th March 2012, 06:14 PM   |  #5  
Member
Flag Orlando fl
Thanks Meter: 3
 
48 posts
Join Date:Joined: Oct 2011
More
Just flashed this and it seems to be working fine on the LG optimus v.
17th March 2012, 11:50 PM   |  #6  
Senior Member
Flag Zuidhorn (Groningen)
Thanks Meter: 76
 
158 posts
Join Date:Joined: Jan 2012
More
Where can I find the .java file in SystemUI.apk?
I want to include that in my own update.zip
18th March 2012, 08:19 AM   |  #7  
evilisto's Avatar
OP Senior Member
Thanks Meter: 2,349
 
486 posts
Join Date:Joined: Nov 2010
Quote:
Originally Posted by F.West98

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
18th March 2012, 03:36 PM   |  #8  
Senior Member
Flag Zuidhorn (Groningen)
Thanks Meter: 76
 
158 posts
Join Date:Joined: Jan 2012
More
What to do with that file?
I don't know exactly, it's my first own mod
18th March 2012, 05:25 PM   |  #9  
evilisto's Avatar
OP Senior Member
Thanks Meter: 2,349
 
486 posts
Join Date:Joined: Nov 2010
Quote:
Originally Posted by F.West98

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..
The Following User Says Thank You to evilisto For This Useful Post: [ View ]
18th March 2012, 05:44 PM   |  #10  
Senior Member
Flag Zuidhorn (Groningen)
Thanks Meter: 76
 
158 posts
Join Date:Joined: Jan 2012
More
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...)
Last edited by F.West98; 18th March 2012 at 05:55 PM.

Post Reply Subscribe to Thread

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

Advanced Search
Display Modes