标签:drag flow index none def 添加 only fda apt
private void initData() {
mTabFragmentAdapter = new TabFragmentFirstAdapter(getSupportFragmentManager(), mDeptType);
mVp.setAdapter(mTabFragmentAdapter);
mVp.addOnPageChangeListener(
new TabLayout.TabLayoutOnPageChangeListener(mTabLayout));
mVp.setOffscreenPageLimit(3);
mTabLayout.setupWithViewPager(mVp);
}
private void initData() {
mTabFragmentAdapter = new TabFragmentFirstAdapter(getSupportFragmentManager(), mDeptType);
mVp.setAdapter(mTabFragmentAdapter);
mVp.addOnPageChangeListener(
new TabLayout.TabLayoutOnPageChangeListener(mTabLayout));
mVp.setOffscreenPageLimit(3);
mTabLayout.setupWithViewPager(mVp);
}
private void reflashData(int type, List<WorkOrderBean.RowsBean> list) {
mTabFragmentAdapter.setDataAndType(type, list);
mTabFragmentAdapter.notifyDataSetChanged();
}
private void reflashData(int type, List<WorkOrderBean.RowsBean> list) {
mTabFragmentAdapter.setDataAndType(type, list);
mTabFragmentAdapter.notifyDataSetChanged();
}
@Override
public int getItemPosition(Object object) {
if (object instanceof WorkSubFirstFragment) {
if (list0.size()==0)return super.getItemPosition(object);
((WorkSubFirstFragment) object).updateView(list0);
} else if (object instanceof WorkSubFirstFragment1) {
if (list1.size()==0)return super.getItemPosition(object);
((WorkSubFirstFragment1) object).updateView(list1);
} else if (object instanceof WorkSubFirstFragment2) {
if (list2.size()==0)return super.getItemPosition(object);
((WorkSubFirstFragment2) object).updateView(list2);
}
return super.getItemPosition(object);
}
public int getItemPosition(Object object) {
if (object instanceof WorkSubFirstFragment) {
if (list0.size()==0)return super.getItemPosition(object);
((WorkSubFirstFragment) object).updateView(list0);
} else if (object instanceof WorkSubFirstFragment1) {
if (list1.size()==0)return super.getItemPosition(object);
((WorkSubFirstFragment1) object).updateView(list1);
} else if (object instanceof WorkSubFirstFragment2) {
if (list2.size()==0)return super.getItemPosition(object);
((WorkSubFirstFragment2) object).updateView(list2);
}
return super.getItemPosition(object);
}
public void updateView(List<WorkOrderBean.RowsBean> rows) {
reflashSelfData(rows);
}
x
public void updateView(List<WorkOrderBean.RowsBean> rows) {
reflashSelfData(rows);
}
list0.clear();
list0.addAll(list);
x
list0.clear();
list0.addAll(list);
ViewPager+TabLayout+Fragment刷新Fragment中的数据
标签:drag flow index none def 添加 only fda apt
原文地址:https://www.cnblogs.com/jeffery336699/p/9288627.html