Skip to content

Commit 88fcb37

Browse files
author
yadavmangesh
committed
UI with SDK v2
1 parent 7f61fb8 commit 88fcb37

26 files changed

+582
-175
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: "[SDK-Version] Issue Title "
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Actual behavior**
24+
A clear and concise description of what you exactly is happening.
25+
26+
**Screenshots** (optional)
27+
If applicable, add screenshots to help explain your problem.
28+
29+
**Enviorment/Platfrom (please complete the following information):**
30+
- Android API Version[ e.g 21 ]
31+
- CometChat SDK Version[ e.g. 1.8.3]
32+
33+
**Files (Optional)**
34+
- `build.gradle` (App Level)
35+
- `build.gradle` (Project Level)
36+
37+
**Logs (Error Logs)**
38+
- Error Log
39+
- Debug Log
40+
41+
**Additional context**
42+
Add any other context about the problem here.

app/build.gradle

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ dependencies {
5252
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
5353
implementation 'com.android.support:design:28.0.0'
5454
implementation 'com.android.support:support-v4:28.0.0'
55-
implementation 'com.android.support:recyclerview-v7:28.0.0'
55+
implementation 'com.android.support:recyclerview-v7:28.0.0'
5656
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
5757
implementation 'com.android.support:cardview-v7:28.0.0'
5858
implementation 'com.android.support:support-emoji-appcompat:28.0.0'
@@ -61,17 +61,14 @@ dependencies {
6161
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
6262

6363
//cometchat sdk
64-
implementation 'com.cometchat:pro-android-chat-sdk:1.8.5'
64+
implementation 'com.cometchat:pro-android-chat-sdk:2.0.0-beta2'
6565

6666
implementation 'com.android.support:recyclerview-selection:28.0.0'
6767

6868
implementation 'com.facebook.shimmer:shimmer:0.4.0'
69-
7069
}
7170

7271
repositories {
7372
mavenCentral()
7473

7574
}
76-
77-

app/src/androidTest/java/com/inscripts/cometchatpulse/demo/ExampleInstrumentedTest.java

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import android.support.test.runner.AndroidJUnitRunner;
77
import android.util.Log;
88
import com.cometchat.pro.constants.CometChatConstants;
9+
import com.cometchat.pro.core.AppSettings;
910
import com.cometchat.pro.core.BannedGroupMembersRequest;
1011
import com.cometchat.pro.core.BlockedUsersRequest;
1112
import com.cometchat.pro.core.CometChat;
@@ -64,8 +65,8 @@ public class ExampleInstrumentedTest {
6465
@Test
6566
public void init() {
6667
CountDownLatch countDownLatch = new CountDownLatch(1);
67-
68-
CometChat.init(appContext, StringContract.AppDetails.API_KEY, new CometChat.CallbackListener<String>() {
68+
AppSettings appSettings=new AppSettings.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion("us").build();
69+
CometChat.init(appContext, StringContract.AppDetails.API_KEY,appSettings, new CometChat.CallbackListener<String>() {
6970
@Override
7071
public void onSuccess(String s) {
7172
Log.d(TAG, "init onSuccess: " + s);
@@ -188,7 +189,7 @@ public void sendTextMessage() {
188189

189190
CountDownLatch countDownLatch = new CountDownLatch(1);
190191

191-
TextMessage textMessage = new TextMessage("superhero1", "Hello",CometChatConstants.MESSAGE_TYPE_TEXT, CometChatConstants.RECEIVER_TYPE_USER);
192+
TextMessage textMessage = new TextMessage("superhero1", "Hello", CometChatConstants.RECEIVER_TYPE_USER);
192193

193194
CometChat.sendMessage(textMessage, new CometChat.CallbackListener<TextMessage>() {
194195
@Override
@@ -222,7 +223,7 @@ public void sendMessageWithInvalidUID() {
222223

223224
CountDownLatch countDownLatch = new CountDownLatch(1);
224225

225-
TextMessage textMessage = new TextMessage("", "hello",CometChatConstants.MESSAGE_TYPE_TEXT, CometChatConstants.RECEIVER_TYPE_USER);
226+
TextMessage textMessage = new TextMessage("", "hello", CometChatConstants.RECEIVER_TYPE_USER);
226227

227228
CometChat.sendMessage(textMessage, new CometChat.CallbackListener<TextMessage>() {
228229
@Override
@@ -253,7 +254,7 @@ public void onError(CometChatException e) {
253254
public void sendTextMessageWithImageType() {
254255
CountDownLatch countDownLatch = new CountDownLatch(1);
255256

256-
TextMessage textMessage = new TextMessage(UID, "Hello",CometChatConstants.MESSAGE_TYPE_TEXT, CometChatConstants.RECEIVER_TYPE_USER);
257+
TextMessage textMessage = new TextMessage(UID, "Hello", CometChatConstants.RECEIVER_TYPE_USER);
257258

258259
CometChat.sendMessage(textMessage, new CometChat.CallbackListener<TextMessage>() {
259260
@Override
@@ -284,7 +285,7 @@ public void sendTextMessageWithNullText() {
284285
CountDownLatch countDownLatch = new CountDownLatch(1);
285286

286287

287-
TextMessage textMessage = new TextMessage(UID, null, CometChatConstants.MESSAGE_TYPE_TEXT, CometChatConstants.RECEIVER_TYPE_USER);
288+
TextMessage textMessage = new TextMessage(UID, null, CometChatConstants.RECEIVER_TYPE_USER);
288289

289290
CometChat.sendMessage(textMessage, new CometChat.CallbackListener<TextMessage>() {
290291
@Override
@@ -316,7 +317,7 @@ public void sendTextMessageWithInvalidPara() {
316317
CountDownLatch countDownLatch = new CountDownLatch(1);
317318

318319

319-
TextMessage textMessage = new TextMessage(UID, null,CometChatConstants.MESSAGE_TYPE_TEXT,CometChatConstants.CATEGORY_MESSAGE);
320+
TextMessage textMessage = new TextMessage(UID, null,CometChatConstants.CATEGORY_MESSAGE);
320321

321322
CometChat.sendMessage(textMessage, new CometChat.CallbackListener<TextMessage>() {
322323
@Override
@@ -348,7 +349,7 @@ public void onError(CometChatException e) {
348349
public void sendTextMessageWithGroupType() {
349350
CountDownLatch countDownLatch = new CountDownLatch(1);
350351

351-
TextMessage textMessage = new TextMessage(UID, "Hello", CometChatConstants.MESSAGE_TYPE_TEXT,CometChatConstants.RECEIVER_TYPE_GROUP);
352+
TextMessage textMessage = new TextMessage(UID, "Hello",CometChatConstants.RECEIVER_TYPE_GROUP);
352353

353354
CometChat.sendMessage(textMessage, new CometChat.CallbackListener<TextMessage>() {
354355
@Override
@@ -378,7 +379,7 @@ public void sendTextMessageInvalidTypeAndEmptyMessage() {
378379

379380
CountDownLatch countDownLatch = new CountDownLatch(1);
380381

381-
TextMessage textMessage = new TextMessage(UID, "",CometChatConstants.MESSAGE_TYPE_TEXT, CometChatConstants.RECEIVER_TYPE_GROUP);
382+
TextMessage textMessage = new TextMessage(UID, "", CometChatConstants.RECEIVER_TYPE_GROUP);
382383

383384
CometChat.sendMessage(textMessage, new CometChat.CallbackListener<TextMessage>() {
384385
@Override
@@ -612,7 +613,7 @@ public void sendTextMessageWithNullPara() {
612613
// customData.put("lattitue","19.0760");
613614
// customData.put("longitude","72.8777");
614615

615-
TextMessage textMessage = new TextMessage(null, null, CometChatConstants.MESSAGE_TYPE_TEXT,null);
616+
TextMessage textMessage = new TextMessage(null, null, null);
616617

617618
CometChat.sendMessage(textMessage, new CometChat.CallbackListener<TextMessage>() {
618619
@Override
@@ -685,7 +686,7 @@ public void sendTextMessageWithNullMessageAndReceiverType() {
685686

686687
CountDownLatch countDownLatch = new CountDownLatch(1);
687688

688-
TextMessage textMessage = new TextMessage(UID, "Hello", CometChatConstants.MESSAGE_TYPE_TEXT,null);
689+
TextMessage textMessage = new TextMessage(UID, "Hello", null);
689690

690691
CometChat.sendMessage(textMessage, new CometChat.CallbackListener<TextMessage>() {
691692
@Override
@@ -719,7 +720,7 @@ public void sendTextMessageWithMetaData() {
719720
try {
720721
CountDownLatch countDownLatch = new CountDownLatch(1);
721722

722-
TextMessage textMessage = new TextMessage(UID, "Hello",CometChatConstants.MESSAGE_TYPE_TEXT, CometChatConstants.RECEIVER_TYPE_USER);
723+
TextMessage textMessage = new TextMessage(UID, "Hello", CometChatConstants.RECEIVER_TYPE_USER);
723724

724725
JSONObject customData = new JSONObject();
725726
customData.put("lattitue", "19.0760");
@@ -759,7 +760,7 @@ public void sendTextMessageWithNullMetaData() {
759760
try {
760761
CountDownLatch countDownLatch = new CountDownLatch(1);
761762

762-
TextMessage textMessage = new TextMessage(UID, "Hello",CometChatConstants.MESSAGE_TYPE_TEXT, CometChatConstants.RECEIVER_TYPE_USER);
763+
TextMessage textMessage = new TextMessage(UID, "Hello", CometChatConstants.RECEIVER_TYPE_USER);
763764

764765
textMessage.setMetadata(null);
765766

@@ -795,7 +796,7 @@ public void sendTextMessageWithMetaGroupType() {
795796
try {
796797
CountDownLatch countDownLatch = new CountDownLatch(1);
797798

798-
TextMessage textMessage = new TextMessage(GUID, "Hello", CometChatConstants.MESSAGE_TYPE_TEXT,CometChatConstants.RECEIVER_TYPE_GROUP);
799+
TextMessage textMessage = new TextMessage(GUID, "Hello",CometChatConstants.RECEIVER_TYPE_GROUP);
799800

800801
JSONObject customData = new JSONObject();
801802

@@ -837,7 +838,7 @@ public void sendTextMessageWithMetaAndMUID() {
837838
try {
838839
CountDownLatch countDownLatch = new CountDownLatch(1);
839840

840-
TextMessage textMessage = new TextMessage(GUID, "Hello",CometChatConstants.MESSAGE_TYPE_TEXT, CometChatConstants.RECEIVER_TYPE_GROUP);
841+
TextMessage textMessage = new TextMessage(GUID, "Hello", CometChatConstants.RECEIVER_TYPE_GROUP);
841842

842843
JSONObject customData = new JSONObject();
843844

@@ -1176,7 +1177,7 @@ public void sendEditMessage(){
11761177
try {
11771178
CountDownLatch countDownLatch = new CountDownLatch(1);
11781179

1179-
TextMessage message = new TextMessage(UID, "text",CometChatConstants.MESSAGE_TYPE_TEXT, CometChatConstants.RECEIVER_TYPE_USER);
1180+
TextMessage message = new TextMessage(UID, "text", CometChatConstants.RECEIVER_TYPE_USER);
11801181
message.setId(MESSAGE_ID);
11811182

11821183
CometChat.editMessage(message, new CometChat.CallbackListener<BaseMessage>() {
@@ -1210,7 +1211,7 @@ public void sendEditTextMessageWithImageType(){
12101211
try {
12111212
CountDownLatch countDownLatch = new CountDownLatch(1);
12121213

1213-
TextMessage message = new TextMessage(UID, "Hey", CometChatConstants.MESSAGE_TYPE_TEXT, CometChatConstants.RECEIVER_TYPE_USER);
1214+
TextMessage message = new TextMessage(UID, "Hey", CometChatConstants.RECEIVER_TYPE_USER);
12141215
message.setId(398);
12151216

12161217
CometChat.editMessage(message, new CometChat.CallbackListener<BaseMessage>() {
@@ -1245,7 +1246,7 @@ public void sendEditMessageWithTypeGroup(){
12451246
try {
12461247
CountDownLatch countDownLatch = new CountDownLatch(1);
12471248

1248-
TextMessage message = new TextMessage(UID, "Edit text Message ", CometChatConstants.MESSAGE_TYPE_TEXT,CometChatConstants.RECEIVER_TYPE_GROUP);
1249+
TextMessage message = new TextMessage(UID, "Edit text Message ", CometChatConstants.RECEIVER_TYPE_GROUP);
12491250
message.setId(489);
12501251

12511252
CometChat.editMessage(message, new CometChat.CallbackListener<BaseMessage>() {
@@ -1280,7 +1281,7 @@ public void sendEditMessageWithNull(){
12801281
try {
12811282
CountDownLatch countDownLatch = new CountDownLatch(1);
12821283

1283-
TextMessage message = new TextMessage(UID, null,CometChatConstants.MESSAGE_TYPE_TEXT, CometChatConstants.RECEIVER_TYPE_USER);
1284+
TextMessage message = new TextMessage(UID, null, CometChatConstants.RECEIVER_TYPE_USER);
12841285
message.setId(489);
12851286

12861287
CometChat.editMessage(message, new CometChat.CallbackListener<BaseMessage>() {
@@ -1315,7 +1316,7 @@ public void sendEditMessageWithWrongId(){
13151316
try {
13161317
CountDownLatch countDownLatch = new CountDownLatch(1);
13171318

1318-
TextMessage message = new TextMessage(UID, "h",CometChatConstants.MESSAGE_TYPE_TEXT,CometChatConstants.RECEIVER_TYPE_USER);
1319+
TextMessage message = new TextMessage(UID, "h",CometChatConstants.RECEIVER_TYPE_USER);
13191320
message.setId(48);
13201321

13211322
CometChat.editMessage(message, new CometChat.CallbackListener<BaseMessage>() {
@@ -1352,7 +1353,7 @@ public void sendEditMessageWithEmpty(){
13521353
try {
13531354
CountDownLatch countDownLatch = new CountDownLatch(1);
13541355

1355-
TextMessage message = new TextMessage(UID, "", CometChatConstants.MESSAGE_TYPE_TEXT,CometChatConstants.RECEIVER_TYPE_USER);
1356+
TextMessage message = new TextMessage(UID, "",CometChatConstants.RECEIVER_TYPE_USER);
13561357
message.setId(489);
13571358

13581359
CometChat.editMessage(message, new CometChat.CallbackListener<BaseMessage>() {
@@ -3535,7 +3536,7 @@ public void test_GroupMemberRequestWithZeroLimit(){
35353536
@Override
35363537
public void onSuccess(List<GroupMember> groupMembers) {
35373538
Log.d(TAG, "test_GroupMemberRequestWithZeroLimit onSuccess: "+groupMembers.size());
3538-
assertEquals(3,groupMembers.size());
3539+
assertEquals(5,groupMembers.size());
35393540
countDownLatch.countDown();
35403541
}
35413542

app/src/main/AndroidManifest.xml

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,52 +3,33 @@
33
xmlns:tools="http://schemas.android.com/tools"
44
package="com.inscripts.cometchatpulse.demo">
55

6-
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
7-
<uses-permission android:name="android.permission.INTERNET" />
8-
<uses-permission android:name="android.permission.CAMERA" />
9-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
10-
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
11-
<uses-permission android:name="android.permission.RECORD_AUDIO" />
12-
<uses-permission android:name="android.permission.VIBRATE" />
13-
14-
<uses-feature android:name="android.hardware.camera.autofocus" />
15-
<uses-feature
16-
android:name="android.hardware.camera"
17-
android:required="true" />
18-
196
<application
207
android:name=".CometApplication"
218
android:allowBackup="false"
229
android:hardwareAccelerated="true"
2310
android:icon="@mipmap/cc_small"
2411
android:label="@string/app_name"
12+
android:largeHeap="true"
2513
android:roundIcon="@mipmap/cc_small"
2614
android:supportsRtl="true"
2715
android:theme="@style/AppTheme"
2816
android:usesCleartextTraffic="true"
29-
android:largeHeap="true"
3017
tools:ignore="GoogleAppIndexingWarning"
3118
tools:replace="android:allowBackup">
32-
33-
34-
<!--<provider-->
35-
<!--android:name="com.google.firebase.provider.FirebaseInitProvider"-->
36-
<!--android:authorities="${applicationId}.firebaseinitprovider"-->
37-
<!--tools:node="remove"-->
38-
<!--/>-->
39-
40-
41-
<activity android:name=".Activity.BlockedUserListActivity"></activity>
42-
19+
<activity android:name=".Activity.MessageInfoActivity"></activity>
20+
<!-- <provider -->
21+
<!-- android:name="com.google.firebase.provider.FirebaseInitProvider" -->
22+
<!-- android:authorities="${applicationId}.firebaseinitprovider" -->
23+
<!-- tools:node="remove" -->
24+
<!-- /> -->
25+
<activity android:name=".Activity.BlockedUserListActivity" />
4326
<activity
4427
android:name=".Activity.CometChatActivity"
4528
android:launchMode="singleTop"
46-
android:screenOrientation="portrait" >
47-
29+
android:screenOrientation="portrait">
4830
<intent-filter>
49-
<action android:name="android.intent.action.SEARCH"/>
31+
<action android:name="android.intent.action.SEARCH" />
5032
</intent-filter>
51-
5233
</activity>
5334
<activity
5435
android:name=".Activity.OneToOneChatActivity"
@@ -85,5 +66,18 @@
8566
<activity android:name=".Activity.CallActivity" />
8667
<activity android:name=".Activity.SelectUserActivity" />
8768
</application>
69+
<uses-feature android:name="android.hardware.camera.autofocus" />
70+
<uses-feature
71+
android:name="android.hardware.camera"
72+
android:required="true" />
73+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
74+
<uses-permission android:name="android.permission.INTERNET" />
75+
<uses-permission android:name="android.permission.CAMERA" />
76+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
77+
78+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
79+
<uses-permission android:name="android.permission.RECORD_AUDIO" />
80+
81+
<uses-permission android:name="android.permission.VIBRATE" />
8882

8983
</manifest>

app/src/main/java/com/inscripts/cometchatpulse/demo/Activity/CometChatActivity.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -133,20 +133,6 @@ public void onPageScrollStateChanged(int i) {
133133
@Override
134134
protected void onStart() {
135135
super.onStart();
136-
137-
CometChat.addGroupListener(TAG, new CometChat.GroupListener() {
138-
@Override
139-
public void onMemberAddedToGroup(Action action, User addedby, User userAdded, Group addedTo) {
140-
super.onMemberAddedToGroup(action, addedby, userAdded, addedTo);
141-
Log.d(TAG, "onMemberAddedToGroup: "+"action \n"+action+" \n addedby "+addedby+ " \n userAdded "+userAdded + " \n addedTo "+addedTo);
142-
}
143-
144-
@Override
145-
public void onAddedToGroup(Action action, User addedby, User userAdded, Group addedTo) {
146-
super.onAddedToGroup(action, addedby, userAdded, addedTo);
147-
Log.d(TAG, "onAddedToGroup: "+"action \n"+action+" \n addedby "+addedby+ " \n userAdded "+userAdded + " \n addedTo "+addedTo);
148-
}
149-
});
150136
}
151137

152138
@Override

0 commit comments

Comments
 (0)