andkulikov / Transitions-Everywhere

Set of extra Transitions on top of Jetpack Transitions Library
Apache License 2.0
4.83k stars 486 forks source link

a flickering when changing state of button. #78

Closed ghost closed 6 years ago

ghost commented 6 years ago

When doing a simple sequential fade-in & fade out for two buttons for a moment text changes to something weird. i have tried support library too same result. ezgif com-video-to-gif

andkulikov commented 6 years ago

there is ChangeText transition, which in one of the modes can keep the previous text for the time of transition. btw, can you show the code?

ghost commented 6 years ago

Thanks for replay. Here is the code:

TransitionManager.beginDelayedTransition((ViewGroup) binding.getRoot());
binding.buttonDestination.setVisibility(View.GONE);
binding.buttonRequest.setVisibility(View.VISIBLE);

So is there any solution for this?

andkulikov commented 6 years ago

if you have two buttons why do you change text on the buttons? are you using data binding which can do this for you? what is "S F" from your gif?

but you can try this variant:

     TransitionSet transitionSet =
            new TransitionSet()
                .setOrdering(TransitionSet.ORDERING_SEQUENTIAL)
                .addTransition(
                    new TransitionSet()
                        .addTransition(new Fade(Fade.OUT))
                        .addTransition(new ChangeText())
                ).addTransition(new Fade(Fade.IN))
            ;
        TransitionManager.beginDelayedTransition((ViewGroup) binding.getRoot(), transitionSet);
ghost commented 6 years ago

Well that's what is weird for me too that where this S F thing is coming because i have not set text to that at all in my code. (I'm sure checked this like 10 times :|). And also i didn't changed the text at all i have only made first button hidden and second one visible but it changes the text automatically for a second and i don't know why. Maybe it has something to do with databinding. Using your code it still happens too even if i remove changeText transition.

andkulikov commented 6 years ago

yeah, data binding should the root of it. could you please debug calls for TextView.setText

ghost commented 6 years ago

Thanks again for response. But i did that and breakpoint doesn't get reached! (breakpoint working properly has been checked using manual test.)

johnernest02 commented 6 years ago

I don't think that is an "F". I believe that us an E. I also get the same issue when starting the transition. The text also becomes out of place after transition

andkulikov commented 6 years ago

so the text for a view was changed to "select ..." and at the same time the view was hidden via view.setVisibility(gone). why do you change text of view you are going to hide? probably here it was changed automatically by data binding which is wrong. @dev-JE02 you also use databinding?