Problem NavigationDrawer + Tabbed Activity API19 (Not seen, in API 21 if)

0

I have an application that mixes a NavigationDrawer with a TabbedActivity and I have reduced the minimum SDK of my application to the API19 and I have the problem that in that API nothing appears on the bar, neither the menu button nor the title nor the icons For APIs> 21 I have no problem.

(SOLVED at link )

Thank you!

    
asked by GCH 20.02.2018 в 12:18
source

2 answers

1

I have managed to solve it through another post on stackoverflow.com but now I have the problem that the layout is bigger than the screen on the bottom because on screens where it had content and margin, you lose the margin and even part of the content:

This is the code of activity_main (where the entire layout is already)

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:openDrawer="start">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="@color/colorPrimary"
            app:popupTheme="@style/AppTheme.PopupOverlay"
            app:titleTextColor="@android:color/white" />

        <android.support.design.widget.CoordinatorLayout
            android:id="@+id/contenedor"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <android.support.design.widget.AppBarLayout
                android:id="@+id/appbar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/colorPrimaryDark"
                android:theme="@style/AppTheme.AppBarOverlay" />

        </android.support.design.widget.CoordinatorLayout>

    </LinearLayout>

    <android.support.design.widget.NavigationView
        android:id="@+id/nav_view"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:fitsSystemWindows="true"
        app:headerLayout="@layout/nav_header_main"
        app:itemIconTint="#981e73be"
        app:itemTextColor="#2E2E2E"
        app:menu="@menu/activity_main_drawer" />

</android.support.v4.widget.DrawerLayout>
    
answered by 21.02.2018 в 14:42
0

in Styles I have:

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

    <style name="AppTheme.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>

    <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

    <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" /> 

Activity_main.xml

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">

<include
    layout="@layout/app_bar_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

<android.support.design.widget.NavigationView
    android:id="@+id/nav_view"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    android:fitsSystemWindows="true"
    app:itemIconTint="#981e73be"
    app:itemTextColor="#2E2E2E"
    app:headerLayout="@layout/nav_header_main"
    app:menu="@menu/activity_main_drawer" />

I have followed these two tutorials: one. link two. link

    
answered by 21.02.2018 в 10:29