日期:2014-05-18 浏览次数:20747 次
handler.post(new Runnable(){
public void run() {
System.out.println("开始");
if (choose) {
List<Vehicle> list = treeNodes.get(positionGroup).childs;
for (int k = 0; k < list.size(); k++) {
for (int j = 0; j < selectedVehicles.size(); j++) {
int id = list.get(k).getId();
Vehicle vhc = selectedVehicles.get(j);
if (vhc.getId() == id) { selectedVehicles.remove(j); TreeViewAdapter.this.selDAO.delete(vhc.getId());
LinearLayout linearLayout = (LinearLayout) getChildView(
positionGroup, k, isLastChild,
view, p);
CheckBox box = (CheckBox) linearLayout
.findViewById(list.get(k)
.getId());
box.setChecked(false);
box.setButtonDrawable(R.drawable.check);
}
}
}
} else {
List<Vehicle> list = treeNodes.get(positionGroup).childs;
for (int j = 0; j < list.size(); j++) {
LinearLayout linearLayout = (LinearLayout) getChildView(
positionGroup, j, isLastChild, view, p);
Vehicle vhc = list.get(j);
CheckBox box = (CheckBox) linearLayout
.findViewById(vhc.getId());
if (!box.isChecked()) {
if (isCanAdd(selectedVehicles, vhc.getId())) {
selectedVehicles.add(vhc);
TreeViewAdapter.this.selDAO.insert(vhc);
}
box.setChecked(true);
box.setButtonDrawable(R.drawable.checked);
}
}