diff --git a/packages/SystemUI/res/layout-land/status_bar_recent_panel.xml b/packages/SystemUI/res/layout-land/status_bar_recent_panel.xml
index 0c0be29..2675a4c 100644
--- a/packages/SystemUI/res/layout-land/status_bar_recent_panel.xml
+++ b/packages/SystemUI/res/layout-land/status_bar_recent_panel.xml
@@ -57,6 +57,15 @@
+
+
android:text="@string/one_key_clean"
+
android:id = "@+id/one_key_clear"
+
android:layout_alignParentBottom="true"
+
android:layout_marginTop="450dp"
+
android:layout_width="match_parent"
+
android:layout_height="wrap_content" />
+
+
android:id="@+id/recents_no_apps"
android:layout_width="match_parent"
diff --git a/packages/SystemUI/res/layout/status_bar_recent_panel.xml b/packages/SystemUI/res/layout/status_bar_recent_panel.xml
index 2f3968d..9665268 100644
--- a/packages/SystemUI/res/layout/status_bar_recent_panel.xml
+++ b/packages/SystemUI/res/layout/status_bar_recent_panel.xml
@@ -32,6 +32,7 @@
android:background="@drawable/status_bar_recents_background"
android:layout_width="match_parent"
android:layout_height="match_parent"
+
android:layout_marginBottom="130dp"
android:layout_alignParentBottom="true">
@@ -59,7 +60,15 @@
-
+
+
+
+
android:text="@string/one_key_clean"
+
android:id = "@+id/one_key_clear"
+
android:layout_alignParentBottom="true"
+
android:layout_marginTop="880dp"
+
android:layout_width="match_parent"
+
android:layout_height="wrap_content" />
android:id="@+id/recents_no_apps"
diff --git a/packages/SystemUI/res/values-in/strings.xml b/packages/SystemUI/res/values-in/strings.xml
index 0893599..f55816c 100644
--- a/packages/SystemUI/res/values-in/strings.xml
+++ b/packages/SystemUI/res/values-in/strings.xml
@@ -20,6 +20,8 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
"Sistem UI"
+
Kunci untuk menghapus
+
jelas dalam ...
"Bersihkan"
"Hapus dari daftar"
"Info apl"
diff --git a/packages/SystemUI/res/values-zh-rCN/strings.xml b/packages/SystemUI/res/values-zh-rCN/strings.xml
index 8b4ac30..0eff18c 100755
--- a/packages/SystemUI/res/values-zh-rCN/strings.xml
+++ b/packages/SystemUI/res/values-zh-rCN/strings.xml
@@ -20,6 +20,8 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
"系统用户界面"
+
一键清除
+
清除中 ...
"清除"
"从列表中删除"
"应用信息"
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index 371f1ab..59d3e67 100755
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -19,6 +19,8 @@
System UI
+ Clean all
+ Cleaning up ...
diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsActivity.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsActivity.java
index 09a7a5e..c55ab52 100644
--- a/packages/SystemUI/src/com/android/systemui/recent/RecentsActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsActivity.java
@@ -28,6 +28,10 @@ import android.os.UserHandle;
import android.view.MotionEvent;
import android.view.View;
import android.view.WindowManager;
+import android.util.Log;
+import android.widget.Button;
+import android.os.Handler;
+import android.os.Message;
import com.android.systemui.R;
import com.android.systemui.statusbar.StatusBarPanel;
@@ -175,11 +179,35 @@ public class RecentsActivity extends Activity {
finish();
}
+
private Handler mHandler=new Handler(){
+
@Override
+
public void handleMessage(Message msg) {
+
finish();
+
}
+
};
+
+
@Override
protected void onCreate(Bundle savedInstanceState) {
getWindow().addPrivateFlags(
WindowManager.LayoutParams.PRIVATE_FLAG_INHERIT_TRANSLUCENT_DECOR);
setContentView(R.layout.status_bar_recent_panel);
+
+
final Button button=(Button) findViewById(R.id.one_key_clear);
+
button.setOnClickListener(new View.OnClickListener() {
+
@Override
+
public void onClick(View v) {
+
RecentsPanelView recentsPanelView=new RecentsPanelView(RecentsActivity.this,null,0);
+
recentsPanelView.delAllRecentTask(RecentsActivity.this);
+
button.setText(getResources().getString(R.string.cleaning));
+
mHandler.sendEmptyMessageDelayed(0,500);
+
+
}
+
});
+
+
+
+
mRecentsPanel = (RecentsPanelView) findViewById(R.id.recents_root);
mRecentsPanel.setOnTouchListener(new TouchOutsideListener(mRecentsPanel));
mRecentsPanel.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
index 788e843..f14b975 100644
--- a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
@@ -810,4 +810,27 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener
}
mRecentsContainer.drawFadedEdges(canvas, left, right, top, bottom);
}
+
+
+ public void delAllRecentTask(Context context){
+
+ final ActivityManager am =(ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE);
+
+ mRecentTaskDescriptions = new ArrayList();
+ mRecentTaskDescriptions=mRecentTasksLoader.getLoadedTasks();
+
if(mRecentTaskDescriptions!=null){
+
+
if (am != null) {
+
for(TaskDescription recent :mRecentTaskDescriptions){
+
am.removeTask(recent.persistentTaskId, ActivityManager.REMOVE_TASK_KILL_PROCESS);
+
setContentDescription(mContext.getString(R.string.accessibility_recents_item_dismissed, recent.getLabel()));
+
sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED);
+
setContentDescription(null);
+
}
+
dismissAndGoBack();
+
}
+
+
}
+
}
+
}