diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4589be08..d8602517 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,8 @@
# Changelog
-### v3.18.0 (Jun 20, 2024) with Chat SDK `v4.16.4`
+### v3.19.0 (Aug 1, 2024) with Chat SDK `v4.17.0`
+* Deprecated `authenticateFeed(AuthenticationHandler)` in `SendbirdUIKit`, which is replaced by `authenticate(AuthenticationHandler)`.
+* Fixed the crash issue caused by the `bindingAdapterPosition` in the RecyclerView not being returned correctly.
+* Support Right-to-Left (RTL) languages.### v3.18.0 (Jun 20, 2024) with Chat SDK `v4.16.4`
* Updated dependencies
* update compileSdkVersion to 34
* [Gradle Plugin] Gradle 8.6
diff --git a/build.gradle b/build.gradle
index 83c8202e..f0348b4e 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,10 +1,16 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
- ext.kotlin_version = '1.7.10'
+ ext.kotlin_version = '1.7.20'
+ ext.paparazzi_version = '1.3.1'
dependencies {
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
+
+ // It will force the kotlin compiler version to be changed to a higher one, so it should only include the plugin in real tests.
+ if (project.hasProperty('withSnapshotTest')) {
+ classpath "app.cash.paparazzi:paparazzi-gradle-plugin:$paparazzi_version"
+ }
}
}
plugins {
diff --git a/gradle.properties b/gradle.properties
index a18ed14a..0d11182a 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -6,7 +6,7 @@
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
-org.gradle.jvmargs=-Xmx1536m
+org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
@@ -22,5 +22,5 @@ android.nonTransitiveRClass=false
android.nonFinalResIds=false
android.enableR8.fullMode=false
-UIKIT_VERSION = 3.18.0
+UIKIT_VERSION = 3.19.0
UIKIT_VERSION_CODE = 1
diff --git a/uikit-samples/build.gradle b/uikit-samples/build.gradle
index 7a0681e2..5b989d53 100644
--- a/uikit-samples/build.gradle
+++ b/uikit-samples/build.gradle
@@ -34,8 +34,7 @@ android {
}
dependencies {
-// implementation project(":uikit")
- implementation "com.sendbird.sdk:uikit:$UIKIT_VERSION"
+ implementation "com.sendbird.sdk:uikit:$UIKIT_VERSION"
implementation(platform("com.google.firebase:firebase-bom:32.2.3"))
implementation "androidx.multidex:multidex:2.0.1"
diff --git a/uikit-samples/src/main/AndroidManifest.xml b/uikit-samples/src/main/AndroidManifest.xml
index 8415c6fe..194cb909 100644
--- a/uikit-samples/src/main/AndroidManifest.xml
+++ b/uikit-samples/src/main/AndroidManifest.xml
@@ -13,7 +13,7 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher"
- android:supportsRtl="false"
+ android:supportsRtl="true"
android:resizeableActivity="false"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning"
@@ -29,7 +29,9 @@
+ android:launchMode="singleTask"
+ android:configChanges="orientation|screenSize|keyboardHidden"
+ android:windowSoftInputMode="adjustResize|stateHidden"/>
{
- return initState
- }
-
- private fun initUIKit(context: Context) {
- SendbirdUIKit.init(object : SendbirdUIKitAdapter {
+ internal val adapter by lazy {
+ object : SendbirdUIKitAdapter {
override fun getAppId(): String = PreferenceUtils.appId.ifEmpty { APP_ID }
override fun getAccessToken(): String? = null
@@ -64,12 +55,25 @@ class BaseApplication : MultiDexApplication() {
initState.value = InitState.SUCCEED
}
}
- }, context)
+ }
+ }
+
+ /**
+ * Returns the state of the result from initialization of Sendbird UIKit.
+ *
+ * @return the [InitState] instance
+ */
+ fun initStateChanges(): LiveData {
+ return initState
+ }
+
+ private fun initUIKit(context: Context) {
+ SendbirdUIKit.init(adapter, context)
// set theme mode
SendbirdUIKit.setDefaultThemeMode(PreferenceUtils.themeMode)
// register push notification
- SendbirdPushHelper.registerPushHandler(MyFirebaseMessagingService())
+ SendbirdPushHelper.registerHandler(MyFirebaseMessagingService())
// set logger
SendbirdUIKit.setLogLevel(SendbirdUIKit.LogLevel.ALL)
}
@@ -98,6 +102,7 @@ class BaseApplication : MultiDexApplication() {
UIKitConfig.groupChannelConfig.typingIndicatorTypes = setOf(TypingIndicatorType.BUBBLE, TypingIndicatorType.TEXT)
// set whether to use feedback
UIKitConfig.groupChannelConfig.enableFeedback = true
+
// set custom params
SendbirdUIKit.setCustomParamsHandler(object : CustomParamsHandler {
override fun onBeforeCreateOpenChannel(params: OpenChannelCreateParams) {
diff --git a/uikit-samples/src/main/java/com/sendbird/uikit/samples/aichatbot/AiChatBotLoginActivity.kt b/uikit-samples/src/main/java/com/sendbird/uikit/samples/aichatbot/AiChatBotLoginActivity.kt
index ba771fbb..b12651db 100644
--- a/uikit-samples/src/main/java/com/sendbird/uikit/samples/aichatbot/AiChatBotLoginActivity.kt
+++ b/uikit-samples/src/main/java/com/sendbird/uikit/samples/aichatbot/AiChatBotLoginActivity.kt
@@ -19,9 +19,7 @@ class AiChatBotLoginActivity : LoginActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding.apply {
- title.visibility = View.GONE
botIdLayout.visibility = View.VISIBLE
- notificationTitle.visibility = View.VISIBLE
botId.setText(PreferenceUtils.botId.ifEmpty { "client_bot" })
}
}
@@ -43,7 +41,7 @@ class AiChatBotLoginActivity : LoginActivity() {
}
PreferenceUtils.userId = userId
PreferenceUtils.nickname = nickname
- SendbirdPushHelper.registerPushHandler(MyFirebaseMessagingService())
+ SendbirdPushHelper.registerHandler(MyFirebaseMessagingService())
val intent = PreferenceUtils.selectedSampleType.startingIntent(this)
startActivity(intent)
finish()
diff --git a/uikit-samples/src/main/java/com/sendbird/uikit/samples/basic/BasicHomeActivity.kt b/uikit-samples/src/main/java/com/sendbird/uikit/samples/basic/BasicHomeActivity.kt
index 7c4e5cf6..03d78a51 100644
--- a/uikit-samples/src/main/java/com/sendbird/uikit/samples/basic/BasicHomeActivity.kt
+++ b/uikit-samples/src/main/java/com/sendbird/uikit/samples/basic/BasicHomeActivity.kt
@@ -78,14 +78,14 @@ class BasicHomeActivity : ThemeHomeActivity() {
// initialize total unread count
SendbirdChat.getTotalUnreadMessageCount(
GroupChannelTotalUnreadMessageCountParams(),
- UnreadMessageCountHandler { totalCount: Int, _: Int, e: SendbirdException? ->
+ UnreadMessageCountHandler { groupChannelCount: Int, _: Int, e: SendbirdException? ->
if (e != null) {
return@UnreadMessageCountHandler
}
- if (totalCount > 0) {
+ if (groupChannelCount > 0) {
binding.groupChannelButton.unreadCountVisibility = View.VISIBLE
binding.groupChannelButton.unreadCount =
- if (totalCount > 99) getString(R.string.text_tab_badge_max_count) else totalCount.toString()
+ if (groupChannelCount > 99) getString(R.string.text_tab_badge_max_count) else groupChannelCount.toString()
} else {
binding.groupChannelButton.unreadCountVisibility = View.GONE
}
@@ -94,11 +94,11 @@ class BasicHomeActivity : ThemeHomeActivity() {
SendbirdChat.addUserEventHandler(USER_EVENT_HANDLER_KEY, object : UserEventHandler() {
override fun onFriendsDiscovered(users: List) {}
override fun onTotalUnreadMessageCountChanged(unreadMessageCount: UnreadMessageCount) {
- val totalCount = unreadMessageCount.groupChannelCount
- if (totalCount > 0) {
+ val groupChannelCount = unreadMessageCount.groupChannelCount
+ if (groupChannelCount > 0) {
binding.groupChannelButton.unreadCountVisibility = View.VISIBLE
binding.groupChannelButton.unreadCount =
- if (totalCount > 99) getString(R.string.text_tab_badge_max_count) else totalCount.toString()
+ if (groupChannelCount > 99) getString(R.string.text_tab_badge_max_count) else groupChannelCount.toString()
} else {
binding.groupChannelButton.unreadCountVisibility = View.GONE
}
diff --git a/uikit-samples/src/main/java/com/sendbird/uikit/samples/basic/GroupChannelMainActivity.kt b/uikit-samples/src/main/java/com/sendbird/uikit/samples/basic/GroupChannelMainActivity.kt
index 16b33c60..05e9267c 100644
--- a/uikit-samples/src/main/java/com/sendbird/uikit/samples/basic/GroupChannelMainActivity.kt
+++ b/uikit-samples/src/main/java/com/sendbird/uikit/samples/basic/GroupChannelMainActivity.kt
@@ -66,13 +66,13 @@ class GroupChannelMainActivity : AppCompatActivity() {
super.onResume()
SendbirdChat.getTotalUnreadMessageCount(
GroupChannelTotalUnreadMessageCountParams(),
- UnreadMessageCountHandler { totalCount: Int, _: Int, e: SendbirdException? ->
+ UnreadMessageCountHandler { groupChannelCount: Int, _: Int, e: SendbirdException? ->
if (e != null) {
return@UnreadMessageCountHandler
}
- if (totalCount > 0) {
+ if (groupChannelCount > 0) {
unreadCountTab.setBadgeVisibility(View.VISIBLE)
- unreadCountTab.setBadgeCount(if (totalCount > 99) getString(R.string.text_tab_badge_max_count) else totalCount.toString())
+ unreadCountTab.setBadgeCount(if (groupChannelCount > 99) getString(R.string.text_tab_badge_max_count) else groupChannelCount.toString())
} else {
unreadCountTab.setBadgeVisibility(View.GONE)
}
@@ -80,10 +80,10 @@ class GroupChannelMainActivity : AppCompatActivity() {
SendbirdChat.addUserEventHandler(USER_EVENT_HANDLER_KEY, object : UserEventHandler() {
override fun onFriendsDiscovered(users: List) {}
override fun onTotalUnreadMessageCountChanged(unreadMessageCount: UnreadMessageCount) {
- val totalCount = unreadMessageCount.groupChannelCount
- if (totalCount > 0) {
+ val groupChannelCount = unreadMessageCount.groupChannelCount
+ if (groupChannelCount > 0) {
unreadCountTab.setBadgeVisibility(View.VISIBLE)
- unreadCountTab.setBadgeCount(if (totalCount > 99) getString(R.string.text_tab_badge_max_count) else totalCount.toString())
+ unreadCountTab.setBadgeCount(if (groupChannelCount > 99) getString(R.string.text_tab_badge_max_count) else groupChannelCount.toString())
} else {
unreadCountTab.setBadgeVisibility(View.GONE)
}
diff --git a/uikit-samples/src/main/java/com/sendbird/uikit/samples/common/LoginActivity.kt b/uikit-samples/src/main/java/com/sendbird/uikit/samples/common/LoginActivity.kt
index 026a926b..5701edc5 100644
--- a/uikit-samples/src/main/java/com/sendbird/uikit/samples/common/LoginActivity.kt
+++ b/uikit-samples/src/main/java/com/sendbird/uikit/samples/common/LoginActivity.kt
@@ -2,8 +2,6 @@ package com.sendbird.uikit.samples.common
import android.content.Intent
import android.os.Bundle
-import android.os.Process
-import android.view.View
import androidx.appcompat.app.AppCompatActivity
import com.sendbird.android.SendbirdChat.sdkVersion
import com.sendbird.android.exception.SendbirdException
@@ -12,9 +10,11 @@ import com.sendbird.android.user.User
import com.sendbird.uikit.SendbirdUIKit
import com.sendbird.uikit.log.Logger
import com.sendbird.uikit.samples.R
+import com.sendbird.uikit.samples.common.extensions.apiHost
import com.sendbird.uikit.samples.common.extensions.authenticate
import com.sendbird.uikit.samples.common.extensions.getLogoDrawable
import com.sendbird.uikit.samples.common.extensions.startingIntent
+import com.sendbird.uikit.samples.common.extensions.wsHost
import com.sendbird.uikit.samples.common.fcm.MyFirebaseMessagingService
import com.sendbird.uikit.samples.common.preferences.PreferenceUtils
import com.sendbird.uikit.samples.common.widgets.WaitingDialog
@@ -30,8 +30,6 @@ open class LoginActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)
binding.apply {
val context = this@LoginActivity
- applicationId.visibility = View.VISIBLE
- saveButton.visibility = View.VISIBLE
userId.setSelectAllOnFocus(true)
nickname.setSelectAllOnFocus(true)
versionInfo.text = String.format(
@@ -39,21 +37,10 @@ open class LoginActivity : AppCompatActivity() {
com.sendbird.uikit.BuildConfig.VERSION_NAME,
sdkVersion
)
- SendbirdUIKit.getAdapter()?.appId?.let { applicationId.setText(it) }
val sampleType = PreferenceUtils.selectedSampleType
logoImageView.background = sampleType.getLogoDrawable(context)
title.text = "${sampleType?.name} Sample"
- saveButton.setOnClickListener {
- val appId = applicationId.text
- if (!appId.isNullOrEmpty()) {
- PreferenceUtils.appId = appId.toString()
- saveButton.postDelayed({
- finish()
- Process.killProcess(Process.myPid())
- }, 500)
- }
- }
signInButton.setOnClickListener {
// Remove all spaces from userID
val userId = binding.userId.text.toString().replace("\\s".toRegex(), "")
@@ -63,10 +50,15 @@ open class LoginActivity : AppCompatActivity() {
}
PreferenceUtils.userId = userId
PreferenceUtils.nickname = nickname
+ // set region
+ val region = PreferenceUtils.region
+ SendbirdUIKit.setCustomHosts(
+ region.apiHost(),
+ region.wsHost()
+ )
onSignUp(userId, nickname)
}
selectSampleLayout.setOnClickListener {
- PreferenceUtils.clearAll()
startActivity(Intent(context, SelectServiceActivity::class.java))
finish()
}
@@ -80,6 +72,8 @@ open class LoginActivity : AppCompatActivity() {
authenticate { _: User?, e: SendbirdException? ->
if (e != null) {
Logger.e(e)
+ PreferenceUtils.userId = ""
+ PreferenceUtils.nickname = ""
ContextUtils.toastError(this@LoginActivity, "${e.message}")
WaitingDialog.dismiss()
return@authenticate
@@ -87,7 +81,7 @@ open class LoginActivity : AppCompatActivity() {
WaitingDialog.dismiss()
PreferenceUtils.userId = userId
PreferenceUtils.nickname = nickname
- SendbirdPushHelper.registerPushHandler(MyFirebaseMessagingService())
+ SendbirdPushHelper.registerHandler(MyFirebaseMessagingService())
val intent = PreferenceUtils.selectedSampleType.startingIntent(this)
startActivity(intent)
finish()
diff --git a/uikit-samples/src/main/java/com/sendbird/uikit/samples/common/SampleSettingsFragment.kt b/uikit-samples/src/main/java/com/sendbird/uikit/samples/common/SampleSettingsFragment.kt
index a9e591f9..fe5a14fa 100644
--- a/uikit-samples/src/main/java/com/sendbird/uikit/samples/common/SampleSettingsFragment.kt
+++ b/uikit-samples/src/main/java/com/sendbird/uikit/samples/common/SampleSettingsFragment.kt
@@ -52,9 +52,9 @@ import com.sendbird.uikit.utils.FileUtils
import com.sendbird.uikit.utils.IntentUtils
import com.sendbird.uikit.utils.PermissionUtils
import com.sendbird.uikit.utils.TextUtils
+import java.io.File
import java.util.Locale
import java.util.TimeZone
-import java.io.File
/**
* Displays a settings screen.
diff --git a/uikit-samples/src/main/java/com/sendbird/uikit/samples/common/SelectServiceActivity.kt b/uikit-samples/src/main/java/com/sendbird/uikit/samples/common/SelectServiceActivity.kt
index 2e55b652..fac1ca12 100644
--- a/uikit-samples/src/main/java/com/sendbird/uikit/samples/common/SelectServiceActivity.kt
+++ b/uikit-samples/src/main/java/com/sendbird/uikit/samples/common/SelectServiceActivity.kt
@@ -4,55 +4,93 @@ import android.content.DialogInterface
import android.content.Intent
import android.net.Uri
import android.os.Bundle
+import android.view.View
+import android.widget.AdapterView
+import android.widget.Toast
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import com.sendbird.android.SendbirdChat
import com.sendbird.uikit.BuildConfig
+import com.sendbird.uikit.SendbirdUIKit
+import com.sendbird.uikit.log.Logger
+import com.sendbird.uikit.samples.BaseApplication
import com.sendbird.uikit.samples.R
import com.sendbird.uikit.samples.aichatbot.AiChatBotLoginActivity
+import com.sendbird.uikit.samples.common.consts.InitState
+import com.sendbird.uikit.samples.common.consts.Region
import com.sendbird.uikit.samples.common.consts.SampleType
import com.sendbird.uikit.samples.common.preferences.PreferenceUtils
+import com.sendbird.uikit.samples.common.widgets.WaitingDialog
import com.sendbird.uikit.samples.databinding.ActivitySelectServiceBinding
import com.sendbird.uikit.samples.enableAiChatBotSample
import com.sendbird.uikit.samples.enableNotificationSample
import com.sendbird.uikit.samples.notification.NotificationLoginActivity
+import java.util.regex.Pattern
-
+private const val APP_ID_FORMAT_REX = "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
class SelectServiceActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val binding = ActivitySelectServiceBinding.inflate(layoutInflater).apply {
+ with(applicationId) {
+ setSelectAllOnFocus(false)
+ SendbirdUIKit.getAdapter()?.appId?.let { setText(it) }
+
+ val appId = text
+ if (!appId.isNullOrEmpty()) {
+ PreferenceUtils.appId = appId.toString()
+ }
+ }
versionInfo.text = String.format(
resources.getString(R.string.text_version_info),
BuildConfig.VERSION_NAME,
SendbirdChat.sdkVersion
)
+ regionSpinner.setSelection(PreferenceUtils.region.ordinal)
+ regionSpinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
+ override fun onItemSelected(parent: AdapterView<*>, view: View, position: Int, id: Long) {
+ val selectedRegion = parent.getItemAtPosition(position).toString()
+ Logger.d("Selected region: $selectedRegion")
+ PreferenceUtils.region = Region.valueOf(selectedRegion)
+ }
+
+ override fun onNothingSelected(parent: AdapterView<*>) {}
+ }
+
basicSampleButton.setOnClickListener {
- PreferenceUtils.selectedSampleType = SampleType.Basic
- startActivity(Intent(this@SelectServiceActivity, LoginActivity::class.java))
- finish()
+ changeServiceType(
+ SampleType.Basic,
+ applicationId.text?.toString(),
+ Intent(this@SelectServiceActivity, LoginActivity::class.java)
+ )
}
aiChatBotSampleButton.setOnClickListener {
if (enableAiChatBotSample) {
- PreferenceUtils.selectedSampleType = SampleType.AiChatBot
- startActivity(Intent(this@SelectServiceActivity, AiChatBotLoginActivity::class.java))
- finish()
+ changeServiceType(
+ SampleType.AiChatBot,
+ applicationId.text?.toString(),
+ Intent(this@SelectServiceActivity, AiChatBotLoginActivity::class.java)
+ )
} else {
showSampleNotSupported("https://github.com/sendbird/sendbird-uikit-android/tree/main/uikit-samples/src/main/java/com/sendbird/uikit/samples/aichatbot/README.md")
}
}
customizationSampleButton.setOnClickListener {
- PreferenceUtils.selectedSampleType = SampleType.Customization
- startActivity(Intent(this@SelectServiceActivity, LoginActivity::class.java))
- finish()
+ changeServiceType(
+ SampleType.Customization,
+ applicationId.text?.toString(),
+ Intent(this@SelectServiceActivity, LoginActivity::class.java)
+ )
}
notificationSampleButton.setOnClickListener {
if (enableNotificationSample) {
- PreferenceUtils.selectedSampleType = SampleType.Notification
- startActivity(Intent(this@SelectServiceActivity, NotificationLoginActivity::class.java))
- finish()
+ changeServiceType(
+ SampleType.Notification,
+ applicationId.text?.toString(),
+ Intent(this@SelectServiceActivity, NotificationLoginActivity::class.java)
+ )
} else {
showSampleNotSupported("https://github.com/sendbird/sendbird-uikit-android/tree/main/uikit-samples/src/main/java/com/sendbird/uikit/samples/notification/README.md")
}
@@ -61,6 +99,55 @@ class SelectServiceActivity : AppCompatActivity() {
setContentView(binding.root)
}
+ private fun changeServiceType(type: SampleType, appId: String?, intent: Intent) {
+ if (!isValidAppIdFormat(appId)) {
+ Toast.makeText(this, "This AppID is not allowed format", Toast.LENGTH_SHORT).show()
+ return
+ }
+ PreferenceUtils.selectedSampleType = type
+ val changed = saveAppId(appId)
+ if (!changed) {
+ startActivity(intent)
+ finish()
+ return
+ }
+
+ SendbirdUIKit.initFromForeground(BaseApplication.adapter, this)
+ BaseApplication.initStateChanges().observe(this) {
+ when (it) {
+ null, InitState.NONE -> {}
+ InitState.MIGRATING -> WaitingDialog.show(this)
+ InitState.FAILED, InitState.SUCCEED -> {
+ startActivity(intent)
+ finish()
+ }
+ }
+ }
+ }
+
+ /**
+ * Save app id.
+ *
+ * @param appId the app id
+ * @return true if the app id is changed, false otherwise
+ */
+ private fun saveAppId(appId: String?): Boolean {
+ val prevAppId = PreferenceUtils.appId
+ if (prevAppId != appId && !appId.isNullOrEmpty()) {
+ PreferenceUtils.appId = appId.toString()
+ return true
+ }
+ return false
+ }
+
+ private fun isValidAppIdFormat(appId: String?): Boolean {
+ return appId?.let {
+ val pattern = Pattern.compile(APP_ID_FORMAT_REX)
+ val matcher = pattern.matcher(it)
+ return matcher.matches()
+ } ?: false
+ }
+
private fun showSampleNotSupported(url: String) {
val builder = AlertDialog.Builder(this@SelectServiceActivity)
builder.setTitle(getString(R.string.sb_text_dialog_not_supported_title))
diff --git a/uikit-samples/src/main/java/com/sendbird/uikit/samples/common/consts/Region.kt b/uikit-samples/src/main/java/com/sendbird/uikit/samples/common/consts/Region.kt
new file mode 100644
index 00000000..94828fed
--- /dev/null
+++ b/uikit-samples/src/main/java/com/sendbird/uikit/samples/common/consts/Region.kt
@@ -0,0 +1,11 @@
+package com.sendbird.uikit.samples.common.consts
+
+enum class Region {
+ PRODUCTION,
+ PREPROD,
+ NO1,
+ NO2,
+ NO3,
+ NO4
+ ;
+}
diff --git a/uikit-samples/src/main/java/com/sendbird/uikit/samples/common/extensions/UIKitExtensions.kt b/uikit-samples/src/main/java/com/sendbird/uikit/samples/common/extensions/UIKitExtensions.kt
index a3a68cae..00d94062 100644
--- a/uikit-samples/src/main/java/com/sendbird/uikit/samples/common/extensions/UIKitExtensions.kt
+++ b/uikit-samples/src/main/java/com/sendbird/uikit/samples/common/extensions/UIKitExtensions.kt
@@ -26,6 +26,7 @@ import com.sendbird.uikit.samples.basic.BasicHomeActivity
import com.sendbird.uikit.samples.basic.GroupChannelMainActivity
import com.sendbird.uikit.samples.common.LoginActivity
import com.sendbird.uikit.samples.common.SelectServiceActivity
+import com.sendbird.uikit.samples.common.consts.Region
import com.sendbird.uikit.samples.common.consts.SampleType
import com.sendbird.uikit.samples.common.consts.StringSet
import com.sendbird.uikit.samples.common.preferences.PreferenceUtils
@@ -122,11 +123,11 @@ internal fun SampleType?.newRedirectToChannelIntent(
internal fun Activity.logout() {
WaitingDialog.show(this)
- SendbirdPushHelper.unregisterPushHandler(object : PushRequestCompleteHandler {
+ SendbirdPushHelper.unregisterHandler(handler = object : PushRequestCompleteHandler {
override fun onComplete(isRegistered: Boolean, token: String?) {
SendbirdUIKit.disconnect {
WaitingDialog.dismiss()
- PreferenceUtils.clearAll()
+ PreferenceUtils.clearUserConfiguration()
cleanUpPreviousSampleSettings()
val notificationManager =
getSystemService(AppCompatActivity.NOTIFICATION_SERVICE) as NotificationManager
@@ -162,7 +163,7 @@ internal fun cleanUpPreviousSampleSettings() {
internal fun authenticate(handler: ConnectHandler) {
if (PreferenceUtils.isUsingFeedChannelOnly) {
- SendbirdUIKit.authenticateFeed(handler::onConnected)
+ SendbirdUIKit.authenticate(handler::onConnected)
return
}
SendbirdUIKit.connect(handler)
@@ -185,3 +186,23 @@ internal fun Intent.getSerializable(key: String, clazz: Clas
this.getSerializableExtra(key) as? T
}
}
+
+internal fun Region.apiHost(): String? {
+ return when (this) {
+ Region.NO1 -> "https://api-no1.sendbirdtest.com"
+ Region.NO2 -> "https://api-no2.sendbirdtest.com"
+ Region.NO3 -> "https://api-no3.sendbirdtest.com"
+ Region.NO4 -> "https://api-no4.sendbirdtest.com"
+ else -> null
+ }
+}
+
+internal fun Region.wsHost(): String? {
+ return when (this) {
+ Region.NO1 -> "wss://ws-no1.sendbirdtest.com"
+ Region.NO2 -> "wss://ws-no2.sendbirdtest.com"
+ Region.NO3 -> "wss://ws-no3.sendbirdtest.com"
+ Region.NO4 -> "wss://ws-no4.sendbirdtest.com"
+ else -> null
+ }
+}
diff --git a/uikit-samples/src/main/java/com/sendbird/uikit/samples/common/preferences/PreferenceUtils.kt b/uikit-samples/src/main/java/com/sendbird/uikit/samples/common/preferences/PreferenceUtils.kt
index bd917962..23e5cfc0 100644
--- a/uikit-samples/src/main/java/com/sendbird/uikit/samples/common/preferences/PreferenceUtils.kt
+++ b/uikit-samples/src/main/java/com/sendbird/uikit/samples/common/preferences/PreferenceUtils.kt
@@ -3,6 +3,7 @@ package com.sendbird.uikit.samples.common.preferences
import android.content.Context
import com.sendbird.uikit.SendbirdUIKit.ThemeMode
import com.sendbird.uikit.samples.BaseApplication
+import com.sendbird.uikit.samples.common.consts.Region
import com.sendbird.uikit.samples.common.consts.SampleType
/**
@@ -18,6 +19,7 @@ internal object PreferenceUtils {
private const val PREFERENCE_KEY_DO_NOT_DISTURB = "PREFERENCE_KEY_DO_NOT_DISTURB"
private const val PREFERENCE_KEY_LATEST_USED_SAMPLE = "PREFERENCE_KEY_LATEST_USED_SAMPLE"
private const val PREFERENCE_KEY_NOTIFICATION_USE_FEED_CHANNEL_ONLY = "PREFERENCE_KEY_NOTIFICATION_USE_FEED_CHANNEL_ONLY"
+ private const val PREFERENCE_KEY_REGION = "PREFERENCE_KEY_REGION"
private lateinit var pref: Preference
fun init(context: Context) {
@@ -52,7 +54,7 @@ internal object PreferenceUtils {
var botId: String
get() = pref.getString(PREFERENCE_KEY_BOT_ID) ?: ""
- set(nickname) = pref.putString(PREFERENCE_KEY_BOT_ID, nickname)
+ set(botId) = pref.putString(PREFERENCE_KEY_BOT_ID, botId)
var isUsingFeedChannelOnly: Boolean
get() = pref.getBoolean(PREFERENCE_KEY_NOTIFICATION_USE_FEED_CHANNEL_ONLY, false)
@@ -73,5 +75,20 @@ internal object PreferenceUtils {
BaseApplication.setupConfigurations()
}
+ var region: Region
+ get() = pref.getString(PREFERENCE_KEY_REGION)?.let {
+ return Region.valueOf(it)
+ } ?: Region.PRODUCTION
+ set(value) {
+ pref.putString(PREFERENCE_KEY_REGION, value.name)
+ }
+
fun clearAll() = pref.clear()
+ fun clearUserConfiguration() {
+ pref.remove(PREFERENCE_KEY_USER_ID)
+ pref.remove(PREFERENCE_KEY_NICKNAME)
+ pref.remove(PREFERENCE_KEY_PROFILE_URL)
+ pref.remove(PREFERENCE_KEY_DO_NOT_DISTURB)
+ pref.remove(PREFERENCE_KEY_NOTIFICATION_USE_FEED_CHANNEL_ONLY)
+ }
}
diff --git a/uikit-samples/src/main/java/com/sendbird/uikit/samples/customization/CustomizationHomeActivity.kt b/uikit-samples/src/main/java/com/sendbird/uikit/samples/customization/CustomizationHomeActivity.kt
index 4ee2481e..71c1045a 100644
--- a/uikit-samples/src/main/java/com/sendbird/uikit/samples/customization/CustomizationHomeActivity.kt
+++ b/uikit-samples/src/main/java/com/sendbird/uikit/samples/customization/CustomizationHomeActivity.kt
@@ -4,7 +4,7 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
-import androidx.activity.ComponentActivity
+import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView.ViewHolder
import com.sendbird.uikit.samples.R
@@ -40,7 +40,7 @@ import com.sendbird.uikit.samples.databinding.ActivityCustomizationHomeBinding
import com.sendbird.uikit.samples.databinding.ViewCustomizationListHeaderBinding
import com.sendbird.uikit.samples.databinding.ViewCustomizationListItemBinding
-class CustomizationHomeActivity : ComponentActivity() {
+class CustomizationHomeActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
ActivityCustomizationHomeBinding.inflate(layoutInflater).apply {
diff --git a/uikit-samples/src/main/java/com/sendbird/uikit/samples/notification/FeedChannelListFragment.kt b/uikit-samples/src/main/java/com/sendbird/uikit/samples/notification/FeedChannelListFragment.kt
index 8966bc49..87106213 100644
--- a/uikit-samples/src/main/java/com/sendbird/uikit/samples/notification/FeedChannelListFragment.kt
+++ b/uikit-samples/src/main/java/com/sendbird/uikit/samples/notification/FeedChannelListFragment.kt
@@ -40,22 +40,23 @@ class FeedChannelListFragment : Fragment() {
val channelKeyStyle = if (themeMode == SendbirdUIKit.ThemeMode.Light) R.style.SendbirdSubtitle1OnLight01 else R.style.SendbirdSubtitle1OnDark01
val channelUrlStyle = if (themeMode == SendbirdUIKit.ThemeMode.Light) R.style.SendbirdBody3OnLight03 else R.style.SendbirdBody3OnDark03
feedChannels.entries.forEach { entry ->
- val itemBinding = ViewFeedChannelItemBinding.inflate(inflater)
- itemBinding.root.setBackgroundResource(background)
- itemBinding.divider.setBackgroundResource(dividerColor)
- itemBinding.tvChannelKey.text = entry.key
- itemBinding.tvChannelUrl.text = entry.value
- itemBinding.tvChannelKey.setAppearance(requireContext(), channelKeyStyle)
- itemBinding.tvChannelUrl.setAppearance(requireContext(), channelUrlStyle)
- itemBinding.root.setOnClickListener {
- startActivity(
- FeedNotificationChannelActivity.newIntent(
- requireContext(),
- entry.value
+ ViewFeedChannelItemBinding.inflate(inflater).apply {
+ root.setBackgroundResource(background)
+ divider.setBackgroundResource(dividerColor)
+ tvChannelKey.text = entry.key
+ tvChannelUrl.text = entry.value
+ tvChannelKey.setAppearance(requireContext(), channelKeyStyle)
+ tvChannelUrl.setAppearance(requireContext(), channelUrlStyle)
+ root.setOnClickListener {
+ startActivity(
+ FeedNotificationChannelActivity.newIntent(
+ requireContext(),
+ entry.value
+ )
)
- )
+ }
+ binding.feedChannelContainer.addView(root)
}
- binding.feedChannelContainer.addView(itemBinding.root)
}
}
return binding.root
diff --git a/uikit-samples/src/main/java/com/sendbird/uikit/samples/notification/FeedChannelListMainActivity.kt b/uikit-samples/src/main/java/com/sendbird/uikit/samples/notification/FeedChannelListMainActivity.kt
index 55c01d5b..23e14692 100644
--- a/uikit-samples/src/main/java/com/sendbird/uikit/samples/notification/FeedChannelListMainActivity.kt
+++ b/uikit-samples/src/main/java/com/sendbird/uikit/samples/notification/FeedChannelListMainActivity.kt
@@ -9,11 +9,8 @@ import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.google.android.material.tabs.TabLayoutMediator
-import com.sendbird.android.SendbirdChat.addUserEventHandler
-import com.sendbird.android.SendbirdChat.getTotalUnreadMessageCount
-import com.sendbird.android.SendbirdChat.removeUserEventHandler
-import com.sendbird.android.exception.SendbirdException
-import com.sendbird.android.handler.UnreadMessageCountHandler
+import com.sendbird.android.SendbirdChat
+import com.sendbird.android.handler.CountHandler
import com.sendbird.android.handler.UserEventHandler
import com.sendbird.android.push.SendbirdPushHelper
import com.sendbird.android.user.UnreadMessageCount
@@ -59,7 +56,7 @@ class FeedChannelListMainActivity : AppCompatActivity() {
InitState.MIGRATING -> WaitingDialog.show(this@FeedChannelListMainActivity)
InitState.FAILED, InitState.SUCCEED -> {
WaitingDialog.dismiss()
- SendbirdUIKit.connect { _, _ -> initPage() }
+ SendbirdUIKit.authenticate { _, _ -> initPage() }
}
}
}
@@ -67,7 +64,7 @@ class FeedChannelListMainActivity : AppCompatActivity() {
override fun onDestroy() {
super.onDestroy()
- removeUserEventHandler(USER_EVENT_HANDLER_KEY)
+ SendbirdChat.removeUserEventHandler(USER_EVENT_HANDLER_KEY)
}
override fun onNewIntent(intent: Intent?) {
@@ -95,17 +92,17 @@ class FeedChannelListMainActivity : AppCompatActivity() {
}.attach()
redirectChannelIfNeeded(intent)
- getTotalUnreadMessageCount(
- handler = UnreadMessageCountHandler { groupChannelCount: Int, feedChannelTotalCount: Int, e: SendbirdException? ->
+ SendbirdChat.getTotalUnreadNotificationCount(
+ handler = CountHandler { feedChannelTotalCount, e ->
if (e != null) {
- return@UnreadMessageCountHandler
+ return@CountHandler
}
- Logger.i("updateChannelListTab [API] groupChannelCount=$groupChannelCount, feedChannelUnreadCount=$feedChannelTotalCount")
+ Logger.i("updateChannelListTab [API] feedChannelUnreadCount=$feedChannelTotalCount")
drawUnreadCount(feedChannelListTab, feedChannelTotalCount)
}
)
- addUserEventHandler(USER_EVENT_HANDLER_KEY, object : UserEventHandler() {
+ SendbirdChat.addUserEventHandler(USER_EVENT_HANDLER_KEY, object : UserEventHandler() {
override fun onFriendsDiscovered(users: List) {}
override fun onTotalUnreadMessageCountChanged(unreadMessageCount: UnreadMessageCount) {
val groupChannelCount = unreadMessageCount.groupChannelCount
diff --git a/uikit-samples/src/main/java/com/sendbird/uikit/samples/notification/NotificationLoginActivity.kt b/uikit-samples/src/main/java/com/sendbird/uikit/samples/notification/NotificationLoginActivity.kt
index 9bde5648..a33de0b4 100644
--- a/uikit-samples/src/main/java/com/sendbird/uikit/samples/notification/NotificationLoginActivity.kt
+++ b/uikit-samples/src/main/java/com/sendbird/uikit/samples/notification/NotificationLoginActivity.kt
@@ -19,8 +19,6 @@ class NotificationLoginActivity : LoginActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding.useFeedOnly.visibility = View.VISIBLE
- binding.title.visibility = View.GONE
- binding.notificationTitle.visibility = View.VISIBLE
}
override fun onSignUp(userId: String, nickname: String) {
@@ -36,7 +34,7 @@ class NotificationLoginActivity : LoginActivity() {
}
PreferenceUtils.userId = userId
PreferenceUtils.nickname = nickname
- SendbirdPushHelper.registerPushHandler(MyFirebaseMessagingService())
+ SendbirdPushHelper.registerHandler(MyFirebaseMessagingService())
val intent = PreferenceUtils.selectedSampleType.startingIntent(this)
startActivity(intent)
finish()
diff --git a/uikit-samples/src/main/java/com/sendbird/uikit/samples/notification/NotificationMainActivity.kt b/uikit-samples/src/main/java/com/sendbird/uikit/samples/notification/NotificationMainActivity.kt
index 142180d9..1bcb8e00 100644
--- a/uikit-samples/src/main/java/com/sendbird/uikit/samples/notification/NotificationMainActivity.kt
+++ b/uikit-samples/src/main/java/com/sendbird/uikit/samples/notification/NotificationMainActivity.kt
@@ -156,14 +156,15 @@ class NotificationMainActivity : AppCompatActivity() {
if (intent == null) return
Logger.i("++ intent: %s, %s", intent, intent.extras)
if (intent.hasExtra(StringSet.PUSH_NOTIFICATION_DATA)) {
- intent.getSerializable(StringSet.PUSH_NOTIFICATION_DATA, HashMap::class.java)?.let {
- val resultMap = HashMap()
- for ((key, value) in it) {
- if (key is String && value is String) {
- resultMap[key] = value
+ intent.getSerializable(StringSet.PUSH_NOTIFICATION_DATA, HashMap::class.java)?.let { hashMap ->
+ val data: Map = hashMap.mapNotNull {
+ if (it.key is String && it.value is String) {
+ it.key as String to it.value as String
+ } else {
+ null
}
- }
- SendbirdPushHelper.markPushNotificationAsClicked(resultMap)
+ }.toMap()
+ SendbirdPushHelper.markPushNotificationAsClicked(data)
}
intent.removeExtra(StringSet.PUSH_NOTIFICATION_DATA)
}
diff --git a/uikit-samples/src/main/res/drawable-ldrtl-hdpi/icon_bad.png b/uikit-samples/src/main/res/drawable-ldrtl-hdpi/icon_bad.png
new file mode 100644
index 00000000..b3cccd9f
Binary files /dev/null and b/uikit-samples/src/main/res/drawable-ldrtl-hdpi/icon_bad.png differ
diff --git a/uikit-samples/src/main/res/drawable-ldrtl-hdpi/icon_chat_filled.png b/uikit-samples/src/main/res/drawable-ldrtl-hdpi/icon_chat_filled.png
new file mode 100644
index 00000000..447696b4
Binary files /dev/null and b/uikit-samples/src/main/res/drawable-ldrtl-hdpi/icon_chat_filled.png differ
diff --git a/uikit-samples/src/main/res/drawable-ldrtl-hdpi/icon_good.png b/uikit-samples/src/main/res/drawable-ldrtl-hdpi/icon_good.png
new file mode 100644
index 00000000..4a5001b5
Binary files /dev/null and b/uikit-samples/src/main/res/drawable-ldrtl-hdpi/icon_good.png differ
diff --git a/uikit-samples/src/main/res/drawable-ldrtl-hdpi/icon_push_lollipop.png b/uikit-samples/src/main/res/drawable-ldrtl-hdpi/icon_push_lollipop.png
new file mode 100644
index 00000000..3d55f2e6
Binary files /dev/null and b/uikit-samples/src/main/res/drawable-ldrtl-hdpi/icon_push_lollipop.png differ
diff --git a/uikit-samples/src/main/res/drawable-ldrtl-hdpi/icon_push_oreo.png b/uikit-samples/src/main/res/drawable-ldrtl-hdpi/icon_push_oreo.png
new file mode 100644
index 00000000..447696b4
Binary files /dev/null and b/uikit-samples/src/main/res/drawable-ldrtl-hdpi/icon_push_oreo.png differ
diff --git a/uikit-samples/src/main/res/drawable-ldrtl-hdpi/icon_theme.png b/uikit-samples/src/main/res/drawable-ldrtl-hdpi/icon_theme.png
new file mode 100644
index 00000000..d90bee2b
Binary files /dev/null and b/uikit-samples/src/main/res/drawable-ldrtl-hdpi/icon_theme.png differ
diff --git a/uikit-samples/src/main/res/drawable-ldrtl-mdpi/icon_bad.png b/uikit-samples/src/main/res/drawable-ldrtl-mdpi/icon_bad.png
new file mode 100644
index 00000000..d8325d97
Binary files /dev/null and b/uikit-samples/src/main/res/drawable-ldrtl-mdpi/icon_bad.png differ
diff --git a/uikit-samples/src/main/res/drawable-ldrtl-mdpi/icon_chat_filled.png b/uikit-samples/src/main/res/drawable-ldrtl-mdpi/icon_chat_filled.png
new file mode 100644
index 00000000..0179a272
Binary files /dev/null and b/uikit-samples/src/main/res/drawable-ldrtl-mdpi/icon_chat_filled.png differ
diff --git a/uikit-samples/src/main/res/drawable-ldrtl-mdpi/icon_good.png b/uikit-samples/src/main/res/drawable-ldrtl-mdpi/icon_good.png
new file mode 100644
index 00000000..dc673f3d
Binary files /dev/null and b/uikit-samples/src/main/res/drawable-ldrtl-mdpi/icon_good.png differ
diff --git a/uikit-samples/src/main/res/drawable-ldrtl-mdpi/icon_push_lollipop.png b/uikit-samples/src/main/res/drawable-ldrtl-mdpi/icon_push_lollipop.png
new file mode 100644
index 00000000..ef278169
Binary files /dev/null and b/uikit-samples/src/main/res/drawable-ldrtl-mdpi/icon_push_lollipop.png differ
diff --git a/uikit-samples/src/main/res/drawable-ldrtl-mdpi/icon_push_oreo.png b/uikit-samples/src/main/res/drawable-ldrtl-mdpi/icon_push_oreo.png
new file mode 100644
index 00000000..0179a272
Binary files /dev/null and b/uikit-samples/src/main/res/drawable-ldrtl-mdpi/icon_push_oreo.png differ
diff --git a/uikit-samples/src/main/res/drawable-ldrtl-mdpi/icon_theme.png b/uikit-samples/src/main/res/drawable-ldrtl-mdpi/icon_theme.png
new file mode 100644
index 00000000..4660d726
Binary files /dev/null and b/uikit-samples/src/main/res/drawable-ldrtl-mdpi/icon_theme.png differ
diff --git a/uikit-samples/src/main/res/drawable-ldrtl-xhdpi/icon_bad.png b/uikit-samples/src/main/res/drawable-ldrtl-xhdpi/icon_bad.png
new file mode 100644
index 00000000..7f5b696c
Binary files /dev/null and b/uikit-samples/src/main/res/drawable-ldrtl-xhdpi/icon_bad.png differ
diff --git a/uikit-samples/src/main/res/drawable-ldrtl-xhdpi/icon_chat_filled.png b/uikit-samples/src/main/res/drawable-ldrtl-xhdpi/icon_chat_filled.png
new file mode 100644
index 00000000..642115c7
Binary files /dev/null and b/uikit-samples/src/main/res/drawable-ldrtl-xhdpi/icon_chat_filled.png differ
diff --git a/uikit-samples/src/main/res/drawable-ldrtl-xhdpi/icon_good.png b/uikit-samples/src/main/res/drawable-ldrtl-xhdpi/icon_good.png
new file mode 100644
index 00000000..b55aca6e
Binary files /dev/null and b/uikit-samples/src/main/res/drawable-ldrtl-xhdpi/icon_good.png differ
diff --git a/uikit-samples/src/main/res/drawable-ldrtl-xhdpi/icon_push_lollipop.png b/uikit-samples/src/main/res/drawable-ldrtl-xhdpi/icon_push_lollipop.png
new file mode 100644
index 00000000..d320b654
Binary files /dev/null and b/uikit-samples/src/main/res/drawable-ldrtl-xhdpi/icon_push_lollipop.png differ
diff --git a/uikit-samples/src/main/res/drawable-ldrtl-xhdpi/icon_push_oreo.png b/uikit-samples/src/main/res/drawable-ldrtl-xhdpi/icon_push_oreo.png
new file mode 100644
index 00000000..642115c7
Binary files /dev/null and b/uikit-samples/src/main/res/drawable-ldrtl-xhdpi/icon_push_oreo.png differ
diff --git a/uikit-samples/src/main/res/drawable-ldrtl-xhdpi/icon_theme.png b/uikit-samples/src/main/res/drawable-ldrtl-xhdpi/icon_theme.png
new file mode 100644
index 00000000..11921cfd
Binary files /dev/null and b/uikit-samples/src/main/res/drawable-ldrtl-xhdpi/icon_theme.png differ
diff --git a/uikit-samples/src/main/res/drawable-ldrtl-xxhdpi/icon_bad.png b/uikit-samples/src/main/res/drawable-ldrtl-xxhdpi/icon_bad.png
new file mode 100644
index 00000000..df494719
Binary files /dev/null and b/uikit-samples/src/main/res/drawable-ldrtl-xxhdpi/icon_bad.png differ
diff --git a/uikit-samples/src/main/res/drawable-ldrtl-xxhdpi/icon_chat_filled.png b/uikit-samples/src/main/res/drawable-ldrtl-xxhdpi/icon_chat_filled.png
new file mode 100644
index 00000000..a435dd4c
Binary files /dev/null and b/uikit-samples/src/main/res/drawable-ldrtl-xxhdpi/icon_chat_filled.png differ
diff --git a/uikit-samples/src/main/res/drawable-ldrtl-xxhdpi/icon_good.png b/uikit-samples/src/main/res/drawable-ldrtl-xxhdpi/icon_good.png
new file mode 100644
index 00000000..4aded0b0
Binary files /dev/null and b/uikit-samples/src/main/res/drawable-ldrtl-xxhdpi/icon_good.png differ
diff --git a/uikit-samples/src/main/res/drawable-ldrtl-xxhdpi/icon_push_lollipop.png b/uikit-samples/src/main/res/drawable-ldrtl-xxhdpi/icon_push_lollipop.png
new file mode 100644
index 00000000..d6f5887b
Binary files /dev/null and b/uikit-samples/src/main/res/drawable-ldrtl-xxhdpi/icon_push_lollipop.png differ
diff --git a/uikit-samples/src/main/res/drawable-ldrtl-xxhdpi/icon_push_oreo.png b/uikit-samples/src/main/res/drawable-ldrtl-xxhdpi/icon_push_oreo.png
new file mode 100644
index 00000000..a435dd4c
Binary files /dev/null and b/uikit-samples/src/main/res/drawable-ldrtl-xxhdpi/icon_push_oreo.png differ
diff --git a/uikit-samples/src/main/res/drawable-ldrtl-xxhdpi/icon_theme.png b/uikit-samples/src/main/res/drawable-ldrtl-xxhdpi/icon_theme.png
new file mode 100644
index 00000000..47979e15
Binary files /dev/null and b/uikit-samples/src/main/res/drawable-ldrtl-xxhdpi/icon_theme.png differ
diff --git a/uikit-samples/src/main/res/drawable-ldrtl-xxxhdpi/icon_bad.png b/uikit-samples/src/main/res/drawable-ldrtl-xxxhdpi/icon_bad.png
new file mode 100644
index 00000000..d5c9f461
Binary files /dev/null and b/uikit-samples/src/main/res/drawable-ldrtl-xxxhdpi/icon_bad.png differ
diff --git a/uikit-samples/src/main/res/drawable-ldrtl-xxxhdpi/icon_chat_filled.png b/uikit-samples/src/main/res/drawable-ldrtl-xxxhdpi/icon_chat_filled.png
new file mode 100644
index 00000000..a6119e5f
Binary files /dev/null and b/uikit-samples/src/main/res/drawable-ldrtl-xxxhdpi/icon_chat_filled.png differ
diff --git a/uikit-samples/src/main/res/drawable-ldrtl-xxxhdpi/icon_good.png b/uikit-samples/src/main/res/drawable-ldrtl-xxxhdpi/icon_good.png
new file mode 100644
index 00000000..9a4022a2
Binary files /dev/null and b/uikit-samples/src/main/res/drawable-ldrtl-xxxhdpi/icon_good.png differ
diff --git a/uikit-samples/src/main/res/drawable-ldrtl-xxxhdpi/icon_push_lollipop.png b/uikit-samples/src/main/res/drawable-ldrtl-xxxhdpi/icon_push_lollipop.png
new file mode 100644
index 00000000..53e02558
Binary files /dev/null and b/uikit-samples/src/main/res/drawable-ldrtl-xxxhdpi/icon_push_lollipop.png differ
diff --git a/uikit-samples/src/main/res/drawable-ldrtl-xxxhdpi/icon_push_oreo.png b/uikit-samples/src/main/res/drawable-ldrtl-xxxhdpi/icon_push_oreo.png
new file mode 100644
index 00000000..a6119e5f
Binary files /dev/null and b/uikit-samples/src/main/res/drawable-ldrtl-xxxhdpi/icon_push_oreo.png differ
diff --git a/uikit-samples/src/main/res/drawable-ldrtl-xxxhdpi/icon_theme.png b/uikit-samples/src/main/res/drawable-ldrtl-xxxhdpi/icon_theme.png
new file mode 100644
index 00000000..c1b2e6ae
Binary files /dev/null and b/uikit-samples/src/main/res/drawable-ldrtl-xxxhdpi/icon_theme.png differ
diff --git a/uikit-samples/src/main/res/drawable/icon_arrow_down.xml b/uikit-samples/src/main/res/drawable/icon_arrow_down.xml
new file mode 100644
index 00000000..1bb1e0f1
--- /dev/null
+++ b/uikit-samples/src/main/res/drawable/icon_arrow_down.xml
@@ -0,0 +1,10 @@
+
+
+
+
diff --git a/uikit-samples/src/main/res/drawable/selector_edittext_white_background_with_focusable.xml b/uikit-samples/src/main/res/drawable/selector_edittext_white_background_with_focusable.xml
new file mode 100644
index 00000000..9c4f2edc
--- /dev/null
+++ b/uikit-samples/src/main/res/drawable/selector_edittext_white_background_with_focusable.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/uikit-samples/src/main/res/drawable/spinner_background.xml b/uikit-samples/src/main/res/drawable/spinner_background.xml
new file mode 100644
index 00000000..9e24d8f3
--- /dev/null
+++ b/uikit-samples/src/main/res/drawable/spinner_background.xml
@@ -0,0 +1,16 @@
+
+
+ -
+
+
+
+
+
+
+
+
diff --git a/uikit-samples/src/main/res/layout/activity_ai_chatbot_home.xml b/uikit-samples/src/main/res/layout/activity_ai_chatbot_home.xml
index 0192d845..74d02d64 100644
--- a/uikit-samples/src/main/res/layout/activity_ai_chatbot_home.xml
+++ b/uikit-samples/src/main/res/layout/activity_ai_chatbot_home.xml
@@ -16,8 +16,8 @@
android:id="@+id/mainTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginLeft="@dimen/sb_size_24"
- android:layout_marginRight="@dimen/sb_size_24"
+ android:layout_marginStart="@dimen/sb_size_24"
+ android:layout_marginEnd="@dimen/sb_size_24"
android:layout_marginBottom="@dimen/sb_size_24"
android:textSize="@dimen/sb_text_size_24"
android:textStyle="bold"
@@ -39,8 +39,8 @@
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="@dimen/sb_size_48"
- android:layout_marginLeft="@dimen/sb_size_24"
- android:layout_marginRight="@dimen/sb_size_24"
+ android:layout_marginStart="@dimen/sb_size_24"
+ android:layout_marginEnd="@dimen/sb_size_24"
android:textSize="@dimen/sb_text_size_14"
android:fontFamily="sans-serif"
android:textStyle="bold"
diff --git a/uikit-samples/src/main/res/layout/activity_customization_home.xml b/uikit-samples/src/main/res/layout/activity_customization_home.xml
index fced1f08..8567ce21 100644
--- a/uikit-samples/src/main/res/layout/activity_customization_home.xml
+++ b/uikit-samples/src/main/res/layout/activity_customization_home.xml
@@ -9,8 +9,8 @@
@@ -22,7 +22,7 @@
android:maxLines="1"
android:ellipsize="end"
android:layout_weight="1"
- android:layout_marginRight="@dimen/sb_size_8"
+ android:layout_marginEnd="@dimen/sb_size_8"
android:text="@string/text_title_customization_sample"
android:textAppearance="@style/SendbirdH1OnLight01"
/>
diff --git a/uikit-samples/src/main/res/layout/activity_home.xml b/uikit-samples/src/main/res/layout/activity_home.xml
index 6a1a4b26..8a0ac1fe 100644
--- a/uikit-samples/src/main/res/layout/activity_home.xml
+++ b/uikit-samples/src/main/res/layout/activity_home.xml
@@ -16,8 +16,8 @@
android:id="@+id/mainTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginLeft="@dimen/sb_size_24"
- android:layout_marginRight="@dimen/sb_size_24"
+ android:layout_marginStart="@dimen/sb_size_24"
+ android:layout_marginEnd="@dimen/sb_size_24"
android:layout_marginBottom="@dimen/sb_size_24"
android:textSize="@dimen/sb_text_size_24"
android:textStyle="bold"
@@ -48,8 +48,8 @@
android:id="@+id/btSignOut"
android:layout_width="match_parent"
android:layout_height="@dimen/sb_size_48"
- android:layout_marginLeft="@dimen/sb_size_24"
- android:layout_marginRight="@dimen/sb_size_24"
+ android:layout_marginStart="@dimen/sb_size_24"
+ android:layout_marginEnd="@dimen/sb_size_24"
android:textSize="@dimen/sb_text_size_14"
android:fontFamily="sans-serif"
android:textStyle="bold"
diff --git a/uikit-samples/src/main/res/layout/activity_login.xml b/uikit-samples/src/main/res/layout/activity_login.xml
index 5be06c6b..410c7885 100644
--- a/uikit-samples/src/main/res/layout/activity_login.xml
+++ b/uikit-samples/src/main/res/layout/activity_login.xml
@@ -10,15 +10,14 @@
+ android:paddingStart="@dimen/sb_size_24"
+ android:paddingEnd="@dimen/sb_size_24">
@@ -28,84 +27,13 @@
android:layout_width="wrap_content"
android:layout_height="@dimen/sb_size_24"
android:layout_marginTop="@dimen/sb_size_4"
- android:layout_marginBottom="@dimen/sb_size_44"
android:textSize="@dimen/sb_text_size_16"
android:textStyle="bold"
android:textColor="@color/onlight_text_high_emphasis"
- android:text="@string/text_title_uikit_sample_app"
app:layout_constraintTop_toBottomOf="@id/logoImageView"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintBottom_toTopOf="@id/applicationIdLayout"
- />
-
-
-
-
-
-
-
-
-
-
-
-
+ app:layout_constraintBottom_toTopOf="@id/regionSpinner"/>
+
+
+
+
+
+
+
+
+ android:paddingStart="@dimen/sb_size_16"
+ android:paddingEnd="@dimen/sb_size_16">
+ android:paddingStart="@dimen/sb_size_16"
+ android:paddingEnd="@dimen/sb_size_16">
+ android:paddingStart="@dimen/sb_size_16"
+ android:paddingEnd="@dimen/sb_size_16">
@@ -38,8 +38,8 @@
android:singleLine="true"
android:ellipsize="end"
app:layout_constraintBottom_toTopOf="@id/brBottom"
- app:layout_constraintLeft_toRightOf="@+id/ivBroadcastIcon"
- app:layout_constraintRight_toLeftOf="@+id/tvMemberCount"
+ app:layout_constraintStart_toEndOf="@+id/ivBroadcastIcon"
+ app:layout_constraintEnd_toStartOf="@+id/tvMemberCount"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginStart="@dimen/sb_size_4"
android:layout_marginEnd="@dimen/sb_size_4" />
@@ -111,8 +111,8 @@
android:layout_marginEnd="@dimen/sb_size_10"
android:layout_marginTop="@dimen/sb_size_2"
android:maxLines="1"
- app:layout_constraintLeft_toRightOf="@id/vgCoverView"
- app:layout_constraintRight_toLeftOf="@+id/tvUnreadMentionCount"
+ app:layout_constraintStart_toEndOf="@id/vgCoverView"
+ app:layout_constraintEnd_toStartOf="@+id/tvUnreadMentionCount"
app:layout_constraintTop_toBottomOf="@id/tvTitle" />
diff --git a/uikit-samples/src/main/res/layout/view_custom_menu_icon_button.xml b/uikit-samples/src/main/res/layout/view_custom_menu_icon_button.xml
index 58a9b46e..8fd08009 100644
--- a/uikit-samples/src/main/res/layout/view_custom_menu_icon_button.xml
+++ b/uikit-samples/src/main/res/layout/view_custom_menu_icon_button.xml
@@ -9,8 +9,8 @@
android:layout_width="@dimen/sb_size_40"
android:layout_height="@dimen/sb_size_40"
android:padding="@dimen/sb_size_8"
- android:layout_marginRight="@dimen/sb_size_12"
- android:layout_marginLeft="@dimen/sb_size_12"
+ android:layout_marginEnd="@dimen/sb_size_12"
+ android:layout_marginStart="@dimen/sb_size_12"
android:src="@drawable/icon_create" />
diff --git a/uikit-samples/src/main/res/layout/view_custom_menu_text_button.xml b/uikit-samples/src/main/res/layout/view_custom_menu_text_button.xml
index 0365a527..36d29037 100644
--- a/uikit-samples/src/main/res/layout/view_custom_menu_text_button.xml
+++ b/uikit-samples/src/main/res/layout/view_custom_menu_text_button.xml
@@ -9,7 +9,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/sb_size_4"
- android:layout_marginRight="@dimen/sb_size_12"
- android:layout_marginLeft="@dimen/sb_size_12"
+ android:layout_marginEnd="@dimen/sb_size_12"
+ android:layout_marginStart="@dimen/sb_size_12"
android:textAppearance="@style/SendbirdButtonPrimary300"/>
-
\ No newline at end of file
+
diff --git a/uikit-samples/src/main/res/layout/view_custom_message_me.xml b/uikit-samples/src/main/res/layout/view_custom_message_me.xml
index af3a3875..fbf1211e 100644
--- a/uikit-samples/src/main/res/layout/view_custom_message_me.xml
+++ b/uikit-samples/src/main/res/layout/view_custom_message_me.xml
@@ -3,9 +3,9 @@
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_12"
+ android:paddingStart="@dimen/sb_size_12"
android:paddingTop="@dimen/sb_size_8"
- android:paddingRight="@dimen/sb_size_12"
+ android:paddingEnd="@dimen/sb_size_12"
android:paddingBottom="@dimen/sb_size_8"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
@@ -14,8 +14,8 @@
android:id="@+id/tvSentAt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginLeft="@dimen/sb_size_0"
- android:layout_marginRight="@dimen/sb_size_4"
+ android:layout_marginStart="@dimen/sb_size_0"
+ android:layout_marginEnd="@dimen/sb_size_4"
android:textSize="@dimen/sb_text_size_10"
app:layout_constraintBottom_toBottomOf="@+id/brBottom"
app:layout_constraintEnd_toStartOf="@+id/tvMessage"
diff --git a/uikit-samples/src/main/res/layout/view_custom_tab.xml b/uikit-samples/src/main/res/layout/view_custom_tab.xml
index 2a7ad73f..4e573729 100644
--- a/uikit-samples/src/main/res/layout/view_custom_tab.xml
+++ b/uikit-samples/src/main/res/layout/view_custom_tab.xml
@@ -33,7 +33,7 @@
android:layout_height="wrap_content"
android:paddingTop="@dimen/sb_size_2"
android:paddingBottom="@dimen/sb_size_2"
- android:paddingLeft="@dimen/sb_size_6"
- android:paddingRight="@dimen/sb_size_6"
+ android:paddingStart="@dimen/sb_size_6"
+ android:paddingEnd="@dimen/sb_size_6"
android:includeFontPadding="false" />
diff --git a/uikit-samples/src/main/res/layout/view_entry_button.xml b/uikit-samples/src/main/res/layout/view_entry_button.xml
index 6f06ed72..bf0c9f20 100644
--- a/uikit-samples/src/main/res/layout/view_entry_button.xml
+++ b/uikit-samples/src/main/res/layout/view_entry_button.xml
@@ -7,7 +7,7 @@
@@ -15,9 +15,8 @@
android:layout_width="120dp"
android:layout_height="@dimen/sb_size_72"
android:scaleType="centerCrop"
+ app:layout_constraintHorizontal_bias="0"
app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintEnd_toStartOf="@id/ivChannelThumbnail"
- app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
diff --git a/uikit-samples/src/main/res/layout/view_select_user.xml b/uikit-samples/src/main/res/layout/view_select_user.xml
index fea0df78..b8b3f626 100644
--- a/uikit-samples/src/main/res/layout/view_select_user.xml
+++ b/uikit-samples/src/main/res/layout/view_select_user.xml
@@ -3,9 +3,9 @@
android:id="@+id/vgUserItem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_16"
+ android:paddingStart="@dimen/sb_size_16"
android:paddingTop="@dimen/sb_size_10"
- android:paddingRight="@dimen/sb_size_16"
+ android:paddingEnd="@dimen/sb_size_16"
android:paddingBottom="@dimen/sb_size_10"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
@@ -14,17 +14,17 @@
android:id="@+id/ivUserCover"
android:layout_width="@dimen/sb_size_36"
android:layout_height="@dimen/sb_size_36"
- app:layout_constraintLeft_toLeftOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@@ -32,7 +32,7 @@
android:id="@+id/cbUserPreview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- app:layout_constraintRight_toRightOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
diff --git a/uikit-samples/src/main/res/values/strings.xml b/uikit-samples/src/main/res/values/strings.xml
index 9f20e7d9..9497cc8f 100644
--- a/uikit-samples/src/main/res/values/strings.xml
+++ b/uikit-samples/src/main/res/values/strings.xml
@@ -153,4 +153,13 @@
Thumbs Up
Thumbs Down
Choose the report category
+
+
+ - PRODUCTION
+ - PREPROD
+ - NO1
+ - NO2
+ - NO3
+ - NO4
+
diff --git a/uikit/build.gradle b/uikit/build.gradle
index 2cde927f..6532bfc5 100644
--- a/uikit/build.gradle
+++ b/uikit/build.gradle
@@ -6,6 +6,7 @@ plugins {
id 'org.jetbrains.dokka' version "$kotlin_version"
}
+
version = UIKIT_VERSION
android {
namespace 'com.sendbird.uikit'
@@ -53,6 +54,10 @@ android {
targetCompatibility = 1.8
}
+ kotlinOptions {
+ jvmTarget = '1.8'
+ }
+
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
@@ -65,17 +70,17 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
// Sendbird
- api 'com.sendbird.sdk:sendbird-chat:4.16.4'
+ api 'com.sendbird.sdk:sendbird-chat:4.17.0'
implementation 'com.github.bumptech.glide:glide:4.16.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.16.0'
- implementation 'androidx.appcompat:appcompat:1.7.0'
+ implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
implementation "androidx.viewpager2:viewpager2:1.1.0"
- implementation 'com.google.android.material:material:1.12.0'
+ implementation 'com.google.android.material:material:1.5.0'
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
@@ -86,7 +91,7 @@ dokkaHtml {
print "uikit doc path=$System.env.UIKIT_DOC_PATH"
outputDirectory.set(file("$System.env.UIKIT_DOC_PATH"))
// Set module name displayed in the final output
- moduleName.set("Sendbird UIKit")
+ moduleName.set("SendbirdUIKit")
suppressInheritedMembers.set(true)
String dokkaBaseConfiguration = """
diff --git a/uikit/internal.gradle b/uikit/internal.gradle
index fcc399f6..994ee269 100644
--- a/uikit/internal.gradle
+++ b/uikit/internal.gradle
@@ -40,7 +40,15 @@ dependencies {
testImplementation 'io.kotest:kotest-assertions-core:5.6.0'
testImplementation "io.mockk:mockk:1.13.4"
testImplementation 'androidx.arch.core:core-testing:2.2.0'
+ testImplementation 'androidx.test.ext:junit:1.1.5'
testImplementation("pl.pragmatists:JUnitParams:1.1.0")
+ testImplementation("app.cash.paparazzi:paparazzi:$paparazzi_version")
+}
+
+// Apply the paparazzi plugin if the project has the withSnapshotTest property
+// It will force the kotlin compiler version to be changed to a higher one, so it should only include the plugin in real tests.
+if (project.hasProperty('withSnapshotTest')) {
+ apply plugin: 'app.cash.paparazzi'
}
tasks.register("ktlintCheck", JavaExec) {
diff --git a/uikit/src/main/java/com/sendbird/uikit/SendbirdUIKit.java b/uikit/src/main/java/com/sendbird/uikit/SendbirdUIKit.java
index 175a20b4..607e2dfa 100644
--- a/uikit/src/main/java/com/sendbird/uikit/SendbirdUIKit.java
+++ b/uikit/src/main/java/com/sendbird/uikit/SendbirdUIKit.java
@@ -45,15 +45,15 @@
import com.sendbird.uikit.interfaces.CustomParamsHandler;
import com.sendbird.uikit.interfaces.CustomUserListQueryHandler;
import com.sendbird.uikit.interfaces.UserInfo;
+import com.sendbird.uikit.internal.contracts.SendbirdChatContract;
+import com.sendbird.uikit.internal.contracts.SendbirdChatImpl;
+import com.sendbird.uikit.internal.contracts.TaskQueueContract;
+import com.sendbird.uikit.internal.contracts.TaskQueueImpl;
import com.sendbird.uikit.internal.singleton.MessageDisplayDataManager;
import com.sendbird.uikit.internal.singleton.MessageTemplateManager;
import com.sendbird.uikit.internal.singleton.NotificationChannelManager;
import com.sendbird.uikit.internal.singleton.UIKitConfigRepository;
import com.sendbird.uikit.internal.tasks.JobResultTask;
-import com.sendbird.uikit.internal.contracts.SendbirdChatImpl;
-import com.sendbird.uikit.internal.contracts.SendbirdChatContract;
-import com.sendbird.uikit.internal.contracts.TaskQueueImpl;
-import com.sendbird.uikit.internal.contracts.TaskQueueContract;
import com.sendbird.uikit.log.Logger;
import com.sendbird.uikit.model.EmojiManager;
import com.sendbird.uikit.model.UserMentionConfig;
@@ -560,14 +560,39 @@ public static void connect(@Nullable ConnectHandler handler) {
* Unlike {@link #connect(ConnectHandler)}, it is used to issue the necessary credentials when using the API required for FeedNotification.
*
* @param handler Callback handler.
+ * @deprecated As of 3.19.0, replaced by {@link #authenticate(AuthenticationHandler)}.
* since 3.7.0
*/
+ @Deprecated
public static void authenticateFeed(@Nullable AuthenticationHandler handler) {
+ authenticate(handler);
+ }
+
+ /**
+ * Authenticate to Sendbird with given UserInfo
.
+ * Unlike {@link #connect(ConnectHandler)}, it is used to issue the necessary credentials when using the API required for FeedNotification.
+ *
+ * @param handler Callback handler.
+ * since 3.19.0
+ */
+ public static void authenticate(@Nullable AuthenticationHandler handler) {
connectInternal(ConnectType.AUTHENTICATE_FEED, new SendbirdChatImpl(), new TaskQueueImpl(), (user, e1) -> {
if (handler != null) handler.onAuthenticated(user, e1);
});
}
+ /**
+ * This method is used only internally.
+ *
+ * @param apiHost Custom API Host. Internal use only.
+ * @param wsHost Custom WS Host. Internal use only.
+ * since 3.19.0
+ */
+ public static synchronized void setCustomHosts(@Nullable String apiHost, @Nullable String wsHost) {
+ UIKitPrefs.putString(StringSet.KEY_CUSTOM_API_HOST, apiHost);
+ UIKitPrefs.putString(StringSet.KEY_CUSTOM_WS_HOST, wsHost);
+ }
+
private enum ConnectType {
CONNECT,
AUTHENTICATE_FEED
@@ -698,14 +723,16 @@ static void fetchTemplatesBlocking(@NonNull SendbirdChatContract sendbirdChat) {
@NonNull
private static Pair connectBlocking(@NonNull SendbirdChatContract sendbirdChat) throws InterruptedException {
- AtomicReference result = new AtomicReference<>();
- AtomicReference error = new AtomicReference<>();
- CountDownLatch latch = new CountDownLatch(1);
- UserInfo userInfo = adapter.getUserInfo();
- String userId = userInfo.getUserId();
- String accessToken = adapter.getAccessToken();
-
- sendbirdChat.connect(userId, accessToken, (user, e) -> {
+ final AtomicReference result = new AtomicReference<>();
+ final AtomicReference error = new AtomicReference<>();
+ final CountDownLatch latch = new CountDownLatch(1);
+ final UserInfo userInfo = adapter.getUserInfo();
+ final String userId = userInfo.getUserId();
+ final String accessToken = adapter.getAccessToken();
+ final String apiHost = UIKitPrefs.getString(StringSet.KEY_CUSTOM_API_HOST, null);
+ final String wsHost = UIKitPrefs.getString(StringSet.KEY_CUSTOM_WS_HOST, null);
+
+ sendbirdChat.connect(userId, accessToken, apiHost, wsHost, (user, e) -> {
result.set(user);
if (e != null) {
error.set(e);
@@ -726,7 +753,8 @@ private static Pair authenticateFeedBlocking(@NonNull S
String userId = userInfo.getUserId();
String accessToken = adapter.getAccessToken();
- sendbirdChat.authenticateFeed(userId, accessToken, null, (user, e) -> {
+ final String apiHost = UIKitPrefs.getString(StringSet.KEY_CUSTOM_API_HOST, null);
+ sendbirdChat.authenticate(userId, accessToken, apiHost, (user, e) -> {
result.set(user);
if (e != null) {
error.set(e);
diff --git a/uikit/src/main/java/com/sendbird/uikit/activities/adapter/DialogListAdapter.java b/uikit/src/main/java/com/sendbird/uikit/activities/adapter/DialogListAdapter.java
index 63776ddb..5a31d9cb 100644
--- a/uikit/src/main/java/com/sendbird/uikit/activities/adapter/DialogListAdapter.java
+++ b/uikit/src/main/java/com/sendbird/uikit/activities/adapter/DialogListAdapter.java
@@ -91,7 +91,7 @@ private ListViewHolder(@NonNull SbViewDialogListItemBinding binding,
buttonTint = a.getColorStateList(R.styleable.DialogView_sb_dialog_view_icon_tint);
this.binding.clItem.setBackgroundResource(listItemBackground);
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) binding.name.getLayoutParams();
- params.setMargins((int) context.getResources().getDimension(nameMarginLeft), 0, 0, 0);
+ params.setMarginStart((int) context.getResources().getDimension(nameMarginLeft));
binding.name.setTextAppearance(context, listItemAppearance);
if (listItemTextColor != null) binding.name.setTextColor(listItemTextColor);
diff --git a/uikit/src/main/java/com/sendbird/uikit/consts/StringSet.kt b/uikit/src/main/java/com/sendbird/uikit/consts/StringSet.kt
index 1852adeb..1fceeba6 100644
--- a/uikit/src/main/java/com/sendbird/uikit/consts/StringSet.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/consts/StringSet.kt
@@ -82,6 +82,8 @@ object StringSet {
const val KEY_OPEN_CHANNEL_CONFIG = "KEY_OPEN_CHANNEL_CONFIG"
const val KEY_EMOJI_REACTION_USER_LIST_SIZE = "KEY_EMOJI_REACTION_USER_LIST_SIZE"
const val KEY_EMOJI_REACTION_USER_ = "KEY_EMOJI_REACTION_USER_"
+ const val KEY_CUSTOM_API_HOST = "KEY_CUSTOM_API_HOST"
+ const val KEY_CUSTOM_WS_HOST = "KEY_CUSTOM_WS_HOST"
const val sb_uikit = "sb_uikit"
const val sbu_type = "sbu_type"
const val audio = "audio"
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/adapter/CarouselChildViewAdapter.kt b/uikit/src/main/java/com/sendbird/uikit/internal/adapter/CarouselChildViewAdapter.kt
index 40252d69..5cfdfd07 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/adapter/CarouselChildViewAdapter.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/adapter/CarouselChildViewAdapter.kt
@@ -2,6 +2,7 @@ package com.sendbird.uikit.internal.adapter
import android.content.Context
import android.view.ViewGroup
+import android.widget.LinearLayout.LayoutParams
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.RecyclerView
import com.sendbird.uikit.R
@@ -10,6 +11,7 @@ import com.sendbird.uikit.internal.model.template_messages.Params
import com.sendbird.uikit.internal.model.template_messages.SizeType
import com.sendbird.uikit.internal.model.template_messages.ViewLifecycleHandler
import com.sendbird.uikit.internal.ui.messages.MessageTemplateView
+import kotlin.math.max
internal class CarouselChildViewAdapter : RecyclerView.Adapter() {
private val childTemplateParams: MutableList = mutableListOf()
@@ -45,11 +47,13 @@ internal class CarouselChildViewAdapter : RecyclerView.Adapter Unit)?): CharSequence {
- return SpannableStringBuilder(this)
- .applyMarkdownBold()
- .applyMarkdownLink(onLinkClickListener)
+internal enum class MarkdownType {
+ BOLD, LINK
}
-private fun SpannableStringBuilder.applyMarkdownBold(): SpannableStringBuilder = apply {
+internal fun CharSequence.applyMarkdown(
+ types: List = listOf(MarkdownType.BOLD, MarkdownType.LINK),
+ onLinkClickListener: ((link: String) -> Unit)?
+): SpannableStringBuilder {
+ val spannableStringBuilder = SpannableStringBuilder(this)
+ types.forEach { type ->
+ when (type) {
+ MarkdownType.BOLD -> {
+ spannableStringBuilder.convertMarkdownBoldPatterns().applySpan()
+ }
+ MarkdownType.LINK -> {
+ spannableStringBuilder.convertMarkdownLinkPatterns().applySpan(onLinkClickListener)
+ }
+ }
+ }
+
+ return spannableStringBuilder
+}
+
+internal fun CharSequence.removeMarkdownFormatting(
+ types: List = listOf(MarkdownType.BOLD, MarkdownType.LINK)
+): SpannableStringBuilder {
+ val spannableStringBuilder = SpannableStringBuilder(this)
+
+ // Remove bold patterns
+ if (MarkdownType.BOLD in types) {
+ spannableStringBuilder.convertMarkdownBoldPatterns()
+ }
+
+ // Remove link patterns
+ if (MarkdownType.LINK in types) {
+ spannableStringBuilder.convertMarkdownLinkPatterns()
+ }
+
+ return spannableStringBuilder
+}
+
+private fun SpannableStringBuilder.convertMarkdownBoldPatterns(): MarkdownResult {
val boldPatterns = listOf(Regex("\\*\\*(.*?)\\*\\*"), Regex("__(.*?)__")) // **bold** or __bold__
- for (boldPattern in boldPatterns) {
+ val ranges = mutableListOf()
+ for (pattern in boldPatterns) {
do {
- val match = boldPattern.find(this)
+ val match = pattern.find(this)
if (match != null) {
val start = match.range.first
val end = match.range.last + 1
- this.setSpan(StyleSpan(Typeface.BOLD), start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
- this.delete(end - 2, end) // Remove last '**' or '__'
- this.delete(start, start + 2) // Remove first '**' or '__'
+ ranges.add(Range(start, end - 4))
+ delete(end - 2, end) // Remove last '**' or '__'
+ delete(start, start + 2) // Remove first '**' or '__'
}
} while (match != null)
}
+ return MarkdownResult(MarkdownType.BOLD, this, ranges)
}
-private fun SpannableStringBuilder.applyMarkdownLink(
- onLinkClickListener: ((url: String) -> Unit)?
-): SpannableStringBuilder = apply {
+private fun SpannableStringBuilder.convertMarkdownLinkPatterns(): MarkdownResult {
val linkPattern = Regex("\\[(.*?)\\]\\((.*?)\\)")
+ val ranges = mutableListOf()
+ val urls = mutableListOf()
do {
val match = linkPattern.find(this)
if (match != null) {
@@ -40,15 +77,38 @@ private fun SpannableStringBuilder.applyMarkdownLink(
val end = match.range.last + 1
val linkText = match.groups[1]?.value ?: ""
val url = match.groups[2]?.value ?: ""
- this.setSpan(StyleSpan(Typeface.BOLD), start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
- this.setSpan(object : ClickableSpan() {
- override fun onClick(widget: View) {
- onLinkClickListener?.invoke(url)
- }
- }, start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
- this.delete(start + linkText.length + 2, end) // remove '(url)' of '[linkText](url)'
- this.delete(start + linkText.length + 1, start + linkText.length + 2) // remove ']' of '[linkText]'
- this.delete(start, start + 1) // remove '[' of '[linkText]'
+ ranges.add(Range(start, start + linkText.length))
+ urls.add(url)
+ delete(start + linkText.length + 2, end) // remove '(url)' of '[linkText](url)'
+ delete(start + linkText.length + 1, start + linkText.length + 2) // remove ']' of '[linkText]'
+ delete(start, start + 1) // remove '[' of '[linkText]'
}
} while (match != null)
+ return MarkdownResult(MarkdownType.LINK, this, ranges, urls)
+}
+
+private data class MarkdownResult(val type: MarkdownType, val src: SpannableStringBuilder, val ranges: List, val results: List? = null)
+
+private fun MarkdownResult.applySpan(onLinkClickListener: ((link: String) -> Unit)? = null) {
+ when (type) {
+ MarkdownType.BOLD -> {
+ ranges.forEach {
+ src.setSpan(StyleSpan(Typeface.BOLD), it.start, it.end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
+ }
+ }
+ MarkdownType.LINK -> {
+ ranges.forEachIndexed { index, range ->
+ val url = results?.get(index) ?: ""
+ val clickableSpan = object : ClickableSpan() {
+ override fun onClick(widget: View) {
+ onLinkClickListener?.invoke(url)
+ }
+ }
+ src.setSpan(StyleSpan(Typeface.BOLD), range.start, range.end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
+ src.setSpan(clickableSpan, range.start, range.end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
+ }
+ }
+ }
}
+
+private data class Range(val start: Int, val end: Int)
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/extensions/ViewExtensions.kt b/uikit/src/main/java/com/sendbird/uikit/internal/extensions/ViewExtensions.kt
index 107b41c3..ea52460b 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/extensions/ViewExtensions.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/extensions/ViewExtensions.kt
@@ -60,7 +60,7 @@ internal fun EditText.setCursorDrawable(cursor: Drawable) {
val f = TextView::class.java.getDeclaredField(StringSet.mCursorDrawableRes)
f.isAccessible = true
f[this] = cursor
- } catch (t: Throwable) {
+ } catch (ignore: Throwable) {
}
}
}
@@ -116,7 +116,7 @@ internal fun View.addRipple(background: Drawable?) = with(TypedValue()) {
this@addRipple.background = createRippleDrawable(color, background)
}
-internal fun View.addRipple(pressedColor: Int) = with(TypedValue()) {
+internal fun View.addRipple(pressedColor: Int) {
this@addRipple.background = createRippleDrawable(pressedColor, background)
}
@@ -194,3 +194,11 @@ internal fun Context.createFallbackViewParams(message: String): Params {
this.getString(R.string.sb_text_template_message_fallback_description),
)
}
+
+internal fun TextView.applyTextAlignment(gravity: Int) {
+ if ((gravity and Gravity.START) == Gravity.START) {
+ textAlignment = View.TEXT_ALIGNMENT_VIEW_START
+ } else if ((gravity and Gravity.END) == Gravity.END) {
+ textAlignment = View.TEXT_ALIGNMENT_VIEW_END
+ }
+}
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/model/template_messages/Params.kt b/uikit/src/main/java/com/sendbird/uikit/internal/model/template_messages/Params.kt
index 4ed5a4bd..d42d0d31 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/model/template_messages/Params.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/model/template_messages/Params.kt
@@ -1,12 +1,10 @@
package com.sendbird.uikit.internal.model.template_messages
import android.content.Context
-import android.graphics.Color
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import com.sendbird.android.message.BaseMessage
-import com.sendbird.uikit.SendbirdUIKit
import com.sendbird.uikit.interfaces.OnNotificationTemplateActionHandler
import com.sendbird.uikit.internal.extensions.intToDp
import com.sendbird.uikit.model.Action
@@ -22,7 +20,7 @@ const val FILL_PARENT = 0
const val WRAP_CONTENT = 1
@Serializable
-internal data class ActionData constructor(
+internal data class ActionData(
val type: ActionType = ActionType.Web,
val data: String,
val alterData: String? = null
@@ -55,7 +53,7 @@ internal data class ActionData constructor(
}
@Serializable
-internal data class SizeSpec constructor(
+internal data class SizeSpec(
val type: SizeType,
@SerialName(KeySet.value)
private val _value: Int
@@ -87,7 +85,7 @@ internal data class SizeSpec constructor(
}
@Serializable
-internal data class Align constructor(
+internal data class Align(
private val horizontal: HorizontalAlign = HorizontalAlign.Left,
private val vertical: VerticalAlign = VerticalAlign.Top
) {
@@ -108,7 +106,7 @@ internal data class Align constructor(
}
@Serializable
-internal data class MetaData constructor(
+internal data class MetaData(
val pixelWidth: Int,
val pixelHeight: Int
)
@@ -162,7 +160,7 @@ internal sealed class ViewParams {
@Serializable
@SerialName(KeySet.box)
-internal data class BoxViewParams constructor(
+internal data class BoxViewParams(
override val type: ViewType,
override val action: ActionData? = null,
override val width: SizeSpec = SizeSpec(SizeType.Flex, FILL_PARENT),
@@ -176,7 +174,7 @@ internal data class BoxViewParams constructor(
@Serializable
@SerialName(KeySet.text)
-internal data class TextViewParams constructor(
+internal data class TextViewParams(
override val type: ViewType,
override val action: ActionData? = null,
override val width: SizeSpec = SizeSpec(SizeType.Flex, FILL_PARENT),
@@ -190,7 +188,7 @@ internal data class TextViewParams constructor(
@Serializable
@SerialName(KeySet.image)
-internal data class ImageViewParams constructor(
+internal data class ImageViewParams(
override val type: ViewType,
override val action: ActionData? = null,
override val width: SizeSpec = SizeSpec(SizeType.Flex, FILL_PARENT),
@@ -203,7 +201,7 @@ internal data class ImageViewParams constructor(
@Serializable
@SerialName(KeySet.textButton)
-internal data class ButtonViewParams constructor(
+internal data class ButtonViewParams(
override val type: ViewType,
override val action: ActionData? = null,
override val width: SizeSpec = SizeSpec(SizeType.Flex, FILL_PARENT),
@@ -211,18 +209,12 @@ internal data class ButtonViewParams constructor(
override val viewStyle: ViewStyle = ViewStyle(),
val text: String,
val maxTextLines: Int = 1,
- val textStyle: TextStyle = TextStyle(
- color = when (SendbirdUIKit.getDefaultThemeMode()) {
- SendbirdUIKit.ThemeMode.Light -> Color.parseColor("#742ddd")
- SendbirdUIKit.ThemeMode.Dark -> Color.parseColor("#c2a9fa")
- },
- weight = Weight.Bold
- )
+ val textStyle: TextStyle? = null
) : ViewParams()
@Serializable
@SerialName(KeySet.imageButton)
-internal data class ImageButtonViewParams constructor(
+internal data class ImageButtonViewParams(
override val type: ViewType,
override val action: ActionData? = null,
override val width: SizeSpec = SizeSpec(SizeType.Flex, FILL_PARENT),
@@ -235,7 +227,7 @@ internal data class ImageButtonViewParams constructor(
@Serializable
@SerialName(KeySet.carouselView)
-internal data class CarouselViewParams constructor(
+internal data class CarouselViewParams(
override val type: ViewType,
override val action: ActionData? = null,
override val width: SizeSpec = SizeSpec(SizeType.Flex, FILL_PARENT),
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/model/template_messages/Styles.kt b/uikit/src/main/java/com/sendbird/uikit/internal/model/template_messages/Styles.kt
index 1468c52f..e035ead3 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/model/template_messages/Styles.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/model/template_messages/Styles.kt
@@ -59,11 +59,13 @@ internal data class ViewStyle(
val padding: Padding? = null
) {
fun apply(view: View, useRipple: Boolean = false): ViewStyle {
- backgroundImageUrl?.let { view.loadToBackground(it, radius ?: 0, useRipple) }
if (backgroundColor != null || (borderWidth != null && borderWidth > 0)) {
view.setBackgroundColor(backgroundColor ?: Color.TRANSPARENT)
}
+ // backgroundImageUrl has higher priority than backgroundColor (platform synced)
+ backgroundImageUrl?.let { view.loadToBackground(it, radius ?: 0, useRipple) }
+
margin?.apply(view)
padding?.apply(view)
@@ -76,7 +78,7 @@ internal data class ViewStyle(
}
@Serializable
-internal data class Margin constructor(
+internal data class Margin(
val top: Int = 0,
val bottom: Int = 0,
val left: Int = 0,
@@ -85,18 +87,17 @@ internal data class Margin constructor(
fun apply(view: View) {
val resources = view.context.resources
val layoutParams = view.layoutParams as LinearLayout.LayoutParams
- layoutParams.setMargins(
- resources.intToDp(left),
- resources.intToDp(top),
- resources.intToDp(right),
- resources.intToDp(bottom)
- )
- view.layoutParams = layoutParams
+ view.layoutParams = layoutParams.also {
+ it.topMargin = resources.intToDp(top)
+ it.bottomMargin = resources.intToDp(bottom)
+ it.marginStart = resources.intToDp(left)
+ it.marginEnd = resources.intToDp(right)
+ }
}
}
@Serializable
-internal data class Padding constructor(
+internal data class Padding(
val top: Int = 0,
val bottom: Int = 0,
val left: Int = 0,
@@ -104,7 +105,7 @@ internal data class Padding constructor(
) {
fun apply(view: View) {
val resources = view.context.resources
- view.setPadding(
+ view.setPaddingRelative(
resources.intToDp(left),
resources.intToDp(top),
resources.intToDp(right),
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/ui/channels/ChannelPreview.kt b/uikit/src/main/java/com/sendbird/uikit/internal/ui/channels/ChannelPreview.kt
index 10ac529f..47f8fcb8 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/ui/channels/ChannelPreview.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/ui/channels/ChannelPreview.kt
@@ -16,8 +16,10 @@ import com.sendbird.android.message.UserMessage
import com.sendbird.uikit.R
import com.sendbird.uikit.SendbirdUIKit
import com.sendbird.uikit.internal.extensions.getDisplayMessage
+import com.sendbird.uikit.internal.extensions.removeMarkdownFormatting
import com.sendbird.uikit.internal.extensions.setAppearance
import com.sendbird.uikit.internal.extensions.toDisplayText
+import com.sendbird.uikit.model.configurations.UIKitConfig.groupChannelConfig
import com.sendbird.uikit.utils.ChannelUtils
import com.sendbird.uikit.utils.DateUtils
import com.sendbird.uikit.utils.DrawableUtils
@@ -200,7 +202,10 @@ internal class ChannelPreview @JvmOverloads constructor(
is UserMessage -> {
textView.maxLines = 2
textView.ellipsize = TextUtils.TruncateAt.END
- message = it.getDisplayMessage()
+ message = it.getDisplayMessage().run {
+ if (!groupChannelConfig.enableMarkdownForUserMessage) this
+ else this.removeMarkdownFormatting()
+ }
}
is BaseFileMessage -> {
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/FeedNotificationView.kt b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/FeedNotificationView.kt
index 0af36417..f4eee7ae 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/FeedNotificationView.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/FeedNotificationView.kt
@@ -82,17 +82,17 @@ internal class FeedNotificationView @JvmOverloads internal constructor(
// UI padding is different when category filter is enabled
if (channel.isCategoryFilterEnabled && channel.notificationCategories.isNotEmpty()) {
- binding.root.setPadding(
- binding.root.paddingLeft,
+ binding.root.setPaddingRelative(
+ binding.root.paddingStart,
0,
- binding.root.paddingRight,
+ binding.root.paddingEnd,
context.resources.getDimensionPixelSize(R.dimen.sb_size_16)
)
} else {
- binding.root.setPadding(
- binding.root.paddingLeft,
+ binding.root.setPaddingRelative(
+ binding.root.paddingStart,
context.resources.getDimensionPixelSize(R.dimen.sb_size_8),
- binding.root.paddingRight,
+ binding.root.paddingEnd,
context.resources.getDimensionPixelSize(R.dimen.sb_size_8)
)
}
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/MyFileMessageView.kt b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/MyFileMessageView.kt
index fce96a38..f261b7dd 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/MyFileMessageView.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/MyFileMessageView.kt
@@ -91,7 +91,7 @@ internal class MyFileMessageView @JvmOverloads internal constructor(
resources.getDimensionPixelSize(if (messageGroupType == MessageGroupType.GROUPING_TYPE_TAIL || messageGroupType == MessageGroupType.GROUPING_TYPE_BODY) R.dimen.sb_size_1 else R.dimen.sb_size_8)
val paddingBottom =
resources.getDimensionPixelSize(if (messageGroupType == MessageGroupType.GROUPING_TYPE_HEAD || messageGroupType == MessageGroupType.GROUPING_TYPE_BODY) R.dimen.sb_size_1 else R.dimen.sb_size_8)
- binding.root.setPadding(binding.root.paddingLeft, paddingTop, binding.root.paddingRight, paddingBottom)
+ binding.root.setPaddingRelative(binding.root.paddingStart, paddingTop, binding.root.paddingEnd, paddingBottom)
if (params.shouldUseQuotedView()) {
ViewUtils.drawQuotedMessage(
binding.quoteReplyPanel,
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/MyImageFileMessageView.kt b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/MyImageFileMessageView.kt
index 9705b08d..e7b752a9 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/MyImageFileMessageView.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/MyImageFileMessageView.kt
@@ -80,7 +80,7 @@ internal class MyImageFileMessageView @JvmOverloads internal constructor(
resources.getDimensionPixelSize(if (messageGroupType == MessageGroupType.GROUPING_TYPE_TAIL || messageGroupType == MessageGroupType.GROUPING_TYPE_BODY) R.dimen.sb_size_1 else R.dimen.sb_size_8)
val paddingBottom =
resources.getDimensionPixelSize(if (messageGroupType == MessageGroupType.GROUPING_TYPE_HEAD || messageGroupType == MessageGroupType.GROUPING_TYPE_BODY) R.dimen.sb_size_1 else R.dimen.sb_size_8)
- binding.root.setPadding(binding.root.paddingLeft, paddingTop, binding.root.paddingRight, paddingBottom)
+ binding.root.setPaddingRelative(binding.root.paddingStart, paddingTop, binding.root.paddingEnd, paddingBottom)
if (params.shouldUseQuotedView()) {
ViewUtils.drawQuotedMessage(
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/MyMessageView.kt b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/MyMessageView.kt
index 99074a95..baa3b701 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/MyMessageView.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/MyMessageView.kt
@@ -84,7 +84,7 @@ internal class MyMessageView @JvmOverloads internal constructor(
resources.getDimensionPixelSize(if (messageGroupType == MessageGroupType.GROUPING_TYPE_TAIL || messageGroupType == MessageGroupType.GROUPING_TYPE_BODY) R.dimen.sb_size_1 else R.dimen.sb_size_8)
val paddingBottom =
resources.getDimensionPixelSize(if (messageGroupType == MessageGroupType.GROUPING_TYPE_HEAD || messageGroupType == MessageGroupType.GROUPING_TYPE_BODY) R.dimen.sb_size_1 else R.dimen.sb_size_8)
- binding.root.setPadding(binding.root.paddingLeft, paddingTop, binding.root.paddingRight, paddingBottom)
+ binding.root.setPaddingRelative(binding.root.paddingStart, paddingTop, binding.root.paddingEnd, paddingBottom)
if (params.shouldUseQuotedView() && channel is GroupChannel) {
ViewUtils.drawQuotedMessage(
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/MyMultipleFilesMessageView.kt b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/MyMultipleFilesMessageView.kt
index 7d733463..40993596 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/MyMultipleFilesMessageView.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/MyMultipleFilesMessageView.kt
@@ -93,7 +93,7 @@ internal class MyMultipleFilesMessageView @JvmOverloads internal constructor(
resources.getDimensionPixelSize(if (messageGroupType == MessageGroupType.GROUPING_TYPE_TAIL || messageGroupType == MessageGroupType.GROUPING_TYPE_BODY) R.dimen.sb_size_1 else R.dimen.sb_size_8)
val paddingBottom =
resources.getDimensionPixelSize(if (messageGroupType == MessageGroupType.GROUPING_TYPE_HEAD || messageGroupType == MessageGroupType.GROUPING_TYPE_BODY) R.dimen.sb_size_1 else R.dimen.sb_size_8)
- binding.root.setPadding(binding.root.paddingLeft, paddingTop, binding.root.paddingRight, paddingBottom)
+ binding.root.setPaddingRelative(binding.root.paddingStart, paddingTop, binding.root.paddingEnd, paddingBottom)
if (params.shouldUseQuotedView()) {
ViewUtils.drawQuotedMessage(
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/MyUserMessageView.kt b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/MyUserMessageView.kt
index 7537dab3..57b2227c 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/MyUserMessageView.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/MyUserMessageView.kt
@@ -159,7 +159,7 @@ internal class MyUserMessageView @JvmOverloads internal constructor(
resources.getDimensionPixelSize(if (messageGroupType === MessageGroupType.GROUPING_TYPE_TAIL || messageGroupType === MessageGroupType.GROUPING_TYPE_BODY) R.dimen.sb_size_1 else R.dimen.sb_size_8)
val paddingBottom =
resources.getDimensionPixelSize(if (messageGroupType === MessageGroupType.GROUPING_TYPE_HEAD || messageGroupType === MessageGroupType.GROUPING_TYPE_BODY) R.dimen.sb_size_1 else R.dimen.sb_size_8)
- binding.root.setPadding(binding.root.paddingLeft, paddingTop, binding.root.paddingRight, paddingBottom)
+ binding.root.setPaddingRelative(binding.root.paddingStart, paddingTop, binding.root.paddingEnd, paddingBottom)
if (params.shouldUseQuotedView()) {
ViewUtils.drawQuotedMessage(
binding.quoteReplyPanel,
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/MyVideoFileMessageView.kt b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/MyVideoFileMessageView.kt
index 2f63ca43..2fcf1aa7 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/MyVideoFileMessageView.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/MyVideoFileMessageView.kt
@@ -79,7 +79,7 @@ internal class MyVideoFileMessageView @JvmOverloads constructor(
resources.getDimensionPixelSize(if (messageGroupType == MessageGroupType.GROUPING_TYPE_TAIL || messageGroupType == MessageGroupType.GROUPING_TYPE_BODY) R.dimen.sb_size_1 else R.dimen.sb_size_8)
val paddingBottom =
resources.getDimensionPixelSize(if (messageGroupType == MessageGroupType.GROUPING_TYPE_HEAD || messageGroupType == MessageGroupType.GROUPING_TYPE_BODY) R.dimen.sb_size_1 else R.dimen.sb_size_8)
- binding.root.setPadding(binding.root.paddingLeft, paddingTop, binding.root.paddingRight, paddingBottom)
+ binding.root.setPaddingRelative(binding.root.paddingStart, paddingTop, binding.root.paddingEnd, paddingBottom)
if (params.shouldUseQuotedView()) {
ViewUtils.drawQuotedMessage(
binding.quoteReplyPanel,
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/MyVoiceMessageView.kt b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/MyVoiceMessageView.kt
index 618ba512..4ae966cf 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/MyVoiceMessageView.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/MyVoiceMessageView.kt
@@ -127,7 +127,7 @@ internal class MyVoiceMessageView @JvmOverloads internal constructor(
resources.getDimensionPixelSize(if (messageGroupType == MessageGroupType.GROUPING_TYPE_TAIL || messageGroupType == MessageGroupType.GROUPING_TYPE_BODY) R.dimen.sb_size_1 else R.dimen.sb_size_8)
val paddingBottom =
resources.getDimensionPixelSize(if (messageGroupType == MessageGroupType.GROUPING_TYPE_HEAD || messageGroupType == MessageGroupType.GROUPING_TYPE_BODY) R.dimen.sb_size_1 else R.dimen.sb_size_8)
- binding.root.setPadding(binding.root.paddingLeft, paddingTop, binding.root.paddingRight, paddingBottom)
+ binding.root.setPaddingRelative(binding.root.paddingStart, paddingTop, binding.root.paddingEnd, paddingBottom)
if (params.shouldUseQuotedView()) {
ViewUtils.drawQuotedMessage(
binding.quoteReplyPanel,
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/OtherFileMessageView.kt b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/OtherFileMessageView.kt
index 8f483acd..7d45b77e 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/OtherFileMessageView.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/OtherFileMessageView.kt
@@ -66,7 +66,7 @@ internal class OtherFileMessageView @JvmOverloads constructor(
resources.getDimensionPixelSize(if (messageGroupType == MessageGroupType.GROUPING_TYPE_TAIL || messageGroupType == MessageGroupType.GROUPING_TYPE_BODY) R.dimen.sb_size_1 else R.dimen.sb_size_8)
val paddingBottom =
resources.getDimensionPixelSize(if (messageGroupType == MessageGroupType.GROUPING_TYPE_HEAD || messageGroupType == MessageGroupType.GROUPING_TYPE_BODY) R.dimen.sb_size_1 else R.dimen.sb_size_8)
- binding.root.setPadding(binding.root.paddingLeft, paddingTop, binding.root.paddingRight, paddingBottom)
+ binding.root.setPaddingRelative(binding.root.paddingStart, paddingTop, binding.root.paddingEnd, paddingBottom)
if (params.shouldUseQuotedView()) {
ViewUtils.drawQuotedMessage(
binding.quoteReplyPanel,
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/OtherImageFileMessageView.kt b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/OtherImageFileMessageView.kt
index 2dd3da59..d097e5b7 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/OtherImageFileMessageView.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/OtherImageFileMessageView.kt
@@ -65,7 +65,7 @@ internal class OtherImageFileMessageView @JvmOverloads constructor(
resources.getDimensionPixelSize(if (messageGroupType == MessageGroupType.GROUPING_TYPE_TAIL || messageGroupType == MessageGroupType.GROUPING_TYPE_BODY) R.dimen.sb_size_1 else R.dimen.sb_size_8)
val paddingBottom =
resources.getDimensionPixelSize(if (messageGroupType == MessageGroupType.GROUPING_TYPE_HEAD || messageGroupType == MessageGroupType.GROUPING_TYPE_BODY) R.dimen.sb_size_1 else R.dimen.sb_size_8)
- binding.root.setPadding(binding.root.paddingLeft, paddingTop, binding.root.paddingRight, paddingBottom)
+ binding.root.setPaddingRelative(binding.root.paddingStart, paddingTop, binding.root.paddingEnd, paddingBottom)
if (params.shouldUseQuotedView()) {
ViewUtils.drawQuotedMessage(
binding.quoteReplyPanel,
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/OtherMessageView.kt b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/OtherMessageView.kt
index 60d81ef3..17f0fea3 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/OtherMessageView.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/OtherMessageView.kt
@@ -97,7 +97,7 @@ internal class OtherMessageView @JvmOverloads internal constructor(
resources.getDimensionPixelSize(if (messageGroupType == MessageGroupType.GROUPING_TYPE_TAIL || messageGroupType == MessageGroupType.GROUPING_TYPE_BODY) R.dimen.sb_size_1 else R.dimen.sb_size_8)
val paddingBottom =
resources.getDimensionPixelSize(if (messageGroupType == MessageGroupType.GROUPING_TYPE_HEAD || messageGroupType == MessageGroupType.GROUPING_TYPE_BODY) R.dimen.sb_size_1 else R.dimen.sb_size_8)
- binding.root.setPadding(binding.root.paddingLeft, paddingTop, binding.root.paddingRight, paddingBottom)
+ binding.root.setPaddingRelative(binding.root.paddingStart, paddingTop, binding.root.paddingEnd, paddingBottom)
if (params.shouldUseQuotedView() && channel is GroupChannel) {
ViewUtils.drawQuotedMessage(
binding.quoteReplyPanel,
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/OtherMultipleFilesMessageView.kt b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/OtherMultipleFilesMessageView.kt
index 28e5d8ca..c2939ddf 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/OtherMultipleFilesMessageView.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/OtherMultipleFilesMessageView.kt
@@ -106,7 +106,7 @@ internal class OtherMultipleFilesMessageView @JvmOverloads constructor(
resources.getDimensionPixelSize(if (messageGroupType == MessageGroupType.GROUPING_TYPE_TAIL || messageGroupType == MessageGroupType.GROUPING_TYPE_BODY) R.dimen.sb_size_1 else R.dimen.sb_size_8)
val paddingBottom =
resources.getDimensionPixelSize(if (messageGroupType == MessageGroupType.GROUPING_TYPE_HEAD || messageGroupType == MessageGroupType.GROUPING_TYPE_BODY) R.dimen.sb_size_1 else R.dimen.sb_size_8)
- binding.root.setPadding(binding.root.paddingLeft, paddingTop, binding.root.paddingRight, paddingBottom)
+ binding.root.setPaddingRelative(binding.root.paddingStart, paddingTop, binding.root.paddingEnd, paddingBottom)
if (params.shouldUseQuotedView()) {
ViewUtils.drawQuotedMessage(
binding.quoteReplyPanel,
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/OtherTemplateMessageView.kt b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/OtherTemplateMessageView.kt
index 0291ddce..b9ceff64 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/OtherTemplateMessageView.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/OtherTemplateMessageView.kt
@@ -91,7 +91,7 @@ internal class OtherTemplateMessageView @JvmOverloads internal constructor(
resources.getDimensionPixelSize(if (messageGroupType == MessageGroupType.GROUPING_TYPE_TAIL || messageGroupType == MessageGroupType.GROUPING_TYPE_BODY) R.dimen.sb_size_1 else R.dimen.sb_size_8)
val paddingBottom =
resources.getDimensionPixelSize(if (messageGroupType == MessageGroupType.GROUPING_TYPE_HEAD || messageGroupType == MessageGroupType.GROUPING_TYPE_BODY) R.dimen.sb_size_1 else R.dimen.sb_size_8)
- binding.root.setPadding(binding.root.paddingLeft, paddingTop, binding.root.paddingRight, paddingBottom)
+ binding.root.setPaddingRelative(binding.root.paddingStart, paddingTop, binding.root.paddingEnd, paddingBottom)
drawTemplateView(message, viewCachePool, shouldShowSentAt, handler)
val shouldHideFeedback = !params.channelConfig.enableFeedback ||
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/OtherUserMessageView.kt b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/OtherUserMessageView.kt
index 90ef1b87..933a4300 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/OtherUserMessageView.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/OtherUserMessageView.kt
@@ -201,7 +201,7 @@ internal class OtherUserMessageView @JvmOverloads internal constructor(
resources.getDimensionPixelSize(if (messageGroupType == MessageGroupType.GROUPING_TYPE_TAIL || messageGroupType == MessageGroupType.GROUPING_TYPE_BODY) R.dimen.sb_size_1 else R.dimen.sb_size_8)
val paddingBottom =
resources.getDimensionPixelSize(if (messageGroupType == MessageGroupType.GROUPING_TYPE_HEAD || messageGroupType == MessageGroupType.GROUPING_TYPE_BODY) R.dimen.sb_size_1 else R.dimen.sb_size_8)
- binding.root.setPadding(binding.root.paddingLeft, paddingTop, binding.root.paddingRight, paddingBottom)
+ binding.root.setPaddingRelative(binding.root.paddingStart, paddingTop, binding.root.paddingEnd, paddingBottom)
if (params.shouldUseQuotedView()) {
ViewUtils.drawQuotedMessage(
binding.quoteReplyPanel,
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/OtherVideoFileMessageView.kt b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/OtherVideoFileMessageView.kt
index c4879f5e..3a5c1d70 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/OtherVideoFileMessageView.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/OtherVideoFileMessageView.kt
@@ -64,7 +64,7 @@ internal class OtherVideoFileMessageView @JvmOverloads constructor(
resources.getDimensionPixelSize(if (messageGroupType == MessageGroupType.GROUPING_TYPE_TAIL || messageGroupType == MessageGroupType.GROUPING_TYPE_BODY) R.dimen.sb_size_1 else R.dimen.sb_size_8)
val paddingBottom =
resources.getDimensionPixelSize(if (messageGroupType == MessageGroupType.GROUPING_TYPE_HEAD || messageGroupType == MessageGroupType.GROUPING_TYPE_BODY) R.dimen.sb_size_1 else R.dimen.sb_size_8)
- binding.root.setPadding(binding.root.paddingLeft, paddingTop, binding.root.paddingRight, paddingBottom)
+ binding.root.setPaddingRelative(binding.root.paddingStart, paddingTop, binding.root.paddingEnd, paddingBottom)
if (params.shouldUseQuotedView()) {
ViewUtils.drawQuotedMessage(
binding.quoteReplyPanel,
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/OtherVoiceMessageView.kt b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/OtherVoiceMessageView.kt
index 98d90b86..e9c519f4 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/OtherVoiceMessageView.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/OtherVoiceMessageView.kt
@@ -63,7 +63,7 @@ internal class OtherVoiceMessageView @JvmOverloads constructor(
resources.getDimensionPixelSize(if (messageGroupType == MessageGroupType.GROUPING_TYPE_TAIL || messageGroupType == MessageGroupType.GROUPING_TYPE_BODY) R.dimen.sb_size_1 else R.dimen.sb_size_8)
val paddingBottom =
resources.getDimensionPixelSize(if (messageGroupType == MessageGroupType.GROUPING_TYPE_HEAD || messageGroupType == MessageGroupType.GROUPING_TYPE_BODY) R.dimen.sb_size_1 else R.dimen.sb_size_8)
- binding.root.setPadding(binding.root.paddingLeft, paddingTop, binding.root.paddingRight, paddingBottom)
+ binding.root.setPaddingRelative(binding.root.paddingStart, paddingTop, binding.root.paddingEnd, paddingBottom)
if (params.shouldUseQuotedView()) {
ViewUtils.drawQuotedMessage(
binding.quoteReplyPanel,
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/SuggestedRepliesView.kt b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/SuggestedRepliesView.kt
index 70699ae5..b0422749 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/SuggestedRepliesView.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/ui/messages/SuggestedRepliesView.kt
@@ -56,10 +56,10 @@ internal class SuggestedRepliesView @JvmOverloads internal constructor(
val layoutManager = binding.rvSuggestedReplies.layoutManager as? LinearLayoutManager
layoutManager?.orientation = LinearLayoutManager.VERTICAL
- binding.rvSuggestedReplies.setPadding(
+ binding.rvSuggestedReplies.setPaddingRelative(
0,
binding.rvSuggestedReplies.paddingTop,
- binding.rvSuggestedReplies.paddingRight,
+ binding.rvSuggestedReplies.paddingEnd,
binding.rvSuggestedReplies.paddingBottom
)
binding.rvSuggestedReplies.clipToPadding = true
@@ -68,10 +68,10 @@ internal class SuggestedRepliesView @JvmOverloads internal constructor(
val layoutManager = binding.rvSuggestedReplies.layoutManager as? LinearLayoutManager
layoutManager?.orientation = LinearLayoutManager.HORIZONTAL
- binding.rvSuggestedReplies.setPadding(
+ binding.rvSuggestedReplies.setPaddingRelative(
resources.getDimensionPixelSize(R.dimen.sb_size_38),
binding.rvSuggestedReplies.paddingTop,
- binding.rvSuggestedReplies.paddingRight,
+ binding.rvSuggestedReplies.paddingEnd,
binding.rvSuggestedReplies.paddingBottom
)
binding.rvSuggestedReplies.clipToPadding = false
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/ui/notifications/ChatNotificationListAdapter.kt b/uikit/src/main/java/com/sendbird/uikit/internal/ui/notifications/ChatNotificationListAdapter.kt
index d5985d19..dc300eab 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/ui/notifications/ChatNotificationListAdapter.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/ui/notifications/ChatNotificationListAdapter.kt
@@ -65,10 +65,12 @@ internal class ChatNotificationListAdapter(
binding.chatNotification.onNotificationTemplateActionHandler = onMessageTemplateActionHandler
binding.chatNotification.binding.contentPanel.setOnClickListener {
val position = this.bindingAdapterPosition
+ if (position == RecyclerView.NO_POSITION) return@setOnClickListener
onItemClickListener?.onItemClick(it, position, getItem(position))
}
binding.chatNotification.binding.contentPanel.setOnLongClickListener {
val position = this.bindingAdapterPosition
+ if (position == RecyclerView.NO_POSITION) return@setOnLongClickListener true
onItemLongClickListener?.onItemLongClick(it, position, getItem(position))
true
}
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/ui/notifications/FeedNotificationListAdapter.kt b/uikit/src/main/java/com/sendbird/uikit/internal/ui/notifications/FeedNotificationListAdapter.kt
index 821c0aab..541428a0 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/ui/notifications/FeedNotificationListAdapter.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/ui/notifications/FeedNotificationListAdapter.kt
@@ -65,10 +65,12 @@ internal class FeedNotificationListAdapter(
binding.feedNotification.onNotificationTemplateActionHandler = onMessageTemplateActionHandler
binding.feedNotification.binding.contentPanel.setOnClickListener {
val position = this.bindingAdapterPosition
+ if (position == RecyclerView.NO_POSITION) return@setOnClickListener
onItemClickListener?.onItemClick(it, position, getItem(position))
}
binding.feedNotification.binding.contentPanel.setOnLongClickListener {
val position = this.bindingAdapterPosition
+ if (position == RecyclerView.NO_POSITION) return@setOnLongClickListener true
onItemLongClickListener?.onItemLongClick(it, position, getItem(position))
true
}
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/ui/notifications/NotificationStatusComponent.kt b/uikit/src/main/java/com/sendbird/uikit/internal/ui/notifications/NotificationStatusComponent.kt
index e70e03b6..156651d5 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/ui/notifications/NotificationStatusComponent.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/ui/notifications/NotificationStatusComponent.kt
@@ -38,7 +38,7 @@ internal class NotificationStatusComponent(
rootView?.let {
val frameLayout: View = it
val layoutParams = frameLayout.layoutParams as ViewGroup.MarginLayoutParams
- val marginTop = it.resources.getDimensionPixelSize(R.dimen.sb_size_62)
+ val marginTop = it.resources.getDimensionPixelSize(R.dimen.sb_size_50)
layoutParams.topMargin = marginTop
frameLayout.layoutParams = layoutParams
}
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/AutoLinkTextView.kt b/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/AutoLinkTextView.kt
index 2a8c4895..b5b4855c 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/AutoLinkTextView.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/AutoLinkTextView.kt
@@ -100,7 +100,7 @@ internal class SBLinkMovementMethod constructor(
}
var touchX = event.x.toInt()
var touchY = event.y.toInt()
- touchX -= widget.totalPaddingLeft
+ touchX -= widget.totalPaddingStart
touchY -= widget.totalPaddingTop
touchX += widget.scrollX
touchY += widget.scrollY
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/ImageWaffleView.kt b/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/ImageWaffleView.kt
index 6507e013..f6e9e02d 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/ImageWaffleView.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/ImageWaffleView.kt
@@ -152,8 +152,8 @@ internal open class ImageWaffleView @JvmOverloads internal constructor(
BitmapShader(it, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP)
}
- val paddingLeft = paddingLeft
- val paddingRight = paddingRight
+ val paddingStart = paddingStart
+ val paddingEnd = paddingEnd
val paddingTop = paddingTop
val paddingBottom = paddingBottom
canvasBounds.set(0f, 0f, width.toFloat(), height.toFloat())
@@ -166,9 +166,9 @@ internal open class ImageWaffleView @JvmOverloads internal constructor(
borderPaint
)
canvasBounds.set(
- ROUND_BORDER + paddingLeft.toFloat(),
+ ROUND_BORDER + paddingStart.toFloat(),
ROUND_BORDER + paddingTop.toFloat(),
- (width - ROUND_BORDER - paddingRight).toFloat(),
+ (width - ROUND_BORDER - paddingEnd).toFloat(),
(height - ROUND_BORDER - paddingBottom).toFloat()
)
canvas.drawRoundRect(
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/MentionWatcher.kt b/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/MentionWatcher.kt
index fa3241f4..c824e8af 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/MentionWatcher.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/MentionWatcher.kt
@@ -66,8 +66,9 @@ internal class MentionWatcher(
while (i-- > 0) {
val targetWord = words[i]
// 3. finds the first token in a string.
+ val contains = trigger == targetWord
val triggerIndex = targetWord.indexOf(trigger)
- if (triggerIndex != -1) {
+ if (contains && triggerIndex != -1) {
val wordIndex = src.lastIndexOf(targetWord)
result = from + wordIndex + triggerIndex
break
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/MessageTemplateImageView.kt b/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/MessageTemplateImageView.kt
index 78188aa2..cef5e489 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/MessageTemplateImageView.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/MessageTemplateImageView.kt
@@ -89,14 +89,16 @@ internal open class MessageTemplateImageView @JvmOverloads constructor(
// draw the buffer and restore canvas settings.
super.draw(canvas)
+ canvas.restoreToCount(save)
+
// draw border
val hasBorder = borderPaint.strokeWidth > 0
if (hasBorder) {
val halfBorder: Float = borderPaint.strokeWidth / 2
+ rectF.set(0f, 0f, width.toFloat(), height.toFloat())
rectF.inset(halfBorder, halfBorder)
- canvas.drawRect(rectF, borderPaint)
+ canvas.drawRoundRect(rectF, radius - halfBorder, radius - halfBorder, borderPaint)
}
- canvas.restoreToCount(save)
}
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
@@ -125,7 +127,7 @@ internal open class MessageTemplateImageView @JvmOverloads constructor(
}
fun load(url: String) {
- var glide = Glide.with(context).load(url)
+ var glide = Glide.with(this).load(url)
if (targetWidth > 0 && targetHeight > 0) {
val deviceWidth = MetricsUtils.getDeviceWidth(context)
if (targetWidth > deviceWidth) {
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/NotificationRecyclerView.kt b/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/NotificationRecyclerView.kt
index 6037ff13..f89accb2 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/NotificationRecyclerView.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/NotificationRecyclerView.kt
@@ -100,7 +100,7 @@ internal class NotificationRecyclerView @JvmOverloads constructor(
setAppearance(context, categoryMenuTextAppearance)
setBackgroundResource(categoryMenuBackground)
buttonDrawable = null
- setPadding(
+ setPaddingRelative(
resources.intToDp(12),
resources.intToDp(7),
resources.intToDp(12),
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/RoundCornerLayout.kt b/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/RoundCornerLayout.kt
index 42f25814..fa333a0f 100755
--- a/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/RoundCornerLayout.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/RoundCornerLayout.kt
@@ -65,21 +65,18 @@ internal open class RoundCornerLayout @JvmOverloads constructor(
canvas.clipPath(path)
}
- val hasBorder = borderPaint.strokeWidth > 0
- val halfBorder: Float = borderPaint.strokeWidth / 2
- if (radius > 0 || hasBorder) {
- rectF.inset(halfBorder, halfBorder)
- }
-
super.draw(canvas)
save?.let { canvas.restoreToCount(it) }
}
override fun dispatchDraw(canvas: Canvas) {
- super.dispatchDraw(canvas)
val hasBorder = borderPaint.strokeWidth > 0
+ val halfBorder: Float = borderPaint.strokeWidth / 2
+ super.dispatchDraw(canvas)
if (hasBorder) {
- canvas.drawRoundRect(rectF, radius, radius, borderPaint)
+ rectF.set(0f, 0f, width.toFloat(), height.toFloat())
+ rectF.inset(halfBorder, halfBorder)
+ canvas.drawRoundRect(rectF, radius - halfBorder, radius - halfBorder, borderPaint)
}
}
}
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/TemplateViews.kt b/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/TemplateViews.kt
index 75b39e13..9e2f4e15 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/TemplateViews.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/TemplateViews.kt
@@ -2,6 +2,7 @@ package com.sendbird.uikit.internal.ui.widgets
import android.annotation.SuppressLint
import android.content.Context
+import android.graphics.Typeface
import android.text.TextUtils
import android.util.AttributeSet
import android.view.Gravity
@@ -9,13 +10,17 @@ import android.view.MotionEvent
import android.widget.LinearLayout
import android.widget.TextView
import androidx.appcompat.widget.AppCompatTextView
+import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.sendbird.uikit.R
+import com.sendbird.uikit.SendbirdUIKit
import com.sendbird.uikit.internal.adapter.CarouselChildViewAdapter
import com.sendbird.uikit.internal.extensions.addRipple
+import com.sendbird.uikit.internal.extensions.applyTextAlignment
import com.sendbird.uikit.internal.extensions.intToDp
import com.sendbird.uikit.internal.extensions.setAppearance
+import com.sendbird.uikit.internal.extensions.setTypeface
import com.sendbird.uikit.internal.model.template_messages.BoxViewParams
import com.sendbird.uikit.internal.model.template_messages.ButtonViewParams
import com.sendbird.uikit.internal.model.template_messages.CarouselViewParams
@@ -55,6 +60,7 @@ internal open class Text @JvmOverloads constructor(
params.textStyle.apply(textView)
textView.gravity = params.align.gravity
+ textView.applyTextAlignment(params.align.gravity)
params.maxTextLines?.let { textView.maxLines = it }
textView.text = params.text
}
@@ -108,7 +114,7 @@ internal open class TextButton @JvmOverloads constructor(
gravity = Gravity.CENTER
// default button padding.
val padding = resources.intToDp(10)
- this.setPadding(padding, padding, padding, padding)
+ this.setPaddingRelative(padding, padding, padding, padding)
this.setBackgroundResource(R.drawable.sb_shape_round_rect_background_200)
setRadiusIntSize(6)
addRipple(background)
@@ -120,13 +126,18 @@ internal open class TextButton @JvmOverloads constructor(
LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT
)
+ setTypeface(Typeface.BOLD)
+ setTextColor(ContextCompat.getColor(context, when (SendbirdUIKit.getDefaultThemeMode()) {
+ SendbirdUIKit.ThemeMode.Light -> R.color.primary_300
+ SendbirdUIKit.ThemeMode.Dark -> R.color.primary_200
+ }))
}
this.addView(textView)
}
fun apply(params: ButtonViewParams, orientation: Orientation) {
params.applyLayoutParams(context, layoutParams, orientation)
- params.textStyle.apply(textView)
+ params.textStyle?.apply(textView)
params.viewStyle.apply(this, true)
textView.maxLines = params.maxTextLines
textView.text = params.text
@@ -150,7 +161,6 @@ internal open class ImageButton @JvmOverloads constructor(
LinearLayout.LayoutParams.WRAP_CONTENT
)
scaleType = ScaleType.FIT_CENTER
- setRadiusIntSize(6)
addRipple(background)
}
@@ -194,8 +204,9 @@ internal class CarouselView @JvmOverloads constructor(
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : RoundCornerLayout(context, attrs, defStyleAttr) {
+ private val maxChildrenCount = 10 // (it's default value, not available to change at this point)
val recyclerView: RecyclerView
- var itemDecoration: CarouselViewItemDecoration? = null
+ private var itemDecoration: CarouselViewItemDecoration? = null
private val startPadding: Int = context.resources.intToDp(12 + 26 + 12) // left padding of profile + profile width + right padding of profile
init {
layoutParams = LayoutParams(
@@ -221,7 +232,7 @@ internal class CarouselView @JvmOverloads constructor(
)
layoutManager = LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false)
- setPadding(startPadding, paddingTop, paddingRight, paddingBottom)
+ setPaddingRelative(startPadding, paddingTop, paddingEnd, paddingBottom)
clipToPadding = false
CarouselLeftSnapHelper().attachToRecyclerView(this)
@@ -240,7 +251,7 @@ internal class CarouselView @JvmOverloads constructor(
val adapter = recyclerView.adapter as? CarouselChildViewAdapter ?: return
adapter.onChildViewCreated = onChildViewCreated
- adapter.setChildTemplateParams(params.items)
+ adapter.setChildTemplateParams(params.items.take(maxChildrenCount)) // platform synced
params.applyLayoutParams(context, layoutParams, orientation)
// Currently, viewStyle is not used in CarouselView.
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/ThemeableRecyclerView.kt b/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/ThemeableRecyclerView.kt
index 76e5fc95..0f9557b7 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/ThemeableRecyclerView.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/ThemeableRecyclerView.kt
@@ -86,8 +86,8 @@ internal open class ThemeableRecyclerView @JvmOverloads constructor(
)
dividerDecoration = object : DividerItemDecoration(context, LinearLayout.VERTICAL) {
override fun onDraw(canvas: Canvas, parent: RecyclerView, state: State) {
- val dividerLeft = parent.paddingLeft
- val dividerRight = parent.width - parent.paddingRight
+ val dividerLeft = parent.paddingStart
+ val dividerRight = parent.width - parent.paddingEnd
val childCount = parent.childCount
for (i in 0..childCount - 2) {
val child = parent.getChildAt(i)
diff --git a/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/ThemeableSnackbar.kt b/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/ThemeableSnackbar.kt
index 4218f341..6cd9de84 100644
--- a/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/ThemeableSnackbar.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/internal/ui/widgets/ThemeableSnackbar.kt
@@ -33,7 +33,7 @@ internal class ThemeableSnackbar @JvmOverloads constructor(
}
val snackbarLayout = snackbar.view as SnackbarLayout
snackbarLayout.removeAllViews()
- snackbarLayout.setPadding(0, 0, 0, 0)
+ snackbarLayout.setPaddingRelative(0, 0, 0, 0)
snackbarLayout.addView(this)
this.snackbar = snackbar
}
diff --git a/uikit/src/main/java/com/sendbird/uikit/model/EmojiManager.kt b/uikit/src/main/java/com/sendbird/uikit/model/EmojiManager.kt
index 4cf903ed..b00235dd 100644
--- a/uikit/src/main/java/com/sendbird/uikit/model/EmojiManager.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/model/EmojiManager.kt
@@ -29,10 +29,9 @@ object EmojiManager {
@JvmStatic
fun init() {
val emojiContainerStr = UIKitPrefs.getString(StringSet.KEY_EMOJI_CONTAINER)
- if (emojiContainerStr.isNotEmpty()) {
- decodeEmojiContainer(emojiContainerStr)?.let {
- upsertEmojiContainer(it, false)
- }
+ if (emojiContainerStr.isNullOrEmpty()) return
+ decodeEmojiContainer(emojiContainerStr)?.let {
+ upsertEmojiContainer(it, false)
}
}
diff --git a/uikit/src/main/java/com/sendbird/uikit/model/configurations/OpenChannelConfig.kt b/uikit/src/main/java/com/sendbird/uikit/model/configurations/OpenChannelConfig.kt
index c4f1397d..e1951fee 100644
--- a/uikit/src/main/java/com/sendbird/uikit/model/configurations/OpenChannelConfig.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/model/configurations/OpenChannelConfig.kt
@@ -87,7 +87,7 @@ data class OpenChannelConfig internal constructor(
val gallery: MediaMenu = MediaMenu(),
@Transient
- var enableDocumentMutable: Boolean? = null
+ private var enableDocumentMutable: Boolean? = null
) : Parcelable {
var enableDocument: Boolean
/**
diff --git a/uikit/src/main/java/com/sendbird/uikit/utils/UIKitPrefs.java b/uikit/src/main/java/com/sendbird/uikit/utils/UIKitPrefs.java
index a571335d..85d59e47 100644
--- a/uikit/src/main/java/com/sendbird/uikit/utils/UIKitPrefs.java
+++ b/uikit/src/main/java/com/sendbird/uikit/utils/UIKitPrefs.java
@@ -52,16 +52,15 @@ public static void putString(@NonNull String key, @Nullable String value) {
editor.putString(key, value).apply();
}
- @NonNull
+ @Nullable
public static String getString(@NonNull String key) {
return getString(key, "");
}
- @NonNull
+ @Nullable
public static String getString(@NonNull String key, @Nullable String defValue) {
if (preferences == null) return defValue == null ? "" : defValue;
- final String value = preferences.getString(key, defValue);
- return value == null ? "" : value;
+ return preferences.getString(key, defValue);
}
public static void putLong(@NonNull String key, long value) {
diff --git a/uikit/src/main/java/com/sendbird/uikit/utils/ViewUtils.java b/uikit/src/main/java/com/sendbird/uikit/utils/ViewUtils.java
index bddfbdab..d6b2d4c4 100644
--- a/uikit/src/main/java/com/sendbird/uikit/utils/ViewUtils.java
+++ b/uikit/src/main/java/com/sendbird/uikit/utils/ViewUtils.java
@@ -45,6 +45,7 @@
import com.sendbird.uikit.consts.StringSet;
import com.sendbird.uikit.interfaces.OnItemClickListener;
import com.sendbird.uikit.internal.extensions.MarkdownExtensionsKt;
+import com.sendbird.uikit.internal.extensions.MarkdownType;
import com.sendbird.uikit.internal.model.GlideCachedUrlLoader;
import com.sendbird.uikit.internal.singleton.MessageDisplayDataManager;
import com.sendbird.uikit.internal.ui.messages.BaseQuotedMessageView;
@@ -66,6 +67,7 @@
import com.sendbird.uikit.vm.PendingMessageRepository;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.TimeUnit;
@@ -145,7 +147,7 @@ public static void drawTextMessage(
);
final SpannableStringBuilder builder;
if (enableMarkdown) {
- builder = new SpannableStringBuilder(MarkdownExtensionsKt.applyMarkdown(text, url -> {
+ builder = new SpannableStringBuilder(MarkdownExtensionsKt.applyMarkdown(text, Arrays.asList(MarkdownType.BOLD, MarkdownType.LINK), url -> {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
context.startActivity(intent);
return Unit.INSTANCE;
diff --git a/uikit/src/main/java/com/sendbird/uikit/vm/BaseMessageListViewModel.java b/uikit/src/main/java/com/sendbird/uikit/vm/BaseMessageListViewModel.java
index b776918f..495b74f7 100644
--- a/uikit/src/main/java/com/sendbird/uikit/vm/BaseMessageListViewModel.java
+++ b/uikit/src/main/java/com/sendbird/uikit/vm/BaseMessageListViewModel.java
@@ -218,9 +218,7 @@ public void resendMessage(@NonNull BaseMessage message, @Nullable OnCompleteHand
Logger.i("__ resent message : %s", userMessage);
});
} else if (message instanceof FileMessage) {
- FileInfo info = PendingMessageRepository.getInstance().getFileInfo(message);
- final File file = info == null ? null : info.getFile();
- channel.resendMessage((FileMessage) message, file, (fileMessage, e) -> {
+ channel.resendMessage((FileMessage) message, (fileMessage, e) -> {
if (handler != null) handler.onComplete(e);
Logger.i("__ resent file message : %s", fileMessage);
});
diff --git a/uikit/src/main/java/com/sendbird/uikit/vm/FeedNotificationChannelViewModel.java b/uikit/src/main/java/com/sendbird/uikit/vm/FeedNotificationChannelViewModel.java
index 2f14b9bd..30577fad 100644
--- a/uikit/src/main/java/com/sendbird/uikit/vm/FeedNotificationChannelViewModel.java
+++ b/uikit/src/main/java/com/sendbird/uikit/vm/FeedNotificationChannelViewModel.java
@@ -81,7 +81,7 @@ public FeedNotificationChannelViewModel(@NonNull String channelUrl, @Nullable Me
*/
@Override
public void authenticate(@NonNull AuthenticateHandler handler) {
- SendbirdUIKit.authenticateFeed((user, e) -> {
+ SendbirdUIKit.authenticate((user, e) -> {
if (user != null) {
FeedChannel.getChannel(channelUrl, (channel, e1) -> {
FeedNotificationChannelViewModel.this.channel = channel;
diff --git a/uikit/src/main/java/com/sendbird/uikit/vm/OpenChannelViewModel.java b/uikit/src/main/java/com/sendbird/uikit/vm/OpenChannelViewModel.java
index 57c31fa6..ec8b33f9 100644
--- a/uikit/src/main/java/com/sendbird/uikit/vm/OpenChannelViewModel.java
+++ b/uikit/src/main/java/com/sendbird/uikit/vm/OpenChannelViewModel.java
@@ -715,10 +715,7 @@ public void resendMessage(@NonNull BaseMessage message, @Nullable OnCompleteHand
PendingMessageRepository.getInstance().updatePendingMessage(channelUrl, pendingMessage);
notifyDataSetChanged();
} else if (message instanceof FileMessage) {
- FileInfo info = PendingMessageRepository.getInstance().getFileInfo(message);
- Logger.d("++ file info=%s", info);
- final File file = info == null ? null : info.getFile();
- FileMessage pendingMessage = channel.resendMessage((FileMessage) message, file, (resentMessage, e) -> {
+ FileMessage pendingMessage = channel.resendMessage((FileMessage) message, (resentMessage, e) -> {
if (e != null) {
Logger.e(e);
if (handler != null) handler.onComplete(e);
diff --git a/uikit/src/main/java/com/sendbird/uikit/widgets/MentionEditText.java b/uikit/src/main/java/com/sendbird/uikit/widgets/MentionEditText.java
index 34d10065..2ee1b47d 100644
--- a/uikit/src/main/java/com/sendbird/uikit/widgets/MentionEditText.java
+++ b/uikit/src/main/java/com/sendbird/uikit/widgets/MentionEditText.java
@@ -5,6 +5,7 @@
import android.graphics.Typeface;
import android.text.Editable;
import android.text.InputType;
+import android.text.Layout;
import android.text.SpannableString;
import android.text.TextUtils;
import android.util.AttributeSet;
@@ -43,6 +44,8 @@
* since 3.0.0
*/
public class MentionEditText extends AppCompatEditText {
+ private final char LRM = '\u200E';
+ private final char RLM = '\u200F';
final private int FLAG_NO_SPELLING_SUGGESTION = InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD;
@NonNull
private final AtomicBoolean isDelKeyEventAlreadyHandled = new AtomicBoolean(false);
@@ -242,19 +245,45 @@ private boolean onBackspacePressed() {
if (cursorStart == cursorEnd) {
final Editable buffer = getText();
if (buffer != null && buffer.length() > 0) {
+ if (cursorStart > 0) {
+ char charBefore = buffer.charAt(cursorStart - 1);
+ if (charBefore == RLM || charBefore == LRM) {
+ int newStartSelection = cursorStart > 1 ? cursorStart - 2 : 0;
+ buffer.delete(newStartSelection, cursorStart);
+ setSelection(newStartSelection);
+ onBackspacePressed();
+ return true;
+ }
+ }
+
MentionSpan[] span = buffer.getSpans(cursorStart, cursorEnd, MentionSpan.class);
if (span.length > 0) {
int start = buffer.getSpanStart(span[0]);
int end = buffer.getSpanEnd(span[0]);
- buffer.replace(start, end, "");
- buffer.removeSpan(span[0]);
- return true;
+ if (end <= cursorStart) {
+ buffer.replace(start, end, "");
+ buffer.removeSpan(span[0]);
+ return true;
+ }
}
}
}
return false;
}
+ private int getCharacterDirectionAtCursor(int cursorPosition) {
+ final Layout layout = getLayout();
+ if (layout == null || getText() == null) {
+ return 0;
+ }
+
+ if (cursorPosition > 0 && cursorPosition <= getText().length()) {
+ int line = layout.getLineForOffset(cursorPosition);
+ return layout.getParagraphDirection(line);
+ }
+ return 0;
+ }
+
/**
* Notifies change of a list of suggested user for mention.
*
@@ -340,8 +369,15 @@ public void bindUserMention(@NonNull UserMentionConfig config, @NonNull TextUICo
MentionSpan mentionSpan = new MentionSpan(getContext(), token, nickname, user, mentionUIConfig);
final SpannableString mentionText = new SpannableString(mentionSpan.getDisplayText());
mentionText.setSpan(mentionSpan, 0, mentionText.length(), SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE);
- text.replace(index, endCursorPosition, TextUtils.concat(mentionText, config.getDelimiter()));
- setSelection(index + mentionSpan.getLength() + 1);
+
+ // for RTL language, the delimiter should be added before the mention text
+ // If "input" text has been written once selecting mention, it should be "input userId@" not "userIdinput@ in RTL language"
+ // wrong result in RTL : "userIdinput@" <-- It's a default behavior in EditText of Android framework
+ // expected result in RTL : "input userId@"
+ // "\u200F" means RIGHT-TO-LEFT MARK (RLM)
+ char direction = getCharacterDirectionAtCursor(startCursorPosition) == Layout.DIR_RIGHT_TO_LEFT ? RLM : LRM;
+ text.replace(index, endCursorPosition, TextUtils.concat(mentionText, direction + config.getDelimiter()));
+ setSelection(index + mentionSpan.getLength() + 1 + config.getDelimiter().length());
}
});
}
diff --git a/uikit/src/main/java/com/sendbird/uikit/widgets/StatusFrameView.kt b/uikit/src/main/java/com/sendbird/uikit/widgets/StatusFrameView.kt
index c1adb60f..775e6f21 100644
--- a/uikit/src/main/java/com/sendbird/uikit/widgets/StatusFrameView.kt
+++ b/uikit/src/main/java/com/sendbird/uikit/widgets/StatusFrameView.kt
@@ -130,6 +130,7 @@ class StatusFrameView @JvmOverloads constructor(
binding.frameParentPanel.setBackgroundResource(background)
binding.progressPanel.setBackgroundResource(background)
setStatus(Status.NONE)
+ binding.frameParentPanel.isClickable = true
} finally {
a.recycle()
}
diff --git a/uikit/src/main/res/drawable-ldrtl-hdpi/icon_arrow_left.png b/uikit/src/main/res/drawable-ldrtl-hdpi/icon_arrow_left.png
new file mode 100644
index 00000000..02b0f4e5
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-hdpi/icon_arrow_left.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-hdpi/icon_broadcast.png b/uikit/src/main/res/drawable-ldrtl-hdpi/icon_broadcast.png
new file mode 100644
index 00000000..d6fd89e4
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-hdpi/icon_broadcast.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-hdpi/icon_chat.png b/uikit/src/main/res/drawable-ldrtl-hdpi/icon_chat.png
new file mode 100644
index 00000000..1500c8f7
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-hdpi/icon_chat.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-hdpi/icon_chevron_right.png b/uikit/src/main/res/drawable-ldrtl-hdpi/icon_chevron_right.png
new file mode 100644
index 00000000..c848c62b
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-hdpi/icon_chevron_right.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-hdpi/icon_container.png b/uikit/src/main/res/drawable-ldrtl-hdpi/icon_container.png
new file mode 100644
index 00000000..e6c77e29
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-hdpi/icon_container.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-hdpi/icon_create.png b/uikit/src/main/res/drawable-ldrtl-hdpi/icon_create.png
new file mode 100644
index 00000000..438485cd
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-hdpi/icon_create.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-hdpi/icon_file_audio.png b/uikit/src/main/res/drawable-ldrtl-hdpi/icon_file_audio.png
new file mode 100644
index 00000000..65bee7bd
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-hdpi/icon_file_audio.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-hdpi/icon_leave.png b/uikit/src/main/res/drawable-ldrtl-hdpi/icon_leave.png
new file mode 100644
index 00000000..0fec3aef
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-hdpi/icon_leave.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-hdpi/icon_message.png b/uikit/src/main/res/drawable-ldrtl-hdpi/icon_message.png
new file mode 100644
index 00000000..d504e65c
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-hdpi/icon_message.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-hdpi/icon_reply.png b/uikit/src/main/res/drawable-ldrtl-hdpi/icon_reply.png
new file mode 100644
index 00000000..b670f681
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-hdpi/icon_reply.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-hdpi/icon_send.png b/uikit/src/main/res/drawable-ldrtl-hdpi/icon_send.png
new file mode 100644
index 00000000..020c9f9f
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-hdpi/icon_send.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-hdpi/icon_thread.png b/uikit/src/main/res/drawable-ldrtl-hdpi/icon_thread.png
new file mode 100644
index 00000000..1b82c095
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-hdpi/icon_thread.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-mdpi/icon_arrow_left.png b/uikit/src/main/res/drawable-ldrtl-mdpi/icon_arrow_left.png
new file mode 100644
index 00000000..ab358594
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-mdpi/icon_arrow_left.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-mdpi/icon_broadcast.png b/uikit/src/main/res/drawable-ldrtl-mdpi/icon_broadcast.png
new file mode 100644
index 00000000..894d2ee6
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-mdpi/icon_broadcast.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-mdpi/icon_chat.png b/uikit/src/main/res/drawable-ldrtl-mdpi/icon_chat.png
new file mode 100644
index 00000000..44a74066
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-mdpi/icon_chat.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-mdpi/icon_chevron_right.png b/uikit/src/main/res/drawable-ldrtl-mdpi/icon_chevron_right.png
new file mode 100644
index 00000000..187368ac
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-mdpi/icon_chevron_right.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-mdpi/icon_container.png b/uikit/src/main/res/drawable-ldrtl-mdpi/icon_container.png
new file mode 100644
index 00000000..ba087553
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-mdpi/icon_container.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-mdpi/icon_create.png b/uikit/src/main/res/drawable-ldrtl-mdpi/icon_create.png
new file mode 100644
index 00000000..cc0248c5
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-mdpi/icon_create.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-mdpi/icon_file_audio.png b/uikit/src/main/res/drawable-ldrtl-mdpi/icon_file_audio.png
new file mode 100644
index 00000000..4fd08fcd
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-mdpi/icon_file_audio.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-mdpi/icon_leave.png b/uikit/src/main/res/drawable-ldrtl-mdpi/icon_leave.png
new file mode 100644
index 00000000..f3583779
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-mdpi/icon_leave.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-mdpi/icon_message.png b/uikit/src/main/res/drawable-ldrtl-mdpi/icon_message.png
new file mode 100644
index 00000000..46d0ab9e
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-mdpi/icon_message.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-mdpi/icon_reply.png b/uikit/src/main/res/drawable-ldrtl-mdpi/icon_reply.png
new file mode 100644
index 00000000..07893d01
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-mdpi/icon_reply.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-mdpi/icon_send.png b/uikit/src/main/res/drawable-ldrtl-mdpi/icon_send.png
new file mode 100644
index 00000000..8948b2c7
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-mdpi/icon_send.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-mdpi/icon_thread.png b/uikit/src/main/res/drawable-ldrtl-mdpi/icon_thread.png
new file mode 100644
index 00000000..8ea2ca25
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-mdpi/icon_thread.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_arrow_left.png b/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_arrow_left.png
new file mode 100644
index 00000000..49d2b96f
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_arrow_left.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_broadcast.png b/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_broadcast.png
new file mode 100644
index 00000000..cb427dfa
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_broadcast.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_chat.png b/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_chat.png
new file mode 100644
index 00000000..807e77f4
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_chat.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_chevron_right.png b/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_chevron_right.png
new file mode 100644
index 00000000..a3465590
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_chevron_right.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_container.png b/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_container.png
new file mode 100644
index 00000000..c690fa37
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_container.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_create.png b/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_create.png
new file mode 100644
index 00000000..6ec9fffa
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_create.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_file_audio.png b/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_file_audio.png
new file mode 100644
index 00000000..825b7c85
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_file_audio.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_leave.png b/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_leave.png
new file mode 100644
index 00000000..23209621
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_leave.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_message.png b/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_message.png
new file mode 100644
index 00000000..7572bc14
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_message.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_reply.png b/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_reply.png
new file mode 100644
index 00000000..18202044
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_reply.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_send.png b/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_send.png
new file mode 100644
index 00000000..bb783a5b
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_send.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_thread.png b/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_thread.png
new file mode 100644
index 00000000..c83d8f8c
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xhdpi/icon_thread.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_arrow_left.png b/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_arrow_left.png
new file mode 100644
index 00000000..cdf86ef9
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_arrow_left.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_broadcast.png b/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_broadcast.png
new file mode 100644
index 00000000..72665036
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_broadcast.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_chat.png b/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_chat.png
new file mode 100644
index 00000000..504371aa
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_chat.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_chevron_right.png b/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_chevron_right.png
new file mode 100644
index 00000000..76c9ff8f
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_chevron_right.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_container.png b/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_container.png
new file mode 100644
index 00000000..82e15ea7
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_container.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_create.png b/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_create.png
new file mode 100644
index 00000000..36ee0956
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_create.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_file_audio.png b/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_file_audio.png
new file mode 100644
index 00000000..c11b14b6
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_file_audio.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_leave.png b/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_leave.png
new file mode 100644
index 00000000..ade75fae
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_leave.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_message.png b/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_message.png
new file mode 100644
index 00000000..1757a240
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_message.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_reply.png b/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_reply.png
new file mode 100644
index 00000000..abc19e6c
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_reply.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_send.png b/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_send.png
new file mode 100644
index 00000000..2887d73e
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_send.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_thread.png b/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_thread.png
new file mode 100644
index 00000000..bae088e0
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xxhdpi/icon_thread.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_arrow_left.png b/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_arrow_left.png
new file mode 100644
index 00000000..a79760bc
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_arrow_left.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_broadcast.png b/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_broadcast.png
new file mode 100644
index 00000000..cad409ef
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_broadcast.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_chat.png b/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_chat.png
new file mode 100644
index 00000000..03508576
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_chat.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_chevron_right.png b/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_chevron_right.png
new file mode 100644
index 00000000..c4e83b27
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_chevron_right.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_container.png b/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_container.png
new file mode 100644
index 00000000..0f9952fe
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_container.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_create.png b/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_create.png
new file mode 100644
index 00000000..8aeb9a3d
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_create.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_file_audio.png b/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_file_audio.png
new file mode 100644
index 00000000..2f25db20
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_file_audio.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_leave.png b/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_leave.png
new file mode 100644
index 00000000..a5be500f
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_leave.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_message.png b/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_message.png
new file mode 100644
index 00000000..e3ac1338
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_message.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_reply.png b/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_reply.png
new file mode 100644
index 00000000..be476e9f
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_reply.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_send.png b/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_send.png
new file mode 100644
index 00000000..900e1872
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_send.png differ
diff --git a/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_thread.png b/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_thread.png
new file mode 100644
index 00000000..10e8371c
Binary files /dev/null and b/uikit/src/main/res/drawable-ldrtl-xxxhdpi/icon_thread.png differ
diff --git a/uikit/src/main/res/layout/sb_fragment_photo_view.xml b/uikit/src/main/res/layout/sb_fragment_photo_view.xml
index 8ba7b4c2..6d59cc96 100644
--- a/uikit/src/main/res/layout/sb_fragment_photo_view.xml
+++ b/uikit/src/main/res/layout/sb_fragment_photo_view.xml
@@ -25,8 +25,8 @@
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical"
- android:paddingRight="@dimen/sb_size_64"
- android:paddingLeft="@dimen/sb_size_64">
+ android:paddingEnd="@dimen/sb_size_64"
+ android:paddingStart="@dimen/sb_size_64">
+ android:paddingStart="@dimen/sb_size_16"
+ android:paddingEnd="@dimen/sb_size_16">
@@ -39,8 +39,8 @@
android:singleLine="true"
android:ellipsize="end"
app:layout_constraintBottom_toTopOf="@id/brBottom"
- app:layout_constraintLeft_toRightOf="@+id/ivBroadcastIcon"
- app:layout_constraintRight_toLeftOf="@+id/tvMemberCount"
+ app:layout_constraintStart_toEndOf="@+id/ivBroadcastIcon"
+ app:layout_constraintEnd_toStartOf="@+id/tvMemberCount"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginStart="@dimen/sb_size_4"
android:layout_marginEnd="@dimen/sb_size_4" />
@@ -114,8 +114,9 @@
android:layout_marginStart="@dimen/sb_size_4"
android:layout_marginEnd="@dimen/sb_size_10"
android:layout_marginTop="@dimen/sb_size_2"
- app:layout_constraintLeft_toRightOf="@id/vgCoverView"
- app:layout_constraintRight_toLeftOf="@+id/tvUnreadMentionCount"
+ android:textAlignment="viewStart"
+ app:layout_constraintStart_toEndOf="@id/vgCoverView"
+ app:layout_constraintEnd_toStartOf="@+id/tvUnreadMentionCount"
app:layout_constraintTop_toBottomOf="@id/tvTitle" />
+ android:layout_height="wrap_content"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent">
+ android:scaleType="centerCrop" />
diff --git a/uikit/src/main/res/layout/sb_view_channel_push_setting.xml b/uikit/src/main/res/layout/sb_view_channel_push_setting.xml
index 0abf49b8..9f59ad9d 100644
--- a/uikit/src/main/res/layout/sb_view_channel_push_setting.xml
+++ b/uikit/src/main/res/layout/sb_view_channel_push_setting.xml
@@ -1,9 +1,9 @@
+ android:layout_height="match_parent">
@@ -36,6 +37,7 @@
android:layout_marginTop="@dimen/sb_size_8"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:textAlignment="viewStart"
android:text="@string/sb_text_push_setting_description"
/>
@@ -61,6 +63,7 @@
@@ -88,6 +91,7 @@
diff --git a/uikit/src/main/res/layout/sb_view_channel_settings_info.xml b/uikit/src/main/res/layout/sb_view_channel_settings_info.xml
index 84fb86ea..2a22f4f0 100644
--- a/uikit/src/main/res/layout/sb_view_channel_settings_info.xml
+++ b/uikit/src/main/res/layout/sb_view_channel_settings_info.xml
@@ -10,8 +10,8 @@
android:layout_height="@dimen/sb_channel_setting_height_132"
android:orientation="vertical"
android:gravity="center"
- android:paddingLeft="@dimen/sb_size_16"
- android:paddingRight="@dimen/sb_size_16">
+ android:paddingStart="@dimen/sb_size_16"
+ android:paddingEnd="@dimen/sb_size_16">
+ android:layout_marginStart="@dimen/sb_size_16"
+ android:layout_marginEnd="@dimen/sb_size_16"/>
diff --git a/uikit/src/main/res/layout/sb_view_chat_notification_component.xml b/uikit/src/main/res/layout/sb_view_chat_notification_component.xml
index 9d6ef97e..7492543e 100644
--- a/uikit/src/main/res/layout/sb_view_chat_notification_component.xml
+++ b/uikit/src/main/res/layout/sb_view_chat_notification_component.xml
@@ -2,8 +2,8 @@
@@ -25,6 +25,7 @@
android:layout_height="wrap_content"
android:ellipsize="end"
android:singleLine="true"
+ android:textAlignment="viewStart"
app:layout_constrainedWidth="true"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintStart_toStartOf="@+id/contentPanel"
diff --git a/uikit/src/main/res/layout/sb_view_chat_notification_recycler_view.xml b/uikit/src/main/res/layout/sb_view_chat_notification_recycler_view.xml
index a000e868..db1c74da 100644
--- a/uikit/src/main/res/layout/sb_view_chat_notification_recycler_view.xml
+++ b/uikit/src/main/res/layout/sb_view_chat_notification_recycler_view.xml
@@ -7,9 +7,9 @@
+ android:paddingStart="@dimen/sb_size_24"
+ android:paddingEnd="@dimen/sb_size_24">
@@ -109,8 +109,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/sb_size_8"
- android:layout_marginLeft="@dimen/sb_size_4"
- android:layout_marginRight="@dimen/sb_size_4"
+ android:layout_marginStart="@dimen/sb_size_4"
+ android:layout_marginEnd="@dimen/sb_size_4"
android:visibility="gone"
/>
@@ -122,8 +122,8 @@
android:padding="@dimen/sb_size_8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginLeft="@dimen/sb_size_4"
- android:layout_marginRight="@dimen/sb_size_4"
+ android:layout_marginStart="@dimen/sb_size_4"
+ android:layout_marginEnd="@dimen/sb_size_4"
android:visibility="gone"
/>
diff --git a/uikit/src/main/res/layout/sb_view_dialog_list_item.xml b/uikit/src/main/res/layout/sb_view_dialog_list_item.xml
index 42698fe5..82b2583d 100644
--- a/uikit/src/main/res/layout/sb_view_dialog_list_item.xml
+++ b/uikit/src/main/res/layout/sb_view_dialog_list_item.xml
@@ -4,32 +4,37 @@
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="@dimen/sb_size_48"
- android:gravity="center_vertical"
android:paddingStart="@dimen/sb_size_0"
android:paddingEnd="@dimen/sb_size_16"
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto">
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ >
+ android:visibility="gone"
+ />
+ android:visibility="gone"
+ />
diff --git a/uikit/src/main/res/layout/sb_view_emoji_component.xml b/uikit/src/main/res/layout/sb_view_emoji_component.xml
index 4de9bc66..fb56f115 100644
--- a/uikit/src/main/res/layout/sb_view_emoji_component.xml
+++ b/uikit/src/main/res/layout/sb_view_emoji_component.xml
@@ -17,9 +17,9 @@
android:scaleType="centerCrop"
android:contentDescription="@string/sb_emoji_default_description"
app:layout_constraintTop_toTopOf="parent"
- app:layout_constraintLeft_toLeftOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintRight_toRightOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintDimensionRatio="1:1"/>
diff --git a/uikit/src/main/res/layout/sb_view_emoji_reaction_component.xml b/uikit/src/main/res/layout/sb_view_emoji_reaction_component.xml
index 5bb9f336..4b858f5d 100644
--- a/uikit/src/main/res/layout/sb_view_emoji_reaction_component.xml
+++ b/uikit/src/main/res/layout/sb_view_emoji_reaction_component.xml
@@ -6,8 +6,8 @@
android:layout_margin="@dimen/sb_size_2"
android:paddingTop="@dimen/sb_size_5"
android:paddingBottom="@dimen/sb_size_5"
- android:paddingLeft="@dimen/sb_size_8"
- android:paddingRight="@dimen/sb_size_8"
+ android:paddingStart="@dimen/sb_size_8"
+ android:paddingEnd="@dimen/sb_size_8"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
diff --git a/uikit/src/main/res/layout/sb_view_emoji_reaction_user_component.xml b/uikit/src/main/res/layout/sb_view_emoji_reaction_user_component.xml
index ab4afa11..68147c9a 100644
--- a/uikit/src/main/res/layout/sb_view_emoji_reaction_user_component.xml
+++ b/uikit/src/main/res/layout/sb_view_emoji_reaction_user_component.xml
@@ -2,9 +2,9 @@
@@ -14,20 +14,20 @@
android:layout_width="@dimen/sb_size_36"
android:layout_height="@dimen/sb_size_36"
android:scaleType="centerCrop"
- app:layout_constraintLeft_toLeftOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
diff --git a/uikit/src/main/res/layout/sb_view_feed_notification_component.xml b/uikit/src/main/res/layout/sb_view_feed_notification_component.xml
index 88de482f..661f79c8 100644
--- a/uikit/src/main/res/layout/sb_view_feed_notification_component.xml
+++ b/uikit/src/main/res/layout/sb_view_feed_notification_component.xml
@@ -2,8 +2,8 @@
@@ -14,9 +14,10 @@
android:layout_height="wrap_content"
android:paddingBottom="@dimen/sb_size_4"
android:ellipsize="end"
- android:gravity="bottom"
+ android:gravity="start|bottom"
android:singleLine="true"
android:layout_marginBottom="@dimen/sb_size_4"
+ android:textAlignment="viewStart"
app:layout_constrainedWidth="true"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintTop_toTopOf="parent"
diff --git a/uikit/src/main/res/layout/sb_view_form_message_component.xml b/uikit/src/main/res/layout/sb_view_form_message_component.xml
index fb49e0d4..02ab79b4 100644
--- a/uikit/src/main/res/layout/sb_view_form_message_component.xml
+++ b/uikit/src/main/res/layout/sb_view_form_message_component.xml
@@ -87,8 +87,6 @@
android:maxWidth="@dimen/sb_message_max_width"
android:paddingTop="@dimen/sb_size_7"
android:paddingBottom="@dimen/sb_size_7"
- android:paddingRight="@dimen/sb_size_12"
- android:paddingLeft="@dimen/sb_size_12"
android:paddingStart="@dimen/sb_size_12"
android:paddingEnd="@dimen/sb_size_12"
app:sb_auto_link_text_view_linkify_mask="all"
diff --git a/uikit/src/main/res/layout/sb_view_header.xml b/uikit/src/main/res/layout/sb_view_header.xml
index a86ff294..60f6fcdf 100644
--- a/uikit/src/main/res/layout/sb_view_header.xml
+++ b/uikit/src/main/res/layout/sb_view_header.xml
@@ -11,8 +11,8 @@
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="@dimen/sb_size_56"
- android:paddingLeft="@dimen/sb_size_8"
- android:paddingRight="@dimen/sb_size_8">
+ android:paddingStart="@dimen/sb_size_8"
+ android:paddingEnd="@dimen/sb_size_8">
@@ -15,8 +15,11 @@
android:layout_width="@dimen/sb_size_36"
android:layout_height="@dimen/sb_size_36"
android:scaleType="centerCrop"
+ app:layout_constraintHorizontal_chainStyle="packed"
+ app:layout_constraintHorizontal_bias="0"
android:contentDescription="@string/sb_view_member_item_profile_description"
- app:layout_constraintLeft_toLeftOf="parent"
+ app:layout_constraintEnd_toStartOf="@id/tvNickname"
+ app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@@ -47,7 +53,6 @@
android:id="@+id/tvDescription"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- app:layout_constraintStart_toEndOf="@id/tvNickname"
app:layout_constraintEnd_toStartOf="@+id/ivAction"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
@@ -58,15 +63,13 @@
android:layout_height="@dimen/sb_size_24"
android:layout_gravity="center"
android:src="@drawable/icon_more"
- android:visibility="gone"
android:layout_marginStart="@dimen/sb_size_8"
android:padding="@dimen/sb_size_0"
+ android:visibility="gone"
android:scaleType="centerCrop"
android:contentDescription="@string/sb_view_member_item_action_button_description"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toEndOf="@id/tvDescription"/>
-
+ app:layout_constraintEnd_toEndOf="parent"/>
diff --git a/uikit/src/main/res/layout/sb_view_mention_limit_alert.xml b/uikit/src/main/res/layout/sb_view_mention_limit_alert.xml
index bd064a60..91372f63 100644
--- a/uikit/src/main/res/layout/sb_view_mention_limit_alert.xml
+++ b/uikit/src/main/res/layout/sb_view_mention_limit_alert.xml
@@ -35,7 +35,8 @@
android:layout_marginEnd="@dimen/sb_size_16"
android:layout_width="0dp"
android:layout_height="wrap_content"
- android:gravity="center_vertical"
+ android:gravity="start|center_vertical"
+ android:textAlignment="viewStart"
app:layout_constraintTop_toTopOf="@id/ivRoofLine"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/ivIcon"
diff --git a/uikit/src/main/res/layout/sb_view_message_input.xml b/uikit/src/main/res/layout/sb_view_message_input.xml
index f46f3f91..6d4b21e6 100644
--- a/uikit/src/main/res/layout/sb_view_message_input.xml
+++ b/uikit/src/main/res/layout/sb_view_message_input.xml
@@ -22,8 +22,8 @@
android:layout_height="wrap_content"
android:paddingTop="@dimen/sb_size_12"
android:paddingBottom="@dimen/sb_size_12"
- android:paddingLeft="@dimen/sb_size_16"
- android:paddingRight="@dimen/sb_size_16"
+ android:paddingStart="@dimen/sb_size_16"
+ android:paddingEnd="@dimen/sb_size_16"
android:visibility="gone"
>
@@ -31,11 +31,11 @@
android:id="@+id/ivQuoteReplyMessageImage"
android:layout_width="@dimen/sb_size_32"
android:layout_height="@dimen/sb_size_32"
- android:layout_marginEnd="@dimen/sb_size_8"
android:background="@drawable/sb_shape_image_message_background"
android:scaleType="centerInside"
- app:layout_constraintEnd_toStartOf="@id/tvQuoteReplyTitle"
+ app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintHorizontal_bias="0"
+ app:layout_constraintEnd_toStartOf="@id/quoteReplyPanelContent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
@@ -51,35 +51,38 @@
app:layout_constraintTop_toTopOf="@id/ivQuoteReplyMessageImage"
app:layout_constraintBottom_toBottomOf="@id/ivQuoteReplyMessageImage" />
-
+ >
-
+
+
+
+
+ />
@@ -132,8 +134,8 @@
android:maxLines="3"
android:layout_marginTop="@dimen/sb_size_10"
android:layout_marginBottom="@dimen/sb_size_10"
- android:paddingLeft="@dimen/sb_size_20"
- android:paddingRight="@dimen/sb_size_20"
+ android:paddingStart="@dimen/sb_size_20"
+ android:paddingEnd="@dimen/sb_size_20"
android:imeOptions="flagNoExtractUi"
android:inputType="textCapSentences|textMultiLine"
app:layout_constraintBottom_toBottomOf="parent"
@@ -181,8 +183,8 @@
android:id="@+id/editPanel"
android:layout_width="match_parent"
android:layout_height="@dimen/sb_size_56"
- android:paddingLeft="@dimen/sb_size_16"
- android:paddingRight="@dimen/sb_size_16"
+ android:paddingStart="@dimen/sb_size_16"
+ android:paddingEnd="@dimen/sb_size_16"
android:visibility="gone">
diff --git a/uikit/src/main/res/layout/sb_view_message_preview.xml b/uikit/src/main/res/layout/sb_view_message_preview.xml
index 5345e7ce..787796c9 100644
--- a/uikit/src/main/res/layout/sb_view_message_preview.xml
+++ b/uikit/src/main/res/layout/sb_view_message_preview.xml
@@ -16,7 +16,7 @@
android:scaleType="centerCrop"
android:layout_marginStart="@dimen/sb_size_16"
android:contentDescription="@string/sb_sender_profile_description"
- app:layout_constraintLeft_toLeftOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@@ -55,7 +57,7 @@
android:layout_height="wrap_content"
android:gravity="end"
app:layout_constraintBottom_toTopOf="@id/brMiddle"
- app:layout_constraintRight_toLeftOf="@id/rightGL"
+ app:layout_constraintEnd_toStartOf="@id/rightGL"
app:layout_constraintTop_toTopOf="parent"
android:paddingStart="@dimen/sb_size_10"
android:paddingEnd="@dimen/sb_size_0" />
@@ -88,6 +90,7 @@
android:layout_height="wrap_content"
android:ellipsize="end"
android:singleLine="true"
+ android:textAlignment="viewStart"
android:layout_marginTop="@dimen/sb_size_4"
app:layout_constrainedWidth="true"
app:layout_constraintStart_toEndOf="@id/ivIcon"
diff --git a/uikit/src/main/res/layout/sb_view_message_recycler_view.xml b/uikit/src/main/res/layout/sb_view_message_recycler_view.xml
index 92769ed4..9eb5ef82 100644
--- a/uikit/src/main/res/layout/sb_view_message_recycler_view.xml
+++ b/uikit/src/main/res/layout/sb_view_message_recycler_view.xml
@@ -39,8 +39,8 @@
android:layout_gravity="center"
android:ellipsize="end"
android:singleLine="true"
- android:paddingLeft="@dimen/sb_size_20"
- android:paddingRight="@dimen/sb_size_20"
+ android:paddingStart="@dimen/sb_size_20"
+ android:paddingEnd="@dimen/sb_size_20"
/>
@@ -60,8 +60,8 @@
android:id="@+id/tvTypingIndicator"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_12"
- android:paddingRight="@dimen/sb_size_12"
+ android:paddingStart="@dimen/sb_size_12"
+ android:paddingEnd="@dimen/sb_size_12"
android:paddingBottom="@dimen/sb_size_5"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
diff --git a/uikit/src/main/res/layout/sb_view_my_file_image_message_component.xml b/uikit/src/main/res/layout/sb_view_my_file_image_message_component.xml
index 2a16e2c0..b8db26d4 100644
--- a/uikit/src/main/res/layout/sb_view_my_file_image_message_component.xml
+++ b/uikit/src/main/res/layout/sb_view_my_file_image_message_component.xml
@@ -3,8 +3,8 @@
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_12"
- android:paddingRight="@dimen/sb_size_12"
+ android:paddingStart="@dimen/sb_size_12"
+ android:paddingEnd="@dimen/sb_size_12"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
@@ -122,9 +122,7 @@
android:id="@+id/rvEmojiReactionList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_7"
android:paddingStart="@dimen/sb_size_7"
- android:paddingRight="@dimen/sb_size_7"
android:paddingEnd="@dimen/sb_size_7"
android:paddingBottom="@dimen/sb_size_7"
android:paddingTop="@dimen/sb_size_7"
@@ -148,7 +146,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
- app:layout_constraintRight_toRightOf="@id/contentPanel"
+ app:layout_constraintEnd_toEndOf="@id/contentPanel"
app:layout_constraintTop_toBottomOf="@id/contentPanel"
/>
diff --git a/uikit/src/main/res/layout/sb_view_my_file_message_component.xml b/uikit/src/main/res/layout/sb_view_my_file_message_component.xml
index 72091068..1d87ee4c 100644
--- a/uikit/src/main/res/layout/sb_view_my_file_message_component.xml
+++ b/uikit/src/main/res/layout/sb_view_my_file_message_component.xml
@@ -3,8 +3,8 @@
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_12"
- android:paddingRight="@dimen/sb_size_12"
+ android:paddingStart="@dimen/sb_size_12"
+ android:paddingEnd="@dimen/sb_size_12"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
>
@@ -81,8 +81,6 @@
android:gravity="center"
android:paddingTop="@dimen/sb_size_7"
android:paddingBottom="@dimen/sb_size_7"
- android:paddingRight="@dimen/sb_size_12"
- android:paddingLeft="@dimen/sb_size_12"
android:paddingStart="@dimen/sb_size_12"
android:paddingEnd="@dimen/sb_size_12"
app:layout_constraintHorizontal_bias="0"
@@ -116,9 +114,7 @@
android:id="@+id/rvEmojiReactionList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_7"
android:paddingStart="@dimen/sb_size_7"
- android:paddingRight="@dimen/sb_size_7"
android:paddingEnd="@dimen/sb_size_7"
android:paddingBottom="@dimen/sb_size_7"
android:paddingTop="@dimen/sb_size_7"
@@ -149,7 +145,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
- app:layout_constraintRight_toRightOf="@id/contentPanelWithReactions"
+ app:layout_constraintEnd_toEndOf="@id/contentPanelWithReactions"
app:layout_constraintTop_toBottomOf="@id/contentPanelWithReactions"
/>
diff --git a/uikit/src/main/res/layout/sb_view_my_file_video_message_component.xml b/uikit/src/main/res/layout/sb_view_my_file_video_message_component.xml
index 950bd5f0..157d15f5 100644
--- a/uikit/src/main/res/layout/sb_view_my_file_video_message_component.xml
+++ b/uikit/src/main/res/layout/sb_view_my_file_video_message_component.xml
@@ -3,8 +3,8 @@
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_12"
- android:paddingRight="@dimen/sb_size_12"
+ android:paddingStart="@dimen/sb_size_12"
+ android:paddingEnd="@dimen/sb_size_12"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
@@ -122,9 +122,7 @@
android:id="@+id/rvEmojiReactionList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_7"
android:paddingStart="@dimen/sb_size_7"
- android:paddingRight="@dimen/sb_size_7"
android:paddingEnd="@dimen/sb_size_7"
android:paddingBottom="@dimen/sb_size_7"
android:paddingTop="@dimen/sb_size_7"
@@ -148,7 +146,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
- app:layout_constraintRight_toRightOf="@id/contentPanel"
+ app:layout_constraintEnd_toEndOf="@id/contentPanel"
app:layout_constraintTop_toBottomOf="@id/contentPanel"
/>
diff --git a/uikit/src/main/res/layout/sb_view_my_message_component.xml b/uikit/src/main/res/layout/sb_view_my_message_component.xml
index f4e64801..c7e1d9fb 100644
--- a/uikit/src/main/res/layout/sb_view_my_message_component.xml
+++ b/uikit/src/main/res/layout/sb_view_my_message_component.xml
@@ -3,8 +3,8 @@
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_12"
- android:paddingRight="@dimen/sb_size_12"
+ android:paddingStart="@dimen/sb_size_12"
+ android:paddingEnd="@dimen/sb_size_12"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
@@ -94,9 +94,7 @@
android:id="@+id/rvEmojiReactionList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_7"
android:paddingStart="@dimen/sb_size_7"
- android:paddingRight="@dimen/sb_size_7"
android:paddingEnd="@dimen/sb_size_7"
android:paddingBottom="@dimen/sb_size_7"
android:paddingTop="@dimen/sb_size_7"
@@ -120,7 +118,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
- app:layout_constraintRight_toRightOf="@id/contentPanel"
+ app:layout_constraintEnd_toEndOf="@id/contentPanel"
app:layout_constraintTop_toBottomOf="@id/contentPanel"
/>
diff --git a/uikit/src/main/res/layout/sb_view_my_multiple_files_message_component.xml b/uikit/src/main/res/layout/sb_view_my_multiple_files_message_component.xml
index 8ddf99aa..41cf2816 100644
--- a/uikit/src/main/res/layout/sb_view_my_multiple_files_message_component.xml
+++ b/uikit/src/main/res/layout/sb_view_my_multiple_files_message_component.xml
@@ -3,8 +3,8 @@
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_12"
- android:paddingRight="@dimen/sb_size_12"
+ android:paddingStart="@dimen/sb_size_12"
+ android:paddingEnd="@dimen/sb_size_12"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
@@ -95,9 +95,7 @@
android:id="@+id/rvEmojiReactionList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_7"
android:paddingStart="@dimen/sb_size_7"
- android:paddingRight="@dimen/sb_size_7"
android:paddingEnd="@dimen/sb_size_7"
android:paddingBottom="@dimen/sb_size_7"
android:paddingTop="@dimen/sb_size_7"
@@ -121,7 +119,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
- app:layout_constraintRight_toRightOf="@id/contentPanel"
+ app:layout_constraintEnd_toEndOf="@id/contentPanel"
app:layout_constraintTop_toBottomOf="@id/contentPanel"
/>
diff --git a/uikit/src/main/res/layout/sb_view_my_quoted_message.xml b/uikit/src/main/res/layout/sb_view_my_quoted_message.xml
index 8774df0a..bb60d6b8 100644
--- a/uikit/src/main/res/layout/sb_view_my_quoted_message.xml
+++ b/uikit/src/main/res/layout/sb_view_my_quoted_message.xml
@@ -14,7 +14,7 @@
android:layout_height="@dimen/sb_size_12"
android:layout_marginStart="@dimen/sb_size_12"
android:importantForAccessibility="no"
- app:layout_constraintRight_toLeftOf="@+id/tvQuoteReplyTitle"
+ app:layout_constraintEnd_toStartOf="@+id/tvQuoteReplyTitle"
app:layout_constraintTop_toTopOf="@id/tvQuoteReplyTitle"
app:layout_constraintBottom_toBottomOf="@id/tvQuoteReplyTitle"
android:layout_marginEnd="@dimen/sb_size_4" />
@@ -46,8 +46,8 @@
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_12"
- android:paddingRight="@dimen/sb_size_12"
+ android:paddingStart="@dimen/sb_size_12"
+ android:paddingEnd="@dimen/sb_size_12"
android:paddingTop="@dimen/sb_size_6"
android:paddingBottom="@dimen/sb_size_12"
android:gravity="center_vertical"
diff --git a/uikit/src/main/res/layout/sb_view_my_user_message_component.xml b/uikit/src/main/res/layout/sb_view_my_user_message_component.xml
index 2eb67e9e..afbd5366 100644
--- a/uikit/src/main/res/layout/sb_view_my_user_message_component.xml
+++ b/uikit/src/main/res/layout/sb_view_my_user_message_component.xml
@@ -3,8 +3,8 @@
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_12"
- android:paddingRight="@dimen/sb_size_12"
+ android:paddingStart="@dimen/sb_size_12"
+ android:paddingEnd="@dimen/sb_size_12"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
@@ -99,8 +99,6 @@
android:maxWidth="@dimen/sb_message_max_width"
android:paddingTop="@dimen/sb_size_7"
android:paddingBottom="@dimen/sb_size_7"
- android:paddingRight="@dimen/sb_size_12"
- android:paddingLeft="@dimen/sb_size_12"
android:paddingStart="@dimen/sb_size_12"
android:paddingEnd="@dimen/sb_size_12"
app:sb_auto_link_text_view_linkify_mask="all"
@@ -126,9 +124,7 @@
android:id="@+id/rvEmojiReactionList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_7"
android:paddingStart="@dimen/sb_size_7"
- android:paddingRight="@dimen/sb_size_7"
android:paddingEnd="@dimen/sb_size_7"
android:paddingBottom="@dimen/sb_size_7"
android:paddingTop="@dimen/sb_size_7"
@@ -146,7 +142,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
- app:layout_constraintRight_toRightOf="@id/contentPanel"
+ app:layout_constraintEnd_toEndOf="@id/contentPanel"
app:layout_constraintTop_toBottomOf="@id/contentPanel"
/>
diff --git a/uikit/src/main/res/layout/sb_view_my_voice_message_component.xml b/uikit/src/main/res/layout/sb_view_my_voice_message_component.xml
index a67fa2dc..46a04f44 100644
--- a/uikit/src/main/res/layout/sb_view_my_voice_message_component.xml
+++ b/uikit/src/main/res/layout/sb_view_my_voice_message_component.xml
@@ -3,8 +3,8 @@
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_12"
- android:paddingRight="@dimen/sb_size_12"
+ android:paddingStart="@dimen/sb_size_12"
+ android:paddingEnd="@dimen/sb_size_12"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
>
@@ -101,9 +101,7 @@
android:id="@+id/rvEmojiReactionList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_7"
android:paddingStart="@dimen/sb_size_7"
- android:paddingRight="@dimen/sb_size_7"
android:paddingEnd="@dimen/sb_size_7"
android:paddingBottom="@dimen/sb_size_7"
android:paddingTop="@dimen/sb_size_7"
@@ -134,7 +132,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
- app:layout_constraintRight_toRightOf="@id/contentPanelWithReactions"
+ app:layout_constraintEnd_toEndOf="@id/contentPanelWithReactions"
app:layout_constraintTop_toBottomOf="@id/contentPanelWithReactions"
/>
diff --git a/uikit/src/main/res/layout/sb_view_ogtag.xml b/uikit/src/main/res/layout/sb_view_ogtag.xml
index 80f0801f..1decdc56 100644
--- a/uikit/src/main/res/layout/sb_view_ogtag.xml
+++ b/uikit/src/main/res/layout/sb_view_ogtag.xml
@@ -44,9 +44,7 @@
android:maxWidth="@dimen/sb_message_max_width"
android:maxLines="10"
android:paddingStart="@dimen/sb_size_12"
- android:paddingLeft="@dimen/sb_size_12"
android:paddingEnd="@dimen/sb_size_12"
- android:paddingRight="@dimen/sb_size_12"
android:paddingBottom="@dimen/sb_size_4"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintBottom_toTopOf="@id/tvOgDescription"
@@ -60,9 +58,7 @@
android:layout_height="wrap_content"
android:maxWidth="@dimen/sb_message_max_width"
android:paddingStart="@dimen/sb_size_12"
- android:paddingLeft="@dimen/sb_size_12"
android:paddingEnd="@dimen/sb_size_12"
- android:paddingRight="@dimen/sb_size_12"
android:paddingBottom="@dimen/sb_size_4"
android:singleLine="true"
android:ellipsize="end"
@@ -78,9 +74,7 @@
android:layout_height="wrap_content"
android:maxWidth="@dimen/sb_message_max_width"
android:paddingStart="@dimen/sb_size_12"
- android:paddingLeft="@dimen/sb_size_12"
android:paddingEnd="@dimen/sb_size_12"
- android:paddingRight="@dimen/sb_size_12"
android:paddingTop="@dimen/sb_size_4"
android:paddingBottom="@dimen/sb_size_4"
android:singleLine="true"
diff --git a/uikit/src/main/res/layout/sb_view_open_channel_file_image_message_component.xml b/uikit/src/main/res/layout/sb_view_open_channel_file_image_message_component.xml
index 690f29fa..f88e9f6f 100644
--- a/uikit/src/main/res/layout/sb_view_open_channel_file_image_message_component.xml
+++ b/uikit/src/main/res/layout/sb_view_open_channel_file_image_message_component.xml
@@ -2,9 +2,9 @@
+ android:paddingStart="@dimen/sb_size_16"
+ android:paddingEnd="@dimen/sb_size_16">
+ android:layout_marginStart="@dimen/sb_size_16"
+ android:layout_marginEnd="@dimen/sb_size_16"/>
+ android:layout_marginStart="@dimen/sb_size_16"
+ android:layout_marginEnd="@dimen/sb_size_16"/>
diff --git a/uikit/src/main/res/layout/sb_view_open_channel_user_message_component.xml b/uikit/src/main/res/layout/sb_view_open_channel_user_message_component.xml
index 5c6b2926..d74ea4bd 100644
--- a/uikit/src/main/res/layout/sb_view_open_channel_user_message_component.xml
+++ b/uikit/src/main/res/layout/sb_view_open_channel_user_message_component.xml
@@ -16,8 +16,8 @@
android:id="@+id/contentPanel"
android:paddingTop="@dimen/sb_size_5"
android:paddingBottom="@dimen/sb_size_5"
- android:paddingLeft="@dimen/sb_size_12"
- android:paddingRight="@dimen/sb_size_12"
+ android:paddingStart="@dimen/sb_size_12"
+ android:paddingEnd="@dimen/sb_size_12"
android:addStatesFromChildren="true"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="@id/guideline"
diff --git a/uikit/src/main/res/layout/sb_view_other_file_image_message_component.xml b/uikit/src/main/res/layout/sb_view_other_file_image_message_component.xml
index 991a5ff1..bf67d21c 100644
--- a/uikit/src/main/res/layout/sb_view_other_file_image_message_component.xml
+++ b/uikit/src/main/res/layout/sb_view_other_file_image_message_component.xml
@@ -3,8 +3,8 @@
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_12"
- android:paddingRight="@dimen/sb_size_12"
+ android:paddingStart="@dimen/sb_size_12"
+ android:paddingEnd="@dimen/sb_size_12"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
@@ -24,8 +24,8 @@
android:id="@+id/tvNickname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_50"
- android:paddingRight="@dimen/sb_size_50"
+ android:paddingStart="@dimen/sb_size_50"
+ android:paddingEnd="@dimen/sb_size_50"
android:paddingBottom="@dimen/sb_size_4"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent" />
@@ -111,9 +111,7 @@
android:id="@+id/rvEmojiReactionList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_7"
android:paddingStart="@dimen/sb_size_7"
- android:paddingRight="@dimen/sb_size_7"
android:paddingEnd="@dimen/sb_size_7"
android:paddingBottom="@dimen/sb_size_7"
android:paddingTop="@dimen/sb_size_7"
@@ -155,7 +153,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
- app:layout_constraintLeft_toLeftOf="@id/contentPanel"
+ app:layout_constraintStart_toStartOf="@id/contentPanel"
app:layout_constraintTop_toBottomOf="@id/contentPanel"
/>
diff --git a/uikit/src/main/res/layout/sb_view_other_file_message_component.xml b/uikit/src/main/res/layout/sb_view_other_file_message_component.xml
index e3bdae60..8489ba75 100644
--- a/uikit/src/main/res/layout/sb_view_other_file_message_component.xml
+++ b/uikit/src/main/res/layout/sb_view_other_file_message_component.xml
@@ -3,8 +3,8 @@
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_12"
- android:paddingRight="@dimen/sb_size_12"
+ android:paddingStart="@dimen/sb_size_12"
+ android:paddingEnd="@dimen/sb_size_12"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
>
@@ -24,8 +24,8 @@
android:id="@+id/tvNickname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_50"
- android:paddingRight="@dimen/sb_size_50"
+ android:paddingStart="@dimen/sb_size_50"
+ android:paddingEnd="@dimen/sb_size_50"
android:paddingBottom="@dimen/sb_size_4"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent" />
@@ -77,8 +77,6 @@
android:gravity="center"
android:paddingTop="@dimen/sb_size_7"
android:paddingBottom="@dimen/sb_size_7"
- android:paddingRight="@dimen/sb_size_12"
- android:paddingLeft="@dimen/sb_size_12"
android:paddingStart="@dimen/sb_size_12"
android:paddingEnd="@dimen/sb_size_12"
app:layout_constraintHorizontal_bias="0"
@@ -111,9 +109,7 @@
android:id="@+id/rvEmojiReactionList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_7"
android:paddingStart="@dimen/sb_size_7"
- android:paddingRight="@dimen/sb_size_7"
android:paddingEnd="@dimen/sb_size_7"
android:paddingBottom="@dimen/sb_size_7"
android:paddingTop="@dimen/sb_size_7"
@@ -154,7 +150,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
- app:layout_constraintLeft_toLeftOf="@id/contentPanelWithReactions"
+ app:layout_constraintStart_toStartOf="@id/contentPanelWithReactions"
app:layout_constraintTop_toBottomOf="@id/contentPanelWithReactions"
/>
diff --git a/uikit/src/main/res/layout/sb_view_other_file_video_message_component.xml b/uikit/src/main/res/layout/sb_view_other_file_video_message_component.xml
index ba1d7da4..d9e8a02a 100644
--- a/uikit/src/main/res/layout/sb_view_other_file_video_message_component.xml
+++ b/uikit/src/main/res/layout/sb_view_other_file_video_message_component.xml
@@ -3,8 +3,8 @@
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_12"
- android:paddingRight="@dimen/sb_size_12"
+ android:paddingStart="@dimen/sb_size_12"
+ android:paddingEnd="@dimen/sb_size_12"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
@@ -24,8 +24,8 @@
android:id="@+id/tvNickname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_50"
- android:paddingRight="@dimen/sb_size_50"
+ android:paddingStart="@dimen/sb_size_50"
+ android:paddingEnd="@dimen/sb_size_50"
android:paddingBottom="@dimen/sb_size_4"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent" />
@@ -111,9 +111,7 @@
android:id="@+id/rvEmojiReactionList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_7"
android:paddingStart="@dimen/sb_size_7"
- android:paddingRight="@dimen/sb_size_7"
android:paddingEnd="@dimen/sb_size_7"
android:paddingBottom="@dimen/sb_size_7"
android:paddingTop="@dimen/sb_size_7"
@@ -155,7 +153,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
- app:layout_constraintLeft_toLeftOf="@id/contentPanel"
+ app:layout_constraintStart_toStartOf="@id/contentPanel"
app:layout_constraintTop_toBottomOf="@id/contentPanel"
/>
diff --git a/uikit/src/main/res/layout/sb_view_other_message_component.xml b/uikit/src/main/res/layout/sb_view_other_message_component.xml
index 0440b62c..334cc6c7 100644
--- a/uikit/src/main/res/layout/sb_view_other_message_component.xml
+++ b/uikit/src/main/res/layout/sb_view_other_message_component.xml
@@ -3,8 +3,8 @@
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_12"
- android:paddingRight="@dimen/sb_size_12"
+ android:paddingStart="@dimen/sb_size_12"
+ android:paddingEnd="@dimen/sb_size_12"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
>
@@ -24,8 +24,8 @@
android:id="@+id/tvNickname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_50"
- android:paddingRight="@dimen/sb_size_50"
+ android:paddingStart="@dimen/sb_size_50"
+ android:paddingEnd="@dimen/sb_size_50"
android:paddingBottom="@dimen/sb_size_4"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent" />
@@ -84,9 +84,7 @@
android:id="@+id/rvEmojiReactionList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_7"
android:paddingStart="@dimen/sb_size_7"
- android:paddingRight="@dimen/sb_size_7"
android:paddingEnd="@dimen/sb_size_7"
android:paddingBottom="@dimen/sb_size_7"
android:paddingTop="@dimen/sb_size_7"
@@ -127,7 +125,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
- app:layout_constraintLeft_toLeftOf="@id/contentPanel"
+ app:layout_constraintStart_toStartOf="@id/contentPanel"
app:layout_constraintTop_toBottomOf="@id/contentPanel"
/>
diff --git a/uikit/src/main/res/layout/sb_view_other_multiple_files_message_component.xml b/uikit/src/main/res/layout/sb_view_other_multiple_files_message_component.xml
index 9bae5a71..7c72ed87 100644
--- a/uikit/src/main/res/layout/sb_view_other_multiple_files_message_component.xml
+++ b/uikit/src/main/res/layout/sb_view_other_multiple_files_message_component.xml
@@ -3,8 +3,8 @@
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_12"
- android:paddingRight="@dimen/sb_size_12"
+ android:paddingStart="@dimen/sb_size_12"
+ android:paddingEnd="@dimen/sb_size_12"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
@@ -24,8 +24,8 @@
android:id="@+id/tvNickname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_50"
- android:paddingRight="@dimen/sb_size_50"
+ android:paddingStart="@dimen/sb_size_50"
+ android:paddingEnd="@dimen/sb_size_50"
android:paddingBottom="@dimen/sb_size_4"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent" />
@@ -84,9 +84,7 @@
android:id="@+id/rvEmojiReactionList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_7"
android:paddingStart="@dimen/sb_size_7"
- android:paddingRight="@dimen/sb_size_7"
android:paddingEnd="@dimen/sb_size_7"
android:paddingBottom="@dimen/sb_size_7"
android:paddingTop="@dimen/sb_size_7"
@@ -128,7 +126,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
- app:layout_constraintLeft_toLeftOf="@id/contentPanel"
+ app:layout_constraintStart_toStartOf="@id/contentPanel"
app:layout_constraintTop_toBottomOf="@id/contentPanel"
/>
diff --git a/uikit/src/main/res/layout/sb_view_other_quoted_message.xml b/uikit/src/main/res/layout/sb_view_other_quoted_message.xml
index 7403a3ce..dc2019fd 100644
--- a/uikit/src/main/res/layout/sb_view_other_quoted_message.xml
+++ b/uikit/src/main/res/layout/sb_view_other_quoted_message.xml
@@ -46,8 +46,8 @@
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_12"
- android:paddingRight="@dimen/sb_size_12"
+ android:paddingStart="@dimen/sb_size_12"
+ android:paddingEnd="@dimen/sb_size_12"
android:paddingTop="@dimen/sb_size_6"
android:paddingBottom="@dimen/sb_size_12"
android:gravity="center_vertical"
diff --git a/uikit/src/main/res/layout/sb_view_other_template_message_component.xml b/uikit/src/main/res/layout/sb_view_other_template_message_component.xml
index 0bebfb1e..a4be37a2 100644
--- a/uikit/src/main/res/layout/sb_view_other_template_message_component.xml
+++ b/uikit/src/main/res/layout/sb_view_other_template_message_component.xml
@@ -10,8 +10,8 @@
android:id="@+id/tvNickname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_50"
- android:paddingRight="@dimen/sb_size_50"
+ android:paddingStart="@dimen/sb_size_50"
+ android:paddingEnd="@dimen/sb_size_50"
android:paddingBottom="@dimen/sb_size_4"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
diff --git a/uikit/src/main/res/layout/sb_view_other_user_message_component.xml b/uikit/src/main/res/layout/sb_view_other_user_message_component.xml
index 49f104aa..508623b7 100644
--- a/uikit/src/main/res/layout/sb_view_other_user_message_component.xml
+++ b/uikit/src/main/res/layout/sb_view_other_user_message_component.xml
@@ -3,8 +3,8 @@
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_12"
- android:paddingRight="@dimen/sb_size_12"
+ android:paddingStart="@dimen/sb_size_12"
+ android:paddingEnd="@dimen/sb_size_12"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
@@ -31,8 +31,8 @@
android:id="@+id/tvNickname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_50"
- android:paddingRight="@dimen/sb_size_50"
+ android:paddingStart="@dimen/sb_size_50"
+ android:paddingEnd="@dimen/sb_size_50"
android:paddingBottom="@dimen/sb_size_4"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
@@ -104,8 +104,6 @@
android:maxWidth="@dimen/sb_message_max_width"
android:paddingTop="@dimen/sb_size_7"
android:paddingBottom="@dimen/sb_size_7"
- android:paddingRight="@dimen/sb_size_12"
- android:paddingLeft="@dimen/sb_size_12"
android:paddingStart="@dimen/sb_size_12"
android:paddingEnd="@dimen/sb_size_12"
app:sb_auto_link_text_view_linkify_mask="all"
@@ -130,9 +128,7 @@
android:id="@+id/rvEmojiReactionList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_7"
android:paddingStart="@dimen/sb_size_7"
- android:paddingRight="@dimen/sb_size_7"
android:paddingEnd="@dimen/sb_size_7"
android:paddingBottom="@dimen/sb_size_7"
android:paddingTop="@dimen/sb_size_7"
@@ -149,7 +145,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
- app:layout_constraintLeft_toLeftOf="@id/contentPanel"
+ app:layout_constraintStart_toStartOf="@id/contentPanel"
app:layout_constraintTop_toBottomOf="@id/contentPanel"
/>
diff --git a/uikit/src/main/res/layout/sb_view_other_voice_message_component.xml b/uikit/src/main/res/layout/sb_view_other_voice_message_component.xml
index 04176d4e..789d56cc 100644
--- a/uikit/src/main/res/layout/sb_view_other_voice_message_component.xml
+++ b/uikit/src/main/res/layout/sb_view_other_voice_message_component.xml
@@ -3,8 +3,8 @@
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_12"
- android:paddingRight="@dimen/sb_size_12"
+ android:paddingStart="@dimen/sb_size_12"
+ android:paddingEnd="@dimen/sb_size_12"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
>
@@ -24,8 +24,8 @@
android:id="@+id/tvNickname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_50"
- android:paddingRight="@dimen/sb_size_50"
+ android:paddingStart="@dimen/sb_size_50"
+ android:paddingEnd="@dimen/sb_size_50"
android:paddingBottom="@dimen/sb_size_4"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent" />
@@ -97,9 +97,7 @@
android:id="@+id/rvEmojiReactionList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_7"
android:paddingStart="@dimen/sb_size_7"
- android:paddingRight="@dimen/sb_size_7"
android:paddingEnd="@dimen/sb_size_7"
android:paddingBottom="@dimen/sb_size_7"
android:paddingTop="@dimen/sb_size_7"
@@ -140,7 +138,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
- app:layout_constraintLeft_toLeftOf="@id/contentPanelWithReactions"
+ app:layout_constraintStart_toStartOf="@id/contentPanelWithReactions"
app:layout_constraintTop_toBottomOf="@id/contentPanelWithReactions"
/>
diff --git a/uikit/src/main/res/layout/sb_view_parent_message_info.xml b/uikit/src/main/res/layout/sb_view_parent_message_info.xml
index 1626defb..ae972ed5 100644
--- a/uikit/src/main/res/layout/sb_view_parent_message_info.xml
+++ b/uikit/src/main/res/layout/sb_view_parent_message_info.xml
@@ -31,34 +31,41 @@
android:layout_width="@dimen/sb_size_34"
android:layout_height="@dimen/sb_size_34"
android:importantForAccessibility="no"
- app:layout_constraintLeft_toLeftOf="@id/guidelineStart"
+ app:layout_constraintStart_toStartOf="@id/guidelineStart"
app:layout_constraintTop_toTopOf="@id/guidelineTop"
app:layout_constraintBottom_toBottomOf="@id/senderBarrier"/>
@@ -67,7 +74,7 @@
android:layout_width="@dimen/sb_size_24"
android:layout_height="@dimen/sb_size_24"
app:layout_constraintTop_toTopOf="@id/guidelineTop"
- app:layout_constraintRight_toRightOf="@id/guidelineEnd"
+ app:layout_constraintEnd_toEndOf="@id/guidelineEnd"
android:contentDescription="@string/sb_view_parent_message_info_menu_icon_description"/>
@@ -14,7 +14,6 @@
android:id="@+id/vgAction"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toEndOf="@id/tvName"
app:layout_constraintTop_toTopOf="parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
@@ -33,8 +32,8 @@
android:id="@+id/tvDescription"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginLeft="@dimen/sb_size_8"
- android:layout_marginRight="@dimen/sb_size_8"
+ android:layout_marginStart="@dimen/sb_size_8"
+ android:layout_marginEnd="@dimen/sb_size_8"
/>
diff --git a/uikit/src/main/res/layout/sb_view_suggested_mention_list_item.xml b/uikit/src/main/res/layout/sb_view_suggested_mention_list_item.xml
index 5057c649..141dded4 100644
--- a/uikit/src/main/res/layout/sb_view_suggested_mention_list_item.xml
+++ b/uikit/src/main/res/layout/sb_view_suggested_mention_list_item.xml
@@ -3,9 +3,9 @@
android:id="@+id/vgMemberItem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_16"
+ android:paddingStart="@dimen/sb_size_16"
android:paddingTop="@dimen/sb_size_8"
- android:paddingRight="@dimen/sb_size_16"
+ android:paddingEnd="@dimen/sb_size_16"
android:paddingBottom="@dimen/sb_size_8"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
@@ -16,7 +16,7 @@
android:layout_height="@dimen/sb_size_28"
android:scaleType="centerCrop"
android:contentDescription="@string/sb_view_suggested_mention_item_profile_description"
- app:layout_constraintLeft_toLeftOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
diff --git a/uikit/src/main/res/layout/sb_view_thread_info.xml b/uikit/src/main/res/layout/sb_view_thread_info.xml
index 7dde203a..23565858 100644
--- a/uikit/src/main/res/layout/sb_view_thread_info.xml
+++ b/uikit/src/main/res/layout/sb_view_thread_info.xml
@@ -14,8 +14,8 @@
android:orientation="horizontal"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintLeft_toLeftOf="parent"
- app:layout_constraintRight_toLeftOf="@id/tvReplyCount"/>
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintEnd_toStartOf="@id/tvReplyCount"/>
+ app:layout_constraintStart_toEndOf="@id/profileViewPanel"
+ app:layout_constraintEnd_toEndOf="parent"/>
diff --git a/uikit/src/main/res/layout/sb_view_time_line_message_component.xml b/uikit/src/main/res/layout/sb_view_time_line_message_component.xml
index fc1e5e7e..7e89d8c4 100644
--- a/uikit/src/main/res/layout/sb_view_time_line_message_component.xml
+++ b/uikit/src/main/res/layout/sb_view_time_line_message_component.xml
@@ -13,8 +13,8 @@
android:layout_marginBottom="@dimen/sb_size_4"
android:textSize="@dimen/sb_text_size_12"
android:gravity="center"
- android:paddingLeft="@dimen/sb_size_8"
- android:paddingRight="@dimen/sb_size_8"
+ android:paddingStart="@dimen/sb_size_8"
+ android:paddingEnd="@dimen/sb_size_8"
android:paddingTop="@dimen/sb_size_4"
android:paddingBottom="@dimen/sb_size_4"
android:minWidth="@dimen/sb_size_50"
diff --git a/uikit/src/main/res/layout/sb_view_toast.xml b/uikit/src/main/res/layout/sb_view_toast.xml
index a9be28a9..0e7aec8f 100644
--- a/uikit/src/main/res/layout/sb_view_toast.xml
+++ b/uikit/src/main/res/layout/sb_view_toast.xml
@@ -11,8 +11,8 @@
android:id="@+id/iconPanel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginRight="@dimen/sb_size_8"
- android:layout_marginLeft="@dimen/sb_size_8">
+ android:layout_marginEnd="@dimen/sb_size_8"
+ android:layout_marginStart="@dimen/sb_size_8">
diff --git a/uikit/src/main/res/layout/sb_view_user_list_item.xml b/uikit/src/main/res/layout/sb_view_user_list_item.xml
index c1d7f5be..aba8da06 100644
--- a/uikit/src/main/res/layout/sb_view_user_list_item.xml
+++ b/uikit/src/main/res/layout/sb_view_user_list_item.xml
@@ -3,9 +3,9 @@
android:id="@+id/vgUserItem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/sb_size_16"
+ android:paddingStart="@dimen/sb_size_16"
android:paddingTop="@dimen/sb_size_10"
- android:paddingRight="@dimen/sb_size_16"
+ android:paddingEnd="@dimen/sb_size_16"
android:paddingBottom="@dimen/sb_size_10"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
@@ -14,17 +14,23 @@
android:id="@+id/ivUserCover"
android:layout_width="@dimen/sb_size_36"
android:layout_height="@dimen/sb_size_36"
- app:layout_constraintLeft_toLeftOf="parent"
+ app:layout_constraintHorizontal_chainStyle="packed"
+ app:layout_constraintHorizontal_bias="0"
+ app:layout_constraintEnd_toStartOf="@id/tvNickname"
+ app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@@ -32,7 +38,7 @@
android:id="@+id/cbUserPreview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- app:layout_constraintRight_toRightOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>