Created
May 11, 2020 08:44
-
-
Save KunalChaubal/037013372563efdf7f89185a64f9f25a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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