Skip to content

Instantly share code, notes, and snippets.

@KunalChaubal
Created May 11, 2020 08:44
Show Gist options
  • Save KunalChaubal/037013372563efdf7f89185a64f9f25a to your computer and use it in GitHub Desktop.
Save KunalChaubal/037013372563efdf7f89185a64f9f25a to your computer and use it in GitHub Desktop.
private val list = ArrayList<ViewType<*>>()
fun getList(): List<ViewType<*>> {
list.clear()
val singleChoiceQuestion = SingleChoiceQuestion(
question = resourceProvider.getString(R.string.txt_question_car),
optionOne = resourceProvider.getString(R.string.txt_yes),
optionTwo = resourceProvider.getString(R.string.txt_no)
)
list.add(SingleChoiceViewType(singleChoiceQuestion))
val multipleChoiceQuestion = MultipleChoiceQuestion(
question = resourceProvider.getString(R.string.txt_multiple_choice_question),
optionList = arrayListOf(
Answer(resourceProvider.getString(R.string.txt_reverse_camera)),
Answer(resourceProvider.getString(R.string.txt_parking_sensor)),
Answer(resourceProvider.getString(R.string.txt_infotainment_system))
)
)
list.add(QuestionViewType(multipleChoiceQuestion.question))
multipleChoiceQuestion.optionList.forEach {
list.add(MultipleAnswerViewType(it))
}
return list
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment