[Android Themes] Adi Aisiteru Reborn:
How to add samsung clear all button, google launch button , task manager button,

HOW TO ADD SAMSUNG

CLEAR ALL RECENT APPS BUTTON, GOOGLE LAUNCH BUTTON , TASK MANAGER BUTTON, IN RECENT PANEL

STEP -1

- Decompile your SystemUI.apk

- Download attached ClearAll-SystemUI.apk.zip, exstract it and merge it to you decompiled SystemUI.apk

- SystemUI.apk/res/layout/status_bar_recent_panel.xml

add the red line

<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.recent.RecentsPanelView android:id="@id/recents_root" android:layout_width="fill_parent" android:layout_height="fill_parent" systemui:recentItemLayout="@layout/status_bar_recent_item"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
<FrameLayout android:id="@id/recents_bg_protect" android:background="@drawable/status_bar_recents_background" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentBottom="true">
<com.android.systemui.recent.RecentsVerticalScrollView android:layout_gravity="bottom|left|center" android:id="@id/recents_container" android:scrollbars="none" android:fadingEdge="vertical" android:fadingEdgeLength="@dimen/status_bar_recents_scroll_fading_edge_length" android:clipChildren="false" android:clipToPadding="false" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginRight="0.0dip" android:stackFromBottom="true" android:divider="@null">
<LinearLayout android:orientation="vertical" android:id="@id/recents_linear_layout" android:clipChildren="false" android:clipToPadding="false" android:layout_width="fill_parent" android:layout_height="wrap_content" />
</com.android.systemui.recent.RecentsVerticalScrollView>
<LinearLayout android:layout_gravity="top" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="5.0dip">
<TextView android:textColor="@*android:color/holo_blue_dark" android:layout_gravity="center" android:id="@id/recents_memory_text" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ProgressBar android:id="@id/recents_memory_bar" android:paddingLeft="4.0dip" android:paddingRight="4.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="@*android:dimen/preference_fragment_padding_side" android:layout_marginRight="@*android:dimen/preference_fragment_padding_side" style="?android:attr/progressBarStyleHorizontal" />
</LinearLayout>
[COLOR="Red"]<LinearLayout android:layout_gravity="bottom" android:orientation="horizontal" android:background="@drawable/tw_ab_bottom_transparent_dark_holo" android:layout_width="fill_parent" android:layout_height="45.0dip" android:layout_weight="1.0">
<ImageButton android:id="@id/asteroid_recents_task_manager_button" android:background="@drawable/tw_recent_panel_button_forphone" android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@drawable/tw_recent_panel_ic_task_manager_holo_dark" android:layout_weight="1.0" android:contentDescription="@string/status_bar_recent_launch_task_manager_title" style="?android:attr/buttonStyle" />
<LinearLayout android:layout_gravity="center_vertical" android:background="@drawable/tw_divider_vertical_holo_dark" android:layout_width="1.0dip" android:layout_height="29.0dip" />
<ImageButton android:id="@id/asteroid_recents_google_button" android:background="@drawable/tw_recent_panel_button_forphone" android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@drawable/tw_recent_panel_ic_google_holo_dark" android:layout_weight="1.0" android:contentDescription="@string/status_bar_recent_launch_google_button" style="?android:attr/buttonStyle" />
<LinearLayout android:layout_gravity="center_vertical" android:background="@drawable/tw_divider_vertical_holo_dark" android:layout_width="1.0dip" android:layout_height="29.0dip" />
<ImageButton android:id="@id/asteroid_recents_clear_all_button" android:background="@drawable/tw_recent_panel_button_forphone" android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@drawable/tw_recent_panel_ic_delete_holo_dark" android:layout_weight="1.0" android:contentDescription="@string/status_bar_recent_remove_all_button" style="?android:attr/buttonStyle" />
</LinearLayout>[/COLOR]
</FrameLayout>
<include android:id="@id/recents_no_apps" android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="fill_parent" layout="@layout/status_bar_no_recent_apps" />
</com.android.systemui.recent.RecentsPanelView>

- SystemUI.apk/res/layout-land/status_bar_recent_panel.xml

add the red line

