Skip to content

Commit 3ebab9d

Browse files
committed
use the latest version of our sdk
1 parent af63332 commit 3ebab9d

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

samplejava/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ android {
3434

3535
dependencies {
3636
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.4.10"
37-
implementation "com.github.getstream:stream-chat-android:4.4.1-alpha"
37+
implementation "com.github.getstream:stream-chat-android:1ab9aa8ae2bde84d5e7a61b767b32dd0c33d05e6"
3838
implementation "io.coil-kt:coil:1.0.0"
3939

4040
implementation "androidx.lifecycle:lifecycle-viewmodel:2.3.0-beta1"

samplejava/src/main/java/com/example/chattutorialjava/ChannelActivity.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,19 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
7474
messageInputViewModel.resetThread();
7575
}
7676
});
77+
// Step 4 - Let the message input know when we are editing a message
78+
messageListView.setOnMessageEditHandler(message -> {
79+
messageInputViewModel.getEditMessage().postValue(message);
80+
return Unit.INSTANCE;
81+
});
7782

78-
// Step 4 - Handle navigate up state
83+
// Step 5 - Handle navigate up state
7984
messageListViewModel.getState().observe(this, state -> {
8085
if (state instanceof NavigateUp) {
8186
finish();
8287
}
8388
});
8489

85-
// Step 5 - Let the message input know when we are editing a message
86-
messageListView.setOnMessageEditHandler(message -> {
87-
messageInputViewModel.getEditMessage().postValue(message);
88-
return Unit.INSTANCE;
89-
});
90-
9190
// Step 6 - Handle back button behaviour correctly when you're in a thread
9291
channelHeaderView.setOnBackClick(() -> {
9392
messageListViewModel.onEvent(MessageListViewModel.Event.BackButtonPressed.INSTANCE);

samplejava/src/main/java/com/example/chattutorialjava/MainActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
3939
user.getExtraData().put("name", "Paranoid Android");
4040
user.getExtraData().put("image", "https://bit.ly/2TIt8NR");
4141

42-
ChatClient.instance().setUser(
42+
client.setUser(
4343
user,
4444
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoic3VtbWVyLWJyb29rLTIifQ.CzyOx8kgrc61qVbzWvhV1WD3KPEo5ZFZH-326hIdKz0",
4545
null

samplekotlin/src/main/java/com/example/chattutorial/ChannelActivity4.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ class ChannelActivity4 : AppCompatActivity() {
8686
ChatClient
8787
.instance()
8888
.channel(cid)
89-
.subscribeFor(this, TypingStartEvent::class, TypingStopEvent::class
89+
.subscribeFor(this, TypingStartEvent::class.java, TypingStopEvent::class.java
9090
) { event ->
9191
when (event) {
92-
is TypingStartEvent -> currentlyTyping.add(event.user.name)
93-
is TypingStopEvent -> currentlyTyping.remove(event.user.name)
92+
is TypingStartEvent -> currentlyTyping.add(event.user.extraData["name"] as String)
93+
is TypingStopEvent -> currentlyTyping.remove(event.user.extraData["name"] as String)
9494
}
9595

9696
binding.typingHeader.text = when {

0 commit comments

Comments
 (0)