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

Commit a6325e55 authored by Tracy Zhou's avatar Tracy Zhou
Browse files

Render user's actual workspace in ThemePicker preview (Part 4)

Clear Glide memory cache when the grid fragment is being reloaded. This is to fix the case when user changes home screen layout before the preview images expire from Glide's cache.

Bug: 144052839
Test: Go to grid options, swipe home, and go to grid options again immediately. Make sure preview for the current grid choice is reloaded.
Change-Id: Ic805c5d4eee1ba8805608c775d5725929a6a9a11
parent 4b1178c1
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ import com.android.wallpaper.module.CurrentWallpaperInfoFactory;
import com.android.wallpaper.module.InjectorProvider;
import com.android.wallpaper.picker.ToolbarFragment;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;

import java.util.List;
@@ -131,6 +132,9 @@ public class GridFragment extends ToolbarFragment {
        final Resources res = getResources();
        DisplayMetrics dm = res.getDisplayMetrics();
        mScreenAspectRatio = (float) dm.heightPixels / dm.widthPixels;

        // Clear memory cache whenever grid fragment view is being loaded.
        Glide.get(getContext()).clearMemory();
        setUpOptions();
        view.findViewById(R.id.apply_button).setOnClickListener(v -> {
            mGridManager.apply(mSelectedOption,  new Callback() {