Added rect selector global
This commit is contained in:
parent
585d959e3d
commit
097f36397b
20 changed files with 68 additions and 5 deletions
9
app/src/main/res/drawable-v21/rect_ripple_selector.xml
Normal file
9
app/src/main/res/drawable-v21/rect_ripple_selector.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:color="?android:colorControlHighlight">
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@android:id/mask"
|
||||||
|
android:drawable="@drawable/rect_selected"/>
|
||||||
|
<item android:drawable="@drawable/rect_selector"/>
|
||||||
|
|
||||||
|
</ripple>
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:color="?android:colorControlHighlight">
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@android:id/mask"
|
||||||
|
android:drawable="@drawable/rect_selected_dark"/>
|
||||||
|
<item android:drawable="@drawable/rect_selector_dark"/>
|
||||||
|
|
||||||
|
</ripple>
|
||||||
7
app/src/main/res/drawable-v21/rect_selector.xml
Normal file
7
app/src/main/res/drawable-v21/rect_selector.xml
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<item android:state_selected="true" android:drawable="@drawable/rect_selected" />
|
||||||
|
<item android:drawable="@drawable/transparent" />
|
||||||
|
|
||||||
|
</selector>
|
||||||
7
app/src/main/res/drawable-v21/rect_selector_dark.xml
Normal file
7
app/src/main/res/drawable-v21/rect_selector_dark.xml
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<item android:state_selected="true" android:drawable="@drawable/rect_selected_dark" />
|
||||||
|
<item android:drawable="@drawable/transparent" />
|
||||||
|
|
||||||
|
</selector>
|
||||||
5
app/src/main/res/drawable/rect_selected.xml
Normal file
5
app/src/main/res/drawable/rect_selected.xml
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<solid android:color="@color/button_selected" />
|
||||||
|
</shape>
|
||||||
5
app/src/main/res/drawable/rect_selected_dark.xml
Normal file
5
app/src/main/res/drawable/rect_selected_dark.xml
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<solid android:color="@color/button_selected_dark" />
|
||||||
|
</shape>
|
||||||
7
app/src/main/res/drawable/rect_selector.xml
Normal file
7
app/src/main/res/drawable/rect_selector.xml
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<item android:state_pressed="true" android:drawable="@drawable/rect_selected" />
|
||||||
|
<item android:drawable="@drawable/transparent" />
|
||||||
|
|
||||||
|
</selector>
|
||||||
7
app/src/main/res/drawable/rect_selector_dark.xml
Normal file
7
app/src/main/res/drawable/rect_selector_dark.xml
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<item android:state_pressed="true" android:drawable="@drawable/rect_selected_dark" />
|
||||||
|
<item android:drawable="@drawable/transparent" />
|
||||||
|
|
||||||
|
</selector>
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<com.mobeta.android.dslv.DragSortListView
|
<com.mobeta.android.dslv.DragSortListView
|
||||||
|
android:listSelector="?rect_selector"
|
||||||
android:id="@+id/dragSortListView"
|
android:id="@+id/dragSortListView"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
android:padding="2dp">
|
android:padding="2dp">
|
||||||
|
|
||||||
<GridView
|
<GridView
|
||||||
|
android:listSelector="?rect_selector"
|
||||||
android:id="@+id/absList"
|
android:id="@+id/absList"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
android:padding="2dp">
|
android:padding="2dp">
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
|
android:listSelector="?rect_selector"
|
||||||
android:id="@+id/absList"
|
android:id="@+id/absList"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
|
||||||
|
|
@ -6,4 +6,5 @@
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
android:divider="@null"
|
android:divider="@null"
|
||||||
android:dividerHeight="0dp"
|
android:dividerHeight="0dp"
|
||||||
|
android:listSelector="?rect_selector"
|
||||||
android:scrollbars="none"/>
|
android:scrollbars="none"/>
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
android:padding="2dp">
|
android:padding="2dp">
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
|
android:listSelector="?rect_selector"
|
||||||
android:id="@+id/absList"
|
android:id="@+id/absList"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="64dp"
|
android:layout_height="64dp"
|
||||||
android:background="?android:attr/selectableItemBackground"
|
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingLeft="16dp"
|
android:paddingLeft="16dp"
|
||||||
android:paddingRight="16dp">
|
android:paddingRight="16dp">
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="64dp"
|
android:layout_height="64dp"
|
||||||
android:background="?android:attr/selectableItemBackground"
|
|
||||||
android:descendantFocusability="blocksDescendants"
|
android:descendantFocusability="blocksDescendants"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="64dp"
|
android:layout_height="64dp"
|
||||||
android:background="?android:attr/selectableItemBackground"
|
|
||||||
android:descendantFocusability="blocksDescendants"
|
android:descendantFocusability="blocksDescendants"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingLeft="16dp"
|
android:paddingLeft="16dp"
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="64dp"
|
android:layout_height="64dp"
|
||||||
android:background="?android:attr/selectableItemBackground"
|
android:descendantFocusability="blocksDescendants"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingLeft="16dp">
|
android:paddingLeft="16dp">
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,12 @@
|
||||||
|
|
||||||
<style name="Theme.MaterialMusic" parent="Theme.MaterialMusic.Base">
|
<style name="Theme.MaterialMusic" parent="Theme.MaterialMusic.Base">
|
||||||
<item name="round_selector">@drawable/round_ripple_selector_dark</item>
|
<item name="round_selector">@drawable/round_ripple_selector_dark</item>
|
||||||
|
<item name="rect_selector">@drawable/rect_ripple_selector_dark</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Theme.MaterialMusic.Light" parent="Theme.MaterialMusic.Base.Light">
|
<style name="Theme.MaterialMusic.Light" parent="Theme.MaterialMusic.Base.Light">
|
||||||
<!--<item name="round_selector">@drawable/round_ripple_selector</item>-->
|
<item name="round_selector">@drawable/round_ripple_selector</item>
|
||||||
|
<item name="rect_selector">@drawable/rect_ripple_selector</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Theme.MaterialMusic.Notification" parent="@android:style/TextAppearance.Material.Notification"/>
|
<style name="Theme.MaterialMusic.Notification" parent="@android:style/TextAppearance.Material.Notification"/>
|
||||||
|
|
|
||||||
|
|
@ -7,4 +7,5 @@
|
||||||
<attr name="fab_color_pressed" format="color"/>
|
<attr name="fab_color_pressed" format="color"/>
|
||||||
<attr name="list_selector" format="reference"/>
|
<attr name="list_selector" format="reference"/>
|
||||||
<attr name="round_selector" format="reference"/>
|
<attr name="round_selector" format="reference"/>
|
||||||
|
<attr name="rect_selector" format="reference"/>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
<item name="list_selector">@drawable/list_selector_dark</item>
|
<item name="list_selector">@drawable/list_selector_dark</item>
|
||||||
<item name="round_selector">@drawable/round_selector_dark</item>
|
<item name="round_selector">@drawable/round_selector_dark</item>
|
||||||
|
<item name="rect_selector">@drawable/rect_selector_dark</item>
|
||||||
|
|
||||||
<item name="md_dark_theme">true</item>
|
<item name="md_dark_theme">true</item>
|
||||||
|
|
||||||
|
|
@ -46,6 +47,7 @@
|
||||||
|
|
||||||
<item name="list_selector">@drawable/list_selector</item>
|
<item name="list_selector">@drawable/list_selector</item>
|
||||||
<item name="round_selector">@drawable/round_selector</item>
|
<item name="round_selector">@drawable/round_selector</item>
|
||||||
|
<item name="rect_selector">@drawable/rect_selector</item>
|
||||||
|
|
||||||
<item name="md_dark_theme">false</item>
|
<item name="md_dark_theme">false</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue