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
465 stars 246 forks source link

[SDC] Add leading and trailing icons in text fields #1946

Open shelaghm opened 1 year ago

shelaghm commented 1 year ago

Feature request from @henryrae / ona

Problem An icon displayed inside the text field can help users more quickly see what data should be entered in a text field. An X icon can be used to clear characters typed inside the text box.

Describe the solution you'd like Ability for developers to add a leading and trailing icon to a text field.

Describe alternatives you've considered Alternative is to leave as is and not support this feature in SDC library.

Priority Low priority, but is nice to have. Could be a great starter issue.

Resources Developer documentation for text field icons Google material design

Screenshots

Screenshot 2023-03-31 at 15 09 37 Screenshot 2023-03-31 at 15 15 16
santosh-pingle commented 1 year ago

@aditya-07 Can you please add this issue to the Android FHIR SDK project.

jingtang10 commented 1 year ago

@HenryRae, I'm marking this as low priority as what @shelaghm suggested, if this ever becomes a blocker / urgent issue please let us know by commenting here.

@shelaghm thanks for creating this. i'm really keen to use a standard-based approach for this kind of stuff. So perhaps, we could propose an extension to FHIR Questionnaries to add icons to text fields. But it should be a workable solution for all platforms instead of just Android.

I removed good first issue label because I think there's some work to be done on the standard side before this work can commence.

I do think the clear text button can be implemented as a default behavior... Does that interference with anything else we might have (e.g i guess we can't add this to date or time input since we have the calendar/clock icons)

The screenshot on the right - the map pin makes me think clicking it will launch google maps and let me input a location that way... i feel that's another level of complexity... so perhaps for indicating the type of input (e.g phone number) we should stick to leading icons. and the trailing icons are for actions (e.g. calendar to launch date entry pop up, clock to launch time entry pop up, or x to clear answer). i hope this distinction helps (and we can potentially split this issue into 2).

shelaghm commented 1 year ago

@jingtang10 I agree with all these suggestions and summarizing it below.

Standard-based approach

Clear text icon

Leading vs trailing icons