Skip to content

Commit

Permalink
1、更改停止loading的模式
Browse files Browse the repository at this point in the history
  • Loading branch information
zincPower committed Jun 21, 2019
1 parent 2926ac0 commit 09ad587
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public OrdinaryPullRefreshLoadView(Context context, @Nullable AttributeSet attrs

@Override
protected void onMoving(MoveInfo moveInfo) {
Log.i(OrdinaryPullRefreshLoadView.class.getSimpleName(), "onMoving: " + moveInfo.toString());
// Log.i(OrdinaryPullRefreshLoadView.class.getSimpleName(), "onMoving: " + moveInfo.toString());
}

@Override
Expand Down Expand Up @@ -129,10 +129,10 @@ protected void onReleaseToAction() {
@Override
protected void onExecuting() {
this.mBallLoader.setVisibility(VISIBLE);
//如果loading没有开启,则开启动画
if (!mBallLoader.isLoading()) {
mBallLoader.startAnimator();
}
// //如果loading没有开启,则开启动画
// if (!mBallLoader.isLoading()) {
// mBallLoader.startAnimator();
// }

//需要先清空箭头状态,后在进行视图隐藏,否则会有问题
this.mIvArrow.clearAnimation();
Expand All @@ -147,7 +147,7 @@ protected void onDone() {
this.mIvArrow.setVisibility(GONE);
this.mBallLoader.setVisibility(GONE);
this.mTvRefreshStatus.setText(getContext().getString(R.string.jrecycle_refreshed));
this.mBallLoader.stopAnimator();
// this.mBallLoader.stopAnimator();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import android.graphics.Paint;
import android.support.v4.content.ContextCompat;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;

import com.zinc.librecycleview.R;
Expand Down Expand Up @@ -195,4 +196,16 @@ public void stopAnimator() {

mAnimatorEnable = false;
}
}

@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
startAnimator();
}

@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
stopAnimator();
}
}

0 comments on commit 09ad587

Please sign in to comment.