Skip to content

Commit a688bff

Browse files
Merge pull request #39 from sendbird/release/3.19.0
3.19.0
2 parents d7deb36 + 7b261b0 commit a688bff

File tree

233 files changed

+1086
-755
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

233 files changed

+1086
-755
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
2-
### v3.18.0 (Jun 20, 2024) with Chat SDK `v4.16.4`
2+
### v3.19.0 (Aug 1, 2024) with Chat SDK `v4.17.0`
3+
* Deprecated `authenticateFeed(AuthenticationHandler)` in `SendbirdUIKit`, which is replaced by `authenticate(AuthenticationHandler)`.
4+
* Fixed the crash issue caused by the `bindingAdapterPosition` in the RecyclerView not being returned correctly.
5+
* Support Right-to-Left (RTL) languages.### v3.18.0 (Jun 20, 2024) with Chat SDK `v4.16.4`
36
* Updated dependencies
47
* update compileSdkVersion to 34
58
* [Gradle Plugin] Gradle 8.6

build.gradle

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
buildscript {
3-
ext.kotlin_version = '1.7.10'
3+
ext.kotlin_version = '1.7.20'
4+
ext.paparazzi_version = '1.3.1'
45

56
dependencies {
67
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
78
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
9+
10+
// It will force the kotlin compiler version to be changed to a higher one, so it should only include the plugin in real tests.
11+
if (project.hasProperty('withSnapshotTest')) {
12+
classpath "app.cash.paparazzi:paparazzi-gradle-plugin:$paparazzi_version"
13+
}
814
}
915
}
1016
plugins {

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# http://www.gradle.org/docs/current/userguide/build_environment.html
77
# Specifies the JVM arguments used for the daemon process.
88
# The setting is particularly useful for tweaking memory settings.
9-
org.gradle.jvmargs=-Xmx1536m
9+
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
1010
# When configured, Gradle will run in incubating parallel mode.
1111
# This option should only be used with decoupled projects. More details, visit
1212
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
@@ -22,5 +22,5 @@ android.nonTransitiveRClass=false
2222
android.nonFinalResIds=false
2323
android.enableR8.fullMode=false
2424

25-
UIKIT_VERSION = 3.18.0
25+
UIKIT_VERSION = 3.19.0
2626
UIKIT_VERSION_CODE = 1

uikit-samples/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ android {
3434
}
3535

3636
dependencies {
37-
// implementation project(":uikit")
38-
implementation "com.sendbird.sdk:uikit:$UIKIT_VERSION"
37+
implementation "com.sendbird.sdk:uikit:$UIKIT_VERSION"
3938

4039
implementation(platform("com.google.firebase:firebase-bom:32.2.3"))
4140
implementation "androidx.multidex:multidex:2.0.1"

uikit-samples/src/main/AndroidManifest.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
android:icon="@mipmap/ic_launcher"
1414
android:label="@string/app_name"
1515
android:roundIcon="@mipmap/ic_launcher"
16-
android:supportsRtl="false"
16+
android:supportsRtl="true"
1717
android:resizeableActivity="false"
1818
android:theme="@style/AppTheme"
1919
tools:ignore="GoogleAppIndexingWarning"
@@ -29,7 +29,9 @@
2929
<!-- common activities -->
3030
<activity
3131
android:name=".common.SelectServiceActivity"
32-
android:launchMode="singleTask" />
32+
android:launchMode="singleTask"
33+
android:configChanges="orientation|screenSize|keyboardHidden"
34+
android:windowSoftInputMode="adjustResize|stateHidden"/>
3335
<activity
3436
android:name=".common.LoginActivity"
3537
android:launchMode="singleTop"

uikit-samples/src/main/java/com/sendbird/uikit/samples/BaseApplication.kt

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,15 @@ import com.sendbird.uikit.samples.common.fcm.MyFirebaseMessagingService
2323
import com.sendbird.uikit.samples.common.preferences.PreferenceUtils
2424

2525
private const val APP_ID = "FEA2129A-EA73-4EB9-9E0B-EC738E7EB768"
26-
internal const val enableAiChatBotSample = false
27-
internal const val enableNotificationSample = false
26+
internal const val enableAiChatBotSample = true
27+
internal const val enableNotificationSample = true
2828

2929
class BaseApplication : MultiDexApplication() {
3030
companion object {
3131
internal val initState = MutableLiveData(InitState.NONE)
3232

33-
/**
34-
* Returns the state of the result from initialization of Sendbird UIKit.
35-
*
36-
* @return the [InitState] instance
37-
*/
38-
fun initStateChanges(): LiveData<InitState> {
39-
return initState
40-
}
41-
42-
private fun initUIKit(context: Context) {
43-
SendbirdUIKit.init(object : SendbirdUIKitAdapter {
33+
internal val adapter by lazy {
34+
object : SendbirdUIKitAdapter {
4435
override fun getAppId(): String = PreferenceUtils.appId.ifEmpty { APP_ID }
4536

4637
override fun getAccessToken(): String? = null
@@ -64,12 +55,25 @@ class BaseApplication : MultiDexApplication() {
6455
initState.value = InitState.SUCCEED
6556
}
6657
}
67-
}, context)
58+
}
59+
}
60+
61+
/**
62+
* Returns the state of the result from initialization of Sendbird UIKit.
63+
*
64+
* @return the [InitState] instance
65+
*/
66+
fun initStateChanges(): LiveData<InitState> {
67+
return initState
68+
}
69+
70+
private fun initUIKit(context: Context) {
71+
SendbirdUIKit.init(adapter, context)
6872

6973
// set theme mode
7074
SendbirdUIKit.setDefaultThemeMode(PreferenceUtils.themeMode)
7175
// register push notification
72-
SendbirdPushHelper.registerPushHandler(MyFirebaseMessagingService())
76+
SendbirdPushHelper.registerHandler(MyFirebaseMessagingService())
7377
// set logger
7478
SendbirdUIKit.setLogLevel(SendbirdUIKit.LogLevel.ALL)
7579
}
@@ -98,6 +102,7 @@ class BaseApplication : MultiDexApplication() {
98102
UIKitConfig.groupChannelConfig.typingIndicatorTypes = setOf(TypingIndicatorType.BUBBLE, TypingIndicatorType.TEXT)
99103
// set whether to use feedback
100104
UIKitConfig.groupChannelConfig.enableFeedback = true
105+
101106
// set custom params
102107
SendbirdUIKit.setCustomParamsHandler(object : CustomParamsHandler {
103108
override fun onBeforeCreateOpenChannel(params: OpenChannelCreateParams) {

uikit-samples/src/main/java/com/sendbird/uikit/samples/aichatbot/AiChatBotLoginActivity.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ class AiChatBotLoginActivity : LoginActivity() {
1919
override fun onCreate(savedInstanceState: Bundle?) {
2020
super.onCreate(savedInstanceState)
2121
binding.apply {
22-
title.visibility = View.GONE
2322
botIdLayout.visibility = View.VISIBLE
24-
notificationTitle.visibility = View.VISIBLE
2523
botId.setText(PreferenceUtils.botId.ifEmpty { "client_bot" })
2624
}
2725
}
@@ -43,7 +41,7 @@ class AiChatBotLoginActivity : LoginActivity() {
4341
}
4442
PreferenceUtils.userId = userId
4543
PreferenceUtils.nickname = nickname
46-
SendbirdPushHelper.registerPushHandler(MyFirebaseMessagingService())
44+
SendbirdPushHelper.registerHandler(MyFirebaseMessagingService())
4745
val intent = PreferenceUtils.selectedSampleType.startingIntent(this)
4846
startActivity(intent)
4947
finish()

uikit-samples/src/main/java/com/sendbird/uikit/samples/basic/BasicHomeActivity.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@ class BasicHomeActivity : ThemeHomeActivity() {
7878
// initialize total unread count
7979
SendbirdChat.getTotalUnreadMessageCount(
8080
GroupChannelTotalUnreadMessageCountParams(),
81-
UnreadMessageCountHandler { totalCount: Int, _: Int, e: SendbirdException? ->
81+
UnreadMessageCountHandler { groupChannelCount: Int, _: Int, e: SendbirdException? ->
8282
if (e != null) {
8383
return@UnreadMessageCountHandler
8484
}
85-
if (totalCount > 0) {
85+
if (groupChannelCount > 0) {
8686
binding.groupChannelButton.unreadCountVisibility = View.VISIBLE
8787
binding.groupChannelButton.unreadCount =
88-
if (totalCount > 99) getString(R.string.text_tab_badge_max_count) else totalCount.toString()
88+
if (groupChannelCount > 99) getString(R.string.text_tab_badge_max_count) else groupChannelCount.toString()
8989
} else {
9090
binding.groupChannelButton.unreadCountVisibility = View.GONE
9191
}
@@ -94,11 +94,11 @@ class BasicHomeActivity : ThemeHomeActivity() {
9494
SendbirdChat.addUserEventHandler(USER_EVENT_HANDLER_KEY, object : UserEventHandler() {
9595
override fun onFriendsDiscovered(users: List<User>) {}
9696
override fun onTotalUnreadMessageCountChanged(unreadMessageCount: UnreadMessageCount) {
97-
val totalCount = unreadMessageCount.groupChannelCount
98-
if (totalCount > 0) {
97+
val groupChannelCount = unreadMessageCount.groupChannelCount
98+
if (groupChannelCount > 0) {
9999
binding.groupChannelButton.unreadCountVisibility = View.VISIBLE
100100
binding.groupChannelButton.unreadCount =
101-
if (totalCount > 99) getString(R.string.text_tab_badge_max_count) else totalCount.toString()
101+
if (groupChannelCount > 99) getString(R.string.text_tab_badge_max_count) else groupChannelCount.toString()
102102
} else {
103103
binding.groupChannelButton.unreadCountVisibility = View.GONE
104104
}

uikit-samples/src/main/java/com/sendbird/uikit/samples/basic/GroupChannelMainActivity.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,24 +66,24 @@ class GroupChannelMainActivity : AppCompatActivity() {
6666
super.onResume()
6767
SendbirdChat.getTotalUnreadMessageCount(
6868
GroupChannelTotalUnreadMessageCountParams(),
69-
UnreadMessageCountHandler { totalCount: Int, _: Int, e: SendbirdException? ->
69+
UnreadMessageCountHandler { groupChannelCount: Int, _: Int, e: SendbirdException? ->
7070
if (e != null) {
7171
return@UnreadMessageCountHandler
7272
}
73-
if (totalCount > 0) {
73+
if (groupChannelCount > 0) {
7474
unreadCountTab.setBadgeVisibility(View.VISIBLE)
75-
unreadCountTab.setBadgeCount(if (totalCount > 99) getString(R.string.text_tab_badge_max_count) else totalCount.toString())
75+
unreadCountTab.setBadgeCount(if (groupChannelCount > 99) getString(R.string.text_tab_badge_max_count) else groupChannelCount.toString())
7676
} else {
7777
unreadCountTab.setBadgeVisibility(View.GONE)
7878
}
7979
})
8080
SendbirdChat.addUserEventHandler(USER_EVENT_HANDLER_KEY, object : UserEventHandler() {
8181
override fun onFriendsDiscovered(users: List<User>) {}
8282
override fun onTotalUnreadMessageCountChanged(unreadMessageCount: UnreadMessageCount) {
83-
val totalCount = unreadMessageCount.groupChannelCount
84-
if (totalCount > 0) {
83+
val groupChannelCount = unreadMessageCount.groupChannelCount
84+
if (groupChannelCount > 0) {
8585
unreadCountTab.setBadgeVisibility(View.VISIBLE)
86-
unreadCountTab.setBadgeCount(if (totalCount > 99) getString(R.string.text_tab_badge_max_count) else totalCount.toString())
86+
unreadCountTab.setBadgeCount(if (groupChannelCount > 99) getString(R.string.text_tab_badge_max_count) else groupChannelCount.toString())
8787
} else {
8888
unreadCountTab.setBadgeVisibility(View.GONE)
8989
}

uikit-samples/src/main/java/com/sendbird/uikit/samples/common/LoginActivity.kt

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ package com.sendbird.uikit.samples.common
22

33
import android.content.Intent
44
import android.os.Bundle
5-
import android.os.Process
6-
import android.view.View
75
import androidx.appcompat.app.AppCompatActivity
86
import com.sendbird.android.SendbirdChat.sdkVersion
97
import com.sendbird.android.exception.SendbirdException
@@ -12,9 +10,11 @@ import com.sendbird.android.user.User
1210
import com.sendbird.uikit.SendbirdUIKit
1311
import com.sendbird.uikit.log.Logger
1412
import com.sendbird.uikit.samples.R
13+
import com.sendbird.uikit.samples.common.extensions.apiHost
1514
import com.sendbird.uikit.samples.common.extensions.authenticate
1615
import com.sendbird.uikit.samples.common.extensions.getLogoDrawable
1716
import com.sendbird.uikit.samples.common.extensions.startingIntent
17+
import com.sendbird.uikit.samples.common.extensions.wsHost
1818
import com.sendbird.uikit.samples.common.fcm.MyFirebaseMessagingService
1919
import com.sendbird.uikit.samples.common.preferences.PreferenceUtils
2020
import com.sendbird.uikit.samples.common.widgets.WaitingDialog
@@ -30,30 +30,17 @@ open class LoginActivity : AppCompatActivity() {
3030
super.onCreate(savedInstanceState)
3131
binding.apply {
3232
val context = this@LoginActivity
33-
applicationId.visibility = View.VISIBLE
34-
saveButton.visibility = View.VISIBLE
3533
userId.setSelectAllOnFocus(true)
3634
nickname.setSelectAllOnFocus(true)
3735
versionInfo.text = String.format(
3836
resources.getString(R.string.text_version_info),
3937
com.sendbird.uikit.BuildConfig.VERSION_NAME,
4038
sdkVersion
4139
)
42-
SendbirdUIKit.getAdapter()?.appId?.let { applicationId.setText(it) }
4340

4441
val sampleType = PreferenceUtils.selectedSampleType
4542
logoImageView.background = sampleType.getLogoDrawable(context)
4643
title.text = "${sampleType?.name} Sample"
47-
saveButton.setOnClickListener {
48-
val appId = applicationId.text
49-
if (!appId.isNullOrEmpty()) {
50-
PreferenceUtils.appId = appId.toString()
51-
saveButton.postDelayed({
52-
finish()
53-
Process.killProcess(Process.myPid())
54-
}, 500)
55-
}
56-
}
5744
signInButton.setOnClickListener {
5845
// Remove all spaces from userID
5946
val userId = binding.userId.text.toString().replace("\\s".toRegex(), "")
@@ -63,10 +50,15 @@ open class LoginActivity : AppCompatActivity() {
6350
}
6451
PreferenceUtils.userId = userId
6552
PreferenceUtils.nickname = nickname
53+
// set region
54+
val region = PreferenceUtils.region
55+
SendbirdUIKit.setCustomHosts(
56+
region.apiHost(),
57+
region.wsHost()
58+
)
6659
onSignUp(userId, nickname)
6760
}
6861
selectSampleLayout.setOnClickListener {
69-
PreferenceUtils.clearAll()
7062
startActivity(Intent(context, SelectServiceActivity::class.java))
7163
finish()
7264
}
@@ -80,14 +72,16 @@ open class LoginActivity : AppCompatActivity() {
8072
authenticate { _: User?, e: SendbirdException? ->
8173
if (e != null) {
8274
Logger.e(e)
75+
PreferenceUtils.userId = ""
76+
PreferenceUtils.nickname = ""
8377
ContextUtils.toastError(this@LoginActivity, "${e.message}")
8478
WaitingDialog.dismiss()
8579
return@authenticate
8680
}
8781
WaitingDialog.dismiss()
8882
PreferenceUtils.userId = userId
8983
PreferenceUtils.nickname = nickname
90-
SendbirdPushHelper.registerPushHandler(MyFirebaseMessagingService())
84+
SendbirdPushHelper.registerHandler(MyFirebaseMessagingService())
9185
val intent = PreferenceUtils.selectedSampleType.startingIntent(this)
9286
startActivity(intent)
9387
finish()

uikit-samples/src/main/java/com/sendbird/uikit/samples/common/SampleSettingsFragment.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ import com.sendbird.uikit.utils.FileUtils
5252
import com.sendbird.uikit.utils.IntentUtils
5353
import com.sendbird.uikit.utils.PermissionUtils
5454
import com.sendbird.uikit.utils.TextUtils
55+
import java.io.File
5556
import java.util.Locale
5657
import java.util.TimeZone
57-
import java.io.File
5858

5959
/**
6060
* Displays a settings screen.

0 commit comments

Comments
 (0)