@@ -71,12 +71,10 @@ class MaterialButtonHelper {
71
71
private boolean cornerRadiusSet = false ;
72
72
private boolean checkable ;
73
73
private LayerDrawable rippleDrawable ;
74
- private boolean cornerAdjustmentEnabled ;
75
74
76
75
MaterialButtonHelper (MaterialButton button , @ NonNull ShapeAppearanceModel shapeAppearanceModel ) {
77
76
materialButton = button ;
78
77
this .shapeAppearanceModel = shapeAppearanceModel ;
79
- cornerAdjustmentEnabled = CornerAdjustmentFlag .isEnabled (button .getContext ());
80
78
}
81
79
82
80
void loadFromAttributes (@ NonNull TypedArray attributes ) {
@@ -214,15 +212,6 @@ private Drawable createBackground() {
214
212
215
213
if (IS_LOLLIPOP ) {
216
214
maskDrawable = new MaterialShapeDrawable (shapeAppearanceModel );
217
- if (strokeWidth > 0 && cornerAdjustmentEnabled ) {
218
- ShapeAppearanceModel adjustedShapeAppearanceModel =
219
- adjustShapeAppearanceModelCornerRadius (shapeAppearanceModel , strokeWidth / 2f );
220
- backgroundDrawable .setShapeAppearanceModel (adjustedShapeAppearanceModel );
221
- surfaceColorStrokeDrawable .setShapeAppearanceModel (adjustedShapeAppearanceModel );
222
- ((MaterialShapeDrawable ) maskDrawable )
223
- .setShapeAppearanceModel (adjustedShapeAppearanceModel );
224
- }
225
-
226
215
DrawableCompat .setTint (maskDrawable , Color .WHITE );
227
216
rippleDrawable =
228
217
new RippleDrawable (
@@ -308,15 +297,6 @@ private void updateStroke() {
308
297
? MaterialColors .getColor (materialButton , R .attr .colorSurface )
309
298
: Color .TRANSPARENT );
310
299
}
311
- if (IS_LOLLIPOP && cornerAdjustmentEnabled ) {
312
- ShapeAppearanceModel shapeAppearance =
313
- adjustShapeAppearanceModelCornerRadius (shapeAppearanceModel , strokeWidth / 2f );
314
- updateButtonShape (shapeAppearance );
315
- // Some APIs don't unwrap the drawable correctly.
316
- if (maskDrawable != null ) {
317
- ((MaterialShapeDrawable ) maskDrawable ).setShapeAppearanceModel (shapeAppearance );
318
- }
319
- }
320
300
}
321
301
}
322
302
@@ -327,21 +307,14 @@ void setCornerRadius(int cornerRadius) {
327
307
this .cornerRadius = cornerRadius ;
328
308
cornerRadiusSet = true ;
329
309
330
- setShapeAppearanceModel (
331
- shapeAppearanceModel .withCornerRadius (
332
- cornerAdjustmentEnabled ? cornerRadius + (strokeWidth / 2f ) : cornerRadius ));
310
+ setShapeAppearanceModel (shapeAppearanceModel .withCornerRadius (cornerRadius ));
333
311
}
334
312
}
335
313
336
314
int getCornerRadius () {
337
315
return cornerRadius ;
338
316
}
339
317
340
- private ShapeAppearanceModel adjustShapeAppearanceModelCornerRadius (
341
- @ NonNull ShapeAppearanceModel shapeAppearanceModel , float cornerRadiusAdjustment ) {
342
- return shapeAppearanceModel .withAdjustedCorners (cornerRadiusAdjustment );
343
- }
344
-
345
318
@ Nullable
346
319
private MaterialShapeDrawable getMaterialShapeDrawable (boolean getSurfaceColorStrokeDrawable ) {
347
320
if (rippleDrawable != null && rippleDrawable .getNumberOfLayers () > 0 ) {
0 commit comments