Skip to content

Commit e56bac9

Browse files
committed
Added 3.0.0-beta.2
1 parent 6aaaa85 commit e56bac9

File tree

85 files changed

+3398
-418
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+3398
-418
lines changed

CHANGELOG.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,29 @@
11
# Change Log
22

3+
### v3.0.0-beta.2 (Apr 29, 2022) with Core SDK `v3.1.12`
4+
* Supported user mention in `GroupChannel`.
5+
* Now you can send mentioning text to the other users in `GroupChannel`. These following functions are available.
6+
* Added `setUseMention(boolean)`, `setUserMentionConfig(UserMentionConfig)`, `getUserMentionConfig()` and `isUsingMention()` in `SendbirdUIKit`.
7+
* Added `setSuggestedMentionListAdapter(SuggestedMentionListAdapter)` in `ChannelFragment.Builder`.
8+
* Added `setMentionUIConfig(TextUIConfig, TextUIConfig)` in `ChannelFragment.Builder`.
9+
* Added `setEditedTextMarkUIConfig(TextUIConfig, TextUIConfig)` in `ChannelFragment.Builder`.
10+
* Added `setSearchedTextUIConfig(TextUIConfig)` in `ChannelFragment.Builder`.
11+
* Added `setMentionUIConfig(TextUIConfig, TextUIConfig)` in `MessageListComponent.Params`.
12+
* Added `setEditedTextMarkUIConfig(TextUIConfig, TextUIConfig)` in `MessageListComponent.Params`.
13+
* Added `setSearchedTextUIConfig(TextUIConfig)` in `MessageListComponent.Params`.
14+
* Added `setMessageUIConfig(MessageUIConfig)` and `getMessageUIConfig()` in `MessageListAdapter`.
15+
* Added `setMessageUIConfig(MessageUIConfig)` in `MessageViewHolder`.
16+
* Added `bindUserMention(UserMentionConfig, OnMentionEventListener)` in `MessageInputComponent`.
17+
* Added `setSuggestedMentionListAdapter(SuggestedMentionListAdapter)` in `MessageInputComponent`.
18+
* Added `setUseSuggestedMentionListDivider(boolean)` in `MessageInputComponent`.
19+
* Added `notifySuggestedMentionDataChanged(List<User>)` in `MessageInputComponent`.
20+
* Added `getMentionSuggestion()` in `ChannelViewModel`.
21+
* Added `loadMemberList(String)` in `ChannelViewModel`.
22+
323
### v3.0.0-beta (Apr 12, 2022) with Core SDK `v3.1.10`
4-
- Support `modules` and `components` in the UIKit
5-
- See more details and breaking changes. [[details](/changelogs/BREAKINGCHANGES_V3.md)]
6-
- See the Migration Guide for Converting V2 to V3. [[details](/changelogs/MIGRATIONGUIDE_V3.md)]
24+
* Support `modules` and `components` in the UIKit
25+
* See more details and breaking changes. [[details](/changelogs/BREAKINGCHANGES_V3.md)]
26+
* See the Migration Guide for Converting V2 to V3. [[details](/changelogs/MIGRATIONGUIDE_V3.md)]
727

828
### Up to v2.x
929
[Change log](/changelogs/CHANGELOG_V2.md)

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ org.gradle.jvmargs=-Xmx1536m
1717
android.useAndroidX=true
1818
android.enablerD8=true
1919

20-
UIKIT_VERSION = 3.0.0-beta
20+
UIKIT_VERSION = 3.0.0-beta.2
2121
UIKIT_VERSION_CODE = 1

