@@ -136,14 +136,16 @@ internal fun Header(
136136 ) {
137137 PrefixQuestionTitle (prefixLocalizedText, questionLocalizedText, readCustomStyleName)
138138
139- Help (
140- hintLocalizedText,
141- readCustomStyleName,
142- isHelpCardOpen,
143- isHelpButtonVisible,
144- helpButtonOnClick,
145- helpCardLocalizedText,
146- )
139+ if (! hintLocalizedText.isNullOrBlank() || isHelpButtonVisible || isHelpCardOpen) {
140+ Help (
141+ hintLocalizedText,
142+ readCustomStyleName,
143+ isHelpCardOpen,
144+ isHelpButtonVisible,
145+ helpButtonOnClick,
146+ helpCardLocalizedText,
147+ )
148+ }
147149
148150 // Required/Optional Text
149151 if (showRequiredOrOptionalText && ! requiredOptionalText.isNullOrBlank()) {
@@ -225,28 +227,31 @@ internal fun Help(
225227 var isCardOpen by remember { mutableStateOf(isHelpCardInitiallyOpen) }
226228
227229 Row (
228- modifier = Modifier .padding(vertical = dimensionResource(R .dimen.help_container_margin_top)),
230+ modifier = Modifier .padding(top = dimensionResource(R .dimen.help_container_margin_top)),
229231 verticalAlignment = Alignment .CenterVertically ,
230232 ) {
231- AndroidView (
232- factory = {
233- TextView (it).apply {
234- id = R .id.hint
235- movementMethod = LinkMovementMethod .getInstance()
236- applyCustomOrDefaultStyle(
237- context = it,
238- view = this ,
239- customStyleName =
240- readCustomStyleName(
241- StyleUrl .SUBTITLE_TEXT_VIEW ,
242- ),
243- defaultStyleResId =
244- getStyleResIdFromAttribute(it, R .attr.questionnaireSubtitleTextStyle),
245- )
246- }
247- },
248- update = { it.text = hintLocalizedText },
249- )
233+ hintLocalizedText?.let {
234+ AndroidView (
235+ modifier = Modifier .weight(0.7f ),
236+ factory = {
237+ TextView (it).apply {
238+ id = R .id.hint
239+ movementMethod = LinkMovementMethod .getInstance()
240+ applyCustomOrDefaultStyle(
241+ context = it,
242+ view = this ,
243+ customStyleName =
244+ readCustomStyleName(
245+ StyleUrl .SUBTITLE_TEXT_VIEW ,
246+ ),
247+ defaultStyleResId =
248+ getStyleResIdFromAttribute(it, R .attr.questionnaireSubtitleTextStyle),
249+ )
250+ }
251+ },
252+ update = { it.text = hintLocalizedText },
253+ )
254+ }
250255
251256 if (isHelpButtonVisible) {
252257 IconButton (
@@ -258,6 +263,7 @@ internal fun Help(
258263 Modifier .padding(dimensionResource(R .dimen.help_icon_padding))
259264 .padding(start = dimensionResource(R .dimen.help_button_margin_start))
260265 .testTag(HELP_BUTTON_TAG )
266+ .weight(0.3f )
261267 .size(
262268 width = dimensionResource(R .dimen.help_button_width),
263269 height = dimensionResource(R .dimen.help_button_height),
0 commit comments