-
Notifications
You must be signed in to change notification settings - Fork 299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove extra space from a Questionnaire View when the group headers have no text to show. #1339
Remove extra space from a Questionnaire View when the group headers have no text to show. #1339
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1339 +/- ##
=========================================
Coverage 84.57% 84.57%
- Complexity 687 690 +3
=========================================
Files 148 148
Lines 10701 10708 +7
Branches 832 836 +4
=========================================
+ Hits 9050 9056 +6
Misses 1237 1237
- Partials 414 415 +1
Continue to review full report at Codecov.
|
...in/java/com/google/android/fhir/datacapture/views/QuestionnaireItemGroupViewHolderFactory.kt
Outdated
Show resolved
Hide resolved
...pture/src/main/java/com/google/android/fhir/datacapture/views/QuestionnaireItemHeaderView.kt
Outdated
Show resolved
Hide resolved
...ava/com/google/android/fhir/datacapture/views/QuestionnaireItemGroupViewHolderFactoryTest.kt
Outdated
Show resolved
Hide resolved
...e/src/test/java/com/google/android/fhir/datacapture/views/QuestionnaireItemHeaderViewTest.kt
Show resolved
Hide resolved
datacapture/src/main/res/layout/questionnaire_item_group_header_view.xml
Outdated
Show resolved
Hide resolved
@@ -43,6 +43,8 @@ internal object QuestionnaireItemGroupViewHolderFactory : | |||
error.text = | |||
if (validationResult.getSingleStringValidationMessage() == "") null | |||
else validationResult.getSingleStringValidationMessage() | |||
|
|||
error.visibility = if (error.text.isNotEmpty()) View.VISIBLE else View.GONE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use isNullOrEmpty
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
discussed with @aditya-07 offline - text view always returns non-null string, so this should be good.
IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).
Fixes #[issue number]
Description
QuestionnaireItemHeaderView
i.e. No prefix, question or hint, then set the visibility of the View as GONE. Otherwise there will be blank space.Based on Jing's comment below, error can be shown in the
QuestionnaireItemGroupViewHolder
. So, keepingErrorView
.Alternative(s) considered
The alternative would be to weed out such
QuestionnaireItemComponent
while processingQuestionnaire
so that they are not in the list provided to theRecyclerView
.Type
Choose one: Bug fix
Screenshots (if applicable)
Black lines here are the
DividerItemDecoration
to display the rows in the recyclerview.Before:
After:
Checklist
./gradlew spotlessApply
and./gradlew spotlessCheck
to check my code follows the style guide of this project../gradlew check
and./gradlew connectedCheck
to test my changes locally.