removed the instances of vanniktech

Signed-off-by: Smarshal21 <lcb2021048@iiitl.ac.in>
This commit is contained in:
Smarshal21 2023-11-11 01:24:43 +05:30
parent d6ff39a8fa
commit ec1108ccc4
6 changed files with 3 additions and 60 deletions

View File

@ -175,7 +175,6 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.10.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation "com.vanniktech:emoji-google:0.17.0"
implementation "androidx.emoji2:emoji2:${emojiVersion}"
implementation "androidx.emoji2:emoji2-bundled:${emojiVersion}"
implementation "androidx.emoji2:emoji2-views:${emojiVersion}"

View File

@ -45,7 +45,6 @@ import com.nextcloud.talk.models.json.chat.ChatMessage
import com.nextcloud.talk.ui.theme.ViewThemeUtils
import com.nextcloud.talk.utils.ApiUtils
import com.nextcloud.talk.utils.DateUtils
import com.nextcloud.talk.utils.TextMatchers
import com.nextcloud.talk.utils.message.MessageUtils
import com.nextcloud.talk.utils.preferences.AppPreferences
import com.stfalcon.chatkit.messages.MessageHolders
@ -103,8 +102,7 @@ class IncomingTextMessageViewHolder(itemView: View, payload: Any) :
val messageParameters = message.messageParameters
if (
(messageParameters == null || messageParameters.size <= 0) &&
TextMatchers.isMessageWithSingleEmoticonOnly(message.text)
(messageParameters == null || messageParameters.size <= 0)
) {
textSize = (textSize * TEXT_SIZE_MULTIPLIER).toFloat()
itemView.isSelected = true

View File

@ -41,7 +41,6 @@ import com.nextcloud.talk.models.json.chat.ReadStatus
import com.nextcloud.talk.ui.theme.ViewThemeUtils
import com.nextcloud.talk.utils.ApiUtils
import com.nextcloud.talk.utils.DateUtils
import com.nextcloud.talk.utils.TextMatchers
import com.nextcloud.talk.utils.message.MessageUtils
import com.stfalcon.chatkit.messages.MessageHolders.OutcomingTextMessageViewHolder
import javax.inject.Inject
@ -89,8 +88,7 @@ class OutcomingTextMessageViewHolder(itemView: View) : OutcomingTextMessageViewH
val messageParameters = message.messageParameters
if (
(messageParameters == null || messageParameters.size <= 0) &&
TextMatchers.isMessageWithSingleEmoticonOnly(message.text)
(messageParameters == null || messageParameters.size <= 0)
) {
textSize = (textSize * TEXT_SIZE_MULTIPLIER).toFloat()
layoutParams.isWrapBefore = true

View File

@ -70,8 +70,6 @@ import com.nextcloud.talk.utils.database.arbitrarystorage.ArbitraryStorageModule
import com.nextcloud.talk.utils.database.user.UserModule
import com.nextcloud.talk.utils.preferences.AppPreferences
import com.nextcloud.talk.webrtc.MagicWebRTCUtils
import com.vanniktech.emoji.EmojiManager
import com.vanniktech.emoji.google.GoogleEmojiProvider
import de.cotech.hw.SecurityKeyManager
import de.cotech.hw.SecurityKeyManagerConfig
import net.sqlcipher.database.SQLiteDatabase
@ -181,9 +179,7 @@ class NextcloudTalkApplication : MultiDexApplication(), LifecycleObserver {
val config = BundledEmojiCompatConfig(this)
config.setReplaceAll(true)
val emojiCompat = EmojiCompat.init(config)
EmojiManager.install(GoogleEmojiProvider())
EmojiCompat.init(config)
NotificationUtils.registerNotificationChannels(applicationContext, appPreferences)
}

View File

@ -26,7 +26,6 @@ import android.content.Context;
import android.text.Editable;
import android.text.Spanned;
import android.widget.EditText;
import third.parties.fresco.BetterImageSpan;
import com.nextcloud.talk.R;
import com.nextcloud.talk.data.user.model.User;
@ -36,9 +35,6 @@ import com.nextcloud.talk.utils.DisplayUtils;
import com.nextcloud.talk.utils.MagicCharPolicy;
import com.nextcloud.talk.utils.text.Spans;
import com.otaliastudios.autocomplete.AutocompleteCallback;
import com.vanniktech.emoji.EmojiRange;
import com.vanniktech.emoji.Emojis;
import kotlin.OptIn;
public class MentionAutocompleteCallback implements AutocompleteCallback<Mention> {
@ -64,12 +60,8 @@ public class MentionAutocompleteCallback implements AutocompleteCallback<Mention
if (range == null) {
return false;
}
String replacement = item.getLabel();
StringBuilder replacementStringBuilder = new StringBuilder(item.getLabel());
for (EmojiRange emojiRange : Emojis.emojis(replacement)) {
replacementStringBuilder.delete(emojiRange.range.getStart(), emojiRange.range.getEndInclusive());
}
editable.replace(range.getStart(), range.getEnd(), replacementStringBuilder + " ");
Spans.MentionChipSpan mentionChipSpan =

View File

@ -1,40 +0,0 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* @author Tim Krüger
* @author Andy Scherzinger
* Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
* Copyright (C) 2021 Tim Krüger <t@timkrueger.me>
* Copyright (C) 2017-2018 Mario Danic <mario@lovelyhq.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Partly based on https://github.com/kevalpatel2106/EmoticonGIFKeyboard/blob/master/emoticongifkeyboard/src/main/java/com/kevalpatel2106/emoticongifkeyboard/internal/emoticon/EmoticonUtils.java
*/
package com.nextcloud.talk.utils;
import com.vanniktech.emoji.EmojiInformation;
import com.vanniktech.emoji.Emojis;
import androidx.annotation.Nullable;
public final class TextMatchers {
public static boolean isMessageWithSingleEmoticonOnly(@Nullable final String text) {
final EmojiInformation emojiInformation = Emojis.emojiInformation(text);
return (emojiInformation.isOnlyEmojis && emojiInformation.emojis.size() == 1);
}
}