Issue/13326 navigate to scan screen from detail#13924
Merged
Conversation
|
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
|
You can test the changes on this Pull Request by downloading the APK here. |
…detail # Conflicts: # WordPress/src/main/java/org/wordpress/android/ui/jetpack/scan/ScanFragment.kt
ashiagr
approved these changes
Feb 2, 2021
Contributor
ashiagr
left a comment
There was a problem hiding this comment.
Works like a charm 🎉 except of the progress bar display issue which we discussed will be fixed in a separate PR.
Thanks for this refactoring to support fixing from scan history 👍!
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Parent issue #13326
This PR update the approach used to propagate data from ThreatDetail screen to Scan screen.
The previous approach was using "startActivityForResult(ThreatDetail)/setResult". The ThreatDetail screen would set a flag in the result and the Scan screen would read this flag and force update the screen. This approach is great when the ThreatDetail screen is always started from Scan screen, but it's not the case anymore. We need to start ThreatDetail screen even from Scan History screen and perhaps even from notifications in the near future.
The new approach uses "startActivity(ThreatDetail)/startActivity(Scan)" . The ThreatDetail screen requests "startActivity(Scan screen)" with "clear top | single top" flags. If the Scan screen is already on the backstack, it's "onNewMethod" is invoked and the screen is force updated. If the Scan screen is not on the backstack, it's started from scratch in which case we don't need to force update it, because the screen always fetches new data on initialization.
Known issues:
To test:
Prerequisites:
Prerequisites:
PR submission checklist:
RELEASE-NOTES.txtif necessary.