diff --git a/datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireItemAdapter.kt b/datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireItemAdapter.kt index 6d20549c31..4e33befac8 100644 --- a/datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireItemAdapter.kt +++ b/datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireItemAdapter.kt @@ -134,7 +134,7 @@ internal class QuestionnaireItemAdapter( questionnaireItemViewItem: QuestionnaireItemViewItem ): QuestionnaireItemViewHolderType { val questionnaireItem = questionnaireItemViewItem.questionnaireItem - + // Use the view type that the client wants if they specified an itemControl return questionnaireItem.itemControl?.viewHolderType // Otherwise, choose a sensible UI element automatically diff --git a/datacapture/src/main/java/com/google/android/fhir/datacapture/views/OptionSelectDialogFragment.kt b/datacapture/src/main/java/com/google/android/fhir/datacapture/views/OptionSelectDialogFragment.kt index 281b8d6095..546c1100f6 100644 --- a/datacapture/src/main/java/com/google/android/fhir/datacapture/views/OptionSelectDialogFragment.kt +++ b/datacapture/src/main/java/com/google/android/fhir/datacapture/views/OptionSelectDialogFragment.kt @@ -282,7 +282,9 @@ private sealed class OptionSelectRow { /** A predefined option. */ data class Option(val option: OptionSelectOption) : OptionSelectRow() - /** "Other" option. Only shown if [OptionSelectDialogFragment.Config.otherOptionsAllowed] is true. */ + /** + * "Other" option. Only shown if [OptionSelectDialogFragment.Config.otherOptionsAllowed] is true. + */ data class OtherRow(val selected: Boolean) : OptionSelectRow() /** Text boxes for user to enter "Other" options in. Only shown when [OtherRow] is selected. */ @@ -322,7 +324,9 @@ private sealed class OptionSelectViewHolder(parent: ViewGroup, layout: Int) : val checkbox: CheckBox = itemView.findViewById(R.id.checkbox) } - /** Freeform option, only shown if [OptionSelectDialogFragment.Config.otherOptionsAllowed] is true. */ + /** + * Freeform option, only shown if [OptionSelectDialogFragment.Config.otherOptionsAllowed] is true. + */ class OtherEditText(parent: ViewGroup) : OptionSelectViewHolder(parent, R.layout.questionnaire_item_option_item_other_text) { val editText: EditText = itemView.findViewById(R.id.edit_text) @@ -339,7 +343,9 @@ private sealed class OptionSelectViewHolder(parent: ViewGroup, layout: Int) : } } - /** Freeform option, only shown if [OptionSelectDialogFragment.Config.otherOptionsAllowed] is true. */ + /** + * Freeform option, only shown if [OptionSelectDialogFragment.Config.otherOptionsAllowed] is true. + */ class OtherAddAnother(parent: ViewGroup) : OptionSelectViewHolder(parent, R.layout.questionnaire_item_option_item_other_add_another) { val addAnother: Button = itemView.findViewById(R.id.add_another)