Skip to content

Commit

Permalink
Merge pull request #14 from sendbird/release/3.9.0
Browse files Browse the repository at this point in the history
3.9.0
  • Loading branch information
sendbird-sdk-deployment authored Sep 22, 2023
2 parents 752e03b + 8ec4946 commit 27eff38
Show file tree
Hide file tree
Showing 241 changed files with 6,742 additions and 1,492 deletions.
96 changes: 96 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
root = true

[*]
trim_trailing_whitespace = true
indent_style = space
ij_continuation_indent_size = 4
ij_any_keep_simple_methods_in_one_line = true
ij_any_keep_simple_blocks_in_one_line = true
ij_any_keep_simple_classes_in_one_line = true
ij_any_keep_simple_lambdas_in_one_line = true
max_line_length = 120

## ktlint configured rules
ktlint_standard_indent = disabled
ktlint_standard_annotation = disabled
ktlint_standard_filename = disabled
ktlint_standard_max-line-length = disabled
ktlint_standard_spacing-between-declarations-with-annotations = disabled
ktlint_standard_spacing-between-declarations-with-comments = disabled

ktlint_standard_wrapping = disabled
ktlint_standard_parameter-wrapping = disabled
ktlint_standard_property-wrapping = disabled
ktlint_standard_argument-list-wrapping = disabled
ktlint_standard_parameter-list-wrapping = disabled
ktlint_standard_trailing-comma-on-call-site = disabled
ktlint_standard_trailing-comma-on-declaration-site = disabled
ktlint_standard_no-wildcard-imports = disabled
ktlint_standard_import-ordering = disabled
ktlint_standard_multiline-if-else = disabled
ktlint_standard_no-semi = disabled
ktlint_standard_package-name = disabled

[*.java]
ij_java_doc_enable_formatting = false

[*.{kt,kts}]
ij_kotlin_allow_trailing_comma = false
ij_kotlin_allow_trailing_comma_on_call_site = false

## Wrapping and Braces
# Keep when reformatting
ij_kotlin_keep_line_breaks = true
ij_kotlin_keep_first_column_comment = true
# Extends/implements list
ij_kotlin_extends_list_wrap = off
ij_kotlin_align_multiline_extends_list = false
ij_kotlin_continuation_indent_in_supertype_lists = true
# Function declaration parameters
ij_kotlin_method_parameters_wrap = off
ij_kotlin_align_multiline_parameters = true
ij_kotlin_method_parameters_new_line_after_left_paren = false
ij_kotlin_method_parameters_right_paren_on_new_line = false
ij_kotlin_continuation_indent_in_parameter_lists = true
# Function call arguments
ij_kotlin_call_parameters_wrap = off
ij_kotlin_align_multiline_parameters_in_calls = false
ij_kotlin_call_parameters_new_line_after_left_paren = false
ij_kotlin_call_parameters_right_paren_on_new_line = false
ij_kotlin_continuation_indent_in_argument_lists = true
# Function parentheses
ij_kotlin_align_multiline_method_parentheses = false
# Chained function calls
ij_kotlin_method_call_chain_wrap = off
ij_kotlin_wrap_first_method_in_call_chain = false
ij_kotlin_continuation_indent_for_chained_calls = true
# 'if()' statement
ij_kotlin_else_on_new_line = false
ij_kotlin_if_rparen_on_new_line = false
ij_kotlin_continuation_indent_in_if_conditions = true
# 'do ... while()' statement
ij_kotlin_while_on_new_line = false
# 'try' statement
ij_kotlin_catch_on_new_line = false
ij_kotlin_finally_on_new_line = false
# Binary expressions
ij_kotlin_align_multiline_binary_operation = false
# Wraps
ij_kotlin_assignment_wrap = off
ij_kotlin_enum_constants_wrap = off
ij_kotlin_class_annotation_wrap = split_into_lines
ij_kotlin_method_annotation_wrap = split_into_lines
ij_kotlin_field_annotation_wrap = split_into_lines
ij_kotlin_parameter_annotation_wrap = off
ij_kotlin_variable_annotation_wrap = off
# 'when' statements
ij_kotlin_align_in_columns_case_branch = false
ij_kotlin_line_break_after_multiline_when_entry = false
# Braces placement
ij_kotlin_lbrace_on_next_line = false
# Expression body functions
ij_kotlin_wrap_expression_body_functions = 0
ij_kotlin_continuation_indent_for_expression_bodies = false
# Elvis expressions
ij_kotlin_wrap_elvis_expressions = 0
ij_kotlin_continuation_indent_in_elvis = false
53 changes: 53 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,57 @@
# Changelog
### v3.9.0 (Sep 22, 2023) with Chat SDK `v4.12.1`
* Support Multiple files message
* Added `setEnableMultipleFilesMessage(boolean)`, `getEnableMultipleFilesMessage()` in `ChannelConfig`.
* Added `isMultipleMediaEnabled()`, `onMultipleMediaResult(List<Uri>)`, and `onSingleMediaResult(Uri)` in `ChannelFragment` and `MessageThreadFragment`.
* Added `sendMultipleFilesMessage(List<FileInfo>, MultipleFilesMessageCreateParams)` in `ChannelViewModel` and `MessageThreadViewModel`.
* Added `onBeforeSendMultipleFilesMessage(MultipleFilesMessageCreateParams)` in `ChannelFragment`, `MessageThreadFragment`, and `CustomParamsHandler`.
* Added `clone()` in `ChannelConfig`, `ChannelListConfig`, `ChannelSettingConfig`, and `OpenChannelConfig`.

