File tree Expand file tree Collapse file tree 5 files changed +16
-18
lines changed
src/main/java/com/example/chattutorial Expand file tree Collapse file tree 5 files changed +16
-18
lines changed Original file line number Diff line number Diff line change 1-
1+ // Top-level build file where you can add configuration options common to all sub-projects/modules.
22buildscript {
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:$k otlin_version "
1111 }
1212}
1313
1414allprojects {
1515 repositories {
16- mavenLocal()
1716 google()
1817 jcenter()
18+ // add jitpack here:
1919 maven { url ' https://jitpack.io' }
2020 }
2121}
2222
2323task clean (type : Delete ) {
2424 delete rootProject. buildDir
25- }
25+ }
Original file line number Diff line number Diff line change @@ -37,11 +37,11 @@ android {
3737
3838dependencies {
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}
Original file line number Diff line number Diff 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 )
Original file line number Diff line number Diff 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 ->
Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments