Skip to content
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

Support choice orientation in boolean view. #1710

Merged

Conversation

santosh-pingle
Copy link
Collaborator

IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).

Fixes #1515

Description

  • Support choice orientation in boolean view.

Alternative(s) considered
Have you considered any alternatives? And if so, why have you chosen the approach in this PR?

Type
Choose one: Feature

Screenshots (if applicable)

Checklist

  • I have read and acknowledged the Code of conduct.
  • I have read the Contributing page.
  • I have signed the Google Individual CLA, or I am covered by my company's Corporate CLA.
  • I have discussed my proposed solution with code owners in the linked issue(s) and we have agreed upon the general approach.
  • I have run ./gradlew spotlessApply and ./gradlew spotlessCheck to check my code follows the style guide of this project.
  • I have run ./gradlew check and ./gradlew connectedCheck to test my changes locally.
  • I have built and run the demo app(s) to verify my change fixes the issue and/or does not break the demo app(s).

@santosh-pingle
Copy link
Collaborator Author

Screen Shot 2022-11-10 at 6 09 55 PM

@codecov
Copy link

codecov bot commented Nov 10, 2022

Codecov Report

Merging #1710 (30e79c8) into master (b1c51f2) will increase coverage by 41.65%.
The diff coverage is 34.61%.

❗ Current head 30e79c8 differs from pull request most recent head eb10fb3. Consider uploading reports for the commit eb10fb3 to get more accurate results

@@              Coverage Diff              @@
##             master    #1710       +/-   ##
=============================================
+ Coverage          0   41.65%   +41.65%     
- Complexity        0      377      +377     
=============================================
  Files             0      150      +150     
  Lines             0     5320     +5320     
  Branches          0      959      +959     
=============================================
+ Hits              0     2216     +2216     
- Misses            0     2762     +2762     
- Partials          0      342      +342     
Impacted Files Coverage Δ
...tionnaireItemBooleanTypePickerViewHolderFactory.kt 50.70% <34.61%> (ø)
...tionnaireItemEditTextMultiLineViewHolderFactory.kt 0.00% <0.00%> (ø)
...ogle/android/fhir/datacapture/DataCaptureConfig.kt 0.00% <0.00%> (ø)
.../java/com/google/android/fhir/search/MoreSearch.kt 80.78% <0.00%> (ø)
...m/google/android/fhir/sync/remote/FhirConverter.kt 0.00% <0.00%> (ø)
...estionnaireItemEditTextStringViewHolderDelegate.kt 0.00% <0.00%> (ø)
...d/fhir/datacapture/utilities/MoreLocalDateTimes.kt 66.66% <0.00%> (ø)
...ttpVerbBasedBundleEntryComponentImplementations.kt 0.00% <0.00%> (ø)
.../QuestionnaireItemDialogSelectViewHolderFactory.kt 79.59% <0.00%> (ø)
...android/fhir/db/impl/entities/LocalChangeEntity.kt 100.00% <0.00%> (ø)
... and 141 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@aditya-07
Copy link
Collaborator

@santosh-pingle Could we not use android:orientation in the RadioGroup?

@santosh-pingle
Copy link
Collaborator Author

@santosh-pingle Could we not use android:orientation in the RadioGroup?

Advantage of having constraintLayout flow is that if views does not get fit on same line then it get wrap on next line.

@aditya-07
Copy link
Collaborator

@santosh-pingle Could we not use android:orientation in the RadioGroup?

Advantage of having constraintLayout flow is that if views does not get fit on same line then it get wrap on next line.

Since the boolean view has just two options, do you think overflow will still be an issue?

@santosh-pingle
Copy link
Collaborator Author

santosh-pingle commented Nov 11, 2022

@santosh-pingle Could we not use android:orientation in the RadioGroup?

Advantage of having constraintLayout flow is that if views does not get fit on same line then it get wrap on next line.

Since the boolean view has just two options, do you think overflow will still be an issue?

  • Considering the local language translation support in future, and translation values does not get fit on the same line, flow will be good option to wrap these options to next line.
  • Also changes in layout resource will be consistent with single/multiple view change.
  • And it still requires kotlin changes to change the layout parameters of the answer options and set horizontal orientation on radio group.

Copy link
Collaborator

@aditya-07 aditya-07 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also add a unit test to check that choiceOrientation is properly getting applied in the view.

@jingtang10
Copy link
Collaborator

jingtang10 commented Dec 4, 2022

@shelaghm fyi

please take a look at the screenshot above

@shelaghm
Copy link

shelaghm commented Dec 5, 2022

@santosh-pingle See below for feedback on how to adjust the padding so that the buttons look more balanced. See screenshot on how to adjust the padding. Otherwise, it looks great to me.
Screen Shot 2022-12-05 at 10 04 03

@santosh-pingle
Copy link
Collaborator Author

@santosh-pingle See below for feedback on how to adjust the padding so that the buttons look more balanced. See screenshot on how to adjust the padding. Otherwise, it looks great to me. Screen Shot 2022-12-05 at 10 04 03

@shelaghm

  • left edge padding 16 dp is already present.
  • top padding not changed
  • padding between icon and text is updated to 16 dp
  • right edge padding updated to 24 dp

Screen Shot 2022-12-14 at 11 08 38 AM

Copy link
Collaborator

@jingtang10 jingtang10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@santosh-pingle santosh-pingle enabled auto-merge (squash) December 23, 2022 13:36
@santosh-pingle santosh-pingle merged commit 991102d into google:master Dec 23, 2022
kevinmost pushed a commit to kevinmost/android-fhir that referenced this pull request Jan 4, 2023
* Support choice orientation in boolean view.

* Resolve conflicts.

* Remove commented code.

* fix lint error

* Address review comments.

* Add padding

* Address review comment.

* Address review comments.

Co-authored-by: Santosh Pingle <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support of choice orientation extension in Boolean choice view.
4 participants