Allow sending freeform reactions
Change-Id: I1f2a6fb14cd16b22543c7bf1b4f0a3dc813ae7a7
This commit is contained in:
parent
45c4f632e7
commit
9444642254
|
@ -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
|
- Setting to hide start call buttons from the room's toolbar
|
||||||
- Render inline images / custom emojis in the timeline
|
- Render inline images / custom emojis in the timeline
|
||||||
- Render image reactions
|
- Render image reactions
|
||||||
|
- Send freeform reactions
|
||||||
|
|
||||||
- Branding (name, app icon, links)
|
- 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
|
- Show a toast instead of a snackbar after copying text, in order to not block the input area right after copying
|
||||||
|
|
|
@ -22,6 +22,7 @@ import im.vector.app.EmojiCompatFontProvider
|
||||||
import im.vector.app.R
|
import im.vector.app.R
|
||||||
import im.vector.app.core.resources.StringProvider
|
import im.vector.app.core.resources.StringProvider
|
||||||
import im.vector.app.core.ui.list.genericFooterItem
|
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 im.vector.lib.core.utils.epoxy.charsequence.toEpoxyCharSequence
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
|
@ -48,6 +49,20 @@ class EmojiSearchResultController @Inject constructor(
|
||||||
val results = data?.results ?: return
|
val results = data?.results ?: return
|
||||||
val host = this
|
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 (results.isEmpty()) {
|
||||||
if (data.query.isEmpty()) {
|
if (data.query.isEmpty()) {
|
||||||
// display 'Type something to find'
|
// display 'Type something to find'
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:textColor="?vctr_content_primary"
|
android:textColor="?vctr_content_primary"
|
||||||
|
android:minWidth="32dp"
|
||||||
tools:ignore="SpUsage"
|
tools:ignore="SpUsage"
|
||||||
tools:text="@sample/reactions.json/data/reaction" />
|
tools:text="@sample/reactions.json/data/reaction" />
|
||||||
|
|
||||||
|
|
|
@ -195,4 +195,7 @@
|
||||||
<string name="settings_floating_date">Floating date</string>
|
<string name="settings_floating_date">Floating date</string>
|
||||||
<string name="settings_floating_date_summary">Show the date on top of messages while scrolling</string>
|
<string name="settings_floating_date_summary">Show the date on top of messages while scrolling</string>
|
||||||
|
|
||||||
|
<string name="freeform_react_with">React with \"%1$s\"</string>
|
||||||
|
<string name="freeform_reaction_summary">Free-form reaction</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Loading…
Reference in New Issue