mirror of
https://github.com/MatomoCamp/matomocamp-companion-android.git
synced 2024-09-19 16:13:46 +02:00
Improved ListView styling by using built-in attribute listChoiceBackgroundIndicator
This commit is contained in:
parent
f31af2f492
commit
63bd76f5ed
4 changed files with 25 additions and 6 deletions
11
app/src/main/res/drawable/abc_list_selector_holo_dark.xml
Normal file
11
app/src/main/res/drawable/abc_list_selector_holo_dark.xml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Improved item background selector which looks more material-ish (no blue color) -->
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="@android:color/transparent" android:state_window_focused="false"/>
|
||||||
|
<!-- Even though these two point to the same resource, have two states so the drawable will invalidate itself when coming out of pressed state. -->
|
||||||
|
<item android:drawable="@drawable/abc_list_selector_disabled_holo_dark" android:state_enabled="false" android:state_focused="true" android:state_pressed="true"/>
|
||||||
|
<item android:drawable="@drawable/abc_list_selector_disabled_holo_dark" android:state_enabled="false" android:state_focused="true"/>
|
||||||
|
<item android:drawable="@drawable/list_selector_background_transition_holo_dark" android:state_focused="true" android:state_pressed="true"/>
|
||||||
|
<item android:drawable="@drawable/list_selector_background_transition_holo_dark" android:state_focused="false" android:state_pressed="true"/>
|
||||||
|
<item android:drawable="@drawable/list_focused_holo_dark" android:state_focused="true"/>
|
||||||
|
</selector>
|
11
app/src/main/res/drawable/abc_list_selector_holo_light.xml
Normal file
11
app/src/main/res/drawable/abc_list_selector_holo_light.xml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Improved item background selector which looks more material-ish (no blue color) -->
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="@android:color/transparent" android:state_window_focused="false"/>
|
||||||
|
<!-- Even though these two point to the same resource, have two states so the drawable will invalidate itself when coming out of pressed state. -->
|
||||||
|
<item android:drawable="@drawable/abc_list_selector_disabled_holo_light" android:state_enabled="false" android:state_focused="true" android:state_pressed="true"/>
|
||||||
|
<item android:drawable="@drawable/abc_list_selector_disabled_holo_light" android:state_enabled="false" android:state_focused="true"/>
|
||||||
|
<item android:drawable="@drawable/list_selector_background_transition_holo_light" android:state_focused="true" android:state_pressed="true"/>
|
||||||
|
<item android:drawable="@drawable/list_selector_background_transition_holo_light" android:state_focused="false" android:state_pressed="true"/>
|
||||||
|
<item android:drawable="@drawable/list_focused_holo_light" android:state_focused="true"/>
|
||||||
|
</selector>
|
|
@ -6,9 +6,10 @@
|
||||||
<style name="AppTheme" parent="Base.AppTheme">
|
<style name="AppTheme" parent="Base.AppTheme">
|
||||||
<item name="android:textColorSecondary">@color/secondary_text</item>
|
<item name="android:textColorSecondary">@color/secondary_text</item>
|
||||||
<item name="android:progressBarStyleHorizontal">@style/ProgressBar.Fosdem</item>
|
<item name="android:progressBarStyleHorizontal">@style/ProgressBar.Fosdem</item>
|
||||||
<item name="android:listViewStyle">@style/ListView.Fosdem</item>
|
|
||||||
<item name="android:fastScrollThumbDrawable">@drawable/fosdem_fastscroll_thumb_holo</item>
|
<item name="android:fastScrollThumbDrawable">@drawable/fosdem_fastscroll_thumb_holo</item>
|
||||||
<item name="android:selectableItemBackground">?attr/selectableItemBackground</item>
|
<item name="android:selectableItemBackground">?attr/selectableItemBackground</item>
|
||||||
|
<item name="android:listChoiceBackgroundIndicator">?attr/listChoiceBackgroundIndicator
|
||||||
|
</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="ProgressBar.Fosdem" parent="android:Widget.Holo.ProgressBar.Horizontal">
|
<style name="ProgressBar.Fosdem" parent="android:Widget.Holo.ProgressBar.Horizontal">
|
||||||
|
@ -18,8 +19,4 @@
|
||||||
<item name="android:progressDrawable">@drawable/fosdem_progress_horizontal_holo_light</item>
|
<item name="android:progressDrawable">@drawable/fosdem_progress_horizontal_holo_light</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="ListView.Fosdem" parent="android:Widget.Holo.Light.ListView">
|
|
||||||
<item name="android:listSelector">?attr/selectableItemBackground</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
|
@ -49,7 +49,7 @@
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="ListView.Fosdem" parent="android:Widget.ListView.White">
|
<style name="ListView.Fosdem" parent="android:Widget.ListView.White">
|
||||||
<item name="android:listSelector">?attr/selectableItemBackground</item>
|
<item name="android:listSelector">?attr/listChoiceBackgroundIndicator</item>
|
||||||
<item name="android:fadingEdge">none</item>
|
<item name="android:fadingEdge">none</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue