add some visuals to selected songs
This commit is contained in:
parent
59d3c523b8
commit
9daaedfdc1
7 changed files with 49 additions and 31 deletions
17
app/src/main/res/drawable-v21/selector.xml
Normal file
17
app/src/main/res/drawable-v21/selector.xml
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<selector>
|
||||
<item
|
||||
android:drawable="@color/activated_item_foreground"
|
||||
android:state_activated="true"/>
|
||||
</selector>
|
||||
</item>
|
||||
<item>
|
||||
<ripple android:color="@color/pressed_item_foreground">
|
||||
<item android:id="@android:id/mask">
|
||||
<color android:color="@android:color/white"/>
|
||||
</item>
|
||||
</ripple>
|
||||
</item>
|
||||
</layer-list>
|
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:drawable="@drawable/button_pressed"
|
||||
android:state_pressed="true"/>
|
||||
</selector>
|
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid
|
||||
android:color="@color/dark_grey"/>
|
||||
</shape>
|
5
app/src/main/res/drawable/selector.xml
Normal file
5
app/src/main/res/drawable/selector.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@color/pressed_item_foreground" android:state_pressed="true"/>
|
||||
<item android:drawable="@color/activated_item_foreground" android:state_activated="true"/>
|
||||
</selector>
|
|
@ -1,26 +1,32 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
android:id="@+id/songHolder"
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/song_item_padding">
|
||||
android:layout_height="match_parent"
|
||||
android:foreground="@drawable/selector">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/songTitle"
|
||||
<LinearLayout
|
||||
android:id="@+id/songHolder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Song Title"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp"/>
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/song_item_padding">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/songArtist"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Song Artist"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp"/>
|
||||
<TextView
|
||||
android:id="@+id/songTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Song Title"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/songArtist"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Song Artist"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp"/>
|
||||
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
|
|
|
@ -4,4 +4,6 @@
|
|||
<color name="colorPrimaryDark">#303F9F</color>
|
||||
<color name="colorAccent">#FF4081</color>
|
||||
<color name="dark_grey">#11000000</color>
|
||||
<color name="pressed_item_foreground">#11000000</color>
|
||||
<color name="activated_item_foreground">#33000000</color>
|
||||
</resources>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
</style>
|
||||
|
||||
<style name="MyButton">
|
||||
<item name="android:background">@drawable/button</item>
|
||||
<item name="android:background">@drawable/selector</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
|
Loading…
Reference in a new issue