Search is back. Now with recycler view and the ability to set a different xml file for song, album, artist and header results if needed. Also improved its appearance by adding elevation (inspired by Googles Inbox).

This commit is contained in:
Karim Abou Zeid 2015-04-25 12:17:41 +02:00
commit 428dd22296
14 changed files with 447 additions and 111 deletions

View file

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="72dp"
android:background="?card_color"
android:elevation="2dp"
android:foreground="?rect_selector"
tools:ignore="UnusedAttribute">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:descendantFocusability="blocksDescendants"
android:orientation="horizontal"
android:paddingLeft="16dp"
android:paddingRight="16dp">
<com.kabouzeid.gramophone.views.SquareImageView
android:id="@+id/album_art"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center"
android:gravity="center"
android:scaleType="centerCrop" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/album_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
android:textColor="?title_text_color" />
<TextView
android:id="@+id/album_artist"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textColor="?caption_text_color" />
</LinearLayout>
</LinearLayout>
<View
android:id="@+id/short_separator"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_gravity="bottom"
android:layout_marginLeft="72dp"
android:layout_marginStart="72dp"
android:background="?separator_color" />
</FrameLayout>