Skip to content

Commit

Permalink
Added 3.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
leo-shin committed Jun 28, 2023
1 parent 5741151 commit 0f7a665
Show file tree
Hide file tree
Showing 87 changed files with 2,360 additions and 443 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
# Changelog
### v3.6.0 (Jun 23, 2023) with Chat SDK `v4.9.1`
* Support feature configuration
* Added `UIKitConfig` object
* Added `setChannelConfig(ChannelConfig)` in `ChannelFragment.Builder`, `MessageThreadFragment.Builder`
* Added `setChanneListConfig(ChannelListConfig)` in `ChannelListFragment.Builder`
* Added `setChannelSettingConfig(ChannelSettingConfig)` in `ChannelSettingsFragment.Builder`
* Added `setOpenChannelConfig(OpenChannelConfig)` in `OpenChannelFragment.Builder`
* Deprecated `setUseDefaultUserProfile(boolean)`, `shouldUseDefaultUserProfile()` in `SendbirdUIKit`
* Deprecated `setUseChannelListTypingIndicators(boolean)`, `isUsingChannelListTypingIndicators()` in `SendbirdUIKit`
* Deprecated `setUseChannelListMessageReceiptStatus(boolean)`, `isUsingChannelListMessageReceiptStatus` in `SendbirdUIKit`
* Deprecated `setUseUserMention(boolean)`, `isUsingUserMention()` in `SendbirdUIKit`
* Deprecated `setUseVoiceMessage(boolean)`, `isUsingVoiceMessage()` in `SendbirdUIKit`
* Deprecated `setReplyType(ReplyType)`, `getReplyType()` in `SendbirdUIKit`
* Deprecated `setThreadReplySelectType(ThreadReplySelectType)`, `getThreadReplySelectType()` in `SendbirdUIKit`
* Deprecated `setUseTypingIndicator(boolean)` in `ChannelFragment.Builder`
* Deprecated `ReactionUtils`
* Improved voice recorder
* Improved stability

