I want to add translucent statusbar and navigation to my app (for kitkat) and on most places it works well.
I have a theme with:
<item name="android:windowTranslucentNavigation">true</item>
<item name="android:windowTranslucentStatus">true</item>
and in my layouts I have android:fitsSystemWindows="true"
For normal activities this works fine, but I have two activities that make trouble. -> The content is shown behind the statusbar and my actionbar.
One of them is the PreferenceActivity were I fixed it by adding findViewById(android.R.id.list).setFitsSystemWindows(true);
The second is an Activity with ActionBar.NAVIGATION_MODE_TABS
and there I can't find the right target for the setFitsSystemWindows(true)
call.
I tried with findViewById(android.R.id.content)
and findViewById(android.R.id.tabcontent)
. I also tried to add the xml attribute to the layout of my fragment but no success.
Add a 25 dp paddingTop on your toolbar
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