|
|
|
|
@ -31,6 +31,7 @@ public class CheckListActivity extends BaseActivity implements AdapterClickCall
|
|
|
|
|
private CheckListAdapter adapter;
|
|
|
|
|
private List<CheckTaskInfo> list;
|
|
|
|
|
private ObservableBoolean createState;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
|
@ -54,7 +55,8 @@ public class CheckListActivity extends BaseActivity implements AdapterClickCall
|
|
|
|
|
MyResult body = response.body();
|
|
|
|
|
if (body.getCode() == 0) {
|
|
|
|
|
createState.set(false);
|
|
|
|
|
list=gson.fromJson(body.getData().toString(),new TypeToken<List<CheckTaskInfo>>(){}.getType());
|
|
|
|
|
list = gson.fromJson(body.getData().toString(), new TypeToken<List<CheckTaskInfo>>() {
|
|
|
|
|
}.getType());
|
|
|
|
|
adapter.setList(list);
|
|
|
|
|
adapter.notifyDataSetChanged();
|
|
|
|
|
} else {
|
|
|
|
|
@ -95,6 +97,21 @@ public class CheckListActivity extends BaseActivity implements AdapterClickCall
|
|
|
|
|
intent.putExtra("id", checkTaskInfo.getId());
|
|
|
|
|
intent.putExtra("inspectionId", checkTaskInfo.getInspectionId());
|
|
|
|
|
intent.putExtra("code", checkTaskInfo.getLocationCode());
|
|
|
|
|
startActivity(intent);
|
|
|
|
|
intent.putExtra("backIndex", index);
|
|
|
|
|
startActivityForResult(intent, 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@SuppressLint("NotifyDataSetChanged")
|
|
|
|
|
@Override
|
|
|
|
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
|
|
|
|
super.onActivityResult(requestCode, resultCode, data);
|
|
|
|
|
|
|
|
|
|
if (requestCode == 1 && data != null) {
|
|
|
|
|
int index = data.getIntExtra("backIndex", 0);
|
|
|
|
|
Log.e("TAG", "onActivityResult:" + index);
|
|
|
|
|
list.get(index).setTaskState("完成");
|
|
|
|
|
adapter.notifyDataSetChanged();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|