diff --git a/README.md b/README.md index 5f9cdef..ae0cdf4 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ The UI Kit is developed to keep developers in mind and aims to reduce developmen [![Platform](https://img.shields.io/badge/Language-Java-yellowgreen.svg)](#) ![GitHub contributors](https://img.shields.io/github/contributors/cometchat-pro/android-java-chat-ui-kit) -![Version](https://shields.io/badge/version-v2.3.5--2-orange) +![Version](https://shields.io/badge/version-v2.4.0--1-orange) ![GitHub stars](https://img.shields.io/github/stars/cometchat-pro/android-java-chat-ui-kit?style=social) ![Twitter Follow](https://img.shields.io/twitter/follow/cometchat?style=social) @@ -71,7 +71,12 @@ allprojects { ```groovy dependencies { - implementation 'com.cometchat:pro-android-chat-sdk:2.3.5' + implementation 'com.cometchat:pro-android-chat-sdk:2.4.0' + + /** From v2.4+ onwards, Voice & Video Calling functionality has been + moved to a separate library. In case you plan to use the calling + feature, please add the Calling dependency.**/ + implementation 'com.cometchat:pro-android-calls-sdk:2.1.0' } ``` diff --git a/uikit/build.gradle b/uikit/build.gradle index d8e3982..b839ce3 100644 --- a/uikit/build.gradle +++ b/uikit/build.gradle @@ -90,6 +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:2.3.5' + compileOnly 'com.cometchat:pro-android-chat-sdk:2.4.0' + compileOnly 'com.cometchat:pro-android-calls-sdk:2.1.0' implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.0' } diff --git a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_list/CometChatCallList.java b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_list/CometChatCallList.java index 4fbffaa..09bc78e 100644 --- a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_list/CometChatCallList.java +++ b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_list/CometChatCallList.java @@ -21,6 +21,7 @@ import com.cometchat.pro.uikit.R; import com.cometchat.pro.uikit.ui_components.shared.cometchatCalls.CometChatCalls; import com.cometchat.pro.uikit.ui_resources.utils.CometChatError; +import com.cometchat.pro.uikit.ui_settings.UIKitSettings; import com.facebook.shimmer.ShimmerFrameLayout; import com.google.android.material.tabs.TabLayout; @@ -103,13 +104,13 @@ public void onClick(View v) { viewPager.setAdapter(tabAdapter); } tabLayout.setupWithViewPager(viewPager); - if (FeatureRestriction.getColor()!=null) { - phoneAddIv.setImageTintList(ColorStateList.valueOf(Color.parseColor(FeatureRestriction.getColor()))); + if (UIKitSettings.getColor()!=null) { + phoneAddIv.setImageTintList(ColorStateList.valueOf(Color.parseColor(UIKitSettings.getColor()))); Drawable wrappedDrawable = DrawableCompat.wrap(getResources(). getDrawable(R.drawable.tab_layout_background_active)); - DrawableCompat.setTint(wrappedDrawable, Color.parseColor(FeatureRestriction.getColor())); + DrawableCompat.setTint(wrappedDrawable, Color.parseColor(UIKitSettings.getColor())); tabLayout.getTabAt(tabLayout.getSelectedTabPosition()).view.setBackground(wrappedDrawable); - tabLayout.setSelectedTabIndicatorColor(Color.parseColor(FeatureRestriction.getColor())); + tabLayout.setSelectedTabIndicatorColor(Color.parseColor(UIKitSettings.getColor())); } else { tabLayout.getTabAt(tabLayout.getSelectedTabPosition()). view.setBackgroundColor(getResources().getColor(R.color.colorPrimary)); @@ -118,10 +119,10 @@ public void onClick(View v) { tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { @Override public void onTabSelected(TabLayout.Tab tab) { - if (FeatureRestriction.getColor()!=null) { + if (UIKitSettings.getColor()!=null) { Drawable wrappedDrawable = DrawableCompat.wrap(getResources(). getDrawable(R.drawable.tab_layout_background_active)); - DrawableCompat.setTint(wrappedDrawable, Color.parseColor(FeatureRestriction.getColor())); + DrawableCompat.setTint(wrappedDrawable, Color.parseColor(UIKitSettings.getColor())); tab.view.setBackground(wrappedDrawable); } else diff --git a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_list/CometChatNewCallList.java b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_list/CometChatNewCallList.java index 1e9e07e..78c6137 100644 --- a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_list/CometChatNewCallList.java +++ b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_list/CometChatNewCallList.java @@ -48,6 +48,7 @@ import com.cometchat.pro.uikit.R; import com.cometchat.pro.uikit.ui_components.shared.CometChatSnackBar; import com.cometchat.pro.uikit.ui_resources.utils.CometChatError; +import com.cometchat.pro.uikit.ui_settings.UIKitSettings; import com.facebook.shimmer.ShimmerFrameLayout; import java.util.List; @@ -106,10 +107,10 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { CometChatError.init(this); ImageView imageView = new ImageView(this); imageView.setImageDrawable(getResources().getDrawable(R.drawable.ic_back_arrow_selected)); - if (FeatureRestriction.getColor()!=null) { - getWindow().setStatusBarColor(Color.parseColor(FeatureRestriction.getColor())); + if (UIKitSettings.getColor()!=null) { + getWindow().setStatusBarColor(Color.parseColor(UIKitSettings.getColor())); imageView.setImageTintList(ColorStateList.valueOf( - Color.parseColor(FeatureRestriction.getColor()))); + Color.parseColor(UIKitSettings.getColor()))); } else imageView.setImageTintList( ColorStateList.valueOf(getResources().getColor(R.color.colorPrimary))); diff --git a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_manager/CometChatStartCallActivity.java b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_manager/CometChatStartCallActivity.java index f722f7f..e680847 100644 --- a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_manager/CometChatStartCallActivity.java +++ b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_manager/CometChatStartCallActivity.java @@ -25,8 +25,8 @@ import com.cometchat.pro.core.CallSettings; import com.cometchat.pro.core.CometChat; import com.cometchat.pro.exceptions.CometChatException; +import com.cometchat.pro.models.AudioMode; import com.cometchat.pro.models.User; -import com.cometchat.pro.rtc.model.AudioMode; import com.cometchat.pro.uikit.R; import com.cometchat.pro.uikit.ui_components.calls.call_manager.ongoing_call.OngoingCallService; import com.cometchat.pro.uikit.ui_components.shared.CometChatSnackBar; @@ -98,13 +98,13 @@ protected void onCreate(Bundle savedInstanceState) { Log.e( "startCallActivity: ",sessionID+" "+type); CometChat.startCall(callSettings, new CometChat.OngoingCallListener() { @Override - public void onAudioModesUpdated(List list) { - Log.e( "onAudioModesUpdated: ",list.toString() ); + public void onUserListUpdated(List list) { + Log.e( "onUserListUpdated: ",list.toString() ); } @Override - public void onUserListUpdated(List list) { - Log.e( "onUserListUpdated: ",list.toString() ); + public void onAudioModesUpdated(List list) { + Log.e("onAudioModesUpdated: ",list.toString() ); } @Override @@ -123,7 +123,7 @@ public void onUserLeft(User user) { mainView, getString(R.string.user_left)+":"+ user.getName(), CometChatSnackBar.INFO); Log.e("onUserLeft: ", user.getUid()); - if (callSettings.isDefaultLayout()) { + if (callSettings.getMode().equals(CallSettings.MODE_SINGLE)) { endCall(); } } else { diff --git a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/chats/CometChatConversationList.java b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/chats/CometChatConversationList.java index b358ace..58be0ac 100644 --- a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/chats/CometChatConversationList.java +++ b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/chats/CometChatConversationList.java @@ -34,6 +34,7 @@ import com.cometchat.pro.models.Action; import com.cometchat.pro.models.Group; import com.cometchat.pro.models.MessageReceipt; +import com.cometchat.pro.models.TypingIndicator; import com.cometchat.pro.models.User; import com.cometchat.pro.uikit.ui_components.shared.CometChatSnackBar; import com.cometchat.pro.uikit.ui_components.shared.cometchatConversations.CometChatConversations; @@ -451,6 +452,18 @@ public void onMessageDeleted(BaseMessage message) { if (rvConversationList!=null) rvConversationList.refreshConversation(message); } + + @Override + public void onTypingStarted(TypingIndicator typingIndicator) { + if (rvConversationList!=null) + rvConversationList.setTypingIndicator(typingIndicator,false); + } + + @Override + public void onTypingEnded(TypingIndicator typingIndicator) { + if (rvConversationList!=null) + rvConversationList.setTypingIndicator(typingIndicator,true); + } }); CometChat.addGroupListener(TAG, new CometChat.GroupListener() { @Override diff --git a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/cometchat_ui/CometChatUI.java b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/cometchat_ui/CometChatUI.java index 0288e74..1ae4ca6 100644 --- a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/cometchat_ui/CometChatUI.java +++ b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/cometchat_ui/CometChatUI.java @@ -41,6 +41,7 @@ import com.cometchat.pro.uikit.ui_components.shared.CometChatSnackBar; import com.cometchat.pro.uikit.ui_resources.utils.CometChatError; import com.cometchat.pro.uikit.ui_resources.utils.EncryptionUtils; +import com.cometchat.pro.uikit.ui_settings.UIKitSettings; import com.google.android.material.badge.BadgeDrawable; import com.google.android.material.bottomnavigation.BottomNavigationView; @@ -198,9 +199,9 @@ private void initViewComponent() { activityCometChatUnifiedBinding.bottomNavigation.setOnNavigationItemSelectedListener(this); - if (FeatureRestriction.getColor()!=null && !FeatureRestriction.getColor().isEmpty()) { - getWindow().setStatusBarColor(Color.parseColor(FeatureRestriction.getColor())); - int widgetColor = Color.parseColor(FeatureRestriction.getColor()); + if (UIKitSettings.getColor()!=null && !UIKitSettings.getColor().isEmpty()) { + getWindow().setStatusBarColor(Color.parseColor(UIKitSettings.getColor())); + int widgetColor = Color.parseColor(UIKitSettings.getColor()); ColorStateList colorStateList = new ColorStateList(new int[][] { { -android.R.attr.state_selected }, {} }, new int[] { Color.GRAY, widgetColor }); diff --git a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/add_members/CometChatAddMembersActivity.java b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/add_members/CometChatAddMembersActivity.java index 3fa7c43..041aa87 100644 --- a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/add_members/CometChatAddMembersActivity.java +++ b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/add_members/CometChatAddMembersActivity.java @@ -13,6 +13,7 @@ import com.cometchat.pro.uikit.ui_resources.constants.UIKitConstants; import com.cometchat.pro.uikit.ui_settings.FeatureRestriction; +import com.cometchat.pro.uikit.ui_settings.UIKitSettings; public class CometChatAddMembersActivity extends AppCompatActivity { @@ -23,8 +24,8 @@ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_screen); handleIntent(); - if (FeatureRestriction.getColor()!=null) - getWindow().setStatusBarColor(Color.parseColor(FeatureRestriction.getColor())); + if (UIKitSettings.getColor()!=null) + getWindow().setStatusBarColor(Color.parseColor(UIKitSettings.getColor())); } private void handleIntent() { diff --git a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/admin_moderator_list/CometChatAdminModeratorListActivity.java b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/admin_moderator_list/CometChatAdminModeratorListActivity.java index add9ea4..e7e8389 100644 --- a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/admin_moderator_list/CometChatAdminModeratorListActivity.java +++ b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/admin_moderator_list/CometChatAdminModeratorListActivity.java @@ -13,6 +13,7 @@ import com.cometchat.pro.uikit.ui_resources.constants.UIKitConstants; import com.cometchat.pro.uikit.ui_settings.FeatureRestriction; +import com.cometchat.pro.uikit.ui_settings.UIKitSettings; public class CometChatAdminModeratorListActivity extends AppCompatActivity { @@ -29,8 +30,8 @@ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_screen); handleIntent(); - if (FeatureRestriction.getColor()!=null) - getWindow().setStatusBarColor(Color.parseColor(FeatureRestriction.getColor())); + if (UIKitSettings.getColor()!=null) + getWindow().setStatusBarColor(Color.parseColor(UIKitSettings.getColor())); } private void handleIntent() { diff --git a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/banned_members/CometChatBanMembersActivity.java b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/banned_members/CometChatBanMembersActivity.java index 4867131..654d121 100644 --- a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/banned_members/CometChatBanMembersActivity.java +++ b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/banned_members/CometChatBanMembersActivity.java @@ -10,6 +10,7 @@ import android.view.View; import com.cometchat.pro.uikit.R; +import com.cometchat.pro.uikit.ui_settings.UIKitSettings; import com.google.android.material.appbar.MaterialToolbar; import com.cometchat.pro.uikit.ui_resources.constants.UIKitConstants; @@ -32,8 +33,8 @@ public void onClick(View v) { } }); handleIntent(); - if (FeatureRestriction.getColor()!=null) - getWindow().setStatusBarColor(Color.parseColor(FeatureRestriction.getColor())); + if (UIKitSettings.getColor()!=null) + getWindow().setStatusBarColor(Color.parseColor(UIKitSettings.getColor())); CometChatBanMembers banFragment = new CometChatBanMembers(); Bundle bundle = new Bundle(); bundle.putString(UIKitConstants.IntentStrings.GUID,guid); diff --git a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/create_group/CometChatCreateGroupActivity.java b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/create_group/CometChatCreateGroupActivity.java index 3b02b83..1d21f88 100644 --- a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/create_group/CometChatCreateGroupActivity.java +++ b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/create_group/CometChatCreateGroupActivity.java @@ -12,6 +12,7 @@ import com.cometchat.pro.uikit.R; import com.cometchat.pro.uikit.ui_settings.FeatureRestriction; +import com.cometchat.pro.uikit.ui_settings.UIKitSettings; public class CometChatCreateGroupActivity extends AppCompatActivity { @@ -26,8 +27,8 @@ protected void onCreate(Bundle savedInstanceState) { setContentView(R.layout.activity_screen); Fragment fragment = new CometChatCreateGroup(); getSupportFragmentManager().beginTransaction().replace(R.id.frame_fragment,fragment).commit(); - if (FeatureRestriction.getColor()!=null) - getWindow().setStatusBarColor(Color.parseColor(FeatureRestriction.getColor())); + if (UIKitSettings.getColor()!=null) + getWindow().setStatusBarColor(Color.parseColor(UIKitSettings.getColor())); } diff --git a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_details/CometChatGroupDetailActivity.java b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_details/CometChatGroupDetailActivity.java index a537d01..e85eddb 100644 --- a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_details/CometChatGroupDetailActivity.java +++ b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_details/CometChatGroupDetailActivity.java @@ -1022,7 +1022,7 @@ public void afterTextChanged(Editable s) { if(!s.toString().isEmpty()) { avatar.setVisibility(View.VISIBLE); - Glide.with(CometChatGroupDetailActivity.this).load(s.toString()).into(avatar); + avatar.setAvatar(s.toString()); } else avatar.setVisibility(View.GONE); } diff --git a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_list/CometChatGroupList.java b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_list/CometChatGroupList.java index 41d1d3f..cba07d4 100644 --- a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_list/CometChatGroupList.java +++ b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_list/CometChatGroupList.java @@ -152,7 +152,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, CometChatError.init(getContext()); ivCreateGroup = view.findViewById(R.id.create_group); - ivCreateGroup.setImageTintList(ColorStateList.valueOf(Color.parseColor(FeatureRestriction.getColor()))); + ivCreateGroup.setImageTintList(ColorStateList.valueOf(Color.parseColor(UIKitSettings.getColor()))); isTitleVisible(); swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { diff --git a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_members/CometChatGroupMemberListActivity.java b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_members/CometChatGroupMemberListActivity.java index f792fdf..f79d1a7 100644 --- a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_members/CometChatGroupMemberListActivity.java +++ b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_members/CometChatGroupMemberListActivity.java @@ -13,6 +13,7 @@ import com.cometchat.pro.uikit.ui_resources.constants.UIKitConstants; import com.cometchat.pro.uikit.ui_settings.FeatureRestriction; +import com.cometchat.pro.uikit.ui_settings.UIKitSettings; public class CometChatGroupMemberListActivity extends AppCompatActivity { @@ -42,8 +43,8 @@ protected void onCreate(Bundle savedInstanceState) { bundle.putBoolean(UIKitConstants.IntentStrings.TRANSFER_OWNERSHIP,transferOwnerShip); fragment.setArguments(bundle); getSupportFragmentManager().beginTransaction().replace(R.id.frame_fragment,fragment).commit(); - if (FeatureRestriction.getColor()!=null) - getWindow().setStatusBarColor(Color.parseColor(FeatureRestriction.getColor())); + if (UIKitSettings.getColor()!=null) + getWindow().setStatusBarColor(Color.parseColor(UIKitSettings.getColor())); } diff --git a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/forward_message/CometChatForwardMessageActivity.java b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/forward_message/CometChatForwardMessageActivity.java index 4fd30bc..77c6c85 100644 --- a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/forward_message/CometChatForwardMessageActivity.java +++ b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/forward_message/CometChatForwardMessageActivity.java @@ -231,10 +231,10 @@ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { @Override public void afterTextChanged(Editable editable) { - if (editable.toString().length()!=0) { - if (conversationListAdapter != null) - conversationListAdapter.getFilter().filter(editable.toString()); - } + if (editable.toString().length()!=0) { + if (conversationListAdapter != null) + conversationListAdapter.getFilter().filter(editable.toString()); + } } }); @@ -294,7 +294,7 @@ public void onClick(View vw) { checkUserList(); } else { - CometChatSnackBar.show(CometChatForwardMessageActivity.this, + CometChatSnackBar.show(CometChatForwardMessageActivity.this, selectedUsers, getString(R.string.forward_to_5_at_a_time), CometChatSnackBar.WARNING); } @@ -333,7 +333,11 @@ public void onClick(View view) { } }).start(); - } else if (messageType != null && messageType.equals(CometChatConstants.MESSAGE_TYPE_IMAGE)) { + } else if (messageType != null && + (messageType.equals(CometChatConstants.MESSAGE_TYPE_IMAGE) || + messageType.equals(CometChatConstants.MESSAGE_TYPE_AUDIO) || + messageType.equals(CometChatConstants.MESSAGE_TYPE_FILE) || + messageType.equals(CometChatConstants.MESSAGE_TYPE_VIDEO))) { new Thread(() -> { for (int i = 0; i <= userList.size() - 1; i++) { Conversation conversation = new ArrayList<>(userList.values()).get(i); @@ -547,9 +551,9 @@ public boolean onCreateOptionsMenu(Menu menu) { @Override public boolean onOptionsItemSelected(@NonNull MenuItem item) { - if (item.getItemId()==android.R.id.home){ - onBackPressed(); - } + if (item.getItemId()==android.R.id.home){ + onBackPressed(); + } return super.onOptionsItemSelected(item); } @@ -582,7 +586,7 @@ public void onSuccess(List conversationsList) { @Override public void onError(CometChatException e) { - CometChatSnackBar.show(CometChatForwardMessageActivity.this, + CometChatSnackBar.show(CometChatForwardMessageActivity.this, rvConversationList, CometChatError.localized(e), CometChatSnackBar.ERROR); } }); diff --git a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/message_list/CometChatMessageList.java b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/message_list/CometChatMessageList.java index c46ad24..b6af9d1 100644 --- a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/message_list/CometChatMessageList.java +++ b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/message_list/CometChatMessageList.java @@ -113,6 +113,7 @@ import com.cometchat.pro.uikit.ui_resources.utils.pattern_utils.PatternUtils; import com.cometchat.pro.uikit.ui_resources.utils.sticker_header.StickyHeaderDecoration; import com.cometchat.pro.uikit.ui_settings.FeatureRestriction; +import com.cometchat.pro.uikit.ui_settings.UIKitSettings; import com.facebook.shimmer.ShimmerFrameLayout; import com.google.android.gms.location.FusedLocationProviderClient; import com.google.android.gms.location.LocationServices; @@ -964,7 +965,7 @@ private void createPollDialog() { MaterialCardView addOption = view.findViewById(R.id.add_options); LinearLayout optionLayout = view.findViewById(R.id.options_layout); MaterialButton addPoll = view.findViewById(R.id.add_poll); - addPoll.setBackgroundColor(Color.parseColor(FeatureRestriction.getColor())); + addPoll.setBackgroundColor(Color.parseColor(UIKitSettings.getColor())); ImageView cancelPoll = view.findViewById(R.id.close_poll); addOption.setOnClickListener(new View.OnClickListener() { @Override @@ -1798,6 +1799,7 @@ public void onError(CometChatException e) { if (messageAdapter == null) { Log.e(TAG, "onError: MessageAdapter is null"); } else { + e.printStackTrace(); textMessage.setSentAt(-1); messageAdapter.updateChangedMessage(textMessage); } @@ -2265,7 +2267,7 @@ public void onSuccess(Boolean booleanVal) { @Override public void onSuccess(Boolean booleanVal) { if (booleanVal) - tvStatus.setText(typingIndicator.getSender().getName() + getString(R.string.is_typing)); + tvStatus.setText(typingIndicator.getSender().getName() +" "+getString(R.string.is_typing)); } }); } @@ -3474,13 +3476,13 @@ public void onSuccess(Boolean booleanVal) { }); } - if (FeatureRestriction.getColor()!=null) { + if (UIKitSettings.getColor()!=null) { audioCallAction.setImageTintList(ColorStateList.valueOf( - Color.parseColor(FeatureRestriction.getColor()))); + Color.parseColor(UIKitSettings.getColor()))); videoCallAction.setImageTintList(ColorStateList.valueOf( - Color.parseColor(FeatureRestriction.getColor()))); + Color.parseColor(UIKitSettings.getColor()))); infoAction.setImageTintList(ColorStateList.valueOf( - Color.parseColor(FeatureRestriction.getColor()))); + Color.parseColor(UIKitSettings.getColor()))); } FeatureRestriction.isShareCopyForwardMessageEnabled(new FeatureRestriction.OnSuccessListener() { diff --git a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/message_list/MessageAdapter.java b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/message_list/MessageAdapter.java index d330384..5a2d89b 100644 --- a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/message_list/MessageAdapter.java +++ b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/message_list/MessageAdapter.java @@ -59,6 +59,7 @@ import com.cometchat.pro.uikit.ui_resources.utils.pattern_utils.PatternUtils; import com.cometchat.pro.uikit.ui_settings.FeatureRestriction; +import com.cometchat.pro.uikit.ui_settings.UIKitSettings; import com.google.android.material.button.MaterialButton; import com.google.android.material.card.MaterialCardView; import com.google.android.material.chip.Chip; @@ -647,7 +648,7 @@ public void onSuccess(Boolean booleanVal) { .LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); linearLayout.setPadding(8,8,8,8); - linearLayout.setBackgroundColor(Color.parseColor(FeatureRestriction.getColor())); + linearLayout.setBackgroundColor(Color.parseColor(UIKitSettings.getColor())); linearLayout.setBackgroundTintList(ColorStateList.valueOf(context.getResources() .getColor(R.color.textColorWhite))); layoutParams.bottomMargin = (int) Utils.dpToPx(context, 8); @@ -1253,7 +1254,7 @@ private void setAudioData(AudioMessageViewHolder viewHolder, int i) { viewHolder.tvUser.setText(baseMessage.getSender().getName()); } } else { - viewHolder.playBtn.setImageTintList(ColorStateList.valueOf(Color.parseColor(FeatureRestriction.getColor()))); + viewHolder.playBtn.setImageTintList(ColorStateList.valueOf(Color.parseColor(UIKitSettings.getColor()))); } FeatureRestriction.isThreadedMessagesEnabled(new FeatureRestriction.OnSuccessListener() { @@ -2412,7 +2413,7 @@ private void setReactionSupport(BaseMessage baseMessage, ChipGroup reactionLayou Chip chip = new Chip(context); chip.setChipStrokeWidth(2f); chip.setChipBackgroundColor(ColorStateList.valueOf(context.getResources().getColor(android.R.color.transparent))); - chip.setChipStrokeColor(ColorStateList.valueOf(Color.parseColor(FeatureRestriction.getColor()))); + chip.setChipStrokeColor(ColorStateList.valueOf(Color.parseColor(UIKitSettings.getColor()))); chip.setText(str + " " + reactionOnMessage.get(str)); reactionLayout.addView(chip); chip.setOnLongClickListener(new View.OnLongClickListener() { @@ -2510,12 +2511,12 @@ private void setColorFilter(BaseMessage baseMessage,View view){ { if (baseMessage.getSender().equals(CometChat.getLoggedInUser())) { if (view instanceof CardView) { - ((CardView)view).setCardBackgroundColor(Color.parseColor(FeatureRestriction.getColor())); + ((CardView)view).setCardBackgroundColor(Color.parseColor(UIKitSettings.getColor())); } else { if (Build.VERSION.SDK_INT >= 29) { - view.getBackground().setColorFilter(new PorterDuffColorFilter(Color.parseColor(FeatureRestriction.getColor()), PorterDuff.Mode.SRC_ATOP)); + view.getBackground().setColorFilter(new PorterDuffColorFilter(Color.parseColor(UIKitSettings.getColor()), PorterDuff.Mode.SRC_ATOP)); } else { - view.getBackground().setColorFilter(Color.parseColor(FeatureRestriction.getColor()), PorterDuff.Mode.SRC_ATOP); + view.getBackground().setColorFilter(Color.parseColor(UIKitSettings.getColor()), PorterDuff.Mode.SRC_ATOP); } } } else { @@ -2731,7 +2732,7 @@ public void setLongClickSelectedItem(BaseMessage baseMessage) { private void setAvatar(CometChatAvatar avatar, String avatarUrl, String name) { if (avatarUrl != null && !avatarUrl.isEmpty()) - Glide.with(context).load(avatarUrl).into(avatar); + avatar.setAvatar(avatarUrl); else avatar.setInitials(name); diff --git a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/CometChatThreadMessageList.java b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/CometChatThreadMessageList.java index 1ca43a1..7449a1b 100644 --- a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/CometChatThreadMessageList.java +++ b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/CometChatThreadMessageList.java @@ -105,6 +105,7 @@ import com.cometchat.pro.uikit.ui_resources.utils.keyboard_utils.KeyBoardUtils; import com.cometchat.pro.uikit.ui_resources.utils.sticker_header.StickyHeaderDecoration; import com.cometchat.pro.uikit.ui_settings.FeatureRestriction; +import com.cometchat.pro.uikit.ui_settings.UIKitSettings; import com.facebook.shimmer.ShimmerFrameLayout; import com.google.android.gms.location.FusedLocationProviderClient; import com.google.android.gms.location.LocationServices; @@ -775,7 +776,7 @@ private void setReactionForParentMessage() { Chip chip = new Chip(context); chip.setChipStrokeWidth(2f); chip.setChipBackgroundColor(ColorStateList.valueOf(context.getResources().getColor(android.R.color.transparent))); - chip.setChipStrokeColor(ColorStateList.valueOf(Color.parseColor(FeatureRestriction.getColor()))); + chip.setChipStrokeColor(ColorStateList.valueOf(Color.parseColor(UIKitSettings.getColor()))); chip.setText(key + " " + reactionInfo.get(key)); reactionLayout.addView(chip); chip.setOnClickListener(new View.OnClickListener() { diff --git a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/CometChatThreadMessageListActivity.java b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/CometChatThreadMessageListActivity.java index 4867c44..05bf3b0 100644 --- a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/CometChatThreadMessageListActivity.java +++ b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/CometChatThreadMessageListActivity.java @@ -28,6 +28,7 @@ import com.cometchat.pro.uikit.ui_components.messages.message_actions.listener.OnMessageLongClick; import com.cometchat.pro.uikit.ui_settings.FeatureRestriction; +import com.cometchat.pro.uikit.ui_settings.UIKitSettings; /** @@ -109,8 +110,8 @@ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_cometchat_message_list); - if (FeatureRestriction.getColor() !=null) { - getWindow().setStatusBarColor(Color.parseColor(FeatureRestriction.getColor())); + if (UIKitSettings.getColor() !=null) { + getWindow().setStatusBarColor(Color.parseColor(UIKitSettings.getColor())); } EmojiCompat.Config config = new BundledEmojiCompatConfig(this); EmojiCompat.init(config); diff --git a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/ThreadAdapter.java b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/ThreadAdapter.java index dc582fb..32578e9 100644 --- a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/ThreadAdapter.java +++ b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/ThreadAdapter.java @@ -51,6 +51,7 @@ import com.cometchat.pro.uikit.ui_resources.utils.pattern_utils.PatternUtils; import com.cometchat.pro.uikit.ui_settings.FeatureRestriction; +import com.cometchat.pro.uikit.ui_settings.UIKitSettings; import com.google.android.material.button.MaterialButton; import com.google.android.material.card.MaterialCardView; import com.google.android.material.chip.Chip; @@ -991,7 +992,7 @@ private void setReactionSupport(BaseMessage baseMessage, ChipGroup reactionLayou Chip chip = new Chip(context); chip.setChipStrokeWidth(2f); chip.setChipBackgroundColor(ColorStateList.valueOf(context.getResources().getColor(android.R.color.transparent))); - chip.setChipStrokeColor(ColorStateList.valueOf(Color.parseColor(FeatureRestriction.getColor()))); + chip.setChipStrokeColor(ColorStateList.valueOf(Color.parseColor(UIKitSettings.getColor()))); chip.setText(str + " " + reactionOnMessage.get(str)); reactionLayout.addView(chip); chip.setOnLongClickListener(new View.OnLongClickListener() { @@ -1170,7 +1171,7 @@ public void setLongClickSelectedItem(BaseMessage baseMessage) { private void setAvatar(CometChatAvatar avatar, String avatarUrl, String name) { if (avatarUrl != null && !avatarUrl.isEmpty()) - Glide.with(context).load(avatarUrl).into(avatar); + avatar.setAvatar(avatarUrl); else avatar.setInitials(name); diff --git a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatAvatar/CometChatAvatar.java b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatAvatar/CometChatAvatar.java index c43af79..5801242 100644 --- a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatAvatar/CometChatAvatar.java +++ b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatAvatar/CometChatAvatar.java @@ -3,37 +3,24 @@ import android.app.Activity; import android.content.Context; import android.content.res.TypedArray; -import android.graphics.Canvas; -import android.graphics.Color; -import android.graphics.ColorFilter; -import android.graphics.Outline; -import android.graphics.Paint; -import android.graphics.Path; -import android.graphics.PixelFormat; -import android.graphics.PorterDuff; -import android.graphics.PorterDuffXfermode; -import android.graphics.Rect; import android.graphics.RectF; import android.graphics.drawable.Drawable; -import android.text.TextPaint; import android.util.AttributeSet; import android.view.View; -import android.view.ViewOutlineProvider; +import android.widget.ImageView; +import android.widget.TextView; import android.widget.Toast; import androidx.annotation.ColorInt; import androidx.annotation.NonNull; -import androidx.appcompat.widget.AppCompatImageView; -import androidx.databinding.BindingMethod; -import androidx.databinding.BindingMethods; import com.bumptech.glide.Glide; +import com.cometchat.pro.models.AppEntity; import com.cometchat.pro.models.Group; import com.cometchat.pro.models.User; import com.cometchat.pro.uikit.R; -import com.cometchat.pro.uikit.ui_settings.FeatureRestriction; -import com.cometchat.pro.uikit.ui_resources.utils.Utils; +import com.google.android.material.card.MaterialCardView; /** * Purpose - This class is a subclass of AppCompatImageView, It is a component which is been used by developer @@ -45,22 +32,11 @@ * * Modified on - 20th January 2020 * -*/ -@BindingMethods(value = {@BindingMethod(type = CometChatAvatar.class, attribute = "app:avatar", method = "setAvatar"), - @BindingMethod(type = CometChatAvatar.class, attribute = "app:avatar_name", method = "setInitials")}) -public class CometChatAvatar extends AppCompatImageView { + */ +public class CometChatAvatar extends MaterialCardView { private static final String TAG = CometChatAvatar.class.getSimpleName(); - private final Class avatar = CometChatAvatar.class; - - private static final ScaleType SCALE_TYPE = ScaleType.CENTER_CROP; - - /* - * Path of them image to be clipped (to be shown) - * */ - Path clipPath; - /* * Place holder drawable (with background color and initials) * */ @@ -71,48 +47,12 @@ public class CometChatAvatar extends AppCompatImageView { * */ String text; - /* - * Used to set size and color of the member initials - * */ - TextPaint textPaint; - - /* - * Used as background of the initials with user specific color - * */ - Paint paint; - - /* - * To draw border - */ - private Paint borderPaint; - - /* - * Shape to be drawn - * */ - int shape; - - /* - * Constants to define shape - * */ - protected static final int CIRCLE = 0; - protected static final int RECTANGLE = 1; - /* * User whose avatar should be displayed * */ //User user; String avatarUrl; - /* - * Image width and height (both are same and com.cometchat.pro.uikit.UI_Resources.constant, defined in dimens.xml - * We cache them in this field - * */ - private int imageSize; - - /* - * We will set it as 2dp - * */ - int cornerRadius; /* * Bounds of the canvas in float @@ -127,9 +67,15 @@ public class CometChatAvatar extends AppCompatImageView { private int borderColor; + private int backgroundColor; + private float borderWidth; - private float borderRadius; + private float radius; + + private MaterialCardView cardView; + private ImageView imageView; + private TextView textView; public CometChatAvatar(Context context) { super(context); @@ -140,177 +86,68 @@ public CometChatAvatar(Context context, AttributeSet attrs) { super(context, attrs); this.context = context; getAttributes(attrs); - init(); } public CometChatAvatar(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); this.context = context; getAttributes(attrs); - init(); } private void getAttributes(AttributeSet attrs) { + View view =View.inflate(context, R.layout.cometchat_avatar,null); TypedArray a = getContext().getTheme().obtainStyledAttributes( attrs, R.styleable.Avatar, 0, 0); + /* + * Get the shape and set shape field accordingly + * */ + drawable = a.getDrawable(R.styleable.Avatar_image); + radius = a.getDimension(R.styleable.Avatar_corner_radius,16); + backgroundColor = a.getColor(R.styleable.Avatar_background_color, + getResources().getColor(R.color.colorPrimary)); + avatarUrl = a.getString(R.styleable.Avatar_avatar); +// borderRadius = a.getInteger(R.styleable.Avatar_cornerRadius,8); + borderColor = a.getColor(R.styleable.Avatar_border_color,getResources().getColor(R.color.colorPrimary)); + // backgroundColor = a.getColor(R.styleable.Avatar_backgroundColor,getResources().getColor(R.color.colorPrimary)); + borderWidth = a.getDimension(R.styleable.Avatar_border_width,1f); + + + addView(view); + + + cardView = view.findViewById(R.id.cardView); + setRadius(radius); + cardView.setCardBackgroundColor(backgroundColor); + imageView = view.findViewById(R.id.image); + textView = view.findViewById(R.id.text); + if (drawable!=null) + imageView.setImageDrawable(drawable); + } - try { - - /* - * Get the shape and set shape field accordingly - * */ - String avatarShape = a.getString(R.styleable.Avatar_avatar_shape); - avatarUrl = a.getString(R.styleable.Avatar_avatar); - borderColor =a.getColor(R.styleable.Avatar_border_color,Color.WHITE); - borderWidth=a.getDimension(R.styleable.Avatar_border_width,1); - - + private void setAvatar(@NonNull User user) { - /* - * If the attribute is not specified, consider circle shape - * */ - if (avatarShape == null) { - shape = CIRCLE; + if (user!=null) { + if (user.getAvatar() != null) { + avatarUrl = user.getAvatar(); + if (isValidContextForGlide(context)) { + setValues(); + } } else { - if (new String("rectangle").equalsIgnoreCase(avatarShape)) { - shape = RECTANGLE; - } else { - shape = CIRCLE; + if (user.getName()!=null&&!user.getName().isEmpty()) { + if (user.getName().length() > 2) { + text = user.getName().substring(0, 2); + } else { + text = user.getName(); + } + }else { + text="??"; } + imageView.setVisibility(View.GONE); + textView.setText(text); } - } finally { - a.recycle(); } - } - - @Override - public ScaleType getScaleType() { - return SCALE_TYPE; - } - - @Override - public void setScaleType(ScaleType scaleType) { - if (scaleType != SCALE_TYPE) { - throw new IllegalArgumentException(String.format("ScaleType %1$s not supported.", scaleType)); - } - } - - public void setShape(String shapestr) - { - if (shapestr.equalsIgnoreCase("circle")) { - shape = CIRCLE; - } else { - shape = RECTANGLE; - } - } - @Override - protected void onSizeChanged(int w, int h, int oldw, int oldh) { - super.onSizeChanged(w, h, oldw, oldh); - init(); - } - - @Override - public void setAdjustViewBounds(boolean adjustViewBounds) { - if (adjustViewBounds) { - throw new IllegalArgumentException("adjustViewBounds not supported."); - } - } - - @Override - public void setPadding(int left, int top, int right, int bottom) { - super.setPadding(left, top, right, bottom); - init(); - } - - @Override - public void setPaddingRelative(int start, int top, int end, int bottom) { - super.setPaddingRelative(start, top, end, bottom); - init(); - } - /* - * Initialize fields - * */ - protected void init() { - rectF = new RectF(); - clipPath = new Path(); - rectF.set(calculateBounds()); - - //imageSize = getResources().getDimensionPixelSize(R.dimen.avatar_size); - imageSize = getHeight(); - cornerRadius = (int) Utils.dpToPixel(2, getResources()); - - paint = new Paint(Paint.ANTI_ALIAS_FLAG); - if (FeatureRestriction.getColor()!=null && !FeatureRestriction.getColor().isEmpty()) { - paint.setColor(Color.parseColor(FeatureRestriction.getColor())); - } - else - paint.setColor(getResources().getColor(R.color.colorPrimary)); - - textPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG); - textPaint.setTextSize(16f * getResources().getDisplayMetrics().scaledDensity); - textPaint.setColor(Color.WHITE); - - borderPaint = new Paint(); - borderPaint.setStyle(Paint.Style.STROKE); - borderPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_OVER)); - - borderPaint.setColor(borderColor); - borderPaint.setAntiAlias(true); - borderPaint.setStrokeWidth(borderWidth); - - if (FeatureRestriction.getColor()!=null && FeatureRestriction.getColor().isEmpty()) - color = Color.parseColor(FeatureRestriction.getColor()); - else - color = getResources().getColor(R.color.colorPrimary); - - setOutlineProvider(new OutlineProvider()); - } - - private RectF calculateBounds() { - int availableWidth = getWidth() - getPaddingLeft() - getPaddingRight(); - int availableHeight = getHeight() - getPaddingTop() - getPaddingBottom(); - - int sideLength = Math.min(availableWidth, availableHeight); - - float left = getPaddingLeft() + (availableWidth - sideLength) / 2f; - float top = getPaddingTop() + (availableHeight - sideLength) / 2f; - - return new RectF(left, top, left + sideLength, top + sideLength); - } - - /** - * This method is used to check if the user parameter passed is null or not. If it is not null then - * it will show avatar of user, else it will show default drawable or first two letter of user name. - * - * @param user is an object of User.class. - * @see User - */ - public void setAvatar(@NonNull User user) { - - if (user!=null) { - if (user.getAvatar() != null) { - avatarUrl = user.getAvatar(); - if (isValidContextForGlide(context)) { - init(); - setValues(); - } - } else { - if (user.getName()!=null&&!user.getName().isEmpty()) { - if (user.getName().length() > 2) { - text = user.getName().substring(0, 2); - } else { - text = user.getName(); - } - }else { - text="??"; - } - init(); - setImageDrawable(drawable); - setDrawable(); - } - } } @@ -321,28 +158,34 @@ public void setAvatar(@NonNull User user) { * @param group is an object of Group.class. * @see Group */ - public void setAvatar(@NonNull Group group) { - - if (group!=null) { - - if (group.getIcon() != null) { - avatarUrl = group.getIcon(); - if (isValidContextForGlide(context)) - init(); - setValues(); - } else { - if (group.getName().length() > 2) - text = group.getName().substring(0, 2); - else { - text = group.getName(); - } - - init(); - setDrawable(); - setImageDrawable(drawable); - } - } + private void setAvatar(@NonNull Group group) { + + if (group!=null) { + + if (group.getIcon() != null) { + avatarUrl = group.getIcon(); + if (isValidContextForGlide(context)) + setValues(); + } else { + if (group.getName().length() > 2) + text = group.getName().substring(0, 2); + else { + text = group.getName(); + } + imageView.setVisibility(View.GONE); + textView.setText(text); + } + } + } + + public void setAvatar(AppEntity appEntity) { + if (appEntity instanceof User) { + setAvatar((User)appEntity); + } else if (appEntity instanceof Group) { + setAvatar((Group)appEntity); + } } + /** * This method is used to set image by using url passed in parameter.. * @@ -353,7 +196,6 @@ public void setAvatar(@NonNull String avatarUrl) { this.avatarUrl = avatarUrl; if (isValidContextForGlide(context)) - init(); setValues(); } @@ -366,7 +208,6 @@ public void setAvatar(Drawable drawable, @NonNull String avatarUrl) { this.drawable = drawable; this.avatarUrl = avatarUrl; if (isValidContextForGlide(context)) { - init(); setValues(); } } @@ -387,10 +228,16 @@ public void setInitials(@NonNull String name) { }else { text=name; } - setDrawable(); - setImageDrawable(drawable); + imageView.setVisibility(View.GONE); + textView.setText(text); + textView.setVisibility(View.VISIBLE); } + public void setAvatar(String url,String name) { + setAvatar(url); + if (url==null) + setInitials(name); + } public float getBorderWidth() { return borderWidth; } @@ -398,6 +245,12 @@ public Drawable getDrawable() { return drawable; } + + public void setDrawable(Drawable drawable) { + imageView.setImageDrawable(drawable); + imageView.setVisibility(View.VISIBLE); + textView.setVisibility(View.GONE); + } /* * Set user specific fields in here * */ @@ -408,12 +261,10 @@ private void setValues() { Glide.with(context) .load(avatarUrl) .placeholder(drawable) - .centerCrop() - .override(imageSize, imageSize) - .into(this); + .into(imageView); } - } else { - setImageDrawable(drawable); + imageView.setVisibility(View.VISIBLE); + textView.setVisibility(View.GONE); } } catch (Exception e) { Toast.makeText(context,e.getMessage(),Toast.LENGTH_LONG).show(); @@ -435,98 +286,13 @@ public static boolean isValidContextForGlide(final Context context) { } - /* - * Create placeholder drawable - * */ - private void setDrawable() { - drawable = new Drawable() { - @Override - public void draw(@NonNull Canvas canvas) { - - int centerX = Math.round(canvas.getWidth() * 0.5f); - int centerY = Math.round(canvas.getHeight() * 0.5f); - - /* - * To draw text - * */ - if (text != null) { - float textWidth = textPaint.measureText(text) * 0.5f; - float textBaseLineHeight = textPaint.getFontMetrics().ascent * -0.4f; - - /* - * Draw the background color before drawing initials text - * */ - if (shape == RECTANGLE) { - canvas.drawRoundRect(rectF, cornerRadius, cornerRadius, paint); - } else { - canvas.drawCircle(centerX, - centerY, - Math.max(canvas.getHeight() / 2, textWidth / 2), - paint); - } - - /* - * Draw the text above the background color - * */ - canvas.drawText(text, centerX - textWidth, centerY + textBaseLineHeight, textPaint); - } - } - - @Override - public void setAlpha(int alpha) { - - } - - @Override - public void setColorFilter(ColorFilter colorFilter) { - - } - - @Override - public int getOpacity() { - return PixelFormat.UNKNOWN; - } - }; - } - - /* - * Set the canvas bounds here - * */ - @Override - protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - super.onMeasure(widthMeasureSpec, heightMeasureSpec); - int screenWidth = MeasureSpec.getSize(widthMeasureSpec); - int screenHeight = MeasureSpec.getSize(heightMeasureSpec); - rectF.set(0, 0, screenWidth, screenHeight); - } - - @Override - protected void onDraw(Canvas canvas) { - if (shape == RECTANGLE) { - canvas.drawRoundRect(rectF, cornerRadius, cornerRadius, borderPaint); - clipPath.addRoundRect(rectF, cornerRadius, cornerRadius, Path.Direction.CCW); - } else { - canvas.drawCircle(rectF.centerX(), rectF.centerY(), (rectF.height() / 2)-borderWidth, borderPaint); - - clipPath.addCircle(rectF.centerX(), rectF.centerY(), (rectF.height() / 2)-borderWidth, Path.Direction.CCW); - } - - canvas.clipPath(clipPath); - super.onDraw(canvas); - } - - @Override - public void setBackgroundColor(int color) { - this.paint.setColor(color); - } - /** * This method is used to set border color of avatar. * @param color */ public void setBorderColor(@ColorInt int color) { this.borderColor = color; - this.borderPaint.setColor(color); + cardView.setStrokeColor(color); } /** @@ -536,19 +302,17 @@ public void setBorderColor(@ColorInt int color) { public void setBorderWidth(int borderWidth) { this.borderWidth = borderWidth; - this.borderPaint.setStrokeWidth(borderWidth); - invalidate(); + cardView.setStrokeWidth(borderWidth); } - private class OutlineProvider extends ViewOutlineProvider { - - @Override - public void getOutline(View view, Outline outline) { - Rect bounds = new Rect(); - rectF.roundOut(bounds); - outline.setRoundRect(bounds, bounds.width() / 2.0f); - } - + public void setCornerRadius(int radius) { + this.radius = radius; + cardView.setRadius(radius); + setRadius(radius); } + public void setBackgroundColor(@ColorInt int color) { + this.backgroundColor = color; + imageView.setBackgroundColor(backgroundColor); + } } diff --git a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatBadgeCount/CometChatBadgeCount.java b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatBadgeCount/CometChatBadgeCount.java index 149faf5..be0940d 100644 --- a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatBadgeCount/CometChatBadgeCount.java +++ b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatBadgeCount/CometChatBadgeCount.java @@ -16,6 +16,7 @@ import com.cometchat.pro.uikit.ui_components.shared.cometchatAvatar.CometChatAvatar; import com.cometchat.pro.uikit.R; +import com.google.android.material.card.MaterialCardView; /** * Purpose - This class is a subclass of LinearLayout, It is a component which is been used by developer @@ -27,13 +28,15 @@ * * Modified on - 16th January 2020 * -*/ + */ -@BindingMethods(value = {@BindingMethod(type = CometChatAvatar.class, attribute = "app:count", method = "setCount")}) -public class CometChatBadgeCount extends LinearLayout { +@BindingMethods(value = {@BindingMethod(type = CometChatBadgeCount.class, attribute = "app:count", method = "setCount")}) +public class CometChatBadgeCount extends MaterialCardView { private TextView tvCount; //Used to display count + private MaterialCardView countView; + private int count; //Used to store value of count private float countSize; //Used to store size of count @@ -80,19 +83,18 @@ private void initViewComponent(Context context, AttributeSet attributeSet, int d addView(view); - if (count==0){ - setVisibility(INVISIBLE); - }else { - setVisibility(VISIBLE); - } + if (count==0){ + setVisibility(INVISIBLE); + }else { + setVisibility(VISIBLE); + } + countView = view.findViewById(R.id.count_parent); tvCount = view.findViewById(R.id.tvSetCount); - tvCount.setBackground(getResources().getDrawable(R.drawable.count_background)); tvCount.setTextSize(countSize); tvCount.setTextColor(countColor); tvCount.setText(String.valueOf(count)); setCountBackground(countBackgroundColor); - } /** @@ -100,11 +102,15 @@ private void initViewComponent(Context context, AttributeSet attributeSet, int d * @param color is an object of Color.class . It is used as color for background. */ public void setCountBackground(@ColorInt int color) { - Drawable unwrappedDrawable = tvCount.getBackground(); - Drawable wrappedDrawable = DrawableCompat.wrap(unwrappedDrawable); - DrawableCompat.setTint(wrappedDrawable,color); + countView.setCardBackgroundColor(color); + setCardBackgroundColor(color); } + + public void setCornerRadius(float radius) { + countView.setRadius(radius); + setRadius(radius); + } /** * This method is used to set color of count i.e integer. * @param color is an object of Color.class. It is used as color of text in tvCount (TextView) diff --git a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatCalls/CometChatCallsAdapter.java b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatCalls/CometChatCallsAdapter.java index d5f1365..af72a2f 100644 --- a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatCalls/CometChatCallsAdapter.java +++ b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatCalls/CometChatCallsAdapter.java @@ -27,6 +27,7 @@ import com.cometchat.pro.uikit.ui_resources.utils.FontUtils; import com.cometchat.pro.uikit.ui_settings.FeatureRestriction; import com.cometchat.pro.uikit.ui_resources.utils.Utils; +import com.cometchat.pro.uikit.ui_settings.UIKitSettings; /** * Purpose - CallListAdapter is a subclass of RecyclerView Adapter which is used to display @@ -203,7 +204,7 @@ public void onBindViewHolder(@NonNull CallViewHolder callViewHolder, int positio } callViewHolder.callListRowBinding.callIv.setImageTintList( - ColorStateList.valueOf(Color.parseColor(FeatureRestriction.getColor()))); + ColorStateList.valueOf(Color.parseColor(UIKitSettings.getColor()))); } diff --git a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatComposeBox/CometChatComposeBox.java b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatComposeBox/CometChatComposeBox.java index 0f6107d..eba8886 100644 --- a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatComposeBox/CometChatComposeBox.java +++ b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatComposeBox/CometChatComposeBox.java @@ -43,6 +43,7 @@ import com.cometchat.pro.uikit.ui_resources.utils.audio_visualizer.AudioRecordView; import com.cometchat.pro.uikit.ui_settings.FeatureRestriction; import com.cometchat.pro.uikit.ui_resources.utils.Utils; +import com.cometchat.pro.uikit.ui_settings.UIKitSettings; public class CometChatComposeBox extends RelativeLayout implements View.OnClickListener { @@ -258,8 +259,8 @@ public void OnMediaSelected(InputContentInfoCompat i) { flBox.setBackgroundTintList(ColorStateList.valueOf(getResources().getColor(R.color.grey))); ivArrow.setImageTintList(ColorStateList.valueOf(getResources().getColor(R.color.grey))); } - if (FeatureRestriction.getColor()!=null) { - int settingsColor = Color.parseColor(FeatureRestriction.getColor()); + if (UIKitSettings.getColor()!=null) { + int settingsColor = Color.parseColor(UIKitSettings.getColor()); ivSend.setImageTintList(ColorStateList.valueOf(settingsColor)); } fetchSettings(); diff --git a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatConversations/CometChatConversations.java b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatConversations/CometChatConversations.java index c5d4d21..92bac8a 100644 --- a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatConversations/CometChatConversations.java +++ b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatConversations/CometChatConversations.java @@ -15,6 +15,7 @@ import com.cometchat.pro.models.BaseMessage; import com.cometchat.pro.models.Conversation; import com.cometchat.pro.models.MessageReceipt; +import com.cometchat.pro.models.TypingIndicator; import com.cometchat.pro.uikit.R; import java.util.List; @@ -188,4 +189,9 @@ public void clearList() { public int size() { return conversationViewModel.size(); } + + public void setTypingIndicator(TypingIndicator typingIndicator, boolean b) { + if (conversationViewModel!=null) + conversationViewModel.setTypingIndicator(typingIndicator,b); + } } diff --git a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatConversations/CometChatConversationsAdapter.java b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatConversations/CometChatConversationsAdapter.java index a438064..0d737e4 100644 --- a/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatConversations/CometChatConversationsAdapter.java +++ b/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatConversations/CometChatConversationsAdapter.java @@ -18,6 +18,7 @@ import com.cometchat.pro.constants.CometChatConstants; import com.cometchat.pro.core.CometChat; import com.cometchat.pro.models.MessageReceipt; +import com.cometchat.pro.models.TypingIndicator; import com.cometchat.pro.uikit.R; import com.cometchat.pro.models.BaseMessage; import com.cometchat.pro.models.Conversation; @@ -66,6 +67,9 @@ public class CometChatConversationsAdapter extends RecyclerView.Adapter() { @Override @@ -52,35 +48,35 @@ public static void isUserSettingsEnabled(OnSuccessListener onSuccessListener) { public static void isOneOnOneChatEnabled(OnSuccessListener onSuccessListener) { CometChat.isFeatureEnabled(Feature.chat_one_on_one_enabled, new CometChat.CallbackListener() { - @Override - public void onSuccess(Boolean aBoolean) { - if (!aBoolean) - UIKitSettings.sendMessageInOneOneOne(false); - onSuccessListener.onSuccess(UIKitSettings.isSendMessageInOneOneOne()); - } + @Override + public void onSuccess(Boolean aBoolean) { + if (!aBoolean) + UIKitSettings.sendMessageInOneOneOne(false); + onSuccessListener.onSuccess(UIKitSettings.isSendMessageInOneOneOne()); + } - @Override - public void onError(CometChatException e) { - e.printStackTrace(); - } - }); + @Override + public void onError(CometChatException e) { + e.printStackTrace(); + } + }); } public static void isGroupChatEnabled(OnSuccessListener onSuccessListener) { CometChat.isFeatureEnabled(Feature.chat_groups_enabled, new CometChat.CallbackListener() { - @Override - public void onSuccess(Boolean aBoolean) { - if (!aBoolean) - UIKitSettings.sendMessageInGroup(false); - onSuccessListener.onSuccess(UIKitSettings.isSendMessageInGroup()); - } + @Override + public void onSuccess(Boolean aBoolean) { + if (!aBoolean) + UIKitSettings.sendMessageInGroup(false); + onSuccessListener.onSuccess(UIKitSettings.isSendMessageInGroup()); + } - @Override - public void onError(CometChatException e) { - e.printStackTrace(); - } - }); + @Override + public void onError(CometChatException e) { + e.printStackTrace(); + } + }); } public static void isDeliveryReceiptsEnabled(OnSuccessListener onSuccessListener) { @@ -161,7 +157,7 @@ public void onSuccess(Boolean aBoolean) { if (!aBoolean || !CometChat.isExtensionEnabled(Feature.Extension.polls)) UIKitSettings.sendPolls(false); else { - UIKitSettings.sendPolls(true); + UIKitSettings.sendPolls(true); } onSuccessListener.onSuccess(UIKitSettings.isSendPolls()); } @@ -406,18 +402,18 @@ public static void isGroupActionMessagesEnabled(OnSuccessListener onSuccessListe public static void isOneOnOneVideoCallEnabled(OnSuccessListener onSuccessListener) { CometChat.isFeatureEnabled(Feature.call_one_on_one_video_enabled, new CometChat.CallbackListener() { - @Override - public void onSuccess(Boolean aBoolean) { - if (!aBoolean) - UIKitSettings.userVideoCall(false); - onSuccessListener.onSuccess(UIKitSettings.isUserVideoCall()); - } + @Override + public void onSuccess(Boolean aBoolean) { + if (!aBoolean) + UIKitSettings.userVideoCall(false); + onSuccessListener.onSuccess(UIKitSettings.isUserVideoCall()); + } - @Override - public void onError(CometChatException e) { - e.printStackTrace(); - } - }); + @Override + public void onError(CometChatException e) { + e.printStackTrace(); + } + }); } public static void isOneOnOneAudioCallEnabled(OnSuccessListener onSuccessListener) { @@ -455,18 +451,18 @@ public void onError(CometChatException e) { public static void isGroupAudioCallEnabled(OnSuccessListener onSuccessListener) { CometChat.isFeatureEnabled(Feature.call_groups_audio_enabled, new CometChat.CallbackListener() { - @Override - public void onSuccess(Boolean aBoolean) { - if (!aBoolean) - UIKitSettings.groupAudioCall(false); - onSuccessListener.onSuccess(UIKitSettings.isGroupAudioCall()); - } + @Override + public void onSuccess(Boolean aBoolean) { + if (!aBoolean) + UIKitSettings.groupAudioCall(false); + onSuccessListener.onSuccess(UIKitSettings.isGroupAudioCall()); + } - @Override - public void onError(CometChatException e) { - e.printStackTrace(); - } - }); + @Override + public void onError(CometChatException e) { + e.printStackTrace(); + } + }); } public static void isMessagesSoundEnabled(OnSuccessListener onSuccessListener) { @@ -492,74 +488,74 @@ public static int getUrlColor() { public static void isLiveReactionEnabled(OnSuccessListener onSuccessListener) { CometChat.isFeatureEnabled(Feature.live_reactions_enabled, new CometChat.CallbackListener() { - @Override - public void onSuccess(Boolean aBoolean) { - if (!aBoolean) - UIKitSettings.sendLiveReaction(false); - onSuccessListener.onSuccess(UIKitSettings.isSendLiveReaction()); - } + @Override + public void onSuccess(Boolean aBoolean) { + if (!aBoolean) + UIKitSettings.sendLiveReaction(false); + onSuccessListener.onSuccess(UIKitSettings.isSendLiveReaction()); + } - @Override - public void onError(CometChatException e) { - e.printStackTrace(); - } - }); + @Override + public void onError(CometChatException e) { + e.printStackTrace(); + } + }); } public static void isReactionEnabled(OnSuccessListener onSuccessListener) { CometChat.isFeatureEnabled(Feature.reactions_enabled, new CometChat.CallbackListener() { - @Override - public void onSuccess(Boolean aBoolean) { - if (!aBoolean || !CometChat.isExtensionEnabled(Feature.Extension.reactions)) - UIKitSettings.sendMessageReaction(false); - else { - UIKitSettings.sendMessageReaction(true); - } - onSuccessListener.onSuccess(UIKitSettings.isSendMessageReaction()); - } - - @Override - public void onError(CometChatException e) { - e.printStackTrace(); - } - }); + @Override + public void onSuccess(Boolean aBoolean) { + if (!aBoolean || !CometChat.isExtensionEnabled(Feature.Extension.reactions)) + UIKitSettings.sendMessageReaction(false); + else { + UIKitSettings.sendMessageReaction(true); + } + onSuccessListener.onSuccess(UIKitSettings.isSendMessageReaction()); + } + + @Override + public void onError(CometChatException e) { + e.printStackTrace(); + } + }); } public static void isCollaborativeWhiteBoardEnabled(OnSuccessListener onSuccessListener) { CometChat.isFeatureEnabled(Feature.collaboration_whiteboard_enabled, new CometChat.CallbackListener() { - @Override - public void onSuccess(Boolean aBoolean) { - if (!aBoolean || !CometChat.isExtensionEnabled(Feature.Extension.whiteboard)) - UIKitSettings.collaborativeWhiteBoard(false); - onSuccessListener.onSuccess(UIKitSettings.isCollaborativeWhiteboard()); - } + @Override + public void onSuccess(Boolean aBoolean) { + if (!aBoolean || !CometChat.isExtensionEnabled(Feature.Extension.whiteboard)) + UIKitSettings.collaborativeWhiteBoard(false); + onSuccessListener.onSuccess(UIKitSettings.isCollaborativeWhiteboard()); + } - @Override - public void onError(CometChatException e) { - e.printStackTrace(); - } - }); + @Override + public void onError(CometChatException e) { + e.printStackTrace(); + } + }); } public static void isCollaborativeDocumentEnabled(OnSuccessListener onSuccessListener) { CometChat.isFeatureEnabled(Feature.collaboration_document_enabled, new CometChat.CallbackListener() { - @Override - public void onSuccess(Boolean aBoolean) { - if (!aBoolean || !CometChat.isExtensionEnabled(Feature.Extension.document)) - UIKitSettings.collaborativeDocument(false); - else - UIKitSettings.collaborativeDocument(true); - onSuccessListener.onSuccess(UIKitSettings.isCollaborativeDocument()); - } - - @Override - public void onError(CometChatException e) { - e.printStackTrace(); - } - }); + @Override + public void onSuccess(Boolean aBoolean) { + if (!aBoolean || !CometChat.isExtensionEnabled(Feature.Extension.document)) + UIKitSettings.collaborativeDocument(false); + else + UIKitSettings.collaborativeDocument(true); + onSuccessListener.onSuccess(UIKitSettings.isCollaborativeDocument()); + } + + @Override + public void onError(CometChatException e) { + e.printStackTrace(); + } + }); } public static void isMessageTranslationEnabled(OnSuccessListener onSuccessListener) { @@ -665,20 +661,20 @@ public void onError(CometChatException e) { } public static void isUserSearchEnabled(OnSuccessListener onSuccessListener) { - CometChat.isFeatureEnabled(Feature.chat_users_search_enabled, new CometChat.CallbackListener() { - @Override - public void onSuccess(Boolean aBoolean) { - if (!aBoolean) - UIKitSettings.searchUser(false); - onSuccessListener.onSuccess(UIKitSettings.isSearchUser()); + CometChat.isFeatureEnabled(Feature.chat_users_search_enabled, new CometChat.CallbackListener() { + @Override + public void onSuccess(Boolean aBoolean) { + if (!aBoolean) + UIKitSettings.searchUser(false); + onSuccessListener.onSuccess(UIKitSettings.isSearchUser()); - } + } - @Override - public void onError(CometChatException e) { - e.printStackTrace(); - } - }); + @Override + public void onError(CometChatException e) { + e.printStackTrace(); + } + }); } public static void isGroupSearchEnabled(OnSuccessListener onSuccessListener) { @@ -882,7 +878,7 @@ public void onSuccess(Boolean aBoolean) { @Override public void onError(CometChatException e) { - e.printStackTrace(); + e.printStackTrace(); } }); } diff --git a/uikit/src/main/java/com/cometchat/pro/uikit/ui_settings/UIKitSettings.java b/uikit/src/main/java/com/cometchat/pro/uikit/ui_settings/UIKitSettings.java index 0bc91e5..7a0301a 100644 --- a/uikit/src/main/java/com/cometchat/pro/uikit/ui_settings/UIKitSettings.java +++ b/uikit/src/main/java/com/cometchat/pro/uikit/ui_settings/UIKitSettings.java @@ -181,6 +181,10 @@ public static void showReplyPrivately(boolean isEnable) { showReplyPrivately = isEnable; } + public static String getColor() { + return UIcolor; + } + public void addConnectionListener(String TAG) { CometChat.addConnectionListener(TAG, new CometChat.ConnectionListener() { @Override @@ -457,7 +461,7 @@ public static void richMedia(boolean isEnable) { public static void sendStickers(boolean isEnable) { - sendStickers = isEnable; + sendStickers = isEnable; } public static void unreadCount(boolean isEnable) { unreadCount = isEnable; } diff --git a/uikit/src/main/res-components/calls/layout/activity_cometchat_callmanager.xml b/uikit/src/main/res-components/calls/layout/activity_cometchat_callmanager.xml index f07db67..9b7afe9 100644 --- a/uikit/src/main/res-components/calls/layout/activity_cometchat_callmanager.xml +++ b/uikit/src/main/res-components/calls/layout/activity_cometchat_callmanager.xml @@ -40,6 +40,7 @@ android:layout_width="48dp" android:id="@+id/caller_av" android:layout_margin="16dp" + app:corner_radius="24dp" android:layout_alignParentEnd="true" tools:src="@tools:sample/avatars" android:layout_height="48dp"/> @@ -107,6 +108,7 @@ + tools:src="@tools:sample/avatars"/> + tools:src="@tools:sample/avatars"/> + diff --git a/uikit/src/main/res-components/groups/layout/cometchat_group_member_row.xml b/uikit/src/main/res-components/groups/layout/cometchat_group_member_row.xml index 520981f..bed4f86 100644 --- a/uikit/src/main/res-components/groups/layout/cometchat_group_member_row.xml +++ b/uikit/src/main/res-components/groups/layout/cometchat_group_member_row.xml @@ -13,16 +13,18 @@ + android:layout_height="36dp" /> diff --git a/uikit/src/main/res-components/messagebubbles/layout/message_left_polls_item.xml b/uikit/src/main/res-components/messagebubbles/layout/message_left_polls_item.xml index 681355c..f97b219 100644 --- a/uikit/src/main/res-components/messagebubbles/layout/message_left_polls_item.xml +++ b/uikit/src/main/res-components/messagebubbles/layout/message_left_polls_item.xml @@ -15,6 +15,7 @@ @@ -19,13 +20,14 @@ + android:layout_height="36dp"/> - - - + android:layout_width="36dp" + app:corner_radius="18dp" + android:layout_height="36dp"/> + + + + \ No newline at end of file diff --git a/uikit/src/main/res-components/shared/layout/cometchat_badge_count.xml b/uikit/src/main/res-components/shared/layout/cometchat_badge_count.xml index ed9ffeb..71bb556 100644 --- a/uikit/src/main/res-components/shared/layout/cometchat_badge_count.xml +++ b/uikit/src/main/res-components/shared/layout/cometchat_badge_count.xml @@ -1,6 +1,7 @@ - @@ -8,13 +9,12 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/uikit/src/main/res-components/userprofile/layout/fragment_cometchat_user_profile.xml b/uikit/src/main/res-components/userprofile/layout/fragment_cometchat_user_profile.xml index 7b9d1e1..9a4d804 100644 --- a/uikit/src/main/res-components/userprofile/layout/fragment_cometchat_user_profile.xml +++ b/uikit/src/main/res-components/userprofile/layout/fragment_cometchat_user_profile.xml @@ -28,13 +28,14 @@ android:layout_width="match_parent" android:layout_height="72dp"> + android:id="@+id/iv_user"/> + android:layout_height="36dp"/> + tools:src="@tools:sample/avatars"/> غادر جارى التحميل إنشاء المجموعة - إرسال الرسالة بشكل خاص + إرسال الرسالة بشكل خاص عرض الصفحة الشخصية هل ترغب في حذف هذه المحادثة؟ حذف المحادثة @@ -290,4 +290,13 @@ رد الردود الرد بشكل خاص + اختر المستخدم + اختر مجموعة + بحث في المستخدمين + مجموعات البحث + مكالمة صوتية مرفوضة + مكالمة فيديو مرفوضة + مكالمة صوتية صادرة + مكالمة فيديو صادرة + لم يتم العثور على أعضاء محظورين \ No newline at end of file diff --git a/uikit/src/main/res/values-de/strings.xml b/uikit/src/main/res/values-de/strings.xml index c1768a5..5e851e3 100644 --- a/uikit/src/main/res/values-de/strings.xml +++ b/uikit/src/main/res/values-de/strings.xml @@ -5,7 +5,7 @@ Gruppen mehr ⚠️ Diese Nachricht wurde gelöscht - 📷 Foto + 📷 Bild 📹 Video 🎵 Audio 📁 Datei @@ -19,7 +19,7 @@ 📃 Dokument Online Du - Admin + Verwalter Moderator Teilnehmerin @@ -28,16 +28,16 @@ Passwort-geschützt Datenschutz und Sicherheit - Gesperrte + Gesperrte Benutzer Präferenzen Du hast geblockt Mitglieder Abbrechen Text in Zwischenablage kopiert - heute + Heute Gestern - tippt... - Bitte geben Sie den Gruppennamen ein + schreibt... + Gruppennamen eingeben Entsperren Gruppenadministrator machen Machen Sie Gruppenmoderator @@ -55,7 +55,7 @@ ✅ Addieren OKAY Mitglieder hinzufügen - AKTIONEN + Aktionen Fügen Sie hinzu Benutzer entsperren Benutzer blockieren @@ -72,9 +72,11 @@ Audio-Anruf Starten Beitreten - hat einen kollaborativen Whiteboar geteilt - Du hast einen neuen kollaborativen Whiteboar erstellt + hat ein kollaboratives Whiteboard geteilt + Du hast ein neues kollaboratives Whiteboard erstellt Du hast ein neues kollaboratives Dokument erstellt + hat ein gemeinschaftliches Dokument geteilt. + Foto- und Videothek Mach ein Foto Standort teilen @@ -82,7 +84,7 @@ Nachricht löschen Antwort-Meldung Nachricht weiterleiten - Faden starten + Antwort im Thread Nachricht teilen Informationen zur Meldung Mitteilung kopieren @@ -97,13 +99,13 @@ Anruf endete Rufen... Verbotene Mitglieder - Aufheben + Entsperren Umfrage erstellen Frage Gib deine Frage ein Geben Sie Ihre Option Einzelheiten - Ban + Sperren Auf Youtube ansehen Besuch Schreiben Sie eine Nachricht @@ -118,9 +120,9 @@ %1$s zu\“ %2$s\“ %1$s wurde zu\“ %2$s\“ hinzugefügt %1$s wird von\“ %2$s\“ entfernt - Möchten Sie von der Gruppe abreisen? - Gruppe löschen - Löschen Sie die Gruppe + Bist du sicher, dass du die Gruppe verlassen willst? + Löschen und beenden + Bist du sicher, dass du löschen möchtest? %1$s kann nicht entfernt werden Lade mehr Laden Sie mehr %1$s Mitglieder @@ -144,7 +146,7 @@ Geben Sie ein altes Passwort Geben Sie ein neues Passwort Gruppen-Alarm - Sie sind Gruppeninhaber, übertragen Sie den Gruppeneigentum an jemand anderen, bevor Sie die Gruppe verlassen. + Du bist der Gruppeninhaber, bitte übertrage die Gruppe an ein Mitglied, bevor Du die Gruppe verlässt. Inhaber machen Möchtest Sie %1$s als Eigentümer machen %1$s ist jetzt Eigentümer @@ -176,9 +178,9 @@ Bilder VIDEOS -Dateien - Du hast keine Gespräche. - Keine Benutzer verfügbar - Keine Gruppen verfügbar + Keine Chats gefunden + Keine Benutzer gefunden + Keine Gruppen gefunden Keine Blockbenutzer Sie haben keine verpassten Anrufe ja @@ -215,7 +217,7 @@ GPS aktiviert GPS deaktiviert Optionen - Eine neue Option hinzufügen + Neue Option hinzufügen Ihr Standort konnte nicht abgerufen werden Beendet Laufende @@ -227,7 +229,6 @@ Einen Anruf einleiten Tippen Sie hier, um das Gespräch zu starten %1$s erfolgreich blockiert - hat ein kollaboratives Dokument freigegeben. Keine Thread-Nachrichten hinzugefügt initiiert @@ -264,7 +265,7 @@ Bitte geben Sie eine gültige UID an Die UID darf nicht leer sein. Bitte geben Sie eine gültige UID an Die UID darf keine Leerzeichen enthalten. Bitte geben Sie eine gültige UID an - etwas ist schief gelaufen + Etwas ist schief gelaufen, bitte versuche es noch einmal Keine Internetverbindung. Bitte versuchen Sie es später erneut Die Erweiterung ist deaktiviert. Bitte aktivieren Sie die Erweiterung über das CometChat-Dashboard Der Gruppenname darf nicht null oder leer sein @@ -272,21 +273,30 @@ verließ die wird heruntergeladen Gruppe erstellen - Nachricht privat senden - Profil anzeigen + Nachricht privat senden + Profil ansehen Möchten Sie diese Konversation löschen? Gespräch löschen offline Neue Nachrichten Neue Nachricht - Geliefert - Lesen + Ausgeliefert + Gesehen Abstimmung - Stimmen - Ablehnen - Antworten - Antworten + Wahlen + Rückgang + Akzeptieren + Antwort Antworten Privat antworten + Ausgehender Audioanruf + Ausgehender Videoanruf + Anruf abgelehnt + Anruf abgelehnt + Keine verbotenen Mitglieder gefunden + Wähle den Benutzer + Wähle die Gruppe + Benutzer suchen + Gruppen suchen \ No newline at end of file diff --git a/uikit/src/main/res/values-es/strings.xml b/uikit/src/main/res/values-es/strings.xml index e2fb9c0..8da7d95 100644 --- a/uikit/src/main/res/values-es/strings.xml +++ b/uikit/src/main/res/values-es/strings.xml @@ -5,12 +5,12 @@ Grupos Más ⚠️ Este mensaje fue eliminado - 📷 Foto + 📷 Imagen 📹 Vídeo 🎵 Audio 📁 Archivo Tienes un mensaje - Llamada de voz perdida» + Llamada de voz perdida Videollamada perdida 📍 Ubicación 📊 Encuesta @@ -19,7 +19,7 @@ 📃 Documento En línea Usted - Admin + Administrador Moderador Participante @@ -40,7 +40,7 @@ Fototeca y Videoteca está escribiendo... - Por favor, introduzca el nombre del grupo + Introducir nombre de grupo Desbloquear Hacer administrador del grupo @@ -59,7 +59,7 @@ ✅ Añadir DE ACUERDO Agregar miembros - ACCIONES + Acciones Añadir en Desbloquear usuario Bloquear usuario @@ -77,9 +77,10 @@ Llamada de audio Lanzamiento Unirse - ha compartido un jabalí blanco colaborativo - Has creado un nuevo jabalí blanco colaborativo - Has creado una nueva documen colaborativa + ha compartido una pizarra colaborativ + Has creado una nueva pizarra colaborativa + Ha creado un nuevo documento colaborativo + ha compartido un documento colaborativo Tomar una foto Compartir ubicación @@ -87,7 +88,7 @@ Eliminar mensaje Mensaje de respuesta Reenviar mensaje - Iniciar subproceso + Responder en hilo Compartir mensaje Información del mensaje Copiar mensaje @@ -98,7 +99,7 @@ Llamada finalizada Llamando... - Desbancar + Levantar la prohibición Crear encuesta Prohibición Ver en Youtube @@ -117,9 +118,9 @@ Añadir %1$s a\» %2$s\» %1$s se agrega a\» %2$s\» %1$s se ha eliminado de\» %2$s\» - ¿Te gustaría salir del grupo? - Eliminar grupo - Eliminar el grupo + ¿Estás seguro de que quieres dejar el grupo? + Eliminar y salir + ¿Está seguro de que desea eliminar? No se puede eliminar %1$s Cargar más Cargar más %1$s miembros @@ -127,6 +128,7 @@ Unirse Incorrecto Miembros prohibidos + No se encontraron miembros prohibidos Miembros prohibidos de %1$s No se puede anular la bana %1$s Introducir descripción del grupo @@ -144,7 +146,7 @@ Introducir contraseña antigua Introduce la nueva contraseña Alerta de grupo - Usted es propietario del grupo, Transfiera la propiedad del grupo a otra persona antes de abandonar el grupo. + Usted es el propietario del grupo, por favor transfiera la propiedad a un miembro antes de abandonar el grupo. Hacer propietario ¿Te gusta hacer %1$s como propietario %1$s ahora es Propietario @@ -179,9 +181,9 @@ Imágenes Vídeos Archivos - No tienes conversaciones. - No hay usuarios disponibles - No hay grupos disponibles + No se encontraron chats. + No se han encontrado usuarios + No se han encontrado grupos Sin bloqueo de usuarios No tienes llamadas perdidas @@ -223,7 +225,7 @@ Introduce tu opción Introduce tu pregunta Pregunta - Agregar una nueva opción + Agregar nueva opción No se puede obtener su ubicación Terminado Continuo @@ -235,7 +237,6 @@ Iniciar una llamada Toca para iniciar una conversación %1$s bloqueado correctamente - ha compartido una documen colaborativa No hay mensajes de hilo adicional iniciado @@ -272,29 +273,37 @@ Proporcione un UID válido UID no puede estar en blanco. Proporcione un UID válido UID no puede contener espacios. Proporcione un UID válido - algo salió mal + Algo salió mal, inténtalo de nuevo No hay conexión a Internet. Vuelve a intentarlo más tarde. La extensión está deshabilitada. Habilite la extensión desde CometChat Dashboard - El nombre del grupo no puede ser nulo ni estar vacío + El nombre del grupo no puede estar en blanco No se pudo encontrar la extensión proporcionada. dejó el grupo descargando creando grupo - Enviar mensaje de forma privada + Enviar mensaje en privado Ver perfil ¿Quieres eliminar esta conversación? Eliminar conversación - desconectado - Nuevos mensajes - Nuevo mensaje + Offline + mensajes nuevos + mensaje nuevo Entregado - Leer + Visto Votar Votos - disminución + Rechazar aceptar - Respuesta - Respuestas + respuesta + respuestas Responder en privado + Llamada de audio saliente + Videollamada saliente + Seleccionar usuario + Selecciona grupo + Buscar usuarios + Grupos de búsqueda + Llamada de voz rechazada + Videollamada rechazada \ No newline at end of file diff --git a/uikit/src/main/res/values-fr/strings.xml b/uikit/src/main/res/values-fr/strings.xml index 3b6b8e4..aaa6737 100644 --- a/uikit/src/main/res/values-fr/strings.xml +++ b/uikit/src/main/res/values-fr/strings.xml @@ -280,7 +280,7 @@ la gauche Téléchargement création d\'un groupe - Envoyer un message en privé + Envoyer un message en privé Voir le profil Souhaitez-vous supprimer cette conversation? Suppression de la conversation @@ -296,6 +296,15 @@ Réponse réponses Répondre en privé + Sélectionnez l\'utilisateur + Sélectionner un groupe + Rechercher des utilisateurs + Groupes de recherche + Appel vocal rejeté + Appel vidéo rejeté + Appel vocal sortant + Appel vidéo sortant + Aucun membre banni trouvé \ No newline at end of file diff --git a/uikit/src/main/res/values-hi/strings.xml b/uikit/src/main/res/values-hi/strings.xml index 1538725..036ec51 100644 --- a/uikit/src/main/res/values-hi/strings.xml +++ b/uikit/src/main/res/values-hi/strings.xml @@ -273,7 +273,7 @@ प्रदान किया गया एक्सटेंशन नहीं मिला। डाउनलोड समूह बनाना - निजी तौर पर संदेश भेजें + निजी तौर पर संदेश भेजें प्रोफ़ाइल देखें क्या आप इस वार्तालाप को हटाना चाहेंगे? वार्तालाप हटाना @@ -289,4 +289,13 @@ जवाब जवाब निजी तौर पर उत्तर दें + उपयोगकर्ता का चयन करें + समूह का चयन करें + उपयोगकर्ता खोजें + समूह खोजें + अस्वीकृत वॉयस कॉल + अस्वीकृत वीडियो कॉल + आउटगोइंग वॉयस कॉल + आउटगोइंग वीडियो कॉल + कोई प्रतिबंधित सदस्य नहीं मिला \ No newline at end of file diff --git a/uikit/src/main/res/values-lt/strings.xml b/uikit/src/main/res/values-lt/strings.xml index 7f78b8a..8aa6a51 100644 --- a/uikit/src/main/res/values-lt/strings.xml +++ b/uikit/src/main/res/values-lt/strings.xml @@ -301,7 +301,7 @@ užblokuotas vartotojas atsisiųsti kurianti grupė - Siųsti pranešimą privačiai + Siųsti pranešimą privačiai Peržiūrėti vartotojo profilį šiandien Ar norėtumėte ištrinti šį pokalbį? @@ -319,5 +319,14 @@ Atsakyti Atsakymai Atsakykite privačiai + Pasirinkite Vartotojas + Pasirinkite Grupė + Ieškoti naudotojų + Ieškoti grupėse + Atmestas balso skambutis + Atmestas vaizdo skambutis + Išeinantis balso skambutis + Išeinantis vaizdo skambutis + Nerasta uždraustų narių \ No newline at end of file diff --git a/uikit/src/main/res/values-ms/strings.xml b/uikit/src/main/res/values-ms/strings.xml index ac4f5d6..0f36663 100644 --- a/uikit/src/main/res/values-ms/strings.xml +++ b/uikit/src/main/res/values-ms/strings.xml @@ -273,7 +273,7 @@ meninggalkan kumpulan memuat turun mewujudkan kumpulan - Hantar Mesej secara tertutup + Hantar Mesej secara tertutup Lihat profil Adakah anda mahu memadamkan perbualan ini? Memadamkan Perbualan @@ -289,4 +289,13 @@ Balas Balasan Balas secara tertutup + Pilih Pengguna + Pilih Kumpulan + Cari Pengguna + Cari Kumpulan + Panggilan suara ditolak + Panggilan video ditolak + Panggilan suara keluar + Panggilan video keluar + Tiada Ahli Larangan Ditemui \ No newline at end of file diff --git a/uikit/src/main/res/values-pt/strings.xml b/uikit/src/main/res/values-pt/strings.xml index 00e3889..132974b 100644 --- a/uikit/src/main/res/values-pt/strings.xml +++ b/uikit/src/main/res/values-pt/strings.xml @@ -273,7 +273,7 @@ deixou o grupo baixando criando grupo - Enviar mensagem em particular + Enviar mensagem em particular Ver perfil Você gostaria de excluir esta conversa? Excluindo a conversa @@ -289,5 +289,14 @@ Responder Respostas Responder em particular + Selecione o usuário + Selecione o Grupo + Usuários de busca + Grupos de Pesquisa + Chamada de voz rejeitada + Vídeo chamada rejeitada + Chamada de voz de saída + Chamada de vídeo realizada + Nenhum membro banido encontrado \ No newline at end of file diff --git a/uikit/src/main/res/values-ru/strings.xml b/uikit/src/main/res/values-ru/strings.xml index e1569eb..72a5c25 100644 --- a/uikit/src/main/res/values-ru/strings.xml +++ b/uikit/src/main/res/values-ru/strings.xml @@ -275,7 +275,7 @@ покинул группу скачивание Создание группы - Отправить сообщение в частном порядке + Отправить сообщение в частном порядке Просмотреть профиль Вы хотите удалить этот разговор? Удаление разговора @@ -291,4 +291,13 @@ Новое сообщение Не в сети Ответить лично + Выбрать пользователя + Выбрать группу + Поиск пользователей + Поисковые группы + Отклоненный голосовой вызов + Отклоненный видеовызов + Исходящий голосовой вызов + Исходящий видеозвонок + Забаненные участники не найдены \ No newline at end of file diff --git a/uikit/src/main/res/values-sv/strings.xml b/uikit/src/main/res/values-sv/strings.xml index 229ec8a..81cc9c9 100644 --- a/uikit/src/main/res/values-sv/strings.xml +++ b/uikit/src/main/res/values-sv/strings.xml @@ -299,7 +299,7 @@ grupp laddar ner skapa grupp - Skicka meddelande privat + Skicka meddelande privat Visa profil i dag Vill du radera den här konversationen? @@ -317,5 +317,14 @@ Svar Svar Svara privat + Välj Användare + Välj Grupp + Sök användare + Sök grupper + Avvisat röstsamtal + Avvisat videosamtal + Utgående röstsamtal + Utgående videosamtal + Inga förbjudna medlemmar hittades \ No newline at end of file diff --git a/uikit/src/main/res/values-zh-rTW/strings.xml b/uikit/src/main/res/values-zh-rTW/strings.xml index c5944b6..21e3f68 100644 --- a/uikit/src/main/res/values-zh-rTW/strings.xml +++ b/uikit/src/main/res/values-zh-rTW/strings.xml @@ -273,7 +273,7 @@ 剩下 正在下載 建立小组 - 私下发送消息 + 私下发送消息 查看資料 您要删除此对话吗? 删除对话 @@ -289,4 +289,13 @@ 回复 回复 私下回复 + 選擇用戶 + 選擇組 + 搜索用戶 + 搜索組 + 被拒絕的語音電話 + 拒絕視頻通話 + 撥出語音電話 + 傳出視頻通話 + 沒有發現被禁止的成員 \ No newline at end of file diff --git a/uikit/src/main/res/values-zh/strings.xml b/uikit/src/main/res/values-zh/strings.xml index b74ea4d..1f70bc7 100644 --- a/uikit/src/main/res/values-zh/strings.xml +++ b/uikit/src/main/res/values-zh/strings.xml @@ -272,7 +272,7 @@ 剩下 正在下载 建立小组 - 私下发送消息 + 私下发送消息 查看资料 您要删除此对话吗? 删除对话 @@ -288,4 +288,13 @@ 回复 回复 私下回复 + 选择用户 + 选择组 + 搜索用户 + 搜索组 + 被拒绝的语音电话 + 拒绝视频通话 + 拨出语音电话 + 传出视频通话 + 没有发现被禁止的成员 \ No newline at end of file diff --git a/uikit/src/main/res/values/attr.xml b/uikit/src/main/res/values/attr.xml index 7e46333..6cc34e7 100644 --- a/uikit/src/main/res/values/attr.xml +++ b/uikit/src/main/res/values/attr.xml @@ -7,10 +7,12 @@ - - + + + + diff --git a/uikit/src/main/res/values/color.xml b/uikit/src/main/res/values/color.xml index 197e100..32b3005 100644 --- a/uikit/src/main/res/values/color.xml +++ b/uikit/src/main/res/values/color.xml @@ -1,7 +1,7 @@ - #03A9F4 - #169CD8 + #3399FF + #808080 #2196F3 #000000 diff --git a/uikit/src/main/res/values/colors.xml b/uikit/src/main/res/values/colors.xml new file mode 100644 index 0000000..df40388 --- /dev/null +++ b/uikit/src/main/res/values/colors.xml @@ -0,0 +1,4 @@ + + + #C4C4C4 + \ No newline at end of file diff --git a/uikit/src/main/res/values/strings.xml b/uikit/src/main/res/values/strings.xml index eed7dd2..5924819 100644 --- a/uikit/src/main/res/values/strings.xml +++ b/uikit/src/main/res/values/strings.xml @@ -126,6 +126,12 @@ Audio Call Missed voice call Missed video call + Rejected voice call + Rejected video call + Outgoing voice call + Outgoing video call + Incoming Audio Call + Incoming Video Call You have not made any calls @@ -137,8 +143,6 @@ All Missed New Call - Incoming Audio Call - Incoming Video Call Missed Rejected Call is Ongoing @@ -249,6 +253,7 @@ Yesterday Ban Banned Successfully + No Banned Members Found unblocked successfully You cannot forward message to more than 5 members 🎵 Audio @@ -312,7 +317,7 @@ Downloading Creating Group - Send Message Privately + Send Message Privately View Profile Today In a thread