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

Commit add893a0 authored by Raj Yengisetty's avatar Raj Yengisetty Committed by Matt Garnes
Browse files

Fix - place Clear Recents button above the nav bar

Change-Id: Ie7059cd1f71bae28ff25f367221b7c7ba0131932
parent dfd89b14
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowInsets;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import com.android.systemui.recents.Constants;
import com.android.systemui.recents.RecentsConfiguration;
import com.android.systemui.recents.misc.Console;
@@ -282,6 +283,14 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV
        mConfig.getTaskStackBounds(width, height, mConfig.systemInsets.top,
                mConfig.systemInsets.right, taskStackBounds);

        if (mClearRecents != null) {
            LinearLayout.LayoutParams params = (LinearLayout.LayoutParams)
                    mClearRecents.getLayoutParams();

            params.bottomMargin = mConfig.systemInsets.bottom;
            mClearRecents.setLayoutParams(params);
        }

        // Measure each TaskStackView with the full width and height of the window since the 
        // transition view is a child of that stack view
        int childCount = getChildCount();
+17 −5
Original line number Diff line number Diff line
@@ -480,16 +480,28 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
    }

    public void dismissAllTasks() {
        final int count = mStack.getTasks().size();
        final ArrayList<Task> tasks = mStack.getTasks();
        post(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < count; i++) {
                    Task t = tasks.get(i);
                    TaskView tv = getChildViewForTask(t);
                ArrayList<Task> tasks = new ArrayList<Task>();
                tasks.addAll(mStack.getTasks());

                // Remove visible TaskViews
                int childCount = getChildCount();
                for (int i = 0; i < childCount; i++) {
                    TaskView tv = (TaskView) getChildAt(i);
                    tasks.remove(tv.getTask());
                    tv.dismissTask();
                }

                int size = tasks.size();
                // Remove any other Tasks
                for (int i = 0; i < size; i++) {
                    Task t = tasks.get(i);
                    if (mStack.getTasks().contains(t)) {
                        mStack.removeTask(t);
                    }
                }
            }
        });
    }