Skip to content

Commit

Permalink
Merge pull request #16 from sendbird/release/3.9.2
Browse files Browse the repository at this point in the history
3.9.2
  • Loading branch information
sendbird-sdk-deployment authored Oct 12, 2023
2 parents 53c39e9 + e85de88 commit 52ad84d
Show file tree
Hide file tree
Showing 71 changed files with 2,183 additions and 2,963 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Changelog
### 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`.
* Improved stability.
### v3.9.1 (Sep 26, 2023) with Chat SDK `v4.12.1`
* Fixed a problem with the user mentions feature in ThreadFragment
* Filter deactivated users from the user mentions list.
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.1
UIKIT_VERSION = 3.9.2
UIKIT_VERSION_CODE = 1
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ private void setLeftButton(final boolean isLeftClosed) {

private static class EmojiAdapter extends RecyclerView.Adapter<EmojiAdapter.EmojiViewHolder> {
@NonNull
private final List<Emoji> emojis = EmojiManager.getInstance().getAllEmojis();
private final List<Emoji> emojis = EmojiManager.getAllEmojis();
@Nullable
private OnItemClickListener<String> emojiClickListener;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ import com.sendbird.uikit_messaging_android.databinding.ViewCustomMenuTextButton
import com.sendbird.uikit_messaging_android.utils.DrawableUtils.setTintList
import com.sendbird.uikit_messaging_android.utils.PreferenceUtils
import com.sendbird.uikit_messaging_android.widgets.WaitingDialog
import java.io.File
import java.util.Locale
import java.util.TimeZone
import java.io.File

/**
* Displays a settings screen.
Expand Down Expand Up @@ -376,9 +376,8 @@ class SettingsFragment : Fragment() {
}
updateUserNickname(result)
}
val params =
DialogEditTextParams(getString(com.sendbird.uikit.R.string.sb_text_channel_settings_change_channel_name_hint))
params.setEnableSingleLine(true)
val params = DialogEditTextParams(getString(com.sendbird.uikit.R.string.sb_text_channel_settings_change_channel_name_hint))
params.enableSingleLine = true
DialogUtils.showInputDialog(
requireContext(),
getString(R.string.text_settings_change_user_nickname),
Expand Down
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.1'
api 'com.sendbird.sdk:sendbird-chat:4.12.3'

implementation 'com.github.bumptech.glide:glide:4.13.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.0'
Expand Down
32 changes: 29 additions & 3 deletions uikit/src/main/java/com/sendbird/uikit/SendbirdUIKit.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import com.sendbird.uikit.log.Logger;
import com.sendbird.uikit.model.EmojiManager;
import com.sendbird.uikit.model.UserMentionConfig;
import com.sendbird.uikit.model.VoiceRecorderConfig;
import com.sendbird.uikit.model.configurations.Common;
import com.sendbird.uikit.model.configurations.UIKitConfig;
import com.sendbird.uikit.utils.FileUtils;
Expand Down Expand Up @@ -232,7 +233,10 @@ public ColorStateList getErrorTintColorStateList(@NonNull Context context) {
private static Pair<Integer, Integer> resizingSize = new Pair<>(DEFAULT_RESIZING_WIDTH_SIZE, DEFAULT_RESIZING_HEIGHT_SIZE);
@NonNull
private static UIKitFragmentFactory fragmentFactory = new UIKitFragmentFactory();
@NonNull
private static UserMentionConfig userMentionConfig = new UserMentionConfig.Builder().build();
@NonNull
private static VoiceRecorderConfig voiceRecorderConfig = new VoiceRecorderConfig();

static void clearAll() {
SendbirdUIKit.customUserListQueryHandler = null;
Expand Down Expand Up @@ -316,7 +320,7 @@ public void onInitSucceed() {
FileUtils.removeDeletableDir(context.getApplicationContext());
UIKitPrefs.init(context.getApplicationContext());
NotificationChannelManager.init(context.getApplicationContext());
EmojiManager.getInstance().init();
EmojiManager.init();
}

/**
Expand Down Expand Up @@ -602,7 +606,7 @@ public Pair<User, SendbirdException> call() throws Exception {
final AppInfo appInfo = sendbirdChat.getAppInfo();
if (appInfo != null) {
if (appInfo.getUseReaction()
&& appInfo.needUpdateEmoji(EmojiManager.getInstance().getEmojiHash())
&& appInfo.needUpdateEmoji(EmojiManager.getEmojiHash())
&& connectType == ConnectType.CONNECT) {
updateEmojiList();
}
Expand Down Expand Up @@ -778,7 +782,7 @@ private static void updateEmojiList() {
Logger.e(e);
} else {
if (emojiContainer != null) {
EmojiManager.getInstance().upsertEmojiContainer(emojiContainer);
EmojiManager.upsertEmojiContainer(emojiContainer);
}
}
});
Expand Down Expand Up @@ -875,6 +879,28 @@ public static void setMentionConfig(@NonNull UserMentionConfig config) {
SendbirdUIKit.userMentionConfig = config;
}

/**
* Returns the voice recorder configuration.
*
* @return The configuration applied for the voice recorder
* since 3.9.2
*/
@NonNull
public static VoiceRecorderConfig getVoiceRecorderConfig() {
return voiceRecorderConfig;
}

/**
* Sets the voice recorder configuration.
*
* @param config The configuration to be applied for the voice recorder
* @see VoiceRecorderConfig
* since 3.9.2
*/
public static void setVoiceRecorderConfig(@NonNull VoiceRecorderConfig config) {
SendbirdUIKit.voiceRecorderConfig = config;
}

/**
* @param level set the displaying log level. {@link LogLevel}
* since 1.0.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public void onBindViewHolder(@NonNull BaseViewHolder<Reaction> holder, int posit
*/
@Override
public int getItemCount() {
if (reactionList.size() >= EmojiManager.getInstance().getAllEmojis().size()) {
if (reactionList.size() >= EmojiManager.getAllEmojis().size()) {
return reactionList.size();
} else {
return reactionList.size() + (useMoreButton ? 1 : 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import com.sendbird.android.user.User;
import com.sendbird.uikit.activities.viewholder.BaseViewHolder;
import com.sendbird.uikit.databinding.SbViewEmojiReactionUserBinding;
import com.sendbird.uikit.interfaces.OnItemClickListener;
import com.sendbird.uikit.internal.ui.reactions.EmojiReactionUserView;

import java.util.ArrayList;
import java.util.List;
Expand All @@ -22,6 +24,8 @@
public class EmojiReactionUserListAdapter extends BaseAdapter<User, BaseViewHolder<User>> {
@NonNull
final private List<User> userList;
@Nullable
private OnItemClickListener<User> emojiReactionUserListProfileClickListener;

/**
* Constructor
Expand Down Expand Up @@ -57,7 +61,20 @@ public EmojiReactionUserListAdapter(@NonNull List<User> userList) {
@NonNull
@Override
public BaseViewHolder<User> onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new EmojiReactionUserViewHolder(SbViewEmojiReactionUserBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false));
final EmojiReactionUserViewHolder viewHolder = new EmojiReactionUserViewHolder(SbViewEmojiReactionUserBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false));
if (viewHolder.itemView instanceof EmojiReactionUserView) {
final EmojiReactionUserView view = (EmojiReactionUserView) viewHolder.itemView;
view.setOnProfileClickListener(v -> {
if (emojiReactionUserListProfileClickListener != null) {
final int position = viewHolder.getAbsoluteAdapterPosition();
final User user = getItem(position);
if (user != null) {
emojiReactionUserListProfileClickListener.onItemClick(v, position, user);
}
}
});
}
return viewHolder;
}

/**
Expand Down Expand Up @@ -133,6 +150,10 @@ public void setItems(@NonNull List<User> userList) {
diffResult.dispatchUpdatesTo(this);
}

public void setOnEmojiReactionUserListProfileClickListener(@Nullable OnItemClickListener<User> emojiReactionUserListProfileClickListener) {
this.emojiReactionUserListProfileClickListener = emojiReactionUserListProfileClickListener;
}


private static class EmojiReactionUserViewHolder extends BaseViewHolder<User> {
private final SbViewEmojiReactionUserBinding binding;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,36 @@
package com.sendbird.uikit.consts;
package com.sendbird.uikit.consts

/**
* Identifier to determine which area was clicked when {@code MessageViewHolder} was clicked
* Identifier to determine which area was clicked when `MessageViewHolder` was clicked
*/
public enum ClickableViewIdentifier {
enum class ClickableViewIdentifier {
/**
* Main message area
*/
Chat,

/**
* Sender's profile area
*/
Profile,

/**
* Quoted message area
*/
QuoteReply,

/**
* Thread information area
*
* since 3.3.0
* @since 3.3.0
*/
ThreadInfo,

/**
* Parent message info menu area
* This is only used in parent message info view
*
* since 3.3.0
* @since 3.3.0
*/
ParentMessageMenu
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
package com.sendbird.uikit.consts;
package com.sendbird.uikit.consts

/**
* The creatable channel type in the UIKit
*
* since 1.2.0
* @since 1.2.0
*/
public enum CreatableChannelType {
enum class CreatableChannelType {
/**
* Normal group channel type
*/
Normal,

/**
* Super group channel type
*/
Super,

/**
* Broadcast channel type
*/
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.sendbird.uikit.consts

import android.text.TextUtils.TruncateAt

open class DialogEditTextParams private constructor(
var hintText: String? = null,
var enableSingleLine: Boolean = false,
var ellipsis: TruncateAt? = null,
var selection: Int = 0,
var text: String? = null,
) {
constructor(hintText: String) : this(hintText = hintText, false, null, 0, null)
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
package com.sendbird.uikit.consts;
package com.sendbird.uikit.consts

/**
* The keyboard display types.
* A Plane type is a default display type.
* A dialog type is a display type that is contained in a dialog box and displayed separately.
* since 2.0.0
* @since 2.0.0
*/
public enum KeyboardDisplayType {
enum class KeyboardDisplayType {
/**
* Shows the keyboard within the same screen.
*/
Plane,

/**
* Shows the keyboard above the dialog.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package com.sendbird.uikit.consts;
package com.sendbird.uikit.consts

/**
* Enum class that indicates the load status of the message.
*/
public enum MessageLoadState {
enum class MessageLoadState {
/**
* Indicates that the loading of messages has started.
*/
LOAD_STARTED,

/**
* Indicates that the loading of messages has ended.
*/
Expand Down
Loading

0 comments on commit 52ad84d

Please sign in to comment.