Skip to content

Commit 25b3078

Browse files
committed
- update Compose SDK Dependency, remove non-compose material dependency, switch from using AppCompatActivity to ComponentActivity and switch from using an AppCompat theme to a MaterialComponents one
1 parent 43cd969 commit 25b3078

File tree

8 files changed

+14
-16
lines changed

8 files changed

+14
-16
lines changed

app/build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,11 @@ android {
4747
}
4848

4949
dependencies {
50-
implementation "io.getstream:stream-chat-android-compose:5.0.1"
50+
implementation "io.getstream:stream-chat-android-compose:5.0.3"
5151

5252
implementation "androidx.compose.material:material-icons-extended:$compose_version"
5353
implementation "androidx.compose.ui:ui:$compose_version"
5454
implementation "androidx.compose.material:material:$compose_version"
5555
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
5656
implementation "androidx.activity:activity-compose:1.4.0"
57-
58-
implementation "com.google.android.material:material:1.5.0"
5957
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.example.chattutorial
22

33
import android.os.Bundle
4+
import androidx.activity.ComponentActivity
45
import androidx.activity.compose.setContent
5-
import androidx.appcompat.app.AppCompatActivity
66
import androidx.compose.ui.res.stringResource
77
import io.getstream.chat.android.client.ChatClient
88
import io.getstream.chat.android.client.logger.ChatLogLevel
@@ -13,7 +13,7 @@ import io.getstream.chat.android.offline.model.message.attachments.UploadAttachm
1313
import io.getstream.chat.android.offline.plugin.configuration.Config
1414
import io.getstream.chat.android.offline.plugin.factory.StreamOfflinePluginFactory
1515

16-
class MainActivity : AppCompatActivity() {
16+
class MainActivity : ComponentActivity() {
1717

1818
override fun onCreate(savedInstanceState: Bundle?) {
1919
super.onCreate(savedInstanceState)

app/src/main/java/com/example/chattutorial/MessagesActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ package com.example.chattutorial
33
import android.content.Context
44
import android.content.Intent
55
import android.os.Bundle
6+
import androidx.activity.ComponentActivity
67
import androidx.activity.compose.setContent
7-
import androidx.appcompat.app.AppCompatActivity
88
import io.getstream.chat.android.compose.ui.messages.MessagesScreen
99
import io.getstream.chat.android.compose.ui.theme.ChatTheme
1010

11-
class MessagesActivity : AppCompatActivity() {
11+
class MessagesActivity : ComponentActivity() {
1212

1313
override fun onCreate(savedInstanceState: Bundle?) {
1414
super.onCreate(savedInstanceState)

app/src/main/java/com/example/chattutorial/MessagesActivity2.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ package com.example.chattutorial
33
import android.content.Context
44
import android.content.Intent
55
import android.os.Bundle
6+
import androidx.activity.ComponentActivity
67
import androidx.activity.compose.setContent
7-
import androidx.appcompat.app.AppCompatActivity
88
import androidx.compose.foundation.shape.RoundedCornerShape
99
import androidx.compose.ui.graphics.RectangleShape
1010
import androidx.compose.ui.unit.dp
1111
import io.getstream.chat.android.compose.ui.messages.MessagesScreen
1212
import io.getstream.chat.android.compose.ui.theme.ChatTheme
1313
import io.getstream.chat.android.compose.ui.theme.StreamShapes
1414

15-
class MessagesActivity2 : AppCompatActivity() {
15+
class MessagesActivity2 : ComponentActivity() {
1616

1717
override fun onCreate(savedInstanceState: Bundle?) {
1818
super.onCreate(savedInstanceState)

app/src/main/java/com/example/chattutorial/MessagesActivity3.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ package com.example.chattutorial
33
import android.content.Context
44
import android.content.Intent
55
import android.os.Bundle
6+
import androidx.activity.ComponentActivity
67
import androidx.activity.compose.setContent
78
import androidx.activity.viewModels
8-
import androidx.appcompat.app.AppCompatActivity
99
import androidx.compose.foundation.background
1010
import androidx.compose.foundation.layout.Box
1111
import androidx.compose.foundation.layout.fillMaxSize
@@ -37,7 +37,7 @@ import io.getstream.chat.android.compose.viewmodel.messages.MessageComposerViewM
3737
import io.getstream.chat.android.compose.viewmodel.messages.MessageListViewModel
3838
import io.getstream.chat.android.compose.viewmodel.messages.MessagesViewModelFactory
3939

40-
class MessagesActivity3 : AppCompatActivity() {
40+
class MessagesActivity3 : ComponentActivity() {
4141

4242
// Build the ViewModel factory
4343
private val factory by lazy {

app/src/main/java/com/example/chattutorial/MessagesActivity4.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ package com.example.chattutorial
33
import android.content.Context
44
import android.content.Intent
55
import android.os.Bundle
6+
import androidx.activity.ComponentActivity
67
import androidx.activity.compose.setContent
78
import androidx.activity.viewModels
8-
import androidx.appcompat.app.AppCompatActivity
99
import androidx.compose.foundation.background
1010
import androidx.compose.foundation.layout.Box
1111
import androidx.compose.foundation.layout.Row
@@ -46,7 +46,7 @@ import io.getstream.chat.android.compose.viewmodel.messages.MessageComposerViewM
4646
import io.getstream.chat.android.compose.viewmodel.messages.MessageListViewModel
4747
import io.getstream.chat.android.compose.viewmodel.messages.MessagesViewModelFactory
4848

49-
class MessagesActivity4 : AppCompatActivity() {
49+
class MessagesActivity4 : ComponentActivity() {
5050

5151
// Build the ViewModel factory
5252
private val factory by lazy {

app/src/main/res/values/themes.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<item name="windowNoTitle">true</item>
2020
</style>
2121

22-
<style name="Theme.ChatTutorial.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
22+
<style name="Theme.ChatTutorial.AppBarOverlay" parent="ThemeOverlay.MaterialComponents.Dark.ActionBar" />
2323

24-
<style name="Theme.ChatTutorial.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
24+
<style name="Theme.ChatTutorial.PopupOverlay" parent="ThemeOverlay.MaterialComponents.Light" />
2525
</resources>

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
mavenCentral()
88
}
99
dependencies {
10-
classpath "com.android.tools.build:gradle:7.1.2"
10+
classpath "com.android.tools.build:gradle:7.1.3"
1111
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10'
1212
}
1313
}

0 commit comments

Comments
 (0)