前往这里排版看着更舒服些
TextView tv_oval_line = (TextView) findViewById(R.id.tv_oval_line);
XSelector.shapeSelector()
.setShape(GradientDrawable.OVAL)
.defaultBgColor(R.color.colorAccent)
.defaultStrokeColor(R.color.colorAccent)
.strokeWidth(1)
.into(tv_oval_line);
+ 方形虚线圆角边框
TextView tv_rect_dash_line_radius = (TextView)findViewById(R.id.tv_rect_dash_line_radius);
XSelector.shapeSelector()
.setShape(GradientDrawable.RECTANGLE)
.defaultBgColor(R.color.colorAccent)
.dashLine(1, R.color.colorPrimary, 5, 5)
.radius(5)
.into(tv_rect_dash_line_radius);
TextView tv_rect_diagonal2 = (TextView)findViewById(R.id.tv_rect_diagonal2);
XSelector.shapeSelector()
.setShape(GradientDrawable.RECTANGLE)
.defaultBgColor(R.color.colorAccent)
.trRadius(10)
.blRadius(10)
.into(tv_rect_diagonal2);
+ 触摸反馈
```
TextView tv_oval_solid = (TextView) findViewById(R.id.tv_oval_solid);
XSelector.shapeSelector()
.setShape(GradientDrawable.OVAL)
.defaultBgColor(R.color.colorAccent)
.pressedBgColor(R.color.colorPrimary)
.into(tv_oval_solid);
+ 渐变效果
TextView tv_gradient_linear_tb = (TextView)findViewById(R.id.tv_gradient_linear_tb);
XSelector.shapeSelector()
.setShape(GradientDrawable.RECTANGLE)
.gradientLinear(ShapeSelector.TOP_BOTTOM, R.color.colorAccent, R.color.colorPrimary)
.into(tv_gradient_linear_tb);
TextView tv_gradient_sweep = (TextView)findViewById(R.id.tv_gradient_sweep);
XSelector.shapeSelector()
.setShape(GradientDrawable.OVAL)
.gradientSweep(R.color.colorAccent, R.color.colorPrimary)
.into(tv_gradient_sweep);
TextView tv_gradient_radial = (TextView)findViewById(R.id.tv_gradient_radial);
XSelector.shapeSelector()
.setShape(GradientDrawable.OVAL)
.gradientRadial(30, R.color.colorAccent, R.color.colorPrimary)
.into(tv_gradient_radial);