-
Notifications
You must be signed in to change notification settings - Fork 4
IFooterView_cn
Zone edited this page Jan 18, 2017
·
1 revision
public interface IFooterView {
/**
* 全局更换头的配置
* 主要是为了复制头部对象,复制想要复制的属性
* 注意:返回null时候,默认就是LoadFooter了
*/
IFooterView clone_();
/**
* 获取footer布局
* @param zRefreshLayout
* @return
*/
View getView(ZRefreshLayout zRefreshLayout);
/**
* loadMore中
* @param footerHeight
*/
void onStart(float footerHeight);
/**
* loadMore 结束
*/
void onComplete();
}
public class MeterialFooter implements IFooterView {
private MeterialCircle mMeterialCircle;
private View rootView;
@Override
public View getView(ZRefreshLayout zRefreshLayout) {
rootView = View.inflate(zRefreshLayout.getContext(), R.layout.header_meterial, null);
//注意inflate那种模式 第一层需要空出去 不然会wrapcontent
LinearLayout ll_main = (LinearLayout) rootView.findViewById(R.id.ll_main);
int[] screenPixs = ScreenUtils.getScreenPix((Activity) zRefreshLayout.getContext());
ll_main.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT
, (int) (screenPixs[1] * 0.1)));
mMeterialCircle=new MeterialCircle(ll_main,(int) (screenPixs[1] * 0.08));
rootView.setVisibility(View.INVISIBLE);
return rootView;
}
@Override
public void onStart(float footerHeight) {
rootView.setVisibility(View.VISIBLE);
mMeterialCircle.start();
}
@Override
public void onComplete() {
rootView.setVisibility(View.INVISIBLE);
mMeterialCircle.stop();
}
@Override
public IFooterView clone_() {
MeterialFooter clone =new MeterialFooter();
return clone;
}
}