Skip to content

Commit

Permalink
Merge pull request #17 from sendbird/release/3.9.3
Browse files Browse the repository at this point in the history
3.9.3
  • Loading branch information
sendbird-sdk-deployment authored Oct 26, 2023
2 parents 52ad84d + a5fa5cb commit 54b4a7a
Show file tree
Hide file tree
Showing 32 changed files with 130 additions and 71 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Changelog
### v3.9.3 (Oct 26, 2023) with Chat SDK `v4.13.0`
* Improve stability.

### v3.9.2 (Oct 12, 2023) with Chat SDK `v4.12.3`
* Added `setVoiceRecorderConfig(VoiceRecorderConfig)` and `getVoiceRecorderConfig()` in `SendbirdUIKit`.
* Added `setOnEmojiReactionUserListProfileClickListener(OnItemClickListener<User>)` in `ChannelFragment.Builder` and `MessageThreadFragment.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.9.2
UIKIT_VERSION = 3.9.3
UIKIT_VERSION_CODE = 1
2 changes: 1 addition & 1 deletion uikit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

// Sendbird
api 'com.sendbird.sdk:sendbird-chat:4.12.3'
api 'com.sendbird.sdk:sendbird-chat:4.13.0'

implementation 'com.github.bumptech.glide:glide:4.13.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public static class Builder {
* @param channelUrl the url of the channel will be implemented.
*/
public Builder(@NonNull String channelUrl) {
this(channelUrl, SendbirdUIKit.getDefaultThemeMode());
this(channelUrl, 0);
}

/**
Expand All @@ -294,7 +294,9 @@ public Builder(@NonNull String channelUrl, @NonNull SendbirdUIKit.ThemeMode them
*/
public Builder(@NonNull String channelUrl, @StyleRes int customThemeResId) {
bundle = new Bundle();
bundle.putInt(StringSet.KEY_THEME_RES_ID, customThemeResId);
if (customThemeResId != 0) {
bundle.putInt(StringSet.KEY_THEME_RES_ID, customThemeResId);
}
bundle.putString(StringSet.KEY_CHANNEL_URL, channelUrl);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,21 +436,16 @@ void showConfirmDialog(@NonNull String message) {
}

void showEmojiActionsDialog(@NonNull BaseMessage message, @NonNull DialogListItem[] actions) {
if (getContext() == null) {
return;
}

boolean showMoreButton = false;
List<Emoji> emojiList = EmojiManager.getAllEmojis();

int shownEmojiSize = emojiList.size();
boolean showMoreButton = false;
if (emojiList.size() > 6) {
showMoreButton = true;
shownEmojiSize = 5;
}
emojiList = emojiList.subList(0, shownEmojiSize);

final Context contextThemeWrapper = ContextUtils.extractModuleThemeContext(getContext(), getModule().getParams().getTheme(), R.attr.sb_component_list);
final Context contextThemeWrapper = ContextUtils.extractModuleThemeContext(requireContext(), getModule().getParams().getTheme(), R.attr.sb_component_list);
final EmojiListView emojiListView = EmojiListView.create(contextThemeWrapper, emojiList, message.getReactions(), showMoreButton);
hideKeyboard();
if (actions.length > 0 || emojiList.size() > 0) {
Expand Down Expand Up @@ -502,7 +497,7 @@ private static Map<Reaction, List<User>> getReactionUserInfo(@NonNull GroupChann
return result;
}

private void hideKeyboard() {
void hideKeyboard() {
if (getView() != null) {
SoftInputUtils.hideSoftKeyboard(getView());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import androidx.annotation.StyleRes;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.sendbird.android.channel.GroupChannel;
import com.sendbird.android.channel.Role;
import com.sendbird.android.message.BaseMessage;
Expand Down Expand Up @@ -708,15 +709,16 @@ void showMessageContextMenu(@NonNull View anchorView, @NonNull BaseMessage messa
final DialogListItem[] actions = items.toArray(new DialogListItem[size]);
if (getViewModel().getChannel() != null && !(ChannelConfig.canSendReactions(channelConfig, getViewModel().getChannel()))) {
final RecyclerView messageListView = getModule().getMessageListComponent().getRecyclerView();
if (getContext() == null || messageListView == null || size <= 0) return;
if (getContext() == null || messageListView == null || size == 0) return;
MessageAnchorDialog messageAnchorDialog = new MessageAnchorDialog.Builder(anchorView, messageListView, actions)
.setOnItemClickListener(createMessageActionListener(message))
.setOnDismissListener(() -> anchorDialogShowing.set(false))
.build();
messageAnchorDialog.show();
anchorDialogShowing.set(true);
} else if (MessageUtils.isUnknownType(message)) {
if (getContext() == null || size <= 0) return;
} else if (MessageUtils.isUnknownType(message) || !MessageUtils.isSucceed(message)) {
if (getContext() == null || size == 0) return;
hideKeyboard();
DialogUtils.showListBottomDialog(requireContext(), actions, createMessageActionListener(message));
} else {
showEmojiActionsDialog(message, actions);
Expand Down Expand Up @@ -869,7 +871,7 @@ public static class Builder {
* @param channelUrl the url of the channel will be implemented.
*/
public Builder(@NonNull String channelUrl) {
this(channelUrl, SendbirdUIKit.getDefaultThemeMode());
this(channelUrl, 0);
}

/**
Expand All @@ -890,7 +892,9 @@ public Builder(@NonNull String channelUrl, @NonNull SendbirdUIKit.ThemeMode them
*/
public Builder(@NonNull String channelUrl, @StyleRes int customThemeResId) {
this.bundle = new Bundle();
this.bundle.putInt(StringSet.KEY_THEME_RES_ID, customThemeResId);
if (customThemeResId != 0) {
this.bundle.putInt(StringSet.KEY_THEME_RES_ID, customThemeResId);
}
this.bundle.putString(StringSet.KEY_CHANNEL_URL, channelUrl);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ public static class Builder {
* Constructor
*/
public Builder() {
this(SendbirdUIKit.getDefaultThemeMode());
this(0);
}

/**
Expand All @@ -304,7 +304,9 @@ public Builder(@NonNull SendbirdUIKit.ThemeMode themeMode) {
*/
public Builder(@StyleRes int customThemeResId) {
bundle = new Bundle();
bundle.putInt(StringSet.KEY_THEME_RES_ID, customThemeResId);
if (customThemeResId != 0) {
bundle.putInt(StringSet.KEY_THEME_RES_ID, customThemeResId);
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public static class Builder {
* since 3.0.0
*/
public Builder(@NonNull String channelUrl) {
this(channelUrl, SendbirdUIKit.getDefaultThemeMode());
this(channelUrl, 0);
}

/**
Expand All @@ -209,7 +209,9 @@ public Builder(@NonNull String channelUrl, @NonNull SendbirdUIKit.ThemeMode them
*/
public Builder(@NonNull String channelUrl, @StyleRes int customThemeResId) {
bundle = new Bundle();
bundle.putInt(StringSet.KEY_THEME_RES_ID, customThemeResId);
if (customThemeResId != 0) {
bundle.putInt(StringSet.KEY_THEME_RES_ID, customThemeResId);
}
bundle.putString(StringSet.KEY_CHANNEL_URL, channelUrl);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ public static class Builder {
* @param channelUrl the url of the channel will be implemented.
*/
public Builder(@NonNull String channelUrl) {
this(channelUrl, SendbirdUIKit.getDefaultThemeMode());
this(channelUrl, 0);
}

/**
Expand All @@ -430,7 +430,9 @@ public Builder(@NonNull String channelUrl, @NonNull SendbirdUIKit.ThemeMode them
*/
public Builder(@NonNull String channelUrl, @StyleRes int customThemeResId) {
bundle = new Bundle();
bundle.putInt(StringSet.KEY_THEME_RES_ID, customThemeResId);
if (customThemeResId != 0) {
bundle.putInt(StringSet.KEY_THEME_RES_ID, customThemeResId);
}
bundle.putString(StringSet.KEY_CHANNEL_URL, channelUrl);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ public static class Builder {
* since 3.5.0
*/
public Builder(@NonNull String channelUrl) {
this(channelUrl, SendbirdUIKit.getDefaultThemeMode());
this(channelUrl, 0);
}

/**
Expand All @@ -301,7 +301,9 @@ public Builder(@NonNull String channelUrl, @NonNull SendbirdUIKit.ThemeMode them
*/
public Builder(@NonNull String channelUrl, @StyleRes int customThemeResId) {
bundle = new Bundle();
bundle.putInt(StringSet.KEY_THEME_RES_ID, customThemeResId);
if (customThemeResId != 0) {
bundle.putInt(StringSet.KEY_THEME_RES_ID, customThemeResId);
}
bundle.putString(StringSet.KEY_CHANNEL_URL, channelUrl);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ public static class Builder {
* Constructor
*/
public Builder() {
this(SendbirdUIKit.getDefaultThemeMode());
this(0);
}

/**
Expand Down Expand Up @@ -305,7 +305,9 @@ public Builder(@StyleRes int customThemeResId) {
*/
public Builder(@StyleRes int customThemeResId, @NonNull CreatableChannelType type) {
bundle = new Bundle();
bundle.putInt(StringSet.KEY_THEME_RES_ID, customThemeResId);
if (customThemeResId != 0) {
bundle.putInt(StringSet.KEY_THEME_RES_ID, customThemeResId);
}
bundle.putSerializable(StringSet.KEY_SELECTED_CHANNEL_TYPE, type);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ public static class Builder {
* since 3.2.0
*/
public Builder() {
this(SendbirdUIKit.getDefaultThemeMode());
this(0);
}

/**
Expand All @@ -344,7 +344,9 @@ public Builder(@NonNull SendbirdUIKit.ThemeMode themeMode) {
*/
public Builder(@StyleRes int customThemeResId) {
bundle = new Bundle();
bundle.putInt(StringSet.KEY_THEME_RES_ID, customThemeResId);
if (customThemeResId != 0) {
bundle.putInt(StringSet.KEY_THEME_RES_ID, customThemeResId);
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ public static class Builder {
* since 3.5.0
*/
public Builder(@NonNull String channelUrl) {
this(channelUrl, SendbirdUIKit.getDefaultThemeMode());
this(channelUrl, 0);
}

/**
Expand All @@ -328,7 +328,9 @@ public Builder(@NonNull String channelUrl, @NonNull SendbirdUIKit.ThemeMode them
*/
public Builder(@NonNull String channelUrl, @StyleRes int customThemeResId) {
bundle = new Bundle();
bundle.putInt(StringSet.KEY_THEME_RES_ID, customThemeResId);
if (customThemeResId != 0) {
bundle.putInt(StringSet.KEY_THEME_RES_ID, customThemeResId);
}
bundle.putString(StringSet.KEY_CHANNEL_URL, channelUrl);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public static class Builder {
* @param channelUrl the url of the channel will be implemented.
*/
public Builder(@NonNull String channelUrl) {
this(channelUrl, SendbirdUIKit.getDefaultThemeMode());
this(channelUrl, 0);
}

/**
Expand All @@ -285,7 +285,9 @@ public Builder(@NonNull String channelUrl, @NonNull SendbirdUIKit.ThemeMode them
*/
public Builder(@NonNull String channelUrl, @StyleRes int customThemeResId) {
bundle = new Bundle();
bundle.putInt(StringSet.KEY_THEME_RES_ID, customThemeResId);
if (customThemeResId != 0) {
bundle.putInt(StringSet.KEY_THEME_RES_ID, customThemeResId);
}
bundle.putString(StringSet.KEY_CHANNEL_URL, channelUrl);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ public static class Builder {
* @param channelUrl the url of the channel will be implemented.
*/
public Builder(@NonNull String channelUrl) {
this(channelUrl, SendbirdUIKit.getDefaultThemeMode());
this(channelUrl, 0);
}

/**
Expand All @@ -322,7 +322,9 @@ public Builder(@NonNull String channelUrl, @NonNull SendbirdUIKit.ThemeMode them
*/
public Builder(@NonNull String channelUrl, @StyleRes int customThemeResId) {
bundle = new Bundle();
bundle.putInt(StringSet.KEY_THEME_RES_ID, customThemeResId);
if (customThemeResId != 0) {
bundle.putInt(StringSet.KEY_THEME_RES_ID, customThemeResId);
}
bundle.putString(StringSet.KEY_CHANNEL_URL, channelUrl);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public static class Builder {
* since 2.1.0
*/
public Builder(@NonNull String channelUrl) {
this(channelUrl, SendbirdUIKit.getDefaultThemeMode());
this(channelUrl, 0);
}

/**
Expand All @@ -294,7 +294,9 @@ public Builder(@NonNull String channelUrl, @NonNull SendbirdUIKit.ThemeMode them
*/
public Builder(@NonNull String channelUrl, @StyleRes int customThemeResId) {
bundle = new Bundle();
bundle.putInt(StringSet.KEY_THEME_RES_ID, customThemeResId);
if (customThemeResId != 0) {
bundle.putInt(StringSet.KEY_THEME_RES_ID, customThemeResId);
}
bundle.putString(StringSet.KEY_CHANNEL_URL, channelUrl);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -514,10 +514,12 @@ protected boolean onMessageContextMenuItemClicked(@NonNull BaseMessage message,
void showMessageContextMenu(@NonNull View anchorView, @NonNull BaseMessage message, @NonNull List<DialogListItem> items) {
int size = items.size();
final DialogListItem[] actions = items.toArray(new DialogListItem[size]);
if (!(getViewModel().getChannel() != null &&
ChannelConfig.canSendReactions(channelConfig, getViewModel().getChannel())) ||
MessageUtils.isUnknownType(message)) {
if (getContext() == null || size <= 0) return;
if (!(getViewModel().getChannel() != null && ChannelConfig.canSendReactions(channelConfig, getViewModel().getChannel())) ||
MessageUtils.isUnknownType(message) ||
!MessageUtils.isSucceed(message)
) {
if (getContext() == null || size == 0) return;
hideKeyboard();
DialogUtils.showListBottomDialog(requireContext(), actions, createMessageActionListener(message));
} else {
showEmojiActionsDialog(message, actions);
Expand Down Expand Up @@ -625,7 +627,7 @@ public static class Builder {
* since 3.3.0
*/
public Builder(@NonNull String channelUrl, @NonNull BaseMessage parentMessage) {
this(channelUrl, parentMessage, SendbirdUIKit.getDefaultThemeMode());
this(channelUrl, parentMessage, 0);
}

/**
Expand All @@ -650,7 +652,9 @@ public Builder(@NonNull String channelUrl, @NonNull BaseMessage parentMessage, @
*/
public Builder(@NonNull String channelUrl, @NonNull BaseMessage parentMessage, @StyleRes int customThemeResId) {
this.bundle = new Bundle();
this.bundle.putInt(StringSet.KEY_THEME_RES_ID, customThemeResId);
if (customThemeResId != 0) {
this.bundle.putInt(StringSet.KEY_THEME_RES_ID, customThemeResId);
}
this.bundle.putString(StringSet.KEY_CHANNEL_URL, channelUrl);
this.bundle.putByteArray(StringSet.KEY_PARENT_MESSAGE, parentMessage.serialize());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public static class Builder {
* since 1.2.0
*/
public Builder(@NonNull String channelUrl) {
this(channelUrl, SendbirdUIKit.getDefaultThemeMode());
this(channelUrl, 0);
}

/**
Expand All @@ -248,7 +248,9 @@ public Builder(@NonNull String channelUrl, @NonNull SendbirdUIKit.ThemeMode them
*/
public Builder(@NonNull String channelUrl, @StyleRes int customThemeResId) {
bundle = new Bundle();
bundle.putInt(StringSet.KEY_THEME_RES_ID, customThemeResId);
if (customThemeResId != 0) {
bundle.putInt(StringSet.KEY_THEME_RES_ID, customThemeResId);
}
bundle.putString(StringSet.KEY_CHANNEL_URL, channelUrl);
}

Expand Down
Loading

0 comments on commit 54b4a7a

Please sign in to comment.