mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-29 09:58:54 +03:00
Fix various issues with emojis
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
d8e8a1dc91
commit
aca1f9a13d
30 changed files with 58 additions and 150 deletions
|
@ -138,6 +138,7 @@ dependencies {
|
|||
implementation 'com.google.android.material:material:1.0.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta1'
|
||||
implementation 'com.github.vanniktech:Emoji:0.6.0'
|
||||
implementation group: 'androidx.emoji', name: 'emoji-bundled', version: '1.0.0'
|
||||
implementation 'org.michaelevans.colorart:library:0.0.3'
|
||||
implementation "android.arch.work:work-runtime:${workVersion}"
|
||||
implementation "android.arch.work:work-rxjava2:${workVersion}"
|
||||
|
|
|
@ -26,30 +26,27 @@ import android.content.Intent;
|
|||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import autodagger.AutoInjector;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
|
||||
import com.bluelinelabs.conductor.Conductor;
|
||||
import com.bluelinelabs.conductor.Controller;
|
||||
import com.bluelinelabs.conductor.Router;
|
||||
import com.bluelinelabs.conductor.RouterTransaction;
|
||||
import com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler;
|
||||
import com.bluelinelabs.conductor.changehandler.VerticalChangeHandler;
|
||||
import com.nextcloud.talk.R;
|
||||
import com.nextcloud.talk.application.NextcloudTalkApplication;
|
||||
import com.nextcloud.talk.controllers.*;
|
||||
import com.nextcloud.talk.controllers.CallNotificationController;
|
||||
import com.nextcloud.talk.controllers.ConversationsListController;
|
||||
import com.nextcloud.talk.controllers.LockedController;
|
||||
import com.nextcloud.talk.controllers.ServerSelectionController;
|
||||
import com.nextcloud.talk.controllers.base.providers.ActionBarProvider;
|
||||
import com.nextcloud.talk.utils.ConductorRemapping;
|
||||
import com.nextcloud.talk.utils.SecurityUtils;
|
||||
import com.nextcloud.talk.utils.bundle.BundleKeys;
|
||||
import com.nextcloud.talk.utils.database.user.UserUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.requery.Persistable;
|
||||
import io.requery.android.sqlcipher.SqlCipherDatabaseSource;
|
||||
import io.requery.reactivex.ReactiveEntityStore;
|
||||
|
|
|
@ -280,13 +280,13 @@ public class ConversationItem extends AbstractFlexibleItem<ConversationItem.Conv
|
|||
@BindView(R.id.dialogAvatar)
|
||||
SimpleDraweeView dialogAvatar;
|
||||
@BindView(R.id.dialogName)
|
||||
EmojiTextView dialogName;
|
||||
TextView dialogName;
|
||||
@BindView(R.id.dialogDate)
|
||||
TextView dialogDate;
|
||||
@BindView(R.id.dialogLastMessageUserAvatar)
|
||||
SimpleDraweeView dialogLastMessageUserAvatar;
|
||||
@BindView(R.id.dialogLastMessage)
|
||||
EmojiTextView dialogLastMessage;
|
||||
TextView dialogLastMessage;
|
||||
@BindView(R.id.dialogUnreadBubble)
|
||||
TextView dialogUnreadBubble;
|
||||
@BindView(R.id.passwordProtectedRoomImageView)
|
||||
|
|
|
@ -29,6 +29,7 @@ import android.net.Uri;
|
|||
import android.text.Spannable;
|
||||
import android.text.SpannableString;
|
||||
import android.text.TextUtils;
|
||||
import android.util.TypedValue;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
import androidx.core.view.ViewCompat;
|
||||
|
@ -45,7 +46,6 @@ import com.nextcloud.talk.utils.DisplayUtils;
|
|||
import com.nextcloud.talk.utils.TextMatchers;
|
||||
import com.nextcloud.talk.utils.database.user.UserUtils;
|
||||
import com.stfalcon.chatkit.messages.MessageHolders;
|
||||
import com.vanniktech.emoji.EmojiTextView;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.util.HashMap;
|
||||
|
@ -59,7 +59,7 @@ public class MagicIncomingTextMessageViewHolder
|
|||
TextView messageAuthor;
|
||||
|
||||
@BindView(R.id.messageText)
|
||||
EmojiTextView messageText;
|
||||
TextView messageText;
|
||||
|
||||
@BindView(R.id.messageUserAvatar)
|
||||
SimpleDraweeView messageUserAvatarView;
|
||||
|
@ -139,7 +139,7 @@ public class MagicIncomingTextMessageViewHolder
|
|||
|
||||
Spannable messageString = new SpannableString(message.getText());
|
||||
|
||||
float emojiSize = DisplayUtils.getDefaultEmojiFontSize(messageText);
|
||||
float textSize = context.getResources().getDimension(R.dimen.chat_text_size);
|
||||
|
||||
if (messageParameters != null && messageParameters.size() > 0) {
|
||||
for (String key : messageParameters.keySet()) {
|
||||
|
@ -177,13 +177,13 @@ public class MagicIncomingTextMessageViewHolder
|
|||
}
|
||||
|
||||
} else if (TextMatchers.isMessageWithSingleEmoticonOnly(message.getText())) {
|
||||
emojiSize *= 2.5f;
|
||||
textSize = (float) (textSize * 2.5);
|
||||
layoutParams.setWrapBefore(true);
|
||||
itemView.setSelected(true);
|
||||
messageAuthor.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
messageText.setEmojiSize((int) emojiSize, true);
|
||||
messageText.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
|
||||
messageTimeView.setLayoutParams(layoutParams);
|
||||
messageText.setText(messageString);
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ import android.graphics.drawable.Drawable;
|
|||
import android.net.Uri;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableString;
|
||||
import android.util.TypedValue;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
import androidx.core.view.ViewCompat;
|
||||
|
@ -41,7 +42,6 @@ import com.nextcloud.talk.utils.DisplayUtils;
|
|||
import com.nextcloud.talk.utils.TextMatchers;
|
||||
import com.nextcloud.talk.utils.database.user.UserUtils;
|
||||
import com.stfalcon.chatkit.messages.MessageHolders;
|
||||
import com.vanniktech.emoji.EmojiTextView;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.util.HashMap;
|
||||
|
@ -50,7 +50,7 @@ import java.util.Map;
|
|||
@AutoInjector(NextcloudTalkApplication.class)
|
||||
public class MagicOutcomingTextMessageViewHolder extends MessageHolders.OutcomingTextMessageViewHolder<ChatMessage> {
|
||||
@BindView(R.id.messageText)
|
||||
EmojiTextView messageText;
|
||||
TextView messageText;
|
||||
|
||||
@BindView(R.id.messageTime)
|
||||
TextView messageTimeView;
|
||||
|
@ -85,7 +85,7 @@ public class MagicOutcomingTextMessageViewHolder extends MessageHolders.Outcomin
|
|||
FlexboxLayout.LayoutParams layoutParams = (FlexboxLayout.LayoutParams) messageTimeView.getLayoutParams();
|
||||
layoutParams.setWrapBefore(false);
|
||||
|
||||
float emojiSize = DisplayUtils.getDefaultEmojiFontSize(messageText);
|
||||
float textSize = context.getResources().getDimension(R.dimen.chat_text_size);
|
||||
|
||||
if (messageParameters != null && messageParameters.size() > 0) {
|
||||
for (String key : messageParameters.keySet()) {
|
||||
|
@ -122,7 +122,7 @@ public class MagicOutcomingTextMessageViewHolder extends MessageHolders.Outcomin
|
|||
}
|
||||
|
||||
} else if (TextMatchers.isMessageWithSingleEmoticonOnly(message.getText())) {
|
||||
emojiSize *= 2.5f;
|
||||
textSize = (float) (textSize * 2.5);
|
||||
layoutParams.setWrapBefore(true);
|
||||
messageTimeView.setTextColor(context.getResources().getColor(R.color.warm_grey_four));
|
||||
itemView.setSelected(true);
|
||||
|
@ -141,7 +141,7 @@ public class MagicOutcomingTextMessageViewHolder extends MessageHolders.Outcomin
|
|||
ViewCompat.setBackground(bubble, bubbleDrawable);
|
||||
}
|
||||
|
||||
messageText.setEmojiSize((int) emojiSize, true);
|
||||
messageText.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
|
||||
messageTimeView.setLayoutParams(layoutParams);
|
||||
messageText.setText(messageString);
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ import android.graphics.drawable.LayerDrawable;
|
|||
import android.net.Uri;
|
||||
import android.os.Handler;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
import autodagger.AutoInjector;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
|
@ -44,11 +45,8 @@ import com.nextcloud.talk.utils.DisplayUtils;
|
|||
import com.nextcloud.talk.utils.DrawableUtils;
|
||||
import com.nextcloud.talk.utils.bundle.BundleKeys;
|
||||
import com.stfalcon.chatkit.messages.MessageHolders;
|
||||
import com.vanniktech.emoji.EmojiTextView;
|
||||
import io.reactivex.Scheduler;
|
||||
import io.reactivex.Single;
|
||||
import io.reactivex.SingleObserver;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
import okhttp3.OkHttpClient;
|
||||
|
@ -61,7 +59,7 @@ import java.util.concurrent.Callable;
|
|||
public class MagicPreviewMessageViewHolder extends MessageHolders.IncomingImageMessageViewHolder<ChatMessage> {
|
||||
|
||||
@BindView(R.id.messageText)
|
||||
EmojiTextView messageText;
|
||||
TextView messageText;
|
||||
|
||||
@Inject
|
||||
Context context;
|
||||
|
|
|
@ -23,6 +23,8 @@ package com.nextcloud.talk.application;
|
|||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import androidx.emoji.bundled.BundledEmojiCompatConfig;
|
||||
import androidx.emoji.text.EmojiCompat;
|
||||
import androidx.lifecycle.LifecycleObserver;
|
||||
import androidx.multidex.MultiDex;
|
||||
import androidx.multidex.MultiDexApplication;
|
||||
|
@ -53,7 +55,7 @@ import com.nextcloud.talk.utils.database.user.UserModule;
|
|||
import com.nextcloud.talk.utils.singletons.MerlinTheWizard;
|
||||
import com.nextcloud.talk.webrtc.MagicWebRTCUtils;
|
||||
import com.vanniktech.emoji.EmojiManager;
|
||||
import com.vanniktech.emoji.twitter.TwitterEmojiProvider;
|
||||
import com.vanniktech.emoji.googlecompat.GoogleCompatEmojiProvider;
|
||||
import okhttp3.OkHttpClient;
|
||||
import org.conscrypt.Conscrypt;
|
||||
import org.webrtc.PeerConnectionFactory;
|
||||
|
@ -159,7 +161,11 @@ public class NextcloudTalkApplication extends MultiDexApplication implements Lif
|
|||
WorkManager.getInstance().enqueue(signalingSettingsWork);
|
||||
WorkManager.getInstance().enqueueUniquePeriodicWork("DailyCapabilitiesUpdateWork", ExistingPeriodicWorkPolicy.REPLACE, periodicCapabilitiesUpdateWork);
|
||||
|
||||
EmojiManager.install(new TwitterEmojiProvider());
|
||||
final EmojiCompat.Config config = new BundledEmojiCompatConfig(this);
|
||||
config.setReplaceAll(true);
|
||||
EmojiCompat emojiCompat = EmojiCompat.init(config);
|
||||
|
||||
EmojiManager.install(new GoogleCompatEmojiProvider(emojiCompat));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ package com.nextcloud.talk.callbacks;
|
|||
import android.content.Context;
|
||||
import android.text.Editable;
|
||||
import android.text.Spanned;
|
||||
import android.text.style.DynamicDrawableSpan;
|
||||
import android.widget.EditText;
|
||||
import com.facebook.widget.text.span.BetterImageSpan;
|
||||
import com.nextcloud.talk.R;
|
||||
import com.nextcloud.talk.models.database.UserEntity;
|
||||
|
@ -32,18 +32,17 @@ 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.EmojiEditText;
|
||||
|
||||
public class MentionAutocompleteCallback implements AutocompleteCallback<Mention> {
|
||||
private Context context;
|
||||
private UserEntity conversationUser;
|
||||
private EmojiEditText emojiEditText;
|
||||
private EditText editText;
|
||||
|
||||
public MentionAutocompleteCallback(Context context, UserEntity conversationUser,
|
||||
EmojiEditText emojiEditText) {
|
||||
EditText editText) {
|
||||
this.context = context;
|
||||
this.conversationUser = conversationUser;
|
||||
this.emojiEditText = emojiEditText;
|
||||
this.editText = editText;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -57,7 +56,7 @@ public class MentionAutocompleteCallback implements AutocompleteCallback<Mention
|
|||
Spans.MentionChipSpan mentionChipSpan =
|
||||
new Spans.MentionChipSpan(DisplayUtils.getDrawableForMentionChipSpan(context,
|
||||
item.getId(), item.getLabel(), conversationUser, item.getSource(),
|
||||
R.xml.chip_text_entry, emojiEditText),
|
||||
R.xml.chip_text_entry, editText),
|
||||
BetterImageSpan.ALIGN_CENTER,
|
||||
item.getId(), item.getLabel());
|
||||
editable.setSpan(mentionChipSpan, start, start + item.getLabel().length(),
|
||||
|
|
|
@ -40,7 +40,6 @@ import android.view.MotionEvent;
|
|||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.*;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
@ -48,7 +47,6 @@ import autodagger.AutoInjector;
|
|||
import butterknife.BindView;
|
||||
import butterknife.OnClick;
|
||||
import butterknife.OnLongClick;
|
||||
|
||||
import com.bluelinelabs.logansquare.LoganSquare;
|
||||
import com.facebook.drawee.backends.pipeline.Fresco;
|
||||
import com.facebook.drawee.interfaces.DraweeController;
|
||||
|
@ -82,7 +80,6 @@ import com.nextcloud.talk.utils.singletons.ApplicationWideCurrentRoomHolder;
|
|||
import com.nextcloud.talk.utils.singletons.MerlinTheWizard;
|
||||
import com.nextcloud.talk.webrtc.*;
|
||||
import com.wooplr.spotlight.SpotlightView;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
|
@ -92,18 +89,15 @@ import me.zhanghai.android.effortlesspermissions.AfterPermissionDenied;
|
|||
import me.zhanghai.android.effortlesspermissions.EffortlessPermissions;
|
||||
import me.zhanghai.android.effortlesspermissions.OpenAppDetailsDialogFragment;
|
||||
import okhttp3.Cache;
|
||||
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
import org.parceler.Parcel;
|
||||
import org.webrtc.*;
|
||||
|
||||
import pub.devrel.easypermissions.AfterPermissionGranted;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
|
|
@ -38,6 +38,7 @@ import android.text.TextWatcher;
|
|||
import android.util.Log;
|
||||
import android.view.*;
|
||||
import android.widget.AbsListView;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.ProgressBar;
|
||||
import androidx.annotation.NonNull;
|
||||
|
@ -95,7 +96,6 @@ import com.stfalcon.chatkit.messages.MessageInput;
|
|||
import com.stfalcon.chatkit.messages.MessagesList;
|
||||
import com.stfalcon.chatkit.messages.MessagesListAdapter;
|
||||
import com.stfalcon.chatkit.utils.DateFormatter;
|
||||
import com.vanniktech.emoji.EmojiEditText;
|
||||
import com.vanniktech.emoji.EmojiImageView;
|
||||
import com.vanniktech.emoji.EmojiPopup;
|
||||
import com.vanniktech.emoji.emoji.Emoji;
|
||||
|
@ -139,7 +139,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||
@BindView(R.id.messageInputView)
|
||||
MessageInput messageInputView;
|
||||
@BindView(R.id.messageInput)
|
||||
EmojiEditText messageInput;
|
||||
EditText messageInput;
|
||||
@BindView(R.id.popupBubbleView)
|
||||
PopupBubble popupBubble;
|
||||
@BindView(R.id.progressBar)
|
||||
|
|
|
@ -31,6 +31,7 @@ import android.view.MenuItem;
|
|||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.work.Data;
|
||||
|
@ -61,7 +62,6 @@ import com.nextcloud.talk.utils.ApiUtils;
|
|||
import com.nextcloud.talk.utils.DisplayUtils;
|
||||
import com.nextcloud.talk.utils.bundle.BundleKeys;
|
||||
import com.nextcloud.talk.utils.preferencestorage.DatabaseStorageModule;
|
||||
import com.vanniktech.emoji.EmojiTextView;
|
||||
import com.yarolegovich.lovelydialog.LovelySaveStateHandler;
|
||||
import com.yarolegovich.lovelydialog.LovelyStandardDialog;
|
||||
import com.yarolegovich.mp.*;
|
||||
|
@ -94,7 +94,7 @@ public class ConversationInfoController extends BaseController {
|
|||
@BindView(R.id.avatar_image)
|
||||
SimpleDraweeView conversationAvatarImageView;
|
||||
@BindView(R.id.display_name_text)
|
||||
EmojiTextView conversationDisplayName;
|
||||
TextView conversationDisplayName;
|
||||
@BindView(R.id.participants_list_category)
|
||||
MaterialPreferenceCategory participantsListCategory;
|
||||
@BindView(R.id.recycler_view)
|
||||
|
|
|
@ -37,7 +37,6 @@ import android.os.Vibrator;
|
|||
import android.text.TextUtils;
|
||||
import android.util.Base64;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
import androidx.core.app.NotificationManagerCompat;
|
||||
|
@ -45,7 +44,6 @@ import androidx.work.Data;
|
|||
import androidx.work.Worker;
|
||||
import androidx.work.WorkerParameters;
|
||||
import autodagger.AutoInjector;
|
||||
|
||||
import com.bluelinelabs.logansquare.LoganSquare;
|
||||
import com.nextcloud.talk.R;
|
||||
import com.nextcloud.talk.activities.MagicCallActivity;
|
||||
|
@ -69,20 +67,16 @@ import com.nextcloud.talk.utils.bundle.BundleKeys;
|
|||
import com.nextcloud.talk.utils.database.arbitrarystorage.ArbitraryStorageUtils;
|
||||
import com.nextcloud.talk.utils.preferences.AppPreferences;
|
||||
import com.nextcloud.talk.utils.singletons.ApplicationWideCurrentRoomHolder;
|
||||
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import okhttp3.JavaNetCookieJar;
|
||||
import okhttp3.OkHttpClient;
|
||||
|
||||
import org.parceler.Parcels;
|
||||
|
||||
import retrofit2.Retrofit;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.NoSuchPaddingException;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.CookieManager;
|
||||
import java.security.InvalidKeyException;
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
package com.nextcloud.talk.models.json.participants;
|
||||
|
||||
import com.bluelinelabs.logansquare.annotation.JsonField;
|
||||
import com.bluelinelabs.logansquare.annotation.JsonIgnore;
|
||||
import com.bluelinelabs.logansquare.annotation.JsonObject;
|
||||
import com.nextcloud.talk.models.json.converters.EnumParticipantTypeConverter;
|
||||
import com.nextcloud.talk.models.json.converters.ObjectParcelConverter;
|
||||
|
|
|
@ -23,10 +23,8 @@ package com.nextcloud.talk.models.json.signaling;
|
|||
import com.bluelinelabs.logansquare.annotation.JsonField;
|
||||
import com.bluelinelabs.logansquare.annotation.JsonObject;
|
||||
import com.nextcloud.talk.models.json.converters.ObjectParcelConverter;
|
||||
|
||||
import org.parceler.ParcelPropertyConverter;
|
||||
|
||||
import lombok.Data;
|
||||
import org.parceler.ParcelPropertyConverter;
|
||||
|
||||
@Data
|
||||
@JsonObject
|
||||
|
|
|
@ -23,13 +23,11 @@ package com.nextcloud.talk.models.json.signaling;
|
|||
import com.bluelinelabs.logansquare.annotation.JsonField;
|
||||
import com.bluelinelabs.logansquare.annotation.JsonObject;
|
||||
import com.nextcloud.talk.models.json.converters.ObjectParcelConverter;
|
||||
|
||||
import lombok.Data;
|
||||
import org.parceler.ParcelPropertyConverter;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@JsonObject
|
||||
public class DataChannelMessageNick {
|
||||
|
|
|
@ -21,12 +21,10 @@
|
|||
package com.nextcloud.talk.utils;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.bluelinelabs.conductor.Router;
|
||||
import com.bluelinelabs.conductor.RouterTransaction;
|
||||
import com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler;
|
||||
import com.nextcloud.talk.controllers.ChatController;
|
||||
import com.nextcloud.talk.utils.bundle.BundleKeys;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -38,17 +38,20 @@ import android.net.Uri;
|
|||
import android.os.Build;
|
||||
import android.text.*;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.text.style.*;
|
||||
import android.text.style.AbsoluteSizeSpan;
|
||||
import android.text.style.ClickableSpan;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.text.style.StyleSpan;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.*;
|
||||
import androidx.appcompat.widget.AppCompatDrawableManager;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.graphics.drawable.DrawableCompat;
|
||||
import androidx.emoji.text.EmojiSpan;
|
||||
import com.facebook.common.executors.UiThreadImmediateExecutorService;
|
||||
import com.facebook.common.references.CloseableReference;
|
||||
import com.facebook.datasource.DataSource;
|
||||
|
@ -71,7 +74,6 @@ import com.nextcloud.talk.application.NextcloudTalkApplication;
|
|||
import com.nextcloud.talk.events.UserMentionClickEvent;
|
||||
import com.nextcloud.talk.models.database.UserEntity;
|
||||
import com.nextcloud.talk.utils.text.Spans;
|
||||
import com.vanniktech.emoji.EmojiEditText;
|
||||
import com.vanniktech.emoji.EmojiTextView;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
|
@ -136,11 +138,6 @@ public class DisplayUtils {
|
|||
return new BitmapDrawable(getRoundedBitmapFromVectorDrawableResource(resources, resource));
|
||||
}
|
||||
|
||||
public static float getDefaultEmojiFontSize(EmojiTextView emojiTextView) {
|
||||
final Paint.FontMetrics fontMetrics = emojiTextView.getPaint().getFontMetrics();
|
||||
return fontMetrics.descent - fontMetrics.ascent;
|
||||
}
|
||||
|
||||
private static Bitmap getBitmap(Drawable drawable) {
|
||||
Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(),
|
||||
drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
|
||||
|
@ -238,9 +235,10 @@ public class DisplayUtils {
|
|||
public static Drawable getDrawableForMentionChipSpan(Context context, String id, String label,
|
||||
UserEntity conversationUser, String type,
|
||||
@XmlRes int chipResource,
|
||||
@Nullable EmojiEditText emojiEditText) {
|
||||
@Nullable EditText emojiEditText) {
|
||||
ChipDrawable chip = ChipDrawable.createFromResource(context, chipResource);
|
||||
chip.setText(label);
|
||||
chip.setEllipsize(TextUtils.TruncateAt.MIDDLE);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
Configuration config = context.getResources().getConfiguration();
|
||||
|
|
|
@ -1,69 +0,0 @@
|
|||
/*
|
||||
* Nextcloud Talk application
|
||||
*
|
||||
* @author Mario Danic
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
package com.nextcloud.talk.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import com.nextcloud.talk.R;
|
||||
import com.vanniktech.emoji.EmojiTextView;
|
||||
|
||||
public class EmojiToolbar extends Toolbar {
|
||||
private EmojiTextView emojiTitleTextView;
|
||||
|
||||
public EmojiToolbar(Context context) {
|
||||
super(context);
|
||||
initEmojiTextView(context, null);
|
||||
|
||||
}
|
||||
|
||||
public EmojiToolbar(Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
initEmojiTextView(context, attrs);
|
||||
}
|
||||
|
||||
public EmojiToolbar(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
initEmojiTextView(context, attrs);
|
||||
}
|
||||
|
||||
private void initEmojiTextView(Context context, @Nullable AttributeSet attrs) {
|
||||
if (emojiTitleTextView == null) {
|
||||
emojiTitleTextView = new EmojiTextView(context, attrs);
|
||||
emojiTitleTextView.setSingleLine(true);
|
||||
emojiTitleTextView.setEllipsize(TextUtils.TruncateAt.END);
|
||||
emojiTitleTextView.setTextAppearance(getContext(), R.style.TextAppearance_AppCompat_Widget_ActionBar_Title);
|
||||
addView(emojiTitleTextView);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTitle(CharSequence title) {
|
||||
emojiTitleTextView.setText(title);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTitle(int titleRes) {
|
||||
emojiTitleTextView.setText(titleRes);
|
||||
}
|
||||
}
|
|
@ -26,8 +26,6 @@ import android.text.TextUtils;
|
|||
import android.util.Log;
|
||||
import androidx.annotation.Nullable;
|
||||
import autodagger.AutoInjector;
|
||||
|
||||
import com.bluelinelabs.logansquare.ConverterUtils;
|
||||
import com.bluelinelabs.logansquare.LoganSquare;
|
||||
import com.nextcloud.talk.R;
|
||||
import com.nextcloud.talk.application.NextcloudTalkApplication;
|
||||
|
@ -39,7 +37,6 @@ import com.nextcloud.talk.models.json.signaling.DataChannelMessage;
|
|||
import com.nextcloud.talk.models.json.signaling.DataChannelMessageNick;
|
||||
import com.nextcloud.talk.models.json.signaling.NCIceCandidate;
|
||||
import com.nextcloud.talk.utils.LoggingUtils;
|
||||
import com.nextcloud.talk.utils.singletons.MerlinTheWizard;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.webrtc.*;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.nextcloud.talk.utils.EmojiToolbar
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?android:attr/actionBarSize"
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
android:layout_centerHorizontal="true"
|
||||
apc:roundAsCircle="true" />
|
||||
|
||||
<com.vanniktech.emoji.EmojiTextView
|
||||
<TextView
|
||||
android:id="@+id/display_name_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
app:flexWrap="wrap"
|
||||
app:justifyContent="flex_end">
|
||||
|
||||
<com.vanniktech.emoji.EmojiTextView
|
||||
<TextView
|
||||
android:id="@id/messageText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
app:flexWrap="wrap"
|
||||
app:justifyContent="flex_end">
|
||||
|
||||
<com.vanniktech.emoji.EmojiTextView
|
||||
<TextView
|
||||
android:id="@+id/messageAuthor"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -55,7 +55,7 @@
|
|||
android:layout_marginBottom="4dp"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<com.vanniktech.emoji.EmojiTextView
|
||||
<TextView
|
||||
android:id="@id/messageText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
app:flexWrap="wrap"
|
||||
app:justifyContent="flex_end">
|
||||
|
||||
<com.vanniktech.emoji.EmojiTextView
|
||||
<TextView
|
||||
android:id="@id/messageText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
app:flexWrap="wrap"
|
||||
app:justifyContent="flex_end">
|
||||
|
||||
<com.vanniktech.emoji.EmojiTextView
|
||||
<TextView
|
||||
android:id="@id/messageText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
android:layout_toEndOf="@id/frame_layout"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.vanniktech.emoji.EmojiTextView
|
||||
<TextView
|
||||
android:id="@+id/name_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
android:layout_toEndOf="@id/frame_layout"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.vanniktech.emoji.EmojiTextView
|
||||
<TextView
|
||||
android:id="@+id/name_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
android:background="@drawable/shape_favorite_bubble" />
|
||||
</FrameLayout>
|
||||
|
||||
<com.vanniktech.emoji.EmojiTextView
|
||||
<TextView
|
||||
android:id="@id/dialogName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -104,7 +104,7 @@
|
|||
app:roundAsCircle="true"
|
||||
tools:src="@drawable/ic_call_black_24dp" />
|
||||
|
||||
<com.vanniktech.emoji.EmojiTextView
|
||||
<TextView
|
||||
android:id="@id/dialogLastMessage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:background="@color/white">
|
||||
|
||||
<com.vanniktech.emoji.EmojiTextView
|
||||
<TextView
|
||||
android:id="@+id/menu_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
android:layout_height="0dp"
|
||||
android:layout_toEndOf="@id/attachmentButton" />
|
||||
|
||||
<com.vanniktech.emoji.EmojiEditText
|
||||
<EditText
|
||||
android:id="@id/messageInput"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
Loading…
Reference in a new issue