As you can see my "Got It" button is behind the navigation bar.Not able to fix it!!! I have tried
<item name="android:fitsSystemWindows">true</item>
As well as setting it in layout file.
my theme in value-21 is :
<style name="AppTheme" parent="android:Theme.Material.Light.NoActionBar">
<item name="android:windowNoTitle">true</item>
<item name="android:windowActionBar">false</item>
<item name="android:windowFullscreen">false</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:fitsSystemWindows">true</item>
</style>
Its the same case with all the screens throughout the application.
Please Help.
Setting
softInputMode
ofpopupWindow
toSOFT_INPUT_ADJUST_RESIZE
resolves the issue.Simply set this in your Activity's onCreate(), while setting up content view :
Use this code in your onCreate method of your
Activity
(If you haveBaseActivity
you can do this there so all activities apply this):When a layout has this flag, it means that this layout is asking the system to be applied window insets. In our case that would mean, that FrameLayout desires to be applied a padding that is equal to status bar’s height.
Here is the solution.
Most of the layouts get solved by adding these properties in value-21 style.xml
for others, I have calculated the hight of navigation bar and add margin to my view .
Note: By using the above solutions everything work but I was also using PopupWindow in my app.The layout of the PopupWindow get messed up in android L. Look for the issue and the solution here
It is so simple, just add this line to your parent layout xml:
For nice user experience you should not need to block navigation keys area using
android:windowTranslucentNavigation
rather here is the better solution, if you are using ResideMenu library then simply add this method in ResideMenu.java
and if you are using
SlidingMenu
library then change mod toSLIDING_CONTENT
by:Hope it will save your time