Better grid item selector drawable.

This commit is contained in:
Karim Abou Zeid 2016-02-28 22:51:48 +01:00
commit 3ea94d5c4a
23 changed files with 117 additions and 96 deletions

View file

@ -16,20 +16,27 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.kabouzeid.gramophone.views.WidthFitSquareImageView
android:id="@+id/image"
<com.kabouzeid.gramophone.views.WidthFitSquareLayout
android:id="@+id/image_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@drawable/default_album_art"
android:transitionName="@string/transition_album_art"
tools:ignore="UnusedAttribute" />
android:layout_height="match_parent">
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@drawable/default_album_art"
android:transitionName="@string/transition_album_art"
tools:ignore="UnusedAttribute" />
</com.kabouzeid.gramophone.views.WidthFitSquareLayout>
<LinearLayout
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/image"
android:layout_below="@+id/image_container"
android:elevation="@dimen/toolbar_elevation"
android:minHeight="@dimen/title_view_height"
android:orientation="vertical"

View file

@ -16,7 +16,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.kabouzeid.gramophone.views.WidthFitSquareImageView
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"

View file

@ -3,9 +3,8 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_margin="2dp"
android:foreground="?attr/rectSelector">
android:foreground="?rectSelectorStrong">
<LinearLayout
android:layout_width="match_parent"
@ -14,11 +13,19 @@
android:orientation="vertical"
tools:ignore="UnusedAttribute,UselessParent">
<com.kabouzeid.gramophone.views.WidthFitSquareImageView
android:id="@+id/image"
<com.kabouzeid.gramophone.views.WidthFitSquareLayout
android:id="@+id/image_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop" />
android:layout_height="match_parent">
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
tools:ignore="ContentDescription" />
</com.kabouzeid.gramophone.views.WidthFitSquareLayout>
<LinearLayout
android:id="@+id/palette_color_container"
@ -48,15 +55,4 @@
</LinearLayout>
<ImageView
android:id="@+id/selected_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingBottom="68dp"
app:srcCompat="@drawable/ic_done_black_24dp"
android:tint="?android:colorBackground"
android:visibility="gone"
tools:ignore="ContentDescription,MissingPrefix" />
</FrameLayout>

View file

@ -5,7 +5,7 @@
android:layout_height="148dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:foreground="?attr/rectSelector"
android:foreground="?attr/rectSelectorStrong"
app:cardBackgroundColor="?cardBackgroundColor">
<LinearLayout