uikit-custom-sample/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ android {
3636
dependencies {
3737
implementation fileTree(dir: "libs", include: ["*.jar"])
3838
// implementation project(":uikit")
39-
implementation "com.sendbird.sdk:uikit:3.0.0-beta"
39+
implementation "com.sendbird.sdk:uikit:3.0.0-beta.2"
4040

4141
implementation "androidx.multidex:multidex:2.0.1"
4242
implementation 'com.google.firebase:firebase-messaging:21.0.0'

uikit-custom-sample/src/main/java/com/sendbird/uikit/customsample/BaseApplication.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import com.sendbird.uikit.interfaces.CustomUserListQueryHandler;
2727
import com.sendbird.uikit.interfaces.OnListResultHandler;
2828
import com.sendbird.uikit.interfaces.UserInfo;
29+
import com.sendbird.uikit.model.UserMentionConfig;
2930

3031
import java.util.ArrayList;
3132
import java.util.List;
@@ -135,6 +136,11 @@ public void onBeforeUpdateOpenChannel(@NonNull OpenChannelParams openChannelPara
135136

136137
SendbirdUIKit.setCustomUserListQueryHandler(getCustomUserListQuery());
137138
SendbirdUIKit.setUIKitFragmentFactory(new CustomFragmentFactory());
139+
SendbirdUIKit.setUseUserMention(true);
140+
SendbirdUIKit.setMentionConfig(new UserMentionConfig.Builder()
141+
.setMaxMentionCount(5)
142+
.setMaxSuggestionCount(10)
143+
.build());
138144
}
139145

140146
@NonNull
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
package com.sendbird.uikit.customsample.groupchannel.components.adapters;
2+
3+
import static androidx.recyclerview.widget.RecyclerView.NO_POSITION;
4+
5+
import android.view.LayoutInflater;
6+
import android.view.View;
7+
import android.view.ViewGroup;
8+
import android.widget.TextView;
9+
10+
import androidx.annotation.NonNull;
11+
import androidx.annotation.Nullable;
12+
13+
import com.sendbird.android.User;
14+
import com.sendbird.uikit.activities.adapter.SuggestedMentionListAdapter;
15+
import com.sendbird.uikit.activities.viewholder.BaseViewHolder;
16+
import com.sendbird.uikit.customsample.R;
17+
import com.sendbird.uikit.interfaces.OnItemClickListener;
18+
19+
public class CustomSuggestedMentionListAdapter extends SuggestedMentionListAdapter {
20+
@Nullable
21+
private OnItemClickListener<User> itemClickListener;
22+
23+
@NonNull
24+
@Override
25+
public BaseViewHolder<User> onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
26+
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_custom_suggested_mention_holder, parent, false);
27+
return new SuggestedMentionViewHolder(view);
28+
}
29+
30+
@Override
31+
public void setOnItemClickListener(@Nullable OnItemClickListener<User> listener) {
32+
this.itemClickListener = listener;
33+
}
34+
35+
private class SuggestedMentionViewHolder extends BaseViewHolder<User> {
36+
private final TextView nickname;
37+
38+
/**
39+
* Constructor
40+
*
41+
* @param itemView View to be displayed.
42+
*/
43+
public SuggestedMentionViewHolder(@NonNull View itemView) {
44+
super(itemView);
45+
nickname = itemView.findViewById(R.id.tvNickname);
46+
47+
itemView.setOnClickListener(v -> {
48+
int userPosition = getAdapterPosition();
49+
50+
if (userPosition != NO_POSITION) {
51+
final User user = getItem(userPosition);
52+
if (itemClickListener != null) {
53+
itemClickListener.onItemClick(v, userPosition, user);
54+
}
55+
}
56+
});
57+
}
58+
59+
@Override
60+
public void bind(@NonNull User user) {
61+
nickname.setText(user.getNickname());
62+
}
63+
}
64+
}

uikit-custom-sample/src/main/java/com/sendbird/uikit/customsample/groupchannel/fragments/CustomChannelFragment.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import com.sendbird.uikit.customsample.groupchannel.components.CustomChannelHeaderComponent;
1515
import com.sendbird.uikit.customsample.groupchannel.components.CustomMessageInputComponent;
1616
import com.sendbird.uikit.customsample.groupchannel.components.adapters.CustomMessageListAdapter;
17+
import com.sendbird.uikit.customsample.groupchannel.components.adapters.CustomSuggestedMentionListAdapter;
1718
import com.sendbird.uikit.customsample.groupchannel.viewmodels.CustomChannelViewModel;
1819
import com.sendbird.uikit.customsample.groupchannel.viewmodels.ViewModelFactory;
1920
import com.sendbird.uikit.customsample.models.CustomMessageType;
@@ -92,6 +93,8 @@ protected void onBindMessageInputComponent(@NonNull MessageInputComponent inputC
9293
customInput.requestInputMode(MessageInputView.Mode.DEFAULT);
9394
customMessageType = CustomMessageType.NONE;
9495
});
96+
customInput.setUseSuggestedMentionListDivider(false);
97+
customInput.setSuggestedMentionListAdapter(new CustomSuggestedMentionListAdapter());
9598
}
9699
}
97100

uikit-custom-sample/src/main/res/layout/view_custom_channel_input.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
app:layout_constraintBottom_toTopOf="@id/menuPanel"
2121
/>
2222

