Skip to content

Commit

Permalink
Android UI Kit v2.1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
darshanbhanushali committed Feb 9, 2021
1 parent d5c3f60 commit 8f8ddea
Show file tree
Hide file tree
Showing 276 changed files with 3,147 additions and 3,928 deletions.
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,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:2.1.7-beta3'
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand All @@ -15,16 +14,13 @@
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;

import com.cometchat.pro.androiduikit.ColorPickerDialog;
import com.cometchat.pro.androiduikit.R;
import com.cometchat.pro.core.CometChat;
import com.cometchat.pro.uikit.Avatar;
import com.cometchat.pro.uikit.ui_components.shared.cometchatAvatar.CometChatAvatar;
import com.google.android.material.textfield.TextInputEditText;
import com.google.android.material.textfield.TextInputLayout;

import java.util.Random;

import utils.Utils;
import com.cometchat.pro.uikit.ui_resources.utils.Utils;

public class AvatarFragment extends Fragment {

Expand All @@ -46,7 +42,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_avatar, container, false);
Avatar avatar = view.findViewById(R.id.avataricon);
CometChatAvatar avatar = view.findViewById(R.id.avataricon);
avatar.setBorderColor(getResources().getColor(R.color.colorPrimaryDark));
avatar.setAvatar(CometChat.getLoggedInUser().getAvatar());
TextInputEditText borderWidth = view.findViewById(R.id.borderWidth);
Expand Down Expand Up @@ -148,7 +144,7 @@ public void onAttach(@NonNull Context context) {
super.onAttach(context);
this.context = context;
}
public void refreshAvatar(Avatar avatar)
public void refreshAvatar(CometChatAvatar avatar)
{
avatar.setAvatar(CometChat.getLoggedInUser());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,15 @@
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RadioGroup;
import android.widget.Toast;

import androidx.fragment.app.Fragment;

import com.cometchat.pro.androiduikit.R;
import com.cometchat.pro.uikit.BadgeCount;
import com.cometchat.pro.uikit.StatusIndicator;
import com.cometchat.pro.uikit.ui_components.shared.cometchatBadgeCount.CometChatBadgeCount;
import com.google.android.material.textfield.TextInputEditText;
import com.google.android.material.textfield.TextInputLayout;

import utils.Utils;
import com.cometchat.pro.uikit.ui_resources.utils.Utils;

public class BadgeCountFragment extends Fragment {

Expand All @@ -35,7 +32,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_badge_count, container, false);
BadgeCount badgeCount = view.findViewById(R.id.badgeCount);
CometChatBadgeCount badgeCount = view.findViewById(R.id.badgeCount);
badgeCountLayout = view.findViewById(R.id.badgeCount_layout);
badgeCountSizeLayout = view.findViewById(R.id.badgeCountSize_layout);
badgeCountEdt = view.findViewById(R.id.badgeCount_edt);
Expand Down Expand Up @@ -192,7 +189,7 @@ private void checkDarkMode() {
}
}

private void refreshbadgeCount(BadgeCount badgeCount) {
private void refreshbadgeCount(CometChatBadgeCount badgeCount) {
badgeCount.setCount(count);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,29 @@
import androidx.recyclerview.widget.RecyclerView;

import com.cometchat.pro.androiduikit.R;
import com.cometchat.pro.constants.CometChatConstants;
import com.cometchat.pro.core.Call;
import com.cometchat.pro.core.CometChat;
import com.cometchat.pro.core.MessagesRequest;
import com.cometchat.pro.exceptions.CometChatException;
import com.cometchat.pro.models.BaseMessage;
import com.cometchat.pro.models.Group;
import com.cometchat.pro.models.User;
import com.cometchat.pro.uikit.CometChatCallList;
import com.cometchat.pro.uikit.ui_components.shared.cometchatCalls.CometChatCalls;
import com.facebook.shimmer.ShimmerFrameLayout;
import com.google.android.material.snackbar.Snackbar;

import java.util.Collections;
import java.util.List;

import constant.StringContract;
import listeners.OnItemClickListener;
import screen.CometChatGroupDetailScreenActivity;
import screen.CometChatUserDetailScreenActivity;
import screen.messagelist.CometChatMessageListActivity;
import utils.CallUtils;
import utils.Utils;
import com.cometchat.pro.uikit.ui_resources.constants.UIKitConstants;
import com.cometchat.pro.uikit.ui_resources.utils.item_clickListener.OnItemClickListener;
import com.cometchat.pro.uikit.ui_components.groups.group_details.CometChatGroupDetailActivity;
import com.cometchat.pro.uikit.ui_components.users.user_details.CometChatUserDetailScreenActivity;
import com.cometchat.pro.uikit.ui_resources.utils.CallUtils;

public class CallListViewFragment extends Fragment {

private CometChatCallList rvCallList;
private CometChatCalls rvCallList;

private LinearLayout noCallView;

Expand All @@ -61,7 +58,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
rvCallList.setItemClickListener(new OnItemClickListener<Call>() {
@Override
public void OnItemClick(Call var, int position) {
if (var.getReceiverType().equals(CometChatConstants.RECEIVER_TYPE_USER)) {
if (var.getReceiverType().equals(com.cometchat.pro.constants.CometChatConstants.RECEIVER_TYPE_USER)) {
User user;
if (var.getSender().getUid().equals(CometChat.getLoggedInUser().getUid())) {
user = ((User)var.getCallReceiver());
Expand All @@ -71,27 +68,27 @@ public void OnItemClick(Call var, int position) {
user = var.getSender();
}
Intent intent = new Intent(getContext(), CometChatUserDetailScreenActivity.class);
intent.putExtra(StringContract.IntentStrings.UID, user.getUid());
intent.putExtra(StringContract.IntentStrings.NAME, user.getName());
intent.putExtra(StringContract.IntentStrings.AVATAR, user.getAvatar());
intent.putExtra(StringContract.IntentStrings.STATUS, user.getStatus());
intent.putExtra(StringContract.IntentStrings.IS_BLOCKED_BY_ME, user.isBlockedByMe());
intent.putExtra(StringContract.IntentStrings.FROM_CALL_LIST,true);
intent.putExtra(UIKitConstants.IntentStrings.UID, user.getUid());
intent.putExtra(UIKitConstants.IntentStrings.NAME, user.getName());
intent.putExtra(UIKitConstants.IntentStrings.AVATAR, user.getAvatar());
intent.putExtra(UIKitConstants.IntentStrings.STATUS, user.getStatus());
intent.putExtra(UIKitConstants.IntentStrings.IS_BLOCKED_BY_ME, user.isBlockedByMe());
intent.putExtra(UIKitConstants.IntentStrings.FROM_CALL_LIST,true);
startActivity(intent);
}
else {
Group group;
group = ((Group)var.getCallReceiver());
Intent intent = new Intent(getContext(), CometChatGroupDetailScreenActivity.class);
intent.putExtra(StringContract.IntentStrings.GUID, group.getGuid());
intent.putExtra(StringContract.IntentStrings.NAME, group.getName());
intent.putExtra(StringContract.IntentStrings.AVATAR, group.getIcon());
intent.putExtra(StringContract.IntentStrings.MEMBER_SCOPE, group.getScope());
intent.putExtra(StringContract.IntentStrings.MEMBER_COUNT,group.getMembersCount());
intent.putExtra(StringContract.IntentStrings.GROUP_OWNER, group.getOwner());
intent.putExtra(StringContract.IntentStrings.GROUP_DESC,group.getDescription());
intent.putExtra(StringContract.IntentStrings.GROUP_PASSWORD,group.getPassword());
intent.putExtra(StringContract.IntentStrings.GROUP_TYPE,group.getGroupType());
Intent intent = new Intent(getContext(), CometChatGroupDetailActivity.class);
intent.putExtra(UIKitConstants.IntentStrings.GUID, group.getGuid());
intent.putExtra(UIKitConstants.IntentStrings.NAME, group.getName());
intent.putExtra(UIKitConstants.IntentStrings.AVATAR, group.getIcon());
intent.putExtra(UIKitConstants.IntentStrings.MEMBER_SCOPE, group.getScope());
intent.putExtra(UIKitConstants.IntentStrings.MEMBER_COUNT,group.getMembersCount());
intent.putExtra(UIKitConstants.IntentStrings.GROUP_OWNER, group.getOwner());
intent.putExtra(UIKitConstants.IntentStrings.GROUP_DESC,group.getDescription());
intent.putExtra(UIKitConstants.IntentStrings.GROUP_PASSWORD,group.getPassword());
intent.putExtra(UIKitConstants.IntentStrings.GROUP_TYPE,group.getGroupType());
startActivity(intent);
}
}
Expand All @@ -103,16 +100,16 @@ public void OnItemClick(Call var, int position) {
@Override
public void onSuccess(Call call) {
Log.e( "onSuccess: ",call.toString());
if (var.getReceiverType().equals(CometChatConstants.RECEIVER_TYPE_USER)) {
if (var.getReceiverType().equals(com.cometchat.pro.constants.CometChatConstants.RECEIVER_TYPE_USER)) {
User user;
if (var.getSender().getUid().equals(CometChat.getLoggedInUser().getUid())) {
user = ((User) var.getCallReceiver());
} else {
user = var.getSender();
}
CallUtils.startCallIntent(getContext(), user, CometChatConstants.CALL_TYPE_AUDIO, true, call.getSessionId());
CallUtils.startCallIntent(getContext(), user, com.cometchat.pro.constants.CometChatConstants.CALL_TYPE_AUDIO, true, call.getSessionId());
} else
CallUtils.startGroupCallIntent(getContext(),((Group)call.getCallReceiver()),CometChatConstants.CALL_TYPE_AUDIO,true,call.getSessionId());
CallUtils.startGroupCallIntent(getContext(),((Group)call.getCallReceiver()), com.cometchat.pro.constants.CometChatConstants.CALL_TYPE_AUDIO,true,call.getSessionId());
}

@Override
Expand Down Expand Up @@ -141,7 +138,7 @@ public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newStat
private void getCallList() {
if (messagesRequest == null)
{
messagesRequest = new MessagesRequest.MessagesRequestBuilder().setCategory(CometChatConstants.CATEGORY_CALL).setLimit(30).build();
messagesRequest = new MessagesRequest.MessagesRequestBuilder().setCategory(com.cometchat.pro.constants.CometChatConstants.CATEGORY_CALL).setLimit(30).build();
}

messagesRequest.fetchPrevious(new CometChat.CallbackListener<List<BaseMessage>>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

import com.cometchat.pro.androiduikit.R;
import com.cometchat.pro.androiduikit.databinding.FragmentConversationListBinding;
import com.cometchat.pro.constants.CometChatConstants;
import com.cometchat.pro.core.CometChat;
import com.cometchat.pro.core.ConversationsRequest;
import com.cometchat.pro.exceptions.CometChatException;
Expand All @@ -23,9 +22,9 @@

import java.util.List;

import constant.StringContract;
import listeners.OnItemClickListener;
import screen.messagelist.CometChatMessageListActivity;
import com.cometchat.pro.uikit.ui_resources.constants.UIKitConstants;
import com.cometchat.pro.uikit.ui_resources.utils.item_clickListener.OnItemClickListener;
import com.cometchat.pro.uikit.ui_components.messages.message_list.CometChatMessageListActivity;

public class ConversationListViewFragment extends Fragment {

Expand All @@ -49,24 +48,24 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
@Override
public void OnItemClick(Conversation conversation, int position) {
Intent intent = new Intent(getContext(), CometChatMessageListActivity.class);
intent.putExtra(StringContract.IntentStrings.TYPE,conversation.getConversationType());
if (conversation.getConversationType().equals(CometChatConstants.CONVERSATION_TYPE_GROUP))
intent.putExtra(UIKitConstants.IntentStrings.TYPE,conversation.getConversationType());
if (conversation.getConversationType().equals(com.cometchat.pro.constants.CometChatConstants.CONVERSATION_TYPE_GROUP))
{
intent.putExtra(StringContract.IntentStrings.NAME,((Group)conversation.getConversationWith()).getName());
intent.putExtra(StringContract.IntentStrings.GUID,((Group)conversation.getConversationWith()).getGuid());
intent.putExtra(StringContract.IntentStrings.GROUP_OWNER,((Group)conversation.getConversationWith()).getOwner());
intent.putExtra(StringContract.IntentStrings.AVATAR,((Group)conversation.getConversationWith()).getIcon());
intent.putExtra(StringContract.IntentStrings.GROUP_TYPE,((Group)conversation.getConversationWith()).getGroupType());
intent.putExtra(StringContract.IntentStrings.MEMBER_COUNT,((Group)conversation.getConversationWith()).getMembersCount());
intent.putExtra(StringContract.IntentStrings.GROUP_DESC,((Group)conversation.getConversationWith()).getDescription());
intent.putExtra(StringContract.IntentStrings.GROUP_PASSWORD,((Group)conversation.getConversationWith()).getPassword());
intent.putExtra(UIKitConstants.IntentStrings.NAME,((Group)conversation.getConversationWith()).getName());
intent.putExtra(UIKitConstants.IntentStrings.GUID,((Group)conversation.getConversationWith()).getGuid());
intent.putExtra(UIKitConstants.IntentStrings.GROUP_OWNER,((Group)conversation.getConversationWith()).getOwner());
intent.putExtra(UIKitConstants.IntentStrings.AVATAR,((Group)conversation.getConversationWith()).getIcon());
intent.putExtra(UIKitConstants.IntentStrings.GROUP_TYPE,((Group)conversation.getConversationWith()).getGroupType());
intent.putExtra(UIKitConstants.IntentStrings.MEMBER_COUNT,((Group)conversation.getConversationWith()).getMembersCount());
intent.putExtra(UIKitConstants.IntentStrings.GROUP_DESC,((Group)conversation.getConversationWith()).getDescription());
intent.putExtra(UIKitConstants.IntentStrings.GROUP_PASSWORD,((Group)conversation.getConversationWith()).getPassword());
}
else
{
intent.putExtra(StringContract.IntentStrings.NAME,((User)conversation.getConversationWith()).getName());
intent.putExtra(StringContract.IntentStrings.UID,((User)conversation.getConversationWith()).getUid());
intent.putExtra(StringContract.IntentStrings.AVATAR,((User)conversation.getConversationWith()).getAvatar());
intent.putExtra(StringContract.IntentStrings.STATUS,((User)conversation.getConversationWith()).getStatus());
intent.putExtra(UIKitConstants.IntentStrings.NAME,((User)conversation.getConversationWith()).getName());
intent.putExtra(UIKitConstants.IntentStrings.UID,((User)conversation.getConversationWith()).getUid());
intent.putExtra(UIKitConstants.IntentStrings.AVATAR,((User)conversation.getConversationWith()).getAvatar());
intent.putExtra(UIKitConstants.IntentStrings.STATUS,((User)conversation.getConversationWith()).getStatus());
}
startActivity(intent);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@

import com.cometchat.pro.androiduikit.R;
import com.cometchat.pro.androiduikit.databinding.FragmentGroupListBinding;
import com.cometchat.pro.constants.CometChatConstants;
import com.cometchat.pro.core.CometChat;
import com.cometchat.pro.core.GroupsRequest;
import com.cometchat.pro.exceptions.CometChatException;
import com.cometchat.pro.models.Group;

import java.util.List;

import constant.StringContract;
import listeners.OnItemClickListener;
import screen.messagelist.CometChatMessageListActivity;
import com.cometchat.pro.uikit.ui_resources.constants.UIKitConstants;
import com.cometchat.pro.uikit.ui_resources.utils.item_clickListener.OnItemClickListener;
import com.cometchat.pro.uikit.ui_components.messages.message_list.CometChatMessageListActivity;

public class GroupListViewFragment extends Fragment {

Expand All @@ -41,15 +40,15 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
@Override
public void OnItemClick(Group group, int position) {
Intent intent = new Intent(getContext(), CometChatMessageListActivity.class);
intent.putExtra(StringContract.IntentStrings.NAME,group.getName());
intent.putExtra(StringContract.IntentStrings.GROUP_OWNER,group.getOwner());
intent.putExtra(StringContract.IntentStrings.GUID,group.getGuid());
intent.putExtra(StringContract.IntentStrings.AVATAR,group.getIcon());
intent.putExtra(StringContract.IntentStrings.GROUP_TYPE,group.getGroupType());
intent.putExtra(StringContract.IntentStrings.TYPE,CometChatConstants.RECEIVER_TYPE_GROUP);
intent.putExtra(StringContract.IntentStrings.MEMBER_COUNT,group.getMembersCount());
intent.putExtra(StringContract.IntentStrings.GROUP_DESC,group.getDescription());
intent.putExtra(StringContract.IntentStrings.GROUP_PASSWORD,group.getPassword());
intent.putExtra(UIKitConstants.IntentStrings.NAME,group.getName());
intent.putExtra(UIKitConstants.IntentStrings.GROUP_OWNER,group.getOwner());
intent.putExtra(UIKitConstants.IntentStrings.GUID,group.getGuid());
intent.putExtra(UIKitConstants.IntentStrings.AVATAR,group.getIcon());
intent.putExtra(UIKitConstants.IntentStrings.GROUP_TYPE,group.getGroupType());
intent.putExtra(UIKitConstants.IntentStrings.TYPE, com.cometchat.pro.constants.CometChatConstants.RECEIVER_TYPE_GROUP);
intent.putExtra(UIKitConstants.IntentStrings.MEMBER_COUNT,group.getMembersCount());
intent.putExtra(UIKitConstants.IntentStrings.GROUP_DESC,group.getDescription());
intent.putExtra(UIKitConstants.IntentStrings.GROUP_PASSWORD,group.getPassword());
startActivity(intent);
}

Expand Down
Loading

0 comments on commit 8f8ddea

Please sign in to comment.