Merge "Apply proper icon tinting to dream icons" into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
ccf275d55c
22
res/color/dream_card_icon_color_state_list.xml
Normal file
22
res/color/dream_card_icon_color_state_list.xml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
~ Copyright (C) 2022 The Android Open Source Project
|
||||||
|
~
|
||||||
|
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
~ you may not use this file except in compliance with the License.
|
||||||
|
~ You may obtain a copy of the License at
|
||||||
|
~
|
||||||
|
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
~
|
||||||
|
~ Unless required by applicable law or agreed to in writing, software
|
||||||
|
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
~ See the License for the specific language governing permissions and
|
||||||
|
~ limitations under the License.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
|
||||||
|
<item android:state_selected="true" android:color="?androidprv:attr/textColorOnAccent"/>
|
||||||
|
<item android:color="?androidprv:attr/colorAccentPrimaryVariant"/>
|
||||||
|
</selector>
|
@@ -94,7 +94,7 @@ public class DreamAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
|||||||
: item.getIcon();
|
: item.getIcon();
|
||||||
if (icon instanceof VectorDrawable) {
|
if (icon instanceof VectorDrawable) {
|
||||||
icon.setTintList(
|
icon.setTintList(
|
||||||
mContext.getColorStateList(R.color.dream_card_text_color_state_list));
|
mContext.getColorStateList(R.color.dream_card_icon_color_state_list));
|
||||||
}
|
}
|
||||||
final int iconSize = mContext.getResources().getDimensionPixelSize(
|
final int iconSize = mContext.getResources().getDimensionPixelSize(
|
||||||
R.dimen.dream_item_icon_size);
|
R.dimen.dream_item_icon_size);
|
||||||
|
Reference in New Issue
Block a user