Search in sources :

Example 1 with TaskIconCache

use of com.android.quickstep.TaskIconCache in project android_packages_apps_Launcher3 by crdroidandroid.

the class TaskView method onTaskListVisibilityChanged.

/**
 * See {@link TaskDataChanges}
 * @param visible If this task view will be visible to the user in overview or hidden
 */
public void onTaskListVisibilityChanged(boolean visible, @TaskDataChanges int changes) {
    if (mTask == null) {
        return;
    }
    cancelPendingLoadTasks();
    if (visible) {
        // These calls are no-ops if the data is already loaded, try and load the high
        // resolution thumbnail if the state permits
        RecentsModel model = RecentsModel.INSTANCE.get(getContext());
        TaskThumbnailCache thumbnailCache = model.getThumbnailCache();
        TaskIconCache iconCache = model.getIconCache();
        if (needsUpdate(changes, FLAG_UPDATE_THUMBNAIL)) {
            mThumbnailLoadRequest = thumbnailCache.updateThumbnailInBackground(mTask, thumbnail -> {
                mSnapshotView.setThumbnail(mTask, thumbnail);
            });
        }
        if (needsUpdate(changes, FLAG_UPDATE_ICON)) {
            mIconLoadRequest = iconCache.updateIconInBackground(mTask, (task) -> {
                setIcon(task.icon);
                mDigitalWellBeingToast.initialize(mTask);
            });
        }
    } else {
        if (needsUpdate(changes, FLAG_UPDATE_THUMBNAIL)) {
            mSnapshotView.setThumbnail(null, null);
            // Reset the task thumbnail reference as well (it will be fetched from the cache or
            // reloaded next time we need it)
            mTask.thumbnail = null;
        }
        if (needsUpdate(changes, FLAG_UPDATE_ICON)) {
            setIcon(null);
        }
    }
}
Also used : Rect(android.graphics.Rect) Task(com.android.systemui.shared.recents.model.Task) Bundle(android.os.Bundle) Utilities.getDescendantCoordRelativeToAncestor(com.android.launcher3.Utilities.getDescendantCoordRelativeToAncestor) NonNull(androidx.annotation.NonNull) TestProtocol(com.android.launcher3.testing.TestProtocol) FrameLayout(android.widget.FrameLayout) END(android.view.Gravity.END) Animator(android.animation.Animator) LauncherSettings(com.android.launcher3.LauncherSettings) SplitPositionOption(com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption) Drawable(android.graphics.drawable.Drawable) TouchDelegate(android.view.TouchDelegate) FloatProperty(android.util.FloatProperty) TOP(android.view.Gravity.TOP) ActivityOptions(android.app.ActivityOptions) AttributeSet(android.util.AttributeSet) ActivityManagerWrapper(com.android.systemui.shared.system.ActivityManagerWrapper) Interpolators(com.android.launcher3.anim.Interpolators) TaskViewUtils(com.android.quickstep.TaskViewUtils) START(android.view.Gravity.START) ROTATION_270(android.view.Surface.ROTATION_270) MAIN_EXECUTOR(com.android.launcher3.util.Executors.MAIN_EXECUTOR) View(android.view.View) TransformingTouchDelegate(com.android.launcher3.util.TransformingTouchDelegate) Log(android.util.Log) RectF(android.graphics.RectF) Utilities(com.android.launcher3.Utilities) UI_HELPER_EXECUTOR(com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR) Surface(android.view.Surface) Interpolator(android.view.animation.Interpolator) ObjectAnimator(android.animation.ObjectAnimator) LAUNCHER_TASK_LAUNCH_TAP(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_LAUNCH_TAP) TaskUtils(com.android.quickstep.TaskUtils) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) ViewGroup(android.view.ViewGroup) DeviceProfile(com.android.launcher3.DeviceProfile) Outline(android.graphics.Outline) List(java.util.List) CancellableTask(com.android.quickstep.util.CancellableTask) CENTER_VERTICAL(android.view.Gravity.CENTER_VERTICAL) TYPE_TASK_MENU(com.android.launcher3.AbstractFloatingView.TYPE_TASK_MENU) ROTATION_180(android.view.Surface.ROTATION_180) ACCEL_DEACCEL(com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL) ActivityOptionsCompat(com.android.systemui.shared.system.ActivityOptionsCompat) Context(android.content.Context) AccessibilityNodeInfo(android.view.accessibility.AccessibilityNodeInfo) TaskThumbnailCache(com.android.quickstep.TaskThumbnailCache) ROTATION_90(android.view.Surface.ROTATION_90) ViewOutlineProvider(android.view.ViewOutlineProvider) QuickStepContract(com.android.systemui.shared.system.QuickStepContract) Intent(android.content.Intent) SystemUiProxy(com.android.quickstep.SystemUiProxy) IntDef(androidx.annotation.IntDef) BOTTOM(android.view.Gravity.BOTTOM) FAST_OUT_SLOW_IN(com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN) RemoteAnimationTargets(com.android.quickstep.RemoteAnimationTargets) Retention(java.lang.annotation.Retention) Utilities.comp(com.android.launcher3.Utilities.comp) ENABLE_QUICKSTEP_LIVE_TILE(com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE) MotionEvent(android.view.MotionEvent) WorkspaceItemInfo(com.android.launcher3.model.data.WorkspaceItemInfo) Toast(android.widget.Toast) AnimatorSet(android.animation.AnimatorSet) ActivityOptionsWrapper(com.android.launcher3.util.ActivityOptionsWrapper) TaskOverlayFactory(com.android.quickstep.TaskOverlayFactory) SystemShortcut(com.android.launcher3.popup.SystemShortcut) TaskCornerRadius(com.android.quickstep.util.TaskCornerRadius) Reusable(com.android.launcher3.util.ViewPool.Reusable) StatefulActivity(com.android.launcher3.statemanager.StatefulActivity) TaskIconCache(com.android.quickstep.TaskIconCache) FeatureFlags(com.android.launcher3.config.FeatureFlags) RecentsOrientedState(com.android.quickstep.util.RecentsOrientedState) Consumer(java.util.function.Consumer) LINEAR(com.android.launcher3.anim.Interpolators.LINEAR) OVERVIEW_SPLIT_SELECT(com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT) PreviewPositionHelper(com.android.quickstep.views.TaskThumbnailView.PreviewPositionHelper) R(com.android.launcher3.R) TestLogging(com.android.launcher3.testing.TestLogging) RecentsModel(com.android.quickstep.RecentsModel) CENTER_HORIZONTAL(android.view.Gravity.CENTER_HORIZONTAL) ComponentKey(com.android.launcher3.util.ComponentKey) SOURCE(java.lang.annotation.RetentionPolicy.SOURCE) LAUNCHER_TASK_ICON_TAP_OR_LONGPRESS(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_ICON_TAP_OR_LONGPRESS) AbstractFloatingView(com.android.launcher3.AbstractFloatingView) PagedOrientationHandler(com.android.launcher3.touch.PagedOrientationHandler) RunnableList(com.android.launcher3.util.RunnableList) Collections(java.util.Collections) LENGTH_SHORT(android.widget.Toast.LENGTH_SHORT) RecentsModel(com.android.quickstep.RecentsModel) TaskThumbnailCache(com.android.quickstep.TaskThumbnailCache) TaskIconCache(com.android.quickstep.TaskIconCache)

