I've been looking for the solution to hide Android Action Bar. Tens of them are published and work the same way - Action Bar is hidden only after it's shown for the second. Not good enough, so I tested more and created my own solution. It was not published anywhere, but seems for me very simple and obvious. The most important is - Action Bar can't be seen at all.
My question is - what's wrong with it ? ) Why did Android dinosaurs avoid something like that ?
Solution to hide Android Action Bar :
in Manifest
android:theme="@style/CustomActionBarTheme"
in themes.xml
<style name="CustomActionBarTheme"
parent="@style/Theme.AppCompat.Light.DarkActionBar">
<item name="android:actionBarStyle">@style/MyActionBar</item>
<!-- Support library compatibility -->
<item name="actionBarStyle">@style/MyActionBar</item>
</style>
<!-- ActionBar styles -->
<style name="MyActionBar"
parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
<item name="android:layout_marginBottom">-50dp</item>
</style>
As you can see I just use negative marginBottom.