<LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/fenleiPullContentLayout" android:orientation="vertical"> </LinearLayout>
pullContentLayout.removeAllViews();
pullViews.clear();
for(int i=0;i<leftEntityData.size();i++){
PullToRefreshProView pullview = (PullToRefreshProView) inflater.inflate(R.layout.fenleipro_item, null);
LayoutParams param = new LayoutParams(LayoutParams.MATCH_PARENT, scrollHeight);
pullview.setLayoutParams(param);
LinearLayout pullayout = (LinearLayout) pullview.findViewById(R.id.fenleirightlayout);
RightAdapter adapter = new RightAdapter(rightEntityList.get(i));
pullayout.removeAllViews();
for(int k=0;k<adapter.getCount();k++){
View view = adapter.getView(k, null, null);
pullayout.addView(view,k);
}
pullViews.add(pullview);
pullContentLayout.addView(pullview, i);
if(i==0){
pullview.setHeaderRefresh(false);
pullview.setOnFooterRefreshListener(new MyOnRefreshListener(i));
}else if(i==leftEntityData.size()-1){
pullview.setFooterRefresh(false);
pullview.setOnHeaderRefreshListener(new MyOnRefreshListener(i));
}else{
pullview.setOnHeaderRefreshListener(new MyOnRefreshListener(i));
pullview.setOnFooterRefreshListener(new MyOnRefreshListener(i));
}
}
private class MyOnRefreshListener implements OnHeaderRefreshListener,OnFooterRefreshListener{
@Override
public void onFooterRefresh(PullToRefreshProView view) {
}
@Override
public void onHeaderRefresh(PullToRefreshProView view) {
}
}
public class PullToRefreshUpAnimation extends Animation{
private View view1,view2;
private int delt;
private int topMarginView1 = 0;
public PullToRefreshUpAnimation(Context context,View v1,View v2,int from,int to){
super();
view1 = v1;
view2 = v2;
delt = to - from;
topMarginView1 = view1.getMeasuredHeight();
setDuration(450);
setFillAfter(true);
setInterpolator(new DecelerateInterpolator());
}
public PullToRefreshUpAnimation(Context context, AttributeSet attrs) {
super(context, attrs);
// TODO Auto-generated constructor stub
setDuration(450);
setFillAfter(true);
setInterpolator(new DecelerateInterpolator());
}
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
android.widget.LinearLayout.LayoutParams param = (android.widget.LinearLayout.LayoutParams)view2.getLayoutParams();
param.topMargin = (int) (interpolatedTime*delt);
param.height = Math.abs(delt);
android.widget.LinearLayout.LayoutParams param1 = (android.widget.LinearLayout.LayoutParams) view1.getLayoutParams();
param1.topMargin = (int) (topMarginView1*(interpolatedTime-1));
param1.height = topMarginView1;
view1.setLayoutParams(param1);
view2.setLayoutParams(param);
}
@Override
public boolean willChangeBounds() {
// TODO Auto-generated method stub
return true;
}
}
public class PullToRefreshAnimation extends Animation{
private View view;
private int delt;
public PullToRefreshAnimation(Context context,View v,int from,int to){
super();
view = v;
delt = to - from;
setDuration(450);
setFillAfter(true);
setInterpolator(new DecelerateInterpolator());
}
public PullToRefreshAnimation(Context context, AttributeSet attrs) {
super(context, attrs);
// TODO Auto-generated constructor stub
setDuration(450);
setFillAfter(true);
setInterpolator(new DecelerateInterpolator());
}
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
android.widget.LinearLayout.LayoutParams param = (android.widget.LinearLayout.LayoutParams)view.getLayoutParams();
param.topMargin = (int) (interpolatedTime*delt);
param.height = Math.abs(delt);
param.width = android.widget.LinearLayout.LayoutParams.MATCH_PARENT;
view.setLayoutParams(param);
}
@Override
public boolean willChangeBounds() {
// TODO Auto-generated method stub
return true;
}
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有