<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.recent.RecentsPanelView android:id="@id/recents_root" android:layout_width="fill_parent" android:layout_height="fill_parent" systemui:recentItemLayout="@layout/status_bar_recent_item"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
<FrameLayout android:id="@id/recents_bg_protect" android:background="@drawable/status_bar_recents_background" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentBottom="true">
<com.android.systemui.recent.RecentsHorizontalScrollView android:layout_gravity="right" android:id="@id/recents_container" android:scrollbars="none" android:fadingEdge="horizontal" android:fadingEdgeLength="@dimen/status_bar_recents_scroll_fading_edge_length" android:clipChildren="false" android:clipToPadding="false" android:layout_width="wrap_content" android:layout_height="fill_parent">
<LinearLayout android:orientation="horizontal" android:id="@id/recents_linear_layout" android:clipChildren="false" android:clipToPadding="false" android:layout_width="wrap_content" android:layout_height="fill_parent" />
</com.android.systemui.recent.RecentsHorizontalScrollView>
<LinearLayout android:layout_gravity="top" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="5.0dip">
<TextView android:textColor="@*android:color/holo_blue_dark" android:layout_gravity="center" android:id="@id/recents_memory_text" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ProgressBar android:id="@id/recents_memory_bar" android:paddingLeft="4.0dip" android:paddingRight="4.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="@*android:dimen/preference_fragment_padding_side" android:layout_marginRight="@*android:dimen/preference_fragment_padding_side" style="?android:attr/progressBarStyleHorizontal" />
</LinearLayout>
[COLOR="Red"]<LinearLayout android:layout_gravity="bottom" android:orientation="horizontal" android:background="@drawable/tw_ab_bottom_transparent_dark_holo" android:layout_width="fill_parent" android:layout_height="45.0dip" android:layout_weight="1.0">
<ImageButton android:id="@id/asteroid_recents_task_manager_button" android:background="@drawable/tw_recent_panel_button_forphone" android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@drawable/tw_recent_panel_ic_task_manager_holo_dark" android:layout_weight="1.0" android:contentDescription="@string/status_bar_recent_launch_task_manager_title" style="?android:attr/buttonStyle" />
<LinearLayout android:layout_gravity="center_vertical" android:background="@drawable/tw_divider_vertical_holo_dark" android:layout_width="1.0dip" android:layout_height="29.0dip" />
<ImageButton android:id="@id/asteroid_recents_google_button" android:background="@drawable/tw_recent_panel_button_forphone" android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@drawable/tw_recent_panel_ic_google_holo_dark" android:layout_weight="1.0" android:contentDescription="@string/status_bar_recent_launch_google_button" style="?android:attr/buttonStyle" />
<LinearLayout android:layout_gravity="center_vertical" android:background="@drawable/tw_divider_vertical_holo_dark" android:layout_width="1.0dip" android:layout_height="29.0dip" />
<ImageButton android:id="@id/asteroid_recents_clear_all_button" android:background="@drawable/tw_recent_panel_button_forphone" android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@drawable/tw_recent_panel_ic_delete_holo_dark" android:layout_weight="1.0" android:contentDescription="@string/status_bar_recent_remove_all_button" style="?android:attr/buttonStyle" />
</LinearLayout>[/COLOR]
</FrameLayout>
<include android:id="@id/recents_no_apps" android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="fill_parent" layout="@layout/status_bar_no_recent_apps" />
</com.android.systemui.recent.RecentsPanelView>

- SystemUI.apk/res/values/ids.xml

add the red line to end of it before </resources>

<item type="id" name="recents_memory_bar">false</item>
<item type="id" name="recents_memory_text">false</item>
[COLOR="Red"]<item type="id" name="asteroid_recents_task_manager_button">false</item>
<item type="id" name="asteroid_recents_google_button">false</item>
<item type="id" name="asteroid_recents_clear_all_button">false</item>[/COLOR]
</resources>

- SystemUI.apk/res/values/strings.xml

add the red line to end of it before </resources>

<string name="status_bar_help_text">"Access them anytime by swiping down.
Swipe down again for system controls."</string>
<string name="shutdown_prompt_title">Shutdown</string>
<string name="shutdown_prompt_message">Low battery and then will be auto shutdown</string>
<string name="shutdown_prompt_message_before">Low battery ! Your phone will shutdown in</string>
<string name="shutdown_prompt_message_after">seconds</string>
[COLOR="Red"]<string name="status_bar_recent_launch_task_manager_title">Task manager</string>
<string name="status_bar_recent_launch_google_button">Google</string>
<string name="status_bar_recent_remove_all_button">Remove all</string>[/COLOR]
</resources>

- Recompile your SystemUI.apk

STEP - 2

- Decompile the newly Recompiled APK again

Next go to

res/values/public.xml

open it with Notepad++

leave it, but keep it open

- SystemUI.apk/smali/com/android/systemui/recent/RecentsPanelView.smali

add the red line

# instance fields
.field private mAnimateIconOfFirstTask:Z

.field private mFitThumbnailToXY:Z

[COLOR="Red"].field private mGoogleButton:Landroid/widget/ImageButton;[/COLOR]

.field private mHighEndGfx:Z

.end annotation
.end field

.field private mRecentTasksLoader:Lcom/android/systemui/recent/RecentTasksLoader;

