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

Commit d2a03061 authored by Winson's avatar Winson
Browse files

Adding desired undocking animation.

- Separating task binding from task data updating
- Removing unused parameters

Bug: 27154882
Change-Id: Ia970597d57857a74b5d008e91a93703d8fb70c1e
parent 3f8f7f4c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -32,4 +32,5 @@
    android:shadowRadius="5"
    android:fontFamily="sans-serif-medium"
    android:background="?android:selectableItemBackground"
    android:visibility="invisible" />
    android:visibility="invisible"
    android:forceHasOverlappingRendering="false" />
+2 −8
Original line number Diff line number Diff line
@@ -349,7 +349,7 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
        loader.loadTasks(this, loadPlan, loadOpts);
        TaskStack stack = loadPlan.getTaskStack();
        mRecentsView.onReload(mIsVisible, stack.getTaskCount() == 0);
        mRecentsView.updateStack(stack);
        mRecentsView.updateStack(stack, true /* setStackViewTasks */);

        // Update the nav bar scrim, but defer the animation until the enter-window event
        boolean animateNavBarScrim = !launchState.launchedViaDockGesture;
@@ -455,13 +455,7 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD

        EventBus.getDefault().send(new ConfigurationChangedEvent(true /* fromMultiWindow */,
                false /* fromDeviceOrientationChange */, numStackTasks > 0));

        if (mRecentsView != null) {
            mRecentsView.updateStack(stack);
        }

        EventBus.getDefault().send(new MultiWindowStateChangedEvent(isInMultiWindowMode,
                numStackTasks > 0));
        EventBus.getDefault().send(new MultiWindowStateChangedEvent(isInMultiWindowMode, stack));
    }

    @Override
+2 −1
Original line number Diff line number Diff line
@@ -771,8 +771,9 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
                    if (icon != null) {
                        icon.setCallback(null);
                    }
                    mHeaderBar.rebindToTask(toTask, false /* touchExplorationEnabled */,
                    mHeaderBar.bindToTask(toTask, false /* touchExplorationEnabled */,
                            disabledInSafeMode);
                    mHeaderBar.onTaskDataLoaded();
                    mHeaderBar.setDimAlpha(toTransform.dimAlpha);
                    mHeaderBar.draw(c);
                    c.setBitmap(null);
+5 −4
Original line number Diff line number Diff line
@@ -17,17 +17,18 @@
package com.android.systemui.recents.events.activity;

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

/**
 * This is sent by the activity whenever the multi-window state has changed.
 */
public class MultiWindowStateChangedEvent extends EventBus.Event {
public class MultiWindowStateChangedEvent extends EventBus.AnimatedEvent {

    public final boolean inMultiWindow;
    public final boolean hasStackTasks;
    public final TaskStack stack;

    public MultiWindowStateChangedEvent(boolean inMultiWindow, boolean hasStackTasks) {
    public MultiWindowStateChangedEvent(boolean inMultiWindow, TaskStack stack) {
        this.inMultiWindow = inMultiWindow;
        this.hasStackTasks = hasStackTasks;
        this.stack = stack;
    }
}
+5 −13
Original line number Diff line number Diff line
@@ -353,24 +353,16 @@ public class RecentsTaskLoader {

    /**
     * Acquires the task resource data directly from the cache, loading if necessary.
     *
     * @param fetchAndInvalidateThumbnails If set, will try loading thumbnails, invalidating them
     *                                     in the cache and loading if necessary. Otherwise, do not
     *                                     load the thumbnail unless the icon also has to be loaded.
     */
    public void loadTaskData(Task t, boolean fetchAndInvalidateThumbnails) {
    public void loadTaskData(Task t) {
        Drawable icon = mIconCache.getAndInvalidateIfModified(t.key);
        Bitmap thumbnail = null;
        ActivityManager.TaskThumbnailInfo thumbnailInfo = null;
        if (fetchAndInvalidateThumbnails) {
        ThumbnailData thumbnailData = mThumbnailCache.getAndInvalidateIfModified(t.key);
        if (thumbnailData != null) {
            thumbnail = thumbnailData.thumbnail;
            thumbnailInfo = thumbnailData.thumbnailInfo;
        }
        } else {
            thumbnail = mDefaultThumbnail;
        }

        // Grab the thumbnail/icon from the cache, if either don't exist, then trigger a reload and
        // use the default assets in their place until they load
Loading