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

Commit 3ff0ee1a authored by Steven Ng's avatar Steven Ng
Browse files

Fix rounded corners for shortcut & generated preview shadow box

Test: Open the widgets picker and locate shortcuts. Rounded corners are
      rendered on the rectangular box of a shortcut
Fix: 191948061
Change-Id: I24e4dc4c4a9c9c7e875444db5294f6c33f50db85
parent 93068d1c
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -98,12 +98,17 @@ public class DatabaseWidgetPreviewLoader implements WidgetPreviewLoader {
    private final IconCache mIconCache;
    private final UserCache mUserCache;
    private final CacheDb mDb;
    private final float mPreviewBoxCornerRadius;

    public DatabaseWidgetPreviewLoader(Context context, IconCache iconCache) {
        mContext = context;
        mIconCache = iconCache;
        mUserCache = UserCache.INSTANCE.get(context);
        mDb = new CacheDb(context);
        float previewCornerRadius = RoundedCornerEnforcement.computeEnforcedRadius(context);
        mPreviewBoxCornerRadius = previewCornerRadius > 0
                ? previewCornerRadius
                : mContext.getResources().getDimension(R.dimen.widget_preview_corner_radius);
    }

    /**
@@ -521,7 +526,7 @@ public class DatabaseWidgetPreviewLoader implements WidgetPreviewLoader {

        ShadowGenerator.Builder builder = new ShadowGenerator.Builder(Color.WHITE);
        builder.shadowBlur = res.getDimension(R.dimen.widget_preview_shadow_blur);
        builder.radius = res.getDimension(R.dimen.widget_preview_corner_radius);
        builder.radius = mPreviewBoxCornerRadius;
        builder.keyShadowDistance = res.getDimension(R.dimen.widget_preview_key_shadow_distance);

        builder.bounds.set(builder.shadowBlur, builder.shadowBlur,