diff --git a/app/build.gradle.kts b/app/build.gradle.kts index a281a7c..5d8e895 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -11,8 +11,8 @@ android { applicationId = "com.hyperling.tictactoe" minSdk = 21 targetSdk = 34 - versionCode = 1 - versionName = "1.0" + versionCode = 2 + versionName = "1.0.1" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { diff --git a/app/src/main/java/com/hyperling/tictactoe/MainActivity.kt b/app/src/main/java/com/hyperling/tictactoe/MainActivity.kt index 16f30ad..448339c 100644 --- a/app/src/main/java/com/hyperling/tictactoe/MainActivity.kt +++ b/app/src/main/java/com/hyperling/tictactoe/MainActivity.kt @@ -194,8 +194,8 @@ fun Game() { Column( horizontalAlignment = Alignment.CenterHorizontally , verticalArrangement = Arrangement.Center - , modifier = Modifier - .fillMaxSize() + //, modifier = Modifier + // .fillMaxSize() ) { Spacer(modifier = Modifier.weight(0.1f)) @@ -346,95 +346,112 @@ fun Game() { fontSize = 16.sp ) Spacer(modifier = Modifier.size(5.dp)) - Row ( + + Row( verticalAlignment = Alignment.CenterVertically, - modifier = Modifier.clickable { - opponentHuman = setRadiosFalse() + horizontalArrangement = Arrangement.SpaceEvenly + ) { + Column ( + horizontalAlignment = Alignment.Start, + verticalArrangement = Arrangement.Top + ) { + Row ( + verticalAlignment = Alignment.CenterVertically, + modifier = Modifier.clickable { + opponentHuman = setRadiosFalse() + } + ){ + RadioButton( + selected = opponentHuman, + onClick = { opponentHuman = setRadiosFalse() }, + ) + Text( + text = stringResource(id = R.string.opponent_human), + fontSize = 16.sp + ) + } + Row ( + verticalAlignment = Alignment.CenterVertically, + modifier = Modifier.clickable { + opponentHard = setRadiosFalse() + } + ){ + RadioButton( + selected = opponentHard, + onClick = { opponentHard = setRadiosFalse() }, + ) + Text( + text = stringResource(id = R.string.opponent_hard), + fontSize = 16.sp + ) + } + Row ( + verticalAlignment = Alignment.CenterVertically, + modifier = Modifier.clickable { + opponentAnnoying = setRadiosFalse() + } + ){ + RadioButton( + selected = opponentAnnoying, + onClick = { opponentAnnoying = setRadiosFalse() }, + ) + Text( + text = stringResource(id = R.string.opponent_annoying), + fontSize = 16.sp + ) + } } - ){ - RadioButton( - selected = opponentHuman, - onClick = { opponentHuman = setRadiosFalse() }, - ) - Text( - text = stringResource(id = R.string.opponent_human), - fontSize = 16.sp - ) - } - Row ( - verticalAlignment = Alignment.CenterVertically, - modifier = Modifier.clickable { - opponentRandom = setRadiosFalse() + + Column ( + horizontalAlignment = Alignment.Start, + verticalArrangement = Arrangement.Bottom + ) { + Row ( + verticalAlignment = Alignment.CenterVertically, + modifier = Modifier.clickable { + opponentRandom = setRadiosFalse() + } + ){ + RadioButton( + selected = opponentRandom, + onClick = { opponentRandom = setRadiosFalse() }, + ) + Text( + text = stringResource(id = R.string.opponent_random), + fontSize = 16.sp + ) + } + Row ( + verticalAlignment = Alignment.CenterVertically, + modifier = Modifier.clickable { + opponentEasy = setRadiosFalse() + } + ){ + RadioButton( + selected = opponentEasy, + onClick = { opponentEasy = setRadiosFalse() }, + ) + Text( + text = stringResource(id = R.string.opponent_easy), + fontSize = 16.sp + ) + } + Row ( + verticalAlignment = Alignment.CenterVertically, + modifier = Modifier.clickable { + opponentShy = setRadiosFalse() + } + ){ + RadioButton( + selected = opponentShy, + onClick = { opponentShy = setRadiosFalse() }, + ) + Text( + text = stringResource(id = R.string.opponent_shy), + fontSize = 16.sp + ) + } } - ){ - RadioButton( - selected = opponentRandom, - onClick = { opponentRandom = setRadiosFalse() }, - ) - Text( - text = stringResource(id = R.string.opponent_random), - fontSize = 16.sp - ) - } - Row ( - verticalAlignment = Alignment.CenterVertically, - modifier = Modifier.clickable { - opponentHard = setRadiosFalse() - } - ){ - RadioButton( - selected = opponentHard, - onClick = { opponentHard = setRadiosFalse() }, - ) - Text( - text = stringResource(id = R.string.opponent_hard), - fontSize = 16.sp - ) - } - Row ( - verticalAlignment = Alignment.CenterVertically, - modifier = Modifier.clickable { - opponentEasy = setRadiosFalse() - } - ){ - RadioButton( - selected = opponentEasy, - onClick = { opponentEasy = setRadiosFalse() }, - ) - Text( - text = stringResource(id = R.string.opponent_easy), - fontSize = 16.sp - ) - } - Row ( - verticalAlignment = Alignment.CenterVertically, - modifier = Modifier.clickable { - opponentAnnoying = setRadiosFalse() - } - ){ - RadioButton( - selected = opponentAnnoying, - onClick = { opponentAnnoying = setRadiosFalse() }, - ) - Text( - text = stringResource(id = R.string.opponent_annoying), - fontSize = 16.sp - ) - } - Row ( - verticalAlignment = Alignment.CenterVertically, - modifier = Modifier.clickable { - opponentShy = setRadiosFalse() - } - ){ - RadioButton( - selected = opponentShy, - onClick = { opponentShy = setRadiosFalse() }, - ) - Text( - text = stringResource(id = R.string.opponent_shy), - fontSize = 16.sp - ) } } Spacer(modifier = Modifier.weight(.05f)) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 64640c2..c2a2871 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -2,12 +2,12 @@ Tic-Tac-Toe Choose your opponent: - Human - Someone next to you. - AI : Random - Fills any open spot. - AI : Hard - Your typical try-hard. - AI : Easy - Opportunist, may try to win. - AI : Stubborn - Won\'t let you win. - AI : Shy - Too scared to win. + Human + AI : Random + AI : Hard + AI : Easy + AI : Stubborn + AI : Shy Website https://hyperling.com