QuestionnaireItemViewHolderDelegate

Delegate for QuestionnaireItemViewHolder.

This interface provides an abstraction of the operations that need to be implemented for a type of view in the questionnaire.

There is a 1:1 relationship between this and QuestionnaireItemViewHolder. In other words, there is a unique QuestionnaireItemViewHolderDelegate for each QuestionnaireItemViewHolder. This is critical for the correctness of the recycler view.

Inheritors

Properties

Link copied to clipboard

Functions

Link copied to clipboard
abstract fun bind(questionnaireViewItem: QuestionnaireViewItem)

Binds a QuestionnaireViewItem to the view. This should update the UI to display the question, the answer, and any validation result.

Link copied to clipboard
abstract fun init(itemView: View)

Initializes the view in QuestionnaireItemViewHolder. Any listeners to record user input should be set in this function.

Link copied to clipboard
abstract fun setReadOnly(isReadOnly: Boolean)

Sets view read only if isReadOnly is true.