Removing widget preview caching

> All previews are generated on demand when the corresponding
  header expands
> Using ItemAnimator to animate layout changes when preview loads

Bug: 196238313
Test: Manual
Change-Id: I0cb859c8443c2c536399e4063f58baecfc7416ad
This commit is contained in:
Sunny Goyal
2021-08-11 15:13:17 -07:00
parent 48b012b148
commit ed2a55f413
24 changed files with 241 additions and 1633 deletions

View File

@@ -32,7 +32,6 @@ import androidx.annotation.Nullable;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.R;
import com.android.launcher3.model.WidgetItem;
import com.android.launcher3.widget.WidgetCell;
@@ -109,10 +108,7 @@ public final class WidgetsRecommendationTableLayout extends TableLayout {
for (WidgetItem widgetItem : widgetItems) {
WidgetCell widgetCell = addItemCell(tableRow);
widgetCell.setPreviewSize(widgetItem, data.mPreviewScale);
widgetCell.applyFromCellItem(widgetItem,
LauncherAppState.getInstance(getContext()).getWidgetCache());
widgetCell.ensurePreview();
widgetCell.applyFromCellItem(widgetItem, data.mPreviewScale);
}
addView(tableRow);
}