Skip to content

Commit

Permalink
v3.0.0-1
Browse files Browse the repository at this point in the history
  • Loading branch information
PoojaShivane committed Aug 16, 2021
1 parent c59aac2 commit 144c2af
Show file tree
Hide file tree
Showing 187 changed files with 3,967 additions and 1,129 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.3.30'
ext.kotlin_version = '1.5.20'
repositories {
google()
jcenter()

}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
classpath 'com.android.tools.build:gradle:3.5.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
6 changes: 4 additions & 2 deletions uikit-kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ android {
compileSdkVersion 29

defaultConfig {
minSdkVersion 21
minSdkVersion 24
targetSdkVersion 29
versionCode 1
versionName "1.0"
Expand Down Expand Up @@ -85,5 +85,7 @@ dependencies {
api 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.0'

//cometchat
compileOnly 'com.cometchat:pro-android-chat-sdk:3.0.0-beta4'
compileOnly 'com.cometchat:pro-android-chat-sdk:3.0.0'
implementation 'com.cometchat:pro-android-calls-sdk:2.1.0'

}
47 changes: 29 additions & 18 deletions uikit-kotlin/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
android:usesCleartextTraffic="true"
tools:node="merge"
tools:targetApi="m">
<activity android:name=".ui_components.calls.call_manager.CometChatStartCallActivity"></activity>
<activity android:name=".ui_components.chats.CometChatStartConversation" />
<activity android:name=".ui_components.calls.call_manager.CometChatStartCallActivity" />
<activity android:name=".ui_components.messages.extensions.collaborative.CometChatCollaborativeActivity" />
<activity android:name=".ui_components.messages.extensions.message_reaction.CometChatReactionInfoActivity" />
<activity android:name=".ui_components.messages.message_information.CometChatMessageInfoScreenActivity" />
Expand Down Expand Up @@ -59,31 +60,41 @@
android:screenOrientation="portrait" />
<activity
android:name=".ui_components.messages.forward_message.CometChatForwardMessageActivity"
android:screenOrientation="portrait" >
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="image/*"/>
<action android:name="android.intent.action.SEND" />

<category android:name="android.intent.category.DEFAULT" />

<data android:mimeType="image/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="text/*"/>
<action android:name="android.intent.action.SEND" />

<category android:name="android.intent.category.DEFAULT" />

<data android:mimeType="text/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="video/*"/>
<action android:name="android.intent.action.SEND" />

<category android:name="android.intent.category.DEFAULT" />

<data android:mimeType="video/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="audio/*"/>
<action android:name="android.intent.action.SEND" />

<category android:name="android.intent.category.DEFAULT" />

<data android:mimeType="audio/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="application/*"/>
<action android:name="android.intent.action.SEND" />

<category android:name="android.intent.category.DEFAULT" />

<data android:mimeType="application/*" />
</intent-filter>
</activity>
<activity
Expand All @@ -99,7 +110,7 @@
android:windowSoftInputMode="adjustResize" />
<activity
android:name=".ui_components.messages.message_list.CometChatMessageListActivity"
android:parentActivityName=".ui_components.cometchat_ui.CometChatUI"

android:screenOrientation="portrait" />

<provider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class CometChatNewCallList constructor() : AppCompatActivity() {
setContentView(R.layout.fragment_cometchat_userlist)
title = findViewById(R.id.tv_title)
val imageView: ImageView = ImageView(this)
imageView.setImageDrawable(resources.getDrawable(R.drawable.ic_close_24dp))
imageView.setImageDrawable(resources.getDrawable(R.drawable.ic_back))
if (UIKitSettings.color != null) {
window.statusBarColor = Color.parseColor(UIKitSettings.color)
imageView.imageTintList = ColorStateList.valueOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import com.cometchat.pro.core.CallSettings
import com.cometchat.pro.core.CallSettings.CallSettingsBuilder
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_resources.constants.UIKitConstants
import com.cometchat.pro.uikit.ui_resources.utils.ErrorMessagesUtils
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.cometchat.pro.uikit.ui_components.chats

import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.text.Editable
import android.text.TextWatcher
Expand All @@ -11,7 +12,6 @@ import android.view.inputmethod.InputMethodManager
import android.widget.*
import android.widget.TextView.OnEditorActionListener
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.ItemTouchHelper
import androidx.recyclerview.widget.RecyclerView
import com.cometchat.pro.constants.CometChatConstants
import com.cometchat.pro.core.CometChat
Expand All @@ -22,6 +22,9 @@ import com.cometchat.pro.exceptions.CometChatException
import com.cometchat.pro.helpers.CometChatHelper
import com.cometchat.pro.models.*
import com.cometchat.pro.uikit.R
import com.cometchat.pro.uikit.ui_components.chats.delete_chat.MyButton
import com.cometchat.pro.uikit.ui_components.chats.delete_chat.MyButtonClickListener
import com.cometchat.pro.uikit.ui_components.chats.delete_chat.MySwipeHelper
import com.cometchat.pro.uikit.ui_components.shared.cometchatConversations.CometChatConversation
import com.cometchat.pro.uikit.ui_resources.utils.ErrorMessagesUtils
import com.facebook.shimmer.ShimmerFrameLayout
Expand All @@ -30,6 +33,7 @@ import com.cometchat.pro.uikit.ui_resources.utils.FontUtils
import com.cometchat.pro.uikit.ui_resources.utils.Utils
import com.cometchat.pro.uikit.ui_settings.FeatureRestriction
import com.cometchat.pro.uikit.ui_settings.UIKitSettings
import com.cometchat.pro.uikit.ui_settings.enum.ConversationMode

/*
Expand Down Expand Up @@ -57,6 +61,7 @@ class CometChatConversationList : Fragment(), TextWatcher {
private var vw: View? = null
private var conversation : Conversation? = null
private var conversationList: MutableList<Conversation> = ArrayList()
private var ivStartConversation: ImageView? = null

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View? {
Expand All @@ -70,11 +75,16 @@ class CometChatConversationList : Fragment(), TextWatcher {
rlSearchBox = vw?.findViewById(R.id.rl_search_box)
conversationShimmer = vw?.findViewById(R.id.shimmer_layout)
clearSearch = vw?.findViewById(R.id.clear_search)
ivStartConversation = vw?.findViewById(R.id.iv_start_conversation)
if (!FeatureRestriction.isChatSearchEnabled()) {
searchEdit?.visibility = View.GONE
clearSearch?.visibility = View.GONE
}
checkDarkMode()
ivStartConversation?.setOnClickListener {
var intent = Intent(context, CometChatStartConversation::class.java)
startActivity(intent)
}
searchEdit?.setOnEditorActionListener(OnEditorActionListener { textView: TextView, i: Int, keyEvent: KeyEvent? ->
if (i == EditorInfo.IME_ACTION_SEARCH) {
rvConversation?.searchConversation(textView.text.toString())
Expand Down Expand Up @@ -115,7 +125,7 @@ class CometChatConversationList : Fragment(), TextWatcher {

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
object : MySwipeHelper(requireContext(),rvConversation as RecyclerView,200){
object : MySwipeHelper(requireContext(),rvConversation as RecyclerView,260){
override fun instantiateMyButton(
viewHolder: RecyclerView.ViewHolder,
buffer: MutableList<MyButton>
Expand Down Expand Up @@ -178,11 +188,7 @@ class CometChatConversationList : Fragment(), TextWatcher {
*/
private fun makeConversationList() {
if (conversationsRequest == null) {
when {
UIKitSettings.chatListMode -> conversationsRequest = ConversationsRequestBuilder().setLimit(50).build()
UIKitSettings.groupInMode -> conversationsRequest = ConversationsRequestBuilder().setConversationType(CometChatConstants.CONVERSATION_TYPE_GROUP).setLimit(50).build()
UIKitSettings.userInMode -> conversationsRequest = ConversationsRequestBuilder().setConversationType(CometChatConstants.CONVERSATION_TYPE_USER).setLimit(50).build()
}
conversationsRequest = ConversationsRequestBuilder().setConversationType(UIKitSettings.conversationInMode.toString()).setLimit(50).build()

}
conversationsRequest?.fetchNext(object : CallbackListener<List<Conversation>>() {
Expand Down Expand Up @@ -317,10 +323,10 @@ class CometChatConversationList : Fragment(), TextWatcher {
if (rvConversation != null) {
val conversation = CometChatHelper.getConversationFromMessage(baseMessage)
if (isRemove) rvConversation?.remove(conversation)
else if (UIKitSettings.chatListMode) rvConversation?.update(conversation)
else if (UIKitSettings.groupInMode && conversation.conversationType == CometChatConstants.CONVERSATION_TYPE_GROUP)
else if (UIKitSettings.conversationInMode == ConversationMode.ALL_CHATS) rvConversation?.update(conversation)
else if (UIKitSettings.conversationInMode == ConversationMode.GROUP && conversation.conversationType == CometChatConstants.CONVERSATION_TYPE_GROUP)
rvConversation?.update(conversation)
else if (UIKitSettings.userInMode && conversation.conversationType == CometChatConstants.CONVERSATION_TYPE_USER)
else if (UIKitSettings.conversationInMode == ConversationMode.USER && conversation.conversationType == CometChatConstants.CONVERSATION_TYPE_USER)
rvConversation?.update(conversation)
checkNoConverstaion()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
package com.cometchat.pro.uikit.ui_components.chats

import android.os.Bundle
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import androidx.viewpager.widget.ViewPager
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.enum.ConversationMode
import com.google.android.material.appbar.MaterialToolbar
import com.google.android.material.tabs.TabLayout

class CometChatStartConversation : AppCompatActivity() {

private var viewPager: ViewPager? = null

private var tabLayout: TabLayout? = null

private var adapter: TabAdapter? = null
private lateinit var toolbar : MaterialToolbar
private val conversationType: String = UIKitSettings.conversationInMode.toString()


override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_start_conversation_from_chat)

toolbar = findViewById(R.id.start_chat_toolbar)
tabLayout = findViewById(R.id.tabLayout)
viewPager = findViewById(R.id.viewPager)
adapter = TabAdapter(supportFragmentManager)

val cometChatUserList = CometChatUserList()
cometChatUserList.setTitleVisible(false)
val cometChatGroupList = CometChatGroupList()
cometChatGroupList.setTitleVisible(false)
cometChatGroupList.setGroupCreateVisible(false)

when (conversationType) {
ConversationMode.ALL_CHATS.toString() -> {
adapter?.addFragment(cometChatUserList, getString(R.string.users))
adapter?.addFragment(cometChatGroupList, getString(R.string.groups))
}
ConversationMode.GROUP.toString() -> {
toolbar.title = getString(R.string.select_group)
tabLayout?.visibility = View.GONE;
adapter?.addFragment(cometChatGroupList, getString(R.string.groups));
}
else -> {
toolbar.title = getString(R.string.select_user)
tabLayout?.visibility = View.GONE;
adapter?.addFragment(cometChatUserList, getString(R.string.users));
}
}

viewPager?.adapter = adapter
viewPager?.offscreenPageLimit = 3
tabLayout?.setupWithViewPager(viewPager)

tabLayout?.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener {
override fun onTabSelected(tab: TabLayout.Tab?) {
if (tab?.position == 0) {
toolbar.title = getString(R.string.select_user)
} else {
toolbar.title = getString(R.string.select_group)
}
}

override fun onTabUnselected(tab: TabLayout.Tab?) {

}

override fun onTabReselected(tab: TabLayout.Tab?) {

}

})

setSupportActionBar(toolbar)
supportActionBar?.setDisplayHomeAsUpEnabled(true)

}

override fun onSupportNavigateUp(): Boolean {
onBackPressed()
return true
}

override fun onBackPressed() {
super.onBackPressed()
finish()
}
}
Loading

0 comments on commit 144c2af

Please sign in to comment.