@@ -71,12 +71,10 @@ class MaterialButtonHelper {
7171 private boolean cornerRadiusSet = false ;
7272 private boolean checkable ;
7373 private LayerDrawable rippleDrawable ;
74- private boolean cornerAdjustmentEnabled ;
7574
7675 MaterialButtonHelper (MaterialButton button , @ NonNull ShapeAppearanceModel shapeAppearanceModel ) {
7776 materialButton = button ;
7877 this .shapeAppearanceModel = shapeAppearanceModel ;
79- cornerAdjustmentEnabled = CornerAdjustmentFlag .isEnabled (button .getContext ());
8078 }
8179
8280 void loadFromAttributes (@ NonNull TypedArray attributes ) {
@@ -214,15 +212,6 @@ private Drawable createBackground() {
214212
215213 if (IS_LOLLIPOP ) {
216214 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-
226215 DrawableCompat .setTint (maskDrawable , Color .WHITE );
227216 rippleDrawable =
228217 new RippleDrawable (
@@ -308,15 +297,6 @@ private void updateStroke() {
308297 ? MaterialColors .getColor (materialButton , R .attr .colorSurface )
309298 : Color .TRANSPARENT );
310299 }
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- }
320300 }
321301 }
322302
@@ -327,21 +307,14 @@ void setCornerRadius(int cornerRadius) {
327307 this .cornerRadius = cornerRadius ;
328308 cornerRadiusSet = true ;
329309
330- setShapeAppearanceModel (
331- shapeAppearanceModel .withCornerRadius (
332- cornerAdjustmentEnabled ? cornerRadius + (strokeWidth / 2f ) : cornerRadius ));
310+ setShapeAppearanceModel (shapeAppearanceModel .withCornerRadius (cornerRadius ));
333311 }
334312 }
335313
336314 int getCornerRadius () {
337315 return cornerRadius ;
338316 }
339317
340- private ShapeAppearanceModel adjustShapeAppearanceModelCornerRadius (
341- @ NonNull ShapeAppearanceModel shapeAppearanceModel , float cornerRadiusAdjustment ) {
342- return shapeAppearanceModel .withAdjustedCorners (cornerRadiusAdjustment );
343- }
344-
345318 @ Nullable
346319 private MaterialShapeDrawable getMaterialShapeDrawable (boolean getSurfaceColorStrokeDrawable ) {
347320 if (rippleDrawable != null && rippleDrawable .getNumberOfLayers () > 0 ) {
0 commit comments