Merge "Make AdaptiveIcon support different inset"
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user