diff --git a/app/build.gradle b/app/build.gradle index 0b8eeb55..af762fcb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -103,6 +103,7 @@ dependencies { implementation 'com.squareup.retrofit2:retrofit:2.9.0' implementation 'com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.11' //Moshi + implementation 'com.squareup.moshi:moshi-kotlin:1.15.0' implementation "com.squareup.retrofit2:converter-moshi:2.9.0" //Convertor factory by Gson diff --git a/app/src/main/java/com/example/jetpack_compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/data/remote/WeatherDto.kt b/app/src/main/java/com/example/jetpack_compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/data/remote/WeatherDto.kt index 71dc4686..0eccd227 100644 --- a/app/src/main/java/com/example/jetpack_compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/data/remote/WeatherDto.kt +++ b/app/src/main/java/com/example/jetpack_compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/data/remote/WeatherDto.kt @@ -1,6 +1,5 @@ package com.example.jetpack_compose_all_in_one.android_architectures.clean_code_with_mvi_mvvm.data.remote -import com.example.jetpack_compose_all_in_one.android_architectures.clean_code_with_mvi_mvvm.data.remote.WeatherDataDto import com.squareup.moshi.Json data class WeatherDto( diff --git a/app/src/main/java/com/example/jetpack_compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/presentation/WeatherScreen.kt b/app/src/main/java/com/example/jetpack_compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/presentation/WeatherScreen.kt index f5791d1e..5565a2d8 100644 --- a/app/src/main/java/com/example/jetpack_compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/presentation/WeatherScreen.kt +++ b/app/src/main/java/com/example/jetpack_compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/presentation/WeatherScreen.kt @@ -7,27 +7,32 @@ import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.height import androidx.compose.material.CircularProgressIndicator +import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp +import com.example.jetpack_compose_all_in_one.ui.theme.Blue10 +import com.example.jetpack_compose_all_in_one.ui.theme.L1BoxColor2 @Composable -fun WeatherScreen() { +fun WeatherScreen( + viewModel: WeatherViewModel +) { Box( modifier = Modifier.fillMaxSize() ) { Column( modifier = Modifier .fillMaxSize() - .background(DarkBlue) + .background(Blue10) ) { WeatherCard( state = viewModel.state, - backgroundColor = DeepBlue + backgroundColor = L1BoxColor2 ) Spacer(modifier = Modifier.height(16.dp)) WeatherForecast(state = viewModel.state) diff --git a/app/src/main/java/com/example/jetpack_compose_all_in_one/ui/components/MainContainerOfApp.kt b/app/src/main/java/com/example/jetpack_compose_all_in_one/ui/components/MainContainerOfApp.kt index 32ca7671..71720999 100644 --- a/app/src/main/java/com/example/jetpack_compose_all_in_one/ui/components/MainContainerOfApp.kt +++ b/app/src/main/java/com/example/jetpack_compose_all_in_one/ui/components/MainContainerOfApp.kt @@ -23,6 +23,7 @@ import androidx.navigation.compose.rememberNavController import com.example.jetpack_compose_all_in_one.* import com.example.jetpack_compose_all_in_one.R import com.example.jetpack_compose_all_in_one.android_architectures.clean_code.presentation.ui.DogApiMainPage +import com.example.jetpack_compose_all_in_one.android_architectures.clean_code_with_mvi_mvvm.presentation.WeatherScreen import com.example.jetpack_compose_all_in_one.android_architectures.mvi.view.RandomDogView import com.example.jetpack_compose_all_in_one.android_architectures.mvp.view.DogMvpUI import com.example.jetpack_compose_all_in_one.application_components.activity.ActivityDemo @@ -52,6 +53,7 @@ import com.example.jetpack_compose_all_in_one.features.timer_demo.TimerDemo import com.example.jetpack_compose_all_in_one.features.weather_sample.model.remote.ApiWeatherService import com.example.jetpack_compose_all_in_one.features.weather_sample.model.remote.RetrofitBuilder import com.example.jetpack_compose_all_in_one.features.weather_sample.model.repository.RemoteWeatherRepository +import com.example.jetpack_compose_all_in_one.features.weather_sample.view.WeatherSample import com.example.jetpack_compose_all_in_one.features.weather_sample.viewmodel.WeatherViewModel import com.example.jetpack_compose_all_in_one.lessons.lesson_1.Lesson_1_Display import com.example.jetpack_compose_all_in_one.lessons.lesson_10.Lesson_10 @@ -76,7 +78,6 @@ import com.example.jetpack_compose_all_in_one.lessons.lesson_7.Lesson_7_Chapter_ import com.example.jetpack_compose_all_in_one.lessons.lesson_8.Lesson_8_Animations import com.example.jetpack_compose_all_in_one.lessons.lesson_9.Lesson_9 import com.example.jetpack_compose_all_in_one.third_party_lib.chat_gpt.view.ChatUI -import com.example.jetpack_compose_all_in_one.third_party_lib.chat_gpt.viewmodel.ChatGPTViewModel import com.example.jetpack_compose_all_in_one.third_party_lib.stripe.IntegrateStripe import com.example.jetpack_compose_all_in_one.ui.views.chat.DemoFullChat2 import com.example.jetpack_compose_all_in_one.ui.views.domain_search.DomainSearch @@ -451,7 +452,7 @@ fun MainContainerOfApp( } composable(NavDes.CleanCodeWithMVI.route()) { - DogApiMainPage() + WeatherScreen(viewModel = hiltViewModel()) } composable(NavDes.SharedPrefDemo.route()){