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

Commit 75ca1857 authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge changes Ide26856c,I68bbef59,I2186bdfc

* changes:
  Allowing tasks to be swiped away in the history view.
  Loading activity icons in History view.
  Ensuring that the undocked task is visible in Overview.
parents 98a400ed 4e5fb2f4
Loading
Loading
Loading
Loading
+23 −8
Original line number Diff line number Diff line
@@ -13,15 +13,30 @@
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<TextView
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:theme="@android:style/Theme.Material"
    android:layout_width="match_parent"
    android:layout_height="48dp"
    android:paddingLeft="32dp"
    android:orientation="horizontal"
    android:clickable="true"
    android:focusable="true"
    android:background="?android:selectableItemBackground">
    <ImageView
        android:id="@+id/icon"
        android:layout_width="32dp"
        android:layout_height="32dp"
        android:layout_gravity="center"
        android:layout_marginStart="16dp" />
    <TextView
        android:id="@+id/description"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:layout_gravity="end"
        android:paddingStart="16dp"
        android:gravity="start|center_vertical"
        android:textSize="14sp"
        android:textColor="#FFFFFF"
    android:fontFamily="sans-serif-medium"
    android:background="?android:selectableItemBackground"
    android:alpha="1" />
 No newline at end of file
        android:fontFamily="sans-serif-medium" />
</LinearLayout>
 No newline at end of file
+1 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ public class Constants {
        public static final int DismissSourceKeyboard = 0;
        public static final int DismissSourceSwipeGesture = 1;
        public static final int DismissSourceHeaderButton = 2;
        public static final int DismissSourceHistorySwipeGesture = 3;
    }

}
+19 −1
Original line number Diff line number Diff line
@@ -51,10 +51,12 @@ import com.android.systemui.recents.events.activity.IterateRecentsEvent;
import com.android.systemui.recents.events.activity.LaunchTaskFailedEvent;
import com.android.systemui.recents.events.activity.LaunchTaskSucceededEvent;
import com.android.systemui.recents.events.activity.ShowHistoryEvent;
import com.android.systemui.recents.events.activity.TaskStackUpdatedEvent;
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.DismissTaskEvent;
import com.android.systemui.recents.events.ui.DismissTaskViewEvent;
import com.android.systemui.recents.events.ui.ShowApplicationInfoEvent;
import com.android.systemui.recents.events.ui.StackViewScrolledEvent;
@@ -525,6 +527,22 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
        }
    }

    @Override
    public void onMultiWindowModeChanged(boolean multiWindowMode) {
        super.onMultiWindowModeChanged(multiWindowMode);
        if (!multiWindowMode) {
            RecentsTaskLoader loader = Recents.getTaskLoader();
            RecentsTaskLoadPlan.Options launchOpts = new RecentsTaskLoadPlan.Options();
            launchOpts.loadIcons = false;
            launchOpts.loadThumbnails = false;
            launchOpts.onlyLoadForCache = true;
            RecentsTaskLoadPlan loadPlan = loader.createLoadPlan(this);
            loader.preloadTasks(loadPlan, false);
            loader.loadTasks(this, loadPlan, launchOpts);
            EventBus.getDefault().send(new TaskStackUpdatedEvent(loadPlan.getTaskStack()));
        }
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        switch (keyCode) {
@@ -709,7 +727,7 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
        MetricsLogger.count(this, "overview_app_info", 1);
    }

    public final void onBusEvent(DismissTaskViewEvent event) {
    public final void onBusEvent(DismissTaskEvent event) {
        // Remove any stored data from the loader
        RecentsTaskLoader loader = Recents.getTaskLoader();
        loader.deleteTaskData(event.task, false);
+36 −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.activity;

import com.android.systemui.recents.RecentsAppWidgetHost;
import com.android.systemui.recents.events.EventBus;
import com.android.systemui.recents.model.TaskStack;

/**
 * This is sent by the activity whenever the task stach has changed.
 */
public class TaskStackUpdatedEvent extends EventBus.Event {

    /**
     * A new TaskStack instance representing the latest stack state.
     */
    public final TaskStack stack;

    public TaskStackUpdatedEvent(TaskStack stack) {
        this.stack = stack;
    }
}
+33 −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;
import com.android.systemui.recents.model.Task;
import com.android.systemui.recents.views.TaskView;

/**
 * This is sent when a {@link Task} has been dismissed.
 */
public class DismissTaskEvent extends EventBus.Event {

    public final Task task;

    public DismissTaskEvent(Task task) {
        this.task = task;
    }
}
Loading