google / android-fhir

The Android FHIR SDK is a set of Kotlin libraries for building offline-capable, mobile-first healthcare applications using the HL7® FHIR® standard on Android.
https://google.github.io/android-fhir/
Apache License 2.0
463 stars 241 forks source link

Placed help button location to after question title #1984

Open khyativyasargus opened 1 year ago

khyativyasargus commented 1 year ago

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

Fixes #1965

Description Move help button location to after question title as subtitle might be empty in some cases.

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) image

Checklist

santosh-pingle commented 1 year ago

@khyativyasargus I noticed a slight cut on the right side of the help button. Could you please confirm this?

Can you also try the following precondition and see how the help button aligns? Please modify questionnaire.json and add 1. precondition text 2. long question text

khyativyasargus commented 1 year ago

Thanks @santosh-pingle for drawing my attention. Sure will check and provide requested details. Just one doubt can you elaborate about precondition here?

santosh-pingle commented 1 year ago

Thanks @santosh-pingle for drawing my attention. Sure will check and provide requested details. Just one doubt can you elaborate about precondition here?

Actually, i just wanted to see if prefix text is present and question text is 2-3 line text in the json file then how help button get aligns`.

In the component_help.json, you can add "prefix":"3." and "text": "Adding long text to just see how help button get aligns, its just testing.Adding long text to just see how help button get aligns, its just testing.Adding long text to just see how help button get aligns, its just testing",

khyativyasargus commented 1 year ago

I noticed a slight cut on the right side of the help button. Could you please confirm this?

@santosh-pingle This is because for help button, Button widget is used which is ideally in square shape with edges and we are putting round shape image into that. so to solve that there are 2 options in my mind right now, 1)increase button width and height by 1dp and put 1dp padding 2)change widget type from Button to ImageView

what do you suggest? Let me know if you have any other option on your mind , I'll do changes accordingly.

khyativyasargus commented 1 year ago

Actually, i just wanted to see if prefix text is present and question text is 2-3 line text in the json file then how help button get aligns`.

In the component_help.json, you can add "prefix":"3." and "text": "Adding long text to just see how help button get aligns, its just testing.Adding long text to just see how help button get aligns, its just testing.Adding long text to just see how help button get aligns, its just testing",

@santosh-pingle I've done some corrections to manage long text, but I'll commit them with help button changes together. Here it is SS for how it looks

image

image

image

santosh-pingle commented 1 year ago

Actually, i just wanted to see if prefix text is present and question text is 2-3 line text in the json file then how help button get aligns. In the component_help.json, you can add"prefix":"3."and"text": "Adding long text to just see how help button get aligns, its just testing.Adding long text to just see how help button get aligns, its just testing.Adding long text to just see how help button get aligns, its just testing",`

@santosh-pingle I've done some corrections to manage long text, but I'll commit them with help button changes together. Here it is SS for how it looks

image

image

image

@shelaghm Can you please review attached screenshots by @khyativyasargus

@khyativyasargus, you mean, changes will be updated to this pr, correct?

khyativyasargus commented 1 year ago

@khyativyasargus, you mean, changes will be updated to this pr, correct?

Yes @santosh-pingle , once you & @shelaghm approves screenshots I'll commit changes in this PR only.

jingtang10 commented 1 year ago

https://stackoverflow.com/questions/63130800/place-a-view-at-the-end-of-multiline-textview does this work?

jingtang10 commented 1 year ago

@khyativyasargus thanks for this change, would it be possible to also refactor the header so that the prefix is also inline the same way the icon is inline in the link i posted above?

khyativyasargus commented 1 year ago

@khyativyasargus thanks for this change, would it be possible to also refactor the header so that the prefix is also inline the same way the icon is inline in the link i posted above?

Yes @jingtang10 this option sounds more convenient to me as per UI perspective. so you want prefix & help icon both inline with title right? I'll give it check and will update you with changes.

khyativyasargus commented 1 year ago

@khyativyasargus thanks for this change, would it be possible to also refactor the header so that the prefix is also inline the same way the icon is inline in the link i posted above?

Hi @jingtang10 @santosh-pingle ! As per our conversation, I've done with refactoring the question header view in such a way that the Prefix, Title, and icon stay inline with the help of Spannable. But I think Text & Icon within spannable should also be customized with custom style attributes and I am not sure how we can achieve that. Can you guide me about the possibility?

jingtang10 commented 1 year ago

hey @khyativyasargus thanks for the update. can you add new screenshots, especially for long titles?

khyativyasargus commented 1 year ago

hey @khyativyasargus thanks for the update. can you add new screenshots, especially for long titles?

Sure @jingtang10 , Here is a screenshot of inline headerview with longer title

image

shelaghm commented 1 year ago

Thanks @khyativyasargus Looks better, one small adjustment would be to make the help button aligned to the text line height? See screenshot as an example Screenshot 2023-05-17 at 08 04 50

aditya-07 commented 10 months ago

@khyativyasargus Please update the PR to latest changes.

khyativyasargus commented 10 months ago

If we are not depending on any kotlin code to place the Help Button, then we should remove it from this PR.

Hi @aditya-07 these changes are required but as we haven't been able to find a way to configure Image using style attribute with Spannable so it's still pending. We can refactor the code of this PR once we find the final solution.