QuestionnaireItemViewHolderDelegate

interface 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.

Functions

Link copied to clipboard
abstract fun bind(questionnaireItemViewItem: QuestionnaireItemViewItem)

Binds a QuestionnaireItemViewItem to the view.

Link copied to clipboard
abstract fun displayValidationResult(validationResult: ValidationResult)

Displays validation messages on the view.

Link copied to clipboard
open fun getValidationResult(context: <ERROR CLASS>): ValidationResult

Run the QuestionnaireResponseItemValidator.validate function.

Link copied to clipboard
abstract fun init(itemView: <ERROR CLASS>)

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

Link copied to clipboard
open fun onAnswerChanged(context: <ERROR CLASS>)

Runs validation to display the correct message and calls the questionnaireResponseChangedCallback

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

Sets view read only if isReadOnly is true.

Properties

Link copied to clipboard
abstract var questionnaireItemViewItem: QuestionnaireItemViewItem