0

My navigation view ignores partly the android:theme parameter of it's view in a certain screen of my app. The certain screen is a search window which includes an edit text view inside the toolbar. This issue only exists for the 4.x devices. It seems like the navigation view only ignores the parameter android:textSize.

Link to the two images. The image including the smaller font is the described navigation view which ignores the android:theme parameter partly.

That's the navigation view which I'm using globally:

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.NavigationView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="@color/nav_background"
android:fitsSystemWindows="true"
android:theme="@style/AppTheme.Drawer"
app:itemBackground="@drawable/nav_item_selector_background"
app:itemTextColor="@color/nav_default_text_color"
app:menu="@menu/navigation_drawer" />

That's the style which is connected to the android:theme:

<style name="AppTheme.Drawer">
    <item name="android:textSize">25sp</item> <!-- menu item text size-->
    <item name="android:listPreferredItemHeightSmall">70dp</item><!-- menu item height-->
</style>

Does anyone has any ideas why this behavior could happen? Additionally my navigation view is sometimes quite laggy without reasons. I don't do any calculation while opening or closing this drawer.

Mordag
  • 487
  • 7
  • 20

1 Answers1

0

I found my problem. I was using super.onCreate(savedInstanceState); after I used the methods to set the content view and toolbar. It seems like that Android 5.0+ has no problems with that but older devices do.

Mordag
  • 487
  • 7
  • 20