Unchecked code

This commit is contained in:
ThomasSession 2024-08-07 15:57:44 +10:00
parent 2c4b8bf443
commit bbac0939f5

View File

@ -1,13 +1,14 @@
package org.thoughtcrime.securesms.messagerequests
import android.content.Context
import android.content.res.ColorStateList
import android.database.Cursor
import android.os.Build
import android.text.SpannableString
import android.text.style.ForegroundColorSpan
import android.view.ContextThemeWrapper
import android.view.ViewGroup
import android.widget.PopupMenu
import androidx.core.graphics.drawable.DrawableCompat
import androidx.recyclerview.widget.RecyclerView
import network.loki.messenger.R
import org.session.libsession.utilities.ThemeUtil
@ -63,10 +64,17 @@ class MessageRequestsAdapter(
val s = SpannableString(item.title)
val danger = ThemeUtil.getThemedColor(context, R.attr.danger)
s.setSpan(ForegroundColorSpan(danger), 0, s.length, 0)
item.iconTintList = ColorStateList.valueOf(danger)
item.icon?.let {
DrawableCompat.setTint(
it,
danger
)
}
item.title = s
}
popupMenu.setForceShowIcon(true)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
popupMenu.setForceShowIcon(true)
}
popupMenu.show()
}