Search in sources :

Example 11 with RecentsModel

use of com.android.quickstep.RecentsModel in project android_packages_apps_Launcher3 by ProtonAOSP.

the class GroupedTaskView method onTaskListVisibilityChanged.

@Override
public void onTaskListVisibilityChanged(boolean visible, int changes) {
    super.onTaskListVisibilityChanged(visible, changes);
    if (visible) {
        RecentsModel model = RecentsModel.INSTANCE.get(getContext());
        TaskThumbnailCache thumbnailCache = model.getThumbnailCache();
        TaskIconCache iconCache = model.getIconCache();
        if (needsUpdate(changes, FLAG_UPDATE_THUMBNAIL)) {
            mThumbnailLoadRequest2 = thumbnailCache.updateThumbnailInBackground(mSecondaryTask, thumbnailData -> mSnapshotView2.setThumbnail(mSecondaryTask, thumbnailData));
        }
        if (needsUpdate(changes, FLAG_UPDATE_ICON)) {
            mIconLoadRequest2 = iconCache.updateIconInBackground(mSecondaryTask, (task) -> {
                setIcon(mIconView2, task.icon);
                mDigitalWellBeingToast2.initialize(mSecondaryTask);
                mDigitalWellBeingToast2.setSplitConfiguration(mSplitBoundsConfig);
                mDigitalWellBeingToast.setSplitConfiguration(mSplitBoundsConfig);
            });
        }
    } else {
        if (needsUpdate(changes, FLAG_UPDATE_THUMBNAIL)) {
            mSnapshotView2.setThumbnail(null, null);
            // Reset the task thumbnail reference as well (it will be fetched from the cache or
            // reloaded next time we need it)
            mSecondaryTask.thumbnail = null;
        }
        if (needsUpdate(changes, FLAG_UPDATE_ICON)) {
            setIcon(mIconView2, null);
        }
    }
}
Also used : DEFAULT_SPLIT_RATIO(com.android.launcher3.util.SplitConfigurationOptions.DEFAULT_SPLIT_RATIO) Context(android.content.Context) TaskThumbnailCache(com.android.quickstep.TaskThumbnailCache) StagedSplitBounds(com.android.launcher3.util.SplitConfigurationOptions.StagedSplitBounds) Task(com.android.systemui.shared.recents.model.Task) NonNull(androidx.annotation.NonNull) TaskIconCache(com.android.quickstep.TaskIconCache) HashMap(java.util.HashMap) RecentsOrientedState(com.android.quickstep.util.RecentsOrientedState) STAGE_POSITION_TOP_OR_LEFT(com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT) DeviceProfile(com.android.launcher3.DeviceProfile) Consumer(java.util.function.Consumer) Nullable(androidx.annotation.Nullable) AttributeSet(android.util.AttributeSet) CancellableTask(com.android.quickstep.util.CancellableTask) R(com.android.launcher3.R) RecentsModel(com.android.quickstep.RecentsModel) MotionEvent(android.view.MotionEvent) STAGE_POSITION_BOTTOM_OR_RIGHT(com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT) ThumbnailData(com.android.systemui.shared.recents.model.ThumbnailData) TransformingTouchDelegate(com.android.launcher3.util.TransformingTouchDelegate) RunnableList(com.android.launcher3.util.RunnableList) RecentsModel(com.android.quickstep.RecentsModel) TaskThumbnailCache(com.android.quickstep.TaskThumbnailCache) TaskIconCache(com.android.quickstep.TaskIconCache)

Aggregations

Context (android.content.Context)11 AttributeSet (android.util.AttributeSet)11 R (com.android.launcher3.R)11 RecentsModel (com.android.quickstep.RecentsModel)11 TaskIconCache (com.android.quickstep.TaskIconCache)11 TaskThumbnailCache (com.android.quickstep.TaskThumbnailCache)11 Task (com.android.systemui.shared.recents.model.Task)11 Consumer (java.util.function.Consumer)11 MotionEvent (android.view.MotionEvent)10 DeviceProfile (com.android.launcher3.DeviceProfile)10 TransformingTouchDelegate (com.android.launcher3.util.TransformingTouchDelegate)10 RecentsOrientedState (com.android.quickstep.util.RecentsOrientedState)10 NonNull (androidx.annotation.NonNull)9 RunnableList (com.android.launcher3.util.RunnableList)9 CancellableTask (com.android.quickstep.util.CancellableTask)9 Nullable (androidx.annotation.Nullable)8 Animator (android.animation.Animator)7 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)7 ObjectAnimator (android.animation.ObjectAnimator)7 ActivityOptions (android.app.ActivityOptions)7