Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Fix comment field not saving on app moving into the background (EXPOSUREAPP-5108) #2424

Merged

Conversation

d4rken
Copy link
Member

@d4rken d4rken commented Feb 19, 2021

In the new comment/circumstances field in the contact journal:
Previously we only saved using EditText.onFocusLost which does not trigger if the user just leaves the app and swipes the app away. Using viewTreeObserver.addOnWindowFocusChangeListener we can catch that.

This PR contains an additional refactoring for View.addLifecycleEventCallback, which I tried first, but this does not work in this case as we are not able to find the parent Fragment from within the viewholder layout. It's a nice refactoring nonetheless, so I'd like to keep it.

Testing

  • Enter something in the contact-journal day screen, swipe the app away, check that it was saved.
  • Check that scroll position stays the same for statistics cards if you view the info screen

TODO

@d4rken d4rken added the maintainers Tag pull requests created by maintainers label Feb 19, 2021
@d4rken d4rken added this to the 1.14.0 milestone Feb 19, 2021
@d4rken d4rken requested review from LukasLechnerDev and a team February 19, 2021 14:14
@LukasLechnerDev LukasLechnerDev self-assigned this Feb 19, 2021
@d4rken d4rken added the author merge PR to be merged by author label Feb 19, 2021
…108-contact-journal-extension-focus-change

# Conflicts:
#	Corona-Warn-App/src/main/java/de/rki/coronawarnapp/contactdiary/ui/day/tabs/common/DiaryCircumstancesTextView.kt
@d4rken d4rken removed the author merge PR to be merged by author label Feb 19, 2021
@ralfgehrer ralfgehrer removed the request for review from LukasLechnerDev February 23, 2021 08:41
Base automatically changed from feature/4741-contact-journal-extension-main to release/1.14.x February 23, 2021 11:42
Copy link
Contributor

@kolyaopahle kolyaopahle left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@kolyaopahle kolyaopahle self-assigned this Feb 23, 2021
@ralfgehrer ralfgehrer self-assigned this Feb 23, 2021
Copy link
Contributor

@ralfgehrer ralfgehrer left a comment

Choose a reason for hiding this comment

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

Tested on Pixel (Android 10)

@sonarcloud
Copy link

sonarcloud bot commented Feb 23, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@ralfgehrer ralfgehrer merged commit 97e4b27 into release/1.14.x Feb 23, 2021
@ralfgehrer ralfgehrer deleted the fix/5108-contact-journal-extension-focus-change branch February 23, 2021 13:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
maintainers Tag pull requests created by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants