Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[predictive-back-navigation] enable for the whole app #773

Merged
merged 5 commits into from
Jul 12, 2024

Conversation

lunaticare
Copy link
Contributor

@lunaticare lunaticare commented Jul 9, 2024

[predictive-back-navigation] enable for the whole app

Summary:

Back-to-home animation is shown when user swipes back from the main activity.

Test Plan:

  • go back from the main activity
  • click on search view, go back, search view should collapse
  • go back to from the package info screen to package list screen
  • go back from app settings screen to the package list screen
droidify-2.mp4

Stack created with Sapling. Best reviewed with ReviewStack.

Copy link

what-the-diff bot commented Jul 9, 2024

PR Summary

  • Enhancement of behavior in the Android Manifest: A new attribute android:enableOnBackInvokedCallback has been included in the application definition in AndroidManifest.xml, allowing us to further customize what occurs when the back button is tapped on Android devices.

  • Expanding functionality on screen transitions in ScreenActivity.kt: Several methods have been added to control the 'Back' button's behavior according to the current state of the application. We've removed some calls to return to the previous screen, replacing them with a more thorough approach that checks the current app status and provides a more consistent user experience.

  • Replacing the use of native Back functions across fragments: In multiple Fragment files (like EditRepositoryFragment.kt, RepositoryFragment.kt, SettingsFragment.kt), calls to the native onBackPressed() function are replaced to take advantage of our newly implemented custom back button handling.

  • Further control of 'Back' button in TabsFragment.kt: More control over the 'Back' button action depending on the current state in TabsFragment.kt, including calculating the appropriate action based on the state of the application and updating it as needed. Similar to the functionality added in ScreenActivity.kt.

With the new implementations in this pull request, back button behavior will be more predictable and enhance application usability, especially when users navigate through different screens or fragments in the application. Having a comprehensive control over the back button across all activities ensures a smooth navigation and more accurate actions corresponding to users' expectations.

First Last added 2 commits July 10, 2024 00:46
Summary:

Disable back pressed callback when no custom actions are needed. This is necessary to make back-to-home animation work.

Test Plan:
Summary:

Test Plan:
Summary:

Test Plan:
Summary:

Back-to-home animation is shown when user swipes back from the main activity.

Test Plan:
* [x] go back from the main activity
* [ ] click on search view, go back, search view should collapse
* [ ] go back to from the package info screen to package list screen
* [ ] go back from app settings screen to the package list screen
@lunaticare
Copy link
Contributor Author

@Iamlooker I fixed the search box behaviour, the change is fully functional.
Do you have any other test in mind other than the ones shown in the video?

@Iamlooker
Copy link
Member

Iamlooker commented Jul 10, 2024

Nope

Thank you for your contribution 😃

I will merge after testing myself

@Iamlooker Iamlooker merged commit 5d64ad2 into Droid-ify:main Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants