-
Notifications
You must be signed in to change notification settings - Fork 252
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
Create QuestionnaireItemHeaderView for the common question header (prefix+question+hint) #1299
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1299 +/- ##
============================================
+ Coverage 84.15% 84.61% +0.45%
- Complexity 678 684 +6
============================================
Files 147 148 +1
Lines 10738 10677 -61
Branches 883 825 -58
============================================
- Hits 9037 9034 -3
+ Misses 1235 1234 -1
+ Partials 466 409 -57
Continue to review full report at Codecov.
|
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.
LGTM, code owner can also review it. thanks!
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.
@jingtang10 Thanks!
...hir/datacapture/views/QuestionnaireItemBooleanTypePickerViewHolderFactoryInstrumentedTest.kt
Outdated
Show resolved
Hide resolved
private var hint: TextView = findViewById(R.id.hint) | ||
|
||
fun bind(questionnaireItem: Questionnaire.QuestionnaireItemComponent) { | ||
questionnaireItem.localizedPrefixSpanned.also { |
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.
that's a misuse of also
instead of declare a variable + if
If you lean to use scope function here, i'd suggest run
or maybe 'let'
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.
changed it to let
.
actually i have been wondering myself the case for using scope function vs declaring variables. any more insight into pros and cons of these two approache regarding readability?
...pture/src/main/java/com/google/android/fhir/datacapture/views/QuestionnaireItemHeaderView.kt
Outdated
Show resolved
Hide resolved
304bc3c
to
433c528
Compare
IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).
Fixes #1291
Description
Extract common view for question headers.
Additional refactoring:
EXTENSION_***_UNOFFICIAL
toEXTENSION_***_ANDROID_FHIR
Questionnaire.QuestionnaireItemComponent.subtitleText
toQuestionnaire.QuestionnaireItemComponent.localizedHintSpanned
because it's localized and hint is slightly more accurate than subtitleQuestionnaire.QuestionnaireItemComponent.flyOverText
toQuestionnaire.QuestionnaireItemComponent.localizedFlyoverSpanned
because it's localizedAlternative(s) considered
NA
Type
Bug fix + Code health
Screenshots (if applicable)
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.