I\'m trying to achieve that an icon in ActionBar will not change states discretely, but by fading animation. When I add android:enterFadeDuration
and android:
I had a similar problem, with my code looking like this:
At first, I found a hint to get rid of enterFadeDuration
and only use exitFadeDuration
. That solved the problem with initial invisibility, but the view still faded into invisibility during the first interraction.
Then, I modified my structure as follows:
-
Basically, I just pushed the default drawable out of the selector. It's a workaround and it also works for selectors with multiple states, but has some notable limitations:
It might not be applicable to the original problem, but it's something to consider for overcoming this behaviour of selectors.