Skip to content

Commit

Permalink
Android UI Kit v3.0.1-1
Browse files Browse the repository at this point in the history
  • Loading branch information
darshanbhanushali committed Sep 8, 2021
1 parent aa93551 commit f2b403e
Show file tree
Hide file tree
Showing 7 changed files with 367 additions and 13 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<img src="https://img.shields.io/badge/Repo%20Size-18.6%20MB-blue" />
![GitHub contributors](https://img.shields.io/github/contributors/cometchat-pro/android-java-chat-app)
![GitHub stars](https://img.shields.io/github/stars/cometchat-pro/android-java-chat-app?style=social)
![Version](https://shields.io/badge/version-v3.0.0--2-orange)
![Version](https://shields.io/badge/version-v3.0.1--1-orange)
![Twitter Follow](https://img.shields.io/twitter/follow/cometchat?style=social)

<img src="https://files.readme.io/952af91-UI_Kit__1.png"/>
Expand All @@ -27,7 +27,7 @@ CometChat Kitchen Sink Sample App (built using CometChat UIKit) is a fully funct
Before you begin, ensure you have met the following requirements:<br/>
&nbsp; You have `Android Studio` installed in your machine.<br/>
&nbsp; You have a `Android Device or Emulator` with Android Version 6.0 or above.<br/>
&nbsp; You have read [CometChat Key Concepts](https://prodocs.cometchat.com/v3.0-beta/docs/concepts).<br/>
&nbsp; You have read [CometChat Key Concepts](https://prodocs.cometchat.com/docs/concepts).<br/>

<hr/>

Expand Down Expand Up @@ -62,7 +62,7 @@ Learn more about how to integrate [UI Kit](https://github.com/cometchat-pro/andr

## Troubleshooting

- To read the full documentation on UI Kit integration visit our [Documentation](https://prodocs.cometchat.com/v3.0-beta/docs/android-ui-kit) .
- To read the full documentation on UI Kit integration visit our [Documentation](https://prodocs.cometchat.com/docs/android-ui-kit) .

- Facing any issues while integrating or installing the UI Kit please <a href="https://app.cometchat.io/"> connect with us via real time support present in CometChat Dashboard.</a>.

Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ dependencies {
implementation 'com.google.android.material:material:1.2.0-alpha05'
implementation 'com.facebook.shimmer:shimmer:0.4.0'

implementation 'com.cometchat:pro-android-chat-sdk:3.0.0'
implementation 'com.cometchat:pro-android-chat-sdk:3.0.1'
implementation 'com.cometchat:pro-android-calls-sdk:2.1.0'

}
4 changes: 2 additions & 2 deletions uikit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ android {
compileSdkVersion 30

defaultConfig {
minSdkVersion 24
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
Expand Down Expand Up @@ -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:3.0.0'
compileOnly 'com.cometchat:pro-android-chat-sdk:3.0.1'
compileOnly 'com.cometchat:pro-android-calls-sdk:2.1.0'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.0'
}
1 change: 0 additions & 1 deletion uikit/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

<queries>
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -104,6 +106,8 @@ public class CometChatForwardMessageActivity extends AppCompatActivity {

private int mediaMessageSize;

private ProgressDialog progressDialog;

private int id;
@Override
protected void onCreate(Bundle savedInstanceState) {
Expand Down Expand Up @@ -327,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(() -> {
Expand Down Expand Up @@ -382,7 +388,7 @@ public void onClick(View view) {
attachment.setFileName(mediaMessageName);
message.setAttachment(attachment);
Log.e(TAG, "onClick: " + attachment.toString());
sendMediaMessage(message,i);
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);
Expand Down Expand Up @@ -433,7 +439,7 @@ else if (messageType.equalsIgnoreCase(UIKitConstants.IntentStrings.INTENT_MEDIA_
} catch (Exception e) {
Log.e(TAG, "onError: " + e.getMessage());
}
sendMediaMessage(message,i);
sendMediaMessage(message,i,progressDialog);
}
}).start();
} else {
Expand Down Expand Up @@ -520,16 +526,18 @@ public void onError(CometChatException e) {
});
}

public void sendMediaMessage(MediaMessage mediaMessage,int i)
public void sendMediaMessage(MediaMessage mediaMessage,int i,ProgressDialog progressDialog)
{
CometChat.sendMediaMessage(mediaMessage, new CometChat.CallbackListener<MediaMessage>() {
@Override
public void onSuccess(MediaMessage mediaMessage) {
Log.e(TAG, "onSuccess: "+mediaMessage.getReceiverUid());
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);
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);
startActivity(intent);
finish();
}
}

Expand Down
Loading

0 comments on commit f2b403e

Please sign in to comment.