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

Commit 397ae747 authored by Winson's avatar Winson
Browse files

Removing unused code

- Removing code related to dismiss-all and stack filtering

Change-Id: Ife3c300970b234a5f7828a3c04f1eb9cb861399f
parent 8b1871d7
Loading
Loading
Loading
Loading
+0 −32
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2015 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.
-->
<!-- Extends Framelayout -->
<com.android.systemui.statusbar.DismissView
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="@dimen/recents_dismiss_all_button_size"
        android:visibility="gone"
        android:clipChildren="false"
        android:clipToPadding="false">
    <com.android.systemui.statusbar.DismissViewButton
            android:id="@+id/dismiss_text"
            android:layout_width="@dimen/recents_dismiss_all_button_size"
            android:layout_height="@dimen/recents_dismiss_all_button_size"
            android:layout_gravity="end"
            android:alpha="1.0"
            android:background="@drawable/recents_button_bg"
            android:contentDescription="@string/recents_dismiss_all_message"/>
</com.android.systemui.statusbar.DismissView>
+0 −6
Original line number Diff line number Diff line
@@ -138,12 +138,6 @@
    <!-- The duration in seconds to wait before the dismiss buttons are shown. -->
    <integer name="recents_task_bar_dismiss_delay_seconds">1000</integer>

    <!-- The min animation duration for animating views that are currently visible. -->
    <integer name="recents_filter_animate_current_views_duration">250</integer>

    <!-- The min animation duration for animating views that are newly visible. -->
    <integer name="recents_filter_animate_new_views_duration">250</integer>

    <!-- The duration of the window transition when coming to Recents from an app.
         In order to defer the in-app animations until after the transition is complete,
         we also need to use this value as the starting delay when animating the first
+0 −2
Original line number Diff line number Diff line
@@ -698,8 +698,6 @@
    <string name="recents_search_bar_label">search</string>
    <!-- Recents: Launch error string. [CHAR LIMIT=NONE] -->
    <string name="recents_launch_error_message">Could not start <xliff:g id="app" example="Calendar">%s</xliff:g>.</string>
    <!-- Recents: Dismiss all button. [CHAR LIMIT=NONE] -->
    <string name="recents_dismiss_all_message">Dismiss all applications</string>

    <!-- Recents: MultiStack add stack split horizontal radio button. [CHAR LIMIT=NONE] -->
    <string name="recents_multistack_add_stack_dialog_split_horizontal">Split Horizontal</string>
+17 −23
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ import com.android.systemui.recents.events.activity.LaunchTaskSucceededEvent;
import com.android.systemui.recents.events.activity.ToggleRecentsEvent;
import com.android.systemui.recents.events.component.RecentsVisibilityChangedEvent;
import com.android.systemui.recents.events.component.ScreenPinningRequestEvent;
import com.android.systemui.recents.events.ui.AllTaskViewsDismissedEvent;
import com.android.systemui.recents.events.ui.DismissTaskViewEvent;
import com.android.systemui.recents.events.ui.ResizeTaskEvent;
import com.android.systemui.recents.events.ui.ShowApplicationInfoEvent;
@@ -79,8 +80,7 @@ import java.util.ArrayList;
/**
 * The main Recents activity that is started from AlternateRecentsComponent.
 */
