Whenever I toggle the system bars by calling setSystemUiVisibility(int)
, they properly toggle, but they have a small delay of about 200ms before starting the fade animation, and this somewhat conflicts with what I want, as I'm already dealing with the app's animations and delays myself, and for things to work out nicely I'd prefer if their animations started immediately. Note that by "immediately" I don't mean necessarily "as soon as I call the change", but just whenever first possible. A comparison would be between calling a method within post()
and postDelayed()
: The former of course doesn't execute immediately, but there's still no visible delay.
Is there an API to change this delay, or a workaround?
Edit: Not sure how useful it is but these are the flags I'm setting:
System bars showing:
None
System bars hidden:
View.SYSTEM_UI_FLAG_FULLSCREEN
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
I'm not calling any layout flags as this is a temporary state, and the layout shouldn't be affected.
Nevermind, it was an unrelated mistake. I was calling setSystemUiVisibility()
outside of the UI thread, but for some reason it was still working (with the delay however) instead of throwing me an exception, thus it didn't occur to me that was it. Running it in post()
makes it start without the delay.