Skip to content

Commit 00f7b44

Browse files
committed
small tutorial tweaks
1 parent 6f81b3f commit 00f7b44

File tree

5 files changed

+16
-18
lines changed

5 files changed

+16
-18
lines changed

build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
1+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
buildscript {
3+
ext.kotlin_version = "1.4.10"
34
repositories {
45
google()
56
jcenter()
6-
77
}
88
dependencies {
9-
classpath 'com.android.tools.build:gradle:4.1.0'
10-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10"
9+
classpath "com.android.tools.build:gradle:4.1.0"
10+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1111
}
1212
}
1313

1414
allprojects {
1515
repositories {
16-
mavenLocal()
1716
google()
1817
jcenter()
18+
// add jitpack here:
1919
maven { url 'https://jitpack.io' }
2020
}
2121
}
2222

2323
task clean(type: Delete) {
2424
delete rootProject.buildDir
25-
}
25+
}

samplekotlin/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ android {
3737

3838
dependencies {
3939
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.4.10"
40-
implementation "com.github.getstream:stream-chat-android:4.3.1-beta-3"
40+
implementation "com.github.getstream:stream-chat-android:4.4.0"
4141
implementation "io.coil-kt:coil:1.0.0"
4242

4343
implementation "androidx.lifecycle:lifecycle-viewmodel:2.3.0-beta1"
4444
implementation "androidx.appcompat:appcompat:1.2.0"
45-
implementation "androidx.constraintlayout:constraintlayout:2.0.2"
45+
implementation "androidx.constraintlayout:constraintlayout:2.0.3"
4646
implementation 'androidx.activity:activity-ktx:1.1.0'
4747
}

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,18 @@ class ChannelActivity : AppCompatActivity(R.layout.activity_channel) {
4949
}
5050
}
5151

52-
// Step 4 - Handle navigate up state
52+
// Step 4 - Let the message input know when we are editing a message
53+
messageListView.setOnMessageEditHandler {
54+
messageInputViewModel.editMessage.postValue(it)
55+
}
56+
57+
// Step 5 - Handle navigate up state
5358
messageListViewModel.state.observe(this) { state ->
5459
if (state is NavigateUp) {
5560
finish()
5661
}
5762
}
5863

59-
// Step 5 - Let the message input know when we are editing a message
60-
messageListView.setOnMessageEditHandler {
61-
messageInputViewModel.editMessage.postValue(it)
62-
}
63-
6464
// Step 6 - Handle back button behaviour correctly when you're in a thread
6565
channelHeaderView.onBackClick = {
6666
messageListViewModel.onEvent(MessageListViewModel.Event.BackButtonPressed)

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,7 @@ class ChannelActivity3 : AppCompatActivity(R.layout.activity_channel_3) {
7979
typingHeader.text = nobodyTyping
8080

8181
// Obtain a ChannelController
82-
// TODO replace watchChannel with getChannelController
83-
val channelController: ChannelController =
84-
ChatDomain.instance().useCases.watchChannel(cid, 0).execute().data()
82+
val channelController = ChatDomain.instance().useCases.getChannelController(cid).execute().data()
8583

8684
// Observe typing users
8785
channelController.typing.observe(this) { users ->

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class MainActivity : AppCompatActivity(R.layout.activity_main) {
2828
extraData["name"] = "Paranoid Android"
2929
extraData["image"] = "https://bit.ly/2TIt8NR"
3030
}
31-
ChatClient.instance().setUser(
31+
client.setUser(
3232
user = user,
3333
token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoic3VtbWVyLWJyb29rLTIifQ.CzyOx8kgrc61qVbzWvhV1WD3KPEo5ZFZH-326hIdKz0"
3434
)

0 commit comments

Comments
 (0)