Skip to content

Commit db279bc

Browse files
Merge pull request #152 from myofficework000/mvi_design
Small fix
2 parents 79554b4 + 64598da commit db279bc

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ dependencies {
103103
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
104104
implementation 'com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.11'
105105
//Moshi
106+
implementation 'com.squareup.moshi:moshi-kotlin:1.15.0'
106107
implementation "com.squareup.retrofit2:converter-moshi:2.9.0"
107108

108109
//Convertor factory by Gson

app/src/main/java/com/example/jetpack_compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/data/remote/WeatherDto.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.example.jetpack_compose_all_in_one.android_architectures.clean_code_with_mvi_mvvm.data.remote
22

3-
import com.example.jetpack_compose_all_in_one.android_architectures.clean_code_with_mvi_mvvm.data.remote.WeatherDataDto
43
import com.squareup.moshi.Json
54

65
data class WeatherDto(

app/src/main/java/com/example/jetpack_compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/presentation/WeatherScreen.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,32 @@ import androidx.compose.foundation.layout.Spacer
77
import androidx.compose.foundation.layout.fillMaxSize
88
import androidx.compose.foundation.layout.height
99
import androidx.compose.material.CircularProgressIndicator
10+
import androidx.compose.material3.Text
1011
import androidx.compose.runtime.Composable
1112
import androidx.compose.ui.Alignment
1213
import androidx.compose.ui.Modifier
1314
import androidx.compose.ui.graphics.Color
1415
import androidx.compose.ui.text.style.TextAlign
1516
import androidx.compose.ui.unit.dp
17+
import com.example.jetpack_compose_all_in_one.ui.theme.Blue10
18+
import com.example.jetpack_compose_all_in_one.ui.theme.L1BoxColor2
1619

1720

1821
@Composable
19-
fun WeatherScreen() {
22+
fun WeatherScreen(
23+
viewModel: WeatherViewModel
24+
) {
2025
Box(
2126
modifier = Modifier.fillMaxSize()
2227
) {
2328
Column(
2429
modifier = Modifier
2530
.fillMaxSize()
26-
.background(DarkBlue)
31+
.background(Blue10)
2732
) {
2833
WeatherCard(
2934
state = viewModel.state,
30-
backgroundColor = DeepBlue
35+
backgroundColor = L1BoxColor2
3136
)
3237
Spacer(modifier = Modifier.height(16.dp))
3338
WeatherForecast(state = viewModel.state)

app/src/main/java/com/example/jetpack_compose_all_in_one/ui/components/MainContainerOfApp.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import androidx.navigation.compose.rememberNavController
2323
import com.example.jetpack_compose_all_in_one.*
2424
import com.example.jetpack_compose_all_in_one.R
2525
import com.example.jetpack_compose_all_in_one.android_architectures.clean_code.presentation.ui.DogApiMainPage
26+
import com.example.jetpack_compose_all_in_one.android_architectures.clean_code_with_mvi_mvvm.presentation.WeatherScreen
2627
import com.example.jetpack_compose_all_in_one.android_architectures.mvi.view.RandomDogView
2728
import com.example.jetpack_compose_all_in_one.android_architectures.mvp.view.DogMvpUI
2829
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
5253
import com.example.jetpack_compose_all_in_one.features.weather_sample.model.remote.ApiWeatherService
5354
import com.example.jetpack_compose_all_in_one.features.weather_sample.model.remote.RetrofitBuilder
5455
import com.example.jetpack_compose_all_in_one.features.weather_sample.model.repository.RemoteWeatherRepository
56+
import com.example.jetpack_compose_all_in_one.features.weather_sample.view.WeatherSample
5557
import com.example.jetpack_compose_all_in_one.features.weather_sample.viewmodel.WeatherViewModel
5658
import com.example.jetpack_compose_all_in_one.lessons.lesson_1.Lesson_1_Display
5759
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_
7678
import com.example.jetpack_compose_all_in_one.lessons.lesson_8.Lesson_8_Animations
7779
import com.example.jetpack_compose_all_in_one.lessons.lesson_9.Lesson_9
7880
import com.example.jetpack_compose_all_in_one.third_party_lib.chat_gpt.view.ChatUI
79-
import com.example.jetpack_compose_all_in_one.third_party_lib.chat_gpt.viewmodel.ChatGPTViewModel
8081
import com.example.jetpack_compose_all_in_one.third_party_lib.stripe.IntegrateStripe
8182
import com.example.jetpack_compose_all_in_one.ui.views.chat.DemoFullChat2
8283
import com.example.jetpack_compose_all_in_one.ui.views.domain_search.DomainSearch
@@ -451,7 +452,7 @@ fun MainContainerOfApp(
451452
}
452453

453454
composable(NavDes.CleanCodeWithMVI.route()) {
454-
DogApiMainPage()
455+
WeatherScreen(viewModel = hiltViewModel())
455456
}
456457

457458
composable(NavDes.SharedPrefDemo.route()){

0 commit comments

Comments
 (0)