@Override public void onClick(View view) { if (!Utilities.isConnected(getActivity())) { ZupApplication.toast(getView(), R.string.only_online_option_error).show(); return; } switch (view.getId()) { case R.id.responsable_group_container: selectGroup(); break; case R.id.responsable_user_container: selectUser(); break; } }
void fillData(ViewGroup root) { if (getItem() == null) return; ReportItem item = getItem(); ReportCategory category = Zup.getInstance().getReportCategoryService().getReportCategory(item.category_id); ReportCategory.Status status = null; if (item.status_id != -1 && category != null) { status = category.getStatus(item.status_id); } TextView txtProtocol = (TextView) root.findViewById(R.id.protocol); TextView txtAddress = (TextView) root.findViewById(R.id.full_address); TextView txtReference = (TextView) root.findViewById(R.id.reference); TextView txtDescription = (TextView) root.findViewById(R.id.description); TextView txtCategory = (TextView) root.findViewById(R.id.category_name); TextView txtCreation = (TextView) root.findViewById(R.id.creation_date); TextView txtStatus = (TextView) root.findViewById(R.id.status); TextView txtGroup = (TextView) root.findViewById(R.id.responsible_group_name); TextView txtUser = (TextView) root.findViewById(R.id.responsible_user_name); txtProtocol.setText(item.protocol); txtAddress.setText(item.getFullAddress()); txtReference.setText(notInformedIfBlank(item.reference)); txtDescription.setText(notInformedIfBlank(item.description)); txtCategory.setText(category != null ? category.title : ""); txtCreation.setText(Utilities.formatIsoDateAndTime(item.created_at)); if (status != null) txtStatus.setText(status.getTitle()); else txtStatus.setText(R.string.no_status); if (item.assignedUser != null) txtUser.setText(item.assignedUser.name); else txtUser.setText(R.string.no_responsable_user_text); if (item.assignedGroup != null) txtGroup.setText(item.assignedGroup.getName()); else txtGroup.setText(R.string.no_responsable_group_text); updateResponsabilityBehavior(root); }