コード例 #1
0
 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);
 }
コード例 #2
0
 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);
 }
コード例 #3
0
 private RoundRectDrawableWithShadow getShadowBackground(CardViewDelegate cardViewDelegate) {
   return (RoundRectDrawableWithShadow) cardViewDelegate.getBackground();
 }
コード例 #4
0
 public void onPreventCornerOverlapChanged(CardViewDelegate cardViewDelegate) {
   getShadowBackground(cardViewDelegate)
       .setAddPaddingForCorners(cardViewDelegate.getPreventCornerOverlap());
   updatePadding(cardViewDelegate);
 }