@@ -73,6 +73,7 @@ interface STATE {
73
73
private int mLoadingSize ;
74
74
private int mLoadingPosition ;
75
75
76
+ private boolean isSizeChanging ; //当前布局尺寸正发生改变
76
77
private boolean nextShrinkReverse ; //下一步是否是恢复动画
77
78
private boolean isCancel ; //是取消当前动画
78
79
private boolean isFail ;
@@ -164,12 +165,13 @@ public void onAnimationStart(Animator animation) {
164
165
if (!nextShrinkReverse ) {
165
166
//begin shrink
166
167
curStatus = STATE .SHRINKING ;
168
+ isSizeChanging = true ;
167
169
if (mOnLoadingListener != null ) {
168
170
mOnLoadingListener .onShrinking ();
169
171
}
170
172
171
173
saveStatus ();
172
- setText ("" );
174
+ LoadingButton . super . setText ("" , BufferType . NORMAL );
173
175
setCompoundDrawablePadding (0 );
174
176
setCompoundDrawablesRelative (mLoadingDrawable , null , null , null );
175
177
setEnableTextInCenter (false );
@@ -197,6 +199,7 @@ public void onAnimationEnd(Animator animation) {
197
199
} else {
198
200
//restore over
199
201
curStatus = STATE .IDE ;
202
+ isSizeChanging = false ;
200
203
restoreStatus ();
201
204
endCallbackListener ();
202
205
nextShrinkReverse = false ;
@@ -611,10 +614,11 @@ public void setCompoundDrawablePadding(int pad) {
611
614
}
612
615
613
616
617
+
614
618
@ Override
615
619
public void setText (CharSequence text , BufferType type ) {
616
- if (enableShrink && ( curStatus != STATE . IDE ) ) {
617
- text = "" ;
620
+ if (enableShrink && isSizeChanging ) {
621
+ return ;
618
622
}
619
623
super .setText (text , type );
620
624
}
0 commit comments