public class RecentsActivity extends Activity implements RecentsView.RecentsViewCallbacks,
        ViewTreeObserver.OnPreDrawListener {
public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreDrawListener {

    private final static String TAG = "RecentsActivity";
    private final static boolean DEBUG = false;
@@ -112,7 +112,7 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
    DozeTrigger mIterateTrigger = new DozeTrigger(500, new Runnable() {
        @Override
        public void run() {
            dismissRecentsToFocusedTask(false);
            dismissRecentsToFocusedTask();
        }
    });

@@ -259,12 +259,9 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
    /**
     * Dismisses recents if we are already visible and the intent is to toggle the recents view.
     */
    boolean dismissRecentsToFocusedTask(boolean checkFilteredStackState) {
    boolean dismissRecentsToFocusedTask() {
        SystemServicesProxy ssp = Recents.getSystemServices();
        if (ssp.isRecentsTopMost(ssp.getTopMostTask(), null)) {
            // If we currently have filtered stacks, then unfilter those first
            if (checkFilteredStackState &&
                    mRecentsView.unfilterFilteredStacks()) return true;
            // If we have a focused Task, launch that Task now
            if (mRecentsView.launchFocusedTask()) return true;
        }
@@ -274,12 +271,9 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
    /**
     * Dismisses recents if we are already visible and the intent is to toggle the recents view.
     */
    boolean dismissRecentsToFocusedTaskOrHome(boolean checkFilteredStackState) {
    boolean dismissRecentsToFocusedTaskOrHome() {
        SystemServicesProxy ssp = Recents.getSystemServices();
        if (ssp.isRecentsTopMost(ssp.getTopMostTask(), null)) {
            // If we currently have filtered stacks, then unfilter those first
            if (checkFilteredStackState &&
                mRecentsView.unfilterFilteredStacks()) return true;
            // If we have a focused Task, launch that Task now
            if (mRecentsView.launchFocusedTask()) return true;
            // If none of the other cases apply, then just go Home
@@ -348,7 +342,6 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
        // Set the Recents layout
        setContentView(R.layout.recents);
        mRecentsView = (RecentsView) findViewById(R.id.recents_view);
        mRecentsView.setCallbacks(this);
        mRecentsView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
                View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
                View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
@@ -557,7 +550,7 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
    @Override
    public void onBackPressed() {
        // Dismiss Recents to the focused Task or Home
        dismissRecentsToFocusedTaskOrHome(true);
        dismissRecentsToFocusedTaskOrHome();
    }

    /**** RecentsResizeTaskDialog ****/
@@ -569,17 +562,10 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
        return mResizeTaskDebugDialog;
    }

    /**** RecentsView.RecentsViewCallbacks Implementation ****/

    @Override
    public void onAllTaskViewsDismissed() {
        mFinishLaunchHomeRunnable.run();
    }

    /**** EventBus events ****/

    public final void onBusEvent(ToggleRecentsEvent event) {
        dismissRecentsToFocusedTaskOrHome(true /* checkFilteredStackState */);
        dismissRecentsToFocusedTaskOrHome();
    }

    public final void onBusEvent(IterateRecentsEvent event) {
@@ -604,10 +590,10 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
    public final void onBusEvent(HideRecentsEvent event) {
        if (event.triggeredFromAltTab) {
            // If we are hiding from releasing Alt-Tab, dismiss Recents to the focused app
            dismissRecentsToFocusedTaskOrHome(false /* checkFilteredStackState */);
            dismissRecentsToFocusedTaskOrHome();
        } else if (event.triggeredFromHomeKey) {
            // Otherwise, dismiss Recents to Home
            dismissRecentsToHome(true /* checkFilteredStackState */);
            dismissRecentsToHome(true /* animated */);
        } else {
            // Do nothing
        }
@@ -683,6 +669,14 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
        ssp.removeTask(event.task.key.id);
    }

    public final void onBusEvent(AllTaskViewsDismissedEvent event) {
        // Just go straight home (no animation necessary because there are no more task views)
        dismissRecentsToHome(false /* animated */);

        // Keep track of all-deletions
        MetricsLogger.count(this, "overview_task_all_dismissed", 1);
    }

    public final void onBusEvent(ResizeTaskEvent event) {
        getResizeTaskDebugDialog().showResizeTaskDialog(event.task, mRecentsView);
    }
+26 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2015 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.
 */

package com.android.systemui.recents.events.ui;

import com.android.systemui.recents.events.EventBus;

/**
 * This is sent whenever all the task views in a stack have been dismissed.
 */
public class AllTaskViewsDismissedEvent extends EventBus.Event {
    // Simple event
}
Loading