File tree Expand file tree Collapse file tree 4 files changed +13
-17
lines changed
src/main/java/com/example/chattutorialjava
src/main/java/com/example/chattutorial Expand file tree Collapse file tree 4 files changed +13
-17
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ android {
3434
3535dependencies {
3636 implementation " org.jetbrains.kotlin:kotlin-stdlib:1.4.10"
37- implementation " com.github.getstream:stream-chat-android:1ab9aa8ae2bde84d5e7a61b767b32dd0c33d05e6 "
37+ implementation " com.github.getstream:stream-chat-android:4.4.1 "
3838 implementation " io.coil-kt:coil:1.0.0"
3939
4040 implementation " androidx.lifecycle:lifecycle-viewmodel:2.3.0-beta01"
Original file line number Diff line number Diff line change @@ -116,20 +116,18 @@ public void handleOnBackPressed() {
116116 ChatDomain .instance ().getUseCases ().getGetChannelController ().invoke (cid ).enqueue ((result ) -> {
117117 ChannelController channelController = result .data ();
118118
119- runOnUiThread (() -> {
120- // Observe typing users
121- channelController .getTyping ().observe (this , users -> {
122- if (users .isEmpty ()) {
123- typingHeaderView .setText (nobodyTyping );
124- } else {
125- List <String > userNames = new LinkedList <>();
126- for (User user : users ) {
127- userNames .add ((String )user .getExtraData ().get ("name" ));
128- }
129- String typing = "typing: " + TextUtils .join (", " , userNames );
130- typingHeaderView .setText (typing );
119+ // Observe typing users
120+ channelController .getTyping ().observe (this , users -> {
121+ if (users .isEmpty ()) {
122+ typingHeaderView .setText (nobodyTyping );
123+ } else {
124+ List <String > userNames = new LinkedList <>();
125+ for (User user : users ) {
126+ userNames .add ((String ) user .getExtraData ().get ("name" ));
131127 }
132- });
128+ String typing = "typing: " + TextUtils .join (", " , userNames );
129+ typingHeaderView .setText (typing );
130+ }
133131 });
134132 return Unit .INSTANCE ;
135133 });
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ android {
4040
4141dependencies {
4242 implementation " org.jetbrains.kotlin:kotlin-stdlib:1.4.10"
43- implementation " com.github.getstream:stream-chat-android:1ab9aa8ae2bde84d5e7a61b767b32dd0c33d05e6 "
43+ implementation " com.github.getstream:stream-chat-android:4.4.1 "
4444 implementation " io.coil-kt:coil:1.0.0"
4545
4646 implementation " androidx.lifecycle:lifecycle-viewmodel:2.3.0-beta01"
Original file line number Diff line number Diff line change @@ -17,11 +17,9 @@ import com.getstream.sdk.chat.viewmodel.messages.MessageListViewModel.Mode.Threa
1717import com.getstream.sdk.chat.viewmodel.messages.MessageListViewModel.State.NavigateUp
1818import com.getstream.sdk.chat.viewmodel.messages.bindView
1919import io.getstream.chat.android.client.ChatClient
20- import io.getstream.chat.android.client.controllers.subscribeFor
2120import io.getstream.chat.android.client.events.TypingStartEvent
2221import io.getstream.chat.android.client.events.TypingStopEvent
2322import io.getstream.chat.android.client.models.Channel
24- import io.getstream.chat.android.client.models.name
2523
2624class ChannelActivity4 : AppCompatActivity () {
2725
You can’t perform that action at this time.
0 commit comments