android-cjj/Android-MaterialRefreshLayout

自动刷新时 圆形箭头固定不动

Closed this issue · 4 comments

materialRefreshLayout.autoRefresh() 设置自动刷新的时候 圆形箭头会固定不动,没有旋转动画效果。

to me ,How to solve

我继承后重写了。
public class RefreshLayout extends MaterialRefreshLayout {
public RefreshLayout(Context context) {
super(context);
}

public RefreshLayout(Context context, AttributeSet attrs) {
    super(context, attrs);
}

public RefreshLayout(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
}


/**
 *
 * @param delay 毫秒
 */
public void autoRefresh(int delay){


    this.postDelayed(new Runnable() {
        @Override
        public void run() {
            RefreshLayout.super.autoRefresh();
        }
    }, delay);


}
public  void autoRefresh(){
    autoRefresh(500);
}

private OnRefreshListener listener;
public void setOnRefreshListener(OnRefreshListener listener){
this.listener=listener;
if (this.listener==null){
return;
}
this.setMaterialRefreshListener(new MaterialRefreshListener(){

        @Override
        public void onRefresh(MaterialRefreshLayout materialRefreshLayout) {
            RefreshLayout.this.listener.onRefresh();
        }

        @Override
        public void onRefreshLoadMore(MaterialRefreshLayout materialRefreshLayout) {
            RefreshLayout.this.listener.onLoad();
        }
    });
}


public interface OnRefreshListener{
    void onRefresh();
    void onLoad();
}

}

ok ,I know,thank you

Progress bar does not display