[COLOR="Red"].field private mRecentsClearAllButton:Landroid/widget/ImageButton;[/COLOR]

.field private mRecentsContainer:Landroid/view/ViewGroup;

.field private mRecentsNoApps:Landroid/view/View;

.field private mRecentsScrim:Landroid/view/View;

.field private mShowing:Z

.field private mStatusBarTouchProxy:Lcom/android/systemui/recent/StatusBarTouchProxy;

[COLOR="Red"].field private mTaskManagerButton:Landroid/widget/ImageButton;[/COLOR]

.field private mThumbnailWidth:I

.field private mWaitingForWindowAnimation:Z

iput v1, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRecentItemLayoutId:I

.line 267
invoke-static {p1}, Lcom/android/systemui/recent/RecentTasksLoader;->getInstance(Landroid/content/Context;)Lcom/android/systemui/recent/RecentTasksLoader;

move-result-object v1

iput-object v1, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRecentTasksLoader:Lcom/android/systemui/recent/RecentTasksLoader;

.line 268
invoke-virtual {v0}, Landroid/content/res/TypedArray;->recycle()V

.line 269
return-void
.end method

[COLOR="Red"].method private AsteroidClearAllRecentApps()V
.locals 8

.prologue
const/4 v7, 0x1

const/4 v6, 0x0

iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mContext:Landroid/content/Context;

const-string v1, "activity"

invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

move-result-object v0

check-cast v0, Landroid/app/ActivityManager;

iget-object v1, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRecentTaskDescriptions:Ljava/util/ArrayList;

invoke-virtual {v1}, Ljava/util/ArrayList;->isEmpty()Z

move-result v1

if-nez v1, :cond_1

iget-object v1, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRecentTaskDescriptions:Ljava/util/ArrayList;

invoke-virtual {v1}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

move-result-object v2

:goto_0
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

move-result v1

if-eqz v1, :cond_0

invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

move-result-object v1

check-cast v1, Lcom/android/systemui/recent/TaskDescription;

iget v3, v1, Lcom/android/systemui/recent/TaskDescription;->persistentTaskId:I

invoke-virtual {v0, v3, v7}, Landroid/app/ActivityManager;->removeTask(II)Z

iget-object v3, p0, Lcom/android/systemui/recent/RecentsPanelView;->mContext:Landroid/content/Context;

const v4, [COLOR="Blue"]0x7f0b00a5[/COLOR]

new-array v5, v7, [Ljava/lang/Object;

invoke-virtual {v1}, Lcom/android/systemui/recent/TaskDescription;->getLabel()Ljava/lang/CharSequence;

move-result-object v1

aput-object v1, v5, v6

invoke-virtual {v3, v4, v5}, Landroid/content/Context;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

move-result-object v1

invoke-virtual {p0, v1}, Lcom/android/systemui/recent/RecentsPanelView;->setContentDescription(Ljava/lang/CharSequence;)V

const/4 v1, 0x4

invoke-virtual {p0, v1}, Lcom/android/systemui/recent/RecentsPanelView;->sendAccessibilityEvent(I)V

const/4 v1, 0x0

invoke-virtual {p0, v1}, Lcom/android/systemui/recent/RecentsPanelView;->setContentDescription(Ljava/lang/CharSequence;)V

goto :goto_0

:cond_0
iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRecentTaskDescriptions:Ljava/util/ArrayList;

invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V

:cond_1
invoke-virtual {p0}, Lcom/android/systemui/recent/RecentsPanelView;->dismissAndGoBack()V

return-void
.end method

.method static synthetic access$177777700(Lcom/android/systemui/recent/RecentsPanelView;)V
.locals 0
.parameter "x0"

.prologue
.line 75
invoke-direct {p0}, Lcom/android/systemui/recent/RecentsPanelView;->AsteroidClearAllRecentApps()V

return-void
.end method[/COLOR]

.method static synthetic access$000(Lcom/android/systemui/recent/RecentsPanelView;)Ljava/util/ArrayList;
.locals 1
.parameter "x0"

.prologue
.line 73
iget-object v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRecentTaskDescriptions:Ljava/util/ArrayList;

return-object v0
.end method

.method static synthetic access$100(Lcom/android/systemui/recent/RecentsPanelView;)I
.locals 1
.parameter "x0"

.prologue
.line 73
iget v0, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRecentItemLayoutId:I

Change this 0x7f0b00a5

with the IDS value you got in your public.xml

<public type="string" name="accessibility_recents_item_dismissed" id="[COLOR="Blue"]0x7f??????[/COLOR]" />

NEXT

find this method

.method protected onFinishInflate()V

scroll down in that method and add the red codes above return-void

invoke-virtual {v1, v2}, Landroid/view/View;->setBackground(Landroid/graphics/drawable/Drawable;)V

.line 488
:cond_0
:goto_0
[COLOR="Red"]const v1, [COLOR="Blue"]0x7f08012e[/COLOR]

invoke-virtual {p0, v1}, Lcom/android/systemui/recent/RecentsPanelView;->findViewById(I)Landroid/view/View;

move-result-object v1

check-cast v1, Landroid/widget/ImageButton;

iput-object v1, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRecentsClearAllButton:Landroid/widget/ImageButton;

.line 499
iget-object v1, p0, Lcom/android/systemui/recent/RecentsPanelView;->mRecentsClearAllButton:Landroid/widget/ImageButton;

new-instance v2, Lcom/android/systemui/recent/RecentsPanelView$AsteroidClearAll;

invoke-direct {v2, p0}, Lcom/android/systemui/recent/RecentsPanelView$AsteroidClearAll;-><init>(Lcom/android/systemui/recent/RecentsPanelView;)V

invoke-virtual {v1, v2}, Landroid/widget/ImageButton;->setOnClickListener(Landroid/view/View$OnClickListener;)V

const v1, [COLOR="Blue"]0x7f08012c[/COLOR]

invoke-virtual {p0, v1}, Lcom/android/systemui/recent/RecentsPanelView;->findViewById(I)Landroid/view/View;

move-result-object v1

check-cast v1, Landroid/widget/ImageButton;

iput-object v1, p0, Lcom/android/systemui/recent/RecentsPanelView;->mTaskManagerButton:Landroid/widget/ImageButton;

iget-object v1, p0, Lcom/android/systemui/recent/RecentsPanelView;->mTaskManagerButton:Landroid/widget/ImageButton;

new-instance v2, Lcom/android/systemui/recent/RecentsPanelView$AsteroidTaskManagerHelper;

invoke-direct {v2, p0}, Lcom/android/systemui/recent/RecentsPanelView$AsteroidTaskManagerHelper;-><init>(Lcom/android/systemui/recent/RecentsPanelView;)V

invoke-virtual {v1, v2}, Landroid/widget/ImageButton;->setOnClickListener(Landroid/view/View$OnClickListener;)V

const v1, [COLOR="Blue"]0x7f08012d[/COLOR]

invoke-virtual {p0, v1}, Lcom/android/systemui/recent/RecentsPanelView;->findViewById(I)Landroid/view/View;

move-result-object v1

check-cast v1, Landroid/widget/ImageButton;

iput-object v1, p0, Lcom/android/systemui/recent/RecentsPanelView;->mGoogleButton:Landroid/widget/ImageButton;

iget-object v1, p0, Lcom/android/systemui/recent/RecentsPanelView;->mGoogleButton:Landroid/widget/ImageButton;

new-instance v2, Lcom/android/systemui/recent/RecentsPanelView$AsteroidGoogleHelper;

invoke-direct {v2, p0}, Lcom/android/systemui/recent/RecentsPanelView$AsteroidGoogleHelper;-><init>(Lcom/android/systemui/recent/RecentsPanelView;)V

invoke-virtual {v1, v2}, Landroid/widget/ImageButton;->setOnClickListener(Landroid/view/View$OnClickListener;)V[/COLOR]

[COLOR="Blue"]return-void[/COLOR]

.line 473
.end local v0 #scrollView:Lcom/android/systemui/recent/RecentsPanelView$RecentsScrollView;
:cond_1
new-instance v1, Ljava/lang/IllegalArgumentException;

const-string v2, "missing Recents[Horizontal]ScrollView"

invoke-direct {v1, v2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

throw v1

.line 483
.restart local v0 #scrollView:Lcom/android/systemui/recent/RecentsPanelView$RecentsScrollView;

Change this 0x7f08012e

with the IDS value you got in your public.xml

<public type="id" name="asteroid_recents_clear_all_button" id="[COLOR="Blue"]0x7f??????[/COLOR]" />

this 0x7f08012c with

<public type="id" name="asteroid_recents_task_manager_button" id="[COLOR="Blue"]0x7f??????[/COLOR]" />

and this 0x7f08012d with

<public type="id" name="asteroid_recents_google_button" id="[COLOR="Blue"]0x7f??????[/COLOR]" />

- Done and recompile your systemUI.apk

- Download attached Asteroid_taskmanager.apk and

- Quicksearcbox.apk ( skip this if you already have velvet / google search installed )

- Push them together to your system/app/reboot

- Done :P

Additional

for JB 4.1.2

change this from the guide

invoke-virtual {p0}, Lcom/android/systemui/recent/RecentsPanelView;->dismissAndGoBack()V

to like this

invoke-virtual {p0, v6}, Lcom/android/systemui/recent/RecentsPanelView;->hide(Z)V