Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid 4.4 — Translucent status/navigation bars — fitsSystemWindows/clipToPadding don't work through fragment transactions
    primarykey
    data
    text
    <p>When using the translucent status and navigation bars from the new Android 4.4 KitKat APIs, setting <code>fitsSystemWindows="true"</code> and <code>clipToPadding="false"</code> to a <code>ListView</code> works initially. <code>fitsSystemWindows="true"</code> keeps the list under the action bar and above the navigation bar, <code>clipToPadding="false"</code> 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.</p> <p>However, when you replace the content with another <code>Fragment</code> through a <code>FragmentTransaction</code> the effect of <code>fitsSystemWindows</code> goes away and the fragment goes under the action bar and navigation bar.</p> <p>I have a codebase of demo source code here along with a downloadable APK as an example: <a href="https://github.com/afollestad/kitkat-transparency-demo" rel="noreferrer">https://github.com/afollestad/kitkat-transparency-demo</a>. 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).</p> <p>Any ideas? Any clarification needed? I posted the before and after screenshots of my personal app being developed for my employer. </p> <p><img src="https://i.stack.imgur.com/W2ofA.png" alt="One"> <img src="https://i.stack.imgur.com/IIDwl.png" alt="Two"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload