diff --git a/FEATURES.md b/FEATURES.md index e4f3577440..f0b532afd1 100644 --- a/FEATURES.md +++ b/FEATURES.md @@ -32,6 +32,7 @@ Here you can find some extra features and changes compared to Element Android (w - Setting to hide start call buttons from the room's toolbar - Render inline images / custom emojis in the timeline - Render image reactions +- Send freeform reactions - Branding (name, app icon, links) - Show a toast instead of a snackbar after copying text, in order to not block the input area right after copying diff --git a/vector/src/main/java/im/vector/app/features/reactions/EmojiSearchResultController.kt b/vector/src/main/java/im/vector/app/features/reactions/EmojiSearchResultController.kt index f699a86d33..9baddfd309 100644 --- a/vector/src/main/java/im/vector/app/features/reactions/EmojiSearchResultController.kt +++ b/vector/src/main/java/im/vector/app/features/reactions/EmojiSearchResultController.kt @@ -22,6 +22,7 @@ import im.vector.app.EmojiCompatFontProvider 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.lib.core.utils.epoxy.charsequence.toEpoxyCharSequence import javax.inject.Inject @@ -48,6 +49,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 (results.isEmpty()) { if (data.query.isEmpty()) { // display 'Type something to find' diff --git a/vector/src/main/res/layout/item_emoji_result.xml b/vector/src/main/res/layout/item_emoji_result.xml index 2d77eef835..054154b002 100644 --- a/vector/src/main/res/layout/item_emoji_result.xml +++ b/vector/src/main/res/layout/item_emoji_result.xml @@ -19,6 +19,7 @@ android:layout_height="wrap_content" android:layout_marginEnd="8dp" android:textColor="?vctr_content_primary" + android:minWidth="32dp" tools:ignore="SpUsage" tools:text="@sample/reactions.json/data/reaction" /> diff --git a/vector/src/main/res/values/strings_sc.xml b/vector/src/main/res/values/strings_sc.xml index 4a35f43e89..b8ba684a76 100644 --- a/vector/src/main/res/values/strings_sc.xml +++ b/vector/src/main/res/values/strings_sc.xml @@ -195,4 +195,7 @@ Floating date Show the date on top of messages while scrolling + React with \"%1$s\" + Free-form reaction +