When using the translucent status and navigation bars from the new Android 4.4 KitKat APIs, setting fitsSystemWindows="true"
and clipToPadding="false"
to a ListView
works initially. fitsSystemWindows="true"
keeps the list under the action bar and above the navigation bar, clipToPadding="false"
allows the list to scroll under the transparent navigation bar and makes the last item in the list scroll up just far enough to pass the navigation bar.
However, when you replace the content with another Fragment
through a FragmentTransaction
the effect of fitsSystemWindows
goes away and the fragment goes under the action bar and navigation bar.
I have a codebase of demo source code here along with a downloadable APK as an example: https://github.com/afollestad/kitkat-transparency-demo. To see what I'm talking about, open the demo app from a device running KitKat, tap an item in the list (which will open another activity), and tap an item in the new activity that opens. The fragment that replaces the content goes under the action bar and clipToPadding doesn't work correctly (the navigation bar covers the last item in the list when you scroll all the way down).
Any ideas? Any clarification needed? I posted the before and after screenshots of my personal app being developed for my employer.