corona-warn-app / cwa-app-android

Native Android app using the Apple/Google exposure notification API. The CWA development ends on May 31, 2023. You still can warn other users until April 30, 2023. More information:
https://coronawarn.app/en/faq/#ramp_down
Apache License 2.0
2.44k stars 495 forks source link

Date of birth input should use input view not calendar view #3968

Closed MikeMcC399 closed 3 years ago

MikeMcC399 commented 3 years ago

Avoid duplicates

Technical details

Describe the bug

The date picker for date of birth in the Rapid Test Profile and in COVID Test Certificate opens by default in calendar view. The recommended view for dates not near to the current date, like dates of birth, is input view.

The title of the date picker is not set. The default "SELECT DATE" is shown.

Steps to reproduce the issue

  1. Set locale to English (United Kingdom)
  2. Tap "Manage Your Tests"
  3. Tap "Create Rapid Test Profile" (tap "CONTINUE" if prompted)
  4. Tap "Date of Birth"
  5. Note that the date picker appears in calendar view, with title "SELECT DATE" and today's date selected
  6. Tap "CANCEL", tap back arrow
  7. Tap "Scan QR Code", tap "ACCEPT"
  8. Scan QR Code e.g. PCR Test QR Code
  9. Tap "Date of Birth"
  10. Note that the date picker appears in calendar view, with title "SELECT DATE"

calendar view

Expected behavior

Follow the advice from https://material.io/components/date-pickers#mobile-pickers and use the mobile date input picker, not the calendar view.

Add the title "Date of Birth" to the data picker, so the user is reminded what data they are being asked to enter.

Possible Fix

After https://github.com/corona-warn-app/cwa-app-android/blob/97fbc95b71db96ed637af3eaa35118eb705a1611/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/coronatest/rat/profile/create/RATProfileCreateFragment.kt#L130-L132

add

.setInputMode(MaterialDatePicker.INPUT_MODE_TEXT)
.setTitleText(getResources().getString(R.string.rat_profile_create_birth_date_hint))

After https://github.com/corona-warn-app/cwa-app-android/blob/97fbc95b71db96ed637af3eaa35118eb705a1611/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/submission/covidcertificate/RequestCovidCertificateFragment.kt#L133-L135

add

.setInputMode(MaterialDatePicker.INPUT_MODE_TEXT)
.setTitleText(getResources().getString(R.string.request_green_certificate_birthdate_hint))

input view

Workaround

Select input view from calendar view by tapping the pencil icon.

image

Additional context

https://material.io/components/date-pickers#mobile-pickers says

Don't

Don’t use a calendar picker to prompt for dates in the distant past or future, such as a date of birth. In these cases, use a mobile input picker or a text field instead.

Do

For dates that don’t require a calendar view, make the mobile date input picker as the default prompt.


Internal Tracking ID: EXPOSUREAPP-9128

dsarkar commented 3 years ago

@MikeMcC399 Thanks. Internal Tracking ID: EXPOSUREAPP-9128

I assume that you have tested this approach. Do you want to and can you provide a PR? If so, let me know, and I will check with dev team if there is a realistic chance to accept your PR.

Thanks

MikeMcC399 commented 3 years ago

@dsarkar Yes, I did already try it out and I can provide a PR if dev would like this submission.

It is an enhancement, not a bug correction. It is just more inconvenient to enter a date of birth from the calendar view.

Let me know if the PR is wanted. If they say no, then that is OK with me.

dsarkar commented 3 years ago

@MikeMcC399 ok, thanks for the offer. Stand by, I check with them.

dsarkar commented 3 years ago

@MikeMcC399 devs need to check with UX team first. So, currently waiting for their feedback.

dsarkar commented 3 years ago

@MikeMcC399 FYI, UX team has assessed this issue and agrees in principle with your suggestion.

MikeMcC399 commented 3 years ago

@dsarkar

FYI, UX team has assessed this issue and agrees in principle with your suggestion.

Thank you and the UX team for considering! Stand by for a PR from me once the work on PR https://github.com/corona-warn-app/cwa-app-android/pull/3987 has stabilized.

MikeMcC399 commented 3 years ago

I have submitted PR #3993 to switch from calendar view to input view for date of birth input related to Rapid Test Profile and Request COVID Certificate.

The general harmonization of date formats in #3987 is still open.

MikeMcC399 commented 3 years ago

PR #3993 "Change date of birth entry from calendar to input view (EXPOSUREAPP-9128) (COMMUNITY)" is merged into release/2.10.x

dsarkar commented 3 years ago

@MikeMcC399 Also here, many thanks for your contributions.

MikeMcC399 commented 3 years ago

Verified on tag/v2.10.1 and on Google Play Store version 2.10.1.

Closing as fixed.