private Drawable createShape(int backgroundColor,int strokeColor){
  GradientDrawable shape=new GradientDrawable();
  shape.setColor(backgroundColor);
  final float[] radiusArray=new float[8];
  Arrays.fill(radiusArray,radius);
  if (radiusTopLeft >= 0) {
    radiusArray[0]=radiusTopLeft;
    radiusArray[1]=radiusTopLeft;
  }
  if (radiusTopRight >= 0) {
    radiusArray[2]=radiusTopRight;
    radiusArray[3]=radiusTopRight;
  }
  if (radiusBottomRight >= 0) {
    radiusArray[4]=radiusBottomRight;
    radiusArray[5]=radiusBottomRight;
  }
  if (radiusBottomLeft >= 0) {
    radiusArray[6]=radiusBottomLeft;
    radiusArray[7]=radiusBottomLeft;
  }
  shape.setCornerRadii(radiusArray);
  shape.setStroke(stroke,strokeColor);
  return shape;
}

private Drawable createShape ( int backgroundColor , int strokeColor ) { GradientDrawable shape = new GradientDrawable ( ) ; shape . setColor ( backgroundColor ) ; final float [ ] radiusArray = new float [ 8 ] ; Arrays . fill ( radiusArray , radius ) ; if ( radiusTopLeft >= 0 ) { radiusArray [ 0 ] = radiusTopLeft ; radiusArray [ 1 ] = radiusTopLeft ; } if ( radiusTopRight >= 0 ) { radiusArray [ 2 ] = radiusTopRight ; radiusArray [ 3 ] = radiusTopRight ; } if ( radiusBottomRight >= 0 ) { radiusArray [ 4 ] = radiusBottomRight ; radiusArray [ 5 ] = radiusBottomRight ; } if ( radiusBottomLeft >= 0 ) { radiusArray [ 6 ] = radiusBottomLeft ; radiusArray [ 7 ] = radiusBottomLeft ; } shape . setCornerRadii ( radiusArray ) ; shape . setStroke ( stroke , strokeColor ) ; return shape ; }
creates background shape - setups background , stroke and radius .