Custom Providers are supported to create and customize various components used in UIKit. Each Provider plays a role in generating key components used in UIKit. You can customize each Provider to easily use and customize UIKit's main components.
* Support custom providers
* ModuleProviders
* AdapterProviders
* FragmentProviders
* ViewModelProviders
* Simple example of using each Provider to work with custom data.

**ModuleProviders**
```kotlin
ModuleProviders.channel = ChannelModuleProvider { context, args ->
ChannelModule(context).apply {
setHeaderComponent(CustomHeaderComponent())
}
}
```

**AdapterProviders**
```kotlin
AdapterProviders.channelList = ChannelListAdapterProvider { uiParams ->
CustomChannelListAdapter()
}
```

**FragmentProviders**
```kotlin
FragmentProviders.channel = ChannelFragmentProvider { channelUrl, args ->
ChannelFragment.Builder(channelUrl)
.setUseHeader(true)
.setCustomFragment(CustomChannelFragment())
.withArguments(args)
.build()
}
```

**ViewModelProviders**
```kotlin
ViewModelProviders.channel = ChannelViewModelProvider { owner, channelUrl, params, config ->
ViewModelProvider(
owner,
CustomViewModelFactory(channelUrl, params, config)
)[channelUrl, CustomChannelViewModel::class.java]
}
```
> All Providers must be configured before use, and it's recommended to configure them in the Application class.
### v3.8.0 (Sep 4 2023) with Chat SDK `v4.12.0`
* Support category filtering in feed notification channel. Categories by which messages can be filtered can be created and edited in the dashboard.
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.8.0
UIKIT_VERSION = 3.9.0
UIKIT_VERSION_CODE = 1
3 changes: 3 additions & 0 deletions uikit-custom-sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ dependencies {
implementation 'com.google.firebase:firebase-messaging'

implementation 'androidx.appcompat:appcompat:1.4.1'
// To use Android Photo Picker backported version
implementation 'androidx.activity:activity:1.7.0-beta01'
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0"))
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ public void onBeforeCreateOpenChannel(@NonNull OpenChannelCreateParams params) {
UIKitConfig.getGroupChannelConfig().setEnableMention(true);
// set the voice message
UIKitConfig.getGroupChannelConfig().setEnableVoiceMessage(true);
// set whether to use Multiple Files Message
UIKitConfig.getGroupChannelConfig().setEnableMultipleFilesMessage(true);
// set the mention configuration
SendbirdUIKit.setMentionConfig(new UserMentionConfig.Builder()
.setMaxMentionCount(5)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
import com.sendbird.android.handler.UserEventHandler;
import com.sendbird.android.params.GroupChannelTotalUnreadMessageCountParams;
import com.sendbird.android.user.User;
import com.sendbird.uikit.SendbirdUIKit;
import com.sendbird.uikit.activities.ChannelActivity;
import com.sendbird.uikit.customsample.R;
import com.sendbird.uikit.customsample.SettingsFragment;
import com.sendbird.uikit.customsample.widgets.CustomTabView;
import com.sendbird.uikit.providers.FragmentProviders;

import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -165,7 +165,7 @@ public MainAdapter(@NonNull FragmentManager fm, int behavior) {
@Override
public Fragment getItem(int position) {
if (position == 0) {
return SendbirdUIKit.getFragmentFactory().newChannelListFragment(new Bundle());
return FragmentProviders.getChannelList().provide(new Bundle());
} else {
return new SettingsFragment();
}
Expand Down
4 changes: 3 additions & 1 deletion uikit-sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ dependencies {

implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.appcompat:appcompat:1.4.1'

// To use Android Photo Picker backported version
implementation 'androidx.activity:activity:1.7.0-beta01'
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0"))
implementation 'androidx.viewpager2:viewpager2:1.0.0'

implementation 'com.github.bumptech.glide:glide:4.13.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ class BaseApplication : MultiDexApplication() {
UIKitConfig.groupChannelConfig.threadReplySelectType = ThreadReplySelectType.THREAD
// set whether to use voice message
UIKitConfig.groupChannelConfig.enableVoiceMessage = true
// set whether to use Multiple Files Message
UIKitConfig.groupChannelConfig.enableMultipleFilesMessage = true

// set custom params
SendbirdUIKit.setCustomParamsHandler(object : CustomParamsHandler {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import com.sendbird.android.user.UnreadMessageCount
import com.sendbird.android.user.User
import com.sendbird.uikit.SendbirdUIKit
import com.sendbird.uikit.activities.ChannelActivity
import com.sendbird.uikit.providers.FragmentProviders
import com.sendbird.uikit_messaging_android.R
import com.sendbird.uikit_messaging_android.SettingsFragment
import com.sendbird.uikit_messaging_android.consts.StringSet
Expand Down Expand Up @@ -129,7 +130,7 @@ class GroupChannelMainActivity : AppCompatActivity() {
private class MainAdapter(fm: FragmentManager, behavior: Int) : FragmentPagerAdapter(fm, behavior) {
override fun getItem(position: Int): Fragment {
return if (position == 0) {
SendbirdUIKit.getFragmentFactory().newChannelListFragment(Bundle())
FragmentProviders.channelList.provide(Bundle())
} else {
SettingsFragment()
}
Expand Down
4 changes: 2 additions & 2 deletions uikit-sample/src/main/res/layout/activity_home.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
android:layout_marginLeft="@dimen/sb_size_8"
android:layout_marginRight="@dimen/sb_size_8"
android:background="@drawable/selector_home_channel_type_button">

<androidx.constraintlayout.widget.Guideline
android:id="@+id/groupChannelButtonGuildLine"
android:layout_width="wrap_content"
Expand Down Expand Up @@ -77,7 +77,7 @@
android:paddingLeft="@dimen/sb_size_6"
android:paddingRight="@dimen/sb_size_6"
android:includeFontPadding="false"
android:visibility="visible"
android:visibility="gone"
android:layout_marginEnd="@dimen/sb_size_4"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
Expand Down
30 changes: 12 additions & 18 deletions uikit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
id 'kotlinx-serialization'
id 'org.jetbrains.dokka' version "$kotlin_version"
id 'kotlin-parcelize'
id 'org.jetbrains.dokka' version "$kotlin_version"
}

version = UIKIT_VERSION
android {
compileSdkVersion 33
compileSdk 33

version = UIKIT_VERSION
defaultConfig {
Expand Down Expand Up @@ -41,9 +41,6 @@ android {
}
}
}
debug {
debuggable true
}
}

buildFeatures {
Expand All @@ -63,17 +60,16 @@ android {
exclude 'META-INF/LICENSE.txt'
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

// Sendbird
api 'com.sendbird.sdk:sendbird-chat:4.12.0'
api 'com.sendbird.sdk:sendbird-chat:4.12.1'

implementation 'com.github.bumptech.glide:glide:4.13.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.0'

implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
Expand All @@ -83,12 +79,11 @@ dependencies {

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2"



}

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")
suppressInheritedMembers.set(true)
Expand All @@ -99,18 +94,18 @@ dokkaHtml {
}
"""
pluginsMapConfiguration.set(
// fully qualified plugin name to json configuration
["org.jetbrains.dokka.base.DokkaBase": dokkaBaseConfiguration]
// fully qualified plugin name to json configuration
["org.jetbrains.dokka.base.DokkaBase": dokkaBaseConfiguration]
)

dokkaSourceSets {
configureEach {
// The set of visibility modifiers that should be documented.
documentedVisibilities.set(
[
org.jetbrains.dokka.DokkaConfiguration.Visibility.PUBLIC, // Same for both Kotlin and Java
org.jetbrains.dokka.DokkaConfiguration.Visibility.PROTECTED, // Same for both Kotlin and Java
]
[
org.jetbrains.dokka.DokkaConfiguration.Visibility.PUBLIC, // Same for both Kotlin and Java
org.jetbrains.dokka.DokkaConfiguration.Visibility.PROTECTED, // Same for both Kotlin and Java
]
)

// Do not output deprecated members. Applies globally, can be overridden by packageOptions
Expand Down Expand Up @@ -138,4 +133,3 @@ dokkaHtml {
}
}
}

Loading

0 comments on commit 27eff38

Please sign in to comment.