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

Not possible to customize animation for replace_root #285

Closed
MichalSznajder opened this issue Sep 1, 2023 · 4 comments
Closed

Not possible to customize animation for replace_root #285

MichalSznajder opened this issue Sep 1, 2023 · 4 comments

Comments

@MichalSznajder
Copy link
Contributor

When animation is customized via getNavigationOptions it is ignored when "presentation": "replace_root" is used. This makes issues like #181 unsolvable. If you have toolbar (either native or in html) and use "replace_root" to navigate between tabs there will be always a white flash.

@leonvogt
Copy link

leonvogt commented Sep 8, 2023

I spend hours figuring out where this white flash is coming from...
In the end my hacky solution was to override the default animation by creating the following files:

  • res/anim/nav_default_enter_anim.xml
  • res/anim/nav_default_exit_anim.xml
  • res/anim/nav_default_pop_enter_anim.xml
  • res/anim/nav_default_pop_exit_anim.xml

And fill them with basically nothing:

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
    <!-- Empty to disable animation -->
    <!--
        The default animation would trigger a blink / flash effect on the Appbar.
        Therefore, we disable the animation here.
     -->
</set>

@MichalSznajder
Copy link
Contributor Author

@leonvogt Are you using custom compilation of Turbo in your project? Those files look like ones in Turbo Android source code.

@leonvogt
Copy link

You are correct; those are the default Android animations that are being overridden by this.
It's definitely not an elegant solution, but it's the only one I found to remove the flash effect on a custom toolbar.

@jayohms
Copy link
Collaborator

jayohms commented Feb 23, 2024

Resolved in #304

@jayohms jayohms closed this as completed Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants