This commit is contained in:
@@ -99,30 +99,30 @@ dependencies {
|
||||
implementation 'androidx.navigation:navigation-fragment-ktx:2.7.7'
|
||||
implementation 'androidx.navigation:navigation-ui-ktx:2.7.7'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.8.1'
|
||||
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.1'
|
||||
implementation 'androidx.fragment:fragment-ktx:1.7.1'
|
||||
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.8.4'
|
||||
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.4'
|
||||
implementation 'androidx.fragment:fragment-ktx:1.8.2'
|
||||
implementation 'androidx.preference:preference-ktx:1.2.1'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.3.2'
|
||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.1'
|
||||
implementation 'androidx.compose.material:material-icons-extended:1.6.7'
|
||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.4'
|
||||
implementation 'androidx.compose.material:material-icons-extended:1.6.8'
|
||||
implementation "com.google.accompanist:accompanist-systemuicontroller:0.27.0"
|
||||
implementation 'androidx.activity:activity-compose:1.9.0'
|
||||
implementation "androidx.compose.ui:ui:1.6.7"
|
||||
implementation "androidx.compose.ui:ui-tooling-preview:1.6.7"
|
||||
implementation "androidx.compose.runtime:runtime-livedata:1.6.7"
|
||||
implementation 'androidx.activity:activity-compose:1.9.1'
|
||||
implementation "androidx.compose.ui:ui:1.6.8"
|
||||
implementation "androidx.compose.ui:ui-tooling-preview:1.6.8"
|
||||
implementation "androidx.compose.runtime:runtime-livedata:1.6.8"
|
||||
implementation "androidx.navigation:navigation-compose:2.7.7"
|
||||
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:2.8.1"
|
||||
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:2.8.4"
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
|
||||
implementation "com.google.dagger:hilt-android:2.51.1"
|
||||
androidTestImplementation "androidx.compose.ui:ui-test-junit4:1.6.7"
|
||||
debugImplementation "androidx.compose.ui:ui-tooling:1.6.7"
|
||||
debugImplementation "androidx.compose.ui:ui-test-manifest:1.6.7"
|
||||
androidTestImplementation "androidx.compose.ui:ui-test-junit4:1.6.8"
|
||||
debugImplementation "androidx.compose.ui:ui-tooling:1.6.8"
|
||||
debugImplementation "androidx.compose.ui:ui-test-manifest:1.6.8"
|
||||
kapt "com.google.dagger:hilt-compiler:2.51.1"
|
||||
implementation "androidx.room:room-runtime:2.6.1"
|
||||
annotationProcessor "androidx.room:room-compiler:2.6.1"
|
||||
implementation "androidx.room:room-runtime:2.6.1"
|
||||
ksp "androidx.room:room-compiler:2.6.1"
|
||||
implementation "androidx.room:room-ktx:2.6.1"
|
||||
implementation "androidx.multidex:multidex:2.0.1"
|
||||
|
||||
@@ -8,14 +8,14 @@ import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.appcompat.app.AppCompatDelegate
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.automirrored.outlined.List
|
||||
import androidx.compose.material.icons.automirrored.outlined.Redo
|
||||
import androidx.compose.material.icons.automirrored.outlined.Undo
|
||||
import androidx.compose.material.icons.outlined.Calculate
|
||||
import androidx.compose.material.icons.outlined.Info
|
||||
import androidx.compose.material.icons.outlined.Keyboard
|
||||
import androidx.compose.material.icons.outlined.List
|
||||
import androidx.compose.material.icons.outlined.MoreVert
|
||||
import androidx.compose.material.icons.outlined.Redo
|
||||
import androidx.compose.material.icons.outlined.Settings
|
||||
import androidx.compose.material.icons.outlined.Undo
|
||||
import androidx.compose.material3.DrawerState
|
||||
import androidx.compose.material3.DrawerValue
|
||||
import androidx.compose.material3.FloatingActionButton
|
||||
@@ -166,7 +166,11 @@ class MainActivity : AppCompatActivity() {
|
||||
Icons.Outlined.Calculate,
|
||||
stringResource(R.string.menu_counter)
|
||||
),
|
||||
DrawerItem(Route.HISTORY, Icons.Outlined.List, stringResource(R.string.menu_history)),
|
||||
DrawerItem(
|
||||
Route.HISTORY,
|
||||
Icons.AutoMirrored.Outlined.List,
|
||||
stringResource(R.string.menu_history)
|
||||
),
|
||||
DrawerItem(
|
||||
Route.SETTINGS,
|
||||
Icons.Outlined.Settings,
|
||||
@@ -217,7 +221,7 @@ class MainActivity : AppCompatActivity() {
|
||||
) {
|
||||
|
||||
var topBarState by remember { mutableStateOf(TopBarState()) }
|
||||
var snackbarHostState by remember { mutableStateOf(SnackbarHostState()) }
|
||||
val snackbarHostState by remember { mutableStateOf(SnackbarHostState()) }
|
||||
|
||||
Scaffold(
|
||||
snackbarHost = { SnackbarHost(snackbarHostState) },
|
||||
@@ -236,7 +240,7 @@ class MainActivity : AppCompatActivity() {
|
||||
startDestination = Route.COUNTER.name,
|
||||
modifier = Modifier.padding(paddings)
|
||||
) {
|
||||
this.composable(Route.COUNTER.name.toString()) {
|
||||
this.composable(Route.COUNTER.name) {
|
||||
|
||||
var expanded by remember { mutableStateOf(false) }
|
||||
|
||||
@@ -244,11 +248,11 @@ class MainActivity : AppCompatActivity() {
|
||||
title = stringResource(R.string.app_name),
|
||||
actions = (listOf(
|
||||
TopBarAction(
|
||||
Icons.Outlined.Undo,
|
||||
Icons.AutoMirrored.Outlined.Undo,
|
||||
mainViewModel.isUndoActionActive,
|
||||
{ mainViewModel.undoLastRound() }),
|
||||
TopBarAction(
|
||||
Icons.Outlined.Redo,
|
||||
Icons.AutoMirrored.Outlined.Redo,
|
||||
mainViewModel.isRedoActionActive,
|
||||
{ mainViewModel.redoLastRound() }),
|
||||
TopBarAction(
|
||||
|
||||
@@ -47,7 +47,6 @@ class ReviewService @Inject constructor(@ActivityContext private val appContext:
|
||||
val reviewInfo = task.result
|
||||
manager.launchReviewFlow(appContext as Activity, reviewInfo)
|
||||
|
||||
} else {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,8 +22,7 @@ class GameRepository @Inject constructor(
|
||||
private val roundDao: RoundDao
|
||||
) {
|
||||
|
||||
var activeGame: Game = Game(true, "TeamA", "TeamB", Date(), Date())
|
||||
private set
|
||||
private var activeGame: Game = Game(true, "TeamA", "TeamB", Date(), Date())
|
||||
|
||||
private val newGameFlow = MutableStateFlow(Game())
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import androidx.compose.material3.TextField
|
||||
import androidx.compose.material3.TextFieldColors
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableIntStateOf
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
@@ -26,7 +27,7 @@ import androidx.compose.ui.platform.LocalFocusManager
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.input.ImeAction
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class, ExperimentalComposeUiApi::class)
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun TypeaheadTextField(
|
||||
value: String,
|
||||
@@ -46,7 +47,7 @@ fun TypeaheadTextField(
|
||||
onExpandedChange = {}
|
||||
) {
|
||||
|
||||
var dropDownWidth by remember { mutableStateOf(0) }
|
||||
var dropDownWidth by remember { mutableIntStateOf(0) }
|
||||
|
||||
TextField(
|
||||
value = value,
|
||||
|
||||
@@ -12,6 +12,7 @@ import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableIntStateOf
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
@@ -28,7 +29,7 @@ import me.zobrist.tichucounter.ui.AppTheme
|
||||
@Composable
|
||||
fun Counter(viewModel: ICounterViewModel = PreviewViewModel()) {
|
||||
|
||||
var orientation by remember { mutableStateOf(Configuration.ORIENTATION_PORTRAIT) }
|
||||
var orientation by remember { mutableIntStateOf(Configuration.ORIENTATION_PORTRAIT) }
|
||||
orientation = LocalConfiguration.current.orientation
|
||||
|
||||
if (viewModel.showVictoryDialog) {
|
||||
@@ -122,7 +123,7 @@ fun CounterViewPreview() {
|
||||
}
|
||||
}
|
||||
|
||||
@Preview()
|
||||
@Preview
|
||||
@Composable
|
||||
fun GameVictoryDialog(
|
||||
pointsA: Int = 2000,
|
||||
|
||||
@@ -19,12 +19,12 @@ import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.layout.wrapContentWidth
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.outlined.Backspace
|
||||
import androidx.compose.material.icons.automirrored.outlined.Backspace
|
||||
import androidx.compose.material.icons.outlined.Check
|
||||
import androidx.compose.material.icons.outlined.KeyboardHide
|
||||
import androidx.compose.material.icons.outlined.SwapHoriz
|
||||
import androidx.compose.material3.Divider
|
||||
import androidx.compose.material3.ElevatedButton
|
||||
import androidx.compose.material3.HorizontalDivider
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.IconButton
|
||||
import androidx.compose.material3.LocalTextStyle
|
||||
@@ -198,7 +198,7 @@ fun KeyboardView(
|
||||
deleteButtonPressedState(deletePressed)
|
||||
|
||||
KeyboardIconButton(
|
||||
icon = Icons.Outlined.Backspace,
|
||||
icon = Icons.AutoMirrored.Outlined.Backspace,
|
||||
interactionSource = interactionSource
|
||||
) {}
|
||||
}
|
||||
@@ -330,7 +330,7 @@ fun CenteredTextField(
|
||||
Row {
|
||||
|
||||
Text(text = value, color = cursorColor.copy(alpha = 0f))
|
||||
Divider(
|
||||
HorizontalDivider(
|
||||
modifier = Modifier
|
||||
.padding(start = 3.dp, top = 15.dp, bottom = 15.dp)
|
||||
.width(1.dp)
|
||||
|
||||
@@ -48,7 +48,6 @@ import androidx.compose.ui.Alignment.Companion.CenterVertically
|
||||
import androidx.compose.ui.Alignment.Companion.TopEnd
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.scale
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.platform.LocalDensity
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
@@ -242,12 +241,11 @@ fun DismissibleHistoryListItem(
|
||||
@Composable
|
||||
fun ItemBackground(
|
||||
dismissBoxValue: SwipeToDismissBoxValue
|
||||
)
|
||||
{
|
||||
) {
|
||||
val backgroundColor by animateColorAsState(
|
||||
when (dismissBoxValue) {
|
||||
SwipeToDismissBoxValue.EndToStart -> MaterialTheme.colorScheme.error
|
||||
SwipeToDismissBoxValue.StartToEnd-> MaterialTheme.colorScheme.primary
|
||||
SwipeToDismissBoxValue.StartToEnd -> MaterialTheme.colorScheme.primary
|
||||
else -> MaterialTheme.colorScheme.background
|
||||
|
||||
}, label = ""
|
||||
@@ -276,10 +274,12 @@ fun ItemBackground(
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
modifier = Modifier.align(Alignment.CenterStart)
|
||||
) {
|
||||
Icon(Icons.Outlined.RestartAlt,
|
||||
Icon(
|
||||
Icons.Outlined.RestartAlt,
|
||||
contentDescription = null,
|
||||
tint = textColor,
|
||||
modifier = Modifier.scale(scale),)
|
||||
modifier = Modifier.scale(scale),
|
||||
)
|
||||
Text(text = stringResource(id = R.string.continue_play), color = textColor)
|
||||
}
|
||||
Column(
|
||||
@@ -288,10 +288,12 @@ fun ItemBackground(
|
||||
modifier = Modifier.align(Alignment.CenterEnd)
|
||||
|
||||
) {
|
||||
Icon(Icons.Outlined.Delete,
|
||||
Icon(
|
||||
Icons.Outlined.Delete,
|
||||
contentDescription = null,
|
||||
tint = textColor,
|
||||
modifier = Modifier.scale(scale),)
|
||||
modifier = Modifier.scale(scale),
|
||||
)
|
||||
Text(text = stringResource(id = R.string.delete), color = textColor)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,10 +3,10 @@ package me.zobrist.tichucounter.ui.layout
|
||||
import android.content.res.Configuration
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.automirrored.outlined.List
|
||||
import androidx.compose.material.icons.outlined.Calculate
|
||||
import androidx.compose.material.icons.outlined.List
|
||||
import androidx.compose.material.icons.outlined.Settings
|
||||
import androidx.compose.material3.Divider
|
||||
import androidx.compose.material3.HorizontalDivider
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.ModalDrawerSheet
|
||||
@@ -38,7 +38,7 @@ fun DrawerContent(
|
||||
text = stringResource(R.string.app_name),
|
||||
style = MaterialTheme.typography.headlineSmall
|
||||
)
|
||||
Divider(modifier = Modifier.padding(10.dp))
|
||||
HorizontalDivider(modifier = Modifier.padding(10.dp))
|
||||
|
||||
drawerItems.forEach { screen ->
|
||||
NavigationDrawerItem(
|
||||
@@ -58,7 +58,7 @@ fun DrawerContent(
|
||||
fun DrawerContentPreview() {
|
||||
|
||||
val counter = DrawerItem(Route.COUNTER, Icons.Outlined.Calculate, "Counter")
|
||||
val history = DrawerItem(Route.HISTORY, Icons.Outlined.List, "History")
|
||||
val history = DrawerItem(Route.HISTORY, Icons.AutoMirrored.Outlined.List, "History")
|
||||
val settings = DrawerItem(Route.SETTINGS, Icons.Outlined.Settings, "Settings")
|
||||
AppTheme {
|
||||
Surface {
|
||||
|
||||
@@ -6,7 +6,7 @@ buildscript {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:8.4.1'
|
||||
classpath 'com.android.tools.build:gradle:8.5.2'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
@@ -26,7 +26,3 @@ allprojects {
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register('clean', Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
|
||||
|
||||
Reference in New Issue
Block a user