NavigationDrawer за SmartGLView - PullRequest
       10

NavigationDrawer за SmartGLView

0 голосов
/ 12 мая 2018

У меня есть активность, содержащая NavigationDrawer и SmartGLView.

SmartGLView внутри DrawerLayout.

Когда появляется NavigationDrawer, какая-то его часть былапокрыты SmartGLView.Как я могу сделать NavigationDrawer поверх SmartGLView?

layout.xml:

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout 
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/pl_drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">

<android.support.design.widget.NavigationView
    android:id="@+id/pl_nav_view"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    android:fitsSystemWindows="true"
    app:headerLayout="@layout/nav_header"
    app:menu="@menu/drawer_view">

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

<FrameLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">

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

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <TextView
                android:id="@+id/pl_tv_name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="line1"
                android:textAlignment="center" />

            <TextView
                android:id="@+id/pl_tv_status"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="@string/normal"
                android:textAlignment="center" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <TextView
                android:id="@+id/pl_tv_time"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="@string/defaultTime"
                android:textAlignment="center" />

            <TextView
                android:id="@+id/pl_tv_speed"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="@string/defaultSpeed"
                android:textAlignment="center" />
        </LinearLayout>


        <FrameLayout
            android:id="@+id/pl_frame_layout"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <fr.arnaudguyon.smartgl.opengl.SmartGLView
                android:id="@+id/smartGLView"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />
        </FrameLayout>
    </LinearLayout>
</FrameLayout>

1 Ответ

0 голосов
/ 12 мая 2018

Перемещение вида навигации вниз.

Основное представление содержимого (первый FrameLayout выше) должно быть первым дочерним элементом в DrawerLayout, поскольку порядок XML подразумевает z-упорядочение, а ящик должен быть сверхусодержание.

...