Skip to content

Commit

Permalink
v3.0.0-2
Browse files Browse the repository at this point in the history
  • Loading branch information
PoojaShivane committed Aug 26, 2021
1 parent a8da381 commit f9a43fd
Show file tree
Hide file tree
Showing 47 changed files with 1,329 additions and 955 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 29
compileSdkVersion 30
defaultConfig {
applicationId "com.cometchat.pro.androiduikit"
minSdkVersion 24
targetSdkVersion 29
targetSdkVersion 30
versionCode 1
renderscriptSupportModeEnabled true
multiDexEnabled true
Expand Down
Binary file removed app/release/app-release.apk
Binary file not shown.
1 change: 0 additions & 1 deletion app/release/output.json

This file was deleted.

1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

<application
android:name=".UIKitApplication"
android:requestLegacyExternalStorage="true"
android:icon="@drawable/cc_small"
android:label="@string/app_name"
android:roundIcon="@drawable/cc_small"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class CallListViewFragment : Fragment() {
}

override fun onError(e: CometChatException) {
Log.e("onError: ", e.message)
e.message?.let { Log.e("onError: ", it) }
if (rvCallList != null) Snackbar.make(rvCallList!!, com.cometchat.pro.uikit.R.string.call_list_error, Snackbar.LENGTH_LONG).show()
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class ConversationListViewFragment : Fragment() {
}

override fun onError(e: CometChatException) {
Log.e("onError: ", e.message)
e.message?.let { Log.e("onError: ", it) }
}
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class GroupListViewFragment : Fragment() {
override fun onError(e: CometChatException) {
groupBinding!!.contactShimmer.stopShimmer()
groupBinding!!.contactShimmer.visibility = View.GONE
Log.e("onError: ", e.message)
e.message?.let { Log.e("onError: ", it) }
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {

}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.4'
classpath 'com.android.tools.build:gradle:4.0.1'
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
8 changes: 6 additions & 2 deletions uikit-kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 29
compileSdkVersion 30

defaultConfig {
minSdkVersion 24
targetSdkVersion 29
targetSdkVersion 30
versionCode 1
versionName "1.0"
multiDexEnabled true
Expand Down Expand Up @@ -88,4 +88,8 @@ dependencies {
compileOnly 'com.cometchat:pro-android-chat-sdk:3.0.0'
implementation 'com.cometchat:pro-android-calls-sdk:2.1.0'

def activityKtxVersion = "1.3.1"
implementation "androidx.activity:activity-ktx:$activityKtxVersion"
def fragmentKtxVersion = "1.4.0-alpha06"
implementation "androidx.fragment:fragment-ktx:$fragmentKtxVersion"
}
37 changes: 7 additions & 30 deletions uikit-kotlin/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.VIBRATE" />

Expand All @@ -17,7 +17,8 @@
android:requestLegacyExternalStorage="true"
android:usesCleartextTraffic="true"
tools:node="merge"
tools:targetApi="m">
tools:targetApi="R">

<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" />
Expand Down Expand Up @@ -66,34 +67,10 @@

<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/*" />
</intent-filter>
<intent-filter>
<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="image/*" />
<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="video/*" />
<data android:mimeType="application/*" />
</intent-filter>
</activity>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class AllCall : Fragment() {

override fun onError(e: CometChatException) {
stopHideShimmer()
Log.e("onError: ", e.message)
e.message?.let { Log.e("onError: ", it) }
if (rvCallList != null)
ErrorMessagesUtils.cometChatErrorMessage(context, e.code)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ class CometChatStartCallActivity : AppCompatActivity() {

CometChat.startCall(callSettings, object : CometChat.OngoingCallListener {
override fun onUserJoined(p0: User?) {
Log.e("onUserJoined: ", p0?.uid)
p0?.uid?.let { Log.e("onUserJoined: ", it) }
}

override fun onUserLeft(p0: User?) {
Log.e("onUserLeft: ", p0?.uid)
p0?.uid?.let { Log.e("onUserLeft: ", it) }
}

override fun onError(p0: CometChatException) {
Log.e("onstartcallError: ", p0?.message)
p0.message?.let { Log.e("onstartcallError: ", it) }
ErrorMessagesUtils.cometChatErrorMessage(this@CometChatStartCallActivity, p0.code)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
package com.cometchat.pro.uikit.ui_components.chats

import android.app.ProgressDialog
import android.content.Context
import android.content.DialogInterface
import android.content.Intent
import android.graphics.Bitmap
import android.os.Bundle
import android.os.Handler
import android.text.Editable
import android.text.TextWatcher
import android.util.Log
Expand All @@ -11,6 +15,7 @@ import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputMethodManager
import android.widget.*
import android.widget.TextView.OnEditorActionListener
import androidx.appcompat.app.AlertDialog
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.RecyclerView
import com.cometchat.pro.constants.CometChatConstants
Expand All @@ -22,15 +27,13 @@ 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
import com.cometchat.pro.uikit.ui_resources.utils.item_clickListener.OnItemClickListener
import com.cometchat.pro.uikit.ui_resources.utils.FontUtils
import com.cometchat.pro.uikit.ui_resources.utils.Utils
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.cometchat.pro.uikit.ui_settings.enum.ConversationMode
Expand Down Expand Up @@ -120,27 +123,59 @@ class CometChatConversationList : Fragment(), TextWatcher {
events.OnItemClick(t as Conversation, position)
}
})
return vw
}

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
object : MySwipeHelper(requireContext(),rvConversation as RecyclerView,260){
override fun instantiateMyButton(
viewHolder: RecyclerView.ViewHolder,
buffer: MutableList<MyButton>
val swipeHelper: RecyclerViewSwipeListener = object : RecyclerViewSwipeListener(context) {
override fun instantiateUnderlayButton(
viewHolder: RecyclerView.ViewHolder?,
underlayButtons: MutableList<UnderlayButton>?
) {
buffer.add(MyButton(object : MyButtonClickListener {
override fun onClick(pos: Int) {
var conversation : Conversation = conversationList[pos]
deleteConversations(conversation)
val deleteBitmap: Bitmap = Utils.drawableToBitmap(
resources.getDrawable(R.drawable.ic_delete_white)
)
FeatureRestriction.isDeleteConversationEnabled(object :
FeatureRestriction.OnSuccessListener {
override fun onSuccess(booleanVal: Boolean) {
if (booleanVal) {
underlayButtons?.add(UnderlayButton(
"",
deleteBitmap,
resources.getColor(R.color.red),
object : UnderlayButtonClickListener {
override fun onClick(pos: Int) {
val conversation: Conversation? = rvConversation?.getConversation(pos)
if (conversation != null) {
deleteConversations(conversation)
}
}
}
))
}
}
}))
})
}

}
swipeHelper.attachToRecyclerView(rvConversation)
return vw
}

// override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
// super.onViewCreated(view, savedInstanceState)
// object : MySwipeHelper(requireContext(),rvConversation as RecyclerView,260){
// override fun instantiateMyButton(
// viewHolder: RecyclerView.ViewHolder,
// buffer: MutableList<MyButton>
// ) {
// buffer.add(MyButton(object : MyButtonClickListener {
// override fun onClick(pos: Int) {
// var conversation : Conversation = conversationList[pos]
// deleteConversations(conversation)
// }
// }))
// }
//
// }
// }

private fun deleteConversations(conversation: Conversation) {
var entity = AppEntity()
if (conversation.conversationType == CometChatConstants.CONVERSATION_TYPE_USER) {
Expand Down
Loading

0 comments on commit f9a43fd

Please sign in to comment.