Open right navigation bar with button from custom toolbar

Hello. In my xamarin android app I have a right navigation bar and a custom toolbar. The code for navigation bar is this

<android.support.design.widget.NavigationView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="right"
android:id="@+id/right_nav_view"
app:menu="@menu/menu_navigation_swipe" />

And the code for toolbar is this

<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="45dp"
android:minHeight="?attr/actionBarSize"
android:background="@drawable/rectangle"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light">

      <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">
        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/HomeButton"
            android:layout_gravity="center"
            android:src="@drawable/logo"
            android:clickable="true" />

      <ImageView
              android:padding="10dp"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:id="@+id/right_nav"
             android:layout_alignParentEnd="true"
             android:layout_alignParentRight="true"
             android:src="@drawable/icon_settings"
             android:clickable="true" />

        </RelativeLayout>
    </android.support.v7.widget.Toolbar>

I wanna open the navigation bar when the user press the ImageView with id = right_nav. How can i do this?

Sign In or Register to comment.