From be627687f05f2845dbf3125a34dbd431bbb2484e Mon Sep 17 00:00:00 2001 From: dwarsh Date: Fri, 27 Aug 2021 02:27:33 +0530 Subject: [PATCH] Android UI Kit v2.4.1-1 --- README.md | 4 +- uikit/build.gradle | 2 +- uikit/src/main/AndroidManifest.xml | 13 +- .../CometChatForwardMessageActivity.java | 208 +++++++++--------- .../CometChatThreadMessageList.java | 12 +- .../constants/UIKitConstants.java | 5 + .../uikit/ui_resources/utils/MediaUtils.java | 109 +++++---- .../fragment_cometchat_thread_message.xml | 18 +- uikit/src/main/res/values/strings.xml | 1 + 9 files changed, 190 insertions(+), 182 deletions(-) diff --git a/README.md b/README.md index ae0cdf4..8540dea 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ The UI Kit is developed to keep developers in mind and aims to reduce developmen [![Platform](https://img.shields.io/badge/Language-Java-yellowgreen.svg)](#) ![GitHub contributors](https://img.shields.io/github/contributors/cometchat-pro/android-java-chat-ui-kit) -![Version](https://shields.io/badge/version-v2.4.0--1-orange) +![Version](https://shields.io/badge/version-v2.4.1--1-orange) ![GitHub stars](https://img.shields.io/github/stars/cometchat-pro/android-java-chat-ui-kit?style=social) ![Twitter Follow](https://img.shields.io/twitter/follow/cometchat?style=social) @@ -71,7 +71,7 @@ allprojects { ```groovy dependencies { - implementation 'com.cometchat:pro-android-chat-sdk:2.4.0' + implementation 'com.cometchat:pro-android-chat-sdk:2.4.1' /** From v2.4+ onwards, Voice & Video Calling functionality has been moved to a separate library. In case you plan to use the calling diff --git a/uikit/build.gradle b/uikit/build.gradle index b839ce3..46e0511 100644 --- a/uikit/build.gradle +++ b/uikit/build.gradle @@ -90,7 +90,7 @@ dependencies { implementation 'com.google.android.gms:play-services-location:17.0.0' implementation 'com.google.android.gms:play-services-maps:17.0.0' //cometchat - compileOnly 'com.cometchat:pro-android-chat-sdk:2.4.0' + compileOnly 'com.cometchat:pro-android-chat-sdk:2.4.1' compileOnly 'com.cometchat:pro-android-calls-sdk:2.1.0' implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.0' } diff --git a/uikit/src/main/AndroidManifest.xml b/uikit/src/main/AndroidManifest.xml index 1d3bc25..58222ad 100644 --- a/uikit/src/main/AndroidManifest.xml +++ b/uikit/src/main/AndroidManifest.xml @@ -12,7 +12,6 @@ - @@ -67,15 +66,11 @@ - - - - - - - - + + + + diff --git a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/forward_message/CometChatForwardMessageActivity.java b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/forward_message/CometChatForwardMessageActivity.java index 77c6c85..60f3e89 100644 --- a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/forward_message/CometChatForwardMessageActivity.java +++ b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/forward_message/CometChatForwardMessageActivity.java @@ -1,5 +1,6 @@ package com.cometchat.pro.uikit.ui_components.messages.forward_message; +import android.app.ProgressDialog; import android.content.Context; import android.content.Intent; import android.graphics.drawable.Drawable; @@ -15,6 +16,7 @@ import android.view.inputmethod.InputMethodManager; import android.widget.EditText; import android.widget.ImageView; +import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -104,6 +106,8 @@ public class CometChatForwardMessageActivity extends AppCompatActivity { private int mediaMessageSize; + private ProgressDialog progressDialog; + private int id; @Override protected void onCreate(Bundle savedInstanceState) { @@ -115,7 +119,7 @@ protected void onCreate(Bundle savedInstanceState) { } - void handleSendText(Intent intent) { + void handleText(Intent intent) { String sharedText = intent.getStringExtra(Intent.EXTRA_TEXT); if (sharedText != null) { messageType = CometChatConstants.MESSAGE_TYPE_TEXT; @@ -123,7 +127,7 @@ void handleSendText(Intent intent) { } } - void handleSendImage(Intent intent) { + void handleImage(Intent intent) { Uri imageUri = (Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM); if (imageUri != null) { messageType = UIKitConstants.IntentStrings.INTENT_MEDIA_IMAGE_MESSAGE; @@ -132,7 +136,7 @@ void handleSendImage(Intent intent) { } } - void handleSendVideo(Intent intent) { + void handleVideo(Intent intent) { Uri videoUri = (Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM); if (videoUri!=null) { messageType = UIKitConstants.IntentStrings.INTENT_MEDIA_VIDEO_MESSAGE; @@ -141,6 +145,23 @@ void handleSendVideo(Intent intent) { } } + void handleAudio(Intent intent) { + Uri audioUri = (Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM); + if (audioUri!=null) { + messageType = UIKitConstants.IntentStrings.INTENT_MEDIA_AUDIO_MESSAGE; + mediaMessageUrl = audioUri.toString(); + Log.e(TAG, "handleSendAudio: "+mediaMessageUrl); + } + } + + void handleFile(Intent intent) { + Uri fileUri = (Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM); + if (fileUri!=null) { + messageType = UIKitConstants.IntentStrings.INTENT_MEDIA_FILE_MESSAGE; + mediaMessageUrl = fileUri.toString(); + Log.e(TAG, "handleSendFile: "+mediaMessageUrl); + } + } /** * This method is used to handle parameter passed to this class. */ @@ -153,11 +174,15 @@ private void handleIntent() { if (Intent.ACTION_SEND.equals(action) && type != null) { if ("text/plain".equals(type)) { - handleSendText(intent); // Handle text being sent + handleText(intent); // Handle text being sent } else if (type.startsWith("image/")) { - handleSendImage(intent); // Handle single image being sent + handleImage(intent); // Handle single image being sent } else if (type.startsWith("video/")) { - handleSendVideo(intent); + handleVideo(intent); + } else if(type.startsWith("audio/")) { + handleAudio(intent); + } else if (type.startsWith("application/")) { + handleFile(intent); } } @@ -200,7 +225,7 @@ private void handleIntent() { * This method is used to initialize the views */ public void init() { - // Inflate the layout + // Inflate the layout MaterialToolbar toolbar = findViewById(R.id.forward_toolbar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); @@ -306,6 +331,8 @@ public void onClick(View vw) { forwardBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { + progressDialog = ProgressDialog + .show(CometChatForwardMessageActivity.this,"",getString(R.string.updating)); if (messageCategory.equals(CometChatConstants.CATEGORY_MESSAGE)) { if (messageType != null && messageType.equals(CometChatConstants.MESSAGE_TYPE_TEXT)) { new Thread(() -> { @@ -361,21 +388,29 @@ public void onClick(View view) { attachment.setFileName(mediaMessageName); message.setAttachment(attachment); Log.e(TAG, "onClick: " + attachment.toString()); - sendMediaMessage(message); - if (i == userList.size() - 1) { - Intent intent = new Intent(CometChatForwardMessageActivity.this, CometChatUI.class); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); - startActivity(intent); - finish(); - } + sendMediaMessage(message,i,progressDialog); +// if (i == userList.size() - 1) { +// Intent intent = new Intent(CometChatForwardMessageActivity.this, CometChatUI.class); +// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); +// startActivity(intent); +// finish(); +// } } }).start(); - } else if (messageType!=null && messageType.equalsIgnoreCase(UIKitConstants.IntentStrings.INTENT_MEDIA_IMAGE_MESSAGE)){ + } else if (messageType != null && + (messageType.equalsIgnoreCase( + UIKitConstants.IntentStrings.INTENT_MEDIA_IMAGE_MESSAGE) || + messageType.equalsIgnoreCase( + UIKitConstants.IntentStrings.INTENT_MEDIA_VIDEO_MESSAGE) || + messageType.equalsIgnoreCase( + UIKitConstants.IntentStrings.INTENT_MEDIA_AUDIO_MESSAGE) || + messageType.equalsIgnoreCase( + UIKitConstants.IntentStrings.INTENT_MEDIA_FILE_MESSAGE))) { new Thread(() -> { for (int i = 0; i <= userList.size() - 1; i++) { Conversation conversation = new ArrayList<>(userList.values()).get(i); - MediaMessage message; + MediaMessage message = null; String uid; String type; Log.e(TAG, "run: " + conversation.getConversationId()); @@ -388,45 +423,15 @@ public void onClick(View view) { } File file = MediaUtils.getRealPath( CometChatForwardMessageActivity.this, - Uri.parse(mediaMessageUrl),true); - message = new MediaMessage(uid, file, CometChatConstants.MESSAGE_TYPE_IMAGE, type); - try { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("path", mediaMessageUrl); - message.setMetadata(jsonObject); - } catch (Exception e) { - Log.e(TAG, "onError: " + e.getMessage()); - } - sendMediaMessage(message); - if (i == userList.size() - 1) { - Intent intent = new Intent(CometChatForwardMessageActivity.this, CometChatUI.class); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); - startActivity(intent); - finish(); - } - } - - }).start(); - } - else if (messageType!=null && messageType.equalsIgnoreCase(UIKitConstants.IntentStrings.INTENT_MEDIA_VIDEO_MESSAGE)){ - new Thread(() -> { - for (int i = 0; i <= userList.size() - 1; i++) { - Conversation conversation = new ArrayList<>(userList.values()).get(i); - MediaMessage message; - String uid; - String type; - Log.e(TAG, "run: " + conversation.getConversationId()); - if (conversation.getConversationType().equals(CometChatConstants.CONVERSATION_TYPE_USER)) { - uid = ((User) conversation.getConversationWith()).getUid(); - type = CometChatConstants.RECEIVER_TYPE_USER; - } else { - uid = ((Group) conversation.getConversationWith()).getGuid(); - type = CometChatConstants.RECEIVER_TYPE_GROUP; - } - File file = MediaUtils.saveDriveFile( - CometChatForwardMessageActivity.this, - Uri.parse(mediaMessageUrl)); - message = new MediaMessage(uid, file, CometChatConstants.MESSAGE_TYPE_VIDEO, type); + Uri.parse(mediaMessageUrl), true); + if (messageType.equalsIgnoreCase(UIKitConstants.IntentStrings.INTENT_MEDIA_IMAGE_MESSAGE)) + message = new MediaMessage(uid, file, CometChatConstants.MESSAGE_TYPE_IMAGE, type); + else if (messageType.equalsIgnoreCase(UIKitConstants.IntentStrings.INTENT_MEDIA_VIDEO_MESSAGE)) + message = new MediaMessage(uid, file, CometChatConstants.MESSAGE_TYPE_VIDEO, type); + else if (messageType.equalsIgnoreCase(UIKitConstants.IntentStrings.INTENT_MEDIA_AUDIO_MESSAGE)) + message = new MediaMessage(uid, file, CometChatConstants.MESSAGE_TYPE_AUDIO, type); + else if (messageType.equalsIgnoreCase(UIKitConstants.IntentStrings.INTENT_MEDIA_FILE_MESSAGE)) + message = new MediaMessage(uid, file, CometChatConstants.MESSAGE_TYPE_FILE, type); try { JSONObject jsonObject = new JSONObject(); jsonObject.put("path", mediaMessageUrl); @@ -434,54 +439,47 @@ else if (messageType!=null && messageType.equalsIgnoreCase(UIKitConstants.Intent } catch (Exception e) { Log.e(TAG, "onError: " + e.getMessage()); } - sendMediaMessage(message); - if (i == userList.size() - 1) { - Intent intent = new Intent(CometChatForwardMessageActivity.this, CometChatUI.class); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); - startActivity(intent); - finish(); - } + sendMediaMessage(message,i,progressDialog); } - }).start(); - } - } else { - if (messageType!=null && messageType.equalsIgnoreCase(UIKitConstants.IntentStrings.LOCATION)) { - new Thread(() -> { - for (int i = 0; i <= userList.size() - 1; i++) { - Conversation conversation = new ArrayList<>(userList.values()).get(i); - CustomMessage message; - String uid; - JSONObject customData = new JSONObject(); - String type; - Log.e(TAG, "run: " + conversation.getConversationId()); - if (conversation.getConversationType().equals(CometChatConstants.CONVERSATION_TYPE_USER)) { - uid = ((User) conversation.getConversationWith()).getUid(); - type = CometChatConstants.RECEIVER_TYPE_USER; - } else { - uid = ((Group) conversation.getConversationWith()).getGuid(); - type = CometChatConstants.RECEIVER_TYPE_GROUP; - } - - try { - customData = new JSONObject(); - customData.put("latitude",lat); - customData.put("longitude",lon); - } catch (JSONException e) { - e.printStackTrace(); - } - message = new CustomMessage(uid,type, UIKitConstants.IntentStrings.LOCATION,customData); - - sendLocationMessage(message); - if (i == userList.size() - 1) { - Intent intent = new Intent(CometChatForwardMessageActivity.this, CometChatUI.class); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); - startActivity(intent); - finish(); + } else { + if (messageType != null && messageType.equalsIgnoreCase(UIKitConstants.IntentStrings.LOCATION)) { + new Thread(() -> { + for (int i = 0; i <= userList.size() - 1; i++) { + Conversation conversation = new ArrayList<>(userList.values()).get(i); + CustomMessage message; + String uid; + JSONObject customData = new JSONObject(); + String type; + Log.e(TAG, "run: " + conversation.getConversationId()); + if (conversation.getConversationType().equals(CometChatConstants.CONVERSATION_TYPE_USER)) { + uid = ((User) conversation.getConversationWith()).getUid(); + type = CometChatConstants.RECEIVER_TYPE_USER; + } else { + uid = ((Group) conversation.getConversationWith()).getGuid(); + type = CometChatConstants.RECEIVER_TYPE_GROUP; + } + + try { + customData = new JSONObject(); + customData.put("latitude", lat); + customData.put("longitude", lon); + } catch (JSONException e) { + e.printStackTrace(); + } + message = new CustomMessage(uid, type, UIKitConstants.IntentStrings.LOCATION, customData); + + sendLocationMessage(message); + if (i == userList.size() - 1) { + Intent intent = new Intent(CometChatForwardMessageActivity.this, CometChatUI.class); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); + startActivity(intent); + finish(); + } } - } - }).start(); + }).start(); + } } } } @@ -528,12 +526,20 @@ public void onError(CometChatException e) { }); } - public void sendMediaMessage(MediaMessage mediaMessage) + public void sendMediaMessage(MediaMessage mediaMessage,int i,ProgressDialog progressDialog) { CometChat.sendMediaMessage(mediaMessage, new CometChat.CallbackListener() { @Override public void onSuccess(MediaMessage mediaMessage) { - Log.d(TAG, "sendMediaMessage onSuccess: " + mediaMessage.toString()); + Log.e(TAG, "onSuccess: "+mediaMessage.getReceiverUid()); + if (i == userList.size() - 1) { + if (progressDialog!=null) + progressDialog.dismiss(); + Intent intent = new Intent(CometChatForwardMessageActivity.this,CometChatUI.class); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); + finish(); + startActivity(intent); + } } @Override diff --git a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/CometChatThreadMessageList.java b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/CometChatThreadMessageList.java index 7449a1b..8fdb819 100644 --- a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/CometChatThreadMessageList.java +++ b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/CometChatThreadMessageList.java @@ -1119,7 +1119,17 @@ public void onRequestPermissionsResult(int requestCode, @NonNull String[] permis showPermissionSnackBar(view.findViewById(R.id.message_box), getResources().getString(R.string.grant_storage_permission)); break; case UIKitConstants.RequestCode.LOCATION: - if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { } + if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { + initLocation(); +// locationManager = (LocationManager) Objects.requireNonNull(getContext()).getSystemService(Context.LOCATION_SERVICE); + boolean provider = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); + if (!provider) { + turnOnLocation(); + } + else { + getLocation(); + } + } else showPermissionSnackBar(view.findViewById(R.id.message_box), getResources().getString(R.string.grant_location_permission)); break; diff --git a/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/constants/UIKitConstants.java b/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/constants/UIKitConstants.java index b8a2b2f..1390caa 100644 --- a/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/constants/UIKitConstants.java +++ b/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/constants/UIKitConstants.java @@ -131,9 +131,14 @@ public static class IntentStrings { public static final String INTENT_MEDIA_VIDEO_MESSAGE = "intent_media_video_message"; + public static final String INTENT_MEDIA_AUDIO_MESSAGE = "intent_media_audio_message"; + + public static final String INTENT_MEDIA_FILE_MESSAGE = "intent_media_file_message"; + public static final String LINK = "link"; public static final String IS_TITLE_VISIBLE = "IS_TITLE_VISIBLE"; + public static final String CREATE_GROUP_VISIBLE = "IS_CREATE_GROUP_VISIBLE"; public static String POLL_QUESTION = "poll_question"; diff --git a/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/utils/MediaUtils.java b/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/utils/MediaUtils.java index 7403332..87bddd0 100644 --- a/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/utils/MediaUtils.java +++ b/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/utils/MediaUtils.java @@ -1,6 +1,5 @@ package com.cometchat.pro.uikit.ui_resources.utils; -import android.annotation.SuppressLint; import android.app.Activity; import android.app.ProgressDialog; import android.content.ComponentName; @@ -33,7 +32,6 @@ import android.widget.Toast; import androidx.core.content.FileProvider; -import androidx.loader.content.CursorLoader; import com.cometchat.pro.models.BaseMessage; import com.cometchat.pro.models.MediaMessage; @@ -41,7 +39,6 @@ import com.cometchat.pro.uikit.R; import com.cometchat.pro.uikit.ui_settings.FeatureRestriction; -import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.ByteArrayOutputStream; import java.io.File; @@ -161,7 +158,7 @@ public static Intent openCamera(Context context) { e.printStackTrace(); } - outputFileUri = FileProvider.getUriForFile(context, provider + ".provider", file); + outputFileUri = FileProvider.getUriForFile(context, provider + ".provider", file); if (Build.VERSION.SDK_INT >= 29) { ContentResolver resolver = context.getContentResolver(); @@ -310,14 +307,21 @@ private static File createFileFromBitmap(Bitmap bitmap) { return f; } + public static File makeEmptyFileWithTitle(String title) { + String root; + if (Build.VERSION.SDK_INT < 29) { + root = Environment.getExternalStorageDirectory().getAbsolutePath(); + } else { + root = Environment.DIRECTORY_DOWNLOADS; + } + return new File(root, title); + } + public static File getRealPath(Context context, Uri fileUri,boolean isThirdParty) { Log.d("", "getRealPath: " + fileUri.getPath()); String realPath; - if (isGoogleDrive(fileUri)) { - return saveDriveFile(context, fileUri); - } - else if (isThirdParty) { - return downloadImage(context, fileUri); + if (isGoogleDrive(fileUri) || isThirdParty) { + return downloadFile(context, fileUri); } // SDK > 19 (Android 4.4) and up else if (Build.VERSION.SDK_INT < 28){ @@ -330,12 +334,12 @@ else if (Build.VERSION.SDK_INT < 28){ return new File(realPath); } - public static File downloadImage(Context context, Uri imageUri) { + public static File downloadFile(Context context, Uri imageUri) { // Uri imageUri = (Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM); File file = null; try { if (imageUri != null) { - file = new File(context.getCacheDir(), "image"); + file = new File(context.getCacheDir(), getFileName(context,imageUri)); InputStream inputStream = context.getContentResolver().openInputStream(imageUri); try { @@ -402,43 +406,38 @@ private static String getFilePathForN(Uri uri, Context context) { return file.getPath(); } - public static File saveDriveFile(Context context, Uri uri) { - - try { - - InputStream inputStream = context.getContentResolver().openInputStream(uri); - int originalSize = inputStream.available(); - - BufferedInputStream bis = null; - BufferedOutputStream bos = null; - String fileName = getFileName(context, uri); - File file = makeEmptyFileWithTitle(fileName); - bis = new BufferedInputStream(inputStream); - bos = new BufferedOutputStream(new FileOutputStream( - file, false)); - - byte[] buf = new byte[originalSize]; - bis.read(buf); - do { - bos.write(buf); - } while (bis.read(buf) != -1); - - bos.flush(); - bos.close(); - bis.close(); - - return file; - - } catch (IOException e) { - return null; - } - - } - - public static File makeEmptyFileWithTitle(String title) { - String root = Environment.getExternalStorageDirectory().getAbsolutePath(); - return new File(root, title); - } +// public static File saveDriveFile(Context context, Uri uri) { +// +// try { +// +// InputStream inputStream = context.getContentResolver().openInputStream(uri); +// int originalSize = inputStream.available(); +// +// BufferedInputStream bis = null; +// BufferedOutputStream bos = null; +// String fileName = getFileName(context, uri); +// File file = makeEmptyFileWithTitle(fileName); +// bis = new BufferedInputStream(inputStream); +// bos = new BufferedOutputStream(new FileOutputStream( +// file, false)); +// +// byte[] buf = new byte[originalSize]; +// bis.read(buf); +// do { +// bos.write(buf); +// } while (bis.read(buf) != -1); +// +// bos.flush(); +// bos.close(); +// bis.close(); +// +// return file; +// +// } catch (IOException e) { +// return null; +// } +// +// } /** @@ -470,15 +469,15 @@ private static String getRealPathFromURI(final Context context, final Uri uri) { // DownloadsProvider else if (isDownloadsDocument(uri)) { - String id = DocumentsContract.getDocumentId(uri); + String id = DocumentsContract.getDocumentId(uri); if (id != null){ - if(id.startsWith("raw:")) { - return id.substring(4); - } - if (id.startsWith("msf:")){ - id=id.substring(4); - } + if(id.startsWith("raw:")) { + return id.substring(4); + } + if (id.startsWith("msf:")){ + id=id.substring(4); + } } String[] contentUriPrefixesToTry = new String[]{ diff --git a/uikit/src/main/res-components/messages/layout/fragment_cometchat_thread_message.xml b/uikit/src/main/res-components/messages/layout/fragment_cometchat_thread_message.xml index 9052b36..91f2e1d 100644 --- a/uikit/src/main/res-components/messages/layout/fragment_cometchat_thread_message.xml +++ b/uikit/src/main/res-components/messages/layout/fragment_cometchat_thread_message.xml @@ -161,9 +161,7 @@ @@ -253,18 +248,15 @@ android:id="@+id/writeboard_vw" android:visibility="gone" android:layout_marginStart="10dp" - android:layout_toEndOf="@+id/iv_user" - android:layout_below="@+id/iv_user" - android:background="@drawable/cc_message_bubble_left" + android:background="@drawable/cc_message_bubble_right" android:orientation="vertical" android:layout_width="250dp" android:layout_height="wrap_content"> Search Users Search Groups Allow Background Location Permisssion + Message Forwarded Successfully