Questionnaire Item View Item
Item for QuestionnaireItemViewHolder in RecyclerView containing
Parameters
the question and the answer.
the question and the answer are used to create the right type of view (e.g. a CheckBox for a yes/no question) and populate the view with the right information (e.g text for the CheckBox and initial yes/no answer for the CheckBox).
function that should be called whenever the questionnaireResponseItemBuilder
is changed to inform the rest of the questionnaire to be updated
Constructors
Functions
QuestionnaireItemViewItem is a transient object for the UI only. Whenever the user makes any change via the UI, a new list of QuestionnaireItemViewItems will be created, each holding references to the underlying QuestionnaireItem and QuestionnaireResponseItem. To avoid refreshing the UI unnecessarily with the same QuestionnaireItems and QuestionnaireResponseItems, we consider two QuestionnaireItemViewItems to be the same if they have the same underlying QuestionnaireItem and QuestionnaireResponseItem. See QuestionnaireItemAdapter.DiffCallback.
Comparing the contents of two QuestionnaireItemViewItems by traversing the underlying Questionnaire.QuestionnaireItemComponent and QuestionnaireResponse.QuestionnaireResponseItemComponent and comparing values of all the properties. This is done by using the Questionnaire.QuestionnaireItemComponent.equalsDeep and QuestionnaireResponse.QuestionnaireResponseItemComponent.equalsDeep.