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" - /> - - - - - - - - - - - -