File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
src/main/java/com/example/reply/ui Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ plugins {
2121
2222android {
2323 namespace " com.example.reply"
24- compileSdkVersion 34
24+ compileSdk 34
2525 defaultConfig {
2626 applicationId ' com.example.reply'
2727 minSdkVersion 21
@@ -117,6 +117,7 @@ dependencies {
117117 implementation ' androidx.core:core-ktx:1.12.0'
118118 implementation " androidx.activity:activity-compose:1.8.1"
119119
120+ implementation " androidx.lifecycle:lifecycle-runtime-compose:2.6.2"
120121 implementation " androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2"
121122 implementation " androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.2"
122123 implementation " androidx.lifecycle:lifecycle-livedata-ktx:2.6.2"
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import androidx.compose.runtime.collectAsState
2727import androidx.compose.runtime.getValue
2828import androidx.compose.ui.tooling.preview.Preview
2929import androidx.compose.ui.unit.dp
30+ import androidx.lifecycle.compose.collectAsStateWithLifecycle
3031import com.example.reply.data.LocalEmailsDataProvider
3132import com.example.reply.ui.theme.AppTheme
3233
@@ -38,7 +39,7 @@ class MainActivity : ComponentActivity() {
3839
3940 setContent {
4041
41- val uiState by viewModel.uiState.collectAsState ()
42+ val uiState by viewModel.uiState.collectAsStateWithLifecycle ()
4243
4344 AppTheme {
4445 Surface (tonalElevation = 5 .dp) {
You can’t perform that action at this time.
0 commit comments