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

Commit dd00b33b authored by D4rKn3sSyS's avatar D4rKn3sSyS Committed by zigackly
Browse files

"Clear all" button on recent apps

    Ported from ParanoidAndroid by zigackly:
    https://github.com/ParanoidAndroid/android_frameworks_base/commit/f8c44e6ef667a3ebe9b658f148fa78a8d4f9a8dd

    Add button to tablet layout ported from Codename Android by zigackly:
    https://github.com/CNA/android_frameworks_base/commit/8d259fe3588c261baa5a17c361255cf28cc82bfe

    Patch set 2: Make the layout consistent, with the button at the top right.

    Patch set 3: Remove the redundant use of removeTask()

    Patch set 4: Top right layout does not work in tablet mode: make it top left for tablets only.

    Patch set 5: Different implementation (No need to keep track of views) - Danesh M

    Patch set 6: Top left layout no longer works for tablet mode with new implementation.
                 Make it bottom left for tablets only.

Change-Id: Iceb86eef41160f1c17e51463b37fd97e27acfb2e
parent 2a572ee7
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -70,6 +70,14 @@

        </com.android.systemui.recent.RecentsHorizontalScrollView>

        <ImageView
            android:id="@+id/recents_clear"
            android:clickable="true"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="top|right"
            android:src="@drawable/ic_notify_clear" />

    </FrameLayout>

    <include layout="@layout/status_bar_no_recent_apps"
+8 −0
Original line number Diff line number Diff line
@@ -68,6 +68,14 @@

        </com.android.systemui.recent.RecentsVerticalScrollView>

        <ImageView
            android:id="@+id/recents_clear"
            android:clickable="true"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="top|right"
            android:src="@drawable/ic_notify_clear" />

    </FrameLayout>

    <include layout="@layout/status_bar_no_recent_apps"
+88 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/* apps/common/assets/default/default/skins/StatusBar.xml
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
**     http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->

<com.android.systemui.recent.RecentsPanelView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui"
    android:id="@+id/recents_root"
    android:layout_height="match_parent"
    android:layout_width="match_parent"
    systemui:recentItemLayout="@layout/status_bar_recent_item"
    >
    <View
        android:id="@+id/recents_transition_background"
        android:layout_height="match_parent"
        android:layout_width="match_parent"
        android:visibility="invisible" />
    <FrameLayout
        android:id="@+id/recents_bg_protect"
        android:background="@drawable/status_bar_recents_background"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentBottom="true"
        android:clipToPadding="false"
        android:clipChildren="false">

        <ImageView
            android:id="@+id/recents_transition_placeholder_icon"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:visibility="invisible" />

        <com.android.systemui.recent.RecentsHorizontalScrollView android:id="@+id/recents_container"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:divider="@null"
            android:stackFromBottom="true"
            android:fadingEdge="horizontal"
            android:scrollbars="none"
            android:fadingEdgeLength="@dimen/status_bar_recents_scroll_fading_edge_length"
            android:layout_gravity="bottom|right"
            android:orientation="horizontal"
            android:clipToPadding="false"
            android:clipChildren="false">

            <LinearLayout android:id="@+id/recents_linear_layout"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:orientation="horizontal"
                android:clipToPadding="false"
                android:clipChildren="false">
            </LinearLayout>

        </com.android.systemui.recent.RecentsHorizontalScrollView>

        <ImageView
            android:id="@+id/recents_clear"
            android:clickable="true"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="top|right"
            android:src="@drawable/ic_notify_clear" />

    </FrameLayout>

    <include layout="@layout/status_bar_no_recent_apps"
        android:id="@+id/recents_no_apps"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:visibility="invisible" />

</com.android.systemui.recent.RecentsPanelView>
+87 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/* apps/common/assets/default/default/skins/StatusBar.xml
**
** Copyright 2010, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
**     http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->

<com.android.systemui.recent.RecentsPanelView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui"
    android:id="@+id/recents_root"
    android:layout_height="match_parent"
    android:layout_width="match_parent"
    systemui:recentItemLayout="@layout/status_bar_recent_item"
    >
    <View
        android:id="@+id/recents_transition_background"
        android:layout_height="match_parent"
        android:layout_width="match_parent"
        android:visibility="invisible" />
    <FrameLayout
        android:id="@+id/recents_bg_protect"
        android:background="@drawable/status_bar_recents_background"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginBottom="@*android:dimen/system_bar_height"
        android:layout_alignParentBottom="true">

        <ImageView
            android:id="@+id/recents_transition_placeholder_icon"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:visibility="invisible" />

        <com.android.systemui.recent.RecentsVerticalScrollView
            android:id="@+id/recents_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:divider="@null"
            android:stackFromBottom="true"
            android:fadingEdge="vertical"
            android:scrollbars="none"
            android:fadingEdgeLength="@dimen/status_bar_recents_scroll_fading_edge_length"
            android:layout_gravity="bottom|left"
            android:clipToPadding="false"
            android:clipChildren="false">

            <LinearLayout android:id="@+id/recents_linear_layout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:clipToPadding="false"
                android:clipChildren="false">
            </LinearLayout>

        </com.android.systemui.recent.RecentsVerticalScrollView>

        <ImageView
            android:id="@+id/recents_clear"
            android:clickable="true"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="top|right"
            android:src="@drawable/ic_notify_clear" />

    </FrameLayout>

    <include layout="@layout/status_bar_no_recent_apps"
        android:id="@+id/recents_no_apps"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:visibility="invisible" />

</com.android.systemui.recent.RecentsPanelView>
+8 −0
Original line number Diff line number Diff line
@@ -71,6 +71,14 @@

        </com.android.systemui.recent.RecentsVerticalScrollView>

        <ImageView
            android:id="@+id/recents_clear"
            android:clickable="true"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom|left"
            android:src="@drawable/ic_notify_clear" />

        <include layout="@layout/system_bar_no_recent_apps"
            android:id="@+id/recents_no_apps"
            android:layout_width="match_parent"
Loading