mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-06 14:27:24 +00:00
theme checked reactions
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
b2e21aef7c
commit
fd49b13b14
@ -31,7 +31,6 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import androidx.annotation.NonNull
|
||||
import androidx.appcompat.content.res.AppCompatResources
|
||||
import autodagger.AutoInjector
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialog
|
||||
@ -228,7 +227,7 @@ class MessageActionsDialog(
|
||||
|
||||
private fun checkAndSetEmojiSelfReaction(emoji: EmojiTextView) {
|
||||
if (emoji.text?.toString() != null && message.reactionsSelf?.contains(emoji.text?.toString()) == true) {
|
||||
emoji.background = AppCompatResources.getDrawable(context, R.drawable.reaction_self_bottom_sheet_background)
|
||||
viewThemeUtils.setCheckedBackground(emoji)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,6 +49,7 @@ import androidx.appcompat.widget.SearchView.SearchAutoComplete
|
||||
import androidx.appcompat.widget.SwitchCompat
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.content.res.ResourcesCompat
|
||||
import androidx.core.graphics.drawable.DrawableCompat
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.children
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
@ -67,6 +68,7 @@ import com.nextcloud.talk.utils.DisplayUtils
|
||||
import com.nextcloud.talk.utils.DrawableUtils
|
||||
import com.nextcloud.talk.utils.ui.ColorUtil
|
||||
import com.nextcloud.talk.utils.ui.PlatformThemeUtil.isDarkMode
|
||||
import com.vanniktech.emoji.EmojiTextView
|
||||
import com.yarolegovich.mp.MaterialPreferenceCategory
|
||||
import com.yarolegovich.mp.MaterialSwitchPreference
|
||||
import scheme.Scheme
|
||||
@ -676,6 +678,18 @@ class ViewThemeUtils @Inject constructor(private val theme: ServerTheme, private
|
||||
}
|
||||
}
|
||||
|
||||
fun setCheckedBackground(emoji: EmojiTextView) {
|
||||
withScheme(emoji) { scheme ->
|
||||
val drawable = AppCompatResources
|
||||
.getDrawable(emoji.context, R.drawable.reaction_self_bottom_sheet_background)!!
|
||||
.mutate()
|
||||
DrawableCompat.setTintList(
|
||||
drawable,
|
||||
ColorStateList.valueOf(scheme.primary))
|
||||
emoji.background = drawable
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val THEMEABLE_PLACEHOLDER_IDS = listOf(
|
||||
R.drawable.ic_mimetype_package_x_generic,
|
||||
|
Loading…
Reference in New Issue
Block a user