Skip to content

Commit e7ed65a

Browse files
authored
Merge pull request #76 from joreilly/cleanup
remove redundant code
2 parents 38e5efc + 86b79b3 commit e7ed65a

File tree

2 files changed

+1
-55
lines changed

2 files changed

+1
-55
lines changed

composeApp/src/androidMain/kotlin/dev/johnoreilly/climatetrace/MainActivity.kt

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,12 @@ package dev.johnoreilly.climatetrace
55
import android.os.Bundle
66
import androidx.activity.ComponentActivity
77
import androidx.activity.compose.setContent
8-
import androidx.compose.foundation.layout.Column
9-
import androidx.compose.foundation.layout.padding
10-
import androidx.compose.material3.CenterAlignedTopAppBar
118
import androidx.compose.material3.ExperimentalMaterial3Api
129
import androidx.compose.material3.MaterialTheme
13-
import androidx.compose.material3.Scaffold
14-
import androidx.compose.material3.Text
1510
import androidx.compose.runtime.Composable
16-
import androidx.compose.runtime.collectAsState
17-
import androidx.compose.runtime.getValue
18-
import androidx.compose.ui.Modifier
19-
import cafe.adriel.voyager.core.screen.Screen
20-
import cafe.adriel.voyager.navigator.LocalNavigator
2111
import cafe.adriel.voyager.navigator.Navigator
22-
import cafe.adriel.voyager.navigator.currentOrThrow
2312
import dev.johnoreilly.climatetrace.di.initKoin
24-
import dev.johnoreilly.climatetrace.ui.CountryEmissionsScreen
25-
import dev.johnoreilly.climatetrace.ui.CountryListView
26-
import dev.johnoreilly.climatetrace.viewmodel.ClimateTraceViewModel
27-
import org.koin.compose.koinInject
13+
import dev.johnoreilly.climatetrace.ui.CountryListScreen
2814

2915
class MainActivity : ComponentActivity() {
3016

@@ -45,35 +31,3 @@ class MainActivity : ComponentActivity() {
4531
fun AndroidApp() {
4632
Navigator(screen = CountryListScreen())
4733
}
48-
49-
50-
class CountryListScreen : Screen {
51-
@Composable
52-
override fun Content() {
53-
val navigator = LocalNavigator.currentOrThrow
54-
55-
val viewModel = koinInject<ClimateTraceViewModel>()
56-
val countryList = viewModel.countryList.collectAsState()
57-
val selectedCountry = viewModel.selectedCountry.collectAsState()
58-
val isLoadingCountries by viewModel.isLoadingCountries.collectAsState()
59-
60-
Scaffold(
61-
topBar = {
62-
CenterAlignedTopAppBar(title = {
63-
Text("ClimateTraceKMP")
64-
})
65-
}
66-
) {
67-
Column(Modifier.padding(it)) {
68-
CountryListView(
69-
countryList.value,
70-
selectedCountry.value,
71-
isLoadingCountries
72-
) { country ->
73-
navigator.push(CountryEmissionsScreen(country))
74-
}
75-
}
76-
}
77-
}
78-
}
79-

local.properties

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)