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

Commit 24eca8d0 authored by Yanting Yang's avatar Yanting Yang Committed by Android (Google) Code Review
Browse files

Merge "Make AdaptiveIcon support different inset"

parents f2e56d1f 157639fc
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -45,12 +45,15 @@ public class AdaptiveIcon extends LayerDrawable {
    private AdaptiveConstantState mAdaptiveConstantState;

    public AdaptiveIcon(Context context, Drawable foreground) {
        this(context, foreground, R.dimen.dashboard_tile_foreground_image_inset);
    }

    public AdaptiveIcon(Context context, Drawable foreground, int insetResId) {
        super(new Drawable[]{
                new AdaptiveIconShapeDrawable(context.getResources()),
                foreground
        });
        final int insetPx = context.getResources()
                .getDimensionPixelSize(R.dimen.dashboard_tile_foreground_image_inset);
        final int insetPx = context.getResources().getDimensionPixelSize(insetResId);
        setLayerInset(1 /* index */, insetPx, insetPx, insetPx, insetPx);
        mAdaptiveConstantState = new AdaptiveConstantState(context, foreground);
    }