Nav drawer android design support library and more

This commit is contained in:
Karim Abou Zeid 2015-05-30 01:13:41 +02:00
commit b233b3b718
25 changed files with 303 additions and 405 deletions

View file

@ -1,4 +1,5 @@
<android.support.v4.widget.DrawerLayout
android:fitsSystemWindows="true"
android:id="@+id/drawer_layout"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
@ -24,11 +25,6 @@
android:orientation="vertical"
tools:ignore="UnusedAttribute">
<View
android:id="@+id/status_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/status_bar_padding" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
@ -79,21 +75,12 @@
</FrameLayout>
<FrameLayout
android:id="@+id/nav_drawer_frame"
android:layout_width="1dp"
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:layout_gravity="start"
android:clickable="true">
<fragment
android:id="@+id/navigation_drawer"
android:name="com.kabouzeid.gramophone.ui.fragments.NavigationDrawerFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:tag="NAV_DRAWER"
tools:layout="@layout/fragment_navigation_drawer" />
</FrameLayout>
android:fitsSystemWindows="true"
app:menu="@menu/menu_drawer" />
</android.support.v4.widget.DrawerLayout>

View file

@ -1,86 +0,0 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/navigation_drawer_background_color"
android:clickable="true"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="@dimen/navigation_drawer_image_height"
android:background="?selectableItemBackground"
android:clickable="true">
<ImageView
android:transitionName="@string/transition_album_cover"
android:id="@+id/album_art"
android:layout_width="match_parent"
android:layout_height="@dimen/navigation_drawer_image_height"
android:layout_alignParentTop="true"
android:scaleType="centerCrop"
android:src="@drawable/default_album_art"
tools:ignore="ContentDescription,UnusedAttribute" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:background="@drawable/shadow_up" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_alignParentBottom="true"
android:layout_marginBottom="8dp"
android:gravity="center_vertical"
android:orientation="vertical">
<TextView
android:id="@+id/song_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:fontFamily="sans-serif-medium"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
android:textColor="@color/white"
android:textSize="14sp" />
<TextView
android:id="@+id/song_artist"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:fontFamily="sans-serif"
android:singleLine="true"
android:text="@string/nothing_playing"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<Button
android:id="@+id/header_clickable"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?selectableItemBackground"
android:clickable="true"
android:soundEffectsEnabled="true" />
</RelativeLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/navigation_drawer_list"
android:scrollbars="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:clipToPadding="false" />
</LinearLayout>

View file

@ -0,0 +1,60 @@
<FrameLayout
android:id="@+id/header"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="@dimen/navigation_drawer_header_height"
android:clickable="true"
android:foreground="?rect_selector">
<ImageView
android:id="@+id/album_art"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@drawable/default_album_art"
android:transitionName="@string/transition_album_cover"
tools:ignore="UnusedAttribute" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="bottom"
android:background="@drawable/shadow_up" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_gravity="bottom"
android:layout_marginBottom="8dp"
android:gravity="center_vertical"
android:orientation="vertical">
<TextView
android:id="@+id/song_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:fontFamily="sans-serif-medium"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
android:textColor="@color/white"
android:textSize="14sp" />
<TextView
android:id="@+id/song_artist"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:fontFamily="sans-serif"
android:singleLine="true"
android:text="@string/nothing_playing"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
</FrameLayout>