android – How to implement a NavigationView with slider button in xml layout-ThrowExceptions

Exception or error:

I need to make a layout like the Image given

I am using NavigationView within DrawerLayout, and want to add a button as shown in the Image Button to show that will always remain in screen on a particular activity, its basically for showing the user that there is a navigationView. SemiCircle button should always in screen even if drawer closed.
The Layout I am trying is

<androidx.coordinatorlayout.widget.CoordinatorLayout>
 <com.google.android.material.appbar.AppBarLayout>
  <com.google.android.material.appbar.CollapsingToolbarLayout>
       *something*
   <androidx.appcompat.widget.Toolbar>
       *custom toolbar*
    </androidx.appcompat.widget.Toolbar>

         </com.google.android.material.appbar.CollapsingToolbarLayout>
        </com.google.android.material.appbar.AppBarLayout>

      <androidx.recyclerview.widget.RecyclerView/>
    </androidx.coordinatorlayout.widget.CoordinatorLayout>
      <com.google.android.material.navigation.NavigationView>
          *if here i am adding button its not working*
      <com.google.android.material.navigation.NavigationView>
</androidx.drawerlayout.widget.DrawerLayout> ```
How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *