Skip to content

Commit f60e736

Browse files
committed
v5.0.0-beta2
1 parent 110a107 commit f60e736

File tree

247 files changed

+9708
-7191
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

247 files changed

+9708
-7191
lines changed

README.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,6 @@ experience into an existing or a new app.
1515
<img src="screenshots/overview_cometchat_screens.png">
1616
</div>
1717

18-
## 🚀 Explore the Sample Apps!
19-
20-
Dive straight into our Sample Apps to see CometChat UI Kit in action! Whether you're building a messaging app or enhancing your existing project, this sample app showcases the full potential of our React UI components.
21-
- [Sample App for Java](sample-app-java#readme)
22-
- [Sample App for Java with Push Notifications](sample-app-java%2Bpush-notification#readme)
23-
- [Sample App for Kotlin](sample-app-kotlin#readme)
24-
- [Sample App for Kotlin with Push Notifications](sample-app-kotlin%2Bpush-notification#readme)
25-
2618
## Prerequisites
2719

2820
- Android Studio
@@ -38,12 +30,12 @@ To set up CometChat Android UI Kit and utilize CometChat for your chat functiona
3830
2. After registering, log into your CometChat account and create a new app. Once created, CometChat will generate an Auth Key and App ID for you. Keep
3931
these credentials secure as you'll need them later.
4032

41-
3. Check the [Key Concepts](https://www.cometchat.com/docs/fundamentals/key-concepts) to understand the basic components of CometChat.
33+
3. Check the [Key Concepts](https://www.cometchat.com/docs/android-uikit/key-concepts) to understand the basic components of CometChat.
4234

43-
4. Refer to the [Integration Steps](https://www.cometchat.com/docs/ui-kit/android/5.0/getting-started) in our documentation to integrate the UI Kit into your
35+
4. Refer to the [Integration Steps](https://www.cometchat.com/docs/android-uikit/integration) in our documentation to integrate the UI Kit into your
4436
Android app.
4537

4638
## Help and Support
4739

48-
For issues running the project or integrating with our UI Kits, consult our [documentation](https://www.cometchat.com/docs/ui-kit/android/5.0/getting-started)
40+
For issues running the project or integrating with our UI Kits, consult our [documentation](https://www.cometchat.com/docs/android-uikit/integration)
4941
or create a [support ticket](https://help.cometchat.com/hc/en-us) or seek real-time support via the [CometChat Dashboard](https://app.cometchat.com/).

chatuikit/build.gradle

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ android {
1010
defaultConfig {
1111
minSdk 24
1212
versionCode 26
13-
versionName "5.0.0-beta1"
13+
versionName "5.0.0-beta2"
1414
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1515
consumerProguardFiles "consumer-rules.pro"
1616

@@ -97,20 +97,11 @@ android {
9797

9898
publishing {
9999
repositories {
100-
101-
// maven {
102-
// url = "$projectDir/distribution"
103-
// }
104-
105100
maven {
106-
name = "cloudsmith"
107-
url = "https://api-g.cloudsmith.io/maven/cometchat/call-team"
108-
credentials {
109-
username = "jitvar-patil"
110-
password = "d412ed679432a059fa33c31e324e223c7b1ed200"
111-
}
101+
url = "$projectDir/distribution"
112102
}
113103
}
104+
114105
publications {
115106
maven(MavenPublication) {
116107
groupId 'com.cometchat'

chatuikit/src/main/java/com/cometchat/chatuikit/calls/CallingExtensionDecorator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
import com.cometchat.chatuikit.shared.models.CometChatMessageTemplate;
3737
import com.cometchat.chatuikit.shared.resources.utils.Utils;
3838
import com.cometchat.chatuikit.shared.viewholders.MessagesViewHolderListener;
39-
import com.cometchat.chatuikit.shared.views.cometchatmessagebubble.CometChatMessageBubble;
4039
import com.cometchat.chatuikit.shared.views.deletebubble.CometChatDeleteBubble;
40+
import com.cometchat.chatuikit.shared.views.messagebubble.CometChatMessageBubble;
4141

4242
import java.util.List;
4343

chatuikit/src/main/java/com/cometchat/chatuikit/calls/calllogs/CallLogsAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import com.cometchat.chatuikit.shared.interfaces.CallLogsClickListener;
2626
import com.cometchat.chatuikit.shared.interfaces.Function2;
2727
import com.cometchat.chatuikit.shared.resources.utils.Utils;
28-
import com.cometchat.chatuikit.shared.views.cometchatdate.CometChatDate;
28+
import com.cometchat.chatuikit.shared.views.date.CometChatDate;
2929

3030
import java.util.ArrayList;
3131
import java.util.HashMap;

chatuikit/src/main/java/com/cometchat/chatuikit/calls/utils/CallTailView.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
import com.cometchat.chatuikit.R;
1313
import com.cometchat.chatuikit.shared.interfaces.OnClick;
14-
import com.cometchat.chatuikit.shared.views.cometchatdate.CometChatDate;
14+
import com.cometchat.chatuikit.shared.views.date.CometChatDate;
1515
import com.google.android.material.card.MaterialCardView;
1616

1717
public class CallTailView extends MaterialCardView {
@@ -25,16 +25,6 @@ public CallTailView(Context context) {
2525
init(context);
2626
}
2727

28-
public CallTailView(Context context, AttributeSet attrs) {
29-
super(context, attrs);
30-
init(context);
31-
}
32-
33-
public CallTailView(Context context, AttributeSet attrs, int defStyleAttr) {
34-
super(context, attrs, defStyleAttr);
35-
init(context);
36-
}
37-
3828
private void init(Context context) {
3929
setStrokeWidth(0);
4030
View view = View.inflate(context, R.layout.cometchat_call_tail_view, null);
@@ -50,6 +40,16 @@ public void onClick(View view) {
5040
addView(view);
5141
}
5242

43+
public CallTailView(Context context, AttributeSet attrs) {
44+
super(context, attrs);
45+
init(context);
46+
}
47+
48+
public CallTailView(Context context, AttributeSet attrs, int defStyleAttr) {
49+
super(context, attrs, defStyleAttr);
50+
init(context);
51+
}
52+
5353
public CometChatDate getChatDate() {
5454
return chatDate;
5555
}

chatuikit/src/main/java/com/cometchat/chatuikit/conversations/ConversationsAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import com.cometchat.chatuikit.shared.utils.ConversationsUtils;
3131
import com.cometchat.chatuikit.shared.utils.SubtitleView;
3232
import com.cometchat.chatuikit.shared.viewholders.ConversationsViewHolderListener;
33-
import com.cometchat.chatuikit.shared.views.cometchatstatusindicator.StatusIndicator;
33+
import com.cometchat.chatuikit.shared.views.statusindicator.StatusIndicator;
3434

3535
import java.util.ArrayList;
3636
import java.util.HashMap;

chatuikit/src/main/java/com/cometchat/chatuikit/extensions/collaborative/document/CollaborativeDocumentExtensionDecorator.java

Lines changed: 107 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import com.cometchat.chatuikit.shared.models.CometChatMessageTemplate;
3232
import com.cometchat.chatuikit.shared.resources.utils.Utils;
3333
import com.cometchat.chatuikit.shared.viewholders.MessagesViewHolderListener;
34-
import com.cometchat.chatuikit.shared.views.cometchatmessagebubble.CometChatMessageBubble;
34+
import com.cometchat.chatuikit.shared.views.messagebubble.CometChatMessageBubble;
3535

3636
import java.util.HashMap;
3737
import java.util.List;
@@ -50,23 +50,6 @@ public CollaborativeDocumentExtensionDecorator(DataSource dataSource, Collaborat
5050
this.configuration = configuration;
5151
}
5252

53-
@Override
54-
public List<String> getDefaultMessageTypes() {
55-
List<String> types = super.getDefaultMessageTypes();
56-
if (!types.contains(collaborativeDocumentExtensionTypeConstant)) {
57-
types.add(collaborativeDocumentExtensionTypeConstant);
58-
}
59-
return types;
60-
}
61-
62-
@Override
63-
public List<String> getDefaultMessageCategories() {
64-
List<String> categories = super.getDefaultMessageCategories();
65-
if (!categories.contains(UIKitConstants.MessageCategory.CUSTOM))
66-
categories.add(UIKitConstants.MessageCategory.CUSTOM);
67-
return categories;
68-
}
69-
7053
@Override
7154
public List<CometChatMessageTemplate> getMessageTemplates(AdditionParameter additionParameter) {
7255
List<CometChatMessageTemplate> templates = super.getMessageTemplates(additionParameter);
@@ -75,61 +58,62 @@ public List<CometChatMessageTemplate> getMessageTemplates(AdditionParameter addi
7558
}
7659

7760
@Override
78-
public List<CometChatMessageComposerAction> getAttachmentOptions(Context context, @Nullable User user, Group group, HashMap<String, String> idMap) {
61+
public List<CometChatMessageComposerAction> getAttachmentOptions(Context context,
62+
@Nullable User user,
63+
Group group,
64+
HashMap<String, String> idMap) {
7965
if (!idMap.containsKey(UIKitConstants.MapId.PARENT_MESSAGE_ID)) {
8066
List<CometChatMessageComposerAction> messageComposerActions = super.getAttachmentOptions(context, user, group, idMap);
81-
messageComposerActions.add(new CometChatMessageComposerAction().setId(ExtensionConstants.ExtensionType.DOCUMENT).setTitle(context.getString(R.string.cometchat_collaborative_doc)).setIcon(R.drawable.cometchat_ic_collaborative_document).setTitleColor(CometChatTheme.getTextColorPrimary(context)).setTitleAppearance(CometChatTheme.getTextAppearanceBodyRegular(context)).setIconTintColor(CometChatTheme.getIconTintHighlight(context)).setBackground(CometChatTheme.getBackgroundColor1(context)).setOnClick(() -> {
82-
String id, type;
83-
id = user != null ? user.getUid() : group.getGuid();
84-
type = user != null ? UIKitConstants.ReceiverType.USER : UIKitConstants.ReceiverType.GROUP;
85-
Extensions.callWriteBoardExtension(id, type, new ExtensionResponseListener() {
86-
@Override
87-
public void OnResponseSuccess(Object var) {
88-
}
89-
90-
@Override
91-
public void OnResponseFailed(CometChatException e) {
92-
showError(context);
93-
}
94-
});
95-
}));
67+
messageComposerActions.add(new CometChatMessageComposerAction()
68+
.setId(ExtensionConstants.ExtensionType.DOCUMENT)
69+
.setTitle(context.getString(R.string.cometchat_collaborative_doc))
70+
.setIcon(R.drawable.cometchat_ic_collaborative_document)
71+
.setTitleColor(CometChatTheme.getTextColorPrimary(context))
72+
.setTitleAppearance(CometChatTheme.getTextAppearanceBodyRegular(context))
73+
.setIconTintColor(CometChatTheme.getIconTintHighlight(context))
74+
.setBackground(CometChatTheme.getBackgroundColor1(context))
75+
.setOnClick(() -> {
76+
String id, type;
77+
id = user != null ? user.getUid() : group.getGuid();
78+
type = user != null ? UIKitConstants.ReceiverType.USER : UIKitConstants.ReceiverType.GROUP;
79+
Extensions.callWriteBoardExtension(id, type, new ExtensionResponseListener() {
80+
@Override
81+
public void OnResponseSuccess(Object var) {
82+
}
83+
84+
@Override
85+
public void OnResponseFailed(CometChatException e) {
86+
showError(context);
87+
}
88+
});
89+
}));
9690
return messageComposerActions;
9791
} else return super.getAttachmentOptions(context, user, group, idMap);
9892
}
9993

100-
private void showError(Context context) {
101-
String errorMessage = context.getString(R.string.cometchat_something_went_wrong);
102-
Toast.makeText(context, errorMessage, Toast.LENGTH_SHORT).show();
94+
@Override
95+
public List<String> getDefaultMessageTypes() {
96+
List<String> types = super.getDefaultMessageTypes();
97+
if (!types.contains(collaborativeDocumentExtensionTypeConstant)) {
98+
types.add(collaborativeDocumentExtensionTypeConstant);
99+
}
100+
return types;
103101
}
104102

105-
public CometChatMessageTemplate getWhiteBoardTemplate(AdditionParameter additionParameter) {
106-
return new CometChatMessageTemplate().setCategory(UIKitConstants.MessageCategory.CUSTOM).setType(collaborativeDocumentExtensionTypeConstant).setOptions((context, baseMessage, isLeftAlign) -> ChatConfigurator.getDataSource().getCommonOptions(context, baseMessage, isLeftAlign)).setContentView(new MessagesViewHolderListener() {
107-
@NonNull
108-
@Override
109-
public View createView(Context context, CometChatMessageBubble messageBubble, UIKitConstants.MessageBubbleAlignment alignment) {
110-
return CollaborativeUtils.getCollaborativeBubbleView(context, configuration, "Collaborative Document", "Open document to edit content together.", "Open Document");
111-
}
112-
113-
@Override
114-
public void bindView(Context context, View createdView, @NonNull BaseMessage message, UIKitConstants.MessageBubbleAlignment alignment, RecyclerView.ViewHolder holder, List<BaseMessage> messageList, int position) {
115-
CollaborativeUtils.bindWriteBordCollaborativeBubble(context, createdView, CometChatUIKit.getLoggedInUser().getUid().equals(message.getSender().getUid()) ? additionParameter.getOutgoingCollaborativeBubbleStyle() : additionParameter.getIncomingCollaborativeBubbleStyle(), message, additionParameter);
116-
}
117-
}).setBottomView(new MessagesViewHolderListener() {
118-
@Override
119-
public View createView(Context context, CometChatMessageBubble messageBubble, UIKitConstants.MessageBubbleAlignment alignment) {
120-
return CometChatUIKit.getDataSource().getBottomView(context, messageBubble, alignment);
121-
}
122-
123-
@Override
124-
public void bindView(Context context, View createdView, BaseMessage message, UIKitConstants.MessageBubbleAlignment alignment, RecyclerView.ViewHolder holder, List<BaseMessage> messageList, int position) {
125-
CometChatUIKit.getDataSource().bindBottomView(context, createdView, message, alignment, holder, messageList, position, additionParameter);
126-
}
127-
});
103+
@Override
104+
public List<String> getDefaultMessageCategories() {
105+
List<String> categories = super.getDefaultMessageCategories();
106+
if (!categories.contains(UIKitConstants.MessageCategory.CUSTOM))
107+
categories.add(UIKitConstants.MessageCategory.CUSTOM);
108+
return categories;
128109
}
129110

130111
@Override
131112
public SpannableString getLastConversationMessage(Context context, Conversation conversation, AdditionParameter additionParameter) {
132-
if (conversation != null && conversation.getLastMessage() != null && (UIKitConstants.MessageCategory.CUSTOM.equals(conversation.getLastMessage().getCategory()) && ExtensionConstants.ExtensionType.DOCUMENT.equalsIgnoreCase(conversation.getLastMessage().getType())))
113+
if (conversation != null && conversation.getLastMessage() != null && (UIKitConstants.MessageCategory.CUSTOM.equals(conversation
114+
.getLastMessage()
115+
.getCategory()) && ExtensionConstants.ExtensionType.DOCUMENT.equalsIgnoreCase(
116+
conversation.getLastMessage().getType())))
133117
return SpannableString.valueOf(getLastConversationMessage_(context, conversation, additionParameter));
134118
else return super.getLastConversationMessage(context, conversation, additionParameter);
135119
}
@@ -157,6 +141,68 @@ public String getLastMessage(Context context, BaseMessage lastMessage) {
157141
return Utils.getMessagePrefix(lastMessage, context) + context.getString(R.string.cometchat_document);
158142
}
159143

144+
private void showError(Context context) {
145+
String errorMessage = context.getString(R.string.cometchat_something_went_wrong);
146+
Toast.makeText(context, errorMessage, Toast.LENGTH_SHORT).show();
147+
}
148+
149+
public CometChatMessageTemplate getWhiteBoardTemplate(AdditionParameter additionParameter) {
150+
return new CometChatMessageTemplate()
151+
.setCategory(UIKitConstants.MessageCategory.CUSTOM)
152+
.setType(collaborativeDocumentExtensionTypeConstant)
153+
.setOptions((context, baseMessage, isLeftAlign) -> ChatConfigurator.getDataSource().getCommonOptions(context, baseMessage, isLeftAlign))
154+
.setContentView(new MessagesViewHolderListener() {
155+
@NonNull
156+
@Override
157+
public View createView(Context context, CometChatMessageBubble messageBubble, UIKitConstants.MessageBubbleAlignment alignment) {
158+
return CollaborativeUtils.getCollaborativeBubbleView(context,
159+
configuration,
160+
"Collaborative Document",
161+
"Open document to edit content together.",
162+
"Open Document");
163+
}
164+
165+
@Override
166+
public void bindView(Context context,
167+
View createdView,
168+
@NonNull BaseMessage message,
169+
UIKitConstants.MessageBubbleAlignment alignment,
170+
RecyclerView.ViewHolder holder,
171+
List<BaseMessage> messageList,
172+
int position) {
173+
CollaborativeUtils.bindWriteBordCollaborativeBubble(context,
174+
createdView,
175+
CometChatUIKit
176+
.getLoggedInUser()
177+
.getUid()
178+
.equals(message
179+
.getSender()
180+
.getUid()) ? additionParameter.getOutgoingCollaborativeBubbleStyle() : additionParameter.getIncomingCollaborativeBubbleStyle(),
181+
message,
182+
additionParameter);
183+
}
184+
})
185+
.setBottomView(new MessagesViewHolderListener() {
186+
@Override
187+
public View createView(Context context, CometChatMessageBubble messageBubble, UIKitConstants.MessageBubbleAlignment alignment) {
188+
return CometChatUIKit.getDataSource().getBottomView(context, messageBubble, alignment);
189+
}
190+
191+
@Override
192+
public void bindView(Context context,
193+
View createdView,
194+
BaseMessage message,
195+
UIKitConstants.MessageBubbleAlignment alignment,
196+
RecyclerView.ViewHolder holder,
197+
List<BaseMessage> messageList,
198+
int position) {
199+
CometChatUIKit
200+
.getDataSource()
201+
.bindBottomView(context, createdView, message, alignment, holder, messageList, position, additionParameter);
202+
}
203+
});
204+
}
205+
160206
@Override
161207
public String getId() {
162208
return CollaborativeDocumentExtensionDecorator.class.getSimpleName();

0 commit comments

Comments
 (0)