diff options
author | Alex Stetson <alexstetson@google.com> | 2021-08-19 13:19:54 -0700 |
---|---|---|
committer | Alex Stetson <alexstetson@google.com> | 2021-09-24 20:28:42 +0000 |
commit | 0933ad18078eca186ed6ea160fa80468675932f8 (patch) | |
tree | a6171dee9a48b37677fd95eaa7609edf62dc6946 /car-qc-lib | |
parent | 9072a79a393fd593276efb96df387146de5ad534 (diff) | |
download | systemlibs-0933ad18078eca186ed6ea160fa80468675932f8.tar.gz |
Add default tint to start icon
Bug: 194397611
Bug: 194116816
Bug: 196424229
Test: manual
Change-Id: I33e2fe8bd63798ba1c84675fa7fb1f1bbc2ea58e
Merged-In: I33e2fe8bd63798ba1c84675fa7fb1f1bbc2ea58e
Diffstat (limited to 'car-qc-lib')
-rw-r--r-- | car-qc-lib/res/values/colors.xml | 1 | ||||
-rw-r--r-- | car-qc-lib/src/com/android/car/qc/view/QCRowView.java | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/car-qc-lib/res/values/colors.xml b/car-qc-lib/res/values/colors.xml index e86aacf..e3fbd6f 100644 --- a/car-qc-lib/res/values/colors.xml +++ b/car-qc-lib/res/values/colors.xml @@ -15,6 +15,7 @@ --> <resources> + <color name="qc_start_icon_color">@android:color/white</color> <color name="qc_toggle_off_background_color">#626262</color> <color name="qc_toggle_unavailable_background_color">@android:color/transparent</color> <color name="qc_toggle_unavailable_color">#75FFFFFF</color> diff --git a/car-qc-lib/src/com/android/car/qc/view/QCRowView.java b/car-qc-lib/src/com/android/car/qc/view/QCRowView.java index 1faed66..6471d35 100644 --- a/car-qc-lib/src/com/android/car/qc/view/QCRowView.java +++ b/car-qc-lib/src/com/android/car/qc/view/QCRowView.java @@ -41,6 +41,7 @@ import android.widget.SeekBar; import android.widget.Switch; import android.widget.TextView; +import androidx.annotation.ColorInt; import androidx.annotation.LayoutRes; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -64,6 +65,8 @@ public class QCRowView extends FrameLayout { private TextView mTitle; private TextView mSubtitle; private ImageView mStartIcon; + @ColorInt + private int mStartIconTint; private LinearLayout mStartItemsContainer; private LinearLayout mEndItemsContainer; private LinearLayout mSeekBarContainer; @@ -209,6 +212,12 @@ public class QCRowView extends FrameLayout { if (row.getStartIcon() != null) { mStartIcon.setVisibility(VISIBLE); Drawable drawable = row.getStartIcon().loadDrawable(getContext()); + if (drawable != null) { + if (mStartIconTint == 0) { + mStartIconTint = getContext().getColor(R.color.qc_start_icon_color); + } + drawable.setTint(mStartIconTint); + } mStartIcon.setImageDrawable(drawable); } else { mStartIcon.setImageDrawable(null); |