@@ -236,7 +236,7 @@ public class TextInputLayout extends LinearLayout {
236
236
@ NonNull private ShapeAppearanceModel shapeAppearanceModel ;
237
237
238
238
private final int boxLabelCutoutPaddingPx ;
239
- private int boxLabelCutoutWidth ;
239
+ private int boxLabelCutoutHeight ;
240
240
@ BoxBackgroundMode private int boxBackgroundMode ;
241
241
private int boxCollapsedPaddingTopPx ;
242
242
private int boxStrokeWidthPx ;
@@ -4077,18 +4077,19 @@ private void openCutout() {
4077
4077
final RectF cutoutBounds = tmpRectF ;
4078
4078
collapsingTextHelper .getCollapsedTextActualBounds (
4079
4079
cutoutBounds , editText .getWidth (), editText .getGravity ());
4080
- boxLabelCutoutWidth = boxStrokeWidthPx ;
4081
- cutoutBounds .bottom = cutoutBounds .top + boxLabelCutoutWidth ;
4082
4080
applyCutoutPadding (cutoutBounds );
4083
- // Offset the cutout bounds by the TextInputLayout's left and top paddings to ensure that the
4084
- // cutout is inset relative to the TextInputLayout's bounds.
4085
- cutoutBounds .offset (-getPaddingLeft (), -getPaddingTop ());
4081
+ boxLabelCutoutHeight = boxStrokeWidthPx ;
4082
+ cutoutBounds .top = 0 ;
4083
+ cutoutBounds .bottom = boxLabelCutoutHeight ;
4084
+ // Offset the cutout bounds by the TextInputLayout's left padding to ensure that the cutout is
4085
+ // inset relative to the TextInputLayout's bounds.
4086
+ cutoutBounds .offset (-getPaddingLeft (), 0 );
4086
4087
((CutoutDrawable ) boxBackground ).setCutout (cutoutBounds );
4087
4088
}
4088
4089
4089
4090
/** If stroke changed width, cutout bounds need to be recalculated. **/
4090
4091
private void updateCutout () {
4091
- if (cutoutEnabled () && !hintExpanded && boxLabelCutoutWidth != boxStrokeWidthPx ) {
4092
+ if (cutoutEnabled () && !hintExpanded && boxLabelCutoutHeight != boxStrokeWidthPx ) {
4092
4093
closeCutout ();
4093
4094
openCutout ();
4094
4095
}
0 commit comments