23-
<androidx.appcompat.widget.AppCompatEditText
23+
<com.sendbird.uikit.widgets.MentionEditText
2424
android:id="@+id/input"
2525
android:layout_width="0dp"
2626
android:layout_height="@dimen/sb_size_56"
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<androidx.constraintlayout.widget.ConstraintLayout
3+
xmlns:android="http://schemas.android.com/apk/res/android"
4+
xmlns:app="http://schemas.android.com/apk/res-auto"
5+
android:layout_width="match_parent"
6+
android:layout_height="wrap_content"
7+
android:background="@drawable/selector_list_background_light"
8+
android:paddingLeft="@dimen/sb_size_16"
9+
android:paddingTop="@dimen/sb_size_10"
10+
android:paddingRight="@dimen/sb_size_16"
11+
android:paddingBottom="@dimen/sb_size_10">
12+
13+
<androidx.appcompat.widget.AppCompatTextView
14+
android:id="@+id/tvNickname"
15+
android:layout_width="0dp"
16+
android:layout_height="wrap_content"
17+
android:layout_marginLeft="@dimen/sb_size_16"
18+
android:layout_marginRight="@dimen/sb_size_16"
19+
android:textAppearance="@style/SendbirdSubtitle1OnLight01"
20+
app:layout_constraintLeft_toLeftOf="parent"
21+
app:layout_constraintTop_toTopOf="parent"
22+
app:layout_constraintBottom_toBottomOf="parent" />
23+
24+
</androidx.constraintlayout.widget.ConstraintLayout>

uikit-custom-sample/src/main/res/values/styles_custom.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@
5656
<!-- COMPONENTS -->
5757
<style name="Component.Custom"/>
5858
<style name="Component.Custom.List">
59-
<item name="sb_pager_recycler_view_background">@color/background_50</item>
60-
<item name="sb_pager_recycler_view_divide_line_color">@color/onlight_04</item>
61-
<item name="sb_pager_recycler_view_divide_line_height">@dimen/sb_size_1</item>
62-
<item name="sb_pager_recycler_view_divide_margin_left">0dp</item>
63-
<item name="sb_pager_recycler_view_divide_margin_right">0dp</item>
59+
<item name="sb_recycler_view_background">@color/background_50</item>
60+
<item name="sb_recycler_view_divide_line_color">@color/onlight_04</item>
61+
<item name="sb_recycler_view_divide_line_height">@dimen/sb_size_1</item>
62+
<item name="sb_recycler_view_divide_margin_left">0dp</item>
63+
<item name="sb_recycler_view_divide_margin_right">0dp</item>
6464
</style>
6565
<style name="Component.Custom.Header">
6666
<item name="sb_appbar_background">@color/primary_300</item>
@@ -166,8 +166,8 @@
166166
<style name="Widget.Sendbird.Custom.Message">
167167
<item name="sb_message_time_text_appearance">@style/SendbirdCaption4OnLight03</item>
168168
<item name="sb_message_sender_name_text_appearance">@style/SendbirdCaption1OnLight02</item>
169-
<item name="sb_message_highlight_background_color">@color/highlight</item>
170-
<item name="sb_message_highlight_foreground_color">@color/background_600</item>
169+
<item name="sb_message_searched_text_appearance">@style/SendbirdSearchedMessage</item>
170+
<item name="sb_message_searched_text_background">@color/highlight</item>
171171
</style>
172172

173173
<style name="Widget.Sendbird.Custom.Message.Timeline">
@@ -188,8 +188,8 @@
188188
<item name="sb_message_time_text_appearance">@style/SendbirdCaption4OnLight03</item>
189189
<item name="sb_message_sender_name_text_appearance">@style/SendbirdCaption1OnLight02</item>
190190
<item name="sb_message_operator_name_text_appearance">@style/SendbirdCaption1Secondary300</item>
191-
<item name="sb_message_highlight_background_color">@color/highlight</item>
192-
<item name="sb_message_highlight_foreground_color">@color/background_600</item>
191+
<item name="sb_message_searched_text_appearance">@style/SendbirdSearchedMessage</item>
192+
<item name="sb_message_searched_text_background">@color/highlight</item>
193193
</style>
194194
<style name="Widget.Sendbird.Custom.OpenChannel.Message.User">
195195
<item name="sb_message_background">@drawable/selector_rectangle_light</item>

uikit-sample/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ dependencies {
3434
implementation fileTree(dir: 'libs', include: ['*.jar'])
3535

3636
// implementation project(":uikit")
37-
implementation "com.sendbird.sdk:uikit:3.0.0-beta"
37+
implementation "com.sendbird.sdk:uikit:3.0.0-beta.2"
3838

3939
implementation "androidx.multidex:multidex:2.0.1"
4040
implementation 'com.google.firebase:firebase-messaging:21.0.0'

0 commit comments

Comments
 (0)