Insert Admob MEDIUM_RECT into the Android Design Library Navigation Menu

Using

<item android:id="@+id/nav_ad" android:title="@null" app:actionLayout="@layout/sidebar_ad" /> 

I can use my own layout and create my own ad inside NavigationView. However, the height of the list item is apparently fixed at the same value, which means that it is not possible to individually change the height of an individual item.

View view = mNavView.getMenu().findItem(R.id.nav_ad).getActionView() returns the custom view I created, however view.getParent() returns null, which means that it is not possible to get a reference to the setMinimumHeight() container setMinimumHeight() on it.

I even thought about using reflection to hack the NavigationMenuAdapter , but since this is a private inner class, I don’t even know where to start.

Uses another drawer library / records own drawer view just for walking?

+7
android admob navigationview android-navigationview android-support-design
source share

No one has answered this question yet.

See related questions:

2510
How to keep Android activity state by saving instance state?
2097
Is there a way to run Python on Android?
1270
How to transfer data between actions in an Android application?
1214
Rename package in Android Studio
1206
What is Gradle in Android Studio?
900
How to disable landscape mode in Android?
370
Android Options menu in fragment
293
How to get the absolute coordinates of the view
53
Why don't ListView items grow to wrap their contents?
14
Android gets the height of the content of the web browser after rendering

All Articles