public void UpdateTextFields() { name.text = evt.name; description.text = evt.description; dates.text = UtilsService.GetDate(evt.start_date) + " - " + UtilsService.GetDate(evt.end_date); place.text = evt.place; }
public void UpdateTextFields() { authorName.text = post.author_name; date.text = UtilsService.GetDate(post.created_at); message.text = post.text_msg; likes.text = post.points.ToString(); }
private void FillInputFields() { User aux = UserService.user; camService.pickPreiveimage.texture = UserService.user.profilePicture; originalPhoto = camService.pickPreiveimage.texture; if (aux.name.Length > 0) { nameField.text = aux.name; } if (aux.email.Length > 0) { emailField.text = aux.email; } if (aux.birth.Length > 0) { birthField.text = UtilsService.GetDate(aux.birth); } if (aux.sex.Length > 0) { genreDropdown.value = FindIndexFromGenre(aux); } if (aux.phone.Length > 0) { phoneField.text = aux.phone; } if (aux.street.Length > 0) { streetField.text = aux.street; } if (aux.neighborhood.Length > 0) { neighborhoodField.text = aux.neighborhood; } if (aux.complement.Length > 0) { complementField.text = aux.complement; } if (aux.zipcode.Length > 0) { zipField.text = aux.zipcode; } if (aux.city.Length > 0) { cityField.text = aux.city; } if (aux.state.Length > 0) { stateDropdown.value = FindIndexFromState(aux); } if (aux.number != null) { numberField.text = aux.number.ToString(); } }
public void UpdatePlantCard (Plant plant) { this.plant = plant; name.text = plant.name; if (plant._request != null && plant._request.status != null) { if (plant._request.status == STATUS_APPROVED) { statusApproved.SetActive(true); date.text = STATUS_APPROVED; } else if (plant._request.status == STATUS_REJECTED) { statusRejected.SetActive(true); date.text = STATUS_REJECTED; } else if (plant._request.status == STATUS_PLANTED) { statusApproved.SetActive(true); if (plant.planting_date != null) date.text = STATUS_PLANTED + " em " + UtilsService.GetDate(plant.planting_date); else date.text = STATUS_PLANTED; } else { statusPending.SetActive(true); date.text = STATUS_PENDING; } } else { statusRejected.SetActive(true); date.text = "Falha no pedido"; } type.text = UNKNOWN_TYPE; foreach (PlantType type in PlantsService.types) { if (type._id == plant._type) { this.type.text = type.name; this.photoUrl = type.photo; break; } } StartCoroutine(_UpdatePlantPhoto()); }
public void UpdateSubmissionCard(MissionAnswer submission) { ResetButtons(); this.submission = submission; title.text = "Missão #" + submission._mission.ToString(); date.text = "Submissão enviada em " + UtilsService.GetDate(submission.created_at); if (submission.image != null && submission.image.Length > 0) { imageButton.SetActive(true); } if (submission.audio != null && submission.audio.Length > 0) { audioButton.SetActive(true); } if (submission.video != null && submission.video.Length > 0) { videoButton.SetActive(true); } if (submission.location_lat != null && submission.location_lng != null && submission.location_lat.Length > 0 && submission.location_lng.Length > 0) { gpsButton.SetActive(true); } if (submission.text_msg != null && submission.text_msg.Length > 0) { textButton.SetActive(true); } switch (submission.status) { case "Pendente": statusPendent.SetActive(true); break; case "Válida": statusApproved.SetActive(true); break; case "Inválida": statusRejected.SetActive(true); break; } StartCoroutine(_UpdateMission()); }
public void UpdateQuizCard(Quiz quiz) { ResetIcons(); this.quiz = quiz; title.text = quiz.title; date.text = "Até " + UtilsService.GetDate(quiz.end_time); points.text = quiz.points.ToString(); if (quiz.description.Length > 60) { description.text = quiz.description.Substring(0, 57) + "..."; } else { description.text = quiz.description; } if (quiz.correct_answer != null && quiz.correct_answer.Length > 0) { binaryAnswerIcon.SetActive(true); } else { multipleAnswerIcon.SetActive(true); } if (quiz.single_answer != null && quiz.single_answer) { singleChancesIcon.SetActive(true); } else { infinityChancesIcon.SetActive(true); } }
public void UpdateMissionCard(Mission mission) { ResetIcons(); this.mission = mission; title.text = mission.name; date.text = "Até " + UtilsService.GetDate(mission.end_time); points.text = mission.points.ToString(); if (mission.description.Length > 60) { description.text = mission.description.Substring(0, 57) + "..."; } else { description.text = mission.description; } if (mission.single_answer != null && mission.single_answer) { singleChancesIcon.SetActive(true); } else { infinityChancesIcon.SetActive(true); } if (mission.is_grupal != null && mission.is_grupal) { groupalIcon.SetActive(true); } else { individualIcon.SetActive(true); } if (mission.has_image != null && mission.has_image) { imageIcon.SetActive(true); } if (mission.has_audio != null && mission.has_audio) { audioIcon.SetActive(true); } if (mission.has_video != null && mission.has_video) { videoIcon.SetActive(true); } if (mission.has_text != null && mission.has_text) { textIcon.SetActive(true); } if (mission.has_geolocation != null && mission.has_geolocation) { geolocationIcon.SetActive(true); } }