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

setupFragmentTransactionAnimation is not called in child fragment #63

Closed
yurimachioni opened this issue Apr 6, 2018 · 4 comments
Closed

Comments

@yurimachioni
Copy link

First of all, nice library. It's been helping me a lot.
I'm having a problem in a setup similar to the BottomNavigationActivity of the sample.
I want to have a slide animation when navigating inside a tab (opening forwardFragments) and no animation or some other animation when I switch tabs. The problem is: when I switch tabs, the parent fragment recreates the child and this forces the animation that was previously set up, without even calling setupFragmentTransactionAnimation() again, to give me a chance to disable or change the animation. This is my guess of what's happening, at least.
To reproduce this, simply add any animation to the TabContainerFragment's Navigator. Then navigate inside a tab, and then between tabs.

Am I misusing the library, or is this a bug ? Could we have a method that is always called when a transaction will happen ?

Thanks !

@Lex1717
Copy link

Lex1717 commented Jun 28, 2018

@yurimachioni Hi!
Recently I ran into the same problem. Did you find any solution?

@yurimachioni
Copy link
Author

Hi!
I didn't. I disabled the animations for now.
The project i'm using this in has really tight deadlines so I can't really spend any time looking inside the lib, maybe there is an easy fix.

@yurimachioni
Copy link
Author

I'm now using a workaround for this. instead of detaching/attaching the parent fragment, i'm using hide and show. this prevents the animation from happening in the child when changing tabs because no view creation callbacks are called. this has other implications and doesn't fix the problem with cicerone, but it works and is a lot smoother.

@terrakok
Copy link
Owner

Animations between fragments is big pain point.
I recommend not use fragment manager for complex animation cases.
You can use MotionLayout or move views manually

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

No branches or pull requests

3 participants