Better grid item selector drawable.
This commit is contained in:
parent
bb1f6c0c4b
commit
3ea94d5c4a
23 changed files with 117 additions and 96 deletions
|
|
@ -1,5 +1,5 @@
|
|||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/ripple_material_light">
|
||||
android:color="@color/ripple_material_light">
|
||||
|
||||
<item
|
||||
android:id="@android:id/mask"
|
||||
15
app/src/main/res/drawable-v21/rect_selector_strong.xml
Normal file
15
app/src/main/res/drawable-v21/rect_selector_strong.xml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/ate_control_normal_light">
|
||||
|
||||
<item
|
||||
android:id="@android:id/mask"
|
||||
android:drawable="@android:color/white" />
|
||||
<item>
|
||||
<selector>
|
||||
<item
|
||||
android:drawable="@color/ate_control_normal_light"
|
||||
android:state_activated="true" />
|
||||
</selector>
|
||||
</item>
|
||||
|
||||
</ripple>
|
||||
15
app/src/main/res/drawable-v21/rect_selector_strong_dark.xml
Normal file
15
app/src/main/res/drawable-v21/rect_selector_strong_dark.xml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/ate_control_normal_dark">
|
||||
|
||||
<item
|
||||
android:id="@android:id/mask"
|
||||
android:drawable="@android:color/white" />
|
||||
<item>
|
||||
<selector>
|
||||
<item
|
||||
android:drawable="@color/ate_control_normal_dark"
|
||||
android:state_activated="true" />
|
||||
</selector>
|
||||
</item>
|
||||
|
||||
</ripple>
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="?android:colorControlHighlight">
|
||||
android:color="@color/ripple_material_light">
|
||||
|
||||
<item
|
||||
android:id="@android:id/mask"
|
||||
android:drawable="@drawable/round_ripple_selector_mask" />
|
||||
android:drawable="@drawable/round_selector_mask" />
|
||||
|
||||
</ripple>
|
||||
8
app/src/main/res/drawable-v21/round_selector_dark.xml
Normal file
8
app/src/main/res/drawable-v21/round_selector_dark.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/ripple_material_dark">
|
||||
|
||||
<item
|
||||
android:id="@android:id/mask"
|
||||
android:drawable="@drawable/round_selector_mask" />
|
||||
|
||||
</ripple>
|
||||
9
app/src/main/res/drawable/rect_selector_strong.xml
Normal file
9
app/src/main/res/drawable/rect_selector_strong.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:drawable="@color/ate_control_normal_light" android:state_activated="true" android:state_pressed="true" />
|
||||
<item android:drawable="@color/ate_control_normal_light" android:state_activated="true" />
|
||||
<item android:drawable="@color/ate_control_normal_light" android:state_pressed="true" />
|
||||
<item android:drawable="@android:color/transparent" />
|
||||
|
||||
</selector>
|
||||
9
app/src/main/res/drawable/rect_selector_strong_dark.xml
Normal file
9
app/src/main/res/drawable/rect_selector_strong_dark.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:drawable="@color/ate_control_normal_dark" android:state_activated="true" android:state_pressed="true" />
|
||||
<item android:drawable="@color/ate_control_normal_dark" android:state_activated="true" />
|
||||
<item android:drawable="@color/ate_control_normal_dark" android:state_pressed="true" />
|
||||
<item android:drawable="@android:color/transparent" />
|
||||
|
||||
</selector>
|
||||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,29 +1,17 @@
|
|||
<resources>
|
||||
|
||||
<style name="Theme.Phonograph" parent="Theme.Phonograph.Base">
|
||||
<item name="roundSelector">@drawable/round_ripple_selector</item>
|
||||
<item name="rectSelector">@drawable/rect_ripple_selector_dark</item>
|
||||
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
|
||||
<item name="android:windowSharedElementsUseOverlay">false</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Phonograph.Light" parent="Theme.Phonograph.Base.Light">
|
||||
<item name="roundSelector">@drawable/round_ripple_selector</item>
|
||||
<item name="rectSelector">@drawable/rect_ripple_selector</item>
|
||||
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
|
||||
<item name="android:windowSharedElementsUseOverlay">false</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Phonograph.Black" parent="Theme.Phonograph.Base.Black">
|
||||
<item name="roundSelector">@drawable/round_ripple_selector</item>
|
||||
<item name="rectSelector">@drawable/rect_ripple_selector_dark</item>
|
||||
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
|
||||
<item name="android:windowSharedElementsUseOverlay">false</item>
|
||||
</style>
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
<attr name="roundSelector" format="reference" />
|
||||
<attr name="rectSelector" format="reference" />
|
||||
<attr name="rectSelectorStrong" format="reference" />
|
||||
|
||||
<attr name="defaultFooterColor" format="color" />
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
<item name="roundSelector">@drawable/round_selector_dark</item>
|
||||
<item name="rectSelector">@drawable/rect_selector_dark</item>
|
||||
<item name="rectSelectorStrong">@drawable/rect_selector_strong_dark</item>
|
||||
|
||||
<item name="cardBackgroundColor">@color/grey_800</item>
|
||||
|
||||
|
|
@ -38,6 +39,7 @@
|
|||
|
||||
<item name="roundSelector">@drawable/round_selector</item>
|
||||
<item name="rectSelector">@drawable/rect_selector</item>
|
||||
<item name="rectSelectorStrong">@drawable/rect_selector_strong</item>
|
||||
|
||||
<item name="cardBackgroundColor">@color/white</item>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue