I'm using AppCompat v21
with the Style "NoActionBar" and add a Action/Toolbar in onCreate
.
Also a SlidingMenu of Feinstein is added and that causes the problem that the that the Activity (and therefore the inside Fragments) overlap with the navigation buttons of Android (it is not fully shown, cut off at the bottom)
if i add:
android:layout_marginBottom="48dp"
in the layout it everything is visible (of course).
On Android 4.4. everything is shown properly.
What am I missing on Android L using the support lib?
SlidingMenu added in onCreate:
super.onCreate(..)
setContentView(..)
menu = new SlidingMenu(this);
menu.setMode(SlidingMenu.LEFT);
menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_MARGIN);
menu.attachToActivity(this, SlidingMenu.SLIDING_WINDOW);
menu.setMenu(R.layout.menu);
menu.setBehindWidthRes(200dp);
Solution:
The issue is stated here https://github.com/jfeinstein10/SlidingMenu/issues/680 (including the solution)
Slding Menu to SLIDING_CONTENT
OR: update the SlidingMenu source like mentioned in the link aboce
Better Solution:
(also working with Samsung devices on 5.0) - provided by withaay
Adding the following lines to the SlidingMenu constructors has worked for me. I didn't have to make any other code changes.
if(Build.VERSION.SDK_INT >= 21) setSystemUiVisibility(SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION)
Try to add android:minHeight="?attr/actionBarSize" to your Toolbar.
Adding the following lines to the SlidingMenu constructors has worked for me. I didn't have to make any other code changes.
If you are trying to use Fenstein Menu with App Compat probably you'll get an issue with your slding menu. Your sliding menu will slide from behind of your phone's bottom bar.
To fix this locate
Find
And replace it
I searched hard about this problem and the solution above worked for me.
You've added the Toolbar in your main
LinearLayout
, but you are still usingmatch_parent
for the height of yourFrameLayout
container. Try filling up the remaining space of your LinearLayout instead:The issue is stated here https://github.com/jfeinstein10/SlidingMenu/issues/680 (including the solution)
The following code worked for me: basically you always call
setSlidingActionBarEnabled(false)
and then compute and set the correct height of your root view according to the below formula, depending on the fact that you have a navigation bar or not.