By default in Android 3.0+, when ActionBar.hide()/show() are called the bar is animated with a brief fade in/out animation.
There does not seem to be an XML style attri
Neither of solutions doesn't work for me so I try this to disable animation at all:
public void setActionBarVisible(boolean isVisible) {
View decorView = getWindow().getDecorView();
int resId;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB
|| Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
resId = getResources().getIdentifier(
"action_bar_container", "id", getPackageName());
} else {
resId = Resources.getSystem().getIdentifier(
"action_bar_container", "id", "android");
}
if (resId != 0) {
decorView.findViewById(resId).setVisibility(isVisible ? View.VISIBLE : View.GONE);
}
}
And it works just fine for me. You can try to animate whole action bar viewGroup to achieve similar effect.