In version 23 of AppCompat it has been introduced a fade in/out animation for the ActionMode, but I need to disable it.
Motivation: I change the background color of a TabLayout and I am not able to reproduce the very same fading animation, so it looks strange. I tried with ObjectAnimator, but it is not a proper "alpha" effect as in the new AppCompat v23.
According to here appcompat-v7 v23.0.0 statusbar color black when in ActionMode (answer from Mattia) it seems the animation is created from Java (thus not possible to overwrite the xml in the "anim" folder):
mFadeAnim = ViewCompat.animate(mActionModeView).alpha(0f);
Any idea on how to disable the new ActionMode animation?
Reproducing the very same effect between two colors would be also an alternative for me but, as explained before, it does not feel the same...
Thanks, Andrea
I had the same problem. I solved it this way:
1) Showing actionmode: I don't disable fadein animation: I just set color of actionbar to the same color as actionmode.
2) Hiding actionmode: For disabling fadingout I just make this call in onDestroyActionMode:
findViewById(R.id.action_mode_bar).setVisibility(View.INVISIBLE);
Don't forget to set previous color to actionbar after that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With