public void initialize( CardViewDelegate cardViewDelegate, Context context, int i, float f, float f2, float f3) { Drawable createBackground = createBackground(context, i, f, f2, f3); createBackground.setAddPaddingForCorners(cardViewDelegate.getPreventCornerOverlap()); cardViewDelegate.setBackgroundDrawable(createBackground); updatePadding(cardViewDelegate); }
public void updatePadding(CardViewDelegate cardViewDelegate) { Rect rect = new Rect(); getShadowBackground(cardViewDelegate).getMaxShadowAndCornerPadding(rect); ((View) cardViewDelegate) .setMinimumHeight((int) Math.ceil((double) getMinHeight(cardViewDelegate))); ((View) cardViewDelegate) .setMinimumWidth((int) Math.ceil((double) getMinWidth(cardViewDelegate))); cardViewDelegate.setShadowPadding(rect.left, rect.top, rect.right, rect.bottom); }
private RoundRectDrawableWithShadow getShadowBackground(CardViewDelegate cardViewDelegate) { return (RoundRectDrawableWithShadow) cardViewDelegate.getBackground(); }
public void onPreventCornerOverlapChanged(CardViewDelegate cardViewDelegate) { getShadowBackground(cardViewDelegate) .setAddPaddingForCorners(cardViewDelegate.getPreventCornerOverlap()); updatePadding(cardViewDelegate); }