-1

I am using navigation drawer in my app, i have a requirement to add chevron at the end of each row like following

enter image description here

Following is my code.

<com.google.android.material.navigation.NavigationView
    android:id="@+id/nav_view"
    android:fitsSystemWindows="true"
    android:layout_marginEnd="-65dp"
    android:layout_marginRight="-65dp"
    android:background="@color/nav_base_color"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    app:itemTextAppearance="@style/navigationFontStyle"
    app:headerLayout="@layout/nav_header_layout"
    app:menu="@menu/navigation" />
dev90
  • 7,187
  • 15
  • 80
  • 153

1 Answers1

1
  <com.google.android.material.navigation.NavigationView
        android:id="@+id/nav_view"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:background="#fff"
        android:fitsSystemWindows="true"
        android:visibility="visible"
        app:headerLayout="@layout/nav_header_sample_drawer"
        app:itemIconTint="@color/colorPrimary"
        app:itemTextColor="#212121">

then here is nav_header_sample_drawe

 <?xml version="1.0" encoding="utf-8"?>
 <layout xmlns:android="http://schemas.android.com/apk/res/android"
 xmlns:app="http://schemas.android.com/apk/res-auto">

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/colorPrimary"
    android:orientation="vertical"
    android:paddingTop="20dp"
    android:theme="@style/ThemeOverlay.AppCompat.Dark">

    <include
        android:id="@+id/drawer_layout"
        layout="@layout/navigation_drawer"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentBottom="true" />


    </LinearLayout>
    </layout>

And Then in layout="@layout/navigation_drawer"

you can add your custom layout

Peter Alwin
  • 239
  • 1
  • 6