### v3.5.7 (Jun 9, 2023) with Chat SDK `v4.9.0`
* An interface has been added to modify the data used for the Views displayed in the RecyclerView. Through each Provider, it is possible to change the data of the Views displayed in the RecyclerView.
* Added `setMessageListAdapter(MessageListAdapter, MessageDisplayDataProvider)` in `ChannelFragment.Builder`
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.5.7
UIKIT_VERSION = 3.6.0
UIKIT_VERSION_CODE = 1
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import com.sendbird.uikit.interfaces.UserInfo;
import com.sendbird.uikit.log.Logger;
import com.sendbird.uikit.model.UserMentionConfig;
import com.sendbird.uikit.model.configurations.UIKitConfig;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -113,10 +114,10 @@ public void onInitSucceed() {
// set logger
SendbirdUIKit.setLogLevel(SendbirdUIKit.LogLevel.ALL);
// set whether to use user profile
SendbirdUIKit.setUseDefaultUserProfile(false);
UIKitConfig.getCommon().setEnableUsingDefaultUserProfile(false);
// set reply type
SendbirdUIKit.setReplyType(ReplyType.THREAD);
SendbirdUIKit.setThreadReplySelectType(ThreadReplySelectType.THREAD);
UIKitConfig.getGroupChannelConfig().setReplyType(ReplyType.THREAD);
UIKitConfig.getGroupChannelConfig().setThreadReplySelectType(ThreadReplySelectType.THREAD);
// set custom user list query
SendbirdUIKit.setCustomUserListQueryHandler(getCustomUserListQuery());
initState.setValue(InitState.SUCCEED);
Expand Down Expand Up @@ -167,9 +168,9 @@ public void onBeforeCreateOpenChannel(@NonNull OpenChannelCreateParams params) {
// set custom UIKit fragment factory
SendbirdUIKit.setUIKitFragmentFactory(new CustomFragmentFactory());
// set whether to use user mention
SendbirdUIKit.setUseUserMention(true);
UIKitConfig.getGroupChannelConfig().setEnableMention(true);
// set the voice message
SendbirdUIKit.setUseVoiceMessage(true);
UIKitConfig.getGroupChannelConfig().setEnableVoiceMessage(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 @@ -14,6 +14,8 @@
import com.sendbird.uikit.consts.ThreadReplySelectType;
import com.sendbird.uikit.interfaces.CustomParamsHandler;
import com.sendbird.uikit.interfaces.UserInfo;
import com.sendbird.uikit.log.Logger;
import com.sendbird.uikit.model.configurations.UIKitConfig;
import com.sendbird.uikit_messaging_android.consts.InitState;
import com.sendbird.uikit_messaging_android.consts.StringSet;
import com.sendbird.uikit_messaging_android.fcm.MyFirebaseMessagingService;
Expand All @@ -40,7 +42,17 @@ public void onCreate() {
@Override
@NonNull
public String getAppId() {
return APP_ID;
String appId;
if (com.sendbird.uikit_messaging_android.BuildConfig.DEBUG) {
appId = PreferenceUtils.getAppId();
if (appId.isEmpty()) {
appId = APP_ID;
}
} else {
appId = APP_ID;
}
Logger.d("++ app id : %s", appId);
return appId;
}

@Override
Expand Down Expand Up @@ -102,18 +114,18 @@ public void onInitSucceed() {
// set logger
SendbirdUIKit.setLogLevel(SendbirdUIKit.LogLevel.ALL);
// set whether to use user profile
SendbirdUIKit.setUseDefaultUserProfile(true);
UIKitConfig.getCommon().setEnableUsingDefaultUserProfile(true);
// set whether to use typing indicators in channel list
SendbirdUIKit.setUseChannelListTypingIndicators(true);
UIKitConfig.getGroupChannelListConfig().setEnableTypingIndicator(true);
// set whether to use read/delivery receipt in channel list
SendbirdUIKit.setUseChannelListMessageReceiptStatus(true);
UIKitConfig.getGroupChannelListConfig().setEnableMessageReceiptStatus(true);
// set whether to use user mention
SendbirdUIKit.setUseUserMention(true);
UIKitConfig.getGroupChannelConfig().setEnableMention(true);
// set reply type
SendbirdUIKit.setReplyType(ReplyType.THREAD);
SendbirdUIKit.setThreadReplySelectType(ThreadReplySelectType.THREAD);
UIKitConfig.getGroupChannelConfig().setReplyType(ReplyType.THREAD);
UIKitConfig.getGroupChannelConfig().setThreadReplySelectType(ThreadReplySelectType.THREAD);
// set whether to use voice message
SendbirdUIKit.setUseVoiceMessage(true);
UIKitConfig.getGroupChannelConfig().setEnableVoiceMessage(true);

// set custom params
SendbirdUIKit.setCustomParamsHandler(new CustomParamsHandler() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,25 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
View view = binding.getRoot();
setContentView(view);

if (com.sendbird.uikit_messaging_android.BuildConfig.DEBUG) {
binding.applicationId.setVisibility(View.VISIBLE);
binding.btSave.setVisibility(View.VISIBLE);
if (SendbirdUIKit.getAdapter() != null) {
binding.applicationId.setText(SendbirdUIKit.getAdapter().getAppId());
}
binding.btSave.setOnClickListener(v -> {
final Editable appId = binding.applicationId.getText();
if (!TextUtils.isEmpty(appId)) {
PreferenceUtils.setAppId(appId.toString());
finish();
android.os.Process.killProcess(android.os.Process.myPid());
}
});
} else {
binding.applicationId.setVisibility(View.GONE);
binding.btSave.setVisibility(View.GONE);
}

binding.etUserId.setSelectAllOnFocus(true);
binding.etNickname.setSelectAllOnFocus(true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*/
public class PreferenceUtils {

private static final String PREFERENCE_KEY_APP_ID = "PREFERENCE_KEY_APP_ID";
private static final String PREFERENCE_KEY_USER_ID = "PREFERENCE_KEY_USER_ID";
private static final String PREFERENCE_KEY_NICKNAME = "PREFERENCE_KEY_NICKNAME";
private static final String PREFERENCE_KEY_PROFILE_URL = "PREFERENCE_KEY_PROFILE_URL";
Expand All @@ -32,6 +33,16 @@ private static SharedPreferences getSharedPreferences() {
return context.getSharedPreferences("sendbird", Context.MODE_PRIVATE);
}

public static void setAppId(@NonNull String appId) {
SharedPreferences.Editor editor = getSharedPreferences().edit();
editor.putString(PREFERENCE_KEY_APP_ID, appId).commit();
}

@NonNull
public static String getAppId() {
return getSharedPreferences().getString(PREFERENCE_KEY_APP_ID, "");
}

public static void setUserId(@NonNull String userId) {
SharedPreferences.Editor editor = getSharedPreferences().edit();
editor.putString(PREFERENCE_KEY_USER_ID, userId).apply();
Expand Down
36 changes: 35 additions & 1 deletion uikit-sample/src/main/res/layout/activity_login.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,40 @@
android:text="@string/text_title_login_activity"
/>

<LinearLayout
android:layout_marginTop="@dimen/sb_size_20"
android:orientation="horizontal"
android:gravity="center_horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<androidx.appcompat.widget.AppCompatEditText
android:layout_width="0dp"
android:id="@+id/applicationId"
android:layout_height="@dimen/sb_size_56"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingLeft="@dimen/sb_size_16"
android:paddingRight="@dimen/sb_size_16"
app:boxStrokeColor="@color/primary_300"
android:background="@drawable/selector_edittext_background_with_focusable"
app:hintTextColor="@color/primary_300"
app:boxBackgroundMode="outline"
/>
<Button
android:text="SAVE"
android:id="@+id/btSave"
android:layout_marginLeft="@dimen/sb_size_10"
android:background="@drawable/selector_button_primary_300"
android:textSize="@dimen/sb_text_size_14"
android:fontFamily="sans-serif"
android:textStyle="bold"
android:textColor="@color/ondark_01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>

<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="@dimen/sb_size_56"
Expand Down Expand Up @@ -125,4 +159,4 @@
</LinearLayout>

</ScrollView>
</LinearLayout>
</LinearLayout>
3 changes: 2 additions & 1 deletion uikit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
id 'org.jetbrains.kotlin.android'
id 'kotlinx-serialization'
id 'org.jetbrains.dokka' version "$kotlin_version"
id 'kotlin-parcelize'
}

version = UIKIT_VERSION
Expand Down Expand Up @@ -67,7 +68,7 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

// Sendbird
api 'com.sendbird.sdk:sendbird-chat:4.9.0'
api 'com.sendbird.sdk:sendbird-chat:4.9.1'

implementation 'com.github.bumptech.glide:glide:4.13.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.0'
Expand Down
Loading

0 comments on commit 0f7a665

Please sign in to comment.