mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-07 11:17:25 +01:00
Improvements to the new library item selectors (#5379)
* Increase card selector radius * Add themed overlay to library selector
This commit is contained in:
parent
73e5e9ecd9
commit
4dfb3cc972
4
app/src/main/res/color/selector_overlay.xml
Normal file
4
app/src/main/res/color/selector_overlay.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:alpha="0.2" android:color="?attr/colorAccent" />
|
||||
</selector>
|
@ -10,7 +10,7 @@
|
||||
android:bottom="2dp"
|
||||
android:left="2dp">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="@dimen/card_radius" />
|
||||
<corners android:radius="@dimen/card_selector_radius" />
|
||||
<solid android:color="?attr/colorLibrarySelectionActive" />
|
||||
</shape>
|
||||
</item>
|
||||
@ -22,7 +22,7 @@
|
||||
android:bottom="2dp"
|
||||
android:left="2dp">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="@dimen/card_radius" />
|
||||
<corners android:radius="@dimen/card_selector_radius" />
|
||||
<solid android:color="?attr/colorLibrarySelectionActive" />
|
||||
</shape>
|
||||
</item>
|
||||
@ -33,7 +33,7 @@
|
||||
android:bottom="2dp"
|
||||
android:left="2dp">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="@dimen/card_radius" />
|
||||
<corners android:radius="@dimen/card_selector_radius" />
|
||||
<solid android:color="?android:attr/colorBackground" />
|
||||
</shape>
|
||||
</item>
|
||||
|
21
app/src/main/res/drawable/library_item_selector_overlay.xml
Normal file
21
app/src/main/res/drawable/library_item_selector_overlay.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="?attr/colorLibrarySelection">
|
||||
<item>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_selected="true">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="@dimen/card_selector_radius" />
|
||||
<solid android:color="@color/selector_overlay" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item android:state_activated="true">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="@dimen/card_selector_radius" />
|
||||
<solid android:color="@color/selector_overlay" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
</item>
|
||||
</ripple>
|
@ -6,6 +6,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="2dp"
|
||||
android:background="@drawable/library_item_selector"
|
||||
android:foreground="@drawable/library_item_selector_overlay"
|
||||
android:padding="4dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
|
@ -5,6 +5,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="2dp"
|
||||
android:background="@drawable/library_item_selector"
|
||||
android:foreground="@drawable/library_item_selector_overlay"
|
||||
android:padding="4dp">
|
||||
|
||||
<FrameLayout
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
<dimen name="space_between_cards">4dp</dimen>
|
||||
<dimen name="card_radius">4dp</dimen>
|
||||
<dimen name="card_selector_radius">6dp</dimen>
|
||||
<dimen name="dialog_radius">8dp</dimen>
|
||||
|
||||
<dimen name="fab_size">56dp</dimen>
|
||||
|
Loading…
Reference in New Issue
Block a user