Ok kali ini aku akan menambah task manager samsung ke recent panel.cling
1. kita akan modipi res/layout/status_bar_no_recent_apps.xml koyo iki
tambah code ini di bawah sendiri
<Button android:gravity="center" android:layout_gravity="bottom" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Task Manager" androidonClick="openTaskManager" />
jadi kelihatan kaya gini
<?xml version="1.0" encoding="utf-8"?> <FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> <TextView android:textSize="20.0dip" android:textColor="#ffffffff" android:gravity="center_horizontal" android:layout_gravity="center" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/status_bar_no_recent_apps" /> <Button android:gravity="center" android:layout_gravity="bottom" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Task Manager" android:onClick="openTaskManager" /> </FrameLayout>
2. we modify res/layout-land/status_bar_recent_panel.xml jadi tambah ini
<Button android:gravity="center" android:layout_gravity="bottom" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Task Manager" androidonClick="openTaskManager" />
jadi kelihatannya kaya gini
<?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"> <View android:id="@id/recents_transition_background" android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="fill_parent" /> <FrameLayout android:id="@id/recents_bg_protect" android:background="@drawable/status_bar_recents_background" android:clipChildren="false" android:clipToPadding="false" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentBottom="true"> <ImageView android:id="@id/recents_transition_placeholder_icon" android:visibility="invisible" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <com.android.systemui.recent.RecentsHorizontalScrollView android:layout_gravity="bottom|right|center" android:orientation="horizontal" 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" android:layout_marginRight="@dimen/status_bar_recents_right_glow_margin" android:stackFromBottom="true" android:divider="@null"> <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> </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" /> <Button android:gravity="center" android:layout_gravity="bottom" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Task Manager" android:onClick="openTaskManager" /> </com.android.systemui.recent.RecentsPanelView>
3. kita menambah code di res/layout-port/status_bar_recent_panel.xml .ini codenya
<Button android:gravity="center" android:layout_gravity="bottom" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Task Manager" androidonClick="openTaskManager" /> |
jadi kelihatannya kaya gini
<?xml version="1.0" encoding="utf-8"?> <com.android.systemui.recent.RecentsPanelView android:id="@id/recents_root" android:clipChildren="false" android:clipToPadding="false" android:layout_width="wrap_content" android:layout_height="fill_parent" systemui:recentItemLayout="@layout/system_bar_recent_item" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui"> <View android:id="@id/recents_transition_background" android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="fill_parent" /> <FrameLayout android:id="@id/recents_bg_protect" android:background="@drawable/recents_bg_protect_tile" android:clipChildren="false" android:clipToPadding="false" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginBottom="@android:dimen/system_bar_height" android:layout_alignParentBottom="true"> <ImageView android:id="@id/recents_transition_placeholder_icon" android:visibility="invisible" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <com.android.systemui.recent.RecentsVerticalScrollView android:layout_gravity="bottom|left|center" android:id="@id/recents_container" android:scrollbars="none" android:fadingEdge="vertical" android:fadingEdgeLength="20.0dip" android:clipChildren="false" android:clipToPadding="false" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="@dimen/status_bar_recents_right_glow_margin" 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="wrap_content" android:layout_height="wrap_content" /> </com.android.systemui.recent.RecentsVerticalScrollView> <include android:id="@id/recents_no_apps" android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginLeft="58.0dip" android:layout_marginBottom="36.0dip" layout="@layout/system_bar_no_recent_apps" /> </FrameLayout> <com.android.systemui.recent.StatusBarTouchProxy android:id="@id/status_bar_touch_proxy" android:layout_width="fill_parent" android:layout_height="@android:dimen/system_bar_height" android:layout_alignParentLeft="true" android:layout_alignParentBottom="true" /> <Button android:gravity="center" android:layout_gravity="bottom" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Task Manager" android:onClick="openTaskManager" /> </com.android.systemui.recent.RecentsPanelView>
4. Buka smali/com/android/systemui/SystemUIService.smali tambah line ini :
.method public openTaskManager(Landroid/view/View;)V .locals 5 .parameter "view" .prologue .line 99 .line 100 :try_start_0 new-instance v1, Landroid/content/Intent; invoke-direct {v1}, Landroid/content/Intent;-><init>()V .line 102 .local v1, intent:Landroid/content/Intent; const-string v2, "android.intent.action.MAIN" invoke-virtual {v1, v2}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent; .line 105 const/high16 v2, 0x1000 invoke-virtual {v1, v2}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent; .line 107 const-string v2, "com.sec.android.app.controlpanel" const-string v3, "com.sec.android.app.controlpanel.activity.JobManagerActivity" invoke-virtual {v1, v2, v3}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent; invoke-virtual {p0, v1}, Lcom/android/systemui/SystemUIService;->startActivity(Landroid/content/Intent;)V :try_end_0 .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0 .line 109 .line 112 .end local v1 #intent:Landroid/content/Intent; :goto_0 return-void .line 115 :catch_0 move-exception v0 .line 117 .local v0, e:Ljava/lang/Exception; invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V goto :goto_0 .end method
click here