diff --git a/app/build.gradle b/app/build.gradle index db6336453..1f36a62ed 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -143,6 +143,7 @@ ext { androidxCameraVersion = "1.1.0" coilKtVersion = "2.2.2" daggerVersion = "2.44.2" + emojiVersion = "1.2.0" lifecycleVersion = '2.5.1' okhttpVersion = "4.10.0" materialDialogsVersion = "3.3.0" @@ -178,7 +179,10 @@ dependencies { implementation 'com.google.android.material:material:1.7.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation "com.vanniktech:emoji-google:0.15.0" - implementation group: 'androidx.emoji', name: 'emoji-bundled', version: '1.1.0' + implementation "androidx.emoji2:emoji2:${emojiVersion}" + implementation "androidx.emoji2:emoji2-bundled:${emojiVersion}" + implementation "androidx.emoji2:emoji2-views:${emojiVersion}" + implementation "androidx.emoji2:emoji2-views-helper:${emojiVersion}" implementation 'org.michaelevans.colorart:library:0.0.3' implementation "androidx.work:work-runtime:${workVersion}" implementation "androidx.work:work-rxjava2:${workVersion}" @@ -245,7 +249,7 @@ dependencies { implementation 'org.apache.commons:commons-lang3:3.12.0' implementation 'com.github.wooplr:Spotlight:1.3' implementation 'com.google.code.findbugs:jsr305:3.0.2' - implementation 'com.github.nextcloud-deps:ChatKit:0.3.1' + implementation 'com.github.nextcloud-deps:ChatKit:0.4.0' implementation 'joda-time:joda-time:2.12.2' implementation "io.coil-kt:coil:${coilKtVersion}" diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingPreviewMessageViewHolder.java b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingPreviewMessageViewHolder.java index 78fbac71e..b618d9518 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingPreviewMessageViewHolder.java +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingPreviewMessageViewHolder.java @@ -33,7 +33,7 @@ import com.nextcloud.talk.databinding.ReactionsInsideMessageBinding; import com.nextcloud.talk.models.json.chat.ChatMessage; import androidx.core.content.ContextCompat; -import androidx.emoji.widget.EmojiTextView; +import androidx.emoji2.widget.EmojiTextView; public class IncomingPreviewMessageViewHolder extends PreviewMessageViewHolder { private final ItemCustomIncomingPreviewMessageBinding binding; diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingPreviewMessageViewHolder.java b/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingPreviewMessageViewHolder.java index 82778e9dd..c6f746427 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingPreviewMessageViewHolder.java +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingPreviewMessageViewHolder.java @@ -33,7 +33,7 @@ import com.nextcloud.talk.databinding.ReactionsInsideMessageBinding; import com.nextcloud.talk.models.json.chat.ChatMessage; import androidx.core.content.ContextCompat; -import androidx.emoji.widget.EmojiTextView; +import androidx.emoji2.widget.EmojiTextView; public class OutcomingPreviewMessageViewHolder extends PreviewMessageViewHolder { diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/PreviewMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/PreviewMessageViewHolder.kt index cfd4be17b..2759f0bbc 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/PreviewMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/PreviewMessageViewHolder.kt @@ -42,7 +42,7 @@ import android.widget.PopupMenu import android.widget.ProgressBar import androidx.appcompat.view.ContextThemeWrapper import androidx.core.content.ContextCompat -import androidx.emoji.widget.EmojiTextView +import androidx.emoji2.widget.EmojiTextView import autodagger.AutoInjector import com.google.android.material.card.MaterialCardView import com.nextcloud.talk.R diff --git a/app/src/main/java/com/nextcloud/talk/application/NextcloudTalkApplication.kt b/app/src/main/java/com/nextcloud/talk/application/NextcloudTalkApplication.kt index de58edb28..a37b24303 100644 --- a/app/src/main/java/com/nextcloud/talk/application/NextcloudTalkApplication.kt +++ b/app/src/main/java/com/nextcloud/talk/application/NextcloudTalkApplication.kt @@ -31,8 +31,8 @@ import android.os.Build.VERSION.SDK_INT import android.os.Build.VERSION_CODES.P import android.util.Log import androidx.appcompat.app.AppCompatDelegate -import androidx.emoji.bundled.BundledEmojiCompatConfig -import androidx.emoji.text.EmojiCompat +import androidx.emoji2.bundled.BundledEmojiCompatConfig +import androidx.emoji2.text.EmojiCompat import androidx.lifecycle.LifecycleObserver import androidx.multidex.MultiDex import androidx.multidex.MultiDexApplication diff --git a/app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt b/app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt index 1648429dd..c44e91890 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt +++ b/app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt @@ -81,8 +81,8 @@ import androidx.core.content.FileProvider import androidx.core.content.PermissionChecker import androidx.core.graphics.drawable.toBitmap import androidx.core.widget.doAfterTextChanged -import androidx.emoji.text.EmojiCompat -import androidx.emoji.widget.EmojiTextView +import androidx.emoji2.text.EmojiCompat +import androidx.emoji2.widget.EmojiTextView import androidx.recyclerview.widget.ItemTouchHelper import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView diff --git a/app/src/main/java/com/nextcloud/talk/jobs/NotificationWorker.kt b/app/src/main/java/com/nextcloud/talk/jobs/NotificationWorker.kt index 20ecc0e17..6fd2425ce 100644 --- a/app/src/main/java/com/nextcloud/talk/jobs/NotificationWorker.kt +++ b/app/src/main/java/com/nextcloud/talk/jobs/NotificationWorker.kt @@ -45,7 +45,7 @@ import androidx.core.app.Person import androidx.core.app.RemoteInput import androidx.core.content.ContextCompat import androidx.core.graphics.drawable.toBitmap -import androidx.emoji.text.EmojiCompat +import androidx.emoji2.text.EmojiCompat import androidx.work.Data import androidx.work.Worker import androidx.work.WorkerParameters diff --git a/app/src/main/java/com/nextcloud/talk/ui/theme/TalkSpecificViewThemeUtils.kt b/app/src/main/java/com/nextcloud/talk/ui/theme/TalkSpecificViewThemeUtils.kt index 5d9970468..a917c63f6 100644 --- a/app/src/main/java/com/nextcloud/talk/ui/theme/TalkSpecificViewThemeUtils.kt +++ b/app/src/main/java/com/nextcloud/talk/ui/theme/TalkSpecificViewThemeUtils.kt @@ -129,7 +129,7 @@ class TalkSpecificViewThemeUtils @Inject constructor( } } - fun colorContactChatItemName(contactName: androidx.emoji.widget.EmojiTextView) { + fun colorContactChatItemName(contactName: androidx.emoji2.widget.EmojiTextView) { withScheme(contactName) { scheme -> contactName.setTextColor(scheme.onPrimaryContainer) } diff --git a/app/src/main/java/com/nextcloud/talk/utils/DisplayUtils.java b/app/src/main/java/com/nextcloud/talk/utils/DisplayUtils.java index a4ab68ed7..50303a506 100644 --- a/app/src/main/java/com/nextcloud/talk/utils/DisplayUtils.java +++ b/app/src/main/java/com/nextcloud/talk/utils/DisplayUtils.java @@ -82,7 +82,7 @@ import androidx.core.content.ContextCompat; import androidx.core.content.res.ResourcesCompat; import androidx.core.graphics.ColorUtils; import androidx.core.graphics.drawable.DrawableCompat; -import androidx.emoji.text.EmojiCompat; +import androidx.emoji2.text.EmojiCompat; import coil.Coil; import coil.request.ImageRequest; import coil.target.Target; diff --git a/app/src/main/java/com/nextcloud/talk/utils/EmojiTextInputEditText.java b/app/src/main/java/com/nextcloud/talk/utils/EmojiTextInputEditText.java index e1111ec83..71490da5e 100644 --- a/app/src/main/java/com/nextcloud/talk/utils/EmojiTextInputEditText.java +++ b/app/src/main/java/com/nextcloud/talk/utils/EmojiTextInputEditText.java @@ -25,7 +25,8 @@ import android.util.AttributeSet; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputConnection; -import androidx.emoji.widget.EmojiEditTextHelper; +import androidx.annotation.NonNull; +import androidx.emoji2.viewsintegration.EmojiEditTextHelper; import com.google.android.material.textfield.TextInputEditText; @@ -57,7 +58,7 @@ public class EmojiTextInputEditText extends TextInputEditText { } @Override - public InputConnection onCreateInputConnection(EditorInfo outAttrs) { + public InputConnection onCreateInputConnection(@NonNull EditorInfo outAttrs) { InputConnection inputConnection = super.onCreateInputConnection(outAttrs); return getEmojiEditTextHelper().onCreateInputConnection(inputConnection, outAttrs); } diff --git a/app/src/main/java/com/nextcloud/talk/utils/FileViewerUtils.kt b/app/src/main/java/com/nextcloud/talk/utils/FileViewerUtils.kt index 098c2dceb..03d0bf3f1 100644 --- a/app/src/main/java/com/nextcloud/talk/utils/FileViewerUtils.kt +++ b/app/src/main/java/com/nextcloud/talk/utils/FileViewerUtils.kt @@ -32,7 +32,7 @@ import android.widget.ImageView import android.widget.ProgressBar import android.widget.Toast import androidx.core.content.FileProvider -import androidx.emoji.widget.EmojiTextView +import androidx.emoji2.widget.EmojiTextView import androidx.work.Data import androidx.work.OneTimeWorkRequest import androidx.work.WorkInfo diff --git a/app/src/main/java/com/nextcloud/talk/utils/ImageEmojiEditText.kt b/app/src/main/java/com/nextcloud/talk/utils/ImageEmojiEditText.kt index fcd102819..602b57a2f 100644 --- a/app/src/main/java/com/nextcloud/talk/utils/ImageEmojiEditText.kt +++ b/app/src/main/java/com/nextcloud/talk/utils/ImageEmojiEditText.kt @@ -28,7 +28,7 @@ import android.view.inputmethod.EditorInfo import android.view.inputmethod.InputConnection import androidx.core.view.inputmethod.EditorInfoCompat import androidx.core.view.inputmethod.InputConnectionCompat -import androidx.emoji.widget.EmojiEditText +import androidx.emoji2.widget.EmojiEditText import com.nextcloud.talk.utils.Mimetype.IMAGE_GIF import com.nextcloud.talk.utils.Mimetype.IMAGE_JPEG import com.nextcloud.talk.utils.Mimetype.IMAGE_PNG @@ -47,9 +47,9 @@ class ImageEmojiEditText : EmojiEditText { constructor(context: Context, attrs: AttributeSet) : super(context, attrs) @Suppress("Detekt.TooGenericExceptionCaught") - override fun onCreateInputConnection(editorInfo: EditorInfo): InputConnection { + override fun onCreateInputConnection(editorInfo: EditorInfo): InputConnection? { - val ic: InputConnection = super.onCreateInputConnection(editorInfo) + val ic: InputConnection? = super.onCreateInputConnection(editorInfo) EditorInfoCompat.setContentMimeTypes(editorInfo, arrayOf(IMAGE_GIF, IMAGE_JPEG, IMAGE_PNG)) @@ -73,6 +73,6 @@ class ImageEmojiEditText : EmojiEditText { } } - return InputConnectionCompat.createWrapper(ic, editorInfo, callback) + return InputConnectionCompat.createWrapper(ic!!, editorInfo, callback) } } diff --git a/app/src/main/res/layout/account_item.xml b/app/src/main/res/layout/account_item.xml index 8668dbcb9..a5322ef05 100644 --- a/app/src/main/res/layout/account_item.xml +++ b/app/src/main/res/layout/account_item.xml @@ -67,7 +67,7 @@ android:paddingStart="3dp" android:paddingEnd="0dp"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -