aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/res/layout
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2015-06-05 17:39:57 -0700
committerScott Jackson <daneren2005@gmail.com>2015-06-05 17:39:57 -0700
commite62cbdae5a41909a03652ae4a967a4e72fe96748 (patch)
treecb8ab4ad69d8b6495ee1a8db079aa57159f76803 /app/src/main/res/layout
parentd79f241c64ffa21ebbaacb918f50300515522bbd (diff)
downloaddsub-e62cbdae5a41909a03652ae4a967a4e72fe96748.tar.gz
dsub-e62cbdae5a41909a03652ae4a967a4e72fe96748.tar.bz2
dsub-e62cbdae5a41909a03652ae4a967a4e72fe96748.zip
#493 Switch from ListView to NavigationView + move server selection logic into drawer
Diffstat (limited to 'app/src/main/res/layout')
-rw-r--r--app/src/main/res/layout/abstract_activity.xml15
-rw-r--r--app/src/main/res/layout/drawer_header.xml52
-rw-r--r--app/src/main/res/layout/drawer_list_item.xml27
3 files changed, 43 insertions, 51 deletions
diff --git a/app/src/main/res/layout/abstract_activity.xml b/app/src/main/res/layout/abstract_activity.xml
index be65e437..f012f484 100644
--- a/app/src/main/res/layout/abstract_activity.xml
+++ b/app/src/main/res/layout/abstract_activity.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
@@ -9,13 +10,11 @@
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
+
<!-- The navigation drawer -->
- <ListView android:id="@+id/left_drawer"
- android:layout_width="240dp"
- android:layout_height="match_parent"
- android:layout_gravity="start"
- android:choiceMode="singleChoice"
- android:divider="@android:color/transparent"
- android:dividerHeight="0dp"
- android:background="?android:windowBackground"/>
+ <android.support.design.widget.NavigationView
+ android:id="@+id/left_drawer"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_gravity="start"/>
</android.support.v4.widget.DrawerLayout>
diff --git a/app/src/main/res/layout/drawer_header.xml b/app/src/main/res/layout/drawer_header.xml
index 00441b73..fe0a9f2d 100644
--- a/app/src/main/res/layout/drawer_header.xml
+++ b/app/src/main/res/layout/drawer_header.xml
@@ -3,34 +3,54 @@
android:layout_width="match_parent"
android:layout_height="178dp"
android:orientation="vertical"
- android:weightSum="1">
+ android:weightSum="1"
+ android:background="?attr/selectableItemBackground">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="56dp"
- android:orientation="vertical"
+ android:orientation="horizontal"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
- <TextView
- android:id="@+id/header_server_name"
+ <LinearLayout
+ android:orientation="vertical"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="16dp"
- android:textColor="?android:textColorPrimary"
- android:textSize="14sp"
- android:textStyle="bold"/>
+ android:layout_height="wrap_content">
+
+ <TextView
+ android:id="@+id/header_server_name"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="16dp"
+ android:textColor="?android:textColorPrimary"
+ android:textSize="14sp"
+ android:textStyle="bold"/>
+
+ <TextView
+ android:id="@+id/header_user_name"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="16dp"
+ android:layout_marginTop="5dp"
+ android:textColor="?android:textColorSecondary"
+ android:textSize="14sp"
+ android:textStyle="normal"/>
+ </LinearLayout>
+
+ <View
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ android:layout_weight="1"/>
- <TextView
- android:id="@+id/header_user_name"
+ <ImageView
+ android:id="@+id/header_select_image"
+ android:src="?attr/select_server"
+ android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginLeft="16dp"
- android:layout_marginTop="5dp"
- android:textColor="?android:textColorSecondary"
- android:textSize="14sp"
- android:textStyle="normal"/>
+ android:paddingRight="20dp"/>
</LinearLayout>
<de.hdodenhof.circleimageview.CircleImageView
diff --git a/app/src/main/res/layout/drawer_list_item.xml b/app/src/main/res/layout/drawer_list_item.xml
deleted file mode 100644
index 607b3658..00000000
--- a/app/src/main/res/layout/drawer_list_item.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="horizontal"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:paddingTop="8dip"
- android:paddingBottom="9dip">
-
- <ImageView
- android:id="@+id/drawer_icon"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="left|center_vertical"
- android:paddingTop="1dip"
- android:paddingBottom="1dip"
- android:paddingRight="8dip"
- android:paddingLeft="10dip"/>
-
- <TextView
- android:id="@+id/drawer_name"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:singleLine="true"
- android:textColor="?android:textColorPrimary"
- android:textAppearance="?android:attr/textAppearanceLarge"
- style="DSub.TextViewStyle"/>
-</LinearLayout>