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

Commit 11ec51c4 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Correct the preview generation for App Widgets." into sc-dev

parents 26524ece 813856ab
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -457,10 +457,24 @@ public class WidgetPreviewLoader {
            drawable.setBounds(x, 0, x + previewWidth, previewHeight);
            drawable.draw(c);
        } else {
            RectF boxRect = drawBoxWithShadow(c, previewWidth, previewHeight);
            RectF boxRect;

            // Draw horizontal and vertical lines to represent individual columns.
            final Paint p = new Paint(Paint.ANTI_ALIAS_FLAG);

            if (Utilities.ATLEAST_S) {
                boxRect = new RectF(/* left= */ 0, /* top= */ 0, /* right= */
                        previewWidth, /* bottom= */ previewHeight);

                p.setStyle(Paint.Style.FILL);
                p.setColor(Color.WHITE);
                float roundedCorner = mContext.getResources().getDimension(
                        android.R.dimen.system_app_widget_background_radius);
                c.drawRoundRect(boxRect, roundedCorner, roundedCorner, p);
            } else {
                boxRect = drawBoxWithShadow(c, previewWidth, previewHeight);
            }

            p.setStyle(Paint.Style.STROKE);
            p.setStrokeWidth(mContext.getResources()
                    .getDimension(R.dimen.widget_preview_cell_divider_width));