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);
}
}
}
Aggregations