commit 7a85e25ec4ecf7d65780da0bfd02ac5a336303b6
parent 2da4a2526805b7a2ae07569f988544abe67253be
Author: iorgamgabriel <iorgamgabriel@yahoo.com>
Date: Mon, 20 Oct 2025 12:45:46 +0000
Bug 1994703 - Add new collection '+' button tint. r=android-reviewers,007
Differential Revision: https://phabricator.services.mozilla.com/D268888
Diffstat:
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/collections/CollectionsListAdapter.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/collections/CollectionsListAdapter.kt
@@ -9,6 +9,8 @@ import android.view.ViewGroup
import android.widget.CheckedTextView
import androidx.annotation.VisibleForTesting
import androidx.appcompat.content.res.AppCompatResources
+import androidx.core.content.ContextCompat
+import androidx.core.graphics.drawable.DrawableCompat
import androidx.core.view.updatePaddingRelative
import androidx.recyclerview.widget.RecyclerView
import mozilla.components.support.ktx.android.view.putCompoundDrawablesRelativeWithIntrinsicBounds
@@ -47,11 +49,21 @@ class CollectionsListAdapter(
)
holder.textView.compoundDrawablePadding =
resources.getDimensionPixelSize(R.dimen.tab_tray_new_collection_drawable_padding)
+ val drawable = AppCompatResources.getDrawable(
+ holder.textView.context,
+ iconsR.drawable.mozac_ic_plus_24,
+ )?.mutate()
+ drawable?.let {
+ DrawableCompat.setTint(
+ it,
+ ContextCompat.getColor(
+ holder.textView.context,
+ R.color.fx_mobile_icon_color_primary,
+ ),
+ )
+ }
holder.textView.putCompoundDrawablesRelativeWithIntrinsicBounds(
- start = AppCompatResources.getDrawable(
- holder.textView.context,
- iconsR.drawable.mozac_ic_plus_24,
- ),
+ start = drawable,
)
} else {
holder.textView.isChecked = checkedPosition == position