From 271bc91303f4f2cff85204b956581e6d30f4fae3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 May 2022 23:08:43 +0000 Subject: [PATCH 1/2] Bump vanniktechEmoji from 0.9.0 to 0.12.0 Bumps `vanniktechEmoji` from 0.9.0 to 0.12.0. Updates `emoji-material` from 0.9.0 to 0.12.0 - [Release notes](https://github.com/vanniktech/Emoji/releases) - [Changelog](https://github.com/vanniktech/Emoji/blob/master/CHANGELOG.md) - [Commits](https://github.com/vanniktech/Emoji/compare/0.9.0...0.12.0) Updates `emoji-google` from 0.9.0 to 0.12.0 - [Release notes](https://github.com/vanniktech/Emoji/releases) - [Changelog](https://github.com/vanniktech/Emoji/blob/master/CHANGELOG.md) - [Commits](https://github.com/vanniktech/Emoji/compare/0.9.0...0.12.0) --- updated-dependencies: - dependency-name: com.vanniktech:emoji-material dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: com.vanniktech:emoji-google dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index 10f9539e5a..b868f74cd1 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -23,7 +23,7 @@ def mavericks = "2.6.1" def glide = "4.13.2" def bigImageViewer = "1.8.1" def jjwt = "0.11.5" -def vanniktechEmoji = "0.9.0" +def vanniktechEmoji = "0.12.0" // Testing def mockk = "1.12.4" From 2d351aa60f809b1b75adc2150fa97e9f5a4e692d Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Fri, 20 May 2022 15:20:24 +0100 Subject: [PATCH 2/2] applying api changes --- .../java/im/vector/app/core/utils/Emoji.kt | 4 ++-- .../home/room/detail/TimelineFragment.kt | 22 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/vector/src/main/java/im/vector/app/core/utils/Emoji.kt b/vector/src/main/java/im/vector/app/core/utils/Emoji.kt index d6a63dca10..3e82ecd5f2 100644 --- a/vector/src/main/java/im/vector/app/core/utils/Emoji.kt +++ b/vector/src/main/java/im/vector/app/core/utils/Emoji.kt @@ -16,7 +16,7 @@ package im.vector.app.core.utils -import com.vanniktech.emoji.EmojiUtils +import com.vanniktech.emoji.isOnlyEmojis /** * Test if a string contains emojis. @@ -28,7 +28,7 @@ import com.vanniktech.emoji.EmojiUtils */ fun containsOnlyEmojis(str: String?): Boolean { // Now rely on vanniktech library - return EmojiUtils.isOnlyEmojis(str) + return str.isOnlyEmojis() } /** diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineFragment.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineFragment.kt index 2bb620623c..19d2038e3c 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineFragment.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineFragment.kt @@ -706,31 +706,31 @@ class TimelineFragment @Inject constructor( } private fun createEmojiPopup(): EmojiPopup { - return EmojiPopup - .Builder - .fromRootView(views.rootConstraintLayout) - .setKeyboardAnimationStyle(R.style.emoji_fade_animation_style) - .setOnEmojiPopupShownListener { + return EmojiPopup( + rootView = views.rootConstraintLayout, + keyboardAnimationStyle = R.style.emoji_fade_animation_style, + onEmojiPopupShownListener = { views.composerLayout.views.composerEmojiButton.apply { contentDescription = getString(R.string.a11y_close_emoji_picker) setImageResource(R.drawable.ic_keyboard) } - } - .setOnEmojiPopupDismissListenerLifecycleAware { + }, + onEmojiPopupDismissListener = lifecycleAwareDismissAction { views.composerLayout.views.composerEmojiButton.apply { contentDescription = getString(R.string.a11y_open_emoji_picker) setImageResource(R.drawable.ic_insert_emoji) } - } - .build(views.composerLayout.views.composerEditText) + }, + editText = views.composerLayout.views.composerEditText + ) } /** * Ensure dismiss actions only trigger when the fragment is in the started state. * EmojiPopup by default dismisses onViewDetachedFromWindow, this can cause race conditions with onDestroyView. */ - private fun EmojiPopup.Builder.setOnEmojiPopupDismissListenerLifecycleAware(action: () -> Unit): EmojiPopup.Builder { - return setOnEmojiPopupDismissListener { + private fun lifecycleAwareDismissAction(action: () -> Unit): () -> Unit { + return { if (lifecycle.currentState.isAtLeast(Lifecycle.State.STARTED)) { action() }