diff --git a/datacapture/src/main/java/com/google/android/fhir/datacapture/extensions/MoreHeaderViews.kt b/datacapture/src/main/java/com/google/android/fhir/datacapture/extensions/MoreHeaderViews.kt index fd4690ea26..84ffef9247 100644 --- a/datacapture/src/main/java/com/google/android/fhir/datacapture/extensions/MoreHeaderViews.kt +++ b/datacapture/src/main/java/com/google/android/fhir/datacapture/extensions/MoreHeaderViews.kt @@ -19,6 +19,7 @@ package com.google.android.fhir.datacapture.extensions import android.content.Context import android.text.SpannableStringBuilder import android.text.Spanned +import android.text.method.LinkMovementMethod import android.view.View.GONE import android.view.View.VISIBLE import android.widget.Button @@ -82,7 +83,10 @@ fun initHelpViews( } } } - helpTextView.updateTextAndVisibility(questionnaireItem.localizedHelpSpanned) + helpTextView.apply { + updateTextAndVisibility(questionnaireItem.localizedHelpSpanned) + movementMethod = LinkMovementMethod.getInstance() + } } /** diff --git a/datacapture/src/main/java/com/google/android/fhir/datacapture/views/GroupHeaderView.kt b/datacapture/src/main/java/com/google/android/fhir/datacapture/views/GroupHeaderView.kt index da85cbac4e..e2d1872bc4 100644 --- a/datacapture/src/main/java/com/google/android/fhir/datacapture/views/GroupHeaderView.kt +++ b/datacapture/src/main/java/com/google/android/fhir/datacapture/views/GroupHeaderView.kt @@ -17,6 +17,7 @@ package com.google.android.fhir.datacapture.views import android.content.Context +import android.text.method.LinkMovementMethod import android.util.AttributeSet import android.view.LayoutInflater import android.widget.LinearLayout @@ -55,11 +56,17 @@ class GroupHeaderView(context: Context, attrs: AttributeSet?) : LinearLayout(con helpCardStateChangedCallback = questionnaireViewItem.helpCardStateChangedCallback, ) prefix.updateTextAndVisibility(questionnaireViewItem.questionnaireItem.localizedPrefixSpanned) - // CQF expression takes precedence over static question text - question.updateTextAndVisibility(questionnaireViewItem.questionText) - hint.updateTextAndVisibility( - questionnaireViewItem.enabledDisplayItems.getLocalizedInstructionsSpanned(), - ) + question.apply { + // CQF expression takes precedence over static question text + updateTextAndVisibility(questionnaireViewItem.questionText) + movementMethod = LinkMovementMethod.getInstance() + } + hint.apply { + updateTextAndVisibility( + questionnaireViewItem.enabledDisplayItems.getLocalizedInstructionsSpanned(), + ) + movementMethod = LinkMovementMethod.getInstance() + } visibility = getHeaderViewVisibility(prefix, question, hint) applyCustomOrDefaultStyle( questionnaireViewItem.questionnaireItem, diff --git a/datacapture/src/main/java/com/google/android/fhir/datacapture/views/HeaderView.kt b/datacapture/src/main/java/com/google/android/fhir/datacapture/views/HeaderView.kt index 7e5e77231d..b723190448 100644 --- a/datacapture/src/main/java/com/google/android/fhir/datacapture/views/HeaderView.kt +++ b/datacapture/src/main/java/com/google/android/fhir/datacapture/views/HeaderView.kt @@ -17,6 +17,7 @@ package com.google.android.fhir.datacapture.views import android.content.Context +import android.text.method.LinkMovementMethod import android.util.AttributeSet import android.view.LayoutInflater import android.widget.LinearLayout @@ -55,13 +56,17 @@ class HeaderView(context: Context, attrs: AttributeSet?) : LinearLayout(context, helpCardStateChangedCallback = questionnaireViewItem.helpCardStateChangedCallback, ) prefix.updateTextAndVisibility(questionnaireViewItem.questionnaireItem.localizedPrefixSpanned) - // CQF expression takes precedence over static question text - question.updateTextAndVisibility( - appendAsteriskToQuestionText(question.context, questionnaireViewItem), - ) - hint.updateTextAndVisibility( - questionnaireViewItem.enabledDisplayItems.getLocalizedInstructionsSpanned(), - ) + question.apply { + // CQF expression takes precedence over static question text + updateTextAndVisibility(appendAsteriskToQuestionText(question.context, questionnaireViewItem)) + movementMethod = LinkMovementMethod.getInstance() + } + hint.apply { + updateTextAndVisibility( + questionnaireViewItem.enabledDisplayItems.getLocalizedInstructionsSpanned(), + ) + movementMethod = LinkMovementMethod.getInstance() + } // Make the entire view GONE if there is nothing to show. This is to avoid an empty row in the // questionnaire. visibility = getHeaderViewVisibility(prefix, question, hint)