diff --git a/ConnectionService + Firebase/app/build.gradle b/ConnectionService + Firebase/app/build.gradle index a496e13..821f835 100644 --- a/ConnectionService + Firebase/app/build.gradle +++ b/ConnectionService + Firebase/app/build.gradle @@ -1,16 +1,17 @@ apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services' +apply plugin: 'com.google.firebase.crashlytics' android { - compileSdkVersion 29 + compileSdkVersion 30 defaultConfig { applicationId "com.cometchat.pro.android.pushnotification" - minSdkVersion 21 - targetSdkVersion 29 + minSdkVersion 24 + targetSdkVersion 30 versionCode 1 renderscriptSupportModeEnabled true multiDexEnabled true - versionName "1.0" + versionName "2.4" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" manifestPlaceholders = [file_provider: "com.cometchat.pro.android.pushnotification"] @@ -34,6 +35,19 @@ android { } } + + android.applicationVariants.all { variant -> + variant.outputs.all { + outputFileName = "Push Notification Sample" + outputFileName += "-v" + android.defaultConfig.versionName + if (variant.buildType.name == "release") { + outputFileName += ".apk" + } else { + outputFileName += "-debug.apk" + } + } + } + lintOptions { checkReleaseBuilds false // Or, if you prefer, you can continue to check for errors in release builds, @@ -50,15 +64,20 @@ dependencies { implementation 'androidx.navigation:navigation-fragment:2.0.0' implementation 'androidx.navigation:navigation-ui:2.0.0' implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0' - implementation 'com.google.firebase:firebase-messaging:20.2.4' + + implementation platform('com.google.firebase:firebase-bom:28.3.1') + implementation 'com.google.firebase:firebase-messaging' + implementation 'com.google.firebase:firebase-crashlytics' + implementation 'com.google.firebase:firebase-analytics' testImplementation 'junit:junit:4.12' implementation 'androidx.recyclerview:recyclerview:1.0.0' androidTestImplementation 'androidx.test:runner:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' implementation project(':uikit') - implementation 'com.google.android.material:material:1.2.0-alpha05' + implementation 'com.google.android.material:material:1.2.0-alpha01' implementation 'com.facebook.shimmer:shimmer:0.4.0' // - implementation 'com.cometchat:pro-android-chat-sdk:2.3.5' + implementation 'com.cometchat:pro-android-chat-sdk:2.4.1' + implementation 'com.cometchat:pro-android-calls-sdk:2.1.0' } diff --git a/ConnectionService + Firebase/app/src/main/AndroidManifest.xml b/ConnectionService + Firebase/app/src/main/AndroidManifest.xml index ef45f70..0f516e3 100644 --- a/ConnectionService + Firebase/app/src/main/AndroidManifest.xml +++ b/ConnectionService + Firebase/app/src/main/AndroidManifest.xml @@ -5,6 +5,11 @@ + + + + + () { @Override public void onSuccess(User user) { - startActivity(new Intent(CreateUserActivity.this,PushNotificationActivity.class)); + startActivity(new Intent(CreateUserActivity.this, PushNotificationActivity.class)); } @Override diff --git a/ConnectionService + Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/LoginActivity.java b/ConnectionService + Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/LoginActivity.java index f7ca9ae..abf22c8 100644 --- a/ConnectionService + Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/LoginActivity.java +++ b/ConnectionService + Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/LoginActivity.java @@ -23,8 +23,7 @@ import com.google.android.gms.tasks.Task; import com.google.android.material.textfield.TextInputEditText; import com.google.android.material.textfield.TextInputLayout; -import com.google.firebase.iid.FirebaseInstanceId; -import com.google.firebase.iid.InstanceIdResult; +import com.google.firebase.messaging.FirebaseMessaging; public class LoginActivity extends AppCompatActivity { @@ -103,18 +102,17 @@ private void login(String uid) { public void onSuccess(User user) { token = MyFirebaseMessagingService.token; if (MyFirebaseMessagingService.token==null) { - FirebaseInstanceId.getInstance().getInstanceId() - .addOnCompleteListener(new OnCompleteListener() { - @Override - public void onComplete(@NonNull Task task) { - if (!task.isSuccessful()) { - Toast.makeText(LoginActivity.this, task.getException().getLocalizedMessage(), Toast.LENGTH_LONG).show(); - return; - } - token = task.getResult().getToken(); - registerPushNotification(token); - } - }); + FirebaseMessaging.getInstance().getToken().addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + if (!task.isSuccessful()) { + Toast.makeText(LoginActivity.this, task.getException().getLocalizedMessage(), Toast.LENGTH_LONG).show(); + return; + } + token = task.getResult(); + registerPushNotification(token); + } + }); } else { registerPushNotification(token); } diff --git a/ConnectionService + Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/MainActivity.java b/ConnectionService + Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/MainActivity.java index 2604701..c853c8b 100644 --- a/ConnectionService + Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/MainActivity.java +++ b/ConnectionService + Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/MainActivity.java @@ -21,8 +21,7 @@ import com.google.android.gms.tasks.Task; import com.google.android.material.button.MaterialButton; import com.google.android.material.card.MaterialCardView; -import com.google.firebase.iid.FirebaseInstanceId; -import com.google.firebase.iid.InstanceIdResult; +import com.google.firebase.messaging.FirebaseMessaging; public class MainActivity extends AppCompatActivity { @@ -47,7 +46,7 @@ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if (CometChat.getLoggedInUser()!=null) - startActivity(new Intent(MainActivity.this,PushNotificationActivity.class)); + startActivity(new Intent(MainActivity.this, PushNotificationActivity.class)); loginBtn = findViewById(R.id.login); superhero1 = findViewById(R.id.superhero1); superhero2 = findViewById(R.id.superhero2); @@ -92,18 +91,18 @@ private void login(String uid) { public void onSuccess(User user) { token = MyFirebaseMessagingService.token; if (token==null) { - FirebaseInstanceId.getInstance().getInstanceId() - .addOnCompleteListener(new OnCompleteListener() { - @Override - public void onComplete(@NonNull Task task) { - if (!task.isSuccessful()) { - Toast.makeText(MainActivity.this, task.getException().getLocalizedMessage(), Toast.LENGTH_LONG).show(); - return; - } - token = task.getResult().getToken(); - registerPushNotification(uid,token); - } - }); + FirebaseMessaging.getInstance().getToken().addOnCompleteListener(new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + if (!task.isSuccessful()) { + Toast.makeText(MainActivity.this, task.getException().getLocalizedMessage(), Toast.LENGTH_LONG).show(); + return; + } + token = task.getResult(); + Log.e(TAG, "onComplete: "+token); + registerPushNotification(uid,token); + } + }); } else { registerPushNotification(uid,token); } diff --git a/ConnectionService + Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/MoreActionFragment.java b/ConnectionService + Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/MoreActionFragment.java index 23583a4..d888aa9 100644 --- a/ConnectionService + Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/MoreActionFragment.java +++ b/ConnectionService + Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/MoreActionFragment.java @@ -2,6 +2,7 @@ import android.app.Activity; import android.content.DialogInterface; +import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.LayoutInflater; @@ -17,6 +18,7 @@ import com.cometchat.pro.android.pushnotification.utils.MyFirebaseMessagingService; import com.cometchat.pro.core.CometChat; import com.cometchat.pro.exceptions.CometChatException; +import com.cometchat.pro.uikit.ui_components.cometchat_ui.CometChatUI; import com.google.android.material.bottomsheet.BottomSheetBehavior; import com.google.android.material.bottomsheet.BottomSheetDialog; import com.google.android.material.bottomsheet.BottomSheetDialogFragment; @@ -24,6 +26,7 @@ public class MoreActionFragment extends BottomSheetDialogFragment { private TextView loggedInUser; + private TextView launchUI; private TextView logout; private String TAG = "MoreAction"; @@ -72,6 +75,14 @@ public void onError(CometChatException e) { }); } }); + + launchUI = view.findViewById(R.id.launch_ui_kit); + launchUI.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + startActivity(new Intent(getContext(), CometChatUI.class)); + } + }); return view; } } \ No newline at end of file diff --git a/ConnectionService + Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/PushNotificationActivity.java b/ConnectionService + Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/PushNotificationActivity.java index c3f284e..0f2c2b8 100644 --- a/ConnectionService + Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/PushNotificationActivity.java +++ b/ConnectionService + Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/PushNotificationActivity.java @@ -4,10 +4,13 @@ import androidx.appcompat.app.AppCompatActivity; import android.Manifest; +import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.ContentResolver; +import android.content.DialogInterface; import android.content.Intent; import android.content.res.ColorStateList; +import android.os.Build; import android.os.Bundle; import android.util.Log; import android.view.View; @@ -29,6 +32,7 @@ import com.cometchat.pro.models.MediaMessage; import com.cometchat.pro.models.TextMessage; import com.cometchat.pro.models.User; +import com.cometchat.pro.uikit.ui_components.calls.callconnection.CallManager; import com.cometchat.pro.uikit.ui_resources.constants.UIKitConstants; import com.cometchat.pro.uikit.ui_resources.utils.CallUtils; import com.cometchat.pro.uikit.ui_resources.utils.MediaUtils; @@ -56,10 +60,43 @@ public class PushNotificationActivity extends AppCompatActivity { private String receiver = CometChatConstants.RECEIVER_TYPE_USER; private TextInputLayout uidLayout; private ProgressDialog progressDialog; + + private String[] permissions = new String[]{Manifest.permission.RECORD_AUDIO, + Manifest.permission.CAMERA,Manifest.permission.WRITE_EXTERNAL_STORAGE, + Manifest.permission.ANSWER_PHONE_CALLS,Manifest.permission.CALL_PHONE, + Manifest.permission.MANAGE_OWN_CALLS,Manifest.permission.READ_PHONE_STATE}; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_push_notification); + if (!Utils.hasPermissions(this,permissions)) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + requestPermissions(permissions, + UIKitConstants.RequestCode.RECORD); + } + } + + CallManager callManager = new CallManager(this); + if (!callManager.checkAccountConnection(this)) { + AlertDialog.Builder alertDialog = new AlertDialog.Builder(this); + alertDialog.setTitle("VoIP Permission"); + alertDialog.setMessage("To make VoIP Calling work properly, you need to allow certain " + + "permission from your call account settings for this app."); + alertDialog.setPositiveButton("Open Settings", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + callManager.launchVoIPSetting(PushNotificationActivity.this); + } + }); + alertDialog.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + alertDialog.create().show(); + } + progressDialog = new ProgressDialog(this); progressDialog.setTitle(getResources().getString(R.string.please_wait)); progressDialog.setMessage(getResources().getString(R.string.media_uploading)); diff --git a/ConnectionService + Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/UIKitApplication.java b/ConnectionService + Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/UIKitApplication.java index 078b8d3..3e9ea90 100644 --- a/ConnectionService + Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/UIKitApplication.java +++ b/ConnectionService + Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/UIKitApplication.java @@ -5,22 +5,38 @@ import android.app.Notification; import android.app.NotificationChannel; import android.app.NotificationManager; +import android.content.BroadcastReceiver; +import android.content.Context; import android.content.DialogInterface; +import android.content.Intent; +import android.content.IntentFilter; import android.media.AudioAttributes; import android.net.Uri; import android.os.Build; import android.util.Log; import android.widget.Toast; + +import androidx.lifecycle.Lifecycle; +import androidx.lifecycle.LifecycleObserver; +import androidx.lifecycle.OnLifecycleEvent; +import androidx.lifecycle.ProcessLifecycleOwner; + import com.cometchat.pro.core.AppSettings; +import com.cometchat.pro.core.Call; import com.cometchat.pro.core.CometChat; import com.cometchat.pro.exceptions.CometChatException; import com.cometchat.pro.android.pushnotification.constants.AppConfig; +import com.cometchat.pro.uikit.ui_components.calls.call_manager.CometChatStartCallActivity; import com.cometchat.pro.uikit.ui_components.calls.call_manager.listener.CometChatCallListener; +import com.cometchat.pro.uikit.ui_components.calls.callconnection.CallNotificationAction; +import com.cometchat.pro.uikit.ui_resources.constants.UIKitConstants; -public class UIKitApplication extends Application { +public class UIKitApplication extends Application implements LifecycleObserver { private static final String TAG = "UIKitApplication"; + public static boolean isBackground; + @Override public void onCreate() { super.onCreate(); @@ -37,10 +53,20 @@ public void onError(CometChatException e) { Toast.makeText(UIKitApplication.this, e.getMessage(), Toast.LENGTH_SHORT).show(); } }); + CometChatCallListener.addCallListener(TAG,this); createNotificationChannel(); + ProcessLifecycleOwner.get().getLifecycle().addObserver(this); } + @OnLifecycleEvent(Lifecycle.Event.ON_START) + public void onMoveToForeground() { + isBackground=false; + } + @OnLifecycleEvent(Lifecycle.Event.ON_STOP) + public void onMoveToBackground() { + isBackground = true; + } private void createNotificationChannel() { // Create the NotificationChannel, but only on API 26+ because @@ -58,6 +84,5 @@ private void createNotificationChannel() { NotificationManager notificationManager = getSystemService(NotificationManager.class); notificationManager.createNotificationChannel(channel); } - } } diff --git a/ConnectionService + Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/constants/AppConfig.java b/ConnectionService + Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/constants/AppConfig.java index 2b3a671..ed4f70f 100644 --- a/ConnectionService + Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/constants/AppConfig.java +++ b/ConnectionService + Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/constants/AppConfig.java @@ -4,9 +4,9 @@ public class AppConfig { public class AppDetails { - public static final String APP_ID = "XXXXXXXXXXXXXXXXX"; + public static final String APP_ID = "XXXXXXXXXXXXXX"; - public static final String AUTH_KEY = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; + public static final String AUTH_KEY = "XXXXXXXXXXXXXXXXXXXXXXXX"; public static final String REGION = "XX"; } diff --git a/ConnectionService + Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/utils/MyFirebaseMessagingService.java b/ConnectionService + Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/utils/MyFirebaseMessagingService.java index 6e7c4c0..624c521 100644 --- a/ConnectionService + Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/utils/MyFirebaseMessagingService.java +++ b/ConnectionService + Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/utils/MyFirebaseMessagingService.java @@ -2,7 +2,10 @@ import android.app.Notification; import android.app.PendingIntent; +import android.content.BroadcastReceiver; +import android.content.Context; import android.content.Intent; +import android.content.IntentFilter; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.media.AudioManager; @@ -19,6 +22,7 @@ import androidx.core.graphics.drawable.IconCompat; import com.cometchat.pro.android.pushnotification.R; +import com.cometchat.pro.android.pushnotification.UIKitApplication; import com.cometchat.pro.android.pushnotification.constants.AppConfig; import com.cometchat.pro.constants.CometChatConstants; import com.cometchat.pro.core.Call; @@ -28,6 +32,8 @@ import com.cometchat.pro.models.BaseMessage; import com.cometchat.pro.models.Group; import com.cometchat.pro.models.MediaMessage; +import com.cometchat.pro.uikit.ui_components.calls.call_manager.CometChatCallActivity; +import com.cometchat.pro.uikit.ui_components.calls.call_manager.CometChatStartCallActivity; import com.cometchat.pro.uikit.ui_components.calls.call_manager.helper.CometChatAudioHelper; import com.cometchat.pro.uikit.ui_components.calls.callconnection.CallManager; import com.cometchat.pro.uikit.ui_components.calls.callconnection.CallNotificationAction; @@ -60,6 +66,8 @@ public class MyFirebaseMessagingService extends FirebaseMessagingService { private static final int REQUEST_CODE = 12; private boolean isCall; + CallManager callManager; + public static void subscribeUserNotification(String UID) { FirebaseMessaging.getInstance().subscribeToTopic(AppConfig.AppDetails.APP_ID + "_"+ CometChatConstants.RECEIVER_TYPE_USER +"_" + @@ -183,8 +191,17 @@ private void showNotifcation(BaseMessage baseMessage) { .setGroupSummary(true); NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this); - if (isCall){ - initiateCallService(call); + if (isCall && json.getString("alert").contains("Incoming")) { + if (UIKitApplication.isBackground) + initiateCallService(call); + } else if(isCall && json.getString("alert").contains("Missed")) { + if (UIKitApplication.isBackground) + endCallService(); + else { + if (CometChatCallActivity.callActivity != null) { + CometChatCallActivity.callActivity.finish(); + } + } } else { // Person person = createPerson(baseMessage); @@ -208,9 +225,13 @@ private void showNotifcation(BaseMessage baseMessage) { } + private void endCallService() { + if(callManager==null) + callManager = new CallManager(getApplicationContext()); + callManager.endCall(); + } private void initiateCallService(Call call) { try { - CallManager callManager; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { Log.e("initiateCallService: ",call.toString()); callManager = new CallManager(getApplicationContext()); @@ -222,12 +243,4 @@ private void initiateCallService(Call call) { e.getMessage(), Toast.LENGTH_LONG); } } - - private Intent getCallIntent(String title){ - Intent callIntent = new Intent(getApplicationContext(), CallNotificationAction.class); - callIntent.putExtra(UIKitConstants.IntentStrings.SESSION_ID,call.getSessionId()); - callIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - callIntent.setAction(title); - return callIntent; - } } diff --git a/ConnectionService + Firebase/app/src/main/res/layout/fragment_more_actions.xml b/ConnectionService + Firebase/app/src/main/res/layout/fragment_more_actions.xml index 8665a3c..cc5f09e 100644 --- a/ConnectionService + Firebase/app/src/main/res/layout/fragment_more_actions.xml +++ b/ConnectionService + Firebase/app/src/main/res/layout/fragment_more_actions.xml @@ -12,6 +12,15 @@ android:layout_margin="16dp" android:layout_width="match_parent" android:layout_height="wrap_content"/> + + + - - - - - - - - + + + + - + \ No newline at end of file diff --git a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_list/CometChatCallList.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_list/CometChatCallList.java index 96a71d5..09bc78e 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_list/CometChatCallList.java +++ b/ConnectionService + Firebase/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; @@ -83,20 +84,17 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, // Inflate the layout for this fragment view = inflater.inflate(R.layout.fragment_cometchat_calls, container, false); tvTitle = view.findViewById(R.id.tv_title); - fetchSettings(); CometChatError.init(getContext()); phoneAddIv = view.findViewById(R.id.add_phone_iv); - if (oneOnoneCallEnabled || oneOnoneVideoCallEnabled) - phoneAddIv.setVisibility(View.VISIBLE); - else - phoneAddIv.setVisibility(View.GONE); - phoneAddIv.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { openUserListScreen(); } }); + + fetchSettings(); + viewPager = view.findViewById(R.id.viewPager); tabLayout = view.findViewById(R.id.tabLayout); if (getActivity() != null) { @@ -106,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)); @@ -121,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 @@ -149,13 +147,15 @@ private void fetchSettings() { FeatureRestriction.isOneOnOneAudioCallEnabled(new FeatureRestriction.OnSuccessListener() { @Override public void onSuccess(Boolean booleanVal) { - oneOnoneCallEnabled = booleanVal; + if (booleanVal) + phoneAddIv.setVisibility(View.VISIBLE); } }); FeatureRestriction.isOneOnOneVideoCallEnabled(new FeatureRestriction.OnSuccessListener() { @Override public void onSuccess(Boolean booleanVal) { - oneOnoneVideoCallEnabled = booleanVal; + if (booleanVal) + phoneAddIv.setVisibility(View.VISIBLE); } }); } diff --git a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_list/CometChatNewCallList.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_list/CometChatNewCallList.java index f98782d..78c6137 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_list/CometChatNewCallList.java +++ b/ConnectionService + Firebase/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; @@ -101,19 +102,19 @@ public CometChatNewCallList() { protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.fragment_cometchat_userlist); + fetchSettings(); title = findViewById(R.id.tv_title); CometChatError.init(this); ImageView imageView = new ImageView(this); - imageView.setImageDrawable(getResources().getDrawable(R.drawable.ic_close_24dp)); - if (FeatureRestriction.getColor()!=null) { - getWindow().setStatusBarColor(Color.parseColor(FeatureRestriction.getColor())); + imageView.setImageDrawable(getResources().getDrawable(R.drawable.ic_back_arrow_selected)); + 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))); - fetchSettings(); imageView.setClickable(true); imageView.setPadding(8,8,8,8); RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); @@ -128,11 +129,11 @@ public void onClick(View v) { onBackPressed(); } }); - title.setTypeface(FontUtils.getInstance(this).getTypeFace(FontUtils.robotoMedium)); RelativeLayout.LayoutParams titleLayoutParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); titleLayoutParams.setMargins(16,32,16,48); titleLayoutParams.addRule(RelativeLayout.CENTER_HORIZONTAL); title.setLayoutParams(titleLayoutParams); + title.setTextAppearance(R.style.TextAppearance_AppCompat_Large); title.setText(getResources().getString(R.string.new_call)); rvUserList = findViewById(R.id.rv_user_list); etSearch = findViewById(R.id.search_bar); @@ -201,9 +202,7 @@ public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newStat } }); - if (audioCallEnabled || videoCallEnabled) { - // Used to trigger event on click of user item in rvUserList (RecyclerView) - rvUserList.setItemClickListener(new OnItemClickListener() { + rvUserList.setItemClickListener(new OnItemClickListener() { @Override public void OnItemClick(User var, int position) { User user = var; @@ -229,7 +228,7 @@ public void onClick(DialogInterface dialogInterface, int i) { alertDialog.show(); } }); - } + fetchUsers(); } diff --git a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_manager/CometChatCallActivity.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_manager/CometChatCallActivity.java index 28fbc7c..dca99c3 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_manager/CometChatCallActivity.java +++ b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_manager/CometChatCallActivity.java @@ -234,10 +234,10 @@ public void setCallType(boolean isVideoCall, boolean isIncoming) { outgoingCallView.setVisibility(View.GONE); if (isVideoCall) { callMessage.setText(getResources().getString(R.string.incoming_video_call)); - callMessage.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(R.drawable.ic_videocam_white_24dp),null,null,null); + callMessage.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(R.drawable.ic_incoming_video_call),null,null,null); } else { callMessage.setText(getResources().getString(R.string.incoming_audio_call)); - callMessage.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(R.drawable.ic_call_incoming_24dp),null,null,null); + callMessage.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(R.drawable.ic_incoming_call),null,null,null); } } else { callTv.setText(getString(R.string.calling)); @@ -248,7 +248,7 @@ public void setCallType(boolean isVideoCall, boolean isIncoming) { if (isVideoCall) { cameraPreview = new CameraPreview(this); cameraFrame.addView(cameraPreview); - hangUp.setImageDrawable(getResources().getDrawable(R.drawable.ic_videocam_white_24dp)); + hangUp.setImageDrawable(getResources().getDrawable(R.drawable.ic_videocall)); } else { hangUp.setImageDrawable(getResources().getDrawable(R.drawable.ic_call_end_white_24dp)); diff --git a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_manager/CometChatStartCallActivity.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_manager/CometChatStartCallActivity.java index f722f7f..e680847 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_manager/CometChatStartCallActivity.java +++ b/ConnectionService + Firebase/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/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_manager/listener/CometChatCallListener.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_manager/listener/CometChatCallListener.java index 716f5e8..b03e4ed 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_manager/listener/CometChatCallListener.java +++ b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_manager/listener/CometChatCallListener.java @@ -2,7 +2,6 @@ import android.content.Context; -import android.os.Build; import android.widget.Toast; import com.cometchat.pro.constants.CometChatConstants; @@ -14,7 +13,6 @@ import com.cometchat.pro.uikit.ui_components.calls.call_manager.CometChatCallActivity; import com.cometchat.pro.uikit.ui_components.calls.call_manager.CometChatStartCallActivity; -import com.cometchat.pro.uikit.ui_components.calls.callconnection.MyConnectionService; import com.cometchat.pro.uikit.ui_resources.utils.CallUtils; /** @@ -77,19 +75,12 @@ public void onOutgoingCallAccepted(Call call) { @Override public void onOutgoingCallRejected(Call call) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - if (MyConnectionService.conn != null) - MyConnectionService.conn.onOutgoingReject(); - } if (CometChatCallActivity.callActivity!=null) CometChatCallActivity.callActivity.finish(); } @Override public void onIncomingCallCancelled(Call call){ - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - MyConnectionService.conn.onDisconnect(); - } if (CometChatCallActivity.callActivity!=null) CometChatCallActivity.callActivity.finish(); } diff --git a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/callconnection/CallConnection.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/callconnection/CallConnection.java index 68613aa..3a6360a 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/callconnection/CallConnection.java +++ b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/callconnection/CallConnection.java @@ -28,12 +28,12 @@ @RequiresApi(api = Build.VERSION_CODES.M) public class CallConnection extends Connection { - Context context; + MyConnectionService service; Call call; String TAG = "CallConnection"; - public CallConnection(Context context,Call call) { - this.context = context; + public CallConnection(MyConnectionService service,Call call) { + this.service = service; this.call = call; Log.e(TAG, "CallConnection: "+call.toString()); } @@ -67,7 +67,7 @@ public void onSuccess(Call call) { @Override public void onError(CometChatException e) { - Toast.makeText(context,"Unable to end call due to ${p0?.code}", + Toast.makeText(service,"Unable to end call due to ${p0?.code}", Toast.LENGTH_LONG).show(); } }); @@ -79,6 +79,36 @@ public void destroyConnection() { super.destroy(); } + @Override + public void onAnswer(int videoState) { + Log.e(TAG, "onAnswerVideo: " ); + if (call.getSessionId()!=null) { + CometChat.acceptCall(call.getSessionId(), new CometChat.CallbackListener() { + @Override + public void onSuccess(Call call) { + Log.e(TAG, "onSuccess: accept"); + service.sendBroadcast(getCallIntent("Answers")); +// Intent acceptIntent = new Intent(service, CometChatStartCallActivity.class); +// acceptIntent.putExtra(UIKitConstants.IntentStrings.SESSION_ID, call.getSessionId()); +// acceptIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); +// service.startActivity(acceptIntent); + destroyConnection(); + } + + @Override + public void onError(CometChatException e) { + destroyConnection(); + Toast.makeText(service, "Error " + e.getMessage(), Toast.LENGTH_LONG).show(); + } + }); + } + } + + @Override + public void onShowIncomingCallUi() { + Log.e(TAG, "onShowIncomingCallUi: " ); + } + @Override public void onAnswer() { Log.i(TAG, "onAnswer"+call.getSessionId()); @@ -87,17 +117,18 @@ public void onAnswer() { @Override public void onSuccess(Call call) { Log.e(TAG, "onSuccess: accept"); + service.sendBroadcast(getCallIntent("Answers")); +// Intent acceptIntent = new Intent(service, CometChatStartCallActivity.class); +// acceptIntent.putExtra(UIKitConstants.IntentStrings.SESSION_ID, call.getSessionId()); +// acceptIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); +// service.startActivity(acceptIntent); destroyConnection(); - Intent acceptIntent = new Intent(context, CometChatStartCallActivity.class); - acceptIntent.putExtra(UIKitConstants.IntentStrings.SESSION_ID, call.getSessionId()); - acceptIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - context.startActivity(acceptIntent); } @Override public void onError(CometChatException e) { destroyConnection(); - Toast.makeText(context, "Error " + e.getMessage(), Toast.LENGTH_LONG).show(); + e.printStackTrace(); } }); } @@ -130,7 +161,6 @@ public void onSuccess(Call call) { public void onError(CometChatException e) { destroyConnection(); Log.e(TAG, "onErrorReject: "+e.getMessage()); - Toast.makeText(context,"ErrorReject: "+e.getMessage(),Toast.LENGTH_LONG).show(); } }); } @@ -141,4 +171,12 @@ public void onOutgoingReject() { destroyConnection(); setDisconnected(new DisconnectCause(DisconnectCause.REMOTE, "REJECTED")); } + + private Intent getCallIntent(String title){ + Intent callIntent = new Intent(service, CallNotificationAction.class); + callIntent.putExtra(UIKitConstants.IntentStrings.SESSION_ID,call.getSessionId()); + callIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + callIntent.setAction(title); + return callIntent; + } } diff --git a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/callconnection/CallManager.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/callconnection/CallManager.java index 8ab9a90..5f95fca 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/callconnection/CallManager.java +++ b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/callconnection/CallManager.java @@ -15,15 +15,20 @@ import android.telecom.VideoProfile; import android.telephony.TelephonyManager; import android.util.Log; +import android.widget.Toast; import androidx.annotation.RequiresApi; +import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; import com.cometchat.pro.constants.CometChatConstants; import com.cometchat.pro.core.Call; +import com.cometchat.pro.core.CometChat; +import com.cometchat.pro.exceptions.CometChatException; import com.cometchat.pro.models.Group; import com.cometchat.pro.models.User; import com.cometchat.pro.uikit.BuildConfig; +import com.cometchat.pro.uikit.R; import com.cometchat.pro.uikit.ui_resources.constants.UIKitConstants; import com.cometchat.pro.uikit.ui_settings.UIKitSettings; @@ -38,15 +43,16 @@ public class CallManager { Context context; TelecomManager telecomManager; PhoneAccountHandle phoneAccountHandle; + public CallManager(Context context) { this.context = context; telecomManager = (TelecomManager) context.getSystemService(TELECOM_SERVICE); - ComponentName componentName = new ComponentName(context, MyConnectionService.class); + ComponentName componentName = new ComponentName(context, MyConnectionService.class); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { phoneAccountHandle = new PhoneAccountHandle(componentName, context.getPackageName()); PhoneAccount phoneAccount = PhoneAccount.builder(phoneAccountHandle, context.getPackageName()) - .setCapabilities(UIKitSettings.getConnectionCapability()).build(); - Log.e( "CallManager: ",phoneAccount.toString() ); + .setCapabilities(UIKitSettings.getConnectionCapability()).build(); + Log.e("CallManager: ", phoneAccount.toString()); telecomManager.registerPhoneAccount(phoneAccount); } } @@ -66,29 +72,29 @@ public void startOutgoingCall() { if (context.checkSelfPermission(Manifest.permission.MANAGE_OWN_CALLS) == PackageManager.PERMISSION_GRANTED) { manager.placeCall(Uri.parse("tel:$number"), test); } - } catch (SecurityException e){ + } catch (SecurityException e) { e.printStackTrace(); } } @RequiresApi(api = Build.VERSION_CODES.M) - public void startIncomingCall(Call call){ + public void startIncomingCall(Call call) { if (context.checkSelfPermission(Manifest.permission.MANAGE_OWN_CALLS) == PackageManager.PERMISSION_GRANTED) { Bundle extras = new Bundle(); - Uri uri = Uri.fromParts(PhoneAccount.SCHEME_TEL, call.getSessionId().substring(0,11), null); - extras.putString(UIKitConstants.IntentStrings.SESSION_ID,call.getSessionId()); - extras.putString(UIKitConstants.IntentStrings.TYPE,call.getReceiverType()); - extras.putString(UIKitConstants.IntentStrings.CALL_TYPE,call.getType()); - extras.putString(UIKitConstants.IntentStrings.ID,call.getReceiverUid()); + Uri uri = Uri.fromParts(PhoneAccount.SCHEME_TEL, call.getSessionId().substring(0, 11), null); + extras.putString(UIKitConstants.IntentStrings.SESSION_ID, call.getSessionId()); + extras.putString(UIKitConstants.IntentStrings.TYPE, call.getReceiverType()); + extras.putString(UIKitConstants.IntentStrings.CALL_TYPE, call.getType()); + extras.putString(UIKitConstants.IntentStrings.ID, call.getReceiverUid()); if (call.getReceiverType().equalsIgnoreCase(CometChatConstants.RECEIVER_TYPE_GROUP)) - extras.putString(UIKitConstants.IntentStrings.NAME,((Group)call.getReceiver()).getName()); + extras.putString(UIKitConstants.IntentStrings.NAME, ((Group) call.getReceiver()).getName()); else - extras.putString(UIKitConstants.IntentStrings.NAME,((User)call.getCallInitiator()).getName()); + extras.putString(UIKitConstants.IntentStrings.NAME, ((User) call.getCallInitiator()).getName()); if (call.getType().equalsIgnoreCase(CometChatConstants.CALL_TYPE_VIDEO)) - extras.putInt(TelecomManager.EXTRA_INCOMING_VIDEO_STATE,VideoProfile.STATE_BIDIRECTIONAL); + extras.putInt(TelecomManager.EXTRA_INCOMING_VIDEO_STATE, VideoProfile.STATE_BIDIRECTIONAL); else - extras.putInt(TelecomManager.EXTRA_INCOMING_VIDEO_STATE,VideoProfile.STATE_AUDIO_ONLY); + extras.putInt(TelecomManager.EXTRA_INCOMING_VIDEO_STATE, VideoProfile.STATE_AUDIO_ONLY); extras.putParcelable(TelecomManager.EXTRA_INCOMING_CALL_ADDRESS, uri); extras.putParcelable(TelecomManager.EXTRA_PHONE_ACCOUNT_HANDLE, phoneAccountHandle); @@ -99,19 +105,68 @@ public void startIncomingCall(Call call){ } else { isCallPermitted = true; } - Log.e("CallManager", "is incoming call permited = "+isCallPermitted+"\n"+phoneAccountHandle.toString()); + Log.e("CallManager", "is incoming call permited = " + isCallPermitted + "\n" + phoneAccountHandle.toString()); try { telecomManager.addNewIncomingCall(phoneAccountHandle, extras); } catch (SecurityException e) { - Intent intent = new Intent(); - intent.setAction(TelecomManager.ACTION_CHANGE_PHONE_ACCOUNTS); + e.printStackTrace(); + CometChat.rejectCall(call.getSessionId(), CometChatConstants.CALL_STATUS_BUSY, new CometChat.CallbackListener() { + @Override + public void onSuccess(Call call) { + Toast.makeText(context, context.getString(R.string.allow_connection_service), Toast.LENGTH_LONG).show(); + launchVoIPSetting(context); + } + + @Override + public void onError(CometChatException e) { + + } + }); + + } catch (Exception e) { + Log.e("CallManagerError: ", e.getMessage()); + } + } + } + + public void launchVoIPSetting(Context context) { + Intent intent = new Intent(); + intent.setAction(TelecomManager.ACTION_CHANGE_PHONE_ACCOUNTS); // ComponentName telecomComponent = new ComponentName("com.android.server.telecom", "com.android.server.telecom.settings.EnableAccountPreferenceActivity"); // intent.setComponent(telecomComponent); - intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - context.startActivity(intent); - } catch (Exception e) { - Log.e( "CallManagerError: ",e.getMessage()); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); + context.startActivity(intent); + } + + public boolean checkAccountConnection(Context context) { + boolean isConnected = false; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + if (ContextCompat.checkSelfPermission(context, Manifest.permission.READ_PHONE_STATE) + == PackageManager.PERMISSION_GRANTED && telecomManager!=null) { + final List enabledAccounts = telecomManager.getCallCapablePhoneAccounts(); + for (PhoneAccountHandle account : enabledAccounts) { + if (account.getComponentName().getClassName().equals(MyConnectionService.class.getCanonicalName())) { + isConnected = true; + break; + } + } } + } + return isConnected; + } + + public void endCall() { + if (telecomManager != null) + if (ActivityCompat.checkSelfPermission(context, Manifest.permission.ANSWER_PHONE_CALLS) != PackageManager.PERMISSION_GRANTED) { + // TODO: Consider calling + // ActivityCompat#requestPermissions + // here to request the missing permissions, and then overriding + // public void onRequestPermissionsResult(int requestCode, String[] permissions, + // int[] grantResults) + // to handle the case where the user grants the permission. See the documentation + // for ActivityCompat#requestPermissions for more details. + return; + }telecomManager.endCall(); } } diff --git a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/callconnection/CallNotificationAction.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/callconnection/CallNotificationAction.java index 6e4884d..13c0bd9 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/callconnection/CallNotificationAction.java +++ b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/callconnection/CallNotificationAction.java @@ -24,22 +24,24 @@ public void onReceive(Context context, Intent intent) { String sessionID = intent.getStringExtra(UIKitConstants.IntentStrings.SESSION_ID); Log.e(TAG, "onReceive: " + intent.getStringExtra(UIKitConstants.IntentStrings.SESSION_ID)); if (intent.getAction().equals("Answers")) { - CometChat.acceptCall(sessionID, new CometChat.CallbackListener() { - @Override - public void onSuccess(Call call) { + Log.e(TAG, "onReceive: Answers" ); +// CometChat.acceptCall(sessionID, new CometChat.CallbackListener() { +// @Override +// public void onSuccess(Call call) { Intent acceptIntent = new Intent(context, CometChatStartCallActivity.class); - acceptIntent.putExtra(UIKitConstants.IntentStrings.SESSION_ID,call.getSessionId()); + acceptIntent.putExtra(UIKitConstants.IntentStrings.SESSION_ID,sessionID); acceptIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + acceptIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); context.startActivity(acceptIntent); - } - - @Override - public void onError(CometChatException e) { - Toast.makeText(context,"Error "+e.getMessage(),Toast.LENGTH_LONG).show(); - } - }); - NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context); - notificationManager.cancel(05); +// } +// +// @Override +// public void onError(CometChatException e) { +// Toast.makeText(context,"Error "+e.getMessage(),Toast.LENGTH_LONG).show(); +// } +// }); +// NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context); +// notificationManager.cancel(05); } else if (intent.getAction().equals("StartCall")){ Intent acceptIntent = new Intent(context, CometChatStartCallActivity.class); acceptIntent.putExtra(UIKitConstants.IntentStrings.SESSION_ID,sessionID); @@ -47,6 +49,7 @@ public void onError(CometChatException e) { context.startActivity(acceptIntent); } else { + Log.e(TAG, "onReceive: Reject" ); CometChat.rejectCall(sessionID, CometChatConstants.CALL_STATUS_REJECTED, new CometChat.CallbackListener() { @Override public void onSuccess(Call call) { diff --git a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/callconnection/MyConnectionService.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/callconnection/MyConnectionService.java index ea17f14..03e47b4 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/callconnection/MyConnectionService.java +++ b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/callconnection/MyConnectionService.java @@ -1,5 +1,9 @@ package com.cometchat.pro.uikit.ui_components.calls.callconnection; +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; import android.net.Uri; import android.os.Build; import android.os.Bundle; @@ -11,10 +15,14 @@ import android.telecom.VideoProfile; import android.util.Log; import android.view.Surface; +import android.widget.Toast; import androidx.annotation.RequiresApi; import com.cometchat.pro.core.Call; +import com.cometchat.pro.core.CometChat; +import com.cometchat.pro.exceptions.CometChatException; +import com.cometchat.pro.uikit.ui_components.calls.call_manager.CometChatStartCallActivity; import com.cometchat.pro.uikit.ui_resources.constants.UIKitConstants; import static android.telecom.TelecomManager.PRESENTATION_ALLOWED; @@ -27,6 +35,7 @@ public MyConnectionService() { super(); } + @Override public Connection onCreateIncomingConnection(PhoneAccountHandle connectionManagerPhoneAccount, ConnectionRequest request) { Bundle bundle = request.getExtras(); @@ -38,7 +47,7 @@ public Connection onCreateIncomingConnection(PhoneAccountHandle connectionManage Call call = new Call(receiverUID,type,callType); call.setSessionId(sessionID); Log.i("CallConnectionService", "onCreateIncomingConnectionCall:"+call.toString()); - conn = new CallConnection(getApplicationContext(),call); + conn = new CallConnection(this,call); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) { conn.setConnectionProperties(Connection.PROPERTY_SELF_MANAGED); } diff --git a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/chats/CometChatConversationList.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/chats/CometChatConversationList.java index ec7ce8f..58be0ac 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/chats/CometChatConversationList.java +++ b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/chats/CometChatConversationList.java @@ -21,6 +21,7 @@ import android.view.ViewGroup; import android.view.inputmethod.EditorInfo; import android.widget.EditText; +import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.TextView; @@ -33,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; @@ -46,6 +48,7 @@ import com.cometchat.pro.uikit.ui_resources.utils.custom_alertDialog.CustomAlertDialogHelper; import com.cometchat.pro.uikit.ui_resources.utils.custom_alertDialog.OnAlertDialogButtonClickListener; import com.cometchat.pro.uikit.ui_resources.utils.recycler_touch.RecyclerViewSwipeListener; +import com.cometchat.pro.uikit.ui_settings.FeatureRestriction; import com.cometchat.pro.uikit.ui_settings.UIKitSettings; import com.facebook.shimmer.ShimmerFrameLayout; @@ -93,6 +96,8 @@ public class CometChatConversationList extends Fragment implements TextWatcher, private List conversationList = new ArrayList<>(); + private ImageView startConversation; + public CometChatConversationList() { // Required empty public constructor } @@ -122,6 +127,23 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, CometChatError.init(getContext()); + startConversation = view.findViewById(R.id.start_conversation); + FeatureRestriction.isStartConversationEnabled(new FeatureRestriction.OnSuccessListener() { + @Override + public void onSuccess(Boolean booleanVal) { + if (booleanVal) + startConversation.setVisibility(View.VISIBLE); + else + startConversation.setVisibility(View.GONE); + } + }); + + startConversation.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + CometChatStartConversation.launch(getContext()); + } + }); searchEdit.setOnEditorActionListener((textView, i, keyEvent) -> { if (i == EditorInfo.IME_ACTION_SEARCH) { if (!textView.getText().toString().isEmpty()) { @@ -184,69 +206,76 @@ public void OnItemClick(Conversation conversation, int position) { RecyclerViewSwipeListener swipeHelper = new RecyclerViewSwipeListener(getContext()) { @Override public void instantiateUnderlayButton(RecyclerView.ViewHolder viewHolder, List underlayButtons) { - Bitmap deleteBitmap = BitmapFactory.decodeResource(getResources(),R.drawable.ic_delete); - underlayButtons.add(new RecyclerViewSwipeListener.UnderlayButton( - "Delete", - deleteBitmap, - getResources().getColor(R.color.red), - new RecyclerViewSwipeListener.UnderlayButtonClickListener() { - @Override - public void onClick(final int pos) { - Conversation conversation = rvConversationList.getConversation(pos); - if (conversation!=null) { - String conversationUid = ""; - String type = ""; - if (conversation.getConversationType() - .equalsIgnoreCase(CometChatConstants.CONVERSATION_TYPE_GROUP)) { - conversationUid = ((Group)conversation.getConversationWith()).getGuid(); - type = CometChatConstants.CONVERSATION_TYPE_GROUP; - } else { - conversationUid = ((User)conversation.getConversationWith()).getUid(); - type = CometChatConstants.CONVERSATION_TYPE_USER; - } - String finalConversationUid = conversationUid; - String finalType = type; - new CustomAlertDialogHelper(getContext(), - getString(R.string.delete_conversation_message), - null, - getString(R.string.yes), - "", getString(R.string.no), new OnAlertDialogButtonClickListener() { + Bitmap deleteBitmap = Utils.drawableToBitmap(getResources().getDrawable(R.drawable.ic_delete_conversation)); + FeatureRestriction.isDeleteConversationEnabled(new FeatureRestriction.OnSuccessListener() { + @Override + public void onSuccess(Boolean booleanVal) { + if (booleanVal) { + underlayButtons.add(new RecyclerViewSwipeListener.UnderlayButton( + "Delete", + deleteBitmap, + getResources().getColor(R.color.red), + new RecyclerViewSwipeListener.UnderlayButtonClickListener() { @Override - public void onButtonClick(AlertDialog alertDialog, View v, int which, int popupId) { - if (which==DialogInterface.BUTTON_POSITIVE) { - ProgressDialog progressDialog = ProgressDialog.show(getContext(),null, - getString(R.string.deleting_conversation)); - CometChat.deleteConversation( - finalConversationUid, finalType, - new CometChat.CallbackListener() { - @Override - public void onSuccess(String s) { - Handler handler = new Handler(); - handler.postDelayed(new Runnable() { - public void run() { - alertDialog.dismiss(); - progressDialog.dismiss(); - } - }, 1500); - rvConversationList.remove(conversation); - } - - @Override - public void onError(CometChatException e) { - progressDialog.dismiss(); - e.printStackTrace(); - } - }); - } else if (which==DialogInterface.BUTTON_NEGATIVE) { - alertDialog.dismiss(); + public void onClick(final int pos) { + Conversation conversation = rvConversationList.getConversation(pos); + if (conversation!=null) { + String conversationUid = ""; + String type = ""; + if (conversation.getConversationType() + .equalsIgnoreCase(CometChatConstants.CONVERSATION_TYPE_GROUP)) { + conversationUid = ((Group)conversation.getConversationWith()).getGuid(); + type = CometChatConstants.CONVERSATION_TYPE_GROUP; + } else { + conversationUid = ((User)conversation.getConversationWith()).getUid(); + type = CometChatConstants.CONVERSATION_TYPE_USER; + } + String finalConversationUid = conversationUid; + String finalType = type; + new CustomAlertDialogHelper(getContext(), + getString(R.string.delete_conversation_message), + null, + getString(R.string.yes), + "", getString(R.string.no), new OnAlertDialogButtonClickListener() { + @Override + public void onButtonClick(AlertDialog alertDialog, View v, int which, int popupId) { + if (which==DialogInterface.BUTTON_POSITIVE) { + ProgressDialog progressDialog = ProgressDialog.show(getContext(),null, + getString(R.string.deleting_conversation)); + CometChat.deleteConversation( + finalConversationUid, finalType, + new CometChat.CallbackListener() { + @Override + public void onSuccess(String s) { + Handler handler = new Handler(); + handler.postDelayed(new Runnable() { + public void run() { + alertDialog.dismiss(); + progressDialog.dismiss(); + } + }, 1500); + rvConversationList.remove(conversation); + } + + @Override + public void onError(CometChatException e) { + progressDialog.dismiss(); + e.printStackTrace(); + } + }); + } else if (which==DialogInterface.BUTTON_NEGATIVE) { + alertDialog.dismiss(); + } + } + }, 1, true); + } } - }, 1, true); - - } - } + } + )); } - )); + } + }); } }; swipeHelper.attachToRecyclerView(rvConversationList); @@ -423,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/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/chats/CometChatStartConversation.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/chats/CometChatStartConversation.java new file mode 100644 index 0000000..e864b79 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/chats/CometChatStartConversation.java @@ -0,0 +1,98 @@ +package com.cometchat.pro.uikit.ui_components.chats; + +import androidx.appcompat.app.AppCompatActivity; +import androidx.fragment.app.FragmentActivity; +import androidx.viewpager.widget.ViewPager; + +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; + +import com.cometchat.pro.uikit.R; +import com.cometchat.pro.uikit.ui_components.groups.group_list.CometChatGroupList; +import com.cometchat.pro.uikit.ui_components.shared.cometchatSharedMedia.adapter.TabAdapter; +import com.cometchat.pro.uikit.ui_components.users.user_list.CometChatUserList; +import com.cometchat.pro.uikit.ui_settings.UIKitSettings; +import com.cometchat.pro.uikit.ui_settings.enums.ConversationMode; +import com.google.android.material.tabs.TabLayout; + +public class CometChatStartConversation extends AppCompatActivity { + + private ViewPager viewPager; + + private TabLayout tabLayout; + + private TabAdapter adapter; + + private TextView title; + + private ImageView backIcon; + + private String conversationType = UIKitSettings.getConversationsMode().toString(); + + public static void launch(Context context) { + context.startActivity(new Intent(context,CometChatStartConversation.class)); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_comet_chat_start_conversation); + title = findViewById(R.id.title); + viewPager = findViewById(R.id.viewPager); + tabLayout = findViewById(R.id.tabLayout); + adapter = new TabAdapter(getSupportFragmentManager()); + backIcon = findViewById(R.id.backIcon); + backIcon.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + onBackPressed(); + } + }); + + CometChatUserList cometChatUserList = new CometChatUserList(); + cometChatUserList.setTitleVisible(false); + CometChatGroupList cometChatGroupList = new CometChatGroupList(); + cometChatGroupList.setTitleVisible(false); + cometChatGroupList.setGroupCreateVisible(false); + if (conversationType.equalsIgnoreCase(ConversationMode.ALL_CHATS.toString())) { + adapter.addFragment(cometChatUserList, getString(R.string.users)); + adapter.addFragment(cometChatGroupList, getString(R.string.groups)); + } else if (conversationType.equalsIgnoreCase(ConversationMode.GROUP.toString())) { + title.setText(getString(R.string.select_group)); + tabLayout.setVisibility(View.GONE); + adapter.addFragment(cometChatGroupList, getString(R.string.groups)); + } else { + title.setText(getString(R.string.select_user)); + tabLayout.setVisibility(View.GONE); + adapter.addFragment(cometChatUserList, getString(R.string.users)); + } + viewPager.setAdapter(adapter); + viewPager.setOffscreenPageLimit(3); + tabLayout.setupWithViewPager(viewPager); + + tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { + @Override + public void onTabSelected(TabLayout.Tab tab) { + if (tab.getPosition()==0) { + title.setText(getString(R.string.select_user)); + } else { + title.setText(getString(R.string.select_group)); + } + } + + @Override + public void onTabUnselected(TabLayout.Tab tab) { + + } + + @Override + public void onTabReselected(TabLayout.Tab tab) { + + } + }); + } +} \ No newline at end of file diff --git a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/cometchat_ui/CometChatUI.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/cometchat_ui/CometChatUI.java index edd36e8..1ae4ca6 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/cometchat_ui/CometChatUI.java +++ b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/cometchat_ui/CometChatUI.java @@ -40,6 +40,8 @@ import com.cometchat.pro.uikit.databinding.ActivityCometchatUnifiedBinding; 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; @@ -62,6 +64,11 @@ import com.cometchat.pro.uikit.ui_resources.utils.Utils; import com.cometchat.pro.uikit.ui_settings.FeatureRestriction; +import javax.crypto.SecretKey; +import javax.crypto.spec.SecretKeySpec; + +import static java.nio.charset.StandardCharsets.UTF_8; + /** * Purpose - CometChatUnified class is main class used to launch the fully working chat application. * It consist of BottomNavigationBar which helps to navigate between different screens like @@ -121,8 +128,6 @@ protected void onCreate(Bundle savedInstanceState) { // It performs action on click of user item in CometChatUserListScreen. setUserClickListener(); - - //It performs action on click of group item in CometChatGroupListScreen. //It checks whether the logged-In user is already a joined a group or not and based on it perform actions. setGroupClickListener(); @@ -194,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/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/add_members/CometChatAddMembersActivity.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/add_members/CometChatAddMembersActivity.java index 3fa7c43..041aa87 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/add_members/CometChatAddMembersActivity.java +++ b/ConnectionService + Firebase/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/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/admin_moderator_list/CometChatAdminModeratorListActivity.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/admin_moderator_list/CometChatAdminModeratorListActivity.java index add9ea4..e7e8389 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/admin_moderator_list/CometChatAdminModeratorListActivity.java +++ b/ConnectionService + Firebase/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/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/banned_members/CometChatBanMembersActivity.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/banned_members/CometChatBanMembersActivity.java index 4867131..654d121 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/banned_members/CometChatBanMembersActivity.java +++ b/ConnectionService + Firebase/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/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/create_group/CometChatCreateGroup.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/create_group/CometChatCreateGroup.java index f158b5e..a4cb7e8 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/create_group/CometChatCreateGroup.java +++ b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/create_group/CometChatCreateGroup.java @@ -89,7 +89,7 @@ public void beforeTextChanged(CharSequence s, int start, int count, int after) { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { if (!etGroupPassword.getText().toString().isEmpty() && s.toString().equals(etGroupPassword.getText().toString())) { - groupCnfPasswordLayout.setEndIconDrawable(getResources().getDrawable(R.drawable.ic_check_black_24dp)); + groupCnfPasswordLayout.setEndIconDrawable(getResources().getDrawable(R.drawable.ic_baseline_check_circle_24)); groupCnfPasswordLayout.setEndIconTintList(ColorStateList.valueOf(getResources().getColor(R.color.green_600))); } } diff --git a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/create_group/CometChatCreateGroupActivity.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/create_group/CometChatCreateGroupActivity.java index 3b02b83..1d21f88 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/create_group/CometChatCreateGroupActivity.java +++ b/ConnectionService + Firebase/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/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_details/CometChatGroupDetailActivity.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_details/CometChatGroupDetailActivity.java index 78ec891..e85eddb 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_details/CometChatGroupDetailActivity.java +++ b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_details/CometChatGroupDetailActivity.java @@ -78,6 +78,8 @@ public class CometChatGroupDetailActivity extends AppCompatActivity { private CometChatAvatar groupIcon; + private ImageView editGroup; + private String groupType; private String ownerId; @@ -124,8 +126,6 @@ public class CometChatGroupDetailActivity extends AppCompatActivity { private TextView tvLoadMore; - private List groupMembers = new ArrayList<>(); - private AlertDialog.Builder dialog; private TextView tvMemberCount; @@ -167,6 +167,13 @@ private void initComponent() { tvGroupName = findViewById(R.id.tv_group_name); tvGroupDesc = findViewById(R.id.group_description); tvGroupName.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + } + }); + editGroup = findViewById(R.id.edit_group); + + editGroup.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { updateGroupDialog(); @@ -224,6 +231,13 @@ public void onClick(View v) { // rvMemberList.setNestedScrollingEnabled(false); handleIntent(); + + if (loggedInUserScope.equalsIgnoreCase(CometChatConstants.SCOPE_ADMIN)) + editGroup.setVisibility(View.VISIBLE); + else + editGroup.setVisibility(View.GONE); + + checkDarkMode(); sharedMediaLayout = findViewById(R.id.shared_media_layout); @@ -368,8 +382,8 @@ public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMen super.onCreateContextMenu(menu, v, menuInfo); MenuInflater menuInflater = getMenuInflater(); menuInflater.inflate(R.menu.group_action_menu, menu); - - menu.findItem(R.id.item_make_admin).setVisible(false); + if (!ownerId.equalsIgnoreCase(loggedInUser.getUid())) + menu.findItem(R.id.item_make_admin).setVisible(false); menu.setHeaderTitle(getString(R.string.group_alert)); } @@ -382,11 +396,32 @@ public boolean onContextItemSelected(@NonNull MenuItem item) { kickMember(); } else if(item.getItemId() == R.id.item_ban) { banMember(); + } else if (item.getItemId() == R.id.item_make_admin) { + transferOwner(groupMember); } return super.onContextItemSelected(item); } + private void transferOwner(GroupMember groupMember) { + CometChat.transferGroupOwnership(guid, groupMember.getUid(), new CometChat.CallbackListener() { + @Override + public void onSuccess(String s) { + CometChatSnackBar.show(CometChatGroupDetailActivity.this, + rvMemberList, + String.format(getResources().getString(R.string.user_is_owner),groupMember.getName()), CometChatSnackBar.SUCCESS); + } + + @Override + public void onError(CometChatException e) { + CometChatSnackBar.show(CometChatGroupDetailActivity.this, + rvMemberList, + String.format(getResources().getString(R.string.update_scope_error)+e.getCode(),groupMember.getName()) + +", "+CometChatError.localized(e),CometChatSnackBar.ERROR); + } + }); + } + /** * This method is used to create dialog box on click of events like Delete Group and Exit Group @@ -495,6 +530,10 @@ private void handleIntent() { } if (getIntent().hasExtra(UIKitConstants.IntentStrings.GROUP_DESC)) { gDesc = getIntent().getStringExtra(UIKitConstants.IntentStrings.GROUP_DESC); + if (gDesc!=null) { + if (!gDesc.isEmpty()) + tvGroupDesc.setVisibility(View.VISIBLE); + } tvGroupDesc.setText(gDesc); } if (getIntent().hasExtra(UIKitConstants.IntentStrings.GROUP_PASSWORD)) { @@ -983,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/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_list/CometChatGroupList.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_list/CometChatGroupList.java index d1e9582..cba07d4 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_list/CometChatGroupList.java +++ b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_list/CometChatGroupList.java @@ -10,6 +10,7 @@ import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.RecyclerView; +import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; import android.text.Editable; import android.text.TextWatcher; @@ -40,6 +41,7 @@ import java.util.ArrayList; import java.util.List; +import com.cometchat.pro.uikit.ui_resources.constants.UIKitConstants; import com.cometchat.pro.uikit.ui_resources.utils.CometChatError; import com.cometchat.pro.uikit.ui_resources.utils.item_clickListener.OnItemClickListener; import com.cometchat.pro.uikit.ui_components.groups.create_group.CometChatCreateGroupActivity; @@ -65,10 +67,14 @@ public class CometChatGroupList extends Fragment { private CometChatGroups rvGroupList; //Uses to display list of groups. - private GroupsRequest groupsRequest; //Uses to fetch Groups. + private SwipeRefreshLayout swipeRefreshLayout; + private GroupsRequest groupsRequest; //Uses to fetch Groups. + private TextView title; private EditText etSearch; //Uses to perform search operations on groups. + private boolean isGroupCreateVisible = true; + private ImageView clearSearch; private ImageView ivCreateGroup; @@ -87,22 +93,76 @@ public CometChatGroupList() { // Required empty public constructor } + + public void setGroupCreateVisible(boolean isVisible) { + Bundle bundle = null; + if (getArguments()!=null) { + bundle = getArguments(); + } else { + bundle = new Bundle(); + } + bundle.putBoolean(UIKitConstants.IntentStrings.CREATE_GROUP_VISIBLE, isVisible); + setArguments(bundle); + } + + public void isGroupCreateVisible() { + if (getArguments()!=null) { + isGroupCreateVisible = getArguments() + .getBoolean(UIKitConstants.IntentStrings.CREATE_GROUP_VISIBLE, true); + if (isGroupCreateVisible) + ivCreateGroup.setVisibility(View.VISIBLE); + else + ivCreateGroup.setVisibility(View.GONE); + } + } + + public void setTitleVisible(boolean isVisible) { + Bundle bundle = null; + if (getArguments()!=null) { + bundle = getArguments(); + } else { + bundle = new Bundle(); + } + bundle.putBoolean(UIKitConstants.IntentStrings.IS_TITLE_VISIBLE,isVisible); + setArguments(bundle); + } + + public void isTitleVisible() { + if (getArguments()!=null) { + boolean isVisible = getArguments() + .getBoolean(UIKitConstants.IntentStrings.IS_TITLE_VISIBLE, true); + if (isVisible) + title.setVisibility(View.VISIBLE); + else + title.setVisibility(View.GONE); + } + } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment View view= inflater.inflate(R.layout.fragment_cometchat_grouplist, container, false); - TextView title = view.findViewById(R.id.tv_title); + title = view.findViewById(R.id.tv_title); title.setTypeface(FontUtils.getInstance(getActivity()).getTypeFace(FontUtils.robotoMedium)); rvGroupList=view.findViewById(R.id.rv_group_list); + swipeRefreshLayout = view.findViewById(R.id.swipe_refresh); noGroupLayout = view.findViewById(R.id.no_group_layout); etSearch = view.findViewById(R.id.search_bar); clearSearch = view.findViewById(R.id.clear_search); 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() { + @Override + public void onRefresh() { + groupsRequest = null; + rvGroupList.clear(); + fetchGroup(); + } + }); FeatureRestriction.isGroupSearchEnabled(new FeatureRestriction.OnSuccessListener() { @Override public void onSuccess(Boolean booleanVal) { @@ -115,7 +175,7 @@ public void onSuccess(Boolean booleanVal) { FeatureRestriction.isGroupCreationEnabled(new FeatureRestriction.OnSuccessListener() { @Override public void onSuccess(Boolean booleanVal) { - if (booleanVal) + if (booleanVal && isGroupCreateVisible) ivCreateGroup.setVisibility(View.VISIBLE); else ivCreateGroup.setVisibility(View.GONE); @@ -224,11 +284,13 @@ public void OnItemClick(Group group, int position) { event.OnItemClick(group,position); } }); + isGroupCreateVisible(); return view; } private void checkGroups() { - if (isPublicGroupEnabled || isPasswordGroupEnabled || isPrivateGroupEnabled) { + if ((isPublicGroupEnabled || isPasswordGroupEnabled || isPrivateGroupEnabled) + && isGroupCreateVisible) { ivCreateGroup.setVisibility(View.VISIBLE); } else ivCreateGroup.setVisibility(View.GONE); @@ -254,6 +316,8 @@ private void fetchGroup(){ public void onSuccess(List groups) { rvGroupList.setGroupList(groups); // sets the groups in rvGroupList i.e CometChatGroupList Component. groupList.addAll(groups); + if (swipeRefreshLayout.isRefreshing()) + swipeRefreshLayout.setRefreshing(false); if (groupList.size()==0) { noGroupLayout.setVisibility(View.VISIBLE); rvGroupList.setVisibility(View.GONE); diff --git a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_members/CometChatGroupMemberListActivity.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_members/CometChatGroupMemberListActivity.java index f792fdf..f79d1a7 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_members/CometChatGroupMemberListActivity.java +++ b/ConnectionService + Firebase/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/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_members/GroupMemberAdapter.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_members/GroupMemberAdapter.java index 5fda61e..135d485 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_members/GroupMemberAdapter.java +++ b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_members/GroupMemberAdapter.java @@ -113,7 +113,7 @@ public void onBindViewHolder(@NonNull GroupMemberViewHolder groupMemberViewHolde } else if (groupMember.getScope().equals(CometChatConstants.SCOPE_MODERATOR)){ groupMemberViewHolder.userListRowBinding.txtUserScope.setText(R.string.moderator); } else { - groupMemberViewHolder.userListRowBinding.txtUserScope.setText(""); + groupMemberViewHolder.userListRowBinding.txtUserScope.setText(R.string.participant); } groupMemberViewHolder.userListRowBinding.txtUserName.setTypeface(fontUtils.getTypeFace(FontUtils.robotoMedium)); diff --git a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/forward_message/CometChatForwardMessageActivity.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/forward_message/CometChatForwardMessageActivity.java index 31a41b9..e69440f 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/forward_message/CometChatForwardMessageActivity.java +++ b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/forward_message/CometChatForwardMessageActivity.java @@ -115,7 +115,7 @@ protected void onCreate(Bundle savedInstanceState) { } - void handleSendText(Intent intent) { + void handleText(Intent intent) { String sharedText = intent.getStringExtra(Intent.EXTRA_TEXT); if (sharedText != null) { messageType = CometChatConstants.MESSAGE_TYPE_TEXT; @@ -123,7 +123,7 @@ void handleSendText(Intent intent) { } } - void handleSendImage(Intent intent) { + void handleImage(Intent intent) { Uri imageUri = (Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM); if (imageUri != null) { messageType = UIKitConstants.IntentStrings.INTENT_MEDIA_IMAGE_MESSAGE; @@ -132,7 +132,7 @@ void handleSendImage(Intent intent) { } } - void handleSendVideo(Intent intent) { + void handleVideo(Intent intent) { Uri videoUri = (Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM); if (videoUri!=null) { messageType = UIKitConstants.IntentStrings.INTENT_MEDIA_VIDEO_MESSAGE; @@ -141,6 +141,23 @@ void handleSendVideo(Intent intent) { } } + void handleAudio(Intent intent) { + Uri audioUri = (Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM); + if (audioUri!=null) { + messageType = UIKitConstants.IntentStrings.INTENT_MEDIA_AUDIO_MESSAGE; + mediaMessageUrl = audioUri.toString(); + Log.e(TAG, "handleSendAudio: "+mediaMessageUrl); + } + } + + void handleFile(Intent intent) { + Uri fileUri = (Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM); + if (fileUri!=null) { + messageType = UIKitConstants.IntentStrings.INTENT_MEDIA_FILE_MESSAGE; + mediaMessageUrl = fileUri.toString(); + Log.e(TAG, "handleSendFile: "+mediaMessageUrl); + } + } /** * This method is used to handle parameter passed to this class. */ @@ -153,11 +170,15 @@ private void handleIntent() { if (Intent.ACTION_SEND.equals(action) && type != null) { if ("text/plain".equals(type)) { - handleSendText(intent); // Handle text being sent + handleText(intent); // Handle text being sent } else if (type.startsWith("image/")) { - handleSendImage(intent); // Handle single image being sent + handleImage(intent); // Handle single image being sent } else if (type.startsWith("video/")) { - handleSendVideo(intent); + handleVideo(intent); + } else if(type.startsWith("audio/")) { + handleAudio(intent); + } else if (type.startsWith("application/")) { + handleFile(intent); } } @@ -200,7 +221,7 @@ private void handleIntent() { * This method is used to initialize the views */ public void init() { - // Inflate the layout + // Inflate the layout MaterialToolbar toolbar = findViewById(R.id.forward_toolbar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); @@ -231,10 +252,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()); + } } }); @@ -273,7 +294,7 @@ public void OnItemClick(Conversation conversation, int position) { avatar = ((Group) conversation.getConversationWith()).getIcon(); } chip.setText(name); - Glide.with(CometChatForwardMessageActivity.this).load(avatar).placeholder(R.drawable.ic_contacts_24dp).transform(new CircleCrop()).into(new SimpleTarget() { + Glide.with(CometChatForwardMessageActivity.this).load(avatar).placeholder(R.drawable.ic_contacts).transform(new CircleCrop()).into(new SimpleTarget() { @Override public void onResourceReady(@NonNull Drawable resource, @Nullable Transition transition) { chip.setChipIcon(resource); @@ -294,7 +315,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 +354,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); @@ -357,21 +382,29 @@ public void onClick(View view) { attachment.setFileName(mediaMessageName); message.setAttachment(attachment); Log.e(TAG, "onClick: " + attachment.toString()); - sendMediaMessage(message); - if (i == userList.size() - 1) { - Intent intent = new Intent(CometChatForwardMessageActivity.this, CometChatUI.class); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); - startActivity(intent); - finish(); - } + sendMediaMessage(message,i); +// if (i == userList.size() - 1) { +// Intent intent = new Intent(CometChatForwardMessageActivity.this, CometChatUI.class); +// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); +// startActivity(intent); +// finish(); +// } } }).start(); - } else if (messageType!=null && messageType.equalsIgnoreCase(UIKitConstants.IntentStrings.INTENT_MEDIA_IMAGE_MESSAGE)){ + } else if (messageType != null && + (messageType.equalsIgnoreCase( + UIKitConstants.IntentStrings.INTENT_MEDIA_IMAGE_MESSAGE) || + messageType.equalsIgnoreCase( + UIKitConstants.IntentStrings.INTENT_MEDIA_VIDEO_MESSAGE) || + messageType.equalsIgnoreCase( + UIKitConstants.IntentStrings.INTENT_MEDIA_AUDIO_MESSAGE) || + messageType.equalsIgnoreCase( + UIKitConstants.IntentStrings.INTENT_MEDIA_FILE_MESSAGE))) { new Thread(() -> { for (int i = 0; i <= userList.size() - 1; i++) { Conversation conversation = new ArrayList<>(userList.values()).get(i); - MediaMessage message; + MediaMessage message = null; String uid; String type; Log.e(TAG, "run: " + conversation.getConversationId()); @@ -384,45 +417,15 @@ public void onClick(View view) { } File file = MediaUtils.getRealPath( CometChatForwardMessageActivity.this, - Uri.parse(mediaMessageUrl),true); - message = new MediaMessage(uid, file, CometChatConstants.MESSAGE_TYPE_IMAGE, type); - try { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("path", mediaMessageUrl); - message.setMetadata(jsonObject); - } catch (Exception e) { - Log.e(TAG, "onError: " + e.getMessage()); - } - sendMediaMessage(message); - if (i == userList.size() - 1) { - Intent intent = new Intent(CometChatForwardMessageActivity.this, CometChatUI.class); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); - startActivity(intent); - finish(); - } - } - - }).start(); - } - else if (messageType!=null && messageType.equalsIgnoreCase(UIKitConstants.IntentStrings.INTENT_MEDIA_VIDEO_MESSAGE)){ - new Thread(() -> { - for (int i = 0; i <= userList.size() - 1; i++) { - Conversation conversation = new ArrayList<>(userList.values()).get(i); - MediaMessage message; - String uid; - String type; - Log.e(TAG, "run: " + conversation.getConversationId()); - if (conversation.getConversationType().equals(CometChatConstants.CONVERSATION_TYPE_USER)) { - uid = ((User) conversation.getConversationWith()).getUid(); - type = CometChatConstants.RECEIVER_TYPE_USER; - } else { - uid = ((Group) conversation.getConversationWith()).getGuid(); - type = CometChatConstants.RECEIVER_TYPE_GROUP; - } - File file = MediaUtils.saveDriveFile( - CometChatForwardMessageActivity.this, - Uri.parse(mediaMessageUrl)); - message = new MediaMessage(uid, file, CometChatConstants.MESSAGE_TYPE_VIDEO, type); + Uri.parse(mediaMessageUrl), true); + if (messageType.equalsIgnoreCase(UIKitConstants.IntentStrings.INTENT_MEDIA_IMAGE_MESSAGE)) + message = new MediaMessage(uid, file, CometChatConstants.MESSAGE_TYPE_IMAGE, type); + else if (messageType.equalsIgnoreCase(UIKitConstants.IntentStrings.INTENT_MEDIA_VIDEO_MESSAGE)) + message = new MediaMessage(uid, file, CometChatConstants.MESSAGE_TYPE_VIDEO, type); + else if (messageType.equalsIgnoreCase(UIKitConstants.IntentStrings.INTENT_MEDIA_AUDIO_MESSAGE)) + message = new MediaMessage(uid, file, CometChatConstants.MESSAGE_TYPE_AUDIO, type); + else if (messageType.equalsIgnoreCase(UIKitConstants.IntentStrings.INTENT_MEDIA_FILE_MESSAGE)) + message = new MediaMessage(uid, file, CometChatConstants.MESSAGE_TYPE_FILE, type); try { JSONObject jsonObject = new JSONObject(); jsonObject.put("path", mediaMessageUrl); @@ -430,54 +433,47 @@ else if (messageType!=null && messageType.equalsIgnoreCase(UIKitConstants.Intent } catch (Exception e) { Log.e(TAG, "onError: " + e.getMessage()); } - sendMediaMessage(message); - if (i == userList.size() - 1) { - Intent intent = new Intent(CometChatForwardMessageActivity.this, CometChatUI.class); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); - startActivity(intent); - finish(); - } + sendMediaMessage(message,i); } - }).start(); - } - } else { - if (messageType!=null && messageType.equalsIgnoreCase(UIKitConstants.IntentStrings.LOCATION)) { - new Thread(() -> { - for (int i = 0; i <= userList.size() - 1; i++) { - Conversation conversation = new ArrayList<>(userList.values()).get(i); - CustomMessage message; - String uid; - JSONObject customData = new JSONObject(); - String type; - Log.e(TAG, "run: " + conversation.getConversationId()); - if (conversation.getConversationType().equals(CometChatConstants.CONVERSATION_TYPE_USER)) { - uid = ((User) conversation.getConversationWith()).getUid(); - type = CometChatConstants.RECEIVER_TYPE_USER; - } else { - uid = ((Group) conversation.getConversationWith()).getGuid(); - type = CometChatConstants.RECEIVER_TYPE_GROUP; - } - - try { - customData = new JSONObject(); - customData.put("latitude",lat); - customData.put("longitude",lon); - } catch (JSONException e) { - e.printStackTrace(); - } - message = new CustomMessage(uid,type, UIKitConstants.IntentStrings.LOCATION,customData); - - sendLocationMessage(message); - if (i == userList.size() - 1) { - Intent intent = new Intent(CometChatForwardMessageActivity.this, CometChatUI.class); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); - startActivity(intent); - finish(); + } else { + if (messageType != null && messageType.equalsIgnoreCase(UIKitConstants.IntentStrings.LOCATION)) { + new Thread(() -> { + for (int i = 0; i <= userList.size() - 1; i++) { + Conversation conversation = new ArrayList<>(userList.values()).get(i); + CustomMessage message; + String uid; + JSONObject customData = new JSONObject(); + String type; + Log.e(TAG, "run: " + conversation.getConversationId()); + if (conversation.getConversationType().equals(CometChatConstants.CONVERSATION_TYPE_USER)) { + uid = ((User) conversation.getConversationWith()).getUid(); + type = CometChatConstants.RECEIVER_TYPE_USER; + } else { + uid = ((Group) conversation.getConversationWith()).getGuid(); + type = CometChatConstants.RECEIVER_TYPE_GROUP; + } + + try { + customData = new JSONObject(); + customData.put("latitude", lat); + customData.put("longitude", lon); + } catch (JSONException e) { + e.printStackTrace(); + } + message = new CustomMessage(uid, type, UIKitConstants.IntentStrings.LOCATION, customData); + + sendLocationMessage(message); + if (i == userList.size() - 1) { + Intent intent = new Intent(CometChatForwardMessageActivity.this, CometChatUI.class); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); + startActivity(intent); + finish(); + } } - } - }).start(); + }).start(); + } } } } @@ -524,12 +520,17 @@ public void onError(CometChatException e) { }); } - public void sendMediaMessage(MediaMessage mediaMessage) + public void sendMediaMessage(MediaMessage mediaMessage,int i) { CometChat.sendMediaMessage(mediaMessage, new CometChat.CallbackListener() { @Override public void onSuccess(MediaMessage mediaMessage) { - Log.d(TAG, "sendMediaMessage onSuccess: " + mediaMessage.toString()); + if (i == userList.size() - 1) { + Intent intent = new Intent(CometChatForwardMessageActivity.this, CometChatUI.class); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); + startActivity(intent); + finish(); + } } @Override @@ -547,9 +548,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 +583,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/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/message_actions/CometChatMessageActions.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/message_actions/CometChatMessageActions.java index 53856b1..2bdb5d8 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/message_actions/CometChatMessageActions.java +++ b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/message_actions/CometChatMessageActions.java @@ -143,7 +143,7 @@ public void onClick(View view) { }); } ImageView addEmojiView = new ImageView(getContext()); - addEmojiView.setImageDrawable(getResources().getDrawable(R.drawable.add_emoji)); + addEmojiView.setImageDrawable(getResources().getDrawable(R.drawable.ic_reactions)); LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams( (int)Utils.dpToPx(getContext(),36),(int)Utils.dpToPx(getContext(),36)); layoutParams.topMargin = 8; diff --git a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/message_list/CometChatMessageList.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/message_list/CometChatMessageList.java index 75442dc..f561329 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/message_list/CometChatMessageList.java +++ b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/message_list/CometChatMessageList.java @@ -5,6 +5,7 @@ import android.animation.AnimatorListenerAdapter; import android.animation.ObjectAnimator; import android.animation.ValueAnimator; +import android.annotation.TargetApi; import android.app.Dialog; import android.app.ProgressDialog; import android.content.ClipData; @@ -50,6 +51,7 @@ import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; +import androidx.core.app.ActivityCompat; import androidx.core.view.inputmethod.InputContentInfoCompat; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.LinearLayoutManager; @@ -111,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; @@ -125,6 +128,7 @@ import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Locale; @@ -261,7 +265,7 @@ public class CometChatMessageList extends Fragment implements View.OnClickListen private User loggedInUser = CometChat.getLoggedInUser(); - String[] CAMERA_PERMISSION = {Manifest.permission.CAMERA,Manifest.permission.WRITE_EXTERNAL_STORAGE}; + String[] CAMERA_PERMISSION = {Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE}; private boolean isInProgress; @@ -355,7 +359,7 @@ private void handleArguments() { } String message = getArguments().getString(UIKitConstants.IntentStrings.MESSAGE); - if (message!=null) { + if (message != null) { try { JSONObject repliedMessageJSON = new JSONObject(message); repliedMessage = CometChatHelper.processMessage(repliedMessageJSON); @@ -438,18 +442,18 @@ public void onCancel(View var1) { new Handler().postDelayed(new Runnable() { @Override public void run() { - if (imageView!=null && animation!=null && animation.isRunning()) { - ObjectAnimator animator = ObjectAnimator.ofFloat(container,"alpha",0.2f); + if (imageView != null && animation != null && animation.isRunning()) { + ObjectAnimator animator = ObjectAnimator.ofFloat(container, "alpha", 0.2f); animator.setDuration(700); animator.start(); animator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { super.onAnimationEnd(animation); - if (imageView!=null) + if (imageView != null) imageView.clearAnimation(); container.removeAllViews(); - if (typingTimer!=null) + if (typingTimer != null) typingTimer.schedule(new TimerTask() { @Override public void run() { @@ -462,12 +466,12 @@ public void run() { TypingIndicator typingIndicator = new TypingIndicator(Id, type, metaData); CometChat.endTyping(typingIndicator); } - },2000); + }, 2000); } }); } } - },1400); + }, 1400); } })); @@ -500,12 +504,12 @@ public void onClick(View view) { public void onClickListener(Sticker sticker) { JSONObject stickerData = new JSONObject(); try { - stickerData.put("sticker_url",sticker.getUrl()); - stickerData.put("sticker_name",sticker.getName()); + stickerData.put("sticker_url", sticker.getUrl()); + stickerData.put("sticker_name", sticker.getName()); } catch (JSONException e) { e.printStackTrace(); } - sendCustomMessage(UIKitConstants.IntentStrings.STICKERS,stickerData); + sendCustomMessage(UIKitConstants.IntentStrings.STICKERS, stickerData); stickerLayout.setVisibility(GONE); } }); @@ -517,7 +521,7 @@ public void onClickListener(Sticker sticker) { replyClose = view.findViewById(R.id.iv_reply_close); replyClose.setOnClickListener(this); - if (repliedMessage!=null) { + if (repliedMessage != null) { baseMessage = repliedMessage; replyMessage(); } @@ -568,7 +572,7 @@ public void onClickListener(Sticker sticker) { if (isEdit) { composeBox.ivMic.setVisibility(GONE); composeBox.ivSend.setVisibility(View.VISIBLE); - }else { + } else { FeatureRestriction.isVoiceNotesEnabled(new FeatureRestriction.OnSuccessListener() { @Override public void onSuccess(Boolean booleanVal) { @@ -598,16 +602,16 @@ public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newStat @Override public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { - if (!isNoMoreMessages && !isInProgress) { - if (linearLayoutManager.findFirstVisibleItemPosition() == 10 || !rvChatListView.canScrollVertically(-1)) { - isInProgress = true; - fetchMessage(); - } - } - if (messageAdapter!=null && ((messageAdapter.getItemCount() - 1) - linearLayoutManager.findLastVisibleItemPosition() < 5)) { - newMessageLayout.setVisibility(GONE); - newMessageCount = 0; + if (!isNoMoreMessages && !isInProgress) { + if (linearLayoutManager.findFirstVisibleItemPosition() == 10 || !rvChatListView.canScrollVertically(-1)) { + isInProgress = true; + fetchMessage(); } + } + if (messageAdapter != null && ((messageAdapter.getItemCount() - 1) - linearLayoutManager.findLastVisibleItemPosition() < 5)) { + newMessageLayout.setVisibility(GONE); + newMessageCount = 0; + } } }); @@ -630,15 +634,16 @@ public void OnItemClick(String var, int position) { checkOnGoingCall(); } - private void checkOnGoingCall(String callType) { - if(CometChat.getActiveCall()!=null && CometChat.getActiveCall().getCallStatus().equals(CometChatConstants.CALL_STATUS_ONGOING) && CometChat.getActiveCall().getSessionId()!=null) { + private void checkOnGoingCall(String callType) { + if (CometChat.getActiveCall() != null && + CometChat.getActiveCall().getCallStatus().equals(CometChatConstants.CALL_STATUS_ONGOING) && CometChat.getActiveCall().getSessionId() != null) { AlertDialog.Builder alert = new AlertDialog.Builder(context); alert.setTitle(getResources().getString(R.string.ongoing_call)) .setMessage(getResources().getString(R.string.ongoing_call_message)) .setPositiveButton(getResources().getString(R.string.join), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - CallUtils.joinOnGoingCall(context,CometChat.getActiveCall()); + CallUtils.joinOnGoingCall(context, CometChat.getActiveCall()); } }).setNegativeButton(getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() { @Override @@ -648,18 +653,17 @@ public void onClick(DialogInterface dialog, int which) { videoCallAction.setClickable(true); } }).create().show(); - } - else { + } else { Call call = null; if (type.equalsIgnoreCase(CometChatConstants.RECEIVER_TYPE_GROUP)) - call = new Call(Id, CometChatConstants.RECEIVER_TYPE_GROUP,callType); + call = new Call(Id, CometChatConstants.RECEIVER_TYPE_GROUP, callType); else - call = new Call(Id, CometChatConstants.RECEIVER_TYPE_USER,callType); + call = new Call(Id, CometChatConstants.RECEIVER_TYPE_USER, callType); CometChat.initiateCall(call, new CometChat.CallbackListener() { @Override public void onSuccess(Call call) { CallUtils.startCallIntent(context, - ((User)call.getCallReceiver()),call.getType(),true, + ((User) call.getCallReceiver()), call.getType(), true, call.getSessionId()); } @@ -667,57 +671,58 @@ public void onSuccess(Call call) { public void onError(CometChatException e) { audioCallAction.setClickable(true); videoCallAction.setClickable(true); - Log.e(TAG, "onError: "+e.getMessage()); + Log.e(TAG, "onError: " + e.getMessage()); CometChatSnackBar.show(context, rvChatListView, - CometChatError.localized(e),CometChatSnackBar.ERROR); + CometChatError.localized(e), CometChatSnackBar.ERROR); } }); } } + /** * This method is used to check if the app has ongoing call or not and based on it show the view * through which user can join ongoing call. * */ private void checkOnGoingCall() { - if(CometChat.getActiveCall()!=null - && (CometChat.getActiveCall().getReceiverUid().equalsIgnoreCase(Id) || - CometChat.getActiveCall().getReceiverUid() - .equalsIgnoreCase(loggedInUser.getUid())) - && CometChat.getActiveCall().getCallStatus(). - equals(CometChatConstants.CALL_STATUS_ONGOING) - && CometChat.getActiveCall().getSessionId()!=null) { - - if(onGoingCallView!=null) - onGoingCallView.setVisibility(View.VISIBLE); - if(onGoingCallTxt!=null) { - onGoingCallTxt.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { + if (CometChat.getActiveCall() != null + && (CometChat.getActiveCall().getReceiverUid().equalsIgnoreCase(Id) || + CometChat.getActiveCall().getReceiverUid() + .equalsIgnoreCase(loggedInUser.getUid())) + && CometChat.getActiveCall().getCallStatus(). + equals(CometChatConstants.CALL_STATUS_ONGOING) + && CometChat.getActiveCall().getSessionId() != null) { + + if (onGoingCallView != null) + onGoingCallView.setVisibility(View.VISIBLE); + if (onGoingCallTxt != null) { + onGoingCallTxt.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + onGoingCallView.setVisibility(View.GONE); + if (CometChat.getActiveCall() != null) + CallUtils.joinOnGoingCall(context, CometChat.getActiveCall()); + else { + Toast.makeText(context, getString(R.string.call_ended), Toast.LENGTH_LONG).show(); onGoingCallView.setVisibility(View.GONE); - if (CometChat.getActiveCall()!=null) - CallUtils.joinOnGoingCall(context,CometChat.getActiveCall()); - else { - Toast.makeText(context,getString(R.string.call_ended),Toast.LENGTH_LONG).show(); - onGoingCallView.setVisibility(View.GONE); - } - } - }); - } - if(onGoingCallClose!=null) { - onGoingCallClose.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - onGoingCallView.setVisibility(GONE); } - }); - } - } else if (CometChat.getActiveCall()!=null){ - if (onGoingCallView!=null) - onGoingCallView.setVisibility(GONE); - Log.e(TAG, "checkOnGoingCall: "+CometChat.getActiveCall().toString()); + } + }); + } + if (onGoingCallClose != null) { + onGoingCallClose.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + onGoingCallView.setVisibility(GONE); + } + }); } + } else if (CometChat.getActiveCall() != null) { + if (onGoingCallView != null) + onGoingCallView.setVisibility(GONE); + Log.e(TAG, "checkOnGoingCall: " + CometChat.getActiveCall().toString()); + } } private void setComposeBoxListener() { @@ -828,7 +833,7 @@ public void onSuccess(Boolean booleanVal) { Toast.makeText(getContext(), "Emoji Support is not enabled", Toast.LENGTH_LONG).show(); } - } else { + } else { if (isEdit) { editMessage(baseMessage, message); editMessageLayout.setVisibility(GONE); @@ -852,17 +857,21 @@ public void onVoiceNoteComplete(String string) { @Override public void onLocationActionClicked() { - if (Utils.hasPermissions(getContext(), Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION)) { + if (Utils.hasPermissions(getContext(), Manifest.permission.ACCESS_FINE_LOCATION, + Manifest.permission.ACCESS_COARSE_LOCATION)) { initLocation(); // locationManager = (LocationManager) Objects.requireNonNull(getContext()).getSystemService(Context.LOCATION_SERVICE); - boolean provider = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); - if (!provider) { + boolean gpsprovider = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); + if (!gpsprovider) { turnOnLocation(); } else { getLocation(); } } else { requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}, UIKitConstants.RequestCode.LOCATION); + if (Build.VERSION.SDK_INT == Build.VERSION_CODES.R) { + checkBackgroundLocationPermissionAPI30(UIKitConstants.RequestCode.LOCATION); + } } } @@ -880,9 +889,10 @@ public void OnResponseSuccess(Object var) { JSONObject stickersJSON = (JSONObject) var; stickersView.setData(Id, type, Extensions.extractStickersFromJSON(stickersJSON)); } + @Override public void OnResponseFailed(CometChatException e) { - CometChatSnackBar.show(context,stickersView, CometChatError.localized(e), CometChatSnackBar.ERROR); + CometChatSnackBar.show(context, stickersView, CometChatError.localized(e), CometChatSnackBar.ERROR); } }); } @@ -892,12 +902,12 @@ public void onWhiteboardClicked() { Extensions.callWhiteBoardExtension(Id, type, new ExtensionResponseListener() { @Override public void OnResponseSuccess(Object var) { - JSONObject jsonObject = (JSONObject)var; + JSONObject jsonObject = (JSONObject) var; } @Override public void OnResponseFailed(CometChatException e) { - CometChatSnackBar.show(context,rvChatListView, CometChatError.localized(e), CometChatSnackBar.ERROR); + CometChatSnackBar.show(context, rvChatListView, CometChatError.localized(e), CometChatSnackBar.ERROR); } }); } @@ -907,22 +917,44 @@ public void onWriteboardClicked() { Extensions.callWriteBoardExtension(Id, type, new ExtensionResponseListener() { @Override public void OnResponseSuccess(Object var) { - JSONObject jsonObject = (JSONObject)var; + JSONObject jsonObject = (JSONObject) var; } @Override public void OnResponseFailed(CometChatException e) { - CometChatSnackBar.show(context,rvChatListView, CometChatError.localized(e), CometChatSnackBar.ERROR); + CometChatSnackBar.show(context, rvChatListView, CometChatError.localized(e), CometChatSnackBar.ERROR); } }); } }); } + @TargetApi(30) + private void checkBackgroundLocationPermissionAPI30(int backgroundLocationRequestCode) { + if (Utils.hasPermissions(context, Manifest.permission.ACCESS_BACKGROUND_LOCATION)) + return; + AlertDialog alertDialog = new AlertDialog.Builder(context) + .setTitle(R.string.background_location_permission_title) + .setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + requestPermissions(new String[]{ + Manifest.permission.ACCESS_BACKGROUND_LOCATION} + , backgroundLocationRequestCode); + } + }) + .setNegativeButton(R.string.no, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + + } + }).create(); + alertDialog.show(); + } private void createPollDialog() { AlertDialog.Builder alertDialog = new AlertDialog.Builder(context, R.style.MyDialogTheme); - View view = LayoutInflater.from(context).inflate(R.layout.add_polls_layout,null); + View view = LayoutInflater.from(context).inflate(R.layout.add_polls_layout, null); alertDialog.setView(view); Dialog dialog = alertDialog.create(); optionsArrayList.clear(); @@ -934,12 +966,12 @@ 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 public void onClick(View v) { - View optionView = LayoutInflater.from(context).inflate(R.layout.polls_option,null); + View optionView = LayoutInflater.from(context).inflate(R.layout.polls_option, null); optionsArrayList.add(optionView); optionLayout.addView(optionView); optionView.findViewById(R.id.delete_option).setOnClickListener(new View.OnClickListener() { @@ -972,7 +1004,7 @@ else if (option2Text.getText().toString().trim().isEmpty()) JSONArray optionJson = new JSONArray(); optionJson.put(option1Text.getText().toString()); optionJson.put(option2Text.getText().toString()); - for(View views : optionsArrayList) { + for (View views : optionsArrayList) { EditText optionsText = views.findViewById(R.id.option_txt); if (!optionsText.getText().toString().trim().isEmpty()) optionJson.put(optionsText.getText().toString()); @@ -994,17 +1026,17 @@ public void onSuccess(JSONObject jsonObject) { public void onError(CometChatException e) { progressDialog.dismiss(); addPoll.setEnabled(true); - Log.e(TAG, "onErrorCallExtension: "+e.getMessage()); - if (view!=null) - CometChatSnackBar.show(context,view, - CometChatError.Extension.localized(e,"polls") + Log.e(TAG, "onErrorCallExtension: " + e.getMessage()); + if (view != null) + CometChatSnackBar.show(context, view, + CometChatError.Extension.localized(e, "polls") , CometChatSnackBar.ERROR); } }); } catch (Exception e) { addPoll.setEnabled(true); - Log.e(TAG, "onErrorJSON: "+e.getMessage()); - Toast.makeText(context,e.getMessage(),Toast.LENGTH_LONG).show(); + Log.e(TAG, "onErrorJSON: " + e.getMessage()); + Toast.makeText(context, e.getMessage(), Toast.LENGTH_LONG).show(); } } } @@ -1021,27 +1053,39 @@ public void onClick(View v) { private void getLocation() { fusedLocationProviderClient.getLastLocation().addOnSuccessListener(new OnSuccessListener() { - @Override - public void onSuccess(Location location) { - if (location != null) - { - double lon = location.getLongitude(); - double lat = location.getLatitude(); + @Override + public void onSuccess(Location location_) { + if (location_ != null) { + double lon = location_.getLongitude(); + double lat = location_.getLatitude(); + + JSONObject customData = new JSONObject(); + try { + customData.put("latitude", lat); + customData.put("longitude", lon); + } catch (JSONException e) { + e.printStackTrace(); + } - JSONObject customData = new JSONObject(); - try { - customData.put("latitude", lat); - customData.put("longitude", lon); - } catch (JSONException e) { - e.printStackTrace(); - } + initAlert(customData); + } else if(location!=null) { + double lon = location.getLongitude(); + double lat = location.getLatitude(); + + JSONObject customData = new JSONObject(); + try { + customData.put("latitude", lat); + customData.put("longitude", lon); + } catch (JSONException e) { + e.printStackTrace(); + } - initAlert(customData); - } else { - Toast.makeText(context,getString(R.string.unable_to_get_location),Toast.LENGTH_LONG).show(); + initAlert(customData); + } else { + Toast.makeText(context, getString(R.string.unable_to_get_location), Toast.LENGTH_LONG).show(); + } } - } - }); + }); } private void initAlert(JSONObject customData) { @@ -1116,6 +1160,7 @@ else if (customType.equalsIgnoreCase(UIKitConstants.IntentStrings.STICKERS)) public void onSuccess(CustomMessage customMessage) { Log.e(TAG, "onSuccessCustomMesage: "+customMessage.toString()); if (customType.equalsIgnoreCase(UIKitConstants.IntentStrings.GROUP_CALL)) { + rvSmartReply.setVisibility(GONE); if (CometChat.getActiveCall() == null) CallUtils.startDirectCall(context, Utils.getDirectCallData(customMessage)); } @@ -1157,7 +1202,9 @@ private void initLocation() { fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(getActivity()); locationListener = new LocationListener() { @Override - public void onLocationChanged(Location location) {} + public void onLocationChanged(Location l) { + location = l; + } @Override public void onStatusChanged(String provider, int status, Bundle extras) {} @Override @@ -1170,8 +1217,7 @@ public void onProviderDisabled(String provider) {} locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, MIN_TIME, MIN_DIST, locationListener); locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, MIN_TIME, MIN_DIST, locationListener); } - catch (Exception e) - { + catch (Exception e) { e.printStackTrace(); } } @@ -1585,6 +1631,7 @@ public void onSuccess(MediaMessage mediaMessage) { Log.d(TAG, "sendMediaMessage onSuccess: " + mediaMessage.toString()); if (messageAdapter != null) { messageAdapter.updateChangedMessage(mediaMessage); + rvSmartReply.setVisibility(GONE); } } @@ -1753,6 +1800,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); } @@ -2008,17 +2056,13 @@ public void onUserOffline(User user) { * @param baseMessage is object of BaseMessage.class. It is message which is been marked as read. */ private void markMessageAsRead(BaseMessage baseMessage) { - FeatureRestriction.isDeliveryReceiptsEnabled(new FeatureRestriction.OnSuccessListener() { - @Override - public void onSuccess(Boolean booleanVal) { // CometChat.markAsRead(baseMessage); //Used for v3 if (type.equals(CometChatConstants.RECEIVER_TYPE_USER)) - CometChat.markAsRead(baseMessage.getId(), baseMessage.getSender().getUid(), baseMessage.getReceiverType()); + CometChat.markAsRead(baseMessage.getId(), baseMessage.getSender().getUid(), + baseMessage.getReceiverType()); else - CometChat.markAsRead(baseMessage.getId(), baseMessage.getReceiverUid(), baseMessage.getReceiverType()); - } - }); - + CometChat.markAsRead(baseMessage.getId(), baseMessage.getReceiverUid(), + baseMessage.getReceiverType()); } @@ -2169,6 +2213,10 @@ private void setMessage(BaseMessage message) { messageList.add(message); initMessageAdapter(messageList); } + } else { + if (messageAdapter!=null) { + messageAdapter.updateReplyCount(message.getParentMessageId()); + } } } @@ -2220,7 +2268,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)); } }); } @@ -3269,16 +3317,29 @@ private void replyMessage() { replyMessage.setCompoundDrawablesWithIntrinsicBounds(0,0,0,0); replyMedia.setVisibility(View.VISIBLE); if (baseMessage.getType().equals(CometChatConstants.MESSAGE_TYPE_TEXT)) { - replyMessage.setText(((TextMessage) baseMessage).getText()); +// boolean isSentimentNegative = Extensions.checkSentiment(baseMessage); +// if (isSentimentNegative) { +// replyMessage.setBackgroundColor(getResources().getColor(R.color.red)); +// replyMessage.setText(getString(R.string.sentiment_content)); +// } +// else { +// replyMessage.setBackgroundColor(getResources().getColor(android.R.color.transparent)); + replyMessage.setText(((TextMessage) baseMessage).getText()); +// } replyMedia.setVisibility(GONE); } else if (baseMessage.getType().equals(CometChatConstants.MESSAGE_TYPE_IMAGE)) { replyMessage.setText(getResources().getString(R.string.shared_a_image)); - Glide.with(context).load(((MediaMessage) baseMessage).getAttachment().getFileUrl()).into(replyMedia); +// boolean isImageSafe = Extensions.getImageModeration(context,baseMessage); +// if (isImageSafe) + Glide.with(context).load(((MediaMessage) baseMessage).getAttachment().getFileUrl()).into(replyMedia); +// else { +// replyMedia.setImageResource(R.drawable.ic_privacy); +// } } else if (baseMessage.getType().equals(CometChatConstants.MESSAGE_TYPE_AUDIO)) { String messageStr = String.format(getResources().getString(R.string.shared_a_audio), Utils.getFileSize(((MediaMessage) baseMessage).getAttachment().getFileSize())); replyMessage.setText(messageStr); - replyMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_library_music_24dp, 0, 0, 0); + replyMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_audio, 0, 0, 0); } else if (baseMessage.getType().equals(CometChatConstants.MESSAGE_TYPE_VIDEO)) { replyMessage.setText(getResources().getString(R.string.shared_a_video)); Glide.with(context).load(((MediaMessage) baseMessage).getAttachment().getFileUrl()).into(replyMedia); @@ -3286,7 +3347,7 @@ private void replyMessage() { String messageStr = String.format(getResources().getString(R.string.shared_a_file), Utils.getFileSize(((MediaMessage) baseMessage).getAttachment().getFileSize())); replyMessage.setText(messageStr); - replyMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_insert_drive_file_black_24dp, 0, 0, 0); + replyMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_file_upload, 0, 0, 0); } else if (baseMessage.getType().equals(UIKitConstants.IntentStrings.LOCATION)) { try { JSONObject jsonObject = ((CustomMessage) baseMessage).getCustomData(); @@ -3314,12 +3375,15 @@ private void replyMessage() { } } else if (baseMessage.getType().equals(UIKitConstants.IntentStrings.WHITEBOARD)) { replyMessage.setText(getString(R.string.shared_a_whiteboard)); - replyMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_whiteboard_24dp, 0, 0, 0); + replyMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_collaborative_whiteboard, 0, 0, 0); } else if (baseMessage.getType().equals(UIKitConstants.IntentStrings.WRITEBOARD)) { replyMessage.setText(getString(R.string.shared_a_writeboard)); - replyMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_writeboard_24dp, 0, 0, 0); + replyMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_collaborative_document, 0, 0, 0); + } else if (baseMessage.getType().equals(UIKitConstants.IntentStrings.GROUP_CALL)) { + replyMessage.setText(getString(R.string.has_shared_group_call)); + replyMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_video_call_selected,0,0,0); } composeBox.ivMic.setVisibility(GONE); composeBox.ivSend.setVisibility(View.VISIBLE); @@ -3413,13 +3477,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/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/message_list/MessageAdapter.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/message_list/MessageAdapter.java index 0bbe485..5a2d89b 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/message_list/MessageAdapter.java +++ b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/message_list/MessageAdapter.java @@ -46,6 +46,7 @@ import com.cometchat.pro.models.Action; import com.cometchat.pro.models.Attachment; import com.cometchat.pro.models.CustomMessage; +import com.cometchat.pro.models.Group; import com.cometchat.pro.uikit.R; import com.cometchat.pro.uikit.ui_components.messages.extensions.Extensions; @@ -58,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; @@ -583,7 +585,7 @@ private void setPollsData(PollMessageViewHolder viewHolder, int i) { public void onSuccess(Boolean booleanVal) { if (baseMessage.getReplyCount()!=0 && booleanVal) { viewHolder.tvThreadReplyCount.setVisibility(View.VISIBLE); - viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+context.getResources().getString(R.string.replies)); + viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+" "+context.getResources().getString(R.string.replies)); } else { viewHolder.tvThreadReplyCount.setVisibility(View.GONE); } @@ -646,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); @@ -803,7 +805,7 @@ public void onClick(DialogInterface dialog, int which) { if (baseMessage.getReplyCount()!=0) { viewHolder.tvThreadReplyCount.setVisibility(View.VISIBLE); - viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+context.getResources().getString(R.string.replies)); + viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+" "+context.getResources().getString(R.string.replies)); } else { viewHolder.tvThreadReplyCount.setVisibility(View.GONE); } @@ -905,7 +907,7 @@ public void onClick(View v) { if (baseMessage.getReplyCount()!=0) { viewHolder.tvThreadReplyCount.setVisibility(View.VISIBLE); - viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+context.getResources().getString(R.string.replies)); + viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+" "+context.getResources().getString(R.string.replies)); } else { viewHolder.tvThreadReplyCount.setVisibility(View.GONE); } @@ -1010,7 +1012,7 @@ public void onClick(View v) { if (baseMessage.getReplyCount()!=0) { viewHolder.tvThreadReplyCount.setVisibility(View.VISIBLE); - viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+context.getResources().getString(R.string.replies)); + viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+" "+context.getResources().getString(R.string.replies)); } else { viewHolder.tvThreadReplyCount.setVisibility(View.GONE); } @@ -1108,7 +1110,7 @@ private void setLocationData(LocationMessageViewHolder viewHolder, int i) { public void onSuccess(Boolean booleanVal) { if (baseMessage.getReplyCount()!=0 && booleanVal) { viewHolder.tvThreadReplyCount.setVisibility(View.VISIBLE); - viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+context.getResources().getString(R.string.replies)); + viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+" "+context.getResources().getString(R.string.replies)); } else { viewHolder.tvThreadReplyCount.setVisibility(View.GONE); } @@ -1252,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() { @@ -1260,7 +1262,7 @@ private void setAudioData(AudioMessageViewHolder viewHolder, int i) { public void onSuccess(Boolean booleanVal) { if (baseMessage.getReplyCount()!=0 && booleanVal) { viewHolder.tvThreadReplyCount.setVisibility(View.VISIBLE); - viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+context.getResources().getString(R.string.replies)); + viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+" "+context.getResources().getString(R.string.replies)); } else { viewHolder.tvThreadReplyCount.setVisibility(View.GONE); } @@ -1393,7 +1395,7 @@ private void setFileData(FileMessageViewHolder viewHolder, int i) { public void onSuccess(Boolean booleanVal) { if (baseMessage.getReplyCount()!=0 && booleanVal) { viewHolder.tvThreadReplyCount.setVisibility(View.VISIBLE); - viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+context.getResources().getString(R.string.replies)); + viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+" "+context.getResources().getString(R.string.replies)); } else { viewHolder.tvThreadReplyCount.setVisibility(View.GONE); } @@ -1528,7 +1530,7 @@ private void setImageData(ImageMessageViewHolder viewHolder, int i) { public void onSuccess(Boolean booleanVal) { if (baseMessage.getReplyCount()!=0 && booleanVal) { viewHolder.tvThreadReplyCount.setVisibility(View.VISIBLE); - viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+context.getResources().getString(R.string.replies)); + viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+" "+context.getResources().getString(R.string.replies)); } else { viewHolder.tvThreadReplyCount.setVisibility(View.GONE); } @@ -1707,7 +1709,7 @@ private void setStickerData(StickerMessageViewHolder viewHolder, int i) { public void onSuccess(Boolean booleanVal) { if (baseMessage.getReplyCount()!=0 && booleanVal) { viewHolder.tvThreadReplyCount.setVisibility(View.VISIBLE); - viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+context.getResources().getString(R.string.replies)); + viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+" "+context.getResources().getString(R.string.replies)); } else { viewHolder.tvThreadReplyCount.setVisibility(View.GONE); } @@ -1802,7 +1804,7 @@ private void setVideoData(VideoMessageViewHolder viewHolder, int i) { public void onSuccess(Boolean booleanVal) { if (baseMessage.getReplyCount()!=0 && booleanVal) { viewHolder.tvThreadReplyCount.setVisibility(View.VISIBLE); - viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+context.getResources().getString(R.string.replies)); + viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+" "+context.getResources().getString(R.string.replies)); } else { viewHolder.tvThreadReplyCount.setVisibility(View.GONE); } @@ -2078,15 +2080,15 @@ public void onSuccess(Boolean booleanVal) { progressBar.setVisibility(View.GONE); if (baseMessage.getReadAt() != 0) { txtTime.setText(Utils.getHeaderDate(baseMessage.getReadAt() * 1000)); - txtTime.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_double_tick, 0); + txtTime.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_message_read, 0); txtTime.setCompoundDrawablePadding(10); } else if (baseMessage.getDeliveredAt() != 0) { txtTime.setText(Utils.getHeaderDate(baseMessage.getDeliveredAt() * 1000)); - txtTime.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_done_all_black_24dp, 0); + txtTime.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_message_delivered, 0); txtTime.setCompoundDrawablePadding(10); } else if (baseMessage.getSentAt()>0){ txtTime.setText(Utils.getHeaderDate(baseMessage.getSentAt() * 1000)); - txtTime.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_check_black_24dp, 0); + txtTime.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_message_sent, 0); txtTime.setCompoundDrawablePadding(10); } else if (baseMessage.getSentAt()==-1) { txtTime.setText(""); @@ -2181,10 +2183,21 @@ public void onClick(DialogInterface dialog, int which) { String messageType = replyMessage.getType(); viewHolder.replyLayout.setVisibility(View.VISIBLE); viewHolder.replyUser.setVisibility(View.VISIBLE); - viewHolder.replyUser.setText(replyMessage.getSender().getName()); + if (replyMessage.getReceiverType().equals(CometChatConstants.RECEIVER_TYPE_USER)) + viewHolder.replyUser.setText(replyMessage.getSender().getName()); + else + viewHolder.replyUser.setText(replyMessage.getSender().getName()+ + " ~ "+((Group)replyMessage.getReceiver()).getName()); if (messageType.equals(CometChatConstants.MESSAGE_TYPE_TEXT)) { - viewHolder.replyMessageImage.setVisibility(View.GONE); - viewHolder.replyMessage.setText(((TextMessage)replyMessage).getText()); + String message = ((TextMessage)replyMessage).getText(); + if(CometChat.isExtensionEnabled("profanity-filter")) { + message = Extensions.checkProfanityMessage(context,replyMessage); + } + if(CometChat.isExtensionEnabled("data-masking")) { + message = Extensions.checkDataMasking(context,replyMessage); + } + viewHolder.replyMessageImage.setVisibility(View.GONE); + viewHolder.replyMessage.setText(message); } else if (messageType.equals(CometChatConstants.MESSAGE_TYPE_IMAGE)) { viewHolder.replyMessage.setText(context.getResources().getString(R.string.message_image)); viewHolder.replyMessageImage.setVisibility(View.GONE); @@ -2243,7 +2256,7 @@ public boolean onLongClick(View view) { public void onSuccess(Boolean booleanVal) { if (baseMessage.getReplyCount()!=0 && booleanVal) { viewHolder.tvThreadReplyCount.setVisibility(View.VISIBLE); - viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+context.getResources().getString(R.string.replies)); + viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+" "+context.getResources().getString(R.string.replies)); } else { viewHolder.tvThreadReplyCount.setVisibility(View.GONE); } @@ -2400,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() { @@ -2498,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 { @@ -2593,7 +2606,7 @@ private void setLinkData(LinkMessageViewHolder viewHolder, int i) { public void onSuccess(Boolean booleanVal) { if (baseMessage.getReplyCount()!=0 && booleanVal) { viewHolder.tvThreadReplyCount.setVisibility(View.VISIBLE); - viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+context.getResources().getString(R.string.replies)); + viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+" "+context.getResources().getString(R.string.replies)); } else { viewHolder.tvThreadReplyCount.setVisibility(View.GONE); } @@ -2719,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); @@ -3003,6 +3016,16 @@ public int getPosition(BaseMessage baseMessage){ return messageList.indexOf(baseMessage); } + public void updateReplyCount(int parentMessageId) { + for(BaseMessage baseMessage : messageList) { + if (baseMessage.getId()==parentMessageId) { + int replyCount = baseMessage.getReplyCount(); + baseMessage.setReplyCount(++replyCount); + notifyItemChanged(messageList.indexOf(baseMessage)); + } + } + } + class ImageMessageViewHolder extends RecyclerView.ViewHolder { private ImageView imageView; diff --git a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/CometChatThreadMessageList.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/CometChatThreadMessageList.java index 63fb1d0..8fdb819 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/CometChatThreadMessageList.java +++ b/ConnectionService + Firebase/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() { @@ -1118,7 +1119,17 @@ public void onRequestPermissionsResult(int requestCode, @NonNull String[] permis showPermissionSnackBar(view.findViewById(R.id.message_box), getResources().getString(R.string.grant_storage_permission)); break; case UIKitConstants.RequestCode.LOCATION: - if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { } + if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { + initLocation(); +// locationManager = (LocationManager) Objects.requireNonNull(getContext()).getSystemService(Context.LOCATION_SERVICE); + boolean provider = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); + if (!provider) { + turnOnLocation(); + } + else { + getLocation(); + } + } else showPermissionSnackBar(view.findViewById(R.id.message_box), getResources().getString(R.string.grant_location_permission)); break; @@ -2696,7 +2707,7 @@ private void replyMessage() { String messageStr = String.format(getResources().getString(R.string.shared_a_audio), Utils.getFileSize(((MediaMessage) baseMessage).getAttachment().getFileSize())); replyMessage.setText(messageStr); - replyMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_library_music_24dp, 0, 0, 0); + replyMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_audio, 0, 0, 0); } else if (baseMessage.getType().equals(CometChatConstants.MESSAGE_TYPE_VIDEO)) { replyMessage.setText(getResources().getString(R.string.shared_a_video)); Glide.with(context).load(((MediaMessage) baseMessage).getAttachment().getFileUrl()).into(replyMedia); @@ -2704,7 +2715,7 @@ private void replyMessage() { String messageStr = String.format(getResources().getString(R.string.shared_a_file), Utils.getFileSize(((MediaMessage) baseMessage).getAttachment().getFileSize())); replyMessage.setText(messageStr); - replyMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_insert_drive_file_black_24dp, 0, 0, 0); + replyMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_file_upload, 0, 0, 0); } composeBox.ivSend.setVisibility(View.VISIBLE); replyMessageLayout.setVisibility(View.VISIBLE); diff --git a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/CometChatThreadMessageListActivity.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/CometChatThreadMessageListActivity.java index 4867c44..05bf3b0 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/CometChatThreadMessageListActivity.java +++ b/ConnectionService + Firebase/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/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/ThreadAdapter.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/ThreadAdapter.java index 6a5dede..32578e9 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/ThreadAdapter.java +++ b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/ThreadAdapter.java @@ -51,7 +51,9 @@ 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; import com.google.android.material.chip.ChipGroup; @@ -789,15 +791,15 @@ private void setStatusIcon(ProgressBar progressBar,TextView txtTime, BaseMessage progressBar.setVisibility(View.GONE); if (baseMessage.getReadAt() != 0) { txtTime.setText(Utils.getHeaderDate(baseMessage.getReadAt() * 1000)); - txtTime.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_double_tick, 0); + txtTime.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_message_read, 0); txtTime.setCompoundDrawablePadding(10); } else if (baseMessage.getDeliveredAt() != 0) { txtTime.setText(Utils.getHeaderDate(baseMessage.getDeliveredAt() * 1000)); - txtTime.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_done_all_black_24dp, 0); + txtTime.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_message_delivered, 0); txtTime.setCompoundDrawablePadding(10); } else if (baseMessage.getSentAt()>0){ txtTime.setText(Utils.getHeaderDate(baseMessage.getSentAt() * 1000)); - txtTime.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_check_black_24dp, 0); + txtTime.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_message_sent, 0); txtTime.setCompoundDrawablePadding(10); } else if (baseMessage.getSentAt()==-1) { txtTime.setText(""); @@ -990,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() { @@ -1169,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); @@ -1485,7 +1487,7 @@ public class TextMessageViewHolder extends RecyclerView.ViewHolder { private int type; private CometChatAvatar ivUser; private RelativeLayout rlMessageBubble; - private RelativeLayout replyLayout; + private MaterialCardView replyLayout; private TextView replyUser; private TextView replyMessage; private RelativeLayout sentimentVw; diff --git a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/CometChatSnackBar.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/CometChatSnackBar.java index 1e2506d..62f01b3 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/CometChatSnackBar.java +++ b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/CometChatSnackBar.java @@ -37,7 +37,7 @@ private static void customSnackBar(Context context,View parentLayout,String mess ImageView closeImage = dialogView.findViewById(R.id.iv_close); ImageView iconImage = dialogView.findViewById(R.id.iv_icon); if (type.equalsIgnoreCase(ERROR)) { - iconImage.setImageResource(R.drawable.ic_baseline_error_24); + iconImage.setImageResource(R.drawable.ic_error); iconImage.setImageTintList(ColorStateList.valueOf(context.getResources().getColor(R.color.textColorWhite))); closeImage.setImageTintList(ColorStateList.valueOf(context.getResources().getColor(R.color.textColorWhite))); messageTv.setTextColor(ColorStateList.valueOf(context.getResources().getColor(R.color.textColorWhite))); @@ -51,7 +51,7 @@ private static void customSnackBar(Context context,View parentLayout,String mess dialogView.setBackgroundColor(context.getResources().getColor(R.color.colorPrimary)); } else if (type.equalsIgnoreCase(WARNING)) { snackbar.setDuration(Snackbar.LENGTH_LONG); - iconImage.setImageResource(R.drawable.ic_warning_image); + iconImage.setImageResource(R.drawable.ic_report); iconImage.setImageTintList(ColorStateList.valueOf(context.getResources().getColor(R.color.textColorWhite))); closeImage.setImageTintList(ColorStateList.valueOf(context.getResources().getColor(R.color.textColorWhite))); messageTv.setTextColor(ColorStateList.valueOf(context.getResources().getColor(R.color.textColorWhite))); diff --git a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatAvatar/CometChatAvatar.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatAvatar/CometChatAvatar.java index c43af79..5801242 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatAvatar/CometChatAvatar.java +++ b/ConnectionService + Firebase/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/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatBadgeCount/CometChatBadgeCount.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatBadgeCount/CometChatBadgeCount.java index 149faf5..be0940d 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatBadgeCount/CometChatBadgeCount.java +++ b/ConnectionService + Firebase/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/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatCalls/CometChatCallsAdapter.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatCalls/CometChatCallsAdapter.java index ebedb86..af72a2f 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatCalls/CometChatCallsAdapter.java +++ b/ConnectionService + Firebase/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 @@ -173,18 +174,22 @@ public void onBindViewHolder(@NonNull CallViewHolder callViewHolder, int positio } if (isVideo) { - callViewHolder.callListRowBinding.callMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_videocam_24dp,0,0,0); + if(isIncoming) { + callViewHolder.callListRowBinding.callMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_incoming_video_call,0,0,0); + } else { + callViewHolder.callListRowBinding.callMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_outgoing_video_call,0,0,0); + } } else { if (isIncoming && isMissed) { callViewHolder.callListRowBinding.callMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_call_missed_incoming_24dp,0,0,0); } else if(isIncoming && !isMissed) { - callViewHolder.callListRowBinding.callMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_call_incoming_24dp,0,0,0); + callViewHolder.callListRowBinding.callMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_incoming_call,0,0,0); } else if (!isIncoming && isMissed) { callViewHolder.callListRowBinding.callMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_call_missed_outgoing_24dp,0,0,0); } else { - callViewHolder.callListRowBinding.callMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_call_outgoing_24dp,0,0,0); + callViewHolder.callListRowBinding.callMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_outgoing_call,0,0,0); } } callViewHolder.callListRowBinding.calltimeTv.setText(Utils.getLastMessageDate(context,call.getInitiatedAt())); @@ -199,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/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatComposeBox/CometChatComposeBox.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatComposeBox/CometChatComposeBox.java index a72c03c..eba8886 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatComposeBox/CometChatComposeBox.java +++ b/ConnectionService + Firebase/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 { @@ -66,7 +67,7 @@ public class CometChatComposeBox extends RelativeLayout implements View.OnClickL private boolean isOpen,isRecording,isPlaying,voiceMessage; - public ImageView ivAudio,ivCamera,ivGallery, ivFile,ivSend,ivArrow,ivMic,ivDelete; + public ImageView ivSend,ivArrow,ivMic,ivDelete; private SeekBar voiceSeekbar; @@ -151,29 +152,17 @@ public void onAudioFocusChange(int focusChange) { voiceMessageLayout=this.findViewById(R.id.voiceMessageLayout); recordTime=this.findViewById(R.id.record_time); voiceSeekbar=this.findViewById(R.id.voice_message_seekbar); - ivCamera=this.findViewById(R.id.ivCamera); - ivGallery=this.findViewById(R.id.ivImage); - ivAudio = this.findViewById(R.id.ivAudio); - ivFile =this.findViewById(R.id.ivFile); - ivSend=this.findViewById(R.id.ivSend); ivArrow=this.findViewById(R.id.ivArrow); etComposeBox=this.findViewById(R.id.etComposeBox); - rlActionContainer=this.findViewById(R.id.rlActionContainers); + ivSend=this.findViewById(R.id.ivSend); ivArrow.setImageTintList(ColorStateList.valueOf(color)); - ivCamera.setImageTintList(ColorStateList.valueOf(color)); - ivGallery.setImageTintList(ColorStateList.valueOf(color)); - ivFile.setImageTintList(ColorStateList.valueOf(color)); ivSend.setImageTintList(ColorStateList.valueOf(color)); - ivAudio.setOnClickListener(this); ivArrow.setOnClickListener(this); ivSend.setOnClickListener(this); ivDelete.setOnClickListener(this); - ivFile.setOnClickListener(this); ivMic.setOnClickListener(this); - ivGallery.setOnClickListener(this); - ivCamera.setOnClickListener(this); composeBoxActionFragment = new CometChatComposeBoxActions(); @@ -257,28 +246,21 @@ public void OnMediaSelected(InputContentInfoCompat i) { if (Utils.isDarkMode(context)) { composeBox.setBackgroundColor(getResources().getColor(R.color.darkModeBackground)); - ivAudio.setImageTintList(ColorStateList.valueOf(getResources().getColor(R.color.textColorWhite))); - ivMic.setImageDrawable(getResources().getDrawable(R.drawable.ic_mic_white_24dp)); + ivMic.setImageDrawable(getResources().getDrawable(R.drawable.ic_microphone_white_selected)); flBox.setBackgroundTintList(ColorStateList.valueOf(getResources().getColor(R.color.textColorWhite))); etComposeBox.setTextColor(getResources().getColor(R.color.textColorWhite)); ivArrow.setImageTintList(ColorStateList.valueOf(getResources().getColor(R.color.textColorWhite))); ivSend.setImageTintList(ColorStateList.valueOf(getResources().getColor(R.color.textColorWhite))); - ivCamera.setImageTintList(ColorStateList.valueOf(getResources().getColor(R.color.textColorWhite))); - ivGallery.setImageTintList(ColorStateList.valueOf(getResources().getColor(R.color.textColorWhite))); - ivFile.setImageTintList(ColorStateList.valueOf(getResources().getColor(R.color.textColorWhite))); } else { composeBox.setBackgroundColor(getResources().getColor(R.color.textColorWhite)); - ivAudio.setImageTintList(ColorStateList.valueOf(getResources().getColor(R.color.colorPrimary))); - ivMic.setImageDrawable(getResources().getDrawable(R.drawable.ic_mic_grey_24dp)); + ivMic.setImageDrawable(getResources().getDrawable(R.drawable.ic_microphone_grey_selected)); etComposeBox.setTextColor(getResources().getColor(R.color.primaryTextColor)); ivSend.setImageTintList(ColorStateList.valueOf(getResources().getColor(R.color.colorPrimary))); flBox.setBackgroundTintList(ColorStateList.valueOf(getResources().getColor(R.color.grey))); ivArrow.setImageTintList(ColorStateList.valueOf(getResources().getColor(R.color.grey))); - ivCamera.setImageTintList(ColorStateList.valueOf(getResources().getColor(R.color.colorPrimary))); - ivFile.setImageTintList(ColorStateList.valueOf(getResources().getColor(R.color.colorPrimary))); } - 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(); @@ -362,18 +344,10 @@ public void setColor(int color) { ivSend.setImageTintList(ColorStateList.valueOf(color)); - ivCamera.setImageTintList(ColorStateList.valueOf(color)); - ivGallery.setImageTintList(ColorStateList.valueOf(color)); - ivFile.setImageTintList(ColorStateList.valueOf(color)); - ivArrow.setImageTintList(ColorStateList.valueOf(color)); } public void setComposeBoxListener(ComposeActionListener composeActionListener){ this.composeActionListener=composeActionListener; - - this.composeActionListener.getCameraActionView(ivCamera); - this.composeActionListener.getGalleryActionView(ivGallery); - this.composeActionListener.getFileActionView(ivFile); } @Override @@ -385,19 +359,13 @@ public void onClick(View view) { etComposeBox.setVisibility(View.VISIBLE); ivArrow.setVisibility(View.VISIBLE); ivMic.setVisibility(View.VISIBLE); - ivMic.setImageDrawable(getResources().getDrawable(R.drawable.ic_mic_grey_24dp)); + ivMic.setImageDrawable(getResources().getDrawable(R.drawable.ic_microphone_grey_selected)); isPlaying = false; isRecording = false; voiceMessage = false; ivDelete.setVisibility(GONE); ivSend.setVisibility(View.GONE); } - if (view.getId()==R.id.ivCamera){ -// composeActionListener.onCameraActionClicked(ivCamera); - } - if (view.getId()==R.id.ivImage){ -// composeActionListener.onGalleryActionClicked(ivGallery); - } if (view.getId()==R.id.ivSend){ if (!voiceMessage) { composeActionListener.onSendActionClicked(etComposeBox); @@ -413,15 +381,9 @@ public void onClick(View view) { isRecording = false; isPlaying = false; voiceMessage = false; - ivMic.setImageResource(R.drawable.ic_mic_grey_24dp); + ivMic.setImageResource(R.drawable.ic_microphone_grey_selected); } - } - if(view.getId()==R.id.ivAudio) { -// composeActionListener.onAudioActionClicked(ivAudio); - } - if (view.getId()==R.id.ivFile){ -// composeActionListener.onFileActionClicked(ivFile); } if(view.getId()==R.id.ivArrow) { // if (isOpen) { diff --git a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatConversations/CometChatConversations.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatConversations/CometChatConversations.java index c5d4d21..92bac8a 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatConversations/CometChatConversations.java +++ b/ConnectionService + Firebase/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/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatConversations/CometChatConversationsAdapter.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatConversations/CometChatConversationsAdapter.java index e5d1ebb..d529ede 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatConversations/CometChatConversationsAdapter.java +++ b/ConnectionService + Firebase/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 userList = new ArrayList<>(); + private SwipeRefreshLayout swipeRefreshLayout; + public CometChatUserList() { // Required empty public constructor } @@ -123,6 +127,15 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, clearSearch = view.findViewById(R.id.clear_search); rlSearchBox=view.findViewById(R.id.rl_search_box); + swipeRefreshLayout = view.findViewById(R.id.swipe_refresh); + swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { + @Override + public void onRefresh() { + usersRequest= null; + rvUserList.clear(); + fetchUsers(); + } + }); CometChatError.init(getContext()); shimmerFrameLayout=view.findViewById(R.id.shimmer_layout); @@ -142,6 +155,7 @@ public void onSuccess(Boolean booleanVal) { } }); + isTitleVisible(); etSearch.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { } @@ -176,6 +190,8 @@ public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) { } }); + + clearSearch.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { @@ -213,13 +229,27 @@ public void OnItemClick(User user, int position) { return view; } + private void isTitleVisible() { + if (getArguments()!=null) { + boolean isVisible = getArguments().getBoolean(UIKitConstants.IntentStrings.IS_TITLE_VISIBLE,true); + if (isVisible) + title.setVisibility(View.VISIBLE); + else + title.setVisibility(View.GONE); + } + } + private void stopHideShimmer() { shimmerFrameLayout.stopShimmer(); shimmerFrameLayout.setVisibility(View.GONE); - title.setVisibility(View.VISIBLE); rlSearchBox.setVisibility(View.VISIBLE); } + public void setTitleVisible(boolean isVisible) { + Bundle bundle = new Bundle(); + bundle.putBoolean(UIKitConstants.IntentStrings.IS_TITLE_VISIBLE,isVisible); + setArguments(bundle); + } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { @@ -250,6 +280,8 @@ public void onSuccess(List users) { userList.addAll(users); stopHideShimmer(); rvUserList.setUserList(users); // set the users to rvUserList i.e CometChatUserList Component. + if (swipeRefreshLayout.isRefreshing()) + swipeRefreshLayout.setRefreshing(false); if (userList.size()==0) { noUserLayout.setVisibility(View.VISIBLE); diff --git a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/constants/UIKitConstants.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/constants/UIKitConstants.java index c7a5ea5..94ecf32 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/constants/UIKitConstants.java +++ b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/constants/UIKitConstants.java @@ -131,8 +131,14 @@ public static class IntentStrings { public static final String INTENT_MEDIA_VIDEO_MESSAGE = "intent_media_video_message"; + public static final String INTENT_MEDIA_AUDIO_MESSAGE = "intent_media_audio_message"; + + public static final String INTENT_MEDIA_FILE_MESSAGE = "intent_media_file_message"; public static final String LINK = "link"; - public static final String CALL_TYPE = "call_type"; + + public static final String IS_TITLE_VISIBLE = "IS_TITLE_VISIBLE"; + public static final String CREATE_GROUP_VISIBLE = "IS_CREATE_GROUP_VISIBLE"; + public static final String CALL_TYPE = "CALL_TYPE"; public static String POLL_QUESTION = "poll_question"; diff --git a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/utils/EncryptionUtils.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/utils/EncryptionUtils.java new file mode 100644 index 0000000..5dd74c9 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/utils/EncryptionUtils.java @@ -0,0 +1,97 @@ +package com.cometchat.pro.uikit.ui_resources.utils; + +import java.math.BigInteger; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.security.SecureRandom; + +import javax.crypto.Cipher; +import javax.crypto.SecretKey; +import javax.crypto.spec.GCMParameterSpec; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; + +public class EncryptionUtils { + + private static final String ENCRYPT_ALGO = "AES/CBC/PKCS5Padding"; + private static final int TAG_LENGTH_BIT = 128; + private static final int IV_LENGTH_BYTE = 16; + + private static final Charset UTF_8 = StandardCharsets.UTF_8; + + // hex representation + public static String hex(byte[] bytes) { + StringBuilder result = new StringBuilder(); + for (byte b : bytes) { + result.append(String.format("%02x", b)); + } + return result.toString(); + } + + public static byte[] toByteArray(String hexString) { + byte[] byteArray = new BigInteger(hexString, 16) + .toByteArray(); + if (byteArray[0] == 0) { + byte[] output = new byte[byteArray.length - 1]; + System.arraycopy( + byteArray, 1, output, + 0, output.length); + return output; + } + return byteArray; + } + // AES-GCM needs GCMParameterSpec + public static byte[] encrypt(byte[] pText, SecretKeySpec secret, byte[] iv) throws Exception { + + Cipher cipher = Cipher.getInstance(ENCRYPT_ALGO); + cipher.init(Cipher.ENCRYPT_MODE, secret, new IvParameterSpec(iv)); + byte[] encryptedText = cipher.doFinal(pText); + return encryptedText; + + } + + // prefix IV length + IV bytes to cipher text + public static byte[] encryptWithPrefixIV(byte[] pText, SecretKeySpec secret, byte[] iv) throws Exception { + + byte[] cipherText = encrypt(pText, secret, iv); + + byte[] cipherTextWithIv = ByteBuffer.allocate(iv.length + cipherText.length) + .put(iv) + .put(cipherText) + .array(); + return cipherTextWithIv; + + } + + public static String decrypt(byte[] cText, SecretKey secret, byte[] iv) throws Exception { + + Cipher cipher = Cipher.getInstance(ENCRYPT_ALGO); + cipher.init(Cipher.DECRYPT_MODE, secret, new IvParameterSpec(iv)); + byte[] plainText = cipher.doFinal(cText); + return new String(plainText, UTF_8); + + } + + public static byte[] getRandomNonce(int numBytes) { + byte[] nonce = new byte[numBytes]; + new SecureRandom().nextBytes(nonce); + return nonce; + } + + public static String decryptWithPrefixIV(byte[] cText, SecretKey secret) throws Exception { + + ByteBuffer bb = ByteBuffer.wrap(cText); + + byte[] iv = new byte[IV_LENGTH_BYTE]; + bb.get(iv); + //bb.get(iv, 0, iv.length); + + byte[] cipherText = new byte[bb.remaining()]; + bb.get(cipherText); + + String plainText = decrypt(cipherText, secret, iv); + return plainText; + + } +} diff --git a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/utils/MediaUtils.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/utils/MediaUtils.java index 7403332..87bddd0 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/utils/MediaUtils.java +++ b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/utils/MediaUtils.java @@ -1,6 +1,5 @@ package com.cometchat.pro.uikit.ui_resources.utils; -import android.annotation.SuppressLint; import android.app.Activity; import android.app.ProgressDialog; import android.content.ComponentName; @@ -33,7 +32,6 @@ import android.widget.Toast; import androidx.core.content.FileProvider; -import androidx.loader.content.CursorLoader; import com.cometchat.pro.models.BaseMessage; import com.cometchat.pro.models.MediaMessage; @@ -41,7 +39,6 @@ import com.cometchat.pro.uikit.R; import com.cometchat.pro.uikit.ui_settings.FeatureRestriction; -import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.ByteArrayOutputStream; import java.io.File; @@ -161,7 +158,7 @@ public static Intent openCamera(Context context) { e.printStackTrace(); } - outputFileUri = FileProvider.getUriForFile(context, provider + ".provider", file); + outputFileUri = FileProvider.getUriForFile(context, provider + ".provider", file); if (Build.VERSION.SDK_INT >= 29) { ContentResolver resolver = context.getContentResolver(); @@ -310,14 +307,21 @@ private static File createFileFromBitmap(Bitmap bitmap) { return f; } + public static File makeEmptyFileWithTitle(String title) { + String root; + if (Build.VERSION.SDK_INT < 29) { + root = Environment.getExternalStorageDirectory().getAbsolutePath(); + } else { + root = Environment.DIRECTORY_DOWNLOADS; + } + return new File(root, title); + } + public static File getRealPath(Context context, Uri fileUri,boolean isThirdParty) { Log.d("", "getRealPath: " + fileUri.getPath()); String realPath; - if (isGoogleDrive(fileUri)) { - return saveDriveFile(context, fileUri); - } - else if (isThirdParty) { - return downloadImage(context, fileUri); + if (isGoogleDrive(fileUri) || isThirdParty) { + return downloadFile(context, fileUri); } // SDK > 19 (Android 4.4) and up else if (Build.VERSION.SDK_INT < 28){ @@ -330,12 +334,12 @@ else if (Build.VERSION.SDK_INT < 28){ return new File(realPath); } - public static File downloadImage(Context context, Uri imageUri) { + public static File downloadFile(Context context, Uri imageUri) { // Uri imageUri = (Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM); File file = null; try { if (imageUri != null) { - file = new File(context.getCacheDir(), "image"); + file = new File(context.getCacheDir(), getFileName(context,imageUri)); InputStream inputStream = context.getContentResolver().openInputStream(imageUri); try { @@ -402,43 +406,38 @@ private static String getFilePathForN(Uri uri, Context context) { return file.getPath(); } - public static File saveDriveFile(Context context, Uri uri) { - - try { - - InputStream inputStream = context.getContentResolver().openInputStream(uri); - int originalSize = inputStream.available(); - - BufferedInputStream bis = null; - BufferedOutputStream bos = null; - String fileName = getFileName(context, uri); - File file = makeEmptyFileWithTitle(fileName); - bis = new BufferedInputStream(inputStream); - bos = new BufferedOutputStream(new FileOutputStream( - file, false)); - - byte[] buf = new byte[originalSize]; - bis.read(buf); - do { - bos.write(buf); - } while (bis.read(buf) != -1); - - bos.flush(); - bos.close(); - bis.close(); - - return file; - - } catch (IOException e) { - return null; - } - - } - - public static File makeEmptyFileWithTitle(String title) { - String root = Environment.getExternalStorageDirectory().getAbsolutePath(); - return new File(root, title); - } +// public static File saveDriveFile(Context context, Uri uri) { +// +// try { +// +// InputStream inputStream = context.getContentResolver().openInputStream(uri); +// int originalSize = inputStream.available(); +// +// BufferedInputStream bis = null; +// BufferedOutputStream bos = null; +// String fileName = getFileName(context, uri); +// File file = makeEmptyFileWithTitle(fileName); +// bis = new BufferedInputStream(inputStream); +// bos = new BufferedOutputStream(new FileOutputStream( +// file, false)); +// +// byte[] buf = new byte[originalSize]; +// bis.read(buf); +// do { +// bos.write(buf); +// } while (bis.read(buf) != -1); +// +// bos.flush(); +// bos.close(); +// bis.close(); +// +// return file; +// +// } catch (IOException e) { +// return null; +// } +// +// } /** @@ -470,15 +469,15 @@ private static String getRealPathFromURI(final Context context, final Uri uri) { // DownloadsProvider else if (isDownloadsDocument(uri)) { - String id = DocumentsContract.getDocumentId(uri); + String id = DocumentsContract.getDocumentId(uri); if (id != null){ - if(id.startsWith("raw:")) { - return id.substring(4); - } - if (id.startsWith("msf:")){ - id=id.substring(4); - } + if(id.startsWith("raw:")) { + return id.substring(4); + } + if (id.startsWith("msf:")){ + id=id.substring(4); + } } String[] contentUriPrefixesToTry = new String[]{ diff --git a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/utils/Utils.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/utils/Utils.java index b04a785..f2f6d98 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/utils/Utils.java +++ b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/utils/Utils.java @@ -11,7 +11,10 @@ import android.database.Cursor; import android.graphics.Bitmap; import android.graphics.BitmapFactory; +import android.graphics.Canvas; import android.graphics.Color; +import android.graphics.drawable.BitmapDrawable; +import android.graphics.drawable.Drawable; import android.location.Address; import android.location.Geocoder; import android.media.AudioManager; @@ -77,6 +80,8 @@ import kotlin.ranges.RangesKt; +import static android.os.Environment.DIRECTORY_DOCUMENTS; + public class Utils { private static final String TAG = "Utils"; @@ -657,10 +662,18 @@ public static String getOutputMediaFile(Context context) { if (!var0.exists() && !var0.mkdirs()) { return null; } else { - String var1 = Environment.getExternalStorageDirectory() + "/" + context.getResources().getString(R.string.app_name) + "/" - + "audio/"; - createDirectory(var1); - return var1 + (new SimpleDateFormat("yyyyMMddHHmmss")).format(new Date()) + ".mp3"; + String dir; + if (Build.VERSION_CODES.R > Build.VERSION.SDK_INT) { + dir = Environment.getExternalStorageDirectory()+"/"+context.getResources().getString(R.string.app_name) + "/" + + "audio/"; + } else { + dir = Environment.getExternalStoragePublicDirectory(DIRECTORY_DOCUMENTS).getPath()+"/"+context.getResources().getString(R.string.app_name) + "/" + + "audio/"; + } +// String var1 = Environment.getExternalStorageDirectory() + "/" + context.getResources().getString(R.string.app_name) + "/" +// + "audio/"; + createDirectory(dir); + return dir + (new SimpleDateFormat("yyyyMMddHHmmss")).format(new Date()) + ".mp3"; } } @@ -709,6 +722,19 @@ public static Bitmap getBitmapFromURL(String strURL) { } } + public static Bitmap drawableToBitmap (Drawable drawable) { + + if (drawable instanceof BitmapDrawable) { + return ((BitmapDrawable)drawable).getBitmap(); + } + + Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888); + Canvas canvas = new Canvas(bitmap); + drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight()); + drawable.draw(canvas); + + return bitmap; + } public static String getAddress(Context context, double latitude, double longitude) { Geocoder geocoder = new Geocoder(context, Locale.getDefault()); try { diff --git a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_settings/FeatureRestriction.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_settings/FeatureRestriction.java index 5a4dd8d..75b5393 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_settings/FeatureRestriction.java +++ b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_settings/FeatureRestriction.java @@ -12,11 +12,6 @@ public static boolean isCallActionMessageEnabled() { return UIKitSettings.isCallNotification(); } - public static String getColor() { - return UIKitSettings.UIcolor; - } - - public static void isUserListEnabled(OnSuccessListener onSuccessListener) { CometChat.isFeatureEnabled(Feature.chat_users_list_enabled, new CometChat.CallbackListener() { @Override @@ -53,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) { @@ -162,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()); } @@ -407,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) { @@ -456,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) { @@ -493,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) { @@ -666,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) { @@ -883,7 +878,7 @@ public void onSuccess(Boolean aBoolean) { @Override public void onError(CometChatException e) { - e.printStackTrace(); + e.printStackTrace(); } }); } @@ -995,6 +990,14 @@ public void onError(CometChatException e) { }); } + public static void isDeleteConversationEnabled(OnSuccessListener onSuccessListener) { + onSuccessListener.onSuccess(UIKitSettings.isDeleteConversation()); + } + + public static void isStartConversationEnabled(OnSuccessListener onSuccessListener) { + onSuccessListener.onSuccess(UIKitSettings.isStartConversation()); + } + public interface OnSuccessListener { void onSuccess(Boolean booleanVal); } diff --git a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_settings/UIKitSettings.java b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_settings/UIKitSettings.java index 7ce7d47..1055da7 100644 --- a/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_settings/UIKitSettings.java +++ b/ConnectionService + Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_settings/UIKitSettings.java @@ -34,6 +34,9 @@ public class UIKitSettings { private static boolean calls = true; private static boolean userSettings = true; + private static boolean startConversation = true; + private static boolean deleteConversation = true; + private static boolean sendMessageInOneOneOne = true; private static boolean sendMessageInGroup = true; @@ -124,7 +127,7 @@ public class UIKitSettings { protected static ConversationMode conversationInMode = ConversationMode.ALL_CHATS; protected static GroupMode groupInMode = GroupMode.ALL_GROUP; protected static UserMode userInMode = UserMode.ALL_USER; - private static int connection_capability = PhoneAccount.CAPABILITY_CALL_PROVIDER; + private static int connectionCapability = PhoneAccount.CAPABILITY_CALL_PROVIDER; public Context context; @@ -180,12 +183,12 @@ public static void showReplyPrivately(boolean isEnable) { showReplyPrivately = isEnable; } - public static int getConnectionCapability() { - return connection_capability; + public static String getColor() { + return UIcolor; } - public static void setConnectionCapability(int capability) { - connection_capability = capability; + public static int getConnectionCapability() { + return connectionCapability; } public void addConnectionListener(String TAG) { @@ -339,6 +342,15 @@ public static void setColor(String color) { UIcolor = color; } + + public static void deleteConversation(boolean isEnabled) { + deleteConversation = isEnabled; + } + + public static void startConversation(boolean isEanbled) { + startConversation = isEanbled; + } + public static void users(boolean showUsers) { users = showUsers; } @@ -914,4 +926,11 @@ public static boolean isHideDeleteMessage() { return hideDeleteMessage; } + public static boolean isDeleteConversation() { + return deleteConversation; + } + + public static boolean isStartConversation() { + return startConversation; + } } diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/calls/layout/activity_cometchat_callmanager.xml b/ConnectionService + Firebase/uikit/src/main/res-components/calls/layout/activity_cometchat_callmanager.xml index f07db67..9b7afe9 100644 --- a/ConnectionService + Firebase/uikit/src/main/res-components/calls/layout/activity_cometchat_callmanager.xml +++ b/ConnectionService + Firebase/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"/> diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/calls/layout/fragment_cometchat_calls.xml b/ConnectionService + Firebase/uikit/src/main/res-components/calls/layout/fragment_cometchat_calls.xml index c3d33b9..b47ba98 100644 --- a/ConnectionService + Firebase/uikit/src/main/res-components/calls/layout/fragment_cometchat_calls.xml +++ b/ConnectionService + Firebase/uikit/src/main/res-components/calls/layout/fragment_cometchat_calls.xml @@ -21,9 +21,10 @@ android:layout_height="wrap_content"/> diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/chats/layout/cometchat_conversation_list_row.xml b/ConnectionService + Firebase/uikit/src/main/res-components/chats/layout/cometchat_conversation_list_row.xml index d0a4119..97e81a4 100644 --- a/ConnectionService + Firebase/uikit/src/main/res-components/chats/layout/cometchat_conversation_list_row.xml +++ b/ConnectionService + Firebase/uikit/src/main/res-components/chats/layout/cometchat_conversation_list_row.xml @@ -31,15 +31,17 @@ android:layout_height="match_parent"> + tools:src="@tools:sample/avatars"/> + - + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/groups/layout/cometchat_group_member_row.xml b/ConnectionService + Firebase/uikit/src/main/res-components/groups/layout/cometchat_group_member_row.xml index 520981f..bed4f86 100644 --- a/ConnectionService + Firebase/uikit/src/main/res-components/groups/layout/cometchat_group_member_row.xml +++ b/ConnectionService + Firebase/uikit/src/main/res-components/groups/layout/cometchat_group_member_row.xml @@ -13,16 +13,18 @@ + android:layout_height="36dp" /> - + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/messagebubbles/layout/message_left_link_item.xml b/ConnectionService + Firebase/uikit/src/main/res-components/messagebubbles/layout/message_left_link_item.xml index ace0ad5..657ee1e 100644 --- a/ConnectionService + Firebase/uikit/src/main/res-components/messagebubbles/layout/message_left_link_item.xml +++ b/ConnectionService + Firebase/uikit/src/main/res-components/messagebubbles/layout/message_left_link_item.xml @@ -15,6 +15,7 @@ diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/messagebubbles/layout/message_left_polls_item.xml b/ConnectionService + Firebase/uikit/src/main/res-components/messagebubbles/layout/message_left_polls_item.xml index 681355c..f97b219 100644 --- a/ConnectionService + Firebase/uikit/src/main/res-components/messagebubbles/layout/message_left_polls_item.xml +++ b/ConnectionService + Firebase/uikit/src/main/res-components/messagebubbles/layout/message_left_polls_item.xml @@ -15,6 +15,7 @@ @@ -32,7 +32,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:ellipsize="end" - android:maxWidth="150dp" + android:maxWidth="200dp" android:maxLines="1" android:textColor="@color/textColorWhite" android:textStyle="bold" diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/messagebubbles/layout/message_right_sticker_item.xml b/ConnectionService + Firebase/uikit/src/main/res-components/messagebubbles/layout/message_right_sticker_item.xml index 715dfb6..e2ee546 100644 --- a/ConnectionService + Firebase/uikit/src/main/res-components/messagebubbles/layout/message_right_sticker_item.xml +++ b/ConnectionService + Firebase/uikit/src/main/res-components/messagebubbles/layout/message_right_sticker_item.xml @@ -32,7 +32,7 @@ android:textSize="12sp" android:textStyle="bold" android:visibility="gone" - tools:drawableEnd="@drawable/ic_double_tick" + tools:drawableEnd="@drawable/ic_message_read" tools:text="11:00 PM" tools:visibility="visible" /> diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/messagebubbles/layout/message_right_writeboard_item.xml b/ConnectionService + Firebase/uikit/src/main/res-components/messagebubbles/layout/message_right_writeboard_item.xml index 6f07229..f5584f7 100644 --- a/ConnectionService + Firebase/uikit/src/main/res-components/messagebubbles/layout/message_right_writeboard_item.xml +++ b/ConnectionService + Firebase/uikit/src/main/res-components/messagebubbles/layout/message_right_writeboard_item.xml @@ -28,7 +28,7 @@ android:layout_centerVertical="true" android:padding="8dp" android:id="@+id/icon" - android:src="@drawable/ic_writeboard_24dp" + android:src="@drawable/ic_collaborative_document" android:tint="@color/textColorWhite" android:layout_width="36dp" android:layout_height="36dp"/> diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/messagebubbles/layout/thread_message_file_item.xml b/ConnectionService + Firebase/uikit/src/main/res-components/messagebubbles/layout/thread_message_file_item.xml index 235dbc6..a69fea1 100644 --- a/ConnectionService + Firebase/uikit/src/main/res-components/messagebubbles/layout/thread_message_file_item.xml +++ b/ConnectionService + Firebase/uikit/src/main/res-components/messagebubbles/layout/thread_message_file_item.xml @@ -79,7 +79,7 @@ android:layout_height="wrap_content"> + android:layout_height="32dp"/> diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/messages/layout/cometchat_composebox_actions.xml b/ConnectionService + Firebase/uikit/src/main/res-components/messages/layout/cometchat_composebox_actions.xml index 2916f95..3627260 100644 --- a/ConnectionService + Firebase/uikit/src/main/res-components/messages/layout/cometchat_composebox_actions.xml +++ b/ConnectionService + Firebase/uikit/src/main/res-components/messages/layout/cometchat_composebox_actions.xml @@ -12,8 +12,7 @@ android:foreground="?attr/selectableItemBackground" android:textStyle="bold" android:text="@string/create_a_poll" - android:drawableTint="@color/grey" - android:drawableStart="@drawable/ic_poll_24dp" + android:drawableStart="@drawable/ic_polls" android:drawablePadding="16dp" android:gravity="center_vertical" android:textColor="@color/grey" @@ -26,8 +25,7 @@ android:foreground="?attr/selectableItemBackground" android:textStyle="bold" android:text="@string/photo_video_library" - android:drawableStart="@drawable/ic_photo" - android:drawableTint="@color/grey" + android:drawableStart="@drawable/ic_image_library" android:drawablePadding="16dp" android:gravity="center_vertical" android:textColor="@color/grey" @@ -40,7 +38,6 @@ android:foreground="?attr/selectableItemBackground" android:textStyle="bold" android:text="@string/take_a_photo" - android:drawableTint="@color/grey" android:drawableStart="@drawable/ic_camera" android:drawablePadding="16dp" android:gravity="center_vertical" @@ -54,9 +51,8 @@ android:foreground="?attr/selectableItemBackground" android:textStyle="bold" android:text="@string/send_files" - android:drawableStart="@drawable/ic_insert_drive_file_black_24dp" + android:drawableStart="@drawable/ic_file_upload" android:drawablePadding="16dp" - android:drawableTint="@color/grey" android:gravity="center_vertical" android:textColor="@color/grey" android:padding="16dp" @@ -65,8 +61,7 @@ @@ -12,21 +13,21 @@ android:focusable="true" android:layout_margin="8dp" android:layout_centerVertical="true" - android:src="@drawable/ic_arrow_back_24dp" - android:tint="@color/primaryTextColor" + android:src="@drawable/ic_back_arrow_selected" android:id="@+id/back_action" android:layout_width="wrap_content" android:layout_height="wrap_content"/> + android:layout_height="36dp"/> + xmlns:android="http://schemas.android.com/apk/res/android"> - + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/others/layout/add_polls_layout.xml b/ConnectionService + Firebase/uikit/src/main/res-components/others/layout/add_polls_layout.xml index 948479d..313dd2d 100644 --- a/ConnectionService + Firebase/uikit/src/main/res-components/others/layout/add_polls_layout.xml +++ b/ConnectionService + Firebase/uikit/src/main/res-components/others/layout/add_polls_layout.xml @@ -113,7 +113,7 @@ android:layout_height="wrap_content"/> diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/others/layout/cometchat_dialog_layout.xml b/ConnectionService + Firebase/uikit/src/main/res-components/others/layout/cometchat_dialog_layout.xml index b1fc45b..c262793 100644 --- a/ConnectionService + Firebase/uikit/src/main/res-components/others/layout/cometchat_dialog_layout.xml +++ b/ConnectionService + Firebase/uikit/src/main/res-components/others/layout/cometchat_dialog_layout.xml @@ -15,7 +15,8 @@ android:layout_alignParentStart="true" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:src="@drawable/ic_baseline_error_24" + android:src="@drawable/ic_error" + android:tint="@color/textColorWhite" android:layout_margin="4dp"/> - - - + android:layout_width="36dp" + app:corner_radius="18dp" + android:layout_height="36dp"/> \ No newline at end of file diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/shared/layout/cometchat_avatar.xml b/ConnectionService + Firebase/uikit/src/main/res-components/shared/layout/cometchat_avatar.xml new file mode 100644 index 0000000..4f0d12a --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/shared/layout/cometchat_avatar.xml @@ -0,0 +1,22 @@ + + + + + \ No newline at end of file diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/shared/layout/cometchat_badge_count.xml b/ConnectionService + Firebase/uikit/src/main/res-components/shared/layout/cometchat_badge_count.xml index ed9ffeb..71bb556 100644 --- a/ConnectionService + Firebase/uikit/src/main/res-components/shared/layout/cometchat_badge_count.xml +++ b/ConnectionService + Firebase/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/ConnectionService + Firebase/uikit/src/main/res-components/shared/layout/cometchat_compose_box.xml b/ConnectionService + Firebase/uikit/src/main/res-components/shared/layout/cometchat_compose_box.xml index b2060bb..575c8e1 100644 --- a/ConnectionService + Firebase/uikit/src/main/res-components/shared/layout/cometchat_compose_box.xml +++ b/ConnectionService + Firebase/uikit/src/main/res-components/shared/layout/cometchat_compose_box.xml @@ -7,56 +7,12 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"> - - - - - - - - - - diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/userprofile/layout/activity_cometchat_more_privacy.xml b/ConnectionService + Firebase/uikit/src/main/res-components/userprofile/layout/activity_cometchat_more_privacy.xml index d27d4b8..aa0f59d 100644 --- a/ConnectionService + Firebase/uikit/src/main/res-components/userprofile/layout/activity_cometchat_more_privacy.xml +++ b/ConnectionService + Firebase/uikit/src/main/res-components/userprofile/layout/activity_cometchat_more_privacy.xml @@ -36,7 +36,7 @@ android:id="@+id/tv_blocked_user_count" android:gravity="center" android:drawablePadding="8dp" - android:drawableEnd="@drawable/ic_arrow_right_24dp" + android:drawableEnd="@drawable/ic_arrow_right" android:layout_centerVertical="true" android:layout_alignParentRight="true" android:layout_width="wrap_content" diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/userprofile/layout/fragment_cometchat_user_profile.xml b/ConnectionService + Firebase/uikit/src/main/res-components/userprofile/layout/fragment_cometchat_user_profile.xml index d9ffdb5..9a4d804 100644 --- a/ConnectionService + Firebase/uikit/src/main/res-components/userprofile/layout/fragment_cometchat_user_profile.xml +++ b/ConnectionService + Firebase/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"/> + @@ -87,7 +96,7 @@ @@ -114,31 +123,24 @@ android:foreground="?attr/selectableItemBackground" android:layout_width="match_parent" android:layout_height="wrap_content"> + + android:layout_height="wrap_content" + android:layout_alignParentLeft="true" + android:layout_gravity="center" + android:src="@drawable/ic_privacy" /> - diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/add_circle.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/add_circle.xml new file mode 100644 index 0000000..e2e554e --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/add_circle.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/add_circle_filled.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/add_circle_filled.xml new file mode 100644 index 0000000..75b792c --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/add_circle_filled.xml @@ -0,0 +1,10 @@ + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_add_users_to_group.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_add_users_to_group.xml new file mode 100644 index 0000000..ad052a9 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_add_users_to_group.xml @@ -0,0 +1,55 @@ + + + + + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_arrow_right_selected.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_arrow_right_selected.xml new file mode 100644 index 0000000..b7c2197 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_arrow_right_selected.xml @@ -0,0 +1,17 @@ + + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_arrow_right_unselected.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_arrow_right_unselected.xml new file mode 100644 index 0000000..36902d0 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_arrow_right_unselected.xml @@ -0,0 +1,17 @@ + + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_audio.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_audio.xml new file mode 100644 index 0000000..71e38f4 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_audio.xml @@ -0,0 +1,31 @@ + + + + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_audiocall.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_audiocall.xml index e516b4c..a2706af 100644 --- a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_audiocall.xml +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_audiocall.xml @@ -1,6 +1,11 @@ - - - + + + + + + + + + + + \ No newline at end of file diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_back_arrow_selected.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_back_arrow_selected.xml new file mode 100644 index 0000000..bbae1b0 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_back_arrow_selected.xml @@ -0,0 +1,14 @@ + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_back_unselected.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_back_unselected.xml new file mode 100644 index 0000000..80be180 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_back_unselected.xml @@ -0,0 +1,13 @@ + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_calls.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_calls.xml new file mode 100644 index 0000000..bc17238 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_calls.xml @@ -0,0 +1,13 @@ + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_calls_selected.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_calls_selected.xml new file mode 100644 index 0000000..36561ae --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_calls_selected.xml @@ -0,0 +1,13 @@ + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_camera.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_camera.xml new file mode 100644 index 0000000..4f1e816 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_camera.xml @@ -0,0 +1,34 @@ + + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_chats.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_chats.xml new file mode 100644 index 0000000..51b8c97 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_chats.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_chats_unselected.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_chats_unselected.xml new file mode 100644 index 0000000..24c272a --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_chats_unselected.xml @@ -0,0 +1,13 @@ + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_close_circle_selected.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_close_circle_selected.xml new file mode 100644 index 0000000..3608cf1 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_close_circle_selected.xml @@ -0,0 +1,10 @@ + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_close_circle_unselected.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_close_circle_unselected.xml new file mode 100644 index 0000000..8057ca9 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_close_circle_unselected.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_collaborative_document.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_collaborative_document.xml new file mode 100644 index 0000000..b4c1257 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_collaborative_document.xml @@ -0,0 +1,48 @@ + + + + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_collaborative_whiteboard.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_collaborative_whiteboard.xml new file mode 100644 index 0000000..703f92a --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_collaborative_whiteboard.xml @@ -0,0 +1,20 @@ + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_copy_paste.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_copy_paste.xml new file mode 100644 index 0000000..b68f659 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_copy_paste.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_create.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_create.xml new file mode 100644 index 0000000..958d8af --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_create.xml @@ -0,0 +1,20 @@ + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_delete.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_delete.xml new file mode 100644 index 0000000..1cc805b --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_delete.xml @@ -0,0 +1,41 @@ + + + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_edit.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_edit.xml new file mode 100644 index 0000000..d277097 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_edit.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_error.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_error.xml new file mode 100644 index 0000000..114d975 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_error.xml @@ -0,0 +1,24 @@ + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_file.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_file.xml new file mode 100644 index 0000000..d24a822 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_file.xml @@ -0,0 +1,9 @@ + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_file_upload.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_file_upload.xml new file mode 100644 index 0000000..61c9d0f --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_file_upload.xml @@ -0,0 +1,34 @@ + + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_forward.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_forward.xml index 9d114fc..cf76ec1 100644 --- a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_forward.xml +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_forward.xml @@ -1,4 +1,13 @@ - - + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_groups.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_groups.xml new file mode 100644 index 0000000..9b75fc7 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_groups.xml @@ -0,0 +1,34 @@ + + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_groups_unselected.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_groups_unselected.xml new file mode 100644 index 0000000..50526cd --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_groups_unselected.xml @@ -0,0 +1,20 @@ + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_hand.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_hand.xml new file mode 100644 index 0000000..c17d998 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_hand.xml @@ -0,0 +1,20 @@ + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_image_library.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_image_library.xml new file mode 100644 index 0000000..bd4d712 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_image_library.xml @@ -0,0 +1,38 @@ + + + + + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_incoming_call.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_incoming_call.xml new file mode 100644 index 0000000..bf926ad --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_incoming_call.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_incoming_video_call.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_incoming_video_call.xml new file mode 100644 index 0000000..cfc8d10 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_incoming_video_call.xml @@ -0,0 +1,21 @@ + + + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_info.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_info.xml index b1dae71..66b6e09 100644 --- a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_info.xml +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_info.xml @@ -1,12 +1,27 @@ + android:pathData="M12.8,14.6H12.2C11.8818,14.6 11.5766,14.4736 11.3515,14.2485C11.1265,14.0235 11,13.7182 11,13.4V10.4C11,10.2409 10.9368,10.0882 10.8243,9.9757C10.7118,9.8632 10.5592,9.8 10.4,9.8H9.8" + android:strokeLineJoin="round" + android:strokeWidth="1.5" + android:fillColor="#00000000" + android:strokeColor="#808080" + android:strokeLineCap="round"/> + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_info_selected.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_info_selected.xml new file mode 100644 index 0000000..5e3dead --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_info_selected.xml @@ -0,0 +1,10 @@ + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_info_unselected.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_info_unselected.xml new file mode 100644 index 0000000..371e6b3 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_info_unselected.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_location.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_location.xml new file mode 100644 index 0000000..6e2b936 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_location.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_message_delivered.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_message_delivered.xml new file mode 100644 index 0000000..b1e6daf --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_message_delivered.xml @@ -0,0 +1,18 @@ + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_message_privately.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_message_privately.xml deleted file mode 100644 index 0ac0660..0000000 --- a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_message_privately.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_message_read.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_message_read.xml new file mode 100644 index 0000000..7220ff8 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_message_read.xml @@ -0,0 +1,18 @@ + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_message_sent.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_message_sent.xml new file mode 100644 index 0000000..9a8dbb5 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_message_sent.xml @@ -0,0 +1,13 @@ + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_microphone_grey_selected.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_microphone_grey_selected.xml new file mode 100644 index 0000000..a1cc1c8 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_microphone_grey_selected.xml @@ -0,0 +1,10 @@ + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_microphone_grey_unselected.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_microphone_grey_unselected.xml new file mode 100644 index 0000000..9d628d3 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_microphone_grey_unselected.xml @@ -0,0 +1,31 @@ + + + + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_microphone_white_selected.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_microphone_white_selected.xml new file mode 100644 index 0000000..a7bf108 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_microphone_white_selected.xml @@ -0,0 +1,10 @@ + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_microphone_white_unselected.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_microphone_white_unselected.xml new file mode 100644 index 0000000..ee1438c --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_microphone_white_unselected.xml @@ -0,0 +1,31 @@ + + + + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_more.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_more.xml new file mode 100644 index 0000000..8c707b0 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_more.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_more_unselected.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_more_unselected.xml new file mode 100644 index 0000000..789a3ff --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_more_unselected.xml @@ -0,0 +1,34 @@ + + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_notifications.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_notifications.xml new file mode 100644 index 0000000..cb9d133 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_notifications.xml @@ -0,0 +1,13 @@ + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_outgoing_call.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_outgoing_call.xml new file mode 100644 index 0000000..b91c24a --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_outgoing_call.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_outgoing_video_call.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_outgoing_video_call.xml new file mode 100644 index 0000000..67ad331 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_outgoing_video_call.xml @@ -0,0 +1,21 @@ + + + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_polls.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_polls.xml new file mode 100644 index 0000000..931aaa2 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_polls.xml @@ -0,0 +1,41 @@ + + + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_privacy.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_privacy.xml new file mode 100644 index 0000000..32d890b --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_privacy.xml @@ -0,0 +1,34 @@ + + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_reactions.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_reactions.xml new file mode 100644 index 0000000..e9e47be --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_reactions.xml @@ -0,0 +1,31 @@ + + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_reply.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_reply.xml deleted file mode 100644 index 69bb169..0000000 --- a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_reply.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_reply_message.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_reply_message.xml new file mode 100644 index 0000000..fce27d1 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_reply_message.xml @@ -0,0 +1,13 @@ + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_reply_message_in_private.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_reply_message_in_private.xml new file mode 100644 index 0000000..78bc61d --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_reply_message_in_private.xml @@ -0,0 +1,48 @@ + + + + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_report.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_report.xml new file mode 100644 index 0000000..c3ef177 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_report.xml @@ -0,0 +1,10 @@ + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_search.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_search.xml new file mode 100644 index 0000000..16aca4b --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_search.xml @@ -0,0 +1,20 @@ + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_send_message.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_send_message.xml new file mode 100644 index 0000000..39a1ec0 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_send_message.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_send_message_in_private.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_send_message_in_private.xml new file mode 100644 index 0000000..b420364 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_send_message_in_private.xml @@ -0,0 +1,38 @@ + + + + + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_send_message_selected.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_send_message_selected.xml new file mode 100644 index 0000000..dfdebad --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_send_message_selected.xml @@ -0,0 +1,10 @@ + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_share.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_share.xml new file mode 100644 index 0000000..222aea2 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_share.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_sticker.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_sticker.xml new file mode 100644 index 0000000..fcf3cb4 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_sticker.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_threaded_message.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_threaded_message.xml new file mode 100644 index 0000000..456376c --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_threaded_message.xml @@ -0,0 +1,34 @@ + + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_translate.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_translate.xml new file mode 100644 index 0000000..d30071a --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_translate.xml @@ -0,0 +1,35 @@ + + + + + + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_users.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_users.xml new file mode 100644 index 0000000..7828b63 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_users.xml @@ -0,0 +1,20 @@ + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_users_unselected.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_users_unselected.xml new file mode 100644 index 0000000..9d4dda0 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_users_unselected.xml @@ -0,0 +1,13 @@ + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_video_call.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_video_call.xml new file mode 100644 index 0000000..e28855b --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_video_call.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_video_call_selected.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_video_call_selected.xml new file mode 100644 index 0000000..21cd9a0 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_video_call_selected.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_video_group_call_selected.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_video_group_call_selected.xml new file mode 100644 index 0000000..53c38d8 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_video_group_call_selected.xml @@ -0,0 +1,17 @@ + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_video_group_call_unselected.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_video_group_call_unselected.xml new file mode 100644 index 0000000..8c27ca5 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_video_group_call_unselected.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_videocall.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_videocall.xml index 9dc81c0..de629eb 100644 --- a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_videocall.xml +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_videocall.xml @@ -1,6 +1,7 @@ - - - + + + + + \ No newline at end of file diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_warning.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_warning.xml new file mode 100644 index 0000000..4fe28aa --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/drawable/ic_warning.xml @@ -0,0 +1,26 @@ + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res-components/users/layout/activity_cometchat_user_detail.xml b/ConnectionService + Firebase/uikit/src/main/res-components/users/layout/activity_cometchat_user_detail.xml index cd1400c..812447e 100644 --- a/ConnectionService + Firebase/uikit/src/main/res-components/users/layout/activity_cometchat_user_detail.xml +++ b/ConnectionService + Firebase/uikit/src/main/res-components/users/layout/activity_cometchat_user_detail.xml @@ -9,6 +9,7 @@ android:layout_width="match_parent" android:id="@+id/user_detail_toolbar" app:title="@string/user_title" + app:navigationIcon="@drawable/ic_back_arrow_selected" android:layout_height="wrap_content"/> + android:layout_height="36dp"/> + tools:src="@tools:sample/avatars"/> diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable-hdpi/ic_edit.png b/ConnectionService + Firebase/uikit/src/main/res/drawable-hdpi/ic_edit.png deleted file mode 100644 index 781504f..0000000 Binary files a/ConnectionService + Firebase/uikit/src/main/res/drawable-hdpi/ic_edit.png and /dev/null differ diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable-hdpi/ic_warning_image.png b/ConnectionService + Firebase/uikit/src/main/res/drawable-hdpi/ic_warning_image.png deleted file mode 100644 index 11188ec..0000000 Binary files a/ConnectionService + Firebase/uikit/src/main/res/drawable-hdpi/ic_warning_image.png and /dev/null differ diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable-mdpi/ic_warning_image.png b/ConnectionService + Firebase/uikit/src/main/res/drawable-mdpi/ic_warning_image.png deleted file mode 100644 index e43955e..0000000 Binary files a/ConnectionService + Firebase/uikit/src/main/res/drawable-mdpi/ic_warning_image.png and /dev/null differ diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable-xhdpi/ic_warning_image.png b/ConnectionService + Firebase/uikit/src/main/res/drawable-xhdpi/ic_warning_image.png deleted file mode 100644 index 69dcef4..0000000 Binary files a/ConnectionService + Firebase/uikit/src/main/res/drawable-xhdpi/ic_warning_image.png and /dev/null differ diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable-xxhdpi/ic_warning_image.png b/ConnectionService + Firebase/uikit/src/main/res/drawable-xxhdpi/ic_warning_image.png deleted file mode 100644 index 436ae9f..0000000 Binary files a/ConnectionService + Firebase/uikit/src/main/res/drawable-xxhdpi/ic_warning_image.png and /dev/null differ diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable-xxxhdpi/ic_warning_image.png b/ConnectionService + Firebase/uikit/src/main/res/drawable-xxxhdpi/ic_warning_image.png deleted file mode 100644 index 4810121..0000000 Binary files a/ConnectionService + Firebase/uikit/src/main/res/drawable-xxxhdpi/ic_warning_image.png and /dev/null differ diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/default_sticker.png b/ConnectionService + Firebase/uikit/src/main/res/drawable/default_sticker.png deleted file mode 100644 index c8f15b4..0000000 Binary files a/ConnectionService + Firebase/uikit/src/main/res/drawable/default_sticker.png and /dev/null differ diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_add.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_add.xml index f2a5c23..e77eead 100644 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_add.xml +++ b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_add.xml @@ -1,5 +1,6 @@ - - - - \ No newline at end of file + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_add_24dp.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_add_24dp.xml deleted file mode 100644 index b5c6c73..0000000 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_add_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_add_circle_grey.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_add_circle_grey.xml new file mode 100644 index 0000000..e05e8a2 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_add_circle_grey.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_add_circle_grey_32dp.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_add_circle_grey_32dp.xml deleted file mode 100644 index ee81581..0000000 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_add_circle_grey_32dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_arrow_back_24dp.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_arrow_back_24dp.xml deleted file mode 100644 index f632160..0000000 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_arrow_back_24dp.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_arrow_right.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_arrow_right.xml new file mode 100644 index 0000000..4746484 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_arrow_right.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_arrow_right_24dp.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_arrow_right_24dp.xml deleted file mode 100644 index 5bc098b..0000000 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_arrow_right_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_back.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_back.xml new file mode 100644 index 0000000..663bab2 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_back.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_baseline_error_24.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_baseline_error_24.xml deleted file mode 100644 index 1fa8716..0000000 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_baseline_error_24.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_baseline_more_vert_24.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_baseline_more_vert_24.xml index 48272f6..fde5725 100644 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_baseline_more_vert_24.xml +++ b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_baseline_more_vert_24.xml @@ -5,6 +5,6 @@ android:viewportHeight="24" android:tint="?attr/colorControlNormal"> diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_call_24dp.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_call_24dp.xml deleted file mode 100644 index ebf9de6..0000000 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_call_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_call_missed_incoming_24dp.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_call_missed_incoming_24dp.xml index 57d1cd7..c41e014 100644 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_call_missed_incoming_24dp.xml +++ b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_call_missed_incoming_24dp.xml @@ -1,4 +1,4 @@ - diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_call_missed_outgoing_24dp.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_call_missed_outgoing_24dp.xml index 057efff..1214277 100644 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_call_missed_outgoing_24dp.xml +++ b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_call_missed_outgoing_24dp.xml @@ -1,4 +1,4 @@ - diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_camera.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_camera.xml deleted file mode 100644 index 83ad59e..0000000 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_camera.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_chat.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_chat.xml deleted file mode 100644 index 80caabf..0000000 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_chat.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_chats.png b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_chats.png deleted file mode 100644 index 6324266..0000000 Binary files a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_chats.png and /dev/null differ diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_chats_selected.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_chats_selected.xml new file mode 100644 index 0000000..b18fa53 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_chats_selected.xml @@ -0,0 +1,13 @@ + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_check_black_24dp.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_check_black_24dp.xml deleted file mode 100644 index 9019a15..0000000 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_check_black_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_close_24dp.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_close_24dp.xml index 5bd1ee8..56150dc 100644 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_close_24dp.xml +++ b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_close_24dp.xml @@ -1,5 +1,20 @@ - - + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_close_circle.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_close_circle.xml index c35a0af..34972f6 100644 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_close_circle.xml +++ b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_close_circle.xml @@ -1,5 +1,5 @@ - - - - \ No newline at end of file + + + + \ No newline at end of file diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_contacts_24dp.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_contacts_24dp.xml deleted file mode 100644 index af96087..0000000 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_contacts_24dp.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_delete.png b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_delete.png deleted file mode 100644 index 31bae4b..0000000 Binary files a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_delete.png and /dev/null differ diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_delete_24dp.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_delete_24dp.xml deleted file mode 100644 index f696718..0000000 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_delete_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_delete_conversation.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_delete_conversation.xml new file mode 100644 index 0000000..1a9194b --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_delete_conversation.xml @@ -0,0 +1,41 @@ + + + + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_done_all_black_24dp.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_done_all_black_24dp.xml deleted file mode 100644 index 39990bb..0000000 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_done_all_black_24dp.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_double_tick.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_double_tick.xml deleted file mode 100644 index 099dda1..0000000 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_double_tick.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_group.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_group.xml deleted file mode 100644 index 5c90d29..0000000 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_group.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_group_add_black_24dp.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_group_add_black_24dp.xml deleted file mode 100644 index 8220314..0000000 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_group_add_black_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_groups_selected.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_groups_selected.xml new file mode 100644 index 0000000..c32aeef --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_groups_selected.xml @@ -0,0 +1,20 @@ + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_hand.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_hand.xml deleted file mode 100644 index c3b2281..0000000 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_hand.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_insert_drive_file_black_24dp.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_insert_drive_file_black_24dp.xml deleted file mode 100644 index bb78063..0000000 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_insert_drive_file_black_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_library_music_24dp.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_library_music_24dp.xml deleted file mode 100644 index 3e60c09..0000000 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_library_music_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_mic_grey.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_mic_grey.xml new file mode 100644 index 0000000..f80e4c8 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_mic_grey.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_mic_grey_24dp.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_mic_grey_24dp.xml deleted file mode 100644 index a734aad..0000000 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_mic_grey_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_mic_white.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_mic_white.xml new file mode 100644 index 0000000..240127a --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_mic_white.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_mic_white_24dp.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_mic_white_24dp.xml deleted file mode 100644 index 877b8c1..0000000 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_mic_white_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_more.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_more.xml deleted file mode 100644 index 8a5434e..0000000 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_more.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_more_selected.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_more_selected.xml new file mode 100644 index 0000000..3e82351 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_more_selected.xml @@ -0,0 +1,10 @@ + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_near_me_24dp.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_near_me_24dp.xml deleted file mode 100644 index 7a97d60..0000000 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_near_me_24dp.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_notification.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_notification.xml deleted file mode 100644 index 0b77b8e..0000000 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_notification.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_notifications_black_24dp.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_notifications_black_24dp.xml deleted file mode 100644 index 17141e5..0000000 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_notifications_black_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_photo.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_photo.xml deleted file mode 100644 index f695bd6..0000000 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_photo.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_poll_24dp.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_poll_24dp.xml deleted file mode 100644 index 2059e8b..0000000 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_poll_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_search_24dp.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_search_24dp.xml deleted file mode 100644 index b2d0147..0000000 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_search_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_security.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_security.xml deleted file mode 100644 index b046468..0000000 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_security.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_send.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_send.xml index 3f8d347..3c80770 100644 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_send.xml +++ b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_send.xml @@ -1,9 +1,7 @@ - - - - - - + + + + + \ No newline at end of file diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_translate.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_translate.xml deleted file mode 100644 index 20ddcb0..0000000 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_translate.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_users_selected.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_users_selected.xml new file mode 100644 index 0000000..d2e193f --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_users_selected.xml @@ -0,0 +1,13 @@ + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_video_group_call.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_video_group_call.xml new file mode 100644 index 0000000..80cbd5a --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_video_group_call.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_videocam_24dp.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_videocam_24dp.xml deleted file mode 100644 index 5498ba1..0000000 --- a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_videocam_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_whiteboard_24dp.png b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_whiteboard_24dp.png deleted file mode 100644 index 3203dbf..0000000 Binary files a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_whiteboard_24dp.png and /dev/null differ diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_writeboard_24dp.png b/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_writeboard_24dp.png deleted file mode 100644 index 1c10e29..0000000 Binary files a/ConnectionService + Firebase/uikit/src/main/res/drawable/ic_writeboard_24dp.png and /dev/null differ diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/info.png b/ConnectionService + Firebase/uikit/src/main/res/drawable/info.png deleted file mode 100644 index 055c2fc..0000000 Binary files a/ConnectionService + Firebase/uikit/src/main/res/drawable/info.png and /dev/null differ diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/share.png b/ConnectionService + Firebase/uikit/src/main/res/drawable/share.png deleted file mode 100644 index 4db3d51..0000000 Binary files a/ConnectionService + Firebase/uikit/src/main/res/drawable/share.png and /dev/null differ diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/start_converastion_tab_state.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/start_converastion_tab_state.xml new file mode 100644 index 0000000..e0b9b22 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res/drawable/start_converastion_tab_state.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/start_conversation_tab_active.xml b/ConnectionService + Firebase/uikit/src/main/res/drawable/start_conversation_tab_active.xml new file mode 100644 index 0000000..0f9a2b3 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res/drawable/start_conversation_tab_active.xml @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/ConnectionService + Firebase/uikit/src/main/res/drawable/thread.png b/ConnectionService + Firebase/uikit/src/main/res/drawable/thread.png deleted file mode 100644 index 7b9ad8b..0000000 Binary files a/ConnectionService + Firebase/uikit/src/main/res/drawable/thread.png and /dev/null differ diff --git a/ConnectionService + Firebase/uikit/src/main/res/layout/activity_comet_chat_start_conversation.xml b/ConnectionService + Firebase/uikit/src/main/res/layout/activity_comet_chat_start_conversation.xml new file mode 100644 index 0000000..a6d50ff --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res/layout/activity_comet_chat_start_conversation.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/ConnectionService + Firebase/uikit/src/main/res/menu/cometchat_navigation_bottom.xml b/ConnectionService + Firebase/uikit/src/main/res/menu/cometchat_navigation_bottom.xml index 43f5f00..ebe3179 100644 --- a/ConnectionService + Firebase/uikit/src/main/res/menu/cometchat_navigation_bottom.xml +++ b/ConnectionService + Firebase/uikit/src/main/res/menu/cometchat_navigation_bottom.xml @@ -9,15 +9,15 @@ + android:icon="@drawable/ic_audiocall" /> + android:icon="@drawable/ic_users"/> \ No newline at end of file diff --git a/ConnectionService + Firebase/uikit/src/main/res/values-ar/strings.xml b/ConnectionService + Firebase/uikit/src/main/res/values-ar/strings.xml index d5f4c9b..25a695b 100644 --- a/ConnectionService + Firebase/uikit/src/main/res/values-ar/strings.xml +++ b/ConnectionService + Firebase/uikit/src/main/res/values-ar/strings.xml @@ -273,11 +273,10 @@ غادر جارى التحميل إنشاء المجموعة - إرسال الرسالة بشكل خاص + إرسال الرسالة بشكل خاص عرض الصفحة الشخصية هل ترغب في حذف هذه المحادثة؟ حذف المحادثة - الرد في الدردشة لا يوجد إنترنت متاح غير متصل على الانترنت رسائل جديدة @@ -291,4 +290,13 @@ رد الردود الرد بشكل خاص + اختر المستخدم + اختر مجموعة + بحث في المستخدمين + مجموعات البحث + مكالمة صوتية مرفوضة + مكالمة فيديو مرفوضة + مكالمة صوتية صادرة + مكالمة فيديو صادرة + لم يتم العثور على أعضاء محظورين \ No newline at end of file diff --git a/ConnectionService + Firebase/uikit/src/main/res/values-de/strings.xml b/ConnectionService + Firebase/uikit/src/main/res/values-de/strings.xml index 751f807..5e851e3 100644 --- a/ConnectionService + Firebase/uikit/src/main/res/values-de/strings.xml +++ b/ConnectionService + Firebase/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,22 +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 - Im Thread antworten 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/ConnectionService + Firebase/uikit/src/main/res/values-es/strings.xml b/ConnectionService + Firebase/uikit/src/main/res/values-es/strings.xml index 7fb6803..8da7d95 100644 --- a/ConnectionService + Firebase/uikit/src/main/res/values-es/strings.xml +++ b/ConnectionService + Firebase/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,30 +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 - Responder en el chat - 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/ConnectionService + Firebase/uikit/src/main/res/values-fr/strings.xml b/ConnectionService + Firebase/uikit/src/main/res/values-fr/strings.xml index f40b21c..aaa6737 100644 --- a/ConnectionService + Firebase/uikit/src/main/res/values-fr/strings.xml +++ b/ConnectionService + Firebase/uikit/src/main/res/values-fr/strings.xml @@ -280,11 +280,10 @@ 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 - Répondre dans le chat hors ligne Nouveaux messages Nouveau message @@ -297,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/ConnectionService + Firebase/uikit/src/main/res/values-hi/strings.xml b/ConnectionService + Firebase/uikit/src/main/res/values-hi/strings.xml index b48e6f7..036ec51 100644 --- a/ConnectionService + Firebase/uikit/src/main/res/values-hi/strings.xml +++ b/ConnectionService + Firebase/uikit/src/main/res/values-hi/strings.xml @@ -273,11 +273,10 @@ प्रदान किया गया एक्सटेंशन नहीं मिला। डाउनलोड समूह बनाना - निजी तौर पर संदेश भेजें + निजी तौर पर संदेश भेजें प्रोफ़ाइल देखें क्या आप इस वार्तालाप को हटाना चाहेंगे? वार्तालाप हटाना - चैट में जवाब दें ऑफ़लाइन नए संदेश नया संदेश @@ -290,4 +289,13 @@ जवाब जवाब निजी तौर पर उत्तर दें + उपयोगकर्ता का चयन करें + समूह का चयन करें + उपयोगकर्ता खोजें + समूह खोजें + अस्वीकृत वॉयस कॉल + अस्वीकृत वीडियो कॉल + आउटगोइंग वॉयस कॉल + आउटगोइंग वीडियो कॉल + कोई प्रतिबंधित सदस्य नहीं मिला \ No newline at end of file diff --git a/ConnectionService + Firebase/uikit/src/main/res/values-lt/strings.xml b/ConnectionService + Firebase/uikit/src/main/res/values-lt/strings.xml index b1612a6..8aa6a51 100644 --- a/ConnectionService + Firebase/uikit/src/main/res/values-lt/strings.xml +++ b/ConnectionService + Firebase/uikit/src/main/res/values-lt/strings.xml @@ -301,13 +301,12 @@ 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į? Ištrinamas pokalbis rašo .. - Atsakyti pokalbiuose neprisijungęs Nauji pranešimai Nauja žinutė @@ -320,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/ConnectionService + Firebase/uikit/src/main/res/values-ms/strings.xml b/ConnectionService + Firebase/uikit/src/main/res/values-ms/strings.xml index 81de6c1..0f36663 100644 --- a/ConnectionService + Firebase/uikit/src/main/res/values-ms/strings.xml +++ b/ConnectionService + Firebase/uikit/src/main/res/values-ms/strings.xml @@ -273,11 +273,10 @@ meninggalkan kumpulan memuat turun mewujudkan kumpulan - Hantar Mesej secara tertutup + Hantar Mesej secara tertutup Lihat profil Adakah anda mahu memadamkan perbualan ini? Memadamkan Perbualan - Balas dalam Sembang di luar talian Mesej Baru Mesej baru @@ -290,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/ConnectionService + Firebase/uikit/src/main/res/values-pt/strings.xml b/ConnectionService + Firebase/uikit/src/main/res/values-pt/strings.xml index cdd7b57..132974b 100644 --- a/ConnectionService + Firebase/uikit/src/main/res/values-pt/strings.xml +++ b/ConnectionService + Firebase/uikit/src/main/res/values-pt/strings.xml @@ -273,11 +273,10 @@ 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 - Responder em bate-papos desligado Novas mensagens Nova mensagem @@ -290,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/ConnectionService + Firebase/uikit/src/main/res/values-ru/strings.xml b/ConnectionService + Firebase/uikit/src/main/res/values-ru/strings.xml index dadf0c3..72a5c25 100644 --- a/ConnectionService + Firebase/uikit/src/main/res/values-ru/strings.xml +++ b/ConnectionService + Firebase/uikit/src/main/res/values-ru/strings.xml @@ -275,7 +275,7 @@ покинул группу скачивание Создание группы - Отправить сообщение в частном порядке + Отправить сообщение в частном порядке Просмотреть профиль Вы хотите удалить этот разговор? Удаление разговора @@ -283,7 +283,6 @@ ответы Отклонить Принять - Ответить в ветке голоса проголосовать Доставлено @@ -292,4 +291,13 @@ Новое сообщение Не в сети Ответить лично + Выбрать пользователя + Выбрать группу + Поиск пользователей + Поисковые группы + Отклоненный голосовой вызов + Отклоненный видеовызов + Исходящий голосовой вызов + Исходящий видеозвонок + Забаненные участники не найдены \ No newline at end of file diff --git a/ConnectionService + Firebase/uikit/src/main/res/values-sv/strings.xml b/ConnectionService + Firebase/uikit/src/main/res/values-sv/strings.xml index 8e12a85..81cc9c9 100644 --- a/ConnectionService + Firebase/uikit/src/main/res/values-sv/strings.xml +++ b/ConnectionService + Firebase/uikit/src/main/res/values-sv/strings.xml @@ -299,13 +299,12 @@ grupp laddar ner skapa grupp - Skicka meddelande privat + Skicka meddelande privat Visa profil i dag Vill du radera den här konversationen? Tar bort konversation skriver.. - Svara i chatt off-line Nya meddelanden Nytt meddelande @@ -318,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/ConnectionService + Firebase/uikit/src/main/res/values-zh-rTW/strings.xml b/ConnectionService + Firebase/uikit/src/main/res/values-zh-rTW/strings.xml index 810dc63..21e3f68 100644 --- a/ConnectionService + Firebase/uikit/src/main/res/values-zh-rTW/strings.xml +++ b/ConnectionService + Firebase/uikit/src/main/res/values-zh-rTW/strings.xml @@ -273,11 +273,10 @@ 剩下 正在下載 建立小组 - 私下发送消息 + 私下发送消息 查看資料 您要删除此对话吗? 删除对话 - 在聊天中回复 離線 新消息 新消息 @@ -290,4 +289,13 @@ 回复 回复 私下回复 + 選擇用戶 + 選擇組 + 搜索用戶 + 搜索組 + 被拒絕的語音電話 + 拒絕視頻通話 + 撥出語音電話 + 傳出視頻通話 + 沒有發現被禁止的成員 \ No newline at end of file diff --git a/ConnectionService + Firebase/uikit/src/main/res/values-zh/strings.xml b/ConnectionService + Firebase/uikit/src/main/res/values-zh/strings.xml index 4d847cb..1f70bc7 100644 --- a/ConnectionService + Firebase/uikit/src/main/res/values-zh/strings.xml +++ b/ConnectionService + Firebase/uikit/src/main/res/values-zh/strings.xml @@ -272,11 +272,10 @@ 剩下 正在下载 建立小组 - 私下发送消息 + 私下发送消息 查看资料 您要删除此对话吗? 删除对话 - 在聊天中回复 离线 新消息 新消息 @@ -289,4 +288,13 @@ 回复 回复 私下回复 + 选择用户 + 选择组 + 搜索用户 + 搜索组 + 被拒绝的语音电话 + 拒绝视频通话 + 拨出语音电话 + 传出视频通话 + 没有发现被禁止的成员 \ No newline at end of file diff --git a/ConnectionService + Firebase/uikit/src/main/res/values/attr.xml b/ConnectionService + Firebase/uikit/src/main/res/values/attr.xml index 7e46333..6cc34e7 100644 --- a/ConnectionService + Firebase/uikit/src/main/res/values/attr.xml +++ b/ConnectionService + Firebase/uikit/src/main/res/values/attr.xml @@ -7,10 +7,12 @@ - - + + + + diff --git a/ConnectionService + Firebase/uikit/src/main/res/values/color.xml b/ConnectionService + Firebase/uikit/src/main/res/values/color.xml index 895099a..32b3005 100644 --- a/ConnectionService + Firebase/uikit/src/main/res/values/color.xml +++ b/ConnectionService + Firebase/uikit/src/main/res/values/color.xml @@ -1,7 +1,7 @@ - #03A9F4 - #169CD8 + #3399FF + #808080 #2196F3 #000000 @@ -13,7 +13,6 @@ #40bdbdbd #E64CAF50 #eecc0000 - #979797 #ECECEC #FF9800 diff --git a/ConnectionService + Firebase/uikit/src/main/res/values/colors.xml b/ConnectionService + Firebase/uikit/src/main/res/values/colors.xml new file mode 100644 index 0000000..df40388 --- /dev/null +++ b/ConnectionService + Firebase/uikit/src/main/res/values/colors.xml @@ -0,0 +1,4 @@ + + + #C4C4C4 + \ No newline at end of file diff --git a/ConnectionService + Firebase/uikit/src/main/res/values/strings.xml b/ConnectionService + Firebase/uikit/src/main/res/values/strings.xml index a7c4bcb..aa895a8 100644 --- a/ConnectionService + Firebase/uikit/src/main/res/values/strings.xml +++ b/ConnectionService + Firebase/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 @@ -273,11 +278,11 @@ joined Unban made - participant + Participant Translate Message No translation available - has shared a group call. - You\'ve created a group call. + has initiated a group call. + You\'ve initiated a group call. "📹 Group Call " Retry Uploading @@ -312,7 +317,7 @@ Downloading Creating Group - Send Message Privately + Send Message Privately View Profile Today In a thread @@ -331,6 +336,11 @@ New Message " New Messages" offline - Reply in Thread No Internet Available + Select User + Select Group + Search Users + Search Groups + Allow Background Location Permisssion + Please enable VoIP for this app diff --git a/Firebase/app/build.gradle b/Firebase/app/build.gradle index a496e13..8b74dda 100644 --- a/Firebase/app/build.gradle +++ b/Firebase/app/build.gradle @@ -5,7 +5,7 @@ android { compileSdkVersion 29 defaultConfig { applicationId "com.cometchat.pro.android.pushnotification" - minSdkVersion 21 + minSdkVersion 24 targetSdkVersion 29 versionCode 1 renderscriptSupportModeEnabled true @@ -60,5 +60,6 @@ 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.3.5' + implementation 'com.cometchat:pro-android-chat-sdk:2.4.1' + implementation 'com.cometchat:pro-android-calls-sdk:2.1.0' } diff --git a/Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/MoreActionFragment.java b/Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/MoreActionFragment.java index 23583a4..d888aa9 100644 --- a/Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/MoreActionFragment.java +++ b/Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/MoreActionFragment.java @@ -2,6 +2,7 @@ import android.app.Activity; import android.content.DialogInterface; +import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.LayoutInflater; @@ -17,6 +18,7 @@ import com.cometchat.pro.android.pushnotification.utils.MyFirebaseMessagingService; import com.cometchat.pro.core.CometChat; import com.cometchat.pro.exceptions.CometChatException; +import com.cometchat.pro.uikit.ui_components.cometchat_ui.CometChatUI; import com.google.android.material.bottomsheet.BottomSheetBehavior; import com.google.android.material.bottomsheet.BottomSheetDialog; import com.google.android.material.bottomsheet.BottomSheetDialogFragment; @@ -24,6 +26,7 @@ public class MoreActionFragment extends BottomSheetDialogFragment { private TextView loggedInUser; + private TextView launchUI; private TextView logout; private String TAG = "MoreAction"; @@ -72,6 +75,14 @@ public void onError(CometChatException e) { }); } }); + + launchUI = view.findViewById(R.id.launch_ui_kit); + launchUI.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + startActivity(new Intent(getContext(), CometChatUI.class)); + } + }); return view; } } \ No newline at end of file diff --git a/Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/PushNotificationActivity.java b/Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/PushNotificationActivity.java index c3f284e..ef7d26f 100644 --- a/Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/PushNotificationActivity.java +++ b/Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/PushNotificationActivity.java @@ -4,10 +4,13 @@ import androidx.appcompat.app.AppCompatActivity; import android.Manifest; +import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.ContentResolver; +import android.content.DialogInterface; import android.content.Intent; import android.content.res.ColorStateList; +import android.os.Build; import android.os.Bundle; import android.util.Log; import android.view.View; @@ -56,10 +59,20 @@ public class PushNotificationActivity extends AppCompatActivity { private String receiver = CometChatConstants.RECEIVER_TYPE_USER; private TextInputLayout uidLayout; private ProgressDialog progressDialog; + + private String[] permissions = new String[]{Manifest.permission.RECORD_AUDIO, + Manifest.permission.CAMERA,Manifest.permission.WRITE_EXTERNAL_STORAGE}; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_push_notification); + if (!Utils.hasPermissions(this,permissions)) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + requestPermissions(permissions, + UIKitConstants.RequestCode.RECORD); + } + } + progressDialog = new ProgressDialog(this); progressDialog.setTitle(getResources().getString(R.string.please_wait)); progressDialog.setMessage(getResources().getString(R.string.media_uploading)); diff --git a/Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/UIKitApplication.java b/Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/UIKitApplication.java index 078b8d3..200a1b6 100644 --- a/Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/UIKitApplication.java +++ b/Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/UIKitApplication.java @@ -5,22 +5,36 @@ import android.app.Notification; import android.app.NotificationChannel; import android.app.NotificationManager; +import android.content.BroadcastReceiver; +import android.content.Context; import android.content.DialogInterface; +import android.content.Intent; +import android.content.IntentFilter; import android.media.AudioAttributes; import android.net.Uri; import android.os.Build; import android.util.Log; import android.widget.Toast; + +import androidx.lifecycle.Lifecycle; +import androidx.lifecycle.LifecycleObserver; +import androidx.lifecycle.OnLifecycleEvent; +import androidx.lifecycle.ProcessLifecycleOwner; + import com.cometchat.pro.core.AppSettings; +import com.cometchat.pro.core.Call; import com.cometchat.pro.core.CometChat; import com.cometchat.pro.exceptions.CometChatException; import com.cometchat.pro.android.pushnotification.constants.AppConfig; +import com.cometchat.pro.uikit.ui_components.calls.call_manager.CometChatStartCallActivity; import com.cometchat.pro.uikit.ui_components.calls.call_manager.listener.CometChatCallListener; -public class UIKitApplication extends Application { +public class UIKitApplication extends Application implements LifecycleObserver { private static final String TAG = "UIKitApplication"; + public static boolean isBackground; + @Override public void onCreate() { super.onCreate(); @@ -37,10 +51,20 @@ public void onError(CometChatException e) { Toast.makeText(UIKitApplication.this, e.getMessage(), Toast.LENGTH_SHORT).show(); } }); + CometChatCallListener.addCallListener(TAG,this); createNotificationChannel(); + ProcessLifecycleOwner.get().getLifecycle().addObserver(this); } + @OnLifecycleEvent(Lifecycle.Event.ON_START) + public void onMoveToForeground() { + isBackground=false; + } + @OnLifecycleEvent(Lifecycle.Event.ON_STOP) + public void onMoveToBackground() { + isBackground = true; + } private void createNotificationChannel() { // Create the NotificationChannel, but only on API 26+ because @@ -58,6 +82,5 @@ private void createNotificationChannel() { NotificationManager notificationManager = getSystemService(NotificationManager.class); notificationManager.createNotificationChannel(channel); } - } } diff --git a/Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/constants/AppConfig.java b/Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/constants/AppConfig.java index 05beccb..ed4f70f 100644 --- a/Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/constants/AppConfig.java +++ b/Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/constants/AppConfig.java @@ -4,9 +4,9 @@ public class AppConfig { public class AppDetails { - public static final String APP_ID = "XXXXXXXXXXXXXXXXX"; + public static final String APP_ID = "XXXXXXXXXXXXXX"; - public static final String AUTH_KEY = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; + public static final String AUTH_KEY = "XXXXXXXXXXXXXXXXXXXXXXXX"; public static final String REGION = "XX"; } diff --git a/Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/utils/MyFirebaseMessagingService.java b/Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/utils/MyFirebaseMessagingService.java index fae14a7..f9f9e0a 100644 --- a/Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/utils/MyFirebaseMessagingService.java +++ b/Firebase/app/src/main/java/com/cometchat/pro/android/pushnotification/utils/MyFirebaseMessagingService.java @@ -18,6 +18,7 @@ import androidx.core.graphics.drawable.IconCompat; import com.cometchat.pro.android.pushnotification.R; +import com.cometchat.pro.android.pushnotification.UIKitApplication; import com.cometchat.pro.android.pushnotification.constants.AppConfig; import com.cometchat.pro.constants.CometChatConstants; import com.cometchat.pro.core.Call; @@ -191,7 +192,8 @@ private void showNotifcation(BaseMessage baseMessage) { builder.addAction(0, "Answers", PendingIntent.getBroadcast(getApplicationContext(), REQUEST_CODE, getCallIntent("Answers"), PendingIntent.FLAG_UPDATE_CURRENT)); builder.addAction(0, "Decline", PendingIntent.getBroadcast(getApplicationContext(), 1, getCallIntent("Decline"), PendingIntent.FLAG_UPDATE_CURRENT)); } - notificationManager.notify(05,builder.build()); + if (UIKitApplication.isBackground) + notificationManager.notify(05,builder.build()); } else { // Person person = createPerson(baseMessage); diff --git a/Firebase/app/src/main/res/layout/fragment_more_actions.xml b/Firebase/app/src/main/res/layout/fragment_more_actions.xml index 8665a3c..21917d2 100644 --- a/Firebase/app/src/main/res/layout/fragment_more_actions.xml +++ b/Firebase/app/src/main/res/layout/fragment_more_actions.xml @@ -12,6 +12,14 @@ android:layout_margin="16dp" android:layout_width="match_parent" android:layout_height="wrap_content"/> + + + + + + + - - - - - - - - + + + + + @@ -112,10 +115,6 @@ - - - \ No newline at end of file diff --git a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_list/CometChatCallList.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_list/CometChatCallList.java index 96a71d5..09bc78e 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_list/CometChatCallList.java +++ b/Firebase/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; @@ -83,20 +84,17 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, // Inflate the layout for this fragment view = inflater.inflate(R.layout.fragment_cometchat_calls, container, false); tvTitle = view.findViewById(R.id.tv_title); - fetchSettings(); CometChatError.init(getContext()); phoneAddIv = view.findViewById(R.id.add_phone_iv); - if (oneOnoneCallEnabled || oneOnoneVideoCallEnabled) - phoneAddIv.setVisibility(View.VISIBLE); - else - phoneAddIv.setVisibility(View.GONE); - phoneAddIv.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { openUserListScreen(); } }); + + fetchSettings(); + viewPager = view.findViewById(R.id.viewPager); tabLayout = view.findViewById(R.id.tabLayout); if (getActivity() != null) { @@ -106,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)); @@ -121,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 @@ -149,13 +147,15 @@ private void fetchSettings() { FeatureRestriction.isOneOnOneAudioCallEnabled(new FeatureRestriction.OnSuccessListener() { @Override public void onSuccess(Boolean booleanVal) { - oneOnoneCallEnabled = booleanVal; + if (booleanVal) + phoneAddIv.setVisibility(View.VISIBLE); } }); FeatureRestriction.isOneOnOneVideoCallEnabled(new FeatureRestriction.OnSuccessListener() { @Override public void onSuccess(Boolean booleanVal) { - oneOnoneVideoCallEnabled = booleanVal; + if (booleanVal) + phoneAddIv.setVisibility(View.VISIBLE); } }); } diff --git a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_list/CometChatNewCallList.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_list/CometChatNewCallList.java index f98782d..78c6137 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_list/CometChatNewCallList.java +++ b/Firebase/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; @@ -101,19 +102,19 @@ public CometChatNewCallList() { protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.fragment_cometchat_userlist); + fetchSettings(); title = findViewById(R.id.tv_title); CometChatError.init(this); ImageView imageView = new ImageView(this); - imageView.setImageDrawable(getResources().getDrawable(R.drawable.ic_close_24dp)); - if (FeatureRestriction.getColor()!=null) { - getWindow().setStatusBarColor(Color.parseColor(FeatureRestriction.getColor())); + imageView.setImageDrawable(getResources().getDrawable(R.drawable.ic_back_arrow_selected)); + 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))); - fetchSettings(); imageView.setClickable(true); imageView.setPadding(8,8,8,8); RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); @@ -128,11 +129,11 @@ public void onClick(View v) { onBackPressed(); } }); - title.setTypeface(FontUtils.getInstance(this).getTypeFace(FontUtils.robotoMedium)); RelativeLayout.LayoutParams titleLayoutParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); titleLayoutParams.setMargins(16,32,16,48); titleLayoutParams.addRule(RelativeLayout.CENTER_HORIZONTAL); title.setLayoutParams(titleLayoutParams); + title.setTextAppearance(R.style.TextAppearance_AppCompat_Large); title.setText(getResources().getString(R.string.new_call)); rvUserList = findViewById(R.id.rv_user_list); etSearch = findViewById(R.id.search_bar); @@ -201,9 +202,7 @@ public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newStat } }); - if (audioCallEnabled || videoCallEnabled) { - // Used to trigger event on click of user item in rvUserList (RecyclerView) - rvUserList.setItemClickListener(new OnItemClickListener() { + rvUserList.setItemClickListener(new OnItemClickListener() { @Override public void OnItemClick(User var, int position) { User user = var; @@ -229,7 +228,7 @@ public void onClick(DialogInterface dialogInterface, int i) { alertDialog.show(); } }); - } + fetchUsers(); } diff --git a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_manager/CometChatCallActivity.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_manager/CometChatCallActivity.java index 28fbc7c..dca99c3 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_manager/CometChatCallActivity.java +++ b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_manager/CometChatCallActivity.java @@ -234,10 +234,10 @@ public void setCallType(boolean isVideoCall, boolean isIncoming) { outgoingCallView.setVisibility(View.GONE); if (isVideoCall) { callMessage.setText(getResources().getString(R.string.incoming_video_call)); - callMessage.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(R.drawable.ic_videocam_white_24dp),null,null,null); + callMessage.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(R.drawable.ic_incoming_video_call),null,null,null); } else { callMessage.setText(getResources().getString(R.string.incoming_audio_call)); - callMessage.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(R.drawable.ic_call_incoming_24dp),null,null,null); + callMessage.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(R.drawable.ic_incoming_call),null,null,null); } } else { callTv.setText(getString(R.string.calling)); @@ -248,7 +248,7 @@ public void setCallType(boolean isVideoCall, boolean isIncoming) { if (isVideoCall) { cameraPreview = new CameraPreview(this); cameraFrame.addView(cameraPreview); - hangUp.setImageDrawable(getResources().getDrawable(R.drawable.ic_videocam_white_24dp)); + hangUp.setImageDrawable(getResources().getDrawable(R.drawable.ic_videocall)); } else { hangUp.setImageDrawable(getResources().getDrawable(R.drawable.ic_call_end_white_24dp)); diff --git a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_manager/CometChatStartCallActivity.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_manager/CometChatStartCallActivity.java index f722f7f..e680847 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/calls/call_manager/CometChatStartCallActivity.java +++ b/Firebase/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/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/chats/CometChatConversationList.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/chats/CometChatConversationList.java index ec7ce8f..58be0ac 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/chats/CometChatConversationList.java +++ b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/chats/CometChatConversationList.java @@ -21,6 +21,7 @@ import android.view.ViewGroup; import android.view.inputmethod.EditorInfo; import android.widget.EditText; +import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.TextView; @@ -33,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; @@ -46,6 +48,7 @@ import com.cometchat.pro.uikit.ui_resources.utils.custom_alertDialog.CustomAlertDialogHelper; import com.cometchat.pro.uikit.ui_resources.utils.custom_alertDialog.OnAlertDialogButtonClickListener; import com.cometchat.pro.uikit.ui_resources.utils.recycler_touch.RecyclerViewSwipeListener; +import com.cometchat.pro.uikit.ui_settings.FeatureRestriction; import com.cometchat.pro.uikit.ui_settings.UIKitSettings; import com.facebook.shimmer.ShimmerFrameLayout; @@ -93,6 +96,8 @@ public class CometChatConversationList extends Fragment implements TextWatcher, private List conversationList = new ArrayList<>(); + private ImageView startConversation; + public CometChatConversationList() { // Required empty public constructor } @@ -122,6 +127,23 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, CometChatError.init(getContext()); + startConversation = view.findViewById(R.id.start_conversation); + FeatureRestriction.isStartConversationEnabled(new FeatureRestriction.OnSuccessListener() { + @Override + public void onSuccess(Boolean booleanVal) { + if (booleanVal) + startConversation.setVisibility(View.VISIBLE); + else + startConversation.setVisibility(View.GONE); + } + }); + + startConversation.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + CometChatStartConversation.launch(getContext()); + } + }); searchEdit.setOnEditorActionListener((textView, i, keyEvent) -> { if (i == EditorInfo.IME_ACTION_SEARCH) { if (!textView.getText().toString().isEmpty()) { @@ -184,69 +206,76 @@ public void OnItemClick(Conversation conversation, int position) { RecyclerViewSwipeListener swipeHelper = new RecyclerViewSwipeListener(getContext()) { @Override public void instantiateUnderlayButton(RecyclerView.ViewHolder viewHolder, List underlayButtons) { - Bitmap deleteBitmap = BitmapFactory.decodeResource(getResources(),R.drawable.ic_delete); - underlayButtons.add(new RecyclerViewSwipeListener.UnderlayButton( - "Delete", - deleteBitmap, - getResources().getColor(R.color.red), - new RecyclerViewSwipeListener.UnderlayButtonClickListener() { - @Override - public void onClick(final int pos) { - Conversation conversation = rvConversationList.getConversation(pos); - if (conversation!=null) { - String conversationUid = ""; - String type = ""; - if (conversation.getConversationType() - .equalsIgnoreCase(CometChatConstants.CONVERSATION_TYPE_GROUP)) { - conversationUid = ((Group)conversation.getConversationWith()).getGuid(); - type = CometChatConstants.CONVERSATION_TYPE_GROUP; - } else { - conversationUid = ((User)conversation.getConversationWith()).getUid(); - type = CometChatConstants.CONVERSATION_TYPE_USER; - } - String finalConversationUid = conversationUid; - String finalType = type; - new CustomAlertDialogHelper(getContext(), - getString(R.string.delete_conversation_message), - null, - getString(R.string.yes), - "", getString(R.string.no), new OnAlertDialogButtonClickListener() { + Bitmap deleteBitmap = Utils.drawableToBitmap(getResources().getDrawable(R.drawable.ic_delete_conversation)); + FeatureRestriction.isDeleteConversationEnabled(new FeatureRestriction.OnSuccessListener() { + @Override + public void onSuccess(Boolean booleanVal) { + if (booleanVal) { + underlayButtons.add(new RecyclerViewSwipeListener.UnderlayButton( + "Delete", + deleteBitmap, + getResources().getColor(R.color.red), + new RecyclerViewSwipeListener.UnderlayButtonClickListener() { @Override - public void onButtonClick(AlertDialog alertDialog, View v, int which, int popupId) { - if (which==DialogInterface.BUTTON_POSITIVE) { - ProgressDialog progressDialog = ProgressDialog.show(getContext(),null, - getString(R.string.deleting_conversation)); - CometChat.deleteConversation( - finalConversationUid, finalType, - new CometChat.CallbackListener() { - @Override - public void onSuccess(String s) { - Handler handler = new Handler(); - handler.postDelayed(new Runnable() { - public void run() { - alertDialog.dismiss(); - progressDialog.dismiss(); - } - }, 1500); - rvConversationList.remove(conversation); - } - - @Override - public void onError(CometChatException e) { - progressDialog.dismiss(); - e.printStackTrace(); - } - }); - } else if (which==DialogInterface.BUTTON_NEGATIVE) { - alertDialog.dismiss(); + public void onClick(final int pos) { + Conversation conversation = rvConversationList.getConversation(pos); + if (conversation!=null) { + String conversationUid = ""; + String type = ""; + if (conversation.getConversationType() + .equalsIgnoreCase(CometChatConstants.CONVERSATION_TYPE_GROUP)) { + conversationUid = ((Group)conversation.getConversationWith()).getGuid(); + type = CometChatConstants.CONVERSATION_TYPE_GROUP; + } else { + conversationUid = ((User)conversation.getConversationWith()).getUid(); + type = CometChatConstants.CONVERSATION_TYPE_USER; + } + String finalConversationUid = conversationUid; + String finalType = type; + new CustomAlertDialogHelper(getContext(), + getString(R.string.delete_conversation_message), + null, + getString(R.string.yes), + "", getString(R.string.no), new OnAlertDialogButtonClickListener() { + @Override + public void onButtonClick(AlertDialog alertDialog, View v, int which, int popupId) { + if (which==DialogInterface.BUTTON_POSITIVE) { + ProgressDialog progressDialog = ProgressDialog.show(getContext(),null, + getString(R.string.deleting_conversation)); + CometChat.deleteConversation( + finalConversationUid, finalType, + new CometChat.CallbackListener() { + @Override + public void onSuccess(String s) { + Handler handler = new Handler(); + handler.postDelayed(new Runnable() { + public void run() { + alertDialog.dismiss(); + progressDialog.dismiss(); + } + }, 1500); + rvConversationList.remove(conversation); + } + + @Override + public void onError(CometChatException e) { + progressDialog.dismiss(); + e.printStackTrace(); + } + }); + } else if (which==DialogInterface.BUTTON_NEGATIVE) { + alertDialog.dismiss(); + } + } + }, 1, true); + } } - }, 1, true); - - } - } + } + )); } - )); + } + }); } }; swipeHelper.attachToRecyclerView(rvConversationList); @@ -423,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/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/chats/CometChatStartConversation.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/chats/CometChatStartConversation.java new file mode 100644 index 0000000..e864b79 --- /dev/null +++ b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/chats/CometChatStartConversation.java @@ -0,0 +1,98 @@ +package com.cometchat.pro.uikit.ui_components.chats; + +import androidx.appcompat.app.AppCompatActivity; +import androidx.fragment.app.FragmentActivity; +import androidx.viewpager.widget.ViewPager; + +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; + +import com.cometchat.pro.uikit.R; +import com.cometchat.pro.uikit.ui_components.groups.group_list.CometChatGroupList; +import com.cometchat.pro.uikit.ui_components.shared.cometchatSharedMedia.adapter.TabAdapter; +import com.cometchat.pro.uikit.ui_components.users.user_list.CometChatUserList; +import com.cometchat.pro.uikit.ui_settings.UIKitSettings; +import com.cometchat.pro.uikit.ui_settings.enums.ConversationMode; +import com.google.android.material.tabs.TabLayout; + +public class CometChatStartConversation extends AppCompatActivity { + + private ViewPager viewPager; + + private TabLayout tabLayout; + + private TabAdapter adapter; + + private TextView title; + + private ImageView backIcon; + + private String conversationType = UIKitSettings.getConversationsMode().toString(); + + public static void launch(Context context) { + context.startActivity(new Intent(context,CometChatStartConversation.class)); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_comet_chat_start_conversation); + title = findViewById(R.id.title); + viewPager = findViewById(R.id.viewPager); + tabLayout = findViewById(R.id.tabLayout); + adapter = new TabAdapter(getSupportFragmentManager()); + backIcon = findViewById(R.id.backIcon); + backIcon.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + onBackPressed(); + } + }); + + CometChatUserList cometChatUserList = new CometChatUserList(); + cometChatUserList.setTitleVisible(false); + CometChatGroupList cometChatGroupList = new CometChatGroupList(); + cometChatGroupList.setTitleVisible(false); + cometChatGroupList.setGroupCreateVisible(false); + if (conversationType.equalsIgnoreCase(ConversationMode.ALL_CHATS.toString())) { + adapter.addFragment(cometChatUserList, getString(R.string.users)); + adapter.addFragment(cometChatGroupList, getString(R.string.groups)); + } else if (conversationType.equalsIgnoreCase(ConversationMode.GROUP.toString())) { + title.setText(getString(R.string.select_group)); + tabLayout.setVisibility(View.GONE); + adapter.addFragment(cometChatGroupList, getString(R.string.groups)); + } else { + title.setText(getString(R.string.select_user)); + tabLayout.setVisibility(View.GONE); + adapter.addFragment(cometChatUserList, getString(R.string.users)); + } + viewPager.setAdapter(adapter); + viewPager.setOffscreenPageLimit(3); + tabLayout.setupWithViewPager(viewPager); + + tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { + @Override + public void onTabSelected(TabLayout.Tab tab) { + if (tab.getPosition()==0) { + title.setText(getString(R.string.select_user)); + } else { + title.setText(getString(R.string.select_group)); + } + } + + @Override + public void onTabUnselected(TabLayout.Tab tab) { + + } + + @Override + public void onTabReselected(TabLayout.Tab tab) { + + } + }); + } +} \ No newline at end of file diff --git a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/cometchat_ui/CometChatUI.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/cometchat_ui/CometChatUI.java index edd36e8..1ae4ca6 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/cometchat_ui/CometChatUI.java +++ b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/cometchat_ui/CometChatUI.java @@ -40,6 +40,8 @@ import com.cometchat.pro.uikit.databinding.ActivityCometchatUnifiedBinding; 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; @@ -62,6 +64,11 @@ import com.cometchat.pro.uikit.ui_resources.utils.Utils; import com.cometchat.pro.uikit.ui_settings.FeatureRestriction; +import javax.crypto.SecretKey; +import javax.crypto.spec.SecretKeySpec; + +import static java.nio.charset.StandardCharsets.UTF_8; + /** * Purpose - CometChatUnified class is main class used to launch the fully working chat application. * It consist of BottomNavigationBar which helps to navigate between different screens like @@ -121,8 +128,6 @@ protected void onCreate(Bundle savedInstanceState) { // It performs action on click of user item in CometChatUserListScreen. setUserClickListener(); - - //It performs action on click of group item in CometChatGroupListScreen. //It checks whether the logged-In user is already a joined a group or not and based on it perform actions. setGroupClickListener(); @@ -194,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/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/add_members/CometChatAddMembersActivity.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/add_members/CometChatAddMembersActivity.java index 3fa7c43..041aa87 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/add_members/CometChatAddMembersActivity.java +++ b/Firebase/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/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/admin_moderator_list/CometChatAdminModeratorListActivity.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/admin_moderator_list/CometChatAdminModeratorListActivity.java index add9ea4..e7e8389 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/admin_moderator_list/CometChatAdminModeratorListActivity.java +++ b/Firebase/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/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/banned_members/CometChatBanMembersActivity.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/banned_members/CometChatBanMembersActivity.java index 4867131..654d121 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/banned_members/CometChatBanMembersActivity.java +++ b/Firebase/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/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/create_group/CometChatCreateGroup.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/create_group/CometChatCreateGroup.java index f158b5e..a4cb7e8 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/create_group/CometChatCreateGroup.java +++ b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/create_group/CometChatCreateGroup.java @@ -89,7 +89,7 @@ public void beforeTextChanged(CharSequence s, int start, int count, int after) { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { if (!etGroupPassword.getText().toString().isEmpty() && s.toString().equals(etGroupPassword.getText().toString())) { - groupCnfPasswordLayout.setEndIconDrawable(getResources().getDrawable(R.drawable.ic_check_black_24dp)); + groupCnfPasswordLayout.setEndIconDrawable(getResources().getDrawable(R.drawable.ic_baseline_check_circle_24)); groupCnfPasswordLayout.setEndIconTintList(ColorStateList.valueOf(getResources().getColor(R.color.green_600))); } } diff --git a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/create_group/CometChatCreateGroupActivity.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/create_group/CometChatCreateGroupActivity.java index 3b02b83..1d21f88 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/create_group/CometChatCreateGroupActivity.java +++ b/Firebase/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/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_details/CometChatGroupDetailActivity.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_details/CometChatGroupDetailActivity.java index 78ec891..e85eddb 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_details/CometChatGroupDetailActivity.java +++ b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_details/CometChatGroupDetailActivity.java @@ -78,6 +78,8 @@ public class CometChatGroupDetailActivity extends AppCompatActivity { private CometChatAvatar groupIcon; + private ImageView editGroup; + private String groupType; private String ownerId; @@ -124,8 +126,6 @@ public class CometChatGroupDetailActivity extends AppCompatActivity { private TextView tvLoadMore; - private List groupMembers = new ArrayList<>(); - private AlertDialog.Builder dialog; private TextView tvMemberCount; @@ -167,6 +167,13 @@ private void initComponent() { tvGroupName = findViewById(R.id.tv_group_name); tvGroupDesc = findViewById(R.id.group_description); tvGroupName.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + } + }); + editGroup = findViewById(R.id.edit_group); + + editGroup.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { updateGroupDialog(); @@ -224,6 +231,13 @@ public void onClick(View v) { // rvMemberList.setNestedScrollingEnabled(false); handleIntent(); + + if (loggedInUserScope.equalsIgnoreCase(CometChatConstants.SCOPE_ADMIN)) + editGroup.setVisibility(View.VISIBLE); + else + editGroup.setVisibility(View.GONE); + + checkDarkMode(); sharedMediaLayout = findViewById(R.id.shared_media_layout); @@ -368,8 +382,8 @@ public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMen super.onCreateContextMenu(menu, v, menuInfo); MenuInflater menuInflater = getMenuInflater(); menuInflater.inflate(R.menu.group_action_menu, menu); - - menu.findItem(R.id.item_make_admin).setVisible(false); + if (!ownerId.equalsIgnoreCase(loggedInUser.getUid())) + menu.findItem(R.id.item_make_admin).setVisible(false); menu.setHeaderTitle(getString(R.string.group_alert)); } @@ -382,11 +396,32 @@ public boolean onContextItemSelected(@NonNull MenuItem item) { kickMember(); } else if(item.getItemId() == R.id.item_ban) { banMember(); + } else if (item.getItemId() == R.id.item_make_admin) { + transferOwner(groupMember); } return super.onContextItemSelected(item); } + private void transferOwner(GroupMember groupMember) { + CometChat.transferGroupOwnership(guid, groupMember.getUid(), new CometChat.CallbackListener() { + @Override + public void onSuccess(String s) { + CometChatSnackBar.show(CometChatGroupDetailActivity.this, + rvMemberList, + String.format(getResources().getString(R.string.user_is_owner),groupMember.getName()), CometChatSnackBar.SUCCESS); + } + + @Override + public void onError(CometChatException e) { + CometChatSnackBar.show(CometChatGroupDetailActivity.this, + rvMemberList, + String.format(getResources().getString(R.string.update_scope_error)+e.getCode(),groupMember.getName()) + +", "+CometChatError.localized(e),CometChatSnackBar.ERROR); + } + }); + } + /** * This method is used to create dialog box on click of events like Delete Group and Exit Group @@ -495,6 +530,10 @@ private void handleIntent() { } if (getIntent().hasExtra(UIKitConstants.IntentStrings.GROUP_DESC)) { gDesc = getIntent().getStringExtra(UIKitConstants.IntentStrings.GROUP_DESC); + if (gDesc!=null) { + if (!gDesc.isEmpty()) + tvGroupDesc.setVisibility(View.VISIBLE); + } tvGroupDesc.setText(gDesc); } if (getIntent().hasExtra(UIKitConstants.IntentStrings.GROUP_PASSWORD)) { @@ -983,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/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_list/CometChatGroupList.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_list/CometChatGroupList.java index d1e9582..cba07d4 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_list/CometChatGroupList.java +++ b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_list/CometChatGroupList.java @@ -10,6 +10,7 @@ import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.RecyclerView; +import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; import android.text.Editable; import android.text.TextWatcher; @@ -40,6 +41,7 @@ import java.util.ArrayList; import java.util.List; +import com.cometchat.pro.uikit.ui_resources.constants.UIKitConstants; import com.cometchat.pro.uikit.ui_resources.utils.CometChatError; import com.cometchat.pro.uikit.ui_resources.utils.item_clickListener.OnItemClickListener; import com.cometchat.pro.uikit.ui_components.groups.create_group.CometChatCreateGroupActivity; @@ -65,10 +67,14 @@ public class CometChatGroupList extends Fragment { private CometChatGroups rvGroupList; //Uses to display list of groups. - private GroupsRequest groupsRequest; //Uses to fetch Groups. + private SwipeRefreshLayout swipeRefreshLayout; + private GroupsRequest groupsRequest; //Uses to fetch Groups. + private TextView title; private EditText etSearch; //Uses to perform search operations on groups. + private boolean isGroupCreateVisible = true; + private ImageView clearSearch; private ImageView ivCreateGroup; @@ -87,22 +93,76 @@ public CometChatGroupList() { // Required empty public constructor } + + public void setGroupCreateVisible(boolean isVisible) { + Bundle bundle = null; + if (getArguments()!=null) { + bundle = getArguments(); + } else { + bundle = new Bundle(); + } + bundle.putBoolean(UIKitConstants.IntentStrings.CREATE_GROUP_VISIBLE, isVisible); + setArguments(bundle); + } + + public void isGroupCreateVisible() { + if (getArguments()!=null) { + isGroupCreateVisible = getArguments() + .getBoolean(UIKitConstants.IntentStrings.CREATE_GROUP_VISIBLE, true); + if (isGroupCreateVisible) + ivCreateGroup.setVisibility(View.VISIBLE); + else + ivCreateGroup.setVisibility(View.GONE); + } + } + + public void setTitleVisible(boolean isVisible) { + Bundle bundle = null; + if (getArguments()!=null) { + bundle = getArguments(); + } else { + bundle = new Bundle(); + } + bundle.putBoolean(UIKitConstants.IntentStrings.IS_TITLE_VISIBLE,isVisible); + setArguments(bundle); + } + + public void isTitleVisible() { + if (getArguments()!=null) { + boolean isVisible = getArguments() + .getBoolean(UIKitConstants.IntentStrings.IS_TITLE_VISIBLE, true); + if (isVisible) + title.setVisibility(View.VISIBLE); + else + title.setVisibility(View.GONE); + } + } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment View view= inflater.inflate(R.layout.fragment_cometchat_grouplist, container, false); - TextView title = view.findViewById(R.id.tv_title); + title = view.findViewById(R.id.tv_title); title.setTypeface(FontUtils.getInstance(getActivity()).getTypeFace(FontUtils.robotoMedium)); rvGroupList=view.findViewById(R.id.rv_group_list); + swipeRefreshLayout = view.findViewById(R.id.swipe_refresh); noGroupLayout = view.findViewById(R.id.no_group_layout); etSearch = view.findViewById(R.id.search_bar); clearSearch = view.findViewById(R.id.clear_search); 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() { + @Override + public void onRefresh() { + groupsRequest = null; + rvGroupList.clear(); + fetchGroup(); + } + }); FeatureRestriction.isGroupSearchEnabled(new FeatureRestriction.OnSuccessListener() { @Override public void onSuccess(Boolean booleanVal) { @@ -115,7 +175,7 @@ public void onSuccess(Boolean booleanVal) { FeatureRestriction.isGroupCreationEnabled(new FeatureRestriction.OnSuccessListener() { @Override public void onSuccess(Boolean booleanVal) { - if (booleanVal) + if (booleanVal && isGroupCreateVisible) ivCreateGroup.setVisibility(View.VISIBLE); else ivCreateGroup.setVisibility(View.GONE); @@ -224,11 +284,13 @@ public void OnItemClick(Group group, int position) { event.OnItemClick(group,position); } }); + isGroupCreateVisible(); return view; } private void checkGroups() { - if (isPublicGroupEnabled || isPasswordGroupEnabled || isPrivateGroupEnabled) { + if ((isPublicGroupEnabled || isPasswordGroupEnabled || isPrivateGroupEnabled) + && isGroupCreateVisible) { ivCreateGroup.setVisibility(View.VISIBLE); } else ivCreateGroup.setVisibility(View.GONE); @@ -254,6 +316,8 @@ private void fetchGroup(){ public void onSuccess(List groups) { rvGroupList.setGroupList(groups); // sets the groups in rvGroupList i.e CometChatGroupList Component. groupList.addAll(groups); + if (swipeRefreshLayout.isRefreshing()) + swipeRefreshLayout.setRefreshing(false); if (groupList.size()==0) { noGroupLayout.setVisibility(View.VISIBLE); rvGroupList.setVisibility(View.GONE); diff --git a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_members/CometChatGroupMemberListActivity.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_members/CometChatGroupMemberListActivity.java index f792fdf..f79d1a7 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_members/CometChatGroupMemberListActivity.java +++ b/Firebase/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/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_members/GroupMemberAdapter.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_members/GroupMemberAdapter.java index 5fda61e..135d485 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_members/GroupMemberAdapter.java +++ b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/groups/group_members/GroupMemberAdapter.java @@ -113,7 +113,7 @@ public void onBindViewHolder(@NonNull GroupMemberViewHolder groupMemberViewHolde } else if (groupMember.getScope().equals(CometChatConstants.SCOPE_MODERATOR)){ groupMemberViewHolder.userListRowBinding.txtUserScope.setText(R.string.moderator); } else { - groupMemberViewHolder.userListRowBinding.txtUserScope.setText(""); + groupMemberViewHolder.userListRowBinding.txtUserScope.setText(R.string.participant); } groupMemberViewHolder.userListRowBinding.txtUserName.setTypeface(fontUtils.getTypeFace(FontUtils.robotoMedium)); diff --git a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/forward_message/CometChatForwardMessageActivity.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/forward_message/CometChatForwardMessageActivity.java index 31a41b9..e69440f 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/forward_message/CometChatForwardMessageActivity.java +++ b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/forward_message/CometChatForwardMessageActivity.java @@ -115,7 +115,7 @@ protected void onCreate(Bundle savedInstanceState) { } - void handleSendText(Intent intent) { + void handleText(Intent intent) { String sharedText = intent.getStringExtra(Intent.EXTRA_TEXT); if (sharedText != null) { messageType = CometChatConstants.MESSAGE_TYPE_TEXT; @@ -123,7 +123,7 @@ void handleSendText(Intent intent) { } } - void handleSendImage(Intent intent) { + void handleImage(Intent intent) { Uri imageUri = (Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM); if (imageUri != null) { messageType = UIKitConstants.IntentStrings.INTENT_MEDIA_IMAGE_MESSAGE; @@ -132,7 +132,7 @@ void handleSendImage(Intent intent) { } } - void handleSendVideo(Intent intent) { + void handleVideo(Intent intent) { Uri videoUri = (Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM); if (videoUri!=null) { messageType = UIKitConstants.IntentStrings.INTENT_MEDIA_VIDEO_MESSAGE; @@ -141,6 +141,23 @@ void handleSendVideo(Intent intent) { } } + void handleAudio(Intent intent) { + Uri audioUri = (Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM); + if (audioUri!=null) { + messageType = UIKitConstants.IntentStrings.INTENT_MEDIA_AUDIO_MESSAGE; + mediaMessageUrl = audioUri.toString(); + Log.e(TAG, "handleSendAudio: "+mediaMessageUrl); + } + } + + void handleFile(Intent intent) { + Uri fileUri = (Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM); + if (fileUri!=null) { + messageType = UIKitConstants.IntentStrings.INTENT_MEDIA_FILE_MESSAGE; + mediaMessageUrl = fileUri.toString(); + Log.e(TAG, "handleSendFile: "+mediaMessageUrl); + } + } /** * This method is used to handle parameter passed to this class. */ @@ -153,11 +170,15 @@ private void handleIntent() { if (Intent.ACTION_SEND.equals(action) && type != null) { if ("text/plain".equals(type)) { - handleSendText(intent); // Handle text being sent + handleText(intent); // Handle text being sent } else if (type.startsWith("image/")) { - handleSendImage(intent); // Handle single image being sent + handleImage(intent); // Handle single image being sent } else if (type.startsWith("video/")) { - handleSendVideo(intent); + handleVideo(intent); + } else if(type.startsWith("audio/")) { + handleAudio(intent); + } else if (type.startsWith("application/")) { + handleFile(intent); } } @@ -200,7 +221,7 @@ private void handleIntent() { * This method is used to initialize the views */ public void init() { - // Inflate the layout + // Inflate the layout MaterialToolbar toolbar = findViewById(R.id.forward_toolbar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); @@ -231,10 +252,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()); + } } }); @@ -273,7 +294,7 @@ public void OnItemClick(Conversation conversation, int position) { avatar = ((Group) conversation.getConversationWith()).getIcon(); } chip.setText(name); - Glide.with(CometChatForwardMessageActivity.this).load(avatar).placeholder(R.drawable.ic_contacts_24dp).transform(new CircleCrop()).into(new SimpleTarget() { + Glide.with(CometChatForwardMessageActivity.this).load(avatar).placeholder(R.drawable.ic_contacts).transform(new CircleCrop()).into(new SimpleTarget() { @Override public void onResourceReady(@NonNull Drawable resource, @Nullable Transition transition) { chip.setChipIcon(resource); @@ -294,7 +315,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 +354,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); @@ -357,21 +382,29 @@ public void onClick(View view) { attachment.setFileName(mediaMessageName); message.setAttachment(attachment); Log.e(TAG, "onClick: " + attachment.toString()); - sendMediaMessage(message); - if (i == userList.size() - 1) { - Intent intent = new Intent(CometChatForwardMessageActivity.this, CometChatUI.class); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); - startActivity(intent); - finish(); - } + sendMediaMessage(message,i); +// if (i == userList.size() - 1) { +// Intent intent = new Intent(CometChatForwardMessageActivity.this, CometChatUI.class); +// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); +// startActivity(intent); +// finish(); +// } } }).start(); - } else if (messageType!=null && messageType.equalsIgnoreCase(UIKitConstants.IntentStrings.INTENT_MEDIA_IMAGE_MESSAGE)){ + } else if (messageType != null && + (messageType.equalsIgnoreCase( + UIKitConstants.IntentStrings.INTENT_MEDIA_IMAGE_MESSAGE) || + messageType.equalsIgnoreCase( + UIKitConstants.IntentStrings.INTENT_MEDIA_VIDEO_MESSAGE) || + messageType.equalsIgnoreCase( + UIKitConstants.IntentStrings.INTENT_MEDIA_AUDIO_MESSAGE) || + messageType.equalsIgnoreCase( + UIKitConstants.IntentStrings.INTENT_MEDIA_FILE_MESSAGE))) { new Thread(() -> { for (int i = 0; i <= userList.size() - 1; i++) { Conversation conversation = new ArrayList<>(userList.values()).get(i); - MediaMessage message; + MediaMessage message = null; String uid; String type; Log.e(TAG, "run: " + conversation.getConversationId()); @@ -384,45 +417,15 @@ public void onClick(View view) { } File file = MediaUtils.getRealPath( CometChatForwardMessageActivity.this, - Uri.parse(mediaMessageUrl),true); - message = new MediaMessage(uid, file, CometChatConstants.MESSAGE_TYPE_IMAGE, type); - try { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("path", mediaMessageUrl); - message.setMetadata(jsonObject); - } catch (Exception e) { - Log.e(TAG, "onError: " + e.getMessage()); - } - sendMediaMessage(message); - if (i == userList.size() - 1) { - Intent intent = new Intent(CometChatForwardMessageActivity.this, CometChatUI.class); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); - startActivity(intent); - finish(); - } - } - - }).start(); - } - else if (messageType!=null && messageType.equalsIgnoreCase(UIKitConstants.IntentStrings.INTENT_MEDIA_VIDEO_MESSAGE)){ - new Thread(() -> { - for (int i = 0; i <= userList.size() - 1; i++) { - Conversation conversation = new ArrayList<>(userList.values()).get(i); - MediaMessage message; - String uid; - String type; - Log.e(TAG, "run: " + conversation.getConversationId()); - if (conversation.getConversationType().equals(CometChatConstants.CONVERSATION_TYPE_USER)) { - uid = ((User) conversation.getConversationWith()).getUid(); - type = CometChatConstants.RECEIVER_TYPE_USER; - } else { - uid = ((Group) conversation.getConversationWith()).getGuid(); - type = CometChatConstants.RECEIVER_TYPE_GROUP; - } - File file = MediaUtils.saveDriveFile( - CometChatForwardMessageActivity.this, - Uri.parse(mediaMessageUrl)); - message = new MediaMessage(uid, file, CometChatConstants.MESSAGE_TYPE_VIDEO, type); + Uri.parse(mediaMessageUrl), true); + if (messageType.equalsIgnoreCase(UIKitConstants.IntentStrings.INTENT_MEDIA_IMAGE_MESSAGE)) + message = new MediaMessage(uid, file, CometChatConstants.MESSAGE_TYPE_IMAGE, type); + else if (messageType.equalsIgnoreCase(UIKitConstants.IntentStrings.INTENT_MEDIA_VIDEO_MESSAGE)) + message = new MediaMessage(uid, file, CometChatConstants.MESSAGE_TYPE_VIDEO, type); + else if (messageType.equalsIgnoreCase(UIKitConstants.IntentStrings.INTENT_MEDIA_AUDIO_MESSAGE)) + message = new MediaMessage(uid, file, CometChatConstants.MESSAGE_TYPE_AUDIO, type); + else if (messageType.equalsIgnoreCase(UIKitConstants.IntentStrings.INTENT_MEDIA_FILE_MESSAGE)) + message = new MediaMessage(uid, file, CometChatConstants.MESSAGE_TYPE_FILE, type); try { JSONObject jsonObject = new JSONObject(); jsonObject.put("path", mediaMessageUrl); @@ -430,54 +433,47 @@ else if (messageType!=null && messageType.equalsIgnoreCase(UIKitConstants.Intent } catch (Exception e) { Log.e(TAG, "onError: " + e.getMessage()); } - sendMediaMessage(message); - if (i == userList.size() - 1) { - Intent intent = new Intent(CometChatForwardMessageActivity.this, CometChatUI.class); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); - startActivity(intent); - finish(); - } + sendMediaMessage(message,i); } - }).start(); - } - } else { - if (messageType!=null && messageType.equalsIgnoreCase(UIKitConstants.IntentStrings.LOCATION)) { - new Thread(() -> { - for (int i = 0; i <= userList.size() - 1; i++) { - Conversation conversation = new ArrayList<>(userList.values()).get(i); - CustomMessage message; - String uid; - JSONObject customData = new JSONObject(); - String type; - Log.e(TAG, "run: " + conversation.getConversationId()); - if (conversation.getConversationType().equals(CometChatConstants.CONVERSATION_TYPE_USER)) { - uid = ((User) conversation.getConversationWith()).getUid(); - type = CometChatConstants.RECEIVER_TYPE_USER; - } else { - uid = ((Group) conversation.getConversationWith()).getGuid(); - type = CometChatConstants.RECEIVER_TYPE_GROUP; - } - - try { - customData = new JSONObject(); - customData.put("latitude",lat); - customData.put("longitude",lon); - } catch (JSONException e) { - e.printStackTrace(); - } - message = new CustomMessage(uid,type, UIKitConstants.IntentStrings.LOCATION,customData); - - sendLocationMessage(message); - if (i == userList.size() - 1) { - Intent intent = new Intent(CometChatForwardMessageActivity.this, CometChatUI.class); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); - startActivity(intent); - finish(); + } else { + if (messageType != null && messageType.equalsIgnoreCase(UIKitConstants.IntentStrings.LOCATION)) { + new Thread(() -> { + for (int i = 0; i <= userList.size() - 1; i++) { + Conversation conversation = new ArrayList<>(userList.values()).get(i); + CustomMessage message; + String uid; + JSONObject customData = new JSONObject(); + String type; + Log.e(TAG, "run: " + conversation.getConversationId()); + if (conversation.getConversationType().equals(CometChatConstants.CONVERSATION_TYPE_USER)) { + uid = ((User) conversation.getConversationWith()).getUid(); + type = CometChatConstants.RECEIVER_TYPE_USER; + } else { + uid = ((Group) conversation.getConversationWith()).getGuid(); + type = CometChatConstants.RECEIVER_TYPE_GROUP; + } + + try { + customData = new JSONObject(); + customData.put("latitude", lat); + customData.put("longitude", lon); + } catch (JSONException e) { + e.printStackTrace(); + } + message = new CustomMessage(uid, type, UIKitConstants.IntentStrings.LOCATION, customData); + + sendLocationMessage(message); + if (i == userList.size() - 1) { + Intent intent = new Intent(CometChatForwardMessageActivity.this, CometChatUI.class); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); + startActivity(intent); + finish(); + } } - } - }).start(); + }).start(); + } } } } @@ -524,12 +520,17 @@ public void onError(CometChatException e) { }); } - public void sendMediaMessage(MediaMessage mediaMessage) + public void sendMediaMessage(MediaMessage mediaMessage,int i) { CometChat.sendMediaMessage(mediaMessage, new CometChat.CallbackListener() { @Override public void onSuccess(MediaMessage mediaMessage) { - Log.d(TAG, "sendMediaMessage onSuccess: " + mediaMessage.toString()); + if (i == userList.size() - 1) { + Intent intent = new Intent(CometChatForwardMessageActivity.this, CometChatUI.class); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); + startActivity(intent); + finish(); + } } @Override @@ -547,9 +548,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 +583,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/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/message_actions/CometChatMessageActions.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/message_actions/CometChatMessageActions.java index 53856b1..2bdb5d8 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/message_actions/CometChatMessageActions.java +++ b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/message_actions/CometChatMessageActions.java @@ -143,7 +143,7 @@ public void onClick(View view) { }); } ImageView addEmojiView = new ImageView(getContext()); - addEmojiView.setImageDrawable(getResources().getDrawable(R.drawable.add_emoji)); + addEmojiView.setImageDrawable(getResources().getDrawable(R.drawable.ic_reactions)); LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams( (int)Utils.dpToPx(getContext(),36),(int)Utils.dpToPx(getContext(),36)); layoutParams.topMargin = 8; diff --git a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/message_list/CometChatMessageList.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/message_list/CometChatMessageList.java index 75442dc..f561329 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/message_list/CometChatMessageList.java +++ b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/message_list/CometChatMessageList.java @@ -5,6 +5,7 @@ import android.animation.AnimatorListenerAdapter; import android.animation.ObjectAnimator; import android.animation.ValueAnimator; +import android.annotation.TargetApi; import android.app.Dialog; import android.app.ProgressDialog; import android.content.ClipData; @@ -50,6 +51,7 @@ import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; +import androidx.core.app.ActivityCompat; import androidx.core.view.inputmethod.InputContentInfoCompat; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.LinearLayoutManager; @@ -111,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; @@ -125,6 +128,7 @@ import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Locale; @@ -261,7 +265,7 @@ public class CometChatMessageList extends Fragment implements View.OnClickListen private User loggedInUser = CometChat.getLoggedInUser(); - String[] CAMERA_PERMISSION = {Manifest.permission.CAMERA,Manifest.permission.WRITE_EXTERNAL_STORAGE}; + String[] CAMERA_PERMISSION = {Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE}; private boolean isInProgress; @@ -355,7 +359,7 @@ private void handleArguments() { } String message = getArguments().getString(UIKitConstants.IntentStrings.MESSAGE); - if (message!=null) { + if (message != null) { try { JSONObject repliedMessageJSON = new JSONObject(message); repliedMessage = CometChatHelper.processMessage(repliedMessageJSON); @@ -438,18 +442,18 @@ public void onCancel(View var1) { new Handler().postDelayed(new Runnable() { @Override public void run() { - if (imageView!=null && animation!=null && animation.isRunning()) { - ObjectAnimator animator = ObjectAnimator.ofFloat(container,"alpha",0.2f); + if (imageView != null && animation != null && animation.isRunning()) { + ObjectAnimator animator = ObjectAnimator.ofFloat(container, "alpha", 0.2f); animator.setDuration(700); animator.start(); animator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { super.onAnimationEnd(animation); - if (imageView!=null) + if (imageView != null) imageView.clearAnimation(); container.removeAllViews(); - if (typingTimer!=null) + if (typingTimer != null) typingTimer.schedule(new TimerTask() { @Override public void run() { @@ -462,12 +466,12 @@ public void run() { TypingIndicator typingIndicator = new TypingIndicator(Id, type, metaData); CometChat.endTyping(typingIndicator); } - },2000); + }, 2000); } }); } } - },1400); + }, 1400); } })); @@ -500,12 +504,12 @@ public void onClick(View view) { public void onClickListener(Sticker sticker) { JSONObject stickerData = new JSONObject(); try { - stickerData.put("sticker_url",sticker.getUrl()); - stickerData.put("sticker_name",sticker.getName()); + stickerData.put("sticker_url", sticker.getUrl()); + stickerData.put("sticker_name", sticker.getName()); } catch (JSONException e) { e.printStackTrace(); } - sendCustomMessage(UIKitConstants.IntentStrings.STICKERS,stickerData); + sendCustomMessage(UIKitConstants.IntentStrings.STICKERS, stickerData); stickerLayout.setVisibility(GONE); } }); @@ -517,7 +521,7 @@ public void onClickListener(Sticker sticker) { replyClose = view.findViewById(R.id.iv_reply_close); replyClose.setOnClickListener(this); - if (repliedMessage!=null) { + if (repliedMessage != null) { baseMessage = repliedMessage; replyMessage(); } @@ -568,7 +572,7 @@ public void onClickListener(Sticker sticker) { if (isEdit) { composeBox.ivMic.setVisibility(GONE); composeBox.ivSend.setVisibility(View.VISIBLE); - }else { + } else { FeatureRestriction.isVoiceNotesEnabled(new FeatureRestriction.OnSuccessListener() { @Override public void onSuccess(Boolean booleanVal) { @@ -598,16 +602,16 @@ public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newStat @Override public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { - if (!isNoMoreMessages && !isInProgress) { - if (linearLayoutManager.findFirstVisibleItemPosition() == 10 || !rvChatListView.canScrollVertically(-1)) { - isInProgress = true; - fetchMessage(); - } - } - if (messageAdapter!=null && ((messageAdapter.getItemCount() - 1) - linearLayoutManager.findLastVisibleItemPosition() < 5)) { - newMessageLayout.setVisibility(GONE); - newMessageCount = 0; + if (!isNoMoreMessages && !isInProgress) { + if (linearLayoutManager.findFirstVisibleItemPosition() == 10 || !rvChatListView.canScrollVertically(-1)) { + isInProgress = true; + fetchMessage(); } + } + if (messageAdapter != null && ((messageAdapter.getItemCount() - 1) - linearLayoutManager.findLastVisibleItemPosition() < 5)) { + newMessageLayout.setVisibility(GONE); + newMessageCount = 0; + } } }); @@ -630,15 +634,16 @@ public void OnItemClick(String var, int position) { checkOnGoingCall(); } - private void checkOnGoingCall(String callType) { - if(CometChat.getActiveCall()!=null && CometChat.getActiveCall().getCallStatus().equals(CometChatConstants.CALL_STATUS_ONGOING) && CometChat.getActiveCall().getSessionId()!=null) { + private void checkOnGoingCall(String callType) { + if (CometChat.getActiveCall() != null && + CometChat.getActiveCall().getCallStatus().equals(CometChatConstants.CALL_STATUS_ONGOING) && CometChat.getActiveCall().getSessionId() != null) { AlertDialog.Builder alert = new AlertDialog.Builder(context); alert.setTitle(getResources().getString(R.string.ongoing_call)) .setMessage(getResources().getString(R.string.ongoing_call_message)) .setPositiveButton(getResources().getString(R.string.join), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - CallUtils.joinOnGoingCall(context,CometChat.getActiveCall()); + CallUtils.joinOnGoingCall(context, CometChat.getActiveCall()); } }).setNegativeButton(getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() { @Override @@ -648,18 +653,17 @@ public void onClick(DialogInterface dialog, int which) { videoCallAction.setClickable(true); } }).create().show(); - } - else { + } else { Call call = null; if (type.equalsIgnoreCase(CometChatConstants.RECEIVER_TYPE_GROUP)) - call = new Call(Id, CometChatConstants.RECEIVER_TYPE_GROUP,callType); + call = new Call(Id, CometChatConstants.RECEIVER_TYPE_GROUP, callType); else - call = new Call(Id, CometChatConstants.RECEIVER_TYPE_USER,callType); + call = new Call(Id, CometChatConstants.RECEIVER_TYPE_USER, callType); CometChat.initiateCall(call, new CometChat.CallbackListener() { @Override public void onSuccess(Call call) { CallUtils.startCallIntent(context, - ((User)call.getCallReceiver()),call.getType(),true, + ((User) call.getCallReceiver()), call.getType(), true, call.getSessionId()); } @@ -667,57 +671,58 @@ public void onSuccess(Call call) { public void onError(CometChatException e) { audioCallAction.setClickable(true); videoCallAction.setClickable(true); - Log.e(TAG, "onError: "+e.getMessage()); + Log.e(TAG, "onError: " + e.getMessage()); CometChatSnackBar.show(context, rvChatListView, - CometChatError.localized(e),CometChatSnackBar.ERROR); + CometChatError.localized(e), CometChatSnackBar.ERROR); } }); } } + /** * This method is used to check if the app has ongoing call or not and based on it show the view * through which user can join ongoing call. * */ private void checkOnGoingCall() { - if(CometChat.getActiveCall()!=null - && (CometChat.getActiveCall().getReceiverUid().equalsIgnoreCase(Id) || - CometChat.getActiveCall().getReceiverUid() - .equalsIgnoreCase(loggedInUser.getUid())) - && CometChat.getActiveCall().getCallStatus(). - equals(CometChatConstants.CALL_STATUS_ONGOING) - && CometChat.getActiveCall().getSessionId()!=null) { - - if(onGoingCallView!=null) - onGoingCallView.setVisibility(View.VISIBLE); - if(onGoingCallTxt!=null) { - onGoingCallTxt.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { + if (CometChat.getActiveCall() != null + && (CometChat.getActiveCall().getReceiverUid().equalsIgnoreCase(Id) || + CometChat.getActiveCall().getReceiverUid() + .equalsIgnoreCase(loggedInUser.getUid())) + && CometChat.getActiveCall().getCallStatus(). + equals(CometChatConstants.CALL_STATUS_ONGOING) + && CometChat.getActiveCall().getSessionId() != null) { + + if (onGoingCallView != null) + onGoingCallView.setVisibility(View.VISIBLE); + if (onGoingCallTxt != null) { + onGoingCallTxt.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + onGoingCallView.setVisibility(View.GONE); + if (CometChat.getActiveCall() != null) + CallUtils.joinOnGoingCall(context, CometChat.getActiveCall()); + else { + Toast.makeText(context, getString(R.string.call_ended), Toast.LENGTH_LONG).show(); onGoingCallView.setVisibility(View.GONE); - if (CometChat.getActiveCall()!=null) - CallUtils.joinOnGoingCall(context,CometChat.getActiveCall()); - else { - Toast.makeText(context,getString(R.string.call_ended),Toast.LENGTH_LONG).show(); - onGoingCallView.setVisibility(View.GONE); - } - } - }); - } - if(onGoingCallClose!=null) { - onGoingCallClose.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - onGoingCallView.setVisibility(GONE); } - }); - } - } else if (CometChat.getActiveCall()!=null){ - if (onGoingCallView!=null) - onGoingCallView.setVisibility(GONE); - Log.e(TAG, "checkOnGoingCall: "+CometChat.getActiveCall().toString()); + } + }); + } + if (onGoingCallClose != null) { + onGoingCallClose.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + onGoingCallView.setVisibility(GONE); + } + }); } + } else if (CometChat.getActiveCall() != null) { + if (onGoingCallView != null) + onGoingCallView.setVisibility(GONE); + Log.e(TAG, "checkOnGoingCall: " + CometChat.getActiveCall().toString()); + } } private void setComposeBoxListener() { @@ -828,7 +833,7 @@ public void onSuccess(Boolean booleanVal) { Toast.makeText(getContext(), "Emoji Support is not enabled", Toast.LENGTH_LONG).show(); } - } else { + } else { if (isEdit) { editMessage(baseMessage, message); editMessageLayout.setVisibility(GONE); @@ -852,17 +857,21 @@ public void onVoiceNoteComplete(String string) { @Override public void onLocationActionClicked() { - if (Utils.hasPermissions(getContext(), Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION)) { + if (Utils.hasPermissions(getContext(), Manifest.permission.ACCESS_FINE_LOCATION, + Manifest.permission.ACCESS_COARSE_LOCATION)) { initLocation(); // locationManager = (LocationManager) Objects.requireNonNull(getContext()).getSystemService(Context.LOCATION_SERVICE); - boolean provider = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); - if (!provider) { + boolean gpsprovider = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); + if (!gpsprovider) { turnOnLocation(); } else { getLocation(); } } else { requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}, UIKitConstants.RequestCode.LOCATION); + if (Build.VERSION.SDK_INT == Build.VERSION_CODES.R) { + checkBackgroundLocationPermissionAPI30(UIKitConstants.RequestCode.LOCATION); + } } } @@ -880,9 +889,10 @@ public void OnResponseSuccess(Object var) { JSONObject stickersJSON = (JSONObject) var; stickersView.setData(Id, type, Extensions.extractStickersFromJSON(stickersJSON)); } + @Override public void OnResponseFailed(CometChatException e) { - CometChatSnackBar.show(context,stickersView, CometChatError.localized(e), CometChatSnackBar.ERROR); + CometChatSnackBar.show(context, stickersView, CometChatError.localized(e), CometChatSnackBar.ERROR); } }); } @@ -892,12 +902,12 @@ public void onWhiteboardClicked() { Extensions.callWhiteBoardExtension(Id, type, new ExtensionResponseListener() { @Override public void OnResponseSuccess(Object var) { - JSONObject jsonObject = (JSONObject)var; + JSONObject jsonObject = (JSONObject) var; } @Override public void OnResponseFailed(CometChatException e) { - CometChatSnackBar.show(context,rvChatListView, CometChatError.localized(e), CometChatSnackBar.ERROR); + CometChatSnackBar.show(context, rvChatListView, CometChatError.localized(e), CometChatSnackBar.ERROR); } }); } @@ -907,22 +917,44 @@ public void onWriteboardClicked() { Extensions.callWriteBoardExtension(Id, type, new ExtensionResponseListener() { @Override public void OnResponseSuccess(Object var) { - JSONObject jsonObject = (JSONObject)var; + JSONObject jsonObject = (JSONObject) var; } @Override public void OnResponseFailed(CometChatException e) { - CometChatSnackBar.show(context,rvChatListView, CometChatError.localized(e), CometChatSnackBar.ERROR); + CometChatSnackBar.show(context, rvChatListView, CometChatError.localized(e), CometChatSnackBar.ERROR); } }); } }); } + @TargetApi(30) + private void checkBackgroundLocationPermissionAPI30(int backgroundLocationRequestCode) { + if (Utils.hasPermissions(context, Manifest.permission.ACCESS_BACKGROUND_LOCATION)) + return; + AlertDialog alertDialog = new AlertDialog.Builder(context) + .setTitle(R.string.background_location_permission_title) + .setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + requestPermissions(new String[]{ + Manifest.permission.ACCESS_BACKGROUND_LOCATION} + , backgroundLocationRequestCode); + } + }) + .setNegativeButton(R.string.no, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + + } + }).create(); + alertDialog.show(); + } private void createPollDialog() { AlertDialog.Builder alertDialog = new AlertDialog.Builder(context, R.style.MyDialogTheme); - View view = LayoutInflater.from(context).inflate(R.layout.add_polls_layout,null); + View view = LayoutInflater.from(context).inflate(R.layout.add_polls_layout, null); alertDialog.setView(view); Dialog dialog = alertDialog.create(); optionsArrayList.clear(); @@ -934,12 +966,12 @@ 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 public void onClick(View v) { - View optionView = LayoutInflater.from(context).inflate(R.layout.polls_option,null); + View optionView = LayoutInflater.from(context).inflate(R.layout.polls_option, null); optionsArrayList.add(optionView); optionLayout.addView(optionView); optionView.findViewById(R.id.delete_option).setOnClickListener(new View.OnClickListener() { @@ -972,7 +1004,7 @@ else if (option2Text.getText().toString().trim().isEmpty()) JSONArray optionJson = new JSONArray(); optionJson.put(option1Text.getText().toString()); optionJson.put(option2Text.getText().toString()); - for(View views : optionsArrayList) { + for (View views : optionsArrayList) { EditText optionsText = views.findViewById(R.id.option_txt); if (!optionsText.getText().toString().trim().isEmpty()) optionJson.put(optionsText.getText().toString()); @@ -994,17 +1026,17 @@ public void onSuccess(JSONObject jsonObject) { public void onError(CometChatException e) { progressDialog.dismiss(); addPoll.setEnabled(true); - Log.e(TAG, "onErrorCallExtension: "+e.getMessage()); - if (view!=null) - CometChatSnackBar.show(context,view, - CometChatError.Extension.localized(e,"polls") + Log.e(TAG, "onErrorCallExtension: " + e.getMessage()); + if (view != null) + CometChatSnackBar.show(context, view, + CometChatError.Extension.localized(e, "polls") , CometChatSnackBar.ERROR); } }); } catch (Exception e) { addPoll.setEnabled(true); - Log.e(TAG, "onErrorJSON: "+e.getMessage()); - Toast.makeText(context,e.getMessage(),Toast.LENGTH_LONG).show(); + Log.e(TAG, "onErrorJSON: " + e.getMessage()); + Toast.makeText(context, e.getMessage(), Toast.LENGTH_LONG).show(); } } } @@ -1021,27 +1053,39 @@ public void onClick(View v) { private void getLocation() { fusedLocationProviderClient.getLastLocation().addOnSuccessListener(new OnSuccessListener() { - @Override - public void onSuccess(Location location) { - if (location != null) - { - double lon = location.getLongitude(); - double lat = location.getLatitude(); + @Override + public void onSuccess(Location location_) { + if (location_ != null) { + double lon = location_.getLongitude(); + double lat = location_.getLatitude(); + + JSONObject customData = new JSONObject(); + try { + customData.put("latitude", lat); + customData.put("longitude", lon); + } catch (JSONException e) { + e.printStackTrace(); + } - JSONObject customData = new JSONObject(); - try { - customData.put("latitude", lat); - customData.put("longitude", lon); - } catch (JSONException e) { - e.printStackTrace(); - } + initAlert(customData); + } else if(location!=null) { + double lon = location.getLongitude(); + double lat = location.getLatitude(); + + JSONObject customData = new JSONObject(); + try { + customData.put("latitude", lat); + customData.put("longitude", lon); + } catch (JSONException e) { + e.printStackTrace(); + } - initAlert(customData); - } else { - Toast.makeText(context,getString(R.string.unable_to_get_location),Toast.LENGTH_LONG).show(); + initAlert(customData); + } else { + Toast.makeText(context, getString(R.string.unable_to_get_location), Toast.LENGTH_LONG).show(); + } } - } - }); + }); } private void initAlert(JSONObject customData) { @@ -1116,6 +1160,7 @@ else if (customType.equalsIgnoreCase(UIKitConstants.IntentStrings.STICKERS)) public void onSuccess(CustomMessage customMessage) { Log.e(TAG, "onSuccessCustomMesage: "+customMessage.toString()); if (customType.equalsIgnoreCase(UIKitConstants.IntentStrings.GROUP_CALL)) { + rvSmartReply.setVisibility(GONE); if (CometChat.getActiveCall() == null) CallUtils.startDirectCall(context, Utils.getDirectCallData(customMessage)); } @@ -1157,7 +1202,9 @@ private void initLocation() { fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(getActivity()); locationListener = new LocationListener() { @Override - public void onLocationChanged(Location location) {} + public void onLocationChanged(Location l) { + location = l; + } @Override public void onStatusChanged(String provider, int status, Bundle extras) {} @Override @@ -1170,8 +1217,7 @@ public void onProviderDisabled(String provider) {} locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, MIN_TIME, MIN_DIST, locationListener); locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, MIN_TIME, MIN_DIST, locationListener); } - catch (Exception e) - { + catch (Exception e) { e.printStackTrace(); } } @@ -1585,6 +1631,7 @@ public void onSuccess(MediaMessage mediaMessage) { Log.d(TAG, "sendMediaMessage onSuccess: " + mediaMessage.toString()); if (messageAdapter != null) { messageAdapter.updateChangedMessage(mediaMessage); + rvSmartReply.setVisibility(GONE); } } @@ -1753,6 +1800,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); } @@ -2008,17 +2056,13 @@ public void onUserOffline(User user) { * @param baseMessage is object of BaseMessage.class. It is message which is been marked as read. */ private void markMessageAsRead(BaseMessage baseMessage) { - FeatureRestriction.isDeliveryReceiptsEnabled(new FeatureRestriction.OnSuccessListener() { - @Override - public void onSuccess(Boolean booleanVal) { // CometChat.markAsRead(baseMessage); //Used for v3 if (type.equals(CometChatConstants.RECEIVER_TYPE_USER)) - CometChat.markAsRead(baseMessage.getId(), baseMessage.getSender().getUid(), baseMessage.getReceiverType()); + CometChat.markAsRead(baseMessage.getId(), baseMessage.getSender().getUid(), + baseMessage.getReceiverType()); else - CometChat.markAsRead(baseMessage.getId(), baseMessage.getReceiverUid(), baseMessage.getReceiverType()); - } - }); - + CometChat.markAsRead(baseMessage.getId(), baseMessage.getReceiverUid(), + baseMessage.getReceiverType()); } @@ -2169,6 +2213,10 @@ private void setMessage(BaseMessage message) { messageList.add(message); initMessageAdapter(messageList); } + } else { + if (messageAdapter!=null) { + messageAdapter.updateReplyCount(message.getParentMessageId()); + } } } @@ -2220,7 +2268,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)); } }); } @@ -3269,16 +3317,29 @@ private void replyMessage() { replyMessage.setCompoundDrawablesWithIntrinsicBounds(0,0,0,0); replyMedia.setVisibility(View.VISIBLE); if (baseMessage.getType().equals(CometChatConstants.MESSAGE_TYPE_TEXT)) { - replyMessage.setText(((TextMessage) baseMessage).getText()); +// boolean isSentimentNegative = Extensions.checkSentiment(baseMessage); +// if (isSentimentNegative) { +// replyMessage.setBackgroundColor(getResources().getColor(R.color.red)); +// replyMessage.setText(getString(R.string.sentiment_content)); +// } +// else { +// replyMessage.setBackgroundColor(getResources().getColor(android.R.color.transparent)); + replyMessage.setText(((TextMessage) baseMessage).getText()); +// } replyMedia.setVisibility(GONE); } else if (baseMessage.getType().equals(CometChatConstants.MESSAGE_TYPE_IMAGE)) { replyMessage.setText(getResources().getString(R.string.shared_a_image)); - Glide.with(context).load(((MediaMessage) baseMessage).getAttachment().getFileUrl()).into(replyMedia); +// boolean isImageSafe = Extensions.getImageModeration(context,baseMessage); +// if (isImageSafe) + Glide.with(context).load(((MediaMessage) baseMessage).getAttachment().getFileUrl()).into(replyMedia); +// else { +// replyMedia.setImageResource(R.drawable.ic_privacy); +// } } else if (baseMessage.getType().equals(CometChatConstants.MESSAGE_TYPE_AUDIO)) { String messageStr = String.format(getResources().getString(R.string.shared_a_audio), Utils.getFileSize(((MediaMessage) baseMessage).getAttachment().getFileSize())); replyMessage.setText(messageStr); - replyMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_library_music_24dp, 0, 0, 0); + replyMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_audio, 0, 0, 0); } else if (baseMessage.getType().equals(CometChatConstants.MESSAGE_TYPE_VIDEO)) { replyMessage.setText(getResources().getString(R.string.shared_a_video)); Glide.with(context).load(((MediaMessage) baseMessage).getAttachment().getFileUrl()).into(replyMedia); @@ -3286,7 +3347,7 @@ private void replyMessage() { String messageStr = String.format(getResources().getString(R.string.shared_a_file), Utils.getFileSize(((MediaMessage) baseMessage).getAttachment().getFileSize())); replyMessage.setText(messageStr); - replyMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_insert_drive_file_black_24dp, 0, 0, 0); + replyMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_file_upload, 0, 0, 0); } else if (baseMessage.getType().equals(UIKitConstants.IntentStrings.LOCATION)) { try { JSONObject jsonObject = ((CustomMessage) baseMessage).getCustomData(); @@ -3314,12 +3375,15 @@ private void replyMessage() { } } else if (baseMessage.getType().equals(UIKitConstants.IntentStrings.WHITEBOARD)) { replyMessage.setText(getString(R.string.shared_a_whiteboard)); - replyMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_whiteboard_24dp, 0, 0, 0); + replyMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_collaborative_whiteboard, 0, 0, 0); } else if (baseMessage.getType().equals(UIKitConstants.IntentStrings.WRITEBOARD)) { replyMessage.setText(getString(R.string.shared_a_writeboard)); - replyMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_writeboard_24dp, 0, 0, 0); + replyMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_collaborative_document, 0, 0, 0); + } else if (baseMessage.getType().equals(UIKitConstants.IntentStrings.GROUP_CALL)) { + replyMessage.setText(getString(R.string.has_shared_group_call)); + replyMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_video_call_selected,0,0,0); } composeBox.ivMic.setVisibility(GONE); composeBox.ivSend.setVisibility(View.VISIBLE); @@ -3413,13 +3477,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/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/message_list/MessageAdapter.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/message_list/MessageAdapter.java index 0bbe485..5a2d89b 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/message_list/MessageAdapter.java +++ b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/message_list/MessageAdapter.java @@ -46,6 +46,7 @@ import com.cometchat.pro.models.Action; import com.cometchat.pro.models.Attachment; import com.cometchat.pro.models.CustomMessage; +import com.cometchat.pro.models.Group; import com.cometchat.pro.uikit.R; import com.cometchat.pro.uikit.ui_components.messages.extensions.Extensions; @@ -58,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; @@ -583,7 +585,7 @@ private void setPollsData(PollMessageViewHolder viewHolder, int i) { public void onSuccess(Boolean booleanVal) { if (baseMessage.getReplyCount()!=0 && booleanVal) { viewHolder.tvThreadReplyCount.setVisibility(View.VISIBLE); - viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+context.getResources().getString(R.string.replies)); + viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+" "+context.getResources().getString(R.string.replies)); } else { viewHolder.tvThreadReplyCount.setVisibility(View.GONE); } @@ -646,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); @@ -803,7 +805,7 @@ public void onClick(DialogInterface dialog, int which) { if (baseMessage.getReplyCount()!=0) { viewHolder.tvThreadReplyCount.setVisibility(View.VISIBLE); - viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+context.getResources().getString(R.string.replies)); + viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+" "+context.getResources().getString(R.string.replies)); } else { viewHolder.tvThreadReplyCount.setVisibility(View.GONE); } @@ -905,7 +907,7 @@ public void onClick(View v) { if (baseMessage.getReplyCount()!=0) { viewHolder.tvThreadReplyCount.setVisibility(View.VISIBLE); - viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+context.getResources().getString(R.string.replies)); + viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+" "+context.getResources().getString(R.string.replies)); } else { viewHolder.tvThreadReplyCount.setVisibility(View.GONE); } @@ -1010,7 +1012,7 @@ public void onClick(View v) { if (baseMessage.getReplyCount()!=0) { viewHolder.tvThreadReplyCount.setVisibility(View.VISIBLE); - viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+context.getResources().getString(R.string.replies)); + viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+" "+context.getResources().getString(R.string.replies)); } else { viewHolder.tvThreadReplyCount.setVisibility(View.GONE); } @@ -1108,7 +1110,7 @@ private void setLocationData(LocationMessageViewHolder viewHolder, int i) { public void onSuccess(Boolean booleanVal) { if (baseMessage.getReplyCount()!=0 && booleanVal) { viewHolder.tvThreadReplyCount.setVisibility(View.VISIBLE); - viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+context.getResources().getString(R.string.replies)); + viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+" "+context.getResources().getString(R.string.replies)); } else { viewHolder.tvThreadReplyCount.setVisibility(View.GONE); } @@ -1252,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() { @@ -1260,7 +1262,7 @@ private void setAudioData(AudioMessageViewHolder viewHolder, int i) { public void onSuccess(Boolean booleanVal) { if (baseMessage.getReplyCount()!=0 && booleanVal) { viewHolder.tvThreadReplyCount.setVisibility(View.VISIBLE); - viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+context.getResources().getString(R.string.replies)); + viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+" "+context.getResources().getString(R.string.replies)); } else { viewHolder.tvThreadReplyCount.setVisibility(View.GONE); } @@ -1393,7 +1395,7 @@ private void setFileData(FileMessageViewHolder viewHolder, int i) { public void onSuccess(Boolean booleanVal) { if (baseMessage.getReplyCount()!=0 && booleanVal) { viewHolder.tvThreadReplyCount.setVisibility(View.VISIBLE); - viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+context.getResources().getString(R.string.replies)); + viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+" "+context.getResources().getString(R.string.replies)); } else { viewHolder.tvThreadReplyCount.setVisibility(View.GONE); } @@ -1528,7 +1530,7 @@ private void setImageData(ImageMessageViewHolder viewHolder, int i) { public void onSuccess(Boolean booleanVal) { if (baseMessage.getReplyCount()!=0 && booleanVal) { viewHolder.tvThreadReplyCount.setVisibility(View.VISIBLE); - viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+context.getResources().getString(R.string.replies)); + viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+" "+context.getResources().getString(R.string.replies)); } else { viewHolder.tvThreadReplyCount.setVisibility(View.GONE); } @@ -1707,7 +1709,7 @@ private void setStickerData(StickerMessageViewHolder viewHolder, int i) { public void onSuccess(Boolean booleanVal) { if (baseMessage.getReplyCount()!=0 && booleanVal) { viewHolder.tvThreadReplyCount.setVisibility(View.VISIBLE); - viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+context.getResources().getString(R.string.replies)); + viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+" "+context.getResources().getString(R.string.replies)); } else { viewHolder.tvThreadReplyCount.setVisibility(View.GONE); } @@ -1802,7 +1804,7 @@ private void setVideoData(VideoMessageViewHolder viewHolder, int i) { public void onSuccess(Boolean booleanVal) { if (baseMessage.getReplyCount()!=0 && booleanVal) { viewHolder.tvThreadReplyCount.setVisibility(View.VISIBLE); - viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+context.getResources().getString(R.string.replies)); + viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+" "+context.getResources().getString(R.string.replies)); } else { viewHolder.tvThreadReplyCount.setVisibility(View.GONE); } @@ -2078,15 +2080,15 @@ public void onSuccess(Boolean booleanVal) { progressBar.setVisibility(View.GONE); if (baseMessage.getReadAt() != 0) { txtTime.setText(Utils.getHeaderDate(baseMessage.getReadAt() * 1000)); - txtTime.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_double_tick, 0); + txtTime.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_message_read, 0); txtTime.setCompoundDrawablePadding(10); } else if (baseMessage.getDeliveredAt() != 0) { txtTime.setText(Utils.getHeaderDate(baseMessage.getDeliveredAt() * 1000)); - txtTime.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_done_all_black_24dp, 0); + txtTime.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_message_delivered, 0); txtTime.setCompoundDrawablePadding(10); } else if (baseMessage.getSentAt()>0){ txtTime.setText(Utils.getHeaderDate(baseMessage.getSentAt() * 1000)); - txtTime.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_check_black_24dp, 0); + txtTime.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_message_sent, 0); txtTime.setCompoundDrawablePadding(10); } else if (baseMessage.getSentAt()==-1) { txtTime.setText(""); @@ -2181,10 +2183,21 @@ public void onClick(DialogInterface dialog, int which) { String messageType = replyMessage.getType(); viewHolder.replyLayout.setVisibility(View.VISIBLE); viewHolder.replyUser.setVisibility(View.VISIBLE); - viewHolder.replyUser.setText(replyMessage.getSender().getName()); + if (replyMessage.getReceiverType().equals(CometChatConstants.RECEIVER_TYPE_USER)) + viewHolder.replyUser.setText(replyMessage.getSender().getName()); + else + viewHolder.replyUser.setText(replyMessage.getSender().getName()+ + " ~ "+((Group)replyMessage.getReceiver()).getName()); if (messageType.equals(CometChatConstants.MESSAGE_TYPE_TEXT)) { - viewHolder.replyMessageImage.setVisibility(View.GONE); - viewHolder.replyMessage.setText(((TextMessage)replyMessage).getText()); + String message = ((TextMessage)replyMessage).getText(); + if(CometChat.isExtensionEnabled("profanity-filter")) { + message = Extensions.checkProfanityMessage(context,replyMessage); + } + if(CometChat.isExtensionEnabled("data-masking")) { + message = Extensions.checkDataMasking(context,replyMessage); + } + viewHolder.replyMessageImage.setVisibility(View.GONE); + viewHolder.replyMessage.setText(message); } else if (messageType.equals(CometChatConstants.MESSAGE_TYPE_IMAGE)) { viewHolder.replyMessage.setText(context.getResources().getString(R.string.message_image)); viewHolder.replyMessageImage.setVisibility(View.GONE); @@ -2243,7 +2256,7 @@ public boolean onLongClick(View view) { public void onSuccess(Boolean booleanVal) { if (baseMessage.getReplyCount()!=0 && booleanVal) { viewHolder.tvThreadReplyCount.setVisibility(View.VISIBLE); - viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+context.getResources().getString(R.string.replies)); + viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+" "+context.getResources().getString(R.string.replies)); } else { viewHolder.tvThreadReplyCount.setVisibility(View.GONE); } @@ -2400,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() { @@ -2498,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 { @@ -2593,7 +2606,7 @@ private void setLinkData(LinkMessageViewHolder viewHolder, int i) { public void onSuccess(Boolean booleanVal) { if (baseMessage.getReplyCount()!=0 && booleanVal) { viewHolder.tvThreadReplyCount.setVisibility(View.VISIBLE); - viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+context.getResources().getString(R.string.replies)); + viewHolder.tvThreadReplyCount.setText(baseMessage.getReplyCount()+" "+context.getResources().getString(R.string.replies)); } else { viewHolder.tvThreadReplyCount.setVisibility(View.GONE); } @@ -2719,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); @@ -3003,6 +3016,16 @@ public int getPosition(BaseMessage baseMessage){ return messageList.indexOf(baseMessage); } + public void updateReplyCount(int parentMessageId) { + for(BaseMessage baseMessage : messageList) { + if (baseMessage.getId()==parentMessageId) { + int replyCount = baseMessage.getReplyCount(); + baseMessage.setReplyCount(++replyCount); + notifyItemChanged(messageList.indexOf(baseMessage)); + } + } + } + class ImageMessageViewHolder extends RecyclerView.ViewHolder { private ImageView imageView; diff --git a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/CometChatThreadMessageList.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/CometChatThreadMessageList.java index 63fb1d0..8fdb819 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/CometChatThreadMessageList.java +++ b/Firebase/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() { @@ -1118,7 +1119,17 @@ public void onRequestPermissionsResult(int requestCode, @NonNull String[] permis showPermissionSnackBar(view.findViewById(R.id.message_box), getResources().getString(R.string.grant_storage_permission)); break; case UIKitConstants.RequestCode.LOCATION: - if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { } + if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { + initLocation(); +// locationManager = (LocationManager) Objects.requireNonNull(getContext()).getSystemService(Context.LOCATION_SERVICE); + boolean provider = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); + if (!provider) { + turnOnLocation(); + } + else { + getLocation(); + } + } else showPermissionSnackBar(view.findViewById(R.id.message_box), getResources().getString(R.string.grant_location_permission)); break; @@ -2696,7 +2707,7 @@ private void replyMessage() { String messageStr = String.format(getResources().getString(R.string.shared_a_audio), Utils.getFileSize(((MediaMessage) baseMessage).getAttachment().getFileSize())); replyMessage.setText(messageStr); - replyMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_library_music_24dp, 0, 0, 0); + replyMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_audio, 0, 0, 0); } else if (baseMessage.getType().equals(CometChatConstants.MESSAGE_TYPE_VIDEO)) { replyMessage.setText(getResources().getString(R.string.shared_a_video)); Glide.with(context).load(((MediaMessage) baseMessage).getAttachment().getFileUrl()).into(replyMedia); @@ -2704,7 +2715,7 @@ private void replyMessage() { String messageStr = String.format(getResources().getString(R.string.shared_a_file), Utils.getFileSize(((MediaMessage) baseMessage).getAttachment().getFileSize())); replyMessage.setText(messageStr); - replyMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_insert_drive_file_black_24dp, 0, 0, 0); + replyMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_file_upload, 0, 0, 0); } composeBox.ivSend.setVisibility(View.VISIBLE); replyMessageLayout.setVisibility(View.VISIBLE); diff --git a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/CometChatThreadMessageListActivity.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/CometChatThreadMessageListActivity.java index 4867c44..05bf3b0 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/CometChatThreadMessageListActivity.java +++ b/Firebase/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/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/ThreadAdapter.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/ThreadAdapter.java index 6a5dede..32578e9 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/ThreadAdapter.java +++ b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/messages/thread_message_list/ThreadAdapter.java @@ -51,7 +51,9 @@ 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; import com.google.android.material.chip.ChipGroup; @@ -789,15 +791,15 @@ private void setStatusIcon(ProgressBar progressBar,TextView txtTime, BaseMessage progressBar.setVisibility(View.GONE); if (baseMessage.getReadAt() != 0) { txtTime.setText(Utils.getHeaderDate(baseMessage.getReadAt() * 1000)); - txtTime.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_double_tick, 0); + txtTime.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_message_read, 0); txtTime.setCompoundDrawablePadding(10); } else if (baseMessage.getDeliveredAt() != 0) { txtTime.setText(Utils.getHeaderDate(baseMessage.getDeliveredAt() * 1000)); - txtTime.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_done_all_black_24dp, 0); + txtTime.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_message_delivered, 0); txtTime.setCompoundDrawablePadding(10); } else if (baseMessage.getSentAt()>0){ txtTime.setText(Utils.getHeaderDate(baseMessage.getSentAt() * 1000)); - txtTime.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_check_black_24dp, 0); + txtTime.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_message_sent, 0); txtTime.setCompoundDrawablePadding(10); } else if (baseMessage.getSentAt()==-1) { txtTime.setText(""); @@ -990,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() { @@ -1169,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); @@ -1485,7 +1487,7 @@ public class TextMessageViewHolder extends RecyclerView.ViewHolder { private int type; private CometChatAvatar ivUser; private RelativeLayout rlMessageBubble; - private RelativeLayout replyLayout; + private MaterialCardView replyLayout; private TextView replyUser; private TextView replyMessage; private RelativeLayout sentimentVw; diff --git a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/CometChatSnackBar.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/CometChatSnackBar.java index 1e2506d..62f01b3 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/CometChatSnackBar.java +++ b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/CometChatSnackBar.java @@ -37,7 +37,7 @@ private static void customSnackBar(Context context,View parentLayout,String mess ImageView closeImage = dialogView.findViewById(R.id.iv_close); ImageView iconImage = dialogView.findViewById(R.id.iv_icon); if (type.equalsIgnoreCase(ERROR)) { - iconImage.setImageResource(R.drawable.ic_baseline_error_24); + iconImage.setImageResource(R.drawable.ic_error); iconImage.setImageTintList(ColorStateList.valueOf(context.getResources().getColor(R.color.textColorWhite))); closeImage.setImageTintList(ColorStateList.valueOf(context.getResources().getColor(R.color.textColorWhite))); messageTv.setTextColor(ColorStateList.valueOf(context.getResources().getColor(R.color.textColorWhite))); @@ -51,7 +51,7 @@ private static void customSnackBar(Context context,View parentLayout,String mess dialogView.setBackgroundColor(context.getResources().getColor(R.color.colorPrimary)); } else if (type.equalsIgnoreCase(WARNING)) { snackbar.setDuration(Snackbar.LENGTH_LONG); - iconImage.setImageResource(R.drawable.ic_warning_image); + iconImage.setImageResource(R.drawable.ic_report); iconImage.setImageTintList(ColorStateList.valueOf(context.getResources().getColor(R.color.textColorWhite))); closeImage.setImageTintList(ColorStateList.valueOf(context.getResources().getColor(R.color.textColorWhite))); messageTv.setTextColor(ColorStateList.valueOf(context.getResources().getColor(R.color.textColorWhite))); diff --git a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatAvatar/CometChatAvatar.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatAvatar/CometChatAvatar.java index c43af79..5801242 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatAvatar/CometChatAvatar.java +++ b/Firebase/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/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatBadgeCount/CometChatBadgeCount.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatBadgeCount/CometChatBadgeCount.java index 149faf5..be0940d 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatBadgeCount/CometChatBadgeCount.java +++ b/Firebase/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/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatCalls/CometChatCallsAdapter.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatCalls/CometChatCallsAdapter.java index ebedb86..af72a2f 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatCalls/CometChatCallsAdapter.java +++ b/Firebase/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 @@ -173,18 +174,22 @@ public void onBindViewHolder(@NonNull CallViewHolder callViewHolder, int positio } if (isVideo) { - callViewHolder.callListRowBinding.callMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_videocam_24dp,0,0,0); + if(isIncoming) { + callViewHolder.callListRowBinding.callMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_incoming_video_call,0,0,0); + } else { + callViewHolder.callListRowBinding.callMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_outgoing_video_call,0,0,0); + } } else { if (isIncoming && isMissed) { callViewHolder.callListRowBinding.callMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_call_missed_incoming_24dp,0,0,0); } else if(isIncoming && !isMissed) { - callViewHolder.callListRowBinding.callMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_call_incoming_24dp,0,0,0); + callViewHolder.callListRowBinding.callMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_incoming_call,0,0,0); } else if (!isIncoming && isMissed) { callViewHolder.callListRowBinding.callMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_call_missed_outgoing_24dp,0,0,0); } else { - callViewHolder.callListRowBinding.callMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_call_outgoing_24dp,0,0,0); + callViewHolder.callListRowBinding.callMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_outgoing_call,0,0,0); } } callViewHolder.callListRowBinding.calltimeTv.setText(Utils.getLastMessageDate(context,call.getInitiatedAt())); @@ -199,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/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatComposeBox/CometChatComposeBox.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatComposeBox/CometChatComposeBox.java index a72c03c..eba8886 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatComposeBox/CometChatComposeBox.java +++ b/Firebase/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 { @@ -66,7 +67,7 @@ public class CometChatComposeBox extends RelativeLayout implements View.OnClickL private boolean isOpen,isRecording,isPlaying,voiceMessage; - public ImageView ivAudio,ivCamera,ivGallery, ivFile,ivSend,ivArrow,ivMic,ivDelete; + public ImageView ivSend,ivArrow,ivMic,ivDelete; private SeekBar voiceSeekbar; @@ -151,29 +152,17 @@ public void onAudioFocusChange(int focusChange) { voiceMessageLayout=this.findViewById(R.id.voiceMessageLayout); recordTime=this.findViewById(R.id.record_time); voiceSeekbar=this.findViewById(R.id.voice_message_seekbar); - ivCamera=this.findViewById(R.id.ivCamera); - ivGallery=this.findViewById(R.id.ivImage); - ivAudio = this.findViewById(R.id.ivAudio); - ivFile =this.findViewById(R.id.ivFile); - ivSend=this.findViewById(R.id.ivSend); ivArrow=this.findViewById(R.id.ivArrow); etComposeBox=this.findViewById(R.id.etComposeBox); - rlActionContainer=this.findViewById(R.id.rlActionContainers); + ivSend=this.findViewById(R.id.ivSend); ivArrow.setImageTintList(ColorStateList.valueOf(color)); - ivCamera.setImageTintList(ColorStateList.valueOf(color)); - ivGallery.setImageTintList(ColorStateList.valueOf(color)); - ivFile.setImageTintList(ColorStateList.valueOf(color)); ivSend.setImageTintList(ColorStateList.valueOf(color)); - ivAudio.setOnClickListener(this); ivArrow.setOnClickListener(this); ivSend.setOnClickListener(this); ivDelete.setOnClickListener(this); - ivFile.setOnClickListener(this); ivMic.setOnClickListener(this); - ivGallery.setOnClickListener(this); - ivCamera.setOnClickListener(this); composeBoxActionFragment = new CometChatComposeBoxActions(); @@ -257,28 +246,21 @@ public void OnMediaSelected(InputContentInfoCompat i) { if (Utils.isDarkMode(context)) { composeBox.setBackgroundColor(getResources().getColor(R.color.darkModeBackground)); - ivAudio.setImageTintList(ColorStateList.valueOf(getResources().getColor(R.color.textColorWhite))); - ivMic.setImageDrawable(getResources().getDrawable(R.drawable.ic_mic_white_24dp)); + ivMic.setImageDrawable(getResources().getDrawable(R.drawable.ic_microphone_white_selected)); flBox.setBackgroundTintList(ColorStateList.valueOf(getResources().getColor(R.color.textColorWhite))); etComposeBox.setTextColor(getResources().getColor(R.color.textColorWhite)); ivArrow.setImageTintList(ColorStateList.valueOf(getResources().getColor(R.color.textColorWhite))); ivSend.setImageTintList(ColorStateList.valueOf(getResources().getColor(R.color.textColorWhite))); - ivCamera.setImageTintList(ColorStateList.valueOf(getResources().getColor(R.color.textColorWhite))); - ivGallery.setImageTintList(ColorStateList.valueOf(getResources().getColor(R.color.textColorWhite))); - ivFile.setImageTintList(ColorStateList.valueOf(getResources().getColor(R.color.textColorWhite))); } else { composeBox.setBackgroundColor(getResources().getColor(R.color.textColorWhite)); - ivAudio.setImageTintList(ColorStateList.valueOf(getResources().getColor(R.color.colorPrimary))); - ivMic.setImageDrawable(getResources().getDrawable(R.drawable.ic_mic_grey_24dp)); + ivMic.setImageDrawable(getResources().getDrawable(R.drawable.ic_microphone_grey_selected)); etComposeBox.setTextColor(getResources().getColor(R.color.primaryTextColor)); ivSend.setImageTintList(ColorStateList.valueOf(getResources().getColor(R.color.colorPrimary))); flBox.setBackgroundTintList(ColorStateList.valueOf(getResources().getColor(R.color.grey))); ivArrow.setImageTintList(ColorStateList.valueOf(getResources().getColor(R.color.grey))); - ivCamera.setImageTintList(ColorStateList.valueOf(getResources().getColor(R.color.colorPrimary))); - ivFile.setImageTintList(ColorStateList.valueOf(getResources().getColor(R.color.colorPrimary))); } - 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(); @@ -362,18 +344,10 @@ public void setColor(int color) { ivSend.setImageTintList(ColorStateList.valueOf(color)); - ivCamera.setImageTintList(ColorStateList.valueOf(color)); - ivGallery.setImageTintList(ColorStateList.valueOf(color)); - ivFile.setImageTintList(ColorStateList.valueOf(color)); - ivArrow.setImageTintList(ColorStateList.valueOf(color)); } public void setComposeBoxListener(ComposeActionListener composeActionListener){ this.composeActionListener=composeActionListener; - - this.composeActionListener.getCameraActionView(ivCamera); - this.composeActionListener.getGalleryActionView(ivGallery); - this.composeActionListener.getFileActionView(ivFile); } @Override @@ -385,19 +359,13 @@ public void onClick(View view) { etComposeBox.setVisibility(View.VISIBLE); ivArrow.setVisibility(View.VISIBLE); ivMic.setVisibility(View.VISIBLE); - ivMic.setImageDrawable(getResources().getDrawable(R.drawable.ic_mic_grey_24dp)); + ivMic.setImageDrawable(getResources().getDrawable(R.drawable.ic_microphone_grey_selected)); isPlaying = false; isRecording = false; voiceMessage = false; ivDelete.setVisibility(GONE); ivSend.setVisibility(View.GONE); } - if (view.getId()==R.id.ivCamera){ -// composeActionListener.onCameraActionClicked(ivCamera); - } - if (view.getId()==R.id.ivImage){ -// composeActionListener.onGalleryActionClicked(ivGallery); - } if (view.getId()==R.id.ivSend){ if (!voiceMessage) { composeActionListener.onSendActionClicked(etComposeBox); @@ -413,15 +381,9 @@ public void onClick(View view) { isRecording = false; isPlaying = false; voiceMessage = false; - ivMic.setImageResource(R.drawable.ic_mic_grey_24dp); + ivMic.setImageResource(R.drawable.ic_microphone_grey_selected); } - } - if(view.getId()==R.id.ivAudio) { -// composeActionListener.onAudioActionClicked(ivAudio); - } - if (view.getId()==R.id.ivFile){ -// composeActionListener.onFileActionClicked(ivFile); } if(view.getId()==R.id.ivArrow) { // if (isOpen) { diff --git a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatConversations/CometChatConversations.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatConversations/CometChatConversations.java index c5d4d21..92bac8a 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatConversations/CometChatConversations.java +++ b/Firebase/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/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatConversations/CometChatConversationsAdapter.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatConversations/CometChatConversationsAdapter.java index e5d1ebb..d529ede 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_components/shared/cometchatConversations/CometChatConversationsAdapter.java +++ b/Firebase/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 userList = new ArrayList<>(); + private SwipeRefreshLayout swipeRefreshLayout; + public CometChatUserList() { // Required empty public constructor } @@ -123,6 +127,15 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, clearSearch = view.findViewById(R.id.clear_search); rlSearchBox=view.findViewById(R.id.rl_search_box); + swipeRefreshLayout = view.findViewById(R.id.swipe_refresh); + swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { + @Override + public void onRefresh() { + usersRequest= null; + rvUserList.clear(); + fetchUsers(); + } + }); CometChatError.init(getContext()); shimmerFrameLayout=view.findViewById(R.id.shimmer_layout); @@ -142,6 +155,7 @@ public void onSuccess(Boolean booleanVal) { } }); + isTitleVisible(); etSearch.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { } @@ -176,6 +190,8 @@ public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) { } }); + + clearSearch.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { @@ -213,13 +229,27 @@ public void OnItemClick(User user, int position) { return view; } + private void isTitleVisible() { + if (getArguments()!=null) { + boolean isVisible = getArguments().getBoolean(UIKitConstants.IntentStrings.IS_TITLE_VISIBLE,true); + if (isVisible) + title.setVisibility(View.VISIBLE); + else + title.setVisibility(View.GONE); + } + } + private void stopHideShimmer() { shimmerFrameLayout.stopShimmer(); shimmerFrameLayout.setVisibility(View.GONE); - title.setVisibility(View.VISIBLE); rlSearchBox.setVisibility(View.VISIBLE); } + public void setTitleVisible(boolean isVisible) { + Bundle bundle = new Bundle(); + bundle.putBoolean(UIKitConstants.IntentStrings.IS_TITLE_VISIBLE,isVisible); + setArguments(bundle); + } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { @@ -250,6 +280,8 @@ public void onSuccess(List users) { userList.addAll(users); stopHideShimmer(); rvUserList.setUserList(users); // set the users to rvUserList i.e CometChatUserList Component. + if (swipeRefreshLayout.isRefreshing()) + swipeRefreshLayout.setRefreshing(false); if (userList.size()==0) { noUserLayout.setVisibility(View.VISIBLE); diff --git a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/constants/UIKitConstants.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/constants/UIKitConstants.java index 4b67e44..94ecf32 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/constants/UIKitConstants.java +++ b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/constants/UIKitConstants.java @@ -131,8 +131,15 @@ public static class IntentStrings { public static final String INTENT_MEDIA_VIDEO_MESSAGE = "intent_media_video_message"; + public static final String INTENT_MEDIA_AUDIO_MESSAGE = "intent_media_audio_message"; + + public static final String INTENT_MEDIA_FILE_MESSAGE = "intent_media_file_message"; public static final String LINK = "link"; + public static final String IS_TITLE_VISIBLE = "IS_TITLE_VISIBLE"; + public static final String CREATE_GROUP_VISIBLE = "IS_CREATE_GROUP_VISIBLE"; + public static final String CALL_TYPE = "CALL_TYPE"; + public static String POLL_QUESTION = "poll_question"; public static String POLL_OPTION = "poll_option"; diff --git a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/utils/EncryptionUtils.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/utils/EncryptionUtils.java new file mode 100644 index 0000000..5dd74c9 --- /dev/null +++ b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/utils/EncryptionUtils.java @@ -0,0 +1,97 @@ +package com.cometchat.pro.uikit.ui_resources.utils; + +import java.math.BigInteger; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.security.SecureRandom; + +import javax.crypto.Cipher; +import javax.crypto.SecretKey; +import javax.crypto.spec.GCMParameterSpec; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; + +public class EncryptionUtils { + + private static final String ENCRYPT_ALGO = "AES/CBC/PKCS5Padding"; + private static final int TAG_LENGTH_BIT = 128; + private static final int IV_LENGTH_BYTE = 16; + + private static final Charset UTF_8 = StandardCharsets.UTF_8; + + // hex representation + public static String hex(byte[] bytes) { + StringBuilder result = new StringBuilder(); + for (byte b : bytes) { + result.append(String.format("%02x", b)); + } + return result.toString(); + } + + public static byte[] toByteArray(String hexString) { + byte[] byteArray = new BigInteger(hexString, 16) + .toByteArray(); + if (byteArray[0] == 0) { + byte[] output = new byte[byteArray.length - 1]; + System.arraycopy( + byteArray, 1, output, + 0, output.length); + return output; + } + return byteArray; + } + // AES-GCM needs GCMParameterSpec + public static byte[] encrypt(byte[] pText, SecretKeySpec secret, byte[] iv) throws Exception { + + Cipher cipher = Cipher.getInstance(ENCRYPT_ALGO); + cipher.init(Cipher.ENCRYPT_MODE, secret, new IvParameterSpec(iv)); + byte[] encryptedText = cipher.doFinal(pText); + return encryptedText; + + } + + // prefix IV length + IV bytes to cipher text + public static byte[] encryptWithPrefixIV(byte[] pText, SecretKeySpec secret, byte[] iv) throws Exception { + + byte[] cipherText = encrypt(pText, secret, iv); + + byte[] cipherTextWithIv = ByteBuffer.allocate(iv.length + cipherText.length) + .put(iv) + .put(cipherText) + .array(); + return cipherTextWithIv; + + } + + public static String decrypt(byte[] cText, SecretKey secret, byte[] iv) throws Exception { + + Cipher cipher = Cipher.getInstance(ENCRYPT_ALGO); + cipher.init(Cipher.DECRYPT_MODE, secret, new IvParameterSpec(iv)); + byte[] plainText = cipher.doFinal(cText); + return new String(plainText, UTF_8); + + } + + public static byte[] getRandomNonce(int numBytes) { + byte[] nonce = new byte[numBytes]; + new SecureRandom().nextBytes(nonce); + return nonce; + } + + public static String decryptWithPrefixIV(byte[] cText, SecretKey secret) throws Exception { + + ByteBuffer bb = ByteBuffer.wrap(cText); + + byte[] iv = new byte[IV_LENGTH_BYTE]; + bb.get(iv); + //bb.get(iv, 0, iv.length); + + byte[] cipherText = new byte[bb.remaining()]; + bb.get(cipherText); + + String plainText = decrypt(cipherText, secret, iv); + return plainText; + + } +} diff --git a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/utils/MediaUtils.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/utils/MediaUtils.java index 7403332..87bddd0 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/utils/MediaUtils.java +++ b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/utils/MediaUtils.java @@ -1,6 +1,5 @@ package com.cometchat.pro.uikit.ui_resources.utils; -import android.annotation.SuppressLint; import android.app.Activity; import android.app.ProgressDialog; import android.content.ComponentName; @@ -33,7 +32,6 @@ import android.widget.Toast; import androidx.core.content.FileProvider; -import androidx.loader.content.CursorLoader; import com.cometchat.pro.models.BaseMessage; import com.cometchat.pro.models.MediaMessage; @@ -41,7 +39,6 @@ import com.cometchat.pro.uikit.R; import com.cometchat.pro.uikit.ui_settings.FeatureRestriction; -import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.ByteArrayOutputStream; import java.io.File; @@ -161,7 +158,7 @@ public static Intent openCamera(Context context) { e.printStackTrace(); } - outputFileUri = FileProvider.getUriForFile(context, provider + ".provider", file); + outputFileUri = FileProvider.getUriForFile(context, provider + ".provider", file); if (Build.VERSION.SDK_INT >= 29) { ContentResolver resolver = context.getContentResolver(); @@ -310,14 +307,21 @@ private static File createFileFromBitmap(Bitmap bitmap) { return f; } + public static File makeEmptyFileWithTitle(String title) { + String root; + if (Build.VERSION.SDK_INT < 29) { + root = Environment.getExternalStorageDirectory().getAbsolutePath(); + } else { + root = Environment.DIRECTORY_DOWNLOADS; + } + return new File(root, title); + } + public static File getRealPath(Context context, Uri fileUri,boolean isThirdParty) { Log.d("", "getRealPath: " + fileUri.getPath()); String realPath; - if (isGoogleDrive(fileUri)) { - return saveDriveFile(context, fileUri); - } - else if (isThirdParty) { - return downloadImage(context, fileUri); + if (isGoogleDrive(fileUri) || isThirdParty) { + return downloadFile(context, fileUri); } // SDK > 19 (Android 4.4) and up else if (Build.VERSION.SDK_INT < 28){ @@ -330,12 +334,12 @@ else if (Build.VERSION.SDK_INT < 28){ return new File(realPath); } - public static File downloadImage(Context context, Uri imageUri) { + public static File downloadFile(Context context, Uri imageUri) { // Uri imageUri = (Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM); File file = null; try { if (imageUri != null) { - file = new File(context.getCacheDir(), "image"); + file = new File(context.getCacheDir(), getFileName(context,imageUri)); InputStream inputStream = context.getContentResolver().openInputStream(imageUri); try { @@ -402,43 +406,38 @@ private static String getFilePathForN(Uri uri, Context context) { return file.getPath(); } - public static File saveDriveFile(Context context, Uri uri) { - - try { - - InputStream inputStream = context.getContentResolver().openInputStream(uri); - int originalSize = inputStream.available(); - - BufferedInputStream bis = null; - BufferedOutputStream bos = null; - String fileName = getFileName(context, uri); - File file = makeEmptyFileWithTitle(fileName); - bis = new BufferedInputStream(inputStream); - bos = new BufferedOutputStream(new FileOutputStream( - file, false)); - - byte[] buf = new byte[originalSize]; - bis.read(buf); - do { - bos.write(buf); - } while (bis.read(buf) != -1); - - bos.flush(); - bos.close(); - bis.close(); - - return file; - - } catch (IOException e) { - return null; - } - - } - - public static File makeEmptyFileWithTitle(String title) { - String root = Environment.getExternalStorageDirectory().getAbsolutePath(); - return new File(root, title); - } +// public static File saveDriveFile(Context context, Uri uri) { +// +// try { +// +// InputStream inputStream = context.getContentResolver().openInputStream(uri); +// int originalSize = inputStream.available(); +// +// BufferedInputStream bis = null; +// BufferedOutputStream bos = null; +// String fileName = getFileName(context, uri); +// File file = makeEmptyFileWithTitle(fileName); +// bis = new BufferedInputStream(inputStream); +// bos = new BufferedOutputStream(new FileOutputStream( +// file, false)); +// +// byte[] buf = new byte[originalSize]; +// bis.read(buf); +// do { +// bos.write(buf); +// } while (bis.read(buf) != -1); +// +// bos.flush(); +// bos.close(); +// bis.close(); +// +// return file; +// +// } catch (IOException e) { +// return null; +// } +// +// } /** @@ -470,15 +469,15 @@ private static String getRealPathFromURI(final Context context, final Uri uri) { // DownloadsProvider else if (isDownloadsDocument(uri)) { - String id = DocumentsContract.getDocumentId(uri); + String id = DocumentsContract.getDocumentId(uri); if (id != null){ - if(id.startsWith("raw:")) { - return id.substring(4); - } - if (id.startsWith("msf:")){ - id=id.substring(4); - } + if(id.startsWith("raw:")) { + return id.substring(4); + } + if (id.startsWith("msf:")){ + id=id.substring(4); + } } String[] contentUriPrefixesToTry = new String[]{ diff --git a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/utils/Utils.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/utils/Utils.java index b04a785..f2f6d98 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/utils/Utils.java +++ b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_resources/utils/Utils.java @@ -11,7 +11,10 @@ import android.database.Cursor; import android.graphics.Bitmap; import android.graphics.BitmapFactory; +import android.graphics.Canvas; import android.graphics.Color; +import android.graphics.drawable.BitmapDrawable; +import android.graphics.drawable.Drawable; import android.location.Address; import android.location.Geocoder; import android.media.AudioManager; @@ -77,6 +80,8 @@ import kotlin.ranges.RangesKt; +import static android.os.Environment.DIRECTORY_DOCUMENTS; + public class Utils { private static final String TAG = "Utils"; @@ -657,10 +662,18 @@ public static String getOutputMediaFile(Context context) { if (!var0.exists() && !var0.mkdirs()) { return null; } else { - String var1 = Environment.getExternalStorageDirectory() + "/" + context.getResources().getString(R.string.app_name) + "/" - + "audio/"; - createDirectory(var1); - return var1 + (new SimpleDateFormat("yyyyMMddHHmmss")).format(new Date()) + ".mp3"; + String dir; + if (Build.VERSION_CODES.R > Build.VERSION.SDK_INT) { + dir = Environment.getExternalStorageDirectory()+"/"+context.getResources().getString(R.string.app_name) + "/" + + "audio/"; + } else { + dir = Environment.getExternalStoragePublicDirectory(DIRECTORY_DOCUMENTS).getPath()+"/"+context.getResources().getString(R.string.app_name) + "/" + + "audio/"; + } +// String var1 = Environment.getExternalStorageDirectory() + "/" + context.getResources().getString(R.string.app_name) + "/" +// + "audio/"; + createDirectory(dir); + return dir + (new SimpleDateFormat("yyyyMMddHHmmss")).format(new Date()) + ".mp3"; } } @@ -709,6 +722,19 @@ public static Bitmap getBitmapFromURL(String strURL) { } } + public static Bitmap drawableToBitmap (Drawable drawable) { + + if (drawable instanceof BitmapDrawable) { + return ((BitmapDrawable)drawable).getBitmap(); + } + + Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888); + Canvas canvas = new Canvas(bitmap); + drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight()); + drawable.draw(canvas); + + return bitmap; + } public static String getAddress(Context context, double latitude, double longitude) { Geocoder geocoder = new Geocoder(context, Locale.getDefault()); try { diff --git a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_settings/FeatureRestriction.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_settings/FeatureRestriction.java index 5a4dd8d..75b5393 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_settings/FeatureRestriction.java +++ b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_settings/FeatureRestriction.java @@ -12,11 +12,6 @@ public static boolean isCallActionMessageEnabled() { return UIKitSettings.isCallNotification(); } - public static String getColor() { - return UIKitSettings.UIcolor; - } - - public static void isUserListEnabled(OnSuccessListener onSuccessListener) { CometChat.isFeatureEnabled(Feature.chat_users_list_enabled, new CometChat.CallbackListener() { @Override @@ -53,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) { @@ -162,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()); } @@ -407,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) { @@ -456,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) { @@ -493,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) { @@ -666,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) { @@ -883,7 +878,7 @@ public void onSuccess(Boolean aBoolean) { @Override public void onError(CometChatException e) { - e.printStackTrace(); + e.printStackTrace(); } }); } @@ -995,6 +990,14 @@ public void onError(CometChatException e) { }); } + public static void isDeleteConversationEnabled(OnSuccessListener onSuccessListener) { + onSuccessListener.onSuccess(UIKitSettings.isDeleteConversation()); + } + + public static void isStartConversationEnabled(OnSuccessListener onSuccessListener) { + onSuccessListener.onSuccess(UIKitSettings.isStartConversation()); + } + public interface OnSuccessListener { void onSuccess(Boolean booleanVal); } diff --git a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_settings/UIKitSettings.java b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_settings/UIKitSettings.java index c326768..1055da7 100644 --- a/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_settings/UIKitSettings.java +++ b/Firebase/uikit/src/main/java/com/cometchat/pro/uikit/ui_settings/UIKitSettings.java @@ -5,6 +5,7 @@ import android.content.Intent; import android.content.res.Configuration; import android.content.res.Resources; +import android.telecom.PhoneAccount; import android.widget.Toast; import com.cometchat.pro.constants.CometChatConstants; @@ -33,6 +34,9 @@ public class UIKitSettings { private static boolean calls = true; private static boolean userSettings = true; + private static boolean startConversation = true; + private static boolean deleteConversation = true; + private static boolean sendMessageInOneOneOne = true; private static boolean sendMessageInGroup = true; @@ -123,6 +127,7 @@ public class UIKitSettings { protected static ConversationMode conversationInMode = ConversationMode.ALL_CHATS; protected static GroupMode groupInMode = GroupMode.ALL_GROUP; protected static UserMode userInMode = UserMode.ALL_USER; + private static int connectionCapability = PhoneAccount.CAPABILITY_CALL_PROVIDER; public Context context; @@ -178,6 +183,14 @@ public static void showReplyPrivately(boolean isEnable) { showReplyPrivately = isEnable; } + public static String getColor() { + return UIcolor; + } + + public static int getConnectionCapability() { + return connectionCapability; + } + public void addConnectionListener(String TAG) { CometChat.addConnectionListener(TAG, new CometChat.ConnectionListener() { @Override @@ -329,6 +342,15 @@ public static void setColor(String color) { UIcolor = color; } + + public static void deleteConversation(boolean isEnabled) { + deleteConversation = isEnabled; + } + + public static void startConversation(boolean isEanbled) { + startConversation = isEanbled; + } + public static void users(boolean showUsers) { users = showUsers; } @@ -904,4 +926,11 @@ public static boolean isHideDeleteMessage() { return hideDeleteMessage; } + public static boolean isDeleteConversation() { + return deleteConversation; + } + + public static boolean isStartConversation() { + return startConversation; + } } diff --git a/Firebase/uikit/src/main/res-components/calls/layout/activity_cometchat_callmanager.xml b/Firebase/uikit/src/main/res-components/calls/layout/activity_cometchat_callmanager.xml index f07db67..9b7afe9 100644 --- a/Firebase/uikit/src/main/res-components/calls/layout/activity_cometchat_callmanager.xml +++ b/Firebase/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"/> diff --git a/Firebase/uikit/src/main/res-components/calls/layout/fragment_cometchat_calls.xml b/Firebase/uikit/src/main/res-components/calls/layout/fragment_cometchat_calls.xml index c3d33b9..b47ba98 100644 --- a/Firebase/uikit/src/main/res-components/calls/layout/fragment_cometchat_calls.xml +++ b/Firebase/uikit/src/main/res-components/calls/layout/fragment_cometchat_calls.xml @@ -21,9 +21,10 @@ android:layout_height="wrap_content"/> diff --git a/Firebase/uikit/src/main/res-components/chats/layout/cometchat_conversation_list_row.xml b/Firebase/uikit/src/main/res-components/chats/layout/cometchat_conversation_list_row.xml index d0a4119..97e81a4 100644 --- a/Firebase/uikit/src/main/res-components/chats/layout/cometchat_conversation_list_row.xml +++ b/Firebase/uikit/src/main/res-components/chats/layout/cometchat_conversation_list_row.xml @@ -31,15 +31,17 @@ android:layout_height="match_parent"> + tools:src="@tools:sample/avatars"/> + - + + + + + diff --git a/Firebase/uikit/src/main/res-components/groups/layout/cometchat_group_member_row.xml b/Firebase/uikit/src/main/res-components/groups/layout/cometchat_group_member_row.xml index 520981f..bed4f86 100644 --- a/Firebase/uikit/src/main/res-components/groups/layout/cometchat_group_member_row.xml +++ b/Firebase/uikit/src/main/res-components/groups/layout/cometchat_group_member_row.xml @@ -13,16 +13,18 @@ + android:layout_height="36dp" /> - + + diff --git a/Firebase/uikit/src/main/res-components/messagebubbles/layout/message_left_link_item.xml b/Firebase/uikit/src/main/res-components/messagebubbles/layout/message_left_link_item.xml index ace0ad5..657ee1e 100644 --- a/Firebase/uikit/src/main/res-components/messagebubbles/layout/message_left_link_item.xml +++ b/Firebase/uikit/src/main/res-components/messagebubbles/layout/message_left_link_item.xml @@ -15,6 +15,7 @@ diff --git a/Firebase/uikit/src/main/res-components/messagebubbles/layout/message_left_polls_item.xml b/Firebase/uikit/src/main/res-components/messagebubbles/layout/message_left_polls_item.xml index 681355c..f97b219 100644 --- a/Firebase/uikit/src/main/res-components/messagebubbles/layout/message_left_polls_item.xml +++ b/Firebase/uikit/src/main/res-components/messagebubbles/layout/message_left_polls_item.xml @@ -15,6 +15,7 @@ @@ -32,7 +32,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:ellipsize="end" - android:maxWidth="150dp" + android:maxWidth="200dp" android:maxLines="1" android:textColor="@color/textColorWhite" android:textStyle="bold" diff --git a/Firebase/uikit/src/main/res-components/messagebubbles/layout/message_right_sticker_item.xml b/Firebase/uikit/src/main/res-components/messagebubbles/layout/message_right_sticker_item.xml index 715dfb6..e2ee546 100644 --- a/Firebase/uikit/src/main/res-components/messagebubbles/layout/message_right_sticker_item.xml +++ b/Firebase/uikit/src/main/res-components/messagebubbles/layout/message_right_sticker_item.xml @@ -32,7 +32,7 @@ android:textSize="12sp" android:textStyle="bold" android:visibility="gone" - tools:drawableEnd="@drawable/ic_double_tick" + tools:drawableEnd="@drawable/ic_message_read" tools:text="11:00 PM" tools:visibility="visible" /> diff --git a/Firebase/uikit/src/main/res-components/messagebubbles/layout/message_right_writeboard_item.xml b/Firebase/uikit/src/main/res-components/messagebubbles/layout/message_right_writeboard_item.xml index 6f07229..f5584f7 100644 --- a/Firebase/uikit/src/main/res-components/messagebubbles/layout/message_right_writeboard_item.xml +++ b/Firebase/uikit/src/main/res-components/messagebubbles/layout/message_right_writeboard_item.xml @@ -28,7 +28,7 @@ android:layout_centerVertical="true" android:padding="8dp" android:id="@+id/icon" - android:src="@drawable/ic_writeboard_24dp" + android:src="@drawable/ic_collaborative_document" android:tint="@color/textColorWhite" android:layout_width="36dp" android:layout_height="36dp"/> diff --git a/Firebase/uikit/src/main/res-components/messagebubbles/layout/thread_message_file_item.xml b/Firebase/uikit/src/main/res-components/messagebubbles/layout/thread_message_file_item.xml index 235dbc6..a69fea1 100644 --- a/Firebase/uikit/src/main/res-components/messagebubbles/layout/thread_message_file_item.xml +++ b/Firebase/uikit/src/main/res-components/messagebubbles/layout/thread_message_file_item.xml @@ -79,7 +79,7 @@ android:layout_height="wrap_content"> + android:layout_height="32dp"/> diff --git a/Firebase/uikit/src/main/res-components/messages/layout/cometchat_composebox_actions.xml b/Firebase/uikit/src/main/res-components/messages/layout/cometchat_composebox_actions.xml index 2916f95..3627260 100644 --- a/Firebase/uikit/src/main/res-components/messages/layout/cometchat_composebox_actions.xml +++ b/Firebase/uikit/src/main/res-components/messages/layout/cometchat_composebox_actions.xml @@ -12,8 +12,7 @@ android:foreground="?attr/selectableItemBackground" android:textStyle="bold" android:text="@string/create_a_poll" - android:drawableTint="@color/grey" - android:drawableStart="@drawable/ic_poll_24dp" + android:drawableStart="@drawable/ic_polls" android:drawablePadding="16dp" android:gravity="center_vertical" android:textColor="@color/grey" @@ -26,8 +25,7 @@ android:foreground="?attr/selectableItemBackground" android:textStyle="bold" android:text="@string/photo_video_library" - android:drawableStart="@drawable/ic_photo" - android:drawableTint="@color/grey" + android:drawableStart="@drawable/ic_image_library" android:drawablePadding="16dp" android:gravity="center_vertical" android:textColor="@color/grey" @@ -40,7 +38,6 @@ android:foreground="?attr/selectableItemBackground" android:textStyle="bold" android:text="@string/take_a_photo" - android:drawableTint="@color/grey" android:drawableStart="@drawable/ic_camera" android:drawablePadding="16dp" android:gravity="center_vertical" @@ -54,9 +51,8 @@ android:foreground="?attr/selectableItemBackground" android:textStyle="bold" android:text="@string/send_files" - android:drawableStart="@drawable/ic_insert_drive_file_black_24dp" + android:drawableStart="@drawable/ic_file_upload" android:drawablePadding="16dp" - android:drawableTint="@color/grey" android:gravity="center_vertical" android:textColor="@color/grey" android:padding="16dp" @@ -65,8 +61,7 @@ @@ -12,21 +13,21 @@ android:focusable="true" android:layout_margin="8dp" android:layout_centerVertical="true" - android:src="@drawable/ic_arrow_back_24dp" - android:tint="@color/primaryTextColor" + android:src="@drawable/ic_back_arrow_selected" android:id="@+id/back_action" android:layout_width="wrap_content" android:layout_height="wrap_content"/> + android:layout_height="36dp"/> + xmlns:android="http://schemas.android.com/apk/res/android"> - + + + diff --git a/Firebase/uikit/src/main/res-components/others/layout/add_polls_layout.xml b/Firebase/uikit/src/main/res-components/others/layout/add_polls_layout.xml index 948479d..313dd2d 100644 --- a/Firebase/uikit/src/main/res-components/others/layout/add_polls_layout.xml +++ b/Firebase/uikit/src/main/res-components/others/layout/add_polls_layout.xml @@ -113,7 +113,7 @@ android:layout_height="wrap_content"/> diff --git a/Firebase/uikit/src/main/res-components/others/layout/cometchat_dialog_layout.xml b/Firebase/uikit/src/main/res-components/others/layout/cometchat_dialog_layout.xml index b1fc45b..c262793 100644 --- a/Firebase/uikit/src/main/res-components/others/layout/cometchat_dialog_layout.xml +++ b/Firebase/uikit/src/main/res-components/others/layout/cometchat_dialog_layout.xml @@ -15,7 +15,8 @@ android:layout_alignParentStart="true" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:src="@drawable/ic_baseline_error_24" + android:src="@drawable/ic_error" + android:tint="@color/textColorWhite" android:layout_margin="4dp"/> - - - + android:layout_width="36dp" + app:corner_radius="18dp" + android:layout_height="36dp"/> \ No newline at end of file diff --git a/Firebase/uikit/src/main/res-components/shared/layout/cometchat_avatar.xml b/Firebase/uikit/src/main/res-components/shared/layout/cometchat_avatar.xml new file mode 100644 index 0000000..4f0d12a --- /dev/null +++ b/Firebase/uikit/src/main/res-components/shared/layout/cometchat_avatar.xml @@ -0,0 +1,22 @@ + + + + + \ No newline at end of file diff --git a/Firebase/uikit/src/main/res-components/shared/layout/cometchat_badge_count.xml b/Firebase/uikit/src/main/res-components/shared/layout/cometchat_badge_count.xml index ed9ffeb..71bb556 100644 --- a/Firebase/uikit/src/main/res-components/shared/layout/cometchat_badge_count.xml +++ b/Firebase/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/Firebase/uikit/src/main/res-components/shared/layout/cometchat_compose_box.xml b/Firebase/uikit/src/main/res-components/shared/layout/cometchat_compose_box.xml index b2060bb..575c8e1 100644 --- a/Firebase/uikit/src/main/res-components/shared/layout/cometchat_compose_box.xml +++ b/Firebase/uikit/src/main/res-components/shared/layout/cometchat_compose_box.xml @@ -7,56 +7,12 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"> - - - - - - - - - - diff --git a/Firebase/uikit/src/main/res-components/userprofile/layout/activity_cometchat_more_privacy.xml b/Firebase/uikit/src/main/res-components/userprofile/layout/activity_cometchat_more_privacy.xml index d27d4b8..aa0f59d 100644 --- a/Firebase/uikit/src/main/res-components/userprofile/layout/activity_cometchat_more_privacy.xml +++ b/Firebase/uikit/src/main/res-components/userprofile/layout/activity_cometchat_more_privacy.xml @@ -36,7 +36,7 @@ android:id="@+id/tv_blocked_user_count" android:gravity="center" android:drawablePadding="8dp" - android:drawableEnd="@drawable/ic_arrow_right_24dp" + android:drawableEnd="@drawable/ic_arrow_right" android:layout_centerVertical="true" android:layout_alignParentRight="true" android:layout_width="wrap_content" diff --git a/Firebase/uikit/src/main/res-components/userprofile/layout/fragment_cometchat_user_profile.xml b/Firebase/uikit/src/main/res-components/userprofile/layout/fragment_cometchat_user_profile.xml index d9ffdb5..9a4d804 100644 --- a/Firebase/uikit/src/main/res-components/userprofile/layout/fragment_cometchat_user_profile.xml +++ b/Firebase/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"/> + @@ -87,7 +96,7 @@ @@ -114,31 +123,24 @@ android:foreground="?attr/selectableItemBackground" android:layout_width="match_parent" android:layout_height="wrap_content"> + + android:layout_height="wrap_content" + android:layout_alignParentLeft="true" + android:layout_gravity="center" + android:src="@drawable/ic_privacy" /> - diff --git a/Firebase/uikit/src/main/res-components/users/drawable/add_circle.xml b/Firebase/uikit/src/main/res-components/users/drawable/add_circle.xml new file mode 100644 index 0000000..e2e554e --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/add_circle.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/add_circle_filled.xml b/Firebase/uikit/src/main/res-components/users/drawable/add_circle_filled.xml new file mode 100644 index 0000000..75b792c --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/add_circle_filled.xml @@ -0,0 +1,10 @@ + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_add_users_to_group.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_add_users_to_group.xml new file mode 100644 index 0000000..ad052a9 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_add_users_to_group.xml @@ -0,0 +1,55 @@ + + + + + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_arrow_right_selected.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_arrow_right_selected.xml new file mode 100644 index 0000000..b7c2197 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_arrow_right_selected.xml @@ -0,0 +1,17 @@ + + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_arrow_right_unselected.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_arrow_right_unselected.xml new file mode 100644 index 0000000..36902d0 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_arrow_right_unselected.xml @@ -0,0 +1,17 @@ + + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_audio.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_audio.xml new file mode 100644 index 0000000..71e38f4 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_audio.xml @@ -0,0 +1,31 @@ + + + + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_audiocall.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_audiocall.xml index e516b4c..a2706af 100644 --- a/Firebase/uikit/src/main/res-components/users/drawable/ic_audiocall.xml +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_audiocall.xml @@ -1,6 +1,11 @@ - - - + + + + + + + + + + + \ No newline at end of file diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_back_arrow_selected.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_back_arrow_selected.xml new file mode 100644 index 0000000..bbae1b0 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_back_arrow_selected.xml @@ -0,0 +1,14 @@ + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_back_unselected.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_back_unselected.xml new file mode 100644 index 0000000..80be180 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_back_unselected.xml @@ -0,0 +1,13 @@ + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_calls.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_calls.xml new file mode 100644 index 0000000..bc17238 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_calls.xml @@ -0,0 +1,13 @@ + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_calls_selected.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_calls_selected.xml new file mode 100644 index 0000000..36561ae --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_calls_selected.xml @@ -0,0 +1,13 @@ + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_camera.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_camera.xml new file mode 100644 index 0000000..4f1e816 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_camera.xml @@ -0,0 +1,34 @@ + + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_chats.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_chats.xml new file mode 100644 index 0000000..51b8c97 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_chats.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_chats_unselected.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_chats_unselected.xml new file mode 100644 index 0000000..24c272a --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_chats_unselected.xml @@ -0,0 +1,13 @@ + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_close_circle_selected.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_close_circle_selected.xml new file mode 100644 index 0000000..3608cf1 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_close_circle_selected.xml @@ -0,0 +1,10 @@ + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_close_circle_unselected.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_close_circle_unselected.xml new file mode 100644 index 0000000..8057ca9 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_close_circle_unselected.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_collaborative_document.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_collaborative_document.xml new file mode 100644 index 0000000..b4c1257 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_collaborative_document.xml @@ -0,0 +1,48 @@ + + + + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_collaborative_whiteboard.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_collaborative_whiteboard.xml new file mode 100644 index 0000000..703f92a --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_collaborative_whiteboard.xml @@ -0,0 +1,20 @@ + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_copy_paste.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_copy_paste.xml new file mode 100644 index 0000000..b68f659 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_copy_paste.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_create.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_create.xml new file mode 100644 index 0000000..958d8af --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_create.xml @@ -0,0 +1,20 @@ + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_delete.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_delete.xml new file mode 100644 index 0000000..1cc805b --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_delete.xml @@ -0,0 +1,41 @@ + + + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_edit.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_edit.xml new file mode 100644 index 0000000..d277097 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_edit.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_error.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_error.xml new file mode 100644 index 0000000..114d975 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_error.xml @@ -0,0 +1,24 @@ + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_file.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_file.xml new file mode 100644 index 0000000..d24a822 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_file.xml @@ -0,0 +1,9 @@ + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_file_upload.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_file_upload.xml new file mode 100644 index 0000000..61c9d0f --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_file_upload.xml @@ -0,0 +1,34 @@ + + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_forward.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_forward.xml index 9d114fc..cf76ec1 100644 --- a/Firebase/uikit/src/main/res-components/users/drawable/ic_forward.xml +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_forward.xml @@ -1,4 +1,13 @@ - - + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_groups.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_groups.xml new file mode 100644 index 0000000..9b75fc7 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_groups.xml @@ -0,0 +1,34 @@ + + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_groups_unselected.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_groups_unselected.xml new file mode 100644 index 0000000..50526cd --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_groups_unselected.xml @@ -0,0 +1,20 @@ + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_hand.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_hand.xml new file mode 100644 index 0000000..c17d998 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_hand.xml @@ -0,0 +1,20 @@ + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_image_library.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_image_library.xml new file mode 100644 index 0000000..bd4d712 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_image_library.xml @@ -0,0 +1,38 @@ + + + + + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_incoming_call.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_incoming_call.xml new file mode 100644 index 0000000..bf926ad --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_incoming_call.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_incoming_video_call.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_incoming_video_call.xml new file mode 100644 index 0000000..cfc8d10 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_incoming_video_call.xml @@ -0,0 +1,21 @@ + + + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_info.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_info.xml index b1dae71..66b6e09 100644 --- a/Firebase/uikit/src/main/res-components/users/drawable/ic_info.xml +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_info.xml @@ -1,12 +1,27 @@ + android:pathData="M12.8,14.6H12.2C11.8818,14.6 11.5766,14.4736 11.3515,14.2485C11.1265,14.0235 11,13.7182 11,13.4V10.4C11,10.2409 10.9368,10.0882 10.8243,9.9757C10.7118,9.8632 10.5592,9.8 10.4,9.8H9.8" + android:strokeLineJoin="round" + android:strokeWidth="1.5" + android:fillColor="#00000000" + android:strokeColor="#808080" + android:strokeLineCap="round"/> + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_info_selected.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_info_selected.xml new file mode 100644 index 0000000..5e3dead --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_info_selected.xml @@ -0,0 +1,10 @@ + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_info_unselected.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_info_unselected.xml new file mode 100644 index 0000000..371e6b3 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_info_unselected.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_location.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_location.xml new file mode 100644 index 0000000..6e2b936 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_location.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_message_delivered.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_message_delivered.xml new file mode 100644 index 0000000..b1e6daf --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_message_delivered.xml @@ -0,0 +1,18 @@ + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_message_privately.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_message_privately.xml deleted file mode 100644 index 0ac0660..0000000 --- a/Firebase/uikit/src/main/res-components/users/drawable/ic_message_privately.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_message_read.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_message_read.xml new file mode 100644 index 0000000..7220ff8 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_message_read.xml @@ -0,0 +1,18 @@ + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_message_sent.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_message_sent.xml new file mode 100644 index 0000000..9a8dbb5 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_message_sent.xml @@ -0,0 +1,13 @@ + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_microphone_grey_selected.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_microphone_grey_selected.xml new file mode 100644 index 0000000..a1cc1c8 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_microphone_grey_selected.xml @@ -0,0 +1,10 @@ + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_microphone_grey_unselected.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_microphone_grey_unselected.xml new file mode 100644 index 0000000..9d628d3 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_microphone_grey_unselected.xml @@ -0,0 +1,31 @@ + + + + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_microphone_white_selected.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_microphone_white_selected.xml new file mode 100644 index 0000000..a7bf108 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_microphone_white_selected.xml @@ -0,0 +1,10 @@ + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_microphone_white_unselected.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_microphone_white_unselected.xml new file mode 100644 index 0000000..ee1438c --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_microphone_white_unselected.xml @@ -0,0 +1,31 @@ + + + + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_more.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_more.xml new file mode 100644 index 0000000..8c707b0 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_more.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_more_unselected.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_more_unselected.xml new file mode 100644 index 0000000..789a3ff --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_more_unselected.xml @@ -0,0 +1,34 @@ + + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_notifications.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_notifications.xml new file mode 100644 index 0000000..cb9d133 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_notifications.xml @@ -0,0 +1,13 @@ + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_outgoing_call.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_outgoing_call.xml new file mode 100644 index 0000000..b91c24a --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_outgoing_call.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_outgoing_video_call.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_outgoing_video_call.xml new file mode 100644 index 0000000..67ad331 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_outgoing_video_call.xml @@ -0,0 +1,21 @@ + + + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_polls.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_polls.xml new file mode 100644 index 0000000..931aaa2 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_polls.xml @@ -0,0 +1,41 @@ + + + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_privacy.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_privacy.xml new file mode 100644 index 0000000..32d890b --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_privacy.xml @@ -0,0 +1,34 @@ + + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_reactions.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_reactions.xml new file mode 100644 index 0000000..e9e47be --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_reactions.xml @@ -0,0 +1,31 @@ + + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_reply.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_reply.xml deleted file mode 100644 index 69bb169..0000000 --- a/Firebase/uikit/src/main/res-components/users/drawable/ic_reply.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_reply_message.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_reply_message.xml new file mode 100644 index 0000000..fce27d1 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_reply_message.xml @@ -0,0 +1,13 @@ + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_reply_message_in_private.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_reply_message_in_private.xml new file mode 100644 index 0000000..78bc61d --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_reply_message_in_private.xml @@ -0,0 +1,48 @@ + + + + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_report.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_report.xml new file mode 100644 index 0000000..c3ef177 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_report.xml @@ -0,0 +1,10 @@ + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_search.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_search.xml new file mode 100644 index 0000000..16aca4b --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_search.xml @@ -0,0 +1,20 @@ + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_send_message.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_send_message.xml new file mode 100644 index 0000000..39a1ec0 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_send_message.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_send_message_in_private.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_send_message_in_private.xml new file mode 100644 index 0000000..b420364 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_send_message_in_private.xml @@ -0,0 +1,38 @@ + + + + + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_send_message_selected.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_send_message_selected.xml new file mode 100644 index 0000000..dfdebad --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_send_message_selected.xml @@ -0,0 +1,10 @@ + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_share.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_share.xml new file mode 100644 index 0000000..222aea2 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_share.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_sticker.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_sticker.xml new file mode 100644 index 0000000..fcf3cb4 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_sticker.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_threaded_message.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_threaded_message.xml new file mode 100644 index 0000000..456376c --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_threaded_message.xml @@ -0,0 +1,34 @@ + + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_translate.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_translate.xml new file mode 100644 index 0000000..d30071a --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_translate.xml @@ -0,0 +1,35 @@ + + + + + + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_users.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_users.xml new file mode 100644 index 0000000..7828b63 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_users.xml @@ -0,0 +1,20 @@ + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_users_unselected.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_users_unselected.xml new file mode 100644 index 0000000..9d4dda0 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_users_unselected.xml @@ -0,0 +1,13 @@ + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_video_call.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_video_call.xml new file mode 100644 index 0000000..e28855b --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_video_call.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_video_call_selected.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_video_call_selected.xml new file mode 100644 index 0000000..21cd9a0 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_video_call_selected.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_video_group_call_selected.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_video_group_call_selected.xml new file mode 100644 index 0000000..53c38d8 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_video_group_call_selected.xml @@ -0,0 +1,17 @@ + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_video_group_call_unselected.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_video_group_call_unselected.xml new file mode 100644 index 0000000..8c27ca5 --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_video_group_call_unselected.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_videocall.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_videocall.xml index 9dc81c0..de629eb 100644 --- a/Firebase/uikit/src/main/res-components/users/drawable/ic_videocall.xml +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_videocall.xml @@ -1,6 +1,7 @@ - - - + + + + + \ No newline at end of file diff --git a/Firebase/uikit/src/main/res-components/users/drawable/ic_warning.xml b/Firebase/uikit/src/main/res-components/users/drawable/ic_warning.xml new file mode 100644 index 0000000..4fe28aa --- /dev/null +++ b/Firebase/uikit/src/main/res-components/users/drawable/ic_warning.xml @@ -0,0 +1,26 @@ + + + + + diff --git a/Firebase/uikit/src/main/res-components/users/layout/activity_cometchat_user_detail.xml b/Firebase/uikit/src/main/res-components/users/layout/activity_cometchat_user_detail.xml index cd1400c..812447e 100644 --- a/Firebase/uikit/src/main/res-components/users/layout/activity_cometchat_user_detail.xml +++ b/Firebase/uikit/src/main/res-components/users/layout/activity_cometchat_user_detail.xml @@ -9,6 +9,7 @@ android:layout_width="match_parent" android:id="@+id/user_detail_toolbar" app:title="@string/user_title" + app:navigationIcon="@drawable/ic_back_arrow_selected" android:layout_height="wrap_content"/> + android:layout_height="36dp"/> + tools:src="@tools:sample/avatars"/> diff --git a/Firebase/uikit/src/main/res/drawable-hdpi/ic_edit.png b/Firebase/uikit/src/main/res/drawable-hdpi/ic_edit.png deleted file mode 100644 index 781504f..0000000 Binary files a/Firebase/uikit/src/main/res/drawable-hdpi/ic_edit.png and /dev/null differ diff --git a/Firebase/uikit/src/main/res/drawable-hdpi/ic_warning_image.png b/Firebase/uikit/src/main/res/drawable-hdpi/ic_warning_image.png deleted file mode 100644 index 11188ec..0000000 Binary files a/Firebase/uikit/src/main/res/drawable-hdpi/ic_warning_image.png and /dev/null differ diff --git a/Firebase/uikit/src/main/res/drawable-mdpi/ic_warning_image.png b/Firebase/uikit/src/main/res/drawable-mdpi/ic_warning_image.png deleted file mode 100644 index e43955e..0000000 Binary files a/Firebase/uikit/src/main/res/drawable-mdpi/ic_warning_image.png and /dev/null differ diff --git a/Firebase/uikit/src/main/res/drawable-xhdpi/ic_warning_image.png b/Firebase/uikit/src/main/res/drawable-xhdpi/ic_warning_image.png deleted file mode 100644 index 69dcef4..0000000 Binary files a/Firebase/uikit/src/main/res/drawable-xhdpi/ic_warning_image.png and /dev/null differ diff --git a/Firebase/uikit/src/main/res/drawable-xxhdpi/ic_warning_image.png b/Firebase/uikit/src/main/res/drawable-xxhdpi/ic_warning_image.png deleted file mode 100644 index 436ae9f..0000000 Binary files a/Firebase/uikit/src/main/res/drawable-xxhdpi/ic_warning_image.png and /dev/null differ diff --git a/Firebase/uikit/src/main/res/drawable-xxxhdpi/ic_warning_image.png b/Firebase/uikit/src/main/res/drawable-xxxhdpi/ic_warning_image.png deleted file mode 100644 index 4810121..0000000 Binary files a/Firebase/uikit/src/main/res/drawable-xxxhdpi/ic_warning_image.png and /dev/null differ diff --git a/Firebase/uikit/src/main/res/drawable/default_sticker.png b/Firebase/uikit/src/main/res/drawable/default_sticker.png deleted file mode 100644 index c8f15b4..0000000 Binary files a/Firebase/uikit/src/main/res/drawable/default_sticker.png and /dev/null differ diff --git a/Firebase/uikit/src/main/res/drawable/ic_add.xml b/Firebase/uikit/src/main/res/drawable/ic_add.xml index f2a5c23..e77eead 100644 --- a/Firebase/uikit/src/main/res/drawable/ic_add.xml +++ b/Firebase/uikit/src/main/res/drawable/ic_add.xml @@ -1,5 +1,6 @@ - - - - \ No newline at end of file + + + + + diff --git a/Firebase/uikit/src/main/res/drawable/ic_add_24dp.xml b/Firebase/uikit/src/main/res/drawable/ic_add_24dp.xml deleted file mode 100644 index b5c6c73..0000000 --- a/Firebase/uikit/src/main/res/drawable/ic_add_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/Firebase/uikit/src/main/res/drawable/ic_add_circle_grey.xml b/Firebase/uikit/src/main/res/drawable/ic_add_circle_grey.xml new file mode 100644 index 0000000..e05e8a2 --- /dev/null +++ b/Firebase/uikit/src/main/res/drawable/ic_add_circle_grey.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Firebase/uikit/src/main/res/drawable/ic_add_circle_grey_32dp.xml b/Firebase/uikit/src/main/res/drawable/ic_add_circle_grey_32dp.xml deleted file mode 100644 index ee81581..0000000 --- a/Firebase/uikit/src/main/res/drawable/ic_add_circle_grey_32dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/Firebase/uikit/src/main/res/drawable/ic_arrow_back_24dp.xml b/Firebase/uikit/src/main/res/drawable/ic_arrow_back_24dp.xml deleted file mode 100644 index f632160..0000000 --- a/Firebase/uikit/src/main/res/drawable/ic_arrow_back_24dp.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Firebase/uikit/src/main/res/drawable/ic_arrow_right.xml b/Firebase/uikit/src/main/res/drawable/ic_arrow_right.xml new file mode 100644 index 0000000..4746484 --- /dev/null +++ b/Firebase/uikit/src/main/res/drawable/ic_arrow_right.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Firebase/uikit/src/main/res/drawable/ic_arrow_right_24dp.xml b/Firebase/uikit/src/main/res/drawable/ic_arrow_right_24dp.xml deleted file mode 100644 index 5bc098b..0000000 --- a/Firebase/uikit/src/main/res/drawable/ic_arrow_right_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/Firebase/uikit/src/main/res/drawable/ic_back.xml b/Firebase/uikit/src/main/res/drawable/ic_back.xml new file mode 100644 index 0000000..663bab2 --- /dev/null +++ b/Firebase/uikit/src/main/res/drawable/ic_back.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/Firebase/uikit/src/main/res/drawable/ic_baseline_error_24.xml b/Firebase/uikit/src/main/res/drawable/ic_baseline_error_24.xml deleted file mode 100644 index 1fa8716..0000000 --- a/Firebase/uikit/src/main/res/drawable/ic_baseline_error_24.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/Firebase/uikit/src/main/res/drawable/ic_baseline_more_vert_24.xml b/Firebase/uikit/src/main/res/drawable/ic_baseline_more_vert_24.xml index 48272f6..fde5725 100644 --- a/Firebase/uikit/src/main/res/drawable/ic_baseline_more_vert_24.xml +++ b/Firebase/uikit/src/main/res/drawable/ic_baseline_more_vert_24.xml @@ -5,6 +5,6 @@ android:viewportHeight="24" android:tint="?attr/colorControlNormal"> diff --git a/Firebase/uikit/src/main/res/drawable/ic_call_24dp.xml b/Firebase/uikit/src/main/res/drawable/ic_call_24dp.xml deleted file mode 100644 index ebf9de6..0000000 --- a/Firebase/uikit/src/main/res/drawable/ic_call_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/Firebase/uikit/src/main/res/drawable/ic_call_missed_incoming_24dp.xml b/Firebase/uikit/src/main/res/drawable/ic_call_missed_incoming_24dp.xml index 57d1cd7..c41e014 100644 --- a/Firebase/uikit/src/main/res/drawable/ic_call_missed_incoming_24dp.xml +++ b/Firebase/uikit/src/main/res/drawable/ic_call_missed_incoming_24dp.xml @@ -1,4 +1,4 @@ - diff --git a/Firebase/uikit/src/main/res/drawable/ic_call_missed_outgoing_24dp.xml b/Firebase/uikit/src/main/res/drawable/ic_call_missed_outgoing_24dp.xml index 057efff..1214277 100644 --- a/Firebase/uikit/src/main/res/drawable/ic_call_missed_outgoing_24dp.xml +++ b/Firebase/uikit/src/main/res/drawable/ic_call_missed_outgoing_24dp.xml @@ -1,4 +1,4 @@ - diff --git a/Firebase/uikit/src/main/res/drawable/ic_camera.xml b/Firebase/uikit/src/main/res/drawable/ic_camera.xml deleted file mode 100644 index 83ad59e..0000000 --- a/Firebase/uikit/src/main/res/drawable/ic_camera.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - diff --git a/Firebase/uikit/src/main/res/drawable/ic_chat.xml b/Firebase/uikit/src/main/res/drawable/ic_chat.xml deleted file mode 100644 index 80caabf..0000000 --- a/Firebase/uikit/src/main/res/drawable/ic_chat.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/Firebase/uikit/src/main/res/drawable/ic_chats.png b/Firebase/uikit/src/main/res/drawable/ic_chats.png deleted file mode 100644 index 6324266..0000000 Binary files a/Firebase/uikit/src/main/res/drawable/ic_chats.png and /dev/null differ diff --git a/Firebase/uikit/src/main/res/drawable/ic_chats_selected.xml b/Firebase/uikit/src/main/res/drawable/ic_chats_selected.xml new file mode 100644 index 0000000..b18fa53 --- /dev/null +++ b/Firebase/uikit/src/main/res/drawable/ic_chats_selected.xml @@ -0,0 +1,13 @@ + + + diff --git a/Firebase/uikit/src/main/res/drawable/ic_check_black_24dp.xml b/Firebase/uikit/src/main/res/drawable/ic_check_black_24dp.xml deleted file mode 100644 index 9019a15..0000000 --- a/Firebase/uikit/src/main/res/drawable/ic_check_black_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/Firebase/uikit/src/main/res/drawable/ic_close_24dp.xml b/Firebase/uikit/src/main/res/drawable/ic_close_24dp.xml index 5bd1ee8..56150dc 100644 --- a/Firebase/uikit/src/main/res/drawable/ic_close_24dp.xml +++ b/Firebase/uikit/src/main/res/drawable/ic_close_24dp.xml @@ -1,5 +1,20 @@ - - + + + diff --git a/Firebase/uikit/src/main/res/drawable/ic_close_circle.xml b/Firebase/uikit/src/main/res/drawable/ic_close_circle.xml index c35a0af..34972f6 100644 --- a/Firebase/uikit/src/main/res/drawable/ic_close_circle.xml +++ b/Firebase/uikit/src/main/res/drawable/ic_close_circle.xml @@ -1,5 +1,5 @@ - - - - \ No newline at end of file + + + + \ No newline at end of file diff --git a/Firebase/uikit/src/main/res/drawable/ic_contacts_24dp.xml b/Firebase/uikit/src/main/res/drawable/ic_contacts_24dp.xml deleted file mode 100644 index af96087..0000000 --- a/Firebase/uikit/src/main/res/drawable/ic_contacts_24dp.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - diff --git a/Firebase/uikit/src/main/res/drawable/ic_delete.png b/Firebase/uikit/src/main/res/drawable/ic_delete.png deleted file mode 100644 index 31bae4b..0000000 Binary files a/Firebase/uikit/src/main/res/drawable/ic_delete.png and /dev/null differ diff --git a/Firebase/uikit/src/main/res/drawable/ic_delete_24dp.xml b/Firebase/uikit/src/main/res/drawable/ic_delete_24dp.xml deleted file mode 100644 index f696718..0000000 --- a/Firebase/uikit/src/main/res/drawable/ic_delete_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/Firebase/uikit/src/main/res/drawable/ic_delete_conversation.xml b/Firebase/uikit/src/main/res/drawable/ic_delete_conversation.xml new file mode 100644 index 0000000..1a9194b --- /dev/null +++ b/Firebase/uikit/src/main/res/drawable/ic_delete_conversation.xml @@ -0,0 +1,41 @@ + + + + + + + diff --git a/Firebase/uikit/src/main/res/drawable/ic_done_all_black_24dp.xml b/Firebase/uikit/src/main/res/drawable/ic_done_all_black_24dp.xml deleted file mode 100644 index 39990bb..0000000 --- a/Firebase/uikit/src/main/res/drawable/ic_done_all_black_24dp.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/Firebase/uikit/src/main/res/drawable/ic_double_tick.xml b/Firebase/uikit/src/main/res/drawable/ic_double_tick.xml deleted file mode 100644 index 099dda1..0000000 --- a/Firebase/uikit/src/main/res/drawable/ic_double_tick.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - diff --git a/Firebase/uikit/src/main/res/drawable/ic_group.xml b/Firebase/uikit/src/main/res/drawable/ic_group.xml deleted file mode 100644 index 5c90d29..0000000 --- a/Firebase/uikit/src/main/res/drawable/ic_group.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - diff --git a/Firebase/uikit/src/main/res/drawable/ic_group_add_black_24dp.xml b/Firebase/uikit/src/main/res/drawable/ic_group_add_black_24dp.xml deleted file mode 100644 index 8220314..0000000 --- a/Firebase/uikit/src/main/res/drawable/ic_group_add_black_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/Firebase/uikit/src/main/res/drawable/ic_groups_selected.xml b/Firebase/uikit/src/main/res/drawable/ic_groups_selected.xml new file mode 100644 index 0000000..c32aeef --- /dev/null +++ b/Firebase/uikit/src/main/res/drawable/ic_groups_selected.xml @@ -0,0 +1,20 @@ + + + + diff --git a/Firebase/uikit/src/main/res/drawable/ic_hand.xml b/Firebase/uikit/src/main/res/drawable/ic_hand.xml deleted file mode 100644 index c3b2281..0000000 --- a/Firebase/uikit/src/main/res/drawable/ic_hand.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/Firebase/uikit/src/main/res/drawable/ic_insert_drive_file_black_24dp.xml b/Firebase/uikit/src/main/res/drawable/ic_insert_drive_file_black_24dp.xml deleted file mode 100644 index bb78063..0000000 --- a/Firebase/uikit/src/main/res/drawable/ic_insert_drive_file_black_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/Firebase/uikit/src/main/res/drawable/ic_library_music_24dp.xml b/Firebase/uikit/src/main/res/drawable/ic_library_music_24dp.xml deleted file mode 100644 index 3e60c09..0000000 --- a/Firebase/uikit/src/main/res/drawable/ic_library_music_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/Firebase/uikit/src/main/res/drawable/ic_mic_grey.xml b/Firebase/uikit/src/main/res/drawable/ic_mic_grey.xml new file mode 100644 index 0000000..f80e4c8 --- /dev/null +++ b/Firebase/uikit/src/main/res/drawable/ic_mic_grey.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/Firebase/uikit/src/main/res/drawable/ic_mic_grey_24dp.xml b/Firebase/uikit/src/main/res/drawable/ic_mic_grey_24dp.xml deleted file mode 100644 index a734aad..0000000 --- a/Firebase/uikit/src/main/res/drawable/ic_mic_grey_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/Firebase/uikit/src/main/res/drawable/ic_mic_white.xml b/Firebase/uikit/src/main/res/drawable/ic_mic_white.xml new file mode 100644 index 0000000..240127a --- /dev/null +++ b/Firebase/uikit/src/main/res/drawable/ic_mic_white.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/Firebase/uikit/src/main/res/drawable/ic_mic_white_24dp.xml b/Firebase/uikit/src/main/res/drawable/ic_mic_white_24dp.xml deleted file mode 100644 index 877b8c1..0000000 --- a/Firebase/uikit/src/main/res/drawable/ic_mic_white_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/Firebase/uikit/src/main/res/drawable/ic_more.xml b/Firebase/uikit/src/main/res/drawable/ic_more.xml deleted file mode 100644 index 8a5434e..0000000 --- a/Firebase/uikit/src/main/res/drawable/ic_more.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - diff --git a/Firebase/uikit/src/main/res/drawable/ic_more_selected.xml b/Firebase/uikit/src/main/res/drawable/ic_more_selected.xml new file mode 100644 index 0000000..3e82351 --- /dev/null +++ b/Firebase/uikit/src/main/res/drawable/ic_more_selected.xml @@ -0,0 +1,10 @@ + + + diff --git a/Firebase/uikit/src/main/res/drawable/ic_near_me_24dp.xml b/Firebase/uikit/src/main/res/drawable/ic_near_me_24dp.xml deleted file mode 100644 index 7a97d60..0000000 --- a/Firebase/uikit/src/main/res/drawable/ic_near_me_24dp.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/Firebase/uikit/src/main/res/drawable/ic_notification.xml b/Firebase/uikit/src/main/res/drawable/ic_notification.xml deleted file mode 100644 index 0b77b8e..0000000 --- a/Firebase/uikit/src/main/res/drawable/ic_notification.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/Firebase/uikit/src/main/res/drawable/ic_notifications_black_24dp.xml b/Firebase/uikit/src/main/res/drawable/ic_notifications_black_24dp.xml deleted file mode 100644 index 17141e5..0000000 --- a/Firebase/uikit/src/main/res/drawable/ic_notifications_black_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/Firebase/uikit/src/main/res/drawable/ic_photo.xml b/Firebase/uikit/src/main/res/drawable/ic_photo.xml deleted file mode 100644 index f695bd6..0000000 --- a/Firebase/uikit/src/main/res/drawable/ic_photo.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/Firebase/uikit/src/main/res/drawable/ic_poll_24dp.xml b/Firebase/uikit/src/main/res/drawable/ic_poll_24dp.xml deleted file mode 100644 index 2059e8b..0000000 --- a/Firebase/uikit/src/main/res/drawable/ic_poll_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/Firebase/uikit/src/main/res/drawable/ic_search_24dp.xml b/Firebase/uikit/src/main/res/drawable/ic_search_24dp.xml deleted file mode 100644 index b2d0147..0000000 --- a/Firebase/uikit/src/main/res/drawable/ic_search_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/Firebase/uikit/src/main/res/drawable/ic_security.xml b/Firebase/uikit/src/main/res/drawable/ic_security.xml deleted file mode 100644 index b046468..0000000 --- a/Firebase/uikit/src/main/res/drawable/ic_security.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/Firebase/uikit/src/main/res/drawable/ic_send.xml b/Firebase/uikit/src/main/res/drawable/ic_send.xml index 3f8d347..3c80770 100644 --- a/Firebase/uikit/src/main/res/drawable/ic_send.xml +++ b/Firebase/uikit/src/main/res/drawable/ic_send.xml @@ -1,9 +1,7 @@ - - - - - - + + + + + \ No newline at end of file diff --git a/Firebase/uikit/src/main/res/drawable/ic_translate.xml b/Firebase/uikit/src/main/res/drawable/ic_translate.xml deleted file mode 100644 index 20ddcb0..0000000 --- a/Firebase/uikit/src/main/res/drawable/ic_translate.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - diff --git a/Firebase/uikit/src/main/res/drawable/ic_users_selected.xml b/Firebase/uikit/src/main/res/drawable/ic_users_selected.xml new file mode 100644 index 0000000..d2e193f --- /dev/null +++ b/Firebase/uikit/src/main/res/drawable/ic_users_selected.xml @@ -0,0 +1,13 @@ + + + diff --git a/Firebase/uikit/src/main/res/drawable/ic_video_group_call.xml b/Firebase/uikit/src/main/res/drawable/ic_video_group_call.xml new file mode 100644 index 0000000..80cbd5a --- /dev/null +++ b/Firebase/uikit/src/main/res/drawable/ic_video_group_call.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/Firebase/uikit/src/main/res/drawable/ic_videocam_24dp.xml b/Firebase/uikit/src/main/res/drawable/ic_videocam_24dp.xml deleted file mode 100644 index 5498ba1..0000000 --- a/Firebase/uikit/src/main/res/drawable/ic_videocam_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/Firebase/uikit/src/main/res/drawable/ic_whiteboard_24dp.png b/Firebase/uikit/src/main/res/drawable/ic_whiteboard_24dp.png deleted file mode 100644 index 3203dbf..0000000 Binary files a/Firebase/uikit/src/main/res/drawable/ic_whiteboard_24dp.png and /dev/null differ diff --git a/Firebase/uikit/src/main/res/drawable/ic_writeboard_24dp.png b/Firebase/uikit/src/main/res/drawable/ic_writeboard_24dp.png deleted file mode 100644 index 1c10e29..0000000 Binary files a/Firebase/uikit/src/main/res/drawable/ic_writeboard_24dp.png and /dev/null differ diff --git a/Firebase/uikit/src/main/res/drawable/info.png b/Firebase/uikit/src/main/res/drawable/info.png deleted file mode 100644 index 055c2fc..0000000 Binary files a/Firebase/uikit/src/main/res/drawable/info.png and /dev/null differ diff --git a/Firebase/uikit/src/main/res/drawable/share.png b/Firebase/uikit/src/main/res/drawable/share.png deleted file mode 100644 index 4db3d51..0000000 Binary files a/Firebase/uikit/src/main/res/drawable/share.png and /dev/null differ diff --git a/Firebase/uikit/src/main/res/drawable/start_converastion_tab_state.xml b/Firebase/uikit/src/main/res/drawable/start_converastion_tab_state.xml new file mode 100644 index 0000000..e0b9b22 --- /dev/null +++ b/Firebase/uikit/src/main/res/drawable/start_converastion_tab_state.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Firebase/uikit/src/main/res/drawable/start_conversation_tab_active.xml b/Firebase/uikit/src/main/res/drawable/start_conversation_tab_active.xml new file mode 100644 index 0000000..0f9a2b3 --- /dev/null +++ b/Firebase/uikit/src/main/res/drawable/start_conversation_tab_active.xml @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Firebase/uikit/src/main/res/drawable/thread.png b/Firebase/uikit/src/main/res/drawable/thread.png deleted file mode 100644 index 7b9ad8b..0000000 Binary files a/Firebase/uikit/src/main/res/drawable/thread.png and /dev/null differ diff --git a/Firebase/uikit/src/main/res/layout/activity_comet_chat_start_conversation.xml b/Firebase/uikit/src/main/res/layout/activity_comet_chat_start_conversation.xml new file mode 100644 index 0000000..a6d50ff --- /dev/null +++ b/Firebase/uikit/src/main/res/layout/activity_comet_chat_start_conversation.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Firebase/uikit/src/main/res/menu/cometchat_navigation_bottom.xml b/Firebase/uikit/src/main/res/menu/cometchat_navigation_bottom.xml index 43f5f00..ebe3179 100644 --- a/Firebase/uikit/src/main/res/menu/cometchat_navigation_bottom.xml +++ b/Firebase/uikit/src/main/res/menu/cometchat_navigation_bottom.xml @@ -9,15 +9,15 @@ + android:icon="@drawable/ic_audiocall" /> + android:icon="@drawable/ic_users"/> \ No newline at end of file diff --git a/Firebase/uikit/src/main/res/values-ar/strings.xml b/Firebase/uikit/src/main/res/values-ar/strings.xml index d5f4c9b..25a695b 100644 --- a/Firebase/uikit/src/main/res/values-ar/strings.xml +++ b/Firebase/uikit/src/main/res/values-ar/strings.xml @@ -273,11 +273,10 @@ غادر جارى التحميل إنشاء المجموعة - إرسال الرسالة بشكل خاص + إرسال الرسالة بشكل خاص عرض الصفحة الشخصية هل ترغب في حذف هذه المحادثة؟ حذف المحادثة - الرد في الدردشة لا يوجد إنترنت متاح غير متصل على الانترنت رسائل جديدة @@ -291,4 +290,13 @@ رد الردود الرد بشكل خاص + اختر المستخدم + اختر مجموعة + بحث في المستخدمين + مجموعات البحث + مكالمة صوتية مرفوضة + مكالمة فيديو مرفوضة + مكالمة صوتية صادرة + مكالمة فيديو صادرة + لم يتم العثور على أعضاء محظورين \ No newline at end of file diff --git a/Firebase/uikit/src/main/res/values-de/strings.xml b/Firebase/uikit/src/main/res/values-de/strings.xml index 751f807..5e851e3 100644 --- a/Firebase/uikit/src/main/res/values-de/strings.xml +++ b/Firebase/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,22 +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 - Im Thread antworten 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/Firebase/uikit/src/main/res/values-es/strings.xml b/Firebase/uikit/src/main/res/values-es/strings.xml index 7fb6803..8da7d95 100644 --- a/Firebase/uikit/src/main/res/values-es/strings.xml +++ b/Firebase/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,30 +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 - Responder en el chat - 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/Firebase/uikit/src/main/res/values-fr/strings.xml b/Firebase/uikit/src/main/res/values-fr/strings.xml index f40b21c..aaa6737 100644 --- a/Firebase/uikit/src/main/res/values-fr/strings.xml +++ b/Firebase/uikit/src/main/res/values-fr/strings.xml @@ -280,11 +280,10 @@ 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 - Répondre dans le chat hors ligne Nouveaux messages Nouveau message @@ -297,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/Firebase/uikit/src/main/res/values-hi/strings.xml b/Firebase/uikit/src/main/res/values-hi/strings.xml index b48e6f7..036ec51 100644 --- a/Firebase/uikit/src/main/res/values-hi/strings.xml +++ b/Firebase/uikit/src/main/res/values-hi/strings.xml @@ -273,11 +273,10 @@ प्रदान किया गया एक्सटेंशन नहीं मिला। डाउनलोड समूह बनाना - निजी तौर पर संदेश भेजें + निजी तौर पर संदेश भेजें प्रोफ़ाइल देखें क्या आप इस वार्तालाप को हटाना चाहेंगे? वार्तालाप हटाना - चैट में जवाब दें ऑफ़लाइन नए संदेश नया संदेश @@ -290,4 +289,13 @@ जवाब जवाब निजी तौर पर उत्तर दें + उपयोगकर्ता का चयन करें + समूह का चयन करें + उपयोगकर्ता खोजें + समूह खोजें + अस्वीकृत वॉयस कॉल + अस्वीकृत वीडियो कॉल + आउटगोइंग वॉयस कॉल + आउटगोइंग वीडियो कॉल + कोई प्रतिबंधित सदस्य नहीं मिला \ No newline at end of file diff --git a/Firebase/uikit/src/main/res/values-lt/strings.xml b/Firebase/uikit/src/main/res/values-lt/strings.xml index b1612a6..8aa6a51 100644 --- a/Firebase/uikit/src/main/res/values-lt/strings.xml +++ b/Firebase/uikit/src/main/res/values-lt/strings.xml @@ -301,13 +301,12 @@ 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į? Ištrinamas pokalbis rašo .. - Atsakyti pokalbiuose neprisijungęs Nauji pranešimai Nauja žinutė @@ -320,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/Firebase/uikit/src/main/res/values-ms/strings.xml b/Firebase/uikit/src/main/res/values-ms/strings.xml index 81de6c1..0f36663 100644 --- a/Firebase/uikit/src/main/res/values-ms/strings.xml +++ b/Firebase/uikit/src/main/res/values-ms/strings.xml @@ -273,11 +273,10 @@ meninggalkan kumpulan memuat turun mewujudkan kumpulan - Hantar Mesej secara tertutup + Hantar Mesej secara tertutup Lihat profil Adakah anda mahu memadamkan perbualan ini? Memadamkan Perbualan - Balas dalam Sembang di luar talian Mesej Baru Mesej baru @@ -290,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/Firebase/uikit/src/main/res/values-pt/strings.xml b/Firebase/uikit/src/main/res/values-pt/strings.xml index cdd7b57..132974b 100644 --- a/Firebase/uikit/src/main/res/values-pt/strings.xml +++ b/Firebase/uikit/src/main/res/values-pt/strings.xml @@ -273,11 +273,10 @@ 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 - Responder em bate-papos desligado Novas mensagens Nova mensagem @@ -290,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/Firebase/uikit/src/main/res/values-ru/strings.xml b/Firebase/uikit/src/main/res/values-ru/strings.xml index dadf0c3..72a5c25 100644 --- a/Firebase/uikit/src/main/res/values-ru/strings.xml +++ b/Firebase/uikit/src/main/res/values-ru/strings.xml @@ -275,7 +275,7 @@ покинул группу скачивание Создание группы - Отправить сообщение в частном порядке + Отправить сообщение в частном порядке Просмотреть профиль Вы хотите удалить этот разговор? Удаление разговора @@ -283,7 +283,6 @@ ответы Отклонить Принять - Ответить в ветке голоса проголосовать Доставлено @@ -292,4 +291,13 @@ Новое сообщение Не в сети Ответить лично + Выбрать пользователя + Выбрать группу + Поиск пользователей + Поисковые группы + Отклоненный голосовой вызов + Отклоненный видеовызов + Исходящий голосовой вызов + Исходящий видеозвонок + Забаненные участники не найдены \ No newline at end of file diff --git a/Firebase/uikit/src/main/res/values-sv/strings.xml b/Firebase/uikit/src/main/res/values-sv/strings.xml index 8e12a85..81cc9c9 100644 --- a/Firebase/uikit/src/main/res/values-sv/strings.xml +++ b/Firebase/uikit/src/main/res/values-sv/strings.xml @@ -299,13 +299,12 @@ grupp laddar ner skapa grupp - Skicka meddelande privat + Skicka meddelande privat Visa profil i dag Vill du radera den här konversationen? Tar bort konversation skriver.. - Svara i chatt off-line Nya meddelanden Nytt meddelande @@ -318,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/Firebase/uikit/src/main/res/values-zh-rTW/strings.xml b/Firebase/uikit/src/main/res/values-zh-rTW/strings.xml index 810dc63..21e3f68 100644 --- a/Firebase/uikit/src/main/res/values-zh-rTW/strings.xml +++ b/Firebase/uikit/src/main/res/values-zh-rTW/strings.xml @@ -273,11 +273,10 @@ 剩下 正在下載 建立小组 - 私下发送消息 + 私下发送消息 查看資料 您要删除此对话吗? 删除对话 - 在聊天中回复 離線 新消息 新消息 @@ -290,4 +289,13 @@ 回复 回复 私下回复 + 選擇用戶 + 選擇組 + 搜索用戶 + 搜索組 + 被拒絕的語音電話 + 拒絕視頻通話 + 撥出語音電話 + 傳出視頻通話 + 沒有發現被禁止的成員 \ No newline at end of file diff --git a/Firebase/uikit/src/main/res/values-zh/strings.xml b/Firebase/uikit/src/main/res/values-zh/strings.xml index 4d847cb..1f70bc7 100644 --- a/Firebase/uikit/src/main/res/values-zh/strings.xml +++ b/Firebase/uikit/src/main/res/values-zh/strings.xml @@ -272,11 +272,10 @@ 剩下 正在下载 建立小组 - 私下发送消息 + 私下发送消息 查看资料 您要删除此对话吗? 删除对话 - 在聊天中回复 离线 新消息 新消息 @@ -289,4 +288,13 @@ 回复 回复 私下回复 + 选择用户 + 选择组 + 搜索用户 + 搜索组 + 被拒绝的语音电话 + 拒绝视频通话 + 拨出语音电话 + 传出视频通话 + 没有发现被禁止的成员 \ No newline at end of file diff --git a/Firebase/uikit/src/main/res/values/attr.xml b/Firebase/uikit/src/main/res/values/attr.xml index 7e46333..6cc34e7 100644 --- a/Firebase/uikit/src/main/res/values/attr.xml +++ b/Firebase/uikit/src/main/res/values/attr.xml @@ -7,10 +7,12 @@ - - + + + + diff --git a/Firebase/uikit/src/main/res/values/color.xml b/Firebase/uikit/src/main/res/values/color.xml index 895099a..32b3005 100644 --- a/Firebase/uikit/src/main/res/values/color.xml +++ b/Firebase/uikit/src/main/res/values/color.xml @@ -1,7 +1,7 @@ - #03A9F4 - #169CD8 + #3399FF + #808080 #2196F3 #000000 @@ -13,7 +13,6 @@ #40bdbdbd #E64CAF50 #eecc0000 - #979797 #ECECEC #FF9800 diff --git a/Firebase/uikit/src/main/res/values/colors.xml b/Firebase/uikit/src/main/res/values/colors.xml new file mode 100644 index 0000000..df40388 --- /dev/null +++ b/Firebase/uikit/src/main/res/values/colors.xml @@ -0,0 +1,4 @@ + + + #C4C4C4 + \ No newline at end of file diff --git a/Firebase/uikit/src/main/res/values/strings.xml b/Firebase/uikit/src/main/res/values/strings.xml index a7c4bcb..aa895a8 100644 --- a/Firebase/uikit/src/main/res/values/strings.xml +++ b/Firebase/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 @@ -273,11 +278,11 @@ joined Unban made - participant + Participant Translate Message No translation available - has shared a group call. - You\'ve created a group call. + has initiated a group call. + You\'ve initiated a group call. "📹 Group Call " Retry Uploading @@ -312,7 +317,7 @@ Downloading Creating Group - Send Message Privately + Send Message Privately View Profile Today In a thread @@ -331,6 +336,11 @@ New Message " New Messages" offline - Reply in Thread No Internet Available + Select User + Select Group + Search Users + Search Groups + Allow Background Location Permisssion + Please enable VoIP for this app