I have a navigation view and it works well but I want to make a small arrow next to it just to let the user know that he can swipe that arrow to the right to see the navigation menu options. I tried to play with margins and put the arrow vector asset inside the navigation view but that didn't work because I also want the user to hide it when he wants to.
That's my simple xml code:
android:id="@+id/drawer_nav"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@color/black"
app:menu="@menu/navigation"
app:itemTextColor="@color/white"
app:itemIconTint="@color/white"
android:layout_gravity="start"
/>
I also tried to have my arrow between the tags of navigation view like this but that didn't work as well.. It showed me the place of the icon just where I want it to be but the icon itself ( the arrow ) somehow disappeared :(
<com.google.android.material.navigation.NavigationView
android:id="@+id/drawer_nav"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@color/black"
app:menu="@menu/navigation"
app:itemTextColor="@color/white"
app:itemIconTint="@color/white"
android:layout_gravity="start">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/arrowopenClose"
android:layout_width="20dp"
android:layout_height="30dp"
android:layout_marginEnd="-20dp"
android:layout_marginTop="400dp"
android:layout_gravity="right"
android:src="@drawable/ic_baseline_keyboard_arrow_right_24"
android:background="@drawable/customarrow"
android:clickable="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</com.google.android.material.navigation.NavigationView>
</androidx.drawerlayout.widget.DrawerLayout>