Update to Sdk34
This commit is contained in:
@@ -24,12 +24,12 @@ versionProperties.load(new FileInputStream(versionPropertiesFile))
|
||||
|
||||
|
||||
android {
|
||||
compileSdk 33
|
||||
compileSdk 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId "me.zobrist.tichucounter"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 33
|
||||
targetSdkVersion 34
|
||||
versionCode versionProperties["versionCode"].toInteger()
|
||||
versionName "${versionMajor}.${versionMinor}.${versionProperties["versionCode"].toInteger()}"
|
||||
resourceConfigurations += ['de', 'en']
|
||||
@@ -95,37 +95,37 @@ dependencies {
|
||||
implementation 'com.google.android.play:core-ktx:1.8.1'
|
||||
implementation 'com.google.code.gson:gson:2.9.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
implementation 'androidx.navigation:navigation-fragment-ktx:2.5.3'
|
||||
implementation 'androidx.navigation:navigation-ui-ktx:2.5.3'
|
||||
implementation 'androidx.navigation:navigation-fragment-ktx:2.7.1'
|
||||
implementation 'androidx.navigation:navigation-ui-ktx:2.7.1'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.1'
|
||||
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1'
|
||||
implementation 'androidx.fragment:fragment-ktx:1.5.7'
|
||||
implementation 'androidx.preference:preference-ktx:1.2.0'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.3.0'
|
||||
implementation 'androidx.fragment:fragment-ktx:1.6.1'
|
||||
implementation 'androidx.preference:preference-ktx:1.2.1'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.3.1'
|
||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1'
|
||||
implementation 'androidx.compose.material:material-icons-extended:1.4.3'
|
||||
implementation 'androidx.compose.material:material-icons-extended:1.5.0'
|
||||
implementation "com.google.accompanist:accompanist-systemuicontroller:0.27.0"
|
||||
implementation 'androidx.activity:activity-compose:1.7.2'
|
||||
implementation "androidx.compose.ui:ui:1.4.3"
|
||||
implementation "androidx.compose.ui:ui-tooling-preview:1.4.3"
|
||||
implementation "androidx.compose.runtime:runtime-livedata:1.4.3"
|
||||
implementation "androidx.navigation:navigation-compose:2.5.3"
|
||||
implementation "androidx.compose.ui:ui:1.5.0"
|
||||
implementation "androidx.compose.ui:ui-tooling-preview:1.5.0"
|
||||
implementation "androidx.compose.runtime:runtime-livedata:1.5.0"
|
||||
implementation "androidx.navigation:navigation-compose:2.7.1"
|
||||
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1"
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
||||
implementation "com.google.dagger:hilt-android:2.44"
|
||||
androidTestImplementation "androidx.compose.ui:ui-test-junit4:1.4.3"
|
||||
debugImplementation "androidx.compose.ui:ui-tooling:1.4.3"
|
||||
debugImplementation "androidx.compose.ui:ui-test-manifest:1.4.3"
|
||||
androidTestImplementation "androidx.compose.ui:ui-test-junit4:1.5.0"
|
||||
debugImplementation "androidx.compose.ui:ui-tooling:1.5.0"
|
||||
debugImplementation "androidx.compose.ui:ui-test-manifest:1.5.0"
|
||||
kapt "com.google.dagger:hilt-compiler:2.44"
|
||||
implementation "androidx.room:room-runtime:2.5.1"
|
||||
annotationProcessor "androidx.room:room-compiler:2.5.1"
|
||||
kapt "androidx.room:room-compiler:2.5.1"
|
||||
implementation "androidx.room:room-ktx:2.5.1"
|
||||
implementation "androidx.room:room-runtime:2.5.2"
|
||||
annotationProcessor "androidx.room:room-compiler:2.5.2"
|
||||
kapt "androidx.room:room-compiler:2.5.2"
|
||||
implementation "androidx.room:room-ktx:2.5.2"
|
||||
implementation "androidx.multidex:multidex:2.0.1"
|
||||
api "androidx.navigation:navigation-fragment-ktx:2.5.3"
|
||||
api "androidx.navigation:navigation-fragment-ktx:2.7.1"
|
||||
}
|
||||
|
||||
// Allow references to generated code
|
||||
|
||||
@@ -36,6 +36,7 @@ import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.navigation.NavHostController
|
||||
import androidx.navigation.compose.NavHost
|
||||
import androidx.navigation.compose.composable
|
||||
import androidx.navigation.compose.currentBackStackEntryAsState
|
||||
import androidx.navigation.compose.rememberNavController
|
||||
import com.google.accompanist.systemuicontroller.rememberSystemUiController
|
||||
@@ -51,7 +52,6 @@ import me.zobrist.tichucounter.domain.SettingsAdapter
|
||||
import me.zobrist.tichucounter.domain.Theme
|
||||
import me.zobrist.tichucounter.domain.TopBarAction
|
||||
import me.zobrist.tichucounter.domain.TopBarState
|
||||
import me.zobrist.tichucounter.domain.composable
|
||||
import me.zobrist.tichucounter.domain.navigate
|
||||
import me.zobrist.tichucounter.ui.AppTheme
|
||||
import me.zobrist.tichucounter.ui.MainViewModel
|
||||
@@ -202,7 +202,7 @@ class MainActivity : AppCompatActivity(), ISettingsChangeListener {
|
||||
startDestination = Route.COUNTER.name,
|
||||
modifier = Modifier.padding(paddings)
|
||||
) {
|
||||
composable(Route.COUNTER) {
|
||||
composable(Route.COUNTER.name) {
|
||||
|
||||
var expanded by remember { mutableStateOf(false) }
|
||||
|
||||
@@ -246,7 +246,7 @@ class MainActivity : AppCompatActivity(), ISettingsChangeListener {
|
||||
|
||||
Counter(counterViewModel)
|
||||
}
|
||||
composable(Route.HISTORY) {
|
||||
composable(Route.HISTORY.name) {
|
||||
topBarState =
|
||||
TopBarState(title = stringResource(R.string.menu_history)) { scope.launch { drawerState.open() } }
|
||||
|
||||
@@ -255,14 +255,14 @@ class MainActivity : AppCompatActivity(), ISettingsChangeListener {
|
||||
snackbarHostState
|
||||
) { navController.navigate(Route.COUNTER) }
|
||||
}
|
||||
composable(Route.SETTINGS) {
|
||||
composable(Route.SETTINGS.name) {
|
||||
topBarState =
|
||||
TopBarState(title = stringResource(R.string.menu_settings)) { scope.launch { drawerState.open() } }
|
||||
|
||||
SettingsView(settingsViewModel)
|
||||
}
|
||||
|
||||
composable(Route.ABOUT) {
|
||||
composable(Route.ABOUT.name) {
|
||||
topBarState =
|
||||
TopBarState(title = stringResource(R.string.menu_about)) { scope.launch { drawerState.open() } }
|
||||
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
package me.zobrist.tichucounter.domain
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.navigation.NamedNavArgument
|
||||
import androidx.navigation.NavBackStackEntry
|
||||
import androidx.navigation.NavController
|
||||
import androidx.navigation.NavDeepLink
|
||||
import androidx.navigation.NavGraphBuilder
|
||||
import androidx.navigation.compose.composable
|
||||
|
||||
fun NavController.navigate(route: Route) {
|
||||
this.navigate(route.name) {
|
||||
@@ -23,12 +17,3 @@ fun NavController.navigate(route: Route) {
|
||||
restoreState = true
|
||||
}
|
||||
}
|
||||
|
||||
fun NavGraphBuilder.composable(
|
||||
route: Route,
|
||||
arguments: List<NamedNavArgument> = emptyList(),
|
||||
deepLinks: List<NavDeepLink> = emptyList(),
|
||||
content: @Composable (NavBackStackEntry) -> Unit
|
||||
) {
|
||||
this.composable(route.name, arguments, deepLinks, content)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package me.zobrist.tichucounter.ui.counter
|
||||
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableIntStateOf
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.focus.FocusRequester
|
||||
@@ -71,10 +72,10 @@ class CounterViewModel @Inject constructor(
|
||||
override var roundScoreList by mutableStateOf(emptyList<Round>())
|
||||
private set
|
||||
|
||||
override var totalScoreA by mutableStateOf(0)
|
||||
override var totalScoreA by mutableIntStateOf(0)
|
||||
private set
|
||||
|
||||
override var totalScoreB by mutableStateOf(0)
|
||||
override var totalScoreB by mutableIntStateOf(0)
|
||||
private set
|
||||
|
||||
override var teamNameA by mutableStateOf("")
|
||||
|
||||
@@ -10,12 +10,9 @@ import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.aspectRatio
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.requiredHeight
|
||||
import androidx.compose.foundation.layout.requiredWidth
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.LazyListState
|
||||
import androidx.compose.foundation.lazy.items
|
||||
@@ -299,7 +296,7 @@ fun HistoryListItem(
|
||||
Row(
|
||||
Modifier.padding(all = 12.dp)
|
||||
) {
|
||||
Box( modifier = modifier.fillMaxSize()) {
|
||||
Box(modifier = modifier.fillMaxSize()) {
|
||||
Column {
|
||||
Text(
|
||||
text = game.game.nameA + " vs " + game.game.nameB,
|
||||
@@ -321,7 +318,8 @@ fun HistoryListItem(
|
||||
Badge(
|
||||
modifier = Modifier.align(TopEnd),
|
||||
contentColor = MaterialTheme.colorScheme.onPrimary,
|
||||
containerColor = MaterialTheme.colorScheme.primary) {
|
||||
containerColor = MaterialTheme.colorScheme.primary
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.active),
|
||||
style = MaterialTheme.typography.labelSmall
|
||||
@@ -338,7 +336,8 @@ fun HistoryListItem(
|
||||
private fun HistoryListPreview() {
|
||||
val tempData = listOf(
|
||||
GameWithScores(
|
||||
Game(true, "abcsdf sdaf asdf sdf ", "defsadf asdf sadf ", Date(), Date()), listOf(Round(1, 550, 500))
|
||||
Game(true, "abcsdf sdaf asdf sdf ", "defsadf asdf sadf ", Date(), Date()),
|
||||
listOf(Round(1, 550, 500))
|
||||
), GameWithScores(
|
||||
Game(false, "ADTH", "dogfg", Date(), Date()), listOf(Round(2, 20, 60))
|
||||
), GameWithScores(
|
||||
|
||||
Reference in New Issue
Block a user