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

a flickering when changing state of button. #78

Closed
ghost opened this issue Jan 14, 2018 · 8 comments
Closed

a flickering when changing state of button. #78

ghost opened this issue Jan 14, 2018 · 8 comments

Comments

@ghost
Copy link

ghost commented Jan 14, 2018

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
Copy link
Owner

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
Copy link
Author

ghost commented Jan 14, 2018

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
Copy link
Owner

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
Copy link
Author

ghost commented Jan 16, 2018

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
Copy link
Owner

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

@ghost
Copy link
Author

ghost commented Jan 19, 2018

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

@johnernest02
Copy link

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
Copy link
Owner

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?

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

2 participants