Skip to content

Commit a4ba435

Browse files
committed
update typing examples
1 parent f958156 commit a4ba435

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
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"
37+
implementation "io.getstream:stream-chat-android:4.4.5"
3838
implementation "io.coil-kt:coil:1.0.0"
3939

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

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,12 @@ public void handleOnBackPressed() {
117117
ChannelController channelController = result.data();
118118

119119
// Observe typing users
120-
channelController.getTyping().observe(this, users -> {
121-
if (users.isEmpty()) {
120+
channelController.getTyping().observe(this, typingState -> {
121+
if (typingState.getUsers().isEmpty()) {
122122
typingHeaderView.setText(nobodyTyping);
123123
} else {
124124
List<String> userNames = new LinkedList<>();
125-
for (User user : users) {
125+
for (User user : typingState.getUsers()) {
126126
userNames.add((String) user.getExtraData().get("name"));
127127
}
128128
String typing = "typing: " + TextUtils.join(", ", userNames);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ class ChannelActivity3 : AppCompatActivity() {
8585
if (channelControllerResult.isSuccess) {
8686

8787
// Observe typing users
88-
channelControllerResult.data().typing.observe(this) { users ->
88+
channelControllerResult.data().typing.observe(this) { typingState ->
8989
binding.typingHeaderView.text = when {
90-
users.isNotEmpty() -> users.joinToString(prefix = "typing: ") { user -> user.name }
90+
typingState.users.isNotEmpty() -> typingState.users.joinToString(prefix = "typing: ") { user -> user.name }
9191
else -> nobodyTyping
9292
}
9393
}

0 commit comments

Comments
 (0)