hotwired / turbo-android

Android framework for making Turbo native apps
MIT License
424 stars 50 forks source link

Not possible to customize animation for replace_root #285

Closed MichalSznajder closed 7 months ago

MichalSznajder commented 1 year ago

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 commented 1 year ago

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:

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 commented 1 year ago

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

leonvogt commented 1 year ago

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 commented 7 months ago

Resolved in https://github.com/hotwired/turbo-android/pull/304