Skip to content

Commit

Permalink
Handle case when both: question text and hint are empty
Browse files Browse the repository at this point in the history
  • Loading branch information
grzesiek2010 committed Feb 6, 2018
1 parent cf326ba commit c26c8b5
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,14 @@ private MediaLayout createQuestionMediaLayout(FormEntryPrompt prompt) {
questionText.setTypeface(null, Typeface.BOLD);
questionText.setTextColor(ContextCompat.getColor(getContext(), R.color.primaryTextColor));
questionText.setPadding(0, 0, 0, 7);
questionText.setText(promptText == null ? "" : TextUtils.textToHtml(FormEntryPromptUtils.markQuestionIfIsRequired(promptText, prompt.isRequired())));
questionText.setText(TextUtils.textToHtml(FormEntryPromptUtils.markQuestionIfIsRequired(promptText, prompt.isRequired())));
questionText.setMovementMethod(LinkMovementMethod.getInstance());

// Wrap to the size of the parent view
questionText.setHorizontallyScrolling(false);

if (promptText == null || promptText.length() == 0) {
if ((prompt.getLongText() == null || promptText.length() == 0)
&& !(prompt.isRequired() && (prompt.getHelpText() == null || prompt.getHelpText().isEmpty()))) {
questionText.setVisibility(GONE);
}

Expand Down

0 comments on commit c26c8b5

Please sign in to comment.