自动刷新时 圆形箭头固定不动
Closed this issue · 4 comments
MoonandMind commented
materialRefreshLayout.autoRefresh() 设置自动刷新的时候 圆形箭头会固定不动,没有旋转动画效果。
fengyun041 commented
to me ,How to solve
MoonandMind commented
我继承后重写了。
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();
}
}
fengyun041 commented
ok ,I know,thank you
fengyun041 commented
Progress bar does not display