mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-26 10:39:23 +03:00
Hide freeform reaction option in easy mode
Change-Id: I74dd0edbec3db17cf4a65f45ffbc689df57e64b3
This commit is contained in:
parent
9444642254
commit
3dbbed6489
1 changed files with 16 additions and 12 deletions
|
@ -23,10 +23,12 @@ import im.vector.app.R
|
|||
import im.vector.app.core.resources.StringProvider
|
||||
import im.vector.app.core.ui.list.genericFooterItem
|
||||
import im.vector.app.features.reactions.data.EmojiItem
|
||||
import im.vector.app.features.settings.VectorPreferences
|
||||
import im.vector.lib.core.utils.epoxy.charsequence.toEpoxyCharSequence
|
||||
import javax.inject.Inject
|
||||
|
||||
class EmojiSearchResultController @Inject constructor(
|
||||
private val vectorPreferences: VectorPreferences,
|
||||
private val stringProvider: StringProvider,
|
||||
private val fontProvider: EmojiCompatFontProvider
|
||||
) : TypedEpoxyController<EmojiSearchResultViewState>() {
|
||||
|
@ -49,18 +51,20 @@ class EmojiSearchResultController @Inject constructor(
|
|||
val results = data?.results ?: return
|
||||
val host = this
|
||||
|
||||
// Extra EmojiItem to allow reacting with freeform text
|
||||
val freeformReaction = EmojiItem(
|
||||
name = stringProvider.getString(R.string.freeform_react_with, data.query),
|
||||
unicode = "",
|
||||
keywords = listOf(stringProvider.getString(R.string.freeform_reaction_summary))
|
||||
)
|
||||
emojiSearchResultItem {
|
||||
id("de.spiritcroc.riotx.freeform-reaction-is-somebody-really-caring-about-this-key-lol")
|
||||
emojiItem(freeformReaction)
|
||||
emojiTypeFace(host.emojiTypeface)
|
||||
currentQuery(data.query)
|
||||
onClickListener { host.listener?.onReactionSelected(data.query) }
|
||||
if (!vectorPreferences.simplifiedMode()) {
|
||||
// Extra EmojiItem to allow reacting with freeform text
|
||||
val freeformReaction = EmojiItem(
|
||||
name = stringProvider.getString(R.string.freeform_react_with, data.query),
|
||||
unicode = "",
|
||||
keywords = listOf(stringProvider.getString(R.string.freeform_reaction_summary))
|
||||
)
|
||||
emojiSearchResultItem {
|
||||
id("de.spiritcroc.riotx.freeform-reaction-is-somebody-really-caring-about-this-key-lol")
|
||||
emojiItem(freeformReaction)
|
||||
emojiTypeFace(host.emojiTypeface)
|
||||
currentQuery(data.query)
|
||||
onClickListener { host.listener?.onReactionSelected(data.query) }
|
||||
}
|
||||
}
|
||||
|
||||
if (results.isEmpty()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue