mirror of
https://github.com/oxen-io/session-android.git
synced 2025-06-14 22:08:31 +00:00
Fixing new color access for action items
This commit is contained in:
parent
c9c715b486
commit
facbee99a5
@ -2,7 +2,7 @@ package org.thoughtcrime.securesms.components.menu
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import androidx.annotation.AttrRes
|
import androidx.annotation.AttrRes
|
||||||
import androidx.annotation.ColorRes
|
import androidx.annotation.ColorInt
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents an action to be rendered
|
* Represents an action to be rendered
|
||||||
@ -13,5 +13,5 @@ data class ActionItem(
|
|||||||
val action: Runnable,
|
val action: Runnable,
|
||||||
val contentDescription: Int? = null,
|
val contentDescription: Int? = null,
|
||||||
val subtitle: ((Context) -> CharSequence?)? = null,
|
val subtitle: ((Context) -> CharSequence?)? = null,
|
||||||
@ColorRes val color: Int? = null,
|
@ColorInt val color: Int? = null,
|
||||||
)
|
)
|
||||||
|
@ -78,7 +78,7 @@ class ContextMenuList(recyclerView: RecyclerView, onItemClick: () -> Unit) {
|
|||||||
|
|
||||||
override fun bind(model: DisplayItem) {
|
override fun bind(model: DisplayItem) {
|
||||||
val item = model.item
|
val item = model.item
|
||||||
val color = item.color?.let { ContextCompat.getColor(context, it) }
|
val color = item.color
|
||||||
|
|
||||||
if (item.iconRes > 0) {
|
if (item.iconRes > 0) {
|
||||||
val typedValue = TypedValue()
|
val typedValue = TypedValue()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user