Replace hard-coded colors with theme colors

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2018-07-30 14:42:33 +02:00
parent 6493a9a1f2
commit d5cde43158
6 changed files with 17 additions and 23 deletions

View File

@ -1,10 +1,14 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- TODO(msf): somehow make an additional activated color entry here (or elsewhere?) that <item>
is in use only in multiselect mode, and one that's in use only in ordinary <selector>
select mode. In otherwords, we don't want to use the same background color <item android:state_activated="true">
for both multiselect and normal select (on two column machines). <color android:color="?android:attr/colorControlHighlight" />
--> <!-- TODO(msf): depending on whether or not we are in multiselect mode, choose instead:
<item android:drawable="@color/list_item_activated" android:state_activated="true" /> <!-- TODO(msf): get color from theme with ?android/attr: --> <color android:color="?android:attr/colorControlActivated" />
<item android:drawable="@android:color/transparent" /> <!-- TODO(msf): get color from theme with ?android/attr: --> -->
</selector> </item>
</selector>
</item>
<item android:drawable="?android:attr/selectableItemBackground" />
</layer-list>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/list_item_ripple"> <!-- TODO(msf): get color from theme with ?android/attr: -->
<item android:drawable="@drawable/list_item_background" />
<item android:id="@android:id/mask" android:drawable="@android:color/white" /> <!-- TODO(msf): get color from theme with ?android/attr: -->
</ripple>

View File

@ -22,7 +22,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/list_item_background_anim" android:background="@drawable/list_item_background"
android:padding="16dp" android:padding="16dp"
android:orientation="horizontal" android:orientation="horizontal"
android:gravity="center_vertical" android:gravity="center_vertical"

View File

@ -28,7 +28,7 @@
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/list_item_background_anim" android:background="@drawable/list_item_background"
android:descendantFocusability="blocksDescendants" android:descendantFocusability="blocksDescendants"
android:padding="16dp"> android:padding="16dp">

View File

@ -1,8 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<!-- TODO(msf): remove these 4 hard-coded colors and replace with theme colors --> <!-- TODO(msf): remove these 2 hard-coded colors and replace with theme colors -->
<color name="list_item_activated">#64cfd8dc</color>
<color name="list_item_ripple">#a0808e95</color>
<color name="fab_label_text_color">#000000</color> <color name="fab_label_text_color">#000000</color>
<color name="fab_label_background_color">#bbbbbb</color> <color name="fab_label_background_color">#bbbbbb</color>

View File

@ -1,8 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<!-- TODO(msf): remove these 4 hard-coded colors and replace with theme colors --> <!-- TODO(msf): remove these 2 hard-coded colors and replace with theme colors -->
<color name="list_item_activated">#cfd8dc</color> <!-- Blue Grey 200 -->
<color name="list_item_ripple">#808e95</color> <!-- Blue Grey 200 dark -->
<color name="fab_label_text_color">#ffffff</color> <color name="fab_label_text_color">#ffffff</color>
<color name="fab_label_background_color">#444444</color> <color name="fab_label_background_color">#444444</color>