@@ -6,6 +6,8 @@ import android.os.Bundle
66import androidx.activity.addCallback
77import androidx.activity.viewModels
88import androidx.appcompat.app.AppCompatActivity
9+ import com.getstream.sdk.chat.view.ChannelHeaderView
10+ import com.getstream.sdk.chat.view.MessageListView
911import com.getstream.sdk.chat.viewmodel.ChannelHeaderViewModel
1012import com.getstream.sdk.chat.viewmodel.MessageInputViewModel
1113import com.getstream.sdk.chat.viewmodel.bindView
@@ -16,9 +18,7 @@ import com.getstream.sdk.chat.viewmodel.messages.MessageListViewModel.Mode.Threa
1618import com.getstream.sdk.chat.viewmodel.messages.MessageListViewModel.State.NavigateUp
1719import com.getstream.sdk.chat.viewmodel.messages.bindView
1820import io.getstream.chat.android.client.models.Channel
19- import kotlinx.android.synthetic.main.activity_channel.channelHeaderView
20- import kotlinx.android.synthetic.main.activity_channel.messageInputView
21- import kotlinx.android.synthetic.main.activity_channel.messageListView
21+
2222
2323class ChannelActivity : AppCompatActivity (R .layout.activity_channel) {
2424
@@ -37,9 +37,11 @@ class ChannelActivity : AppCompatActivity(R.layout.activity_channel) {
3737 // TODO set custom AttachmentViewHolderFactory
3838
3939 // Step 2 - Bind the view and ViewModels, they are loosely coupled so it's easy to customize
40+ val channelHeaderView: ChannelHeaderView = findViewById(R .id.channelHeaderView)
41+ val messageListView: MessageListView = findViewById(R .id.messageListView)
4042 channelHeaderViewModel.bindView(channelHeaderView, this )
4143 messageListViewModel.bindView(messageListView, this )
42- messageInputViewModel.bindView(messageInputView, this )
44+ messageInputViewModel.bindView(findViewById( R .id. messageInputView) , this )
4345
4446 // Step 3 - Let the message input know when we open a thread
4547 messageListViewModel.mode.observe(this ) { mode ->
0 commit comments