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

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

Merge "Fixing some drag and drop issues."

parents 2e408947 d9529619
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -22,7 +22,7 @@ import com.android.systemui.recents.model.TaskStack;
/**
/**
 * This is sent by the activity whenever the task stach has changed.
 * This is sent by the activity whenever the task stach has changed.
 */
 */
public class TaskStackUpdatedEvent extends EventBus.Event {
public class TaskStackUpdatedEvent extends EventBus.AnimatedEvent {


    /**
    /**
     * A new TaskStack instance representing the latest stack state.
     * A new TaskStack instance representing the latest stack state.
+5 −1
Original line number Original line Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.systemui.recents.events.ui.dragndrop;
import com.android.systemui.recents.events.EventBus;
import com.android.systemui.recents.events.EventBus;
import com.android.systemui.recents.model.Task;
import com.android.systemui.recents.model.Task;
import com.android.systemui.recents.views.RecentsViewTouchHandler;
import com.android.systemui.recents.views.RecentsViewTouchHandler;
import com.android.systemui.recents.views.TaskView;


/**
/**
 * This event is sent by the drag manager when it requires drop targets to register themselves for
 * This event is sent by the drag manager when it requires drop targets to register themselves for
@@ -27,10 +28,13 @@ import com.android.systemui.recents.views.RecentsViewTouchHandler;
public class DragStartInitializeDropTargetsEvent extends EventBus.Event {
public class DragStartInitializeDropTargetsEvent extends EventBus.Event {


    public final Task task;
    public final Task task;
    public final TaskView taskView;
    public final RecentsViewTouchHandler handler;
    public final RecentsViewTouchHandler handler;


    public DragStartInitializeDropTargetsEvent(Task task, RecentsViewTouchHandler handler) {
    public DragStartInitializeDropTargetsEvent(Task task, TaskView taskView,
            RecentsViewTouchHandler handler) {
        this.task = task;
        this.task = task;
        this.taskView = taskView;
        this.handler = handler;
        this.handler = handler;
    }
    }
}
}
+6 −1
Original line number Original line Diff line number Diff line
@@ -400,7 +400,12 @@ public class TaskStack {
            // Calculate the task stack bounds from the new window bounds
            // Calculate the task stack bounds from the new window bounds
            Rect searchBarSpaceBounds = new Rect();
            Rect searchBarSpaceBounds = new Rect();
            Rect taskStackBounds = new Rect();
            Rect taskStackBounds = new Rect();
            config.getTaskStackBounds(newWindowBounds, insets.top, insets.right,
            // If the task stack bounds is specifically under the dock area, then ignore the top
            // inset
            int top = dockArea.bottom < 1f
                    ? 0
                    : insets.top;
            config.getTaskStackBounds(newWindowBounds, top, insets.right,
                    searchBarSpaceBounds, taskStackBounds);
                    searchBarSpaceBounds, taskStackBounds);
            return taskStackBounds;
            return taskStackBounds;
        }
        }
+0 −16
Original line number Original line Diff line number Diff line
@@ -319,22 +319,6 @@ public class RecentsTvActivity extends Activity implements OnPreDrawListener {
        }
        }
    }
    }


    @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, -1, false);
            loader.loadTasks(this, loadPlan, launchOpts);
            EventBus.getDefault().send(new TaskStackUpdatedEvent(loadPlan.getTaskStack()));
        }
    }

    @Override
    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        switch (keyCode) {
        switch (keyCode) {
+0 −7
Original line number Original line Diff line number Diff line
@@ -227,12 +227,6 @@ public class RecentsTvView extends FrameLayout {
        EventBus.getDefault().send(new CancelEnterRecentsWindowAnimationEvent(null));
        EventBus.getDefault().send(new CancelEnterRecentsWindowAnimationEvent(null));
    }
    }


    public final void onBusEvent(TaskStackUpdatedEvent event) {
        mStack.setTasks(event.stack.computeAllTasksList(), true /* notifyStackChanges */);
        mStack.createAffiliatedGroupings(getContext());
    }


    public final void onBusEvent(RecentsVisibilityChangedEvent event) {
    public final void onBusEvent(RecentsVisibilityChangedEvent event) {
        if (!event.visible) {
        if (!event.visible) {
            // Reset the view state
            // Reset the view state
@@ -240,7 +234,6 @@ public class RecentsTvView extends FrameLayout {
        }
        }
    }
    }



    public void setTaskStackViewAdapter(TaskStackHorizontalViewAdapter taskStackViewAdapter) {
    public void setTaskStackViewAdapter(TaskStackHorizontalViewAdapter taskStackViewAdapter) {
        if(mTaskStackHorizontalView != null) {
        if(mTaskStackHorizontalView != null) {
            mTaskStackHorizontalView.setAdapter(taskStackViewAdapter);
            mTaskStackHorizontalView.setAdapter(taskStackViewAdapter);
Loading