drawer: use custom navigation component
The native NavigationView component is not customizable enough.
To implement a proper account switcher we need to have full control on
this view. The NavigationView now only serves has a container for our
navigation fragment. This fragment manages the header and the navigation
list.
Change-Id: I272c29b466022552b244edd65b725d0dc3ec29eb
Tuleap: #1218
diff --git a/ring-android/app/src/main/res/layout/item_menu.xml b/ring-android/app/src/main/res/layout/item_menu.xml
index 340fd37..6de729d 100644
--- a/ring-android/app/src/main/res/layout/item_menu.xml
+++ b/ring-android/app/src/main/res/layout/item_menu.xml
@@ -1,12 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
-<TextView xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/menu_title_categorie"
+
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
- android:layout_height="?android:attr/listPreferredItemHeight"
- android:gravity="center_vertical"
- android:paddingBottom="10dip"
- android:paddingLeft="15dip"
- android:paddingTop="10dip"
- android:background="?android:attr/activatedBackgroundIndicator"
- android:textColor="@color/black"
- android:textSize="20sp" />
+ android:layout_height="48dp"
+ android:background="?android:attr/selectableItemBackground"
+ android:drawSelectorOnTop="true">
+
+ <android.support.v7.widget.AppCompatImageView
+ android:id="@+id/navigation_item_icon"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_centerVertical="true"
+ android:layout_marginLeft="16dp"
+ android:layout_marginStart="16dp"
+ android:alpha="0.54"
+ tools:src="@drawable/ic_home_black" />
+
+ <TextView
+ android:id="@+id/navigation_item_title"
+ android:layout_width="match_parent"
+ android:layout_height="?android:attr/listPreferredItemHeight"
+ android:layout_centerVertical="true"
+ android:layout_marginEnd="16dp"
+ android:layout_marginLeft="72dp"
+ android:layout_marginRight="16dp"
+ android:layout_marginStart="72dp"
+ android:alpha="0.87"
+ android:fontFamily="sans-serif-medium"
+ android:gravity="center_vertical"
+ android:textColor="@color/black"
+ android:textSize="14sp"
+ tools:text="Home" />
+
+</RelativeLayout>