add header/footer to drawer
This commit is contained in:
parent
9427231035
commit
40ccb4518a
17 changed files with 93 additions and 11 deletions
|
|
@ -1,7 +1,6 @@
|
|||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/drawer_layout"
|
||||
android:layout_width="match_parent"
|
||||
|
|
@ -21,10 +20,6 @@
|
|||
<include layout="@layout/toolbar_layout" />
|
||||
</FrameLayout>
|
||||
|
||||
<android.support.design.widget.NavigationView
|
||||
android:id="@+id/navigation"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
app:menu="@menu/drawer_items" />
|
||||
<include layout="@layout/drawer_laoyut"/>
|
||||
|
||||
</android.support.v4.widget.DrawerLayout>
|
||||
65
app/src/main/res/layout/drawer_laoyut.xml
Normal file
65
app/src/main/res/layout/drawer_laoyut.xml
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout android:id="@+id/navigation_layout"
|
||||
android:orientation="vertical"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_gravity="start"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="?attr/android:windowBackground">
|
||||
|
||||
<View
|
||||
android:id="@+id/drawer_header"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="150dp"
|
||||
android:layout_alignLeft="@id/navigation"
|
||||
android:layout_alignRight="@id/navigation"
|
||||
android:layout_alignStart="@id/navigation"
|
||||
android:layout_alignEnd="@id/navigation"
|
||||
android:background="?attr/colorPrimary"/>
|
||||
|
||||
<android.support.design.widget.NavigationView
|
||||
android:id="@+id/navigation"
|
||||
android:layout_below="@id/drawer_header"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:menu="@menu/drawer_items"
|
||||
app:elevation="0dp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/navigation_drawer_footer"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="60dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_alignLeft="@id/navigation"
|
||||
android:layout_alignRight="@id/navigation"
|
||||
android:layout_alignStart="@id/navigation"
|
||||
android:layout_alignEnd="@id/navigation"
|
||||
|
||||
android:layout_alignParentBottom="true">
|
||||
<ImageButton
|
||||
android:id="@+id/drawer_settings"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:src="?attr/settings"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/drawer_downloads"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:src="?attr/download" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/drawer_history"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:src="?attr/history"/>
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
@ -310,7 +310,7 @@
|
|||
android:layout_height="55dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight="1"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:contentDescription="@string/append_playlist"
|
||||
|
|
@ -327,7 +327,7 @@
|
|||
android:layout_height="55dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight="1"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:contentDescription="@string/play_audio"
|
||||
|
|
@ -344,7 +344,7 @@
|
|||
android:layout_height="55dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight="1"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:contentDescription="@string/open_in_popup_mode"
|
||||
|
|
@ -361,7 +361,7 @@
|
|||
android:layout_height="55dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight="1"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:contentDescription="@string/controls_download_desc"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue