Friday 10 January 2020

Remove gap from navigation drawer layout

I have created an application that has a navigation view.

when the application in fullscreen then I open that navigation-view that shows me the black overlay on top of navigation-view and also shows me the gap between the bottom of the screen and the bottom of navigation-view. For that, I have attached images with this that shows the problems.

  • xml code
<?xml version="1.0" encoding="utf-8"?>

<androidx.drawerlayout.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"
    tools:openDrawer="start">

    ...

    <com.google.android.material.navigation.NavigationView
        android:id="@+id/nav_view"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="end"
        tools:ignore="RtlSymmetry">

        <!--PlayList Layout-->
        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/rcvVideoPlaylist"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scrollbars="vertical"
            android:fitsSystemWindows="false"
            tools:listitem="@layout/item_video_playlist" />

    </com.google.android.material.navigation.NavigationView>

</androidx.drawerlayout.widget.DrawerLayout>
  • for fullscreen code
view.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE
                | View.SYSTEM_UI_FLAG_FULLSCREEN
                | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
                | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);

see the below image. This image show the overlay problem. This image show the gap problem.

anyone give me the solution to remove that overlay from navigation-view and gap in that navigation-view



from Remove gap from navigation drawer layout

No comments:

Post a Comment