Example 2 with TaskIconCache

use of com.android.quickstep.TaskIconCache in project android_packages_apps_Launcher3 by AOSPA.

the class TaskView method onTaskListVisibilityChanged.

/**
 * See {@link TaskDataChanges}
 * @param visible If this task view will be visible to the user in overview or hidden
 */
public void onTaskListVisibilityChanged(boolean visible, @TaskDataChanges int changes) {
    if (mTask == null) {
        return;
    }
    cancelPendingLoadTasks();
    if (visible) {
        // These calls are no-ops if the data is already loaded, try and load the high
        // resolution thumbnail if the state permits
        RecentsModel model = RecentsModel.INSTANCE.get(getContext());
        TaskThumbnailCache thumbnailCache = model.getThumbnailCache();
        TaskIconCache iconCache = model.getIconCache();
        if (needsUpdate(changes, FLAG_UPDATE_THUMBNAIL)) {
            mThumbnailLoadRequest = thumbnailCache.updateThumbnailInBackground(mTask, thumbnail -> {
                mSnapshotView.setThumbnail(mTask, thumbnail);
            });
        }
        if (needsUpdate(changes, FLAG_UPDATE_ICON)) {
            mIconLoadRequest = iconCache.updateIconInBackground(mTask, (task) -> {
                setIcon(mIconView, task.icon);
                mDigitalWellBeingToast.initialize(mTask);
            });
        }
    } else {
        if (needsUpdate(changes, FLAG_UPDATE_THUMBNAIL)) {
            mSnapshotView.setThumbnail(null, null);
            // Reset the task thumbnail reference as well (it will be fetched from the cache or
            // reloaded next time we need it)
            mTask.thumbnail = null;
        }
        if (needsUpdate(changes, FLAG_UPDATE_ICON)) {
            setIcon(mIconView, null);
        }
    }
}
Also used : Rect(android.graphics.Rect) Task(com.android.systemui.shared.recents.model.Task) Arrays(java.util.Arrays) Bundle(android.os.Bundle) Utilities.getDescendantCoordRelativeToAncestor(com.android.launcher3.Utilities.getDescendantCoordRelativeToAncestor) NonNull(androidx.annotation.NonNull) TestProtocol(com.android.launcher3.testing.TestProtocol) FrameLayout(android.widget.FrameLayout) Animator(android.animation.Animator) LauncherSettings(com.android.launcher3.LauncherSettings) SplitPositionOption(com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption) Drawable(android.graphics.drawable.Drawable) TouchDelegate(android.view.TouchDelegate) FloatProperty(android.util.FloatProperty) ActivityOptions(android.app.ActivityOptions) AttributeSet(android.util.AttributeSet) ActivityManagerWrapper(com.android.systemui.shared.system.ActivityManagerWrapper) Interpolators(com.android.launcher3.anim.Interpolators) TaskViewUtils(com.android.quickstep.TaskViewUtils) STAGE_POSITION_BOTTOM_OR_RIGHT(com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT) MAIN_EXECUTOR(com.android.launcher3.util.Executors.MAIN_EXECUTOR) View(android.view.View) TransformingTouchDelegate(com.android.launcher3.util.TransformingTouchDelegate) Log(android.util.Log) RectF(android.graphics.RectF) Utilities(com.android.launcher3.Utilities) UI_HELPER_EXECUTOR(com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR) Interpolator(android.view.animation.Interpolator) ObjectAnimator(android.animation.ObjectAnimator) LAUNCHER_TASK_LAUNCH_TAP(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_LAUNCH_TAP) TaskUtils(com.android.quickstep.TaskUtils) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) ViewGroup(android.view.ViewGroup) DeviceProfile(com.android.launcher3.DeviceProfile) Outline(android.graphics.Outline) List(java.util.List) Nullable(androidx.annotation.Nullable) Stream(java.util.stream.Stream) CancellableTask(com.android.quickstep.util.CancellableTask) ThumbnailData(com.android.systemui.shared.recents.model.ThumbnailData) IdRes(android.annotation.IdRes) RemoteTargetHandle(com.android.quickstep.RemoteTargetGluer.RemoteTargetHandle) TYPE_TASK_MENU(com.android.launcher3.AbstractFloatingView.TYPE_TASK_MENU) ACCEL_DEACCEL(com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL) ActivityOptionsCompat(com.android.systemui.shared.system.ActivityOptionsCompat) Context(android.content.Context) AccessibilityNodeInfo(android.view.accessibility.AccessibilityNodeInfo) TaskThumbnailCache(com.android.quickstep.TaskThumbnailCache) RemoteAnimationTargetCompat(com.android.systemui.shared.system.RemoteAnimationTargetCompat) SplitConfigurationOptions(com.android.launcher3.util.SplitConfigurationOptions) ViewOutlineProvider(android.view.ViewOutlineProvider) QuickStepContract(com.android.systemui.shared.system.QuickStepContract) Intent(android.content.Intent) HashMap(java.util.HashMap) SystemUiProxy(com.android.quickstep.SystemUiProxy) IntDef(androidx.annotation.IntDef) FAST_OUT_SLOW_IN(com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN) RemoteAnimationTargets(com.android.quickstep.RemoteAnimationTargets) Retention(java.lang.annotation.Retention) Utilities.comp(com.android.launcher3.Utilities.comp) TransformParams(com.android.quickstep.util.TransformParams) ENABLE_QUICKSTEP_LIVE_TILE(com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE) MotionEvent(android.view.MotionEvent) WorkspaceItemInfo(com.android.launcher3.model.data.WorkspaceItemInfo) STAGE_POSITION_UNDEFINED(com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_UNDEFINED) Toast(android.widget.Toast) AnimatorSet(android.animation.AnimatorSet) ActivityOptionsWrapper(com.android.launcher3.util.ActivityOptionsWrapper) TaskOverlayFactory(com.android.quickstep.TaskOverlayFactory) SystemShortcut(com.android.launcher3.popup.SystemShortcut) TaskCornerRadius(com.android.quickstep.util.TaskCornerRadius) Reusable(com.android.launcher3.util.ViewPool.Reusable) StatefulActivity(com.android.launcher3.statemanager.StatefulActivity) TaskIconCache(com.android.quickstep.TaskIconCache) RecentsOrientedState(com.android.quickstep.util.RecentsOrientedState) Consumer(java.util.function.Consumer) LINEAR(com.android.launcher3.anim.Interpolators.LINEAR) OVERVIEW_SPLIT_SELECT(com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT) PreviewPositionHelper(com.android.quickstep.views.TaskThumbnailView.PreviewPositionHelper) R(com.android.launcher3.R) TestLogging(com.android.launcher3.testing.TestLogging) RecentsModel(com.android.quickstep.RecentsModel) ComponentKey(com.android.launcher3.util.ComponentKey) SOURCE(java.lang.annotation.RetentionPolicy.SOURCE) LAUNCHER_TASK_ICON_TAP_OR_LONGPRESS(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_ICON_TAP_OR_LONGPRESS) AbstractFloatingView(com.android.launcher3.AbstractFloatingView) PagedOrientationHandler(com.android.launcher3.touch.PagedOrientationHandler) RunnableList(com.android.launcher3.util.RunnableList) Collections(java.util.Collections) LENGTH_SHORT(android.widget.Toast.LENGTH_SHORT) RecentsModel(com.android.quickstep.RecentsModel) TaskThumbnailCache(com.android.quickstep.TaskThumbnailCache) TaskIconCache(com.android.quickstep.TaskIconCache)

Example 3 with TaskIconCache

use of com.android.quickstep.TaskIconCache in project android_packages_apps_Launcher3 by AOSPA.

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)

Example 4 with TaskIconCache

use of com.android.quickstep.TaskIconCache in project android_packages_apps_Trebuchet by LineageOS.

the class TaskView method onTaskListVisibilityChanged.

public void onTaskListVisibilityChanged(boolean visible) {
    if (mTask == null) {
        return;
    }
    cancelPendingLoadTasks();
    if (visible) {
        // These calls are no-ops if the data is already loaded, try and load the high
        // resolution thumbnail if the state permits
        RecentsModel model = RecentsModel.INSTANCE.get(getContext());
        TaskThumbnailCache thumbnailCache = model.getThumbnailCache();
        TaskIconCache iconCache = model.getIconCache();
        mThumbnailLoadRequest = thumbnailCache.updateThumbnailInBackground(mTask, thumbnail -> mSnapshotView.setThumbnail(mTask, thumbnail));
        mIconLoadRequest = iconCache.updateIconInBackground(mTask, (task) -> {
            setIcon(task.icon);
            if (ENABLE_QUICKSTEP_LIVE_TILE.get() && isRunningTask()) {
                getRecentsView().updateLiveTileIcon(task.icon);
            }
            mDigitalWellBeingToast.initialize(mTask);
        });
    } else {
        mSnapshotView.setThumbnail(null, null);
        setIcon(null);
        // Reset the task thumbnail reference as well (it will be fetched from the cache or
        // reloaded next time we need it)
        mTask.thumbnail = null;
    }
}
Also used : Rect(android.graphics.Rect) Task(com.android.systemui.shared.recents.model.Task) Bundle(android.os.Bundle) Utilities.getDescendantCoordRelativeToAncestor(com.android.launcher3.Utilities.getDescendantCoordRelativeToAncestor) TestProtocol(com.android.launcher3.testing.TestProtocol) FrameLayout(android.widget.FrameLayout) END(android.view.Gravity.END) Animator(android.animation.Animator) LauncherSettings(com.android.launcher3.LauncherSettings) Drawable(android.graphics.drawable.Drawable) TouchDelegate(android.view.TouchDelegate) FloatProperty(android.util.FloatProperty) TOP(android.view.Gravity.TOP) ActivityOptions(android.app.ActivityOptions) AttributeSet(android.util.AttributeSet) ActivityManagerWrapper(com.android.systemui.shared.system.ActivityManagerWrapper) Interpolators(com.android.launcher3.anim.Interpolators) ScrollState(com.android.quickstep.views.RecentsView.ScrollState) Handler(android.os.Handler) START(android.view.Gravity.START) ROTATION_270(android.view.Surface.ROTATION_270) View(android.view.View) TransformingTouchDelegate(com.android.launcher3.util.TransformingTouchDelegate) Log(android.util.Log) RectF(android.graphics.RectF) Utilities(com.android.launcher3.Utilities) Surface(android.view.Surface) ObjectAnimator(android.animation.ObjectAnimator) LAUNCHER_TASK_LAUNCH_TAP(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_LAUNCH_TAP) TaskUtils(com.android.quickstep.TaskUtils) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) DeviceProfile(com.android.launcher3.DeviceProfile) Outline(android.graphics.Outline) List(java.util.List) TOUCH_RESPONSE_INTERPOLATOR(com.android.launcher3.anim.Interpolators.TOUCH_RESPONSE_INTERPOLATOR) CENTER_VERTICAL(android.view.Gravity.CENTER_VERTICAL) ROTATION_180(android.view.Surface.ROTATION_180) LauncherLogProto(com.android.launcher3.userevent.nano.LauncherLogProto) ActivityOptionsCompat(com.android.systemui.shared.system.ActivityOptionsCompat) Context(android.content.Context) AccessibilityNodeInfo(android.view.accessibility.AccessibilityNodeInfo) TaskThumbnailCache(com.android.quickstep.TaskThumbnailCache) PageCallbacks(com.android.quickstep.views.RecentsView.PageCallbacks) TimeInterpolator(android.animation.TimeInterpolator) Touch(com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch) ROTATION_90(android.view.Surface.ROTATION_90) ViewOutlineProvider(android.view.ViewOutlineProvider) UserEventDispatcher(com.android.launcher3.logging.UserEventDispatcher) QuickStepContract(com.android.systemui.shared.system.QuickStepContract) Intent(android.content.Intent) BOTTOM(android.view.Gravity.BOTTOM) FAST_OUT_SLOW_IN(com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN) AnimatorPlaybackController(com.android.launcher3.anim.AnimatorPlaybackController) Utilities.comp(com.android.launcher3.Utilities.comp) ENABLE_QUICKSTEP_LIVE_TILE(com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE) MotionEvent(android.view.MotionEvent) WorkspaceItemInfo(com.android.launcher3.model.data.WorkspaceItemInfo) GradientDrawable(android.graphics.drawable.GradientDrawable) Toast(android.widget.Toast) TaskOverlayFactory(com.android.quickstep.TaskOverlayFactory) RECENTS_LAUNCH_DURATION(com.android.launcher3.QuickstepAppTransitionManagerImpl.RECENTS_LAUNCH_DURATION) SystemShortcut(com.android.launcher3.popup.SystemShortcut) TaskCornerRadius(com.android.quickstep.util.TaskCornerRadius) InsetDrawable(android.graphics.drawable.InsetDrawable) Reusable(com.android.launcher3.util.ViewPool.Reusable) TaskIconCache(com.android.quickstep.TaskIconCache) RecentsOrientedState(com.android.quickstep.util.RecentsOrientedState) BaseDraggingActivity(com.android.launcher3.BaseDraggingActivity) Direction(com.android.launcher3.userevent.nano.LauncherLogProto.Action.Direction) Consumer(java.util.function.Consumer) LINEAR(com.android.launcher3.anim.Interpolators.LINEAR) PreviewPositionHelper(com.android.quickstep.views.TaskThumbnailView.PreviewPositionHelper) R(com.android.launcher3.R) TestLogging(com.android.launcher3.testing.TestLogging) RecentsModel(com.android.quickstep.RecentsModel) CENTER_HORIZONTAL(android.view.Gravity.CENTER_HORIZONTAL) ComponentKey(com.android.launcher3.util.ComponentKey) LAUNCHER_TASK_ICON_TAP_OR_LONGPRESS(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_ICON_TAP_OR_LONGPRESS) PagedOrientationHandler(com.android.launcher3.touch.PagedOrientationHandler) Collections(java.util.Collections) PendingAnimation(com.android.launcher3.anim.PendingAnimation) LENGTH_SHORT(android.widget.Toast.LENGTH_SHORT) ValueAnimator(android.animation.ValueAnimator) RecentsModel(com.android.quickstep.RecentsModel) TaskThumbnailCache(com.android.quickstep.TaskThumbnailCache) TaskIconCache(com.android.quickstep.TaskIconCache)

Example 5 with TaskIconCache

use of com.android.quickstep.TaskIconCache in project android_packages_apps_Launcher3 by ArrowOS.

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