Skip to content

Commit

Permalink
Added v3.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sendbird-sdk-deployment committed Jan 4, 2024
1 parent 28c5f2f commit e0524a4
Show file tree
Hide file tree
Showing 154 changed files with 1,781 additions and 656 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
# Changelog
### v3.12.0 (Jan, 2024) with Chat SDK `v4.13.0`
* Added `sendLogImpression(List<BaseMessage>)` in `FeedNotificationChannelViewModel`.
* Improved performance of scrolling in Message List.

**MyMessageViewHolder** and **OtherMessageViewHolder**:
* Added `MyMessageViewHolder` and `OtherMessageViewHolder` to provide a basic UI frame for single message.
* These ViewHolders include UI elements such as 'message sent time,' 'nickname,' 'profile,' and 'sending status,' excluding the content area.
* Customers can now customize only the content area. Note: This feature is currently experimental.

**BaseMessageListViewModel.buildMessageList()**:
* Added `BaseMessageListViewModel.buildMessageList()` to allow customers to customize the message list before delivering it to the view.

```kotlin
class CustomChannelViewModel(
channelUrl: String
) : ChannelViewModel(channelUrl, null) {
override fun buildMessageList(): List<BaseMessage> {
return super.buildMessageList().map { message ->
// Customize the message here
message
}
}
}
```
### v3.11.0 (Nov 29, 2023) with Chat SDK `v4.13.0`
* `VIEW_TYPE_TYPING_INDICATOR` is a new typing indicator UI that can be turned on through `typingIndicatorTypes` option. When turned on, it will be displayed in `ChannelFragment` upon receiving typing event in real time.
* Added `typingIndicatorTypes` in `ChannelConfig`.
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ org.gradle.jvmargs=-Xmx1536m
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true

UIKIT_VERSION = 3.11.0
UIKIT_VERSION = 3.12.0
UIKIT_VERSION_CODE = 1
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
package com.sendbird.uikit.samples.aichatbot

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.sendbird.uikit.SendbirdUIKit
import com.sendbird.uikit.samples.R
import com.sendbird.uikit.samples.common.ThemeHomeActivity
import com.sendbird.uikit.samples.common.extensions.logout
import com.sendbird.uikit.samples.common.widgets.WaitingDialog
import com.sendbird.uikit.samples.databinding.ActivityAiChatbotHomeBinding
import com.sendbird.uikit.utils.ContextUtils

class AIChatBotHomeActivity : AppCompatActivity() {
class AIChatBotHomeActivity : ThemeHomeActivity() {
override val binding by lazy { ActivityAiChatbotHomeBinding.inflate(layoutInflater) }
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
ActivityAiChatbotHomeBinding.inflate(layoutInflater).apply {
setContentView(root)
chatbotButton.setOnClickListener { startChatWithAiBot() }
btSignOut.setOnClickListener { logout() }
}
binding.chatbotButton.setOnClickListener { startChatWithAiBot() }
binding.btSignOut.setOnClickListener { logout() }
}

override fun applyTheme() {
super.applyTheme()
binding.btSignOut.setBackgroundResource(
if (isDarkTheme) R.drawable.selector_home_signout_button_dark
else R.drawable.selector_home_signout_button
)
}

private fun startChatWithAiBot() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import android.provider.Settings
import android.view.View
import androidx.activity.result.contract.ActivityResultContracts
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
import androidx.core.content.PermissionChecker
Expand All @@ -23,21 +22,23 @@ import com.sendbird.android.user.UnreadMessageCount
import com.sendbird.android.user.User
import com.sendbird.uikit.samples.R
import com.sendbird.uikit.samples.basic.openchannel.OpenChannelMainActivity
import com.sendbird.uikit.samples.common.ThemeHomeActivity
import com.sendbird.uikit.samples.common.extensions.logout
import com.sendbird.uikit.samples.common.extensions.setTextColorResource
import com.sendbird.uikit.samples.databinding.ActivityHomeBinding
import com.sendbird.uikit.utils.ContextUtils
import java.util.Locale

class BasicHomeActivity : AppCompatActivity() {
private lateinit var binding: ActivityHomeBinding
class BasicHomeActivity : ThemeHomeActivity() {
override val binding by lazy { ActivityHomeBinding.inflate(layoutInflater) }
private val requestPermissionLauncher =
registerForActivityResult(ActivityResultContracts.RequestPermission()) { }
private val appSettingLauncher =
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { }

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
this.binding = ActivityHomeBinding.inflate(layoutInflater).apply {
binding.apply {
groupChannelButton.setOnClickListener {
startActivity(Intent(this@BasicHomeActivity, GroupChannelMainActivity::class.java))
}
Expand All @@ -61,7 +62,15 @@ class BasicHomeActivity : AppCompatActivity() {
requestPermissionLauncher.launch(permission)
}
}
setContentView(binding.root)
}

override fun applyTheme() {
super.applyTheme()
binding.mainTitle.setTextColorResource(if (isDarkTheme) R.color.ondark_01 else R.color.onlight_01)
binding.btSignOut.setBackgroundResource(
if (isDarkTheme) R.drawable.selector_home_signout_button_dark
else R.drawable.selector_home_signout_button
)
}

override fun onResume() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class LiveStreamActivity : AppCompatActivity() {
}
addChannelHandler()
ivLive.visibility = View.VISIBLE
ivLive.setOnClickListener {groupLiveControl.toggleVisibility() }
ivLive.setOnClickListener { groupLiveControl.toggleVisibility() }
ivClose.setOnClickListener { finish() }
ivChatToggle?.setOnClickListener {
if (sbFragmentContainer.visibility == View.GONE) {
Expand Down Expand Up @@ -189,11 +189,11 @@ class LiveStreamActivity : AppCompatActivity() {
private fun hideSystemUI() {
if (resources.configuration.orientation == Configuration.ORIENTATION_LANDSCAPE) {
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE or
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or
View.SYSTEM_UI_FLAG_FULLSCREEN or
View.SYSTEM_UI_FLAG_LOW_PROFILE or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or
View.SYSTEM_UI_FLAG_FULLSCREEN or
View.SYSTEM_UI_FLAG_LOW_PROFILE or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ import com.sendbird.uikit.samples.BaseApplication.Companion.initStateChanges
import com.sendbird.uikit.samples.R
import com.sendbird.uikit.samples.common.consts.InitState
import com.sendbird.uikit.samples.common.extensions.authenticate
import com.sendbird.uikit.samples.common.extensions.isUsingDarkTheme
import com.sendbird.uikit.samples.common.extensions.startingIntent
import com.sendbird.uikit.samples.common.preferences.PreferenceUtils
import com.sendbird.uikit.samples.common.widgets.WaitingDialog
import com.sendbird.uikit.samples.databinding.ActivitySplashBinding

/**
* Displays a splash screen.
Expand All @@ -20,7 +22,12 @@ import com.sendbird.uikit.samples.common.widgets.WaitingDialog
class SplashActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_splash)
ActivitySplashBinding.inflate(layoutInflater).apply {
setContentView(root)
val isDarkTheme = PreferenceUtils.themeMode.isUsingDarkTheme()
val backgroundRedId = if (isDarkTheme) R.color.background_600 else R.color.background_50
root.setBackgroundResource(backgroundRedId)
}
initStateChanges().observe(this) { initState: InitState ->
Logger.i("++ init state : %s", initState)
WaitingDialog.dismiss()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.sendbird.uikit.samples.common

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.viewbinding.ViewBinding
import com.sendbird.uikit.samples.R
import com.sendbird.uikit.samples.common.extensions.isUsingDarkTheme
import com.sendbird.uikit.samples.common.preferences.PreferenceUtils

abstract class ThemeHomeActivity : AppCompatActivity() {
abstract val binding: ViewBinding
val isDarkTheme: Boolean
get() = PreferenceUtils.themeMode.isUsingDarkTheme()
private var currentThemeMode = PreferenceUtils.themeMode

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setTheme(if (PreferenceUtils.themeMode.isUsingDarkTheme()) R.style.AppTheme_Dark else R.style.AppTheme)
setContentView(binding.root)
applyTheme()
}

override fun onResume() {
super.onResume()
if (currentThemeMode != PreferenceUtils.themeMode) {
currentThemeMode = PreferenceUtils.themeMode
recreate()
}
}

open fun applyTheme() {
val backgroundRedId = if (isDarkTheme) R.color.background_600 else R.color.background_50
binding.apply {
root.setBackgroundResource(backgroundRedId)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ import android.view.View
import android.view.ViewOutlineProvider
import android.widget.FrameLayout
import com.sendbird.uikit.samples.R
import com.sendbird.uikit.samples.common.extensions.setAppearance
import com.sendbird.uikit.samples.databinding.ViewEntryButtonBinding
import com.sendbird.uikit.samples.utils.toDp
import com.sendbird.uikit.utils.DrawableUtils

class EntryButton @JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = R.attr.widget_entry_button
) : FrameLayout(context, attrs, defStyleAttr) {
private val binding: ViewEntryButtonBinding
var unreadCountVisibility: Int
Expand Down Expand Up @@ -42,6 +46,28 @@ class EntryButton @JvmOverloads constructor(
binding.description.visibility = View.GONE
}
}

a.getResourceId(
R.styleable.EntryButton_background_color,
R.drawable.selector_home_channel_type_button
).apply { binding.root.setBackgroundResource(this) }
a.getColorStateList(R.styleable.EntryButton_icon_tint).apply {
binding.chevron.setImageDrawable(
DrawableUtils.setTintList(
getContext(),
R.drawable.icon_chevron_right,
this
)
)
}
a.getResourceId(
R.styleable.EntryButton_title_text_appearance,
R.style.EntryButtonTitle
).apply { binding.title.setAppearance(context, this) }
a.getResourceId(
R.styleable.EntryButton_description_text_appearance,
R.style.EntryButtonDescription
).apply { binding.description.setAppearance(context, this) }
} finally {
a.recycle()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class MessageUISampleAdapter(
val binding: ViewCustomMessageMeBinding
) : GroupChannelMessageViewHolder(binding.root) {
override fun setEmojiReaction(
reactionList: MutableList<Reaction>,
reactionList: List<Reaction>,
emojiReactionClickListener: OnItemClickListener<String>?,
emojiReactionLongClickListener: OnItemLongClickListener<String>?,
moreButtonClickListener: View.OnClickListener?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class NewMessageTypeSampleAdapter(
val binding: ViewCustomMessageMeBinding
) : GroupChannelMessageViewHolder(binding.root) {
override fun setEmojiReaction(
reactionList: MutableList<Reaction>,
reactionList: List<Reaction>,
emojiReactionClickListener: OnItemClickListener<String>?,
emojiReactionLongClickListener: OnItemLongClickListener<String>?,
moreButtonClickListener: View.OnClickListener?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@ import android.content.Intent
import android.os.Bundle
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import androidx.viewbinding.ViewBinding
import com.sendbird.uikit.activities.FeedNotificationChannelActivity
import com.sendbird.uikit.samples.R
import com.sendbird.uikit.samples.common.ThemeHomeActivity
import com.sendbird.uikit.samples.common.extensions.getFeedChannelUrl
import com.sendbird.uikit.samples.common.extensions.logout
import com.sendbird.uikit.samples.common.extensions.setTextColorResource
import com.sendbird.uikit.samples.common.preferences.PreferenceUtils
import com.sendbird.uikit.samples.databinding.ActivityNotificationHomeBinding

class NotificationHomeActivity : AppCompatActivity() {
class NotificationHomeActivity : ThemeHomeActivity() {
override val binding: ActivityNotificationHomeBinding by lazy { ActivityNotificationHomeBinding.inflate(layoutInflater) }
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
ActivityNotificationHomeBinding.inflate(layoutInflater).apply {
setContentView(root)
binding.apply {
chatAndFeedButton.visibility = if (PreferenceUtils.isUsingFeedChannelOnly) View.GONE else View.VISIBLE
chatAndFeedButton.setOnClickListener {
startActivity(Intent(this@NotificationHomeActivity, NotificationMainActivity::class.java))
Expand All @@ -31,4 +35,13 @@ class NotificationHomeActivity : AppCompatActivity() {
btSignOut.setOnClickListener { logout() }
}
}

override fun applyTheme() {
super.applyTheme()
binding.mainTitle.setTextColorResource(if (isDarkTheme) R.color.ondark_01 else R.color.onlight_01)
binding.btSignOut.setBackgroundResource(
if (isDarkTheme) R.drawable.selector_home_signout_button_dark
else R.drawable.selector_home_signout_button
)
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<solid android:color="@color/primary_500"/>
<corners android:radius="@dimen/sb_size_8"/>
</shape>
</item>

<item android:state_pressed="false">
<shape android:shape="rectangle">
<solid android:color="@color/background_400"/>
<corners android:radius="@dimen/sb_size_8"/>
</shape>
</item>
</selector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<corners android:radius="@dimen/sb_size_4"/>
<solid android:color="@color/primary_300"/>
<stroke android:color="@color/primary_400"
android:width="@dimen/sb_size_1"/>
</shape>
</item>
<item android:state_pressed="false">
<shape android:shape="rectangle">
<corners android:radius="@dimen/sb_size_4"/>
<stroke android:color="@color/primary_300"
android:width="@dimen/sb_size_1"/>
<solid android:color="@color/primary_200"/>
</shape>
</item>
</selector>
Loading

0 comments on commit e0524a4

Please sign in to comment.