mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +01:00
parent
3410efcd60
commit
a71444637a
@ -154,8 +154,8 @@ dependencies {
|
|||||||
|
|
||||||
implementation 'net.orange-box.storebox:storebox-lib:1.4.0'
|
implementation 'net.orange-box.storebox:storebox-lib:1.4.0'
|
||||||
|
|
||||||
compileOnly "org.projectlombok:lombok:1.18.2"
|
compileOnly "org.projectlombok:lombok:1.18.4"
|
||||||
annotationProcessor "org.projectlombok:lombok:1.18.2"
|
annotationProcessor "org.projectlombok:lombok:1.18.4"
|
||||||
|
|
||||||
implementation 'com.jakewharton:butterknife:9.0.0-rc1'
|
implementation 'com.jakewharton:butterknife:9.0.0-rc1'
|
||||||
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1'
|
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1'
|
||||||
@ -168,6 +168,11 @@ dependencies {
|
|||||||
implementation 'com.github.bumptech.glide:glide:4.8.0'
|
implementation 'com.github.bumptech.glide:glide:4.8.0'
|
||||||
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
|
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
|
||||||
implementation 'com.github.bumptech.glide:okhttp3-integration:4.8.0@aar'
|
implementation 'com.github.bumptech.glide:okhttp3-integration:4.8.0@aar'
|
||||||
|
implementation 'com.facebook.fresco:fresco:1.11.0'
|
||||||
|
implementation 'com.facebook.fresco:animated-webp:1.11.0'
|
||||||
|
implementation 'com.facebook.fresco:webpsupport:1.11.0'
|
||||||
|
implementation 'com.facebook.fresco:animated-gif:1.11.0'
|
||||||
|
implementation "com.facebook.fresco:imagepipeline-okhttp3:1.11.0"
|
||||||
implementation 'org.webrtc:google-webrtc:1.0.23295'
|
implementation 'org.webrtc:google-webrtc:1.0.23295'
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}"
|
||||||
|
|
||||||
@ -181,7 +186,7 @@ dependencies {
|
|||||||
|
|
||||||
implementation 'com.github.wooplr:Spotlight:1.3'
|
implementation 'com.github.wooplr:Spotlight:1.3'
|
||||||
|
|
||||||
implementation 'com.github.mario:Chatkit:31d75fd532'
|
implementation 'com.github.mario:chatkit:628c909ef4'
|
||||||
|
|
||||||
implementation 'com.otaliastudios:autocomplete:1.1.0'
|
implementation 'com.otaliastudios:autocomplete:1.1.0'
|
||||||
|
|
||||||
|
@ -33,16 +33,16 @@ import android.view.View;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.amulyakhare.textdrawable.TextDrawable;
|
import com.amulyakhare.textdrawable.TextDrawable;
|
||||||
|
import com.facebook.drawee.view.SimpleDraweeView;
|
||||||
import com.google.android.flexbox.FlexboxLayout;
|
import com.google.android.flexbox.FlexboxLayout;
|
||||||
import com.kevalpatel2106.emoticongifkeyboard.widget.EmoticonTextView;
|
import com.kevalpatel2106.emoticongifkeyboard.widget.EmoticonTextView;
|
||||||
import com.nextcloud.talk.R;
|
import com.nextcloud.talk.R;
|
||||||
import com.nextcloud.talk.application.NextcloudTalkApplication;
|
import com.nextcloud.talk.application.NextcloudTalkApplication;
|
||||||
import com.nextcloud.talk.models.json.chat.ChatMessage;
|
import com.nextcloud.talk.models.json.chat.ChatMessage;
|
||||||
import com.nextcloud.talk.utils.DisplayUtils;
|
import com.nextcloud.talk.utils.DisplayUtils;
|
||||||
import com.nextcloud.talk.utils.EmojiDetection;
|
import com.nextcloud.talk.utils.TextMatchers;
|
||||||
import com.nextcloud.talk.utils.database.user.UserUtils;
|
import com.nextcloud.talk.utils.database.user.UserUtils;
|
||||||
import com.stfalcon.chatkit.messages.MessageHolders;
|
import com.stfalcon.chatkit.messages.MessageHolders;
|
||||||
import com.stfalcon.chatkit.utils.ShapeImageView;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -65,7 +65,7 @@ public class MagicIncomingTextMessageViewHolder
|
|||||||
EmoticonTextView messageText;
|
EmoticonTextView messageText;
|
||||||
|
|
||||||
@BindView(R.id.messageUserAvatar)
|
@BindView(R.id.messageUserAvatar)
|
||||||
ShapeImageView messageUserAvatarView;
|
SimpleDraweeView messageUserAvatarView;
|
||||||
|
|
||||||
@BindView(R.id.messageTime)
|
@BindView(R.id.messageTime)
|
||||||
TextView messageTimeView;
|
TextView messageTimeView;
|
||||||
@ -156,7 +156,7 @@ public class MagicIncomingTextMessageViewHolder
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (EmojiDetection.isMessageWithSingleEmoticonOnly(context, message.getText())) {
|
} else if (TextMatchers.isMessageWithSingleEmoticonOnly(context, message.getText())) {
|
||||||
messageString.setSpan(new RelativeSizeSpan(2.5f), 0, messageString.length(),
|
messageString.setSpan(new RelativeSizeSpan(2.5f), 0, messageString.length(),
|
||||||
Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
|
Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||||
layoutParams.setWrapBefore(true);
|
layoutParams.setWrapBefore(true);
|
||||||
|
@ -37,7 +37,7 @@ import com.nextcloud.talk.R;
|
|||||||
import com.nextcloud.talk.application.NextcloudTalkApplication;
|
import com.nextcloud.talk.application.NextcloudTalkApplication;
|
||||||
import com.nextcloud.talk.models.json.chat.ChatMessage;
|
import com.nextcloud.talk.models.json.chat.ChatMessage;
|
||||||
import com.nextcloud.talk.utils.DisplayUtils;
|
import com.nextcloud.talk.utils.DisplayUtils;
|
||||||
import com.nextcloud.talk.utils.EmojiDetection;
|
import com.nextcloud.talk.utils.TextMatchers;
|
||||||
import com.nextcloud.talk.utils.database.user.UserUtils;
|
import com.nextcloud.talk.utils.database.user.UserUtils;
|
||||||
import com.stfalcon.chatkit.messages.MessageHolders;
|
import com.stfalcon.chatkit.messages.MessageHolders;
|
||||||
|
|
||||||
@ -106,7 +106,7 @@ public class MagicOutcomingTextMessageViewHolder extends MessageHolders.Outcomin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (EmojiDetection.isMessageWithSingleEmoticonOnly(context, message.getText())) {
|
} else if (TextMatchers.isMessageWithSingleEmoticonOnly(context, message.getText())) {
|
||||||
messageString.setSpan(new RelativeSizeSpan(2.5f), 0, messageString.length(),
|
messageString.setSpan(new RelativeSizeSpan(2.5f), 0, messageString.length(),
|
||||||
Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
|
Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||||
layoutParams.setWrapBefore(true);
|
layoutParams.setWrapBefore(true);
|
||||||
|
@ -28,8 +28,9 @@ import android.widget.TextView;
|
|||||||
import com.nextcloud.talk.R;
|
import com.nextcloud.talk.R;
|
||||||
import com.nextcloud.talk.application.NextcloudTalkApplication;
|
import com.nextcloud.talk.application.NextcloudTalkApplication;
|
||||||
import com.nextcloud.talk.models.json.chat.ChatMessage;
|
import com.nextcloud.talk.models.json.chat.ChatMessage;
|
||||||
|
import com.nextcloud.talk.utils.DisplayUtils;
|
||||||
|
import com.nextcloud.talk.utils.TextMatchers;
|
||||||
import com.stfalcon.chatkit.messages.MessageHolders;
|
import com.stfalcon.chatkit.messages.MessageHolders;
|
||||||
import com.stfalcon.chatkit.utils.RoundedImageView;
|
|
||||||
|
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
@ -51,31 +52,26 @@ public class MagicPreviewMessageViewHolder extends MessageHolders.IncomingImageM
|
|||||||
if (userAvatar != null) {
|
if (userAvatar != null) {
|
||||||
if (message.isGrouped) {
|
if (message.isGrouped) {
|
||||||
userAvatar.setVisibility(View.INVISIBLE);
|
userAvatar.setVisibility(View.INVISIBLE);
|
||||||
((RoundedImageView) image).setCorners(R.dimen.message_bubble_corners_radius, R.dimen.message_bubble_corners_radius, 0, 0);
|
|
||||||
} else {
|
} else {
|
||||||
userAvatar.setVisibility(View.VISIBLE);
|
userAvatar.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (message.getSpecialURLType() == TextMatchers.SpecialURLType.NONE) {
|
||||||
if (message.getUser().getId().equals(message.activeUserId)) {
|
// it's a preview for a Nextcloud share
|
||||||
time.setTextColor(NextcloudTalkApplication.getSharedApplication().getResources().getColor(R.color.white60));
|
|
||||||
if (!message.isGrouped) {
|
|
||||||
((RoundedImageView) image).setCorners(R.dimen.message_bubble_corners_radius, 0, 0, 0);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
time.setTextColor(NextcloudTalkApplication.getSharedApplication().getResources().getColor(R.color.warm_grey_four));
|
|
||||||
if (!message.isGrouped) {
|
|
||||||
((RoundedImageView) image).setCorners(0, R.dimen.message_bubble_corners_radius, 0, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
messageText.setText(message.getSelectedIndividualHashMap().get("name"));
|
messageText.setText(message.getSelectedIndividualHashMap().get("name"));
|
||||||
|
DisplayUtils.setClickableString(message.getSelectedIndividualHashMap().get("name"), message.getSelectedIndividualHashMap().get("link"), messageText);
|
||||||
image.setOnClickListener(v -> {
|
image.setOnClickListener(v -> {
|
||||||
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(message.getSelectedIndividualHashMap().get("link")));
|
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(message.getSelectedIndividualHashMap().get("link")));
|
||||||
browserIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
browserIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
NextcloudTalkApplication.getSharedApplication().getApplicationContext().startActivity(browserIntent);
|
NextcloudTalkApplication.getSharedApplication().getApplicationContext().startActivity(browserIntent);
|
||||||
});
|
});
|
||||||
|
} else if (message.getSpecialURLType() == TextMatchers.SpecialURLType.GIPHY){
|
||||||
|
messageText.setText("GIPHY");
|
||||||
|
DisplayUtils.setClickableString("GIPHY", "https://giphy.com", messageText);
|
||||||
|
} else if (message.getSpecialURLType() == TextMatchers.SpecialURLType.TENOR) {
|
||||||
|
messageText.setText("Tenor");
|
||||||
|
DisplayUtils.setClickableString("Tenor", "https://tenor.com", messageText);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,10 @@ import android.content.Context;
|
|||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.facebook.cache.disk.DiskCacheConfig;
|
||||||
|
import com.facebook.common.logging.FLog;
|
||||||
|
import com.facebook.drawee.backends.pipeline.Fresco;
|
||||||
|
import com.facebook.imagepipeline.core.ImagePipelineConfig;
|
||||||
import com.nextcloud.talk.dagger.modules.BusModule;
|
import com.nextcloud.talk.dagger.modules.BusModule;
|
||||||
import com.nextcloud.talk.dagger.modules.ContextModule;
|
import com.nextcloud.talk.dagger.modules.ContextModule;
|
||||||
import com.nextcloud.talk.dagger.modules.DatabaseModule;
|
import com.nextcloud.talk.dagger.modules.DatabaseModule;
|
||||||
@ -35,6 +39,7 @@ import com.nextcloud.talk.jobs.SignalingSettingsJob;
|
|||||||
import com.nextcloud.talk.utils.ClosedInterfaceImpl;
|
import com.nextcloud.talk.utils.ClosedInterfaceImpl;
|
||||||
import com.nextcloud.talk.utils.DeviceUtils;
|
import com.nextcloud.talk.utils.DeviceUtils;
|
||||||
import com.nextcloud.talk.utils.DisplayUtils;
|
import com.nextcloud.talk.utils.DisplayUtils;
|
||||||
|
import com.nextcloud.talk.utils.OkHttpNetworkFetcherWithCache;
|
||||||
import com.nextcloud.talk.utils.database.arbitrarystorage.ArbitraryStorageModule;
|
import com.nextcloud.talk.utils.database.arbitrarystorage.ArbitraryStorageModule;
|
||||||
import com.nextcloud.talk.utils.database.user.UserModule;
|
import com.nextcloud.talk.utils.database.user.UserModule;
|
||||||
import com.nextcloud.talk.webrtc.MagicWebRTCUtils;
|
import com.nextcloud.talk.webrtc.MagicWebRTCUtils;
|
||||||
@ -45,6 +50,7 @@ import org.webrtc.voiceengine.WebRtcAudioUtils;
|
|||||||
|
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import androidx.lifecycle.LifecycleObserver;
|
import androidx.lifecycle.LifecycleObserver;
|
||||||
@ -55,6 +61,7 @@ import androidx.work.PeriodicWorkRequest;
|
|||||||
import androidx.work.WorkManager;
|
import androidx.work.WorkManager;
|
||||||
import autodagger.AutoComponent;
|
import autodagger.AutoComponent;
|
||||||
import autodagger.AutoInjector;
|
import autodagger.AutoInjector;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
import uk.co.chrisjenx.calligraphy.CalligraphyConfig;
|
import uk.co.chrisjenx.calligraphy.CalligraphyConfig;
|
||||||
|
|
||||||
@AutoComponent(
|
@AutoComponent(
|
||||||
@ -71,6 +78,9 @@ import uk.co.chrisjenx.calligraphy.CalligraphyConfig;
|
|||||||
@Singleton
|
@Singleton
|
||||||
@AutoInjector(NextcloudTalkApplication.class)
|
@AutoInjector(NextcloudTalkApplication.class)
|
||||||
public class NextcloudTalkApplication extends MultiDexApplication implements LifecycleObserver {
|
public class NextcloudTalkApplication extends MultiDexApplication implements LifecycleObserver {
|
||||||
|
@Inject
|
||||||
|
OkHttpClient okHttpClient;
|
||||||
|
|
||||||
private static final String TAG = NextcloudTalkApplication.class.getSimpleName();
|
private static final String TAG = NextcloudTalkApplication.class.getSimpleName();
|
||||||
|
|
||||||
//region Singleton
|
//region Singleton
|
||||||
@ -124,6 +134,18 @@ public class NextcloudTalkApplication extends MultiDexApplication implements Lif
|
|||||||
|
|
||||||
componentApplication.inject(this);
|
componentApplication.inject(this);
|
||||||
|
|
||||||
|
ImagePipelineConfig imagePipelineConfig = ImagePipelineConfig.newBuilder(this)
|
||||||
|
.setNetworkFetcher(new OkHttpNetworkFetcherWithCache(okHttpClient))
|
||||||
|
.setMainDiskCacheConfig(DiskCacheConfig.newBuilder(this)
|
||||||
|
.setMaxCacheSize(0)
|
||||||
|
.setMaxCacheSizeOnLowDiskSpace(0)
|
||||||
|
.setMaxCacheSizeOnVeryLowDiskSpace(0)
|
||||||
|
.build())
|
||||||
|
.build();
|
||||||
|
|
||||||
|
Fresco.initialize(this, imagePipelineConfig);
|
||||||
|
FLog.setMinimumLoggingLevel(FLog.VERBOSE);
|
||||||
|
|
||||||
new ClosedInterfaceImpl().providerInstallerInstallIfNeededAsync();
|
new ClosedInterfaceImpl().providerInstallerInstallIfNeededAsync();
|
||||||
DeviceUtils.ignoreSpecialBatteryFeatures();
|
DeviceUtils.ignoreSpecialBatteryFeatures();
|
||||||
|
|
||||||
|
@ -25,10 +25,10 @@ import android.content.ClipData;
|
|||||||
import android.content.ClipboardManager;
|
import android.content.ClipboardManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.Bitmap;
|
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
import android.graphics.drawable.ColorDrawable;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
@ -43,21 +43,17 @@ import android.view.MenuItem;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.AbsListView;
|
import android.widget.AbsListView;
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.amulyakhare.textdrawable.TextDrawable;
|
|
||||||
import com.bluelinelabs.conductor.RouterTransaction;
|
import com.bluelinelabs.conductor.RouterTransaction;
|
||||||
import com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler;
|
import com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler;
|
||||||
import com.bumptech.glide.load.DataSource;
|
import com.facebook.drawee.backends.pipeline.Fresco;
|
||||||
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
import com.facebook.drawee.interfaces.DraweeController;
|
||||||
import com.bumptech.glide.load.engine.GlideException;
|
import com.facebook.drawee.view.SimpleDraweeView;
|
||||||
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
|
import com.facebook.imagepipeline.request.ImageRequest;
|
||||||
import com.bumptech.glide.request.RequestListener;
|
import com.facebook.imagepipeline.request.ImageRequestBuilder;
|
||||||
import com.bumptech.glide.request.RequestOptions;
|
|
||||||
import com.bumptech.glide.request.target.Target;
|
|
||||||
import com.nextcloud.talk.R;
|
import com.nextcloud.talk.R;
|
||||||
import com.nextcloud.talk.activities.MagicCallActivity;
|
import com.nextcloud.talk.activities.MagicCallActivity;
|
||||||
import com.nextcloud.talk.adapters.messages.MagicIncomingTextMessageViewHolder;
|
import com.nextcloud.talk.adapters.messages.MagicIncomingTextMessageViewHolder;
|
||||||
@ -80,11 +76,11 @@ import com.nextcloud.talk.models.json.rooms.RoomOverall;
|
|||||||
import com.nextcloud.talk.models.json.rooms.RoomsOverall;
|
import com.nextcloud.talk.models.json.rooms.RoomsOverall;
|
||||||
import com.nextcloud.talk.presenters.MentionAutocompletePresenter;
|
import com.nextcloud.talk.presenters.MentionAutocompletePresenter;
|
||||||
import com.nextcloud.talk.utils.ApiUtils;
|
import com.nextcloud.talk.utils.ApiUtils;
|
||||||
|
import com.nextcloud.talk.utils.DisplayUtils;
|
||||||
import com.nextcloud.talk.utils.KeyboardUtils;
|
import com.nextcloud.talk.utils.KeyboardUtils;
|
||||||
import com.nextcloud.talk.utils.NotificationUtils;
|
import com.nextcloud.talk.utils.NotificationUtils;
|
||||||
import com.nextcloud.talk.utils.bundle.BundleKeys;
|
import com.nextcloud.talk.utils.bundle.BundleKeys;
|
||||||
import com.nextcloud.talk.utils.database.user.UserUtils;
|
import com.nextcloud.talk.utils.database.user.UserUtils;
|
||||||
import com.nextcloud.talk.utils.glide.GlideApp;
|
|
||||||
import com.nextcloud.talk.utils.singletons.ApplicationWideCurrentRoomHolder;
|
import com.nextcloud.talk.utils.singletons.ApplicationWideCurrentRoomHolder;
|
||||||
import com.otaliastudios.autocomplete.Autocomplete;
|
import com.otaliastudios.autocomplete.Autocomplete;
|
||||||
import com.otaliastudios.autocomplete.AutocompleteCallback;
|
import com.otaliastudios.autocomplete.AutocompleteCallback;
|
||||||
@ -97,7 +93,6 @@ import com.stfalcon.chatkit.messages.MessageInput;
|
|||||||
import com.stfalcon.chatkit.messages.MessagesList;
|
import com.stfalcon.chatkit.messages.MessagesList;
|
||||||
import com.stfalcon.chatkit.messages.MessagesListAdapter;
|
import com.stfalcon.chatkit.messages.MessagesListAdapter;
|
||||||
import com.stfalcon.chatkit.utils.DateFormatter;
|
import com.stfalcon.chatkit.utils.DateFormatter;
|
||||||
import com.stfalcon.chatkit.utils.RoundedImageView;
|
|
||||||
import com.webianks.library.PopupBubble;
|
import com.webianks.library.PopupBubble;
|
||||||
|
|
||||||
import org.parceler.Parcels;
|
import org.parceler.Parcels;
|
||||||
@ -113,7 +108,6 @@ import java.util.concurrent.TimeUnit;
|
|||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
import autodagger.AutoInjector;
|
import autodagger.AutoInjector;
|
||||||
@ -326,38 +320,19 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||||||
|
|
||||||
adapter = new MessagesListAdapter<>(conversationUser.getUserId(), messageHolders, new ImageLoader() {
|
adapter = new MessagesListAdapter<>(conversationUser.getUserId(), messageHolders, new ImageLoader() {
|
||||||
@Override
|
@Override
|
||||||
public void loadImage(ImageView imageView, String url) {
|
public void loadImage(SimpleDraweeView imageView, String url) {
|
||||||
if (!(imageView instanceof RoundedImageView)) {
|
ImageRequest request = ImageRequestBuilder.newBuilderWithSource(Uri.parse(url))
|
||||||
GlideApp.with(NextcloudTalkApplication.getSharedApplication().getApplicationContext())
|
.setProgressiveRenderingEnabled(true)
|
||||||
.asBitmap()
|
.disableDiskCache()
|
||||||
.diskCacheStrategy(DiskCacheStrategy.NONE)
|
.build();
|
||||||
.load(url)
|
|
||||||
.centerInside()
|
|
||||||
.override(imageView.getMeasuredWidth(), imageView.getMeasuredHeight())
|
|
||||||
.apply(RequestOptions.bitmapTransform(new CircleCrop()))
|
|
||||||
.listener(new RequestListener<Bitmap>() {
|
|
||||||
@Override
|
|
||||||
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Bitmap> target, boolean isFirstResource) {
|
|
||||||
TextDrawable drawable = TextDrawable.builder().beginConfig().bold()
|
|
||||||
.endConfig().buildRound("?", getResources().getColor(R.color.nc_grey));
|
|
||||||
imageView.setImageDrawable(drawable);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
DraweeController draweeController = Fresco.newDraweeControllerBuilder()
|
||||||
public boolean onResourceReady(Bitmap resource, Object model, Target<Bitmap> target, DataSource dataSource, boolean isFirstResource) {
|
.setImageRequest(request)
|
||||||
return false;
|
.setControllerListener(DisplayUtils.getImageControllerListener(imageView))
|
||||||
}
|
.setOldController(imageView.getController())
|
||||||
})
|
.setAutoPlayAnimations(true)
|
||||||
.into(imageView);
|
.build();
|
||||||
} else {
|
imageView.setController(draweeController);
|
||||||
GlideApp.with(NextcloudTalkApplication.getSharedApplication().getApplicationContext())
|
|
||||||
.asBitmap()
|
|
||||||
.diskCacheStrategy(DiskCacheStrategy.NONE)
|
|
||||||
.override(480, 480)
|
|
||||||
.load(url)
|
|
||||||
.into(imageView);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -251,7 +251,7 @@ public class RestModule {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class HeadersInterceptor implements Interceptor {
|
public static class HeadersInterceptor implements Interceptor {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Response intercept(@NonNull Chain chain) throws IOException {
|
public Response intercept(@NonNull Chain chain) throws IOException {
|
||||||
|
@ -25,6 +25,7 @@ import com.bluelinelabs.logansquare.annotation.JsonObject;
|
|||||||
import com.nextcloud.talk.R;
|
import com.nextcloud.talk.R;
|
||||||
import com.nextcloud.talk.models.json.converters.EnumSystemMessageTypeConverter;
|
import com.nextcloud.talk.models.json.converters.EnumSystemMessageTypeConverter;
|
||||||
import com.nextcloud.talk.utils.ApiUtils;
|
import com.nextcloud.talk.utils.ApiUtils;
|
||||||
|
import com.nextcloud.talk.utils.TextMatchers;
|
||||||
import com.stfalcon.chatkit.commons.models.IMessage;
|
import com.stfalcon.chatkit.commons.models.IMessage;
|
||||||
import com.stfalcon.chatkit.commons.models.IUser;
|
import com.stfalcon.chatkit.commons.models.IUser;
|
||||||
import com.stfalcon.chatkit.commons.models.MessageContentType;
|
import com.stfalcon.chatkit.commons.models.MessageContentType;
|
||||||
@ -44,6 +45,10 @@ import lombok.Data;
|
|||||||
@JsonObject
|
@JsonObject
|
||||||
public class ChatMessage implements IMessage, MessageContentType, MessageContentType.Image {
|
public class ChatMessage implements IMessage, MessageContentType, MessageContentType.Image {
|
||||||
|
|
||||||
|
public TextMatchers.SpecialURLType getSpecialURLType() {
|
||||||
|
return TextMatchers.getSpecialUrlTypeMessage(getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public String getImageUrl() {
|
public String getImageUrl() {
|
||||||
@ -59,6 +64,10 @@ public class ChatMessage implements IMessage, MessageContentType, MessageContent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getSpecialURLType() != TextMatchers.SpecialURLType.NONE) {
|
||||||
|
return getMessage().trim();
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,19 +22,33 @@ package com.nextcloud.talk.utils;
|
|||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
import android.content.res.ColorStateList;
|
import android.content.res.ColorStateList;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.graphics.Typeface;
|
import android.graphics.Typeface;
|
||||||
|
import android.graphics.drawable.Animatable;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.text.Spannable;
|
import android.text.Spannable;
|
||||||
|
import android.text.SpannableString;
|
||||||
|
import android.text.Spanned;
|
||||||
|
import android.text.TextPaint;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
import android.text.method.LinkMovementMethod;
|
||||||
import android.text.style.AbsoluteSizeSpan;
|
import android.text.style.AbsoluteSizeSpan;
|
||||||
|
import android.text.style.ClickableSpan;
|
||||||
import android.text.style.ForegroundColorSpan;
|
import android.text.style.ForegroundColorSpan;
|
||||||
import android.text.style.StyleSpan;
|
import android.text.style.StyleSpan;
|
||||||
import android.util.DisplayMetrics;
|
import android.util.DisplayMetrics;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.facebook.drawee.controller.ControllerListener;
|
||||||
|
import com.facebook.drawee.view.SimpleDraweeView;
|
||||||
|
import com.facebook.imagepipeline.image.ImageInfo;
|
||||||
import com.nextcloud.talk.R;
|
import com.nextcloud.talk.R;
|
||||||
import com.nextcloud.talk.application.NextcloudTalkApplication;
|
import com.nextcloud.talk.application.NextcloudTalkApplication;
|
||||||
|
|
||||||
@ -47,6 +61,8 @@ import java.util.regex.Pattern;
|
|||||||
import androidx.annotation.ColorInt;
|
import androidx.annotation.ColorInt;
|
||||||
import androidx.annotation.ColorRes;
|
import androidx.annotation.ColorRes;
|
||||||
import androidx.annotation.DrawableRes;
|
import androidx.annotation.DrawableRes;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.widget.AppCompatDrawableManager;
|
import androidx.appcompat.widget.AppCompatDrawableManager;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.core.graphics.drawable.DrawableCompat;
|
import androidx.core.graphics.drawable.DrawableCompat;
|
||||||
@ -55,6 +71,68 @@ public class DisplayUtils {
|
|||||||
|
|
||||||
private static final String TAG = "DisplayUtils";
|
private static final String TAG = "DisplayUtils";
|
||||||
|
|
||||||
|
public static void setClickableString(String string, String url, TextView textView){
|
||||||
|
SpannableString spannableString = new SpannableString(string);
|
||||||
|
spannableString.setSpan(new ClickableSpan() {
|
||||||
|
@Override
|
||||||
|
public void onClick(@NonNull View widget) {
|
||||||
|
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
||||||
|
browserIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
NextcloudTalkApplication.getSharedApplication().getApplicationContext().startActivity(browserIntent);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateDrawState(TextPaint ds) {
|
||||||
|
super.updateDrawState(ds);
|
||||||
|
ds.setUnderlineText(false);
|
||||||
|
}
|
||||||
|
}, 0, string.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||||
|
textView.setText(spannableString);
|
||||||
|
textView.setMovementMethod(LinkMovementMethod.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void updateViewSize(@Nullable ImageInfo imageInfo, SimpleDraweeView draweeView) {
|
||||||
|
if (imageInfo != null) {
|
||||||
|
draweeView.getLayoutParams().width = imageInfo.getWidth();
|
||||||
|
draweeView.getLayoutParams().height = ViewGroup.LayoutParams.WRAP_CONTENT;
|
||||||
|
draweeView.setAspectRatio((float) imageInfo.getWidth() / imageInfo.getHeight());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ControllerListener getImageControllerListener(SimpleDraweeView draweeView) {
|
||||||
|
return new ControllerListener() {
|
||||||
|
@Override
|
||||||
|
public void onSubmit(String id, Object callerContext) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFinalImageSet(String id, @javax.annotation.Nullable Object imageInfo, @javax.annotation.Nullable Animatable animatable) {
|
||||||
|
updateViewSize((ImageInfo)imageInfo, draweeView);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onIntermediateImageSet(String id, @javax.annotation.Nullable Object imageInfo) {
|
||||||
|
updateViewSize((ImageInfo) imageInfo, draweeView);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onIntermediateImageFailed(String id, Throwable throwable) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String id, Throwable throwable) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRelease(String id) {
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
public static float convertDpToPixel(float dp, Context context) {
|
public static float convertDpToPixel(float dp, Context context) {
|
||||||
Resources resources = context.getResources();
|
Resources resources = context.getResources();
|
||||||
DisplayMetrics metrics = resources.getDisplayMetrics();
|
DisplayMetrics metrics = resources.getDisplayMetrics();
|
||||||
|
@ -0,0 +1,42 @@
|
|||||||
|
/*
|
||||||
|
* 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 com.facebook.imagepipeline.backends.okhttp3.OkHttpNetworkFetcher;
|
||||||
|
|
||||||
|
import java.util.concurrent.Executor;
|
||||||
|
|
||||||
|
import okhttp3.Call;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
|
||||||
|
public class OkHttpNetworkFetcherWithCache extends OkHttpNetworkFetcher {
|
||||||
|
public OkHttpNetworkFetcherWithCache(OkHttpClient okHttpClient) {
|
||||||
|
super(okHttpClient);
|
||||||
|
}
|
||||||
|
|
||||||
|
public OkHttpNetworkFetcherWithCache(Call.Factory callFactory, Executor cancellationExecutor) {
|
||||||
|
super(callFactory, cancellationExecutor);
|
||||||
|
}
|
||||||
|
|
||||||
|
public OkHttpNetworkFetcherWithCache(Call.Factory callFactory, Executor cancellationExecutor, boolean disableOkHttpCache) {
|
||||||
|
super(callFactory, cancellationExecutor, true);
|
||||||
|
}
|
||||||
|
}
|
@ -25,6 +25,7 @@ package com.nextcloud.talk.utils;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.util.Patterns;
|
||||||
|
|
||||||
import com.nextcloud.talk.R;
|
import com.nextcloud.talk.R;
|
||||||
|
|
||||||
@ -32,18 +33,49 @@ import java.io.BufferedReader;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
public final class EmojiDetection {
|
public final class TextMatchers {
|
||||||
|
|
||||||
private static final String TAG = "EmojiDetection";
|
private static final String TAG = "EmojiDetection";
|
||||||
|
|
||||||
private static Pattern regexPattern;
|
private static Pattern regexPattern;
|
||||||
|
|
||||||
|
public enum SpecialURLType {
|
||||||
|
NONE,
|
||||||
|
GIPHY,
|
||||||
|
TENOR,
|
||||||
|
}
|
||||||
|
|
||||||
|
public static SpecialURLType getSpecialUrlTypeMessage(@NonNull final String text) {
|
||||||
|
List<String> links = new ArrayList<>();
|
||||||
|
Matcher m = Patterns.WEB_URL.matcher(text);
|
||||||
|
while (m.find()) {
|
||||||
|
String url = m.group();
|
||||||
|
links.add(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (links.size() == 1 && text.trim().length() == links.get(0).length()) {
|
||||||
|
String specialLink = links.get(0);
|
||||||
|
if (specialLink.startsWith("https://media.giphy.com/") && specialLink.endsWith(".gif")) {
|
||||||
|
return SpecialURLType.GIPHY;
|
||||||
|
} else if (specialLink.contains("tenor.com/")) {
|
||||||
|
Pattern pattern = Pattern.compile("https://media.*\\.tenor\\.com.*\\.gif.*", Pattern.CASE_INSENSITIVE);
|
||||||
|
if (pattern.matcher(specialLink).matches()) {
|
||||||
|
return SpecialURLType.TENOR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return SpecialURLType.NONE;
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean isMessageWithSingleEmoticonOnly(@NonNull final Context context,
|
public static boolean isMessageWithSingleEmoticonOnly(@NonNull final Context context,
|
||||||
@Nullable final CharSequence text) {
|
@Nullable final CharSequence text) {
|
||||||
|
|
28
app/src/main/res/drawable/incoming_corners.xml
Normal file
28
app/src/main/res/drawable/incoming_corners.xml
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
~ 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/>.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<shape
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
|
||||||
|
<corners android:radius="@dimen/message_bubble_corners_radius" />
|
||||||
|
<solid android:color="@color/nc_white_color" />
|
||||||
|
</shape>
|
29
app/src/main/res/drawable/shape_grouped_message.xml
Normal file
29
app/src/main/res/drawable/shape_grouped_message.xml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
~ 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/>.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
|
||||||
|
<corners
|
||||||
|
android:radius="@dimen/message_bubble_corners_radius" />
|
||||||
|
|
||||||
|
<solid android:color="@color/nc_white_color" />
|
||||||
|
</shape>
|
@ -26,7 +26,7 @@
|
|||||||
android:topLeftRadius="0dp"
|
android:topLeftRadius="0dp"
|
||||||
android:bottomRightRadius="@dimen/message_bubble_corners_radius"
|
android:bottomRightRadius="@dimen/message_bubble_corners_radius"
|
||||||
android:bottomLeftRadius="@dimen/message_bubble_corners_radius"
|
android:bottomLeftRadius="@dimen/message_bubble_corners_radius"
|
||||||
android:topRightRadius="0dp" />
|
android:topRightRadius="@dimen/message_bubble_corners_radius" />
|
||||||
|
|
||||||
<solid android:color="@color/white_two" />
|
<solid android:color="@color/nc_white_color" />
|
||||||
</shape>
|
</shape>
|
||||||
|
@ -28,5 +28,5 @@
|
|||||||
android:bottomLeftRadius="@dimen/message_bubble_corners_radius"
|
android:bottomLeftRadius="@dimen/message_bubble_corners_radius"
|
||||||
android:topRightRadius="0dp" />
|
android:topRightRadius="0dp" />
|
||||||
|
|
||||||
<solid android:color="@color/colorPrimary" />
|
<solid android:color="@color/nc_white_color" />
|
||||||
</shape>
|
</shape>
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="16dp"
|
||||||
@ -26,24 +27,26 @@
|
|||||||
android:layout_marginEnd="16dp"
|
android:layout_marginEnd="16dp"
|
||||||
android:layout_marginBottom="2dp">
|
android:layout_marginBottom="2dp">
|
||||||
|
|
||||||
<com.stfalcon.chatkit.utils.ShapeImageView
|
<com.facebook.drawee.view.SimpleDraweeView
|
||||||
android:id="@id/messageUserAvatar"
|
android:id="@id/messageUserAvatar"
|
||||||
android:layout_width="40dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:layout_marginEnd="8dp" />
|
android:layout_marginEnd="8dp"
|
||||||
|
app:roundAsCircle="true" />
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_toEndOf="@id/messageUserAvatar"
|
android:layout_toEndOf="@id/messageUserAvatar">
|
||||||
android:background="@drawable/shape_preview_text_incoming_message">
|
|
||||||
|
|
||||||
<com.stfalcon.chatkit.utils.RoundedImageView
|
<com.facebook.drawee.view.SimpleDraweeView
|
||||||
android:id="@id/image"
|
android:id="@id/image"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="480px"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="480px"
|
||||||
android:adjustViewBounds="true" />
|
android:adjustViewBounds="true"
|
||||||
|
app:actualImageScaleType="fitCenter" />
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -51,27 +54,25 @@
|
|||||||
android:layout_below="@id/image"
|
android:layout_below="@id/image"
|
||||||
android:layout_alignStart="@+id/image"
|
android:layout_alignStart="@+id/image"
|
||||||
android:layout_alignEnd="@id/image"
|
android:layout_alignEnd="@id/image"
|
||||||
android:layout_margin="8dp">
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="8dp">
|
||||||
|
|
||||||
<com.kevalpatel2106.emoticongifkeyboard.widget.EmoticonTextView
|
<com.kevalpatel2106.emoticongifkeyboard.widget.EmoticonTextView
|
||||||
android:id="@id/messageText"
|
android:id="@id/messageText"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
android:textColorLink="@color/warm_grey_four"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="@color/dark_grey_two"
|
android:autoLink="all"
|
||||||
|
android:textColor="@color/warm_grey_four"
|
||||||
android:textIsSelectable="true"
|
android:textIsSelectable="true"
|
||||||
android:textSize="14sp" />
|
android:textSize="12sp" />
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@id/imageOverlay"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@id/messageTime"
|
android:id="@id/messageTime"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@id/messageText"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_alignParentEnd="true" />
|
android:textColor="@color/warm_grey_four" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
@ -27,10 +27,11 @@
|
|||||||
android:layout_marginRight="16dp"
|
android:layout_marginRight="16dp"
|
||||||
android:layout_marginBottom="2dp">
|
android:layout_marginBottom="2dp">
|
||||||
|
|
||||||
<com.stfalcon.chatkit.utils.ShapeImageView
|
<com.facebook.drawee.view.SimpleDraweeView
|
||||||
android:id="@id/messageUserAvatar"
|
android:id="@id/messageUserAvatar"
|
||||||
android:layout_width="40dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
|
app:roundAsCircle="true"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:layout_marginEnd="8dp" />
|
android:layout_marginEnd="8dp" />
|
||||||
|
|
||||||
|
@ -19,24 +19,21 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="16dp"
|
||||||
android:layout_marginTop="2dp"
|
android:layout_marginTop="2dp"
|
||||||
android:layout_marginEnd="16dp"
|
android:layout_marginEnd="16dp"
|
||||||
android:layout_marginBottom="2dp">
|
android:layout_marginBottom="2dp">
|
||||||
|
|
||||||
<RelativeLayout
|
<com.facebook.drawee.view.SimpleDraweeView
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:background="@drawable/shape_preview_text_outcoming_message">
|
|
||||||
|
|
||||||
<com.stfalcon.chatkit.utils.RoundedImageView
|
|
||||||
android:id="@id/image"
|
android:id="@id/image"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="480px"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="480px"
|
||||||
android:adjustViewBounds="true" />
|
app:actualImageScaleType="fitCenter"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:layout_alignParentEnd="true"/>
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -44,30 +41,25 @@
|
|||||||
android:layout_below="@id/image"
|
android:layout_below="@id/image"
|
||||||
android:layout_alignStart="@+id/image"
|
android:layout_alignStart="@+id/image"
|
||||||
android:layout_alignEnd="@id/image"
|
android:layout_alignEnd="@id/image"
|
||||||
android:layout_margin="8dp">
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="8dp">
|
||||||
|
|
||||||
<com.kevalpatel2106.emoticongifkeyboard.widget.EmoticonTextView
|
<com.kevalpatel2106.emoticongifkeyboard.widget.EmoticonTextView
|
||||||
android:id="@id/messageText"
|
android:id="@id/messageText"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="@color/nc_outcoming_text_default"
|
android:autoLink="all"
|
||||||
|
android:textColorLink="@color/warm_grey_four"
|
||||||
|
android:textColor="@color/warm_grey_four"
|
||||||
android:textIsSelectable="true"
|
android:textIsSelectable="true"
|
||||||
android:textSize="14sp" />
|
android:textSize="12sp" />
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@id/imageOverlay"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@id/messageTime"
|
android:id="@id/messageTime"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@id/messageText"
|
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:textColor="@color/white60" />
|
android:textColor="@color/warm_grey_four" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
@ -44,7 +44,6 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignWithParentIfMissing="true"
|
android:layout_alignWithParentIfMissing="true"
|
||||||
android:textColorHighlight="@color/nc_grey"
|
android:textColorHighlight="@color/nc_grey"
|
||||||
|
|
||||||
android:textIsSelectable="true" />
|
android:textIsSelectable="true" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
Loading…
Reference in New Issue
Block a user