@@ -589,7 +589,7 @@ protected void onLayout(boolean changed, int left, int top, int right, int botto
589589 int curOrientation = getResources ().getConfiguration ().orientation ;
590590 if (orientation != curOrientation ) {
591591 orientation = curOrientation ;
592- recoverOriginalLayoutParams () ;
592+ originalWidth = UNSET ;
593593 }
594594 if (originalWidth == UNSET ) {
595595 originalWidth = getMeasuredWidth ();
@@ -634,7 +634,7 @@ void recoverOriginalLayoutParams() {
634634
635635 @ Override
636636 public void setWidth (@ Px int pixels ) {
637- recoverOriginalLayoutParams () ;
637+ originalWidth = UNSET ;
638638 super .setWidth (pixels );
639639 }
640640
@@ -679,19 +679,19 @@ public void refreshDrawableState() {
679679
680680 @ Override
681681 public void setText (CharSequence text , BufferType type ) {
682- recoverOriginalLayoutParams () ;
682+ originalWidth = UNSET ;
683683 super .setText (text , type );
684684 }
685685
686686 @ Override
687687 public void setTextAppearance (Context context , int resId ) {
688- recoverOriginalLayoutParams () ;
688+ originalWidth = UNSET ;
689689 super .setTextAppearance (context , resId );
690690 }
691691
692692 @ Override
693693 public void setTextSize (int unit , float size ) {
694- recoverOriginalLayoutParams () ;
694+ originalWidth = UNSET ;
695695 super .setTextSize (unit , size );
696696 }
697697
@@ -910,7 +910,7 @@ void setInternalBackground(Drawable background) {
910910 @ Override
911911 public void setCompoundDrawablePadding (@ Px int padding ) {
912912 if (getCompoundDrawablePadding () != padding ) {
913- recoverOriginalLayoutParams () ;
913+ originalWidth = UNSET ;
914914 }
915915 super .setCompoundDrawablePadding (padding );
916916 }
@@ -958,7 +958,7 @@ public void setIconSize(@Px int iconSize) {
958958 if (maybeRunAfterWidthAnimation (() -> setIconSize (iconSize ))) {
959959 return ;
960960 }
961- recoverOriginalLayoutParams () ;
961+ originalWidth = UNSET ;
962962 this .iconSize = iconSize ;
963963 updateIcon (/* needsIconReset= */ true );
964964 updateSecondaryIcon (/* needsIconReset= */ true );
@@ -991,7 +991,7 @@ public void setIcon(@Nullable Drawable icon) {
991991 if (maybeRunAfterWidthAnimation (() -> setIcon (icon ))) {
992992 return ;
993993 }
994- recoverOriginalLayoutParams () ;
994+ originalWidth = UNSET ;
995995 this .icon = icon ;
996996 updateIcon (/* needsIconReset= */ true );
997997 updateIconPosition (getMeasuredWidth (), getMeasuredHeight ());
@@ -1106,7 +1106,7 @@ public void setSecondaryIcon(@Nullable Drawable icon) {
11061106 if (maybeRunAfterWidthAnimation (() -> setIcon (icon ))) {
11071107 return ;
11081108 }
1109- recoverOriginalLayoutParams () ;
1109+ originalWidth = UNSET ;
11101110 secondaryIcon = icon ;
11111111 stopNullSecondaryIconUpdate = false ;
11121112 updateSecondaryIcon (/* needsIconReset= */ true );
0 commit comments