Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dec5587b authored by kaiyiz's avatar kaiyiz
Browse files

SystemUI: Support clear all recent apps function and optimize task manager

1. Add clear button and task manager button on bottom of recent app panel.
2. Clear button can remove all recent apps.
3. Task manager button can start a activity to manager the running tasks.

Change-Id: I581f8f908d75956b4f850ddc31c5f3bd0e9df7b6
parent fa9bddda
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -189,6 +189,11 @@
          </intent-filter>
        </activity>

        <activity android:name=".recents.TaskManagerActivity"
                android:theme="@style/TaskManagerStyle"
                android:excludeFromRecents="true">
        </activity>

        <receiver
            android:name=".recent.RecentsPreloadReceiver"
            android:exported="false">
+25 −0
Original line number Diff line number Diff line
@@ -56,6 +56,31 @@
        android:background="@drawable/recents_button_bg"
        android:contentDescription="@string/clear_recents" />

    <LinearLayout
        android:id="@+id/recents_top_buttons"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal|top"
        android:visibility="gone">
        <Button
            android:id="@+id/task_manager"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:gravity="center"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:text="@string/status_bar_recent_task_manager_text"/>
        <Button
            android:id="@+id/recents_clear"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:gravity="center"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:text="@string/status_bar_recent_clear_all_text"/>
    </LinearLayout>


    <!-- Nav Bar Scrim View -->
    <ImageView
        android:id="@+id/nav_bar_scrim"
+39 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2014, The Linux Foundation. All rights reserved.

     Redistribution and use in source and binary forms, with or without
     modification, are permitted provided that the following conditions are
     met:
         * Redistributions of source code must retain the above copyright
           notice, this list of conditions and the following disclaimer.
         * Redistributions in binary form must reproduce the above
           copyright notice, this list of conditions and the following
           disclaimer in the documentation and/or other materials provided
           with the distribution.
         * Neither the name of The Linux Foundation nor the names of its
           contributors may be used to endorse or promote products derived
           from this software without specific prior written permission.

     THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
     WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
     ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
     BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
     BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
     OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
     IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" >
        <ExpandableListView android:id="@+id/taskList"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            />
</LinearLayout>
+86 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2015, The Linux Foundation. All rights reserved.

     Redistribution and use in source and binary forms, with or without
     modification, are permitted provided that the following conditions are
     met:
         * Redistributions of source code must retain the above copyright
           notice, this list of conditions and the following disclaimer.
         * Redistributions in binary form must reproduce the above
           copyright notice, this list of conditions and the following
           disclaimer in the documentation and/or other materials provided
           with the distribution.
         * Neither the name of The Linux Foundation nor the names of its
           contributors may be used to endorse or promote products derived
           from this software without specific prior written permission.

     THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
     WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
     ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
     BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
     BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
     OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
     IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    >
    <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        >
        <RelativeLayout
            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="35dip"
            android:gravity="center_vertical"
            >
            <TextView android:id="@+id/category"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:scaleType="fitCenter"
                android:maxLines="1"
                android:paddingLeft="3dip"
                android:paddingTop="3dip"
                android:textAppearance="?android:attr/textAppearanceMedium"
                android:layout_alignParentLeft="true"
                />

            <Button
                android:id="@+id/killall"
                android:layout_width="wrap_content"
                android:layout_height="30dip"
                android:text="@string/tasklist_killall"
                android:textAppearance="?android:attr/textAppearanceSmall"
                android:layout_alignParentRight="true"
                android:focusable="false"
                android:background="@drawable/btn_tasklist_killall"
                />
        </RelativeLayout>
        <TextView
            android:id="@+id/memUsage"
            android:layout_width="match_parent"
            android:layout_height="20dip"
            android:paddingLeft="40dip"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:layout_alignParentLeft="true"
            android:visibility="gone"
            />
    <ProgressBar
        android:id="@+id/memUsageProgressBar"
        style="?android:attr/progressBarStyleHorizontal"
        android:paddingLeft="40dip"
        android:layout_width="240dip"
        android:layout_height="20dip"
        android:visibility="gone"
        android:layout_alignParentLeft="true"/>
    </LinearLayout>
</RelativeLayout>
+77 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2015, The Linux Foundation. All rights reserved.

     Redistribution and use in source and binary forms, with or without
     modification, are permitted provided that the following conditions are
     met:
         * Redistributions of source code must retain the above copyright
           notice, this list of conditions and the following disclaimer.
         * Redistributions in binary form must reproduce the above
           copyright notice, this list of conditions and the following
           disclaimer in the documentation and/or other materials provided
           with the distribution.
         * Neither the name of The Linux Foundation nor the names of its
           contributors may be used to endorse or promote products derived
           from this software without specific prior written permission.

     THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
     WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
     ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
     BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
     BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
     OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
     IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    >
    <ImageView
        android:id="@+id/icon"
        android:layout_width="32dip"
        android:layout_height="32dip"
        android:layout_margin="4dip"
        android:gravity="center"
        android:paddingRight="2dip"
        android:scaleType="fitCenter"
        android:src="@android:drawable/sym_def_app_icon"
        android:layout_alignParentLeft="true"
    />

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@id/icon"
        android:orientation="vertical">
        <TextView android:id="@+id/taskname"
            android:layout_width="240dip"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:maxLines="1"
            android:gravity="center_vertical"
        />
        <TextView android:id="@+id/memorysize"
            android:layout_width="240dip"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:gravity="center_vertical"
        />
    </LinearLayout>

    <Button
        android:id="@+id/kill"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:gravity="center"
        android:layout_alignParentRight="true"
        android:text="@string/tasklist_stop"
    />

</RelativeLayout>
Loading