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

Commit 2847a60b authored by Demon000's avatar Demon000 Committed by Bruno Martins
Browse files

ThemePicker: limit number of icon previews shown

Change-Id: I8a1506fd0e8cddbaf4d6df28b75045c2e7801a81
parent a3a7f48c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -53,6 +53,8 @@ import java.util.List;
public class ShapeOptionsProvider extends ThemeComponentOptionProvider<ShapeOption> {

    private static final String TAG = "ShapeOptionsProvider";
    private static final int MAX_ICON_SHAPE_PREVIEWS = 6;

    private final String[] mShapePreviewIconPackages;
    private int mThumbSize;

@@ -105,6 +107,10 @@ public class ShapeOptionsProvider extends ThemeComponentOptionProvider<ShapeOpti
    private List<Drawable> getShapedIcons(Path path) {
        List<Drawable> icons = new ArrayList<>();
        for (String packageName : mShapePreviewIconPackages) {
            if (icons.size() == MAX_ICON_SHAPE_PREVIEWS) {
                break;
            }

            try {
                Drawable appIcon = mContext.getPackageManager().getApplicationIcon(packageName);
                if (appIcon instanceof AdaptiveIconDrawable) {