Skip to content

Commit

Permalink
Android UI Kit v2.3.5-1
Browse files Browse the repository at this point in the history
  • Loading branch information
darshanbhanushali committed Jun 16, 2021
1 parent fb26085 commit 027e117
Show file tree
Hide file tree
Showing 117 changed files with 738 additions and 2,907 deletions.
2 changes: 1 addition & 1 deletion 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-v2.3.4--1-orange)
![Version](https://shields.io/badge/version-v2.3.5--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 Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@ dependencies {
implementation 'com.facebook.shimmer:shimmer:0.4.0'

//
implementation 'com.cometchat:pro-android-chat-sdk:2.3.4'
implementation 'com.cometchat:pro-android-chat-sdk:2.3.5'
}
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public void onSuccess(List<BaseMessage> baseMessages) {
public void onError(CometChatException e) {
Log.e( "onError: ",e.getMessage() );
if (rvCallList!=null)
Snackbar.make(rvCallList, com.cometchat.pro.uikit.R.string.call_list_error,Snackbar.LENGTH_LONG).show();
Snackbar.make(rvCallList, R.string.err_default_message,Snackbar.LENGTH_LONG).show();
}
});
}
Expand Down
3 changes: 1 addition & 2 deletions uikit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ 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.3.4'

compileOnly 'com.cometchat:pro-android-chat-sdk:2.3.5'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ protected void onCreate(Bundle savedInstanceState) {
.setSessionId(sessionID)
.build();

CometChatError.init(this);
Log.e( "startCallActivity: ",sessionID+" "+type);
CometChat.startCall(callSettings, new CometChat.OngoingCallListener() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,26 +148,20 @@ private void setGroupClickListener() {
CometChatGroupList.setItemClickListener(new OnItemClickListener<Group>() {
@Override
public void OnItemClick(Group g, int position) {
FeatureRestriction.isGroupChatEnabled(new FeatureRestriction.OnSuccessListener() {
@Override
public void onSuccess(Boolean booleanVal) {
group = g;
if (group.isJoined()) {
startGroupIntent(group);
} else {
if (group.getGroupType().equals(CometChatConstants.GROUP_TYPE_PASSWORD)) {
View dialogview = getLayoutInflater().inflate(R.layout.cc_dialog, null);
TextView tvTitle = dialogview.findViewById(R.id.textViewDialogueTitle);
tvTitle.setText(String.format(getResources().getString(R.string.enter_password_to_join),group.getName()));
new CustomAlertDialogHelper(CometChatUI.this, getResources().getString(R.string.password), dialogview, getResources().getString(R.string.join),
"", getResources().getString(R.string.cancel), CometChatUI.this, 1, false);
} else if (group.getGroupType().equals(CometChatConstants.GROUP_TYPE_PUBLIC)) {
joinGroup(group);
}
}

group = g;
if (group.isJoined()) {
startGroupIntent(group);
} else {
if (group.getGroupType().equals(CometChatConstants.GROUP_TYPE_PASSWORD)) {
View dialogview = getLayoutInflater().inflate(R.layout.cc_dialog, null);
TextView tvTitle = dialogview.findViewById(R.id.textViewDialogueTitle);
tvTitle.setText(String.format(getResources().getString(R.string.enter_password_to_join),group.getName()));
new CustomAlertDialogHelper(CometChatUI.this, getResources().getString(R.string.password), dialogview, getResources().getString(R.string.join),
"", getResources().getString(R.string.cancel), CometChatUI.this, 1, false);
} else if (group.getGroupType().equals(CometChatConstants.GROUP_TYPE_PUBLIC)) {
joinGroup(group);
}
});
}
}
});
}
Expand All @@ -176,13 +170,7 @@ private void setUserClickListener() {
CometChatUserList.setItemClickListener(new OnItemClickListener<User>() {
@Override
public void OnItemClick(User user, int position) {
FeatureRestriction.isOneOnOneChatEnabled(new FeatureRestriction.OnSuccessListener() {
@Override
public void onSuccess(Boolean booleanVal) {
if (booleanVal)
startUserIntent(user);
}
});
startUserIntent(user);
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ public class CometChatMessageActions extends BottomSheetDialogFragment {
private TextView shareMessage;
private TextView translateMessage;
private TextView retryMessage;
private TextView replyMessagePrivately;

private TextView messagePrivately;

private String userName;
private String userAvatar;

private LinearLayout reactionsList;
Expand All @@ -64,6 +64,7 @@ public class CometChatMessageActions extends BottomSheetDialogFragment {
private boolean isDeleteVisible;
private boolean isForwardVisible;
private boolean isReplyVisible;
private boolean isReplyPrivatelyVisible;
private boolean isMessageInfoVisible;
private boolean isReactionsVisible;
private boolean isTranslateVisible;
Expand All @@ -89,6 +90,7 @@ private void fetchArguments() {
isEditVisible = getArguments().getBoolean("editVisible");
isDeleteVisible = getArguments().getBoolean("deleteVisible");
isReplyVisible = getArguments().getBoolean("replyVisible");
isReplyPrivatelyVisible = getArguments().getBoolean("replyPrivatelyVisible");
isForwardVisible = getArguments().getBoolean("forwardVisible");
isShareVisible = getArguments().getBoolean("shareVisible");
isMessageInfoVisible = getArguments().getBoolean("messageInfoVisible");
Expand Down Expand Up @@ -117,22 +119,6 @@ public void onGlobalLayout() {
}
});

messagePrivately = view.findViewById(R.id.reply_privately);

if ((userName!=null && userName.isEmpty())
|| (userAvatar!=null && userAvatar.isEmpty()))
messagePrivately.setVisibility(View.GONE);
else {
if (isPrivateReplyVisible)
messagePrivately.setVisibility(View.VISIBLE);
else
messagePrivately.setVisibility(View.GONE);
}

messagePrivately.setOnClickListener(v-> {
messageActionListener.onPrivateReplyToUser();
dismiss();
});
reactionsList = view.findViewById(R.id.initial_reactions);
List<Reaction> reactions = Extensions.getInitialReactions(INITIAL_REACTION_COUNT);
for(Reaction reaction : reactions) {
Expand Down Expand Up @@ -184,6 +170,19 @@ public void onClick(View view) {
shareMessage = view.findViewById(R.id.share_message);
messageInfo = view.findViewById(R.id.message_info);

messagePrivately = view.findViewById(R.id.reply_privately);
replyMessagePrivately = view.findViewById(R.id.reply_message_privately);

if (isPrivateReplyVisible)
messagePrivately.setVisibility(View.VISIBLE);
else
messagePrivately.setVisibility(View.GONE);

if (isReplyPrivatelyVisible)
replyMessagePrivately.setVisibility(View.VISIBLE);
else
replyMessagePrivately.setVisibility(View.GONE);

if (isPrivateReplyVisible)
messagePrivately.setVisibility(View.VISIBLE);
else
Expand Down Expand Up @@ -236,10 +235,23 @@ public void onClick(View view) {
messageInfo.setVisibility(View.VISIBLE);
else
messageInfo.setVisibility(View.GONE);

if (type!=null && type.equals(CometChatThreadMessageListActivity.class.getName())) {
threadMessage.setVisibility(View.GONE);
}

replyMessagePrivately.setOnClickListener(v-> {
if (messageActionListener!=null)
messageActionListener.onReplyMessagePrivately();
dismiss();
});
messagePrivately.setOnClickListener(v-> {
if (messageActionListener!=null) {
messageActionListener.onPrivateReplyToUser();
dismiss();
}
});

retryMessage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Expand Down Expand Up @@ -346,6 +358,8 @@ public interface MessageActionListener {
void onTranslateMessageClick();
void onRetryClick();
void onPrivateReplyToUser();

void onReplyMessagePrivately();
}

@Override
Expand Down
Loading

0 comments on commit 027e117

Please sign in to comment.