Fix UI being too tall for some devices.
This commit is contained in:
parent
aedb86030a
commit
31703cffb9
@ -11,8 +11,8 @@ android {
|
|||||||
applicationId = "com.hyperling.tictactoe"
|
applicationId = "com.hyperling.tictactoe"
|
||||||
minSdk = 21
|
minSdk = 21
|
||||||
targetSdk = 34
|
targetSdk = 34
|
||||||
versionCode = 1
|
versionCode = 2
|
||||||
versionName = "1.0"
|
versionName = "1.0.1"
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
vectorDrawables {
|
vectorDrawables {
|
||||||
|
@ -194,8 +194,8 @@ fun Game() {
|
|||||||
Column(
|
Column(
|
||||||
horizontalAlignment = Alignment.CenterHorizontally
|
horizontalAlignment = Alignment.CenterHorizontally
|
||||||
, verticalArrangement = Arrangement.Center
|
, verticalArrangement = Arrangement.Center
|
||||||
, modifier = Modifier
|
//, modifier = Modifier
|
||||||
.fillMaxSize()
|
// .fillMaxSize()
|
||||||
) {
|
) {
|
||||||
|
|
||||||
Spacer(modifier = Modifier.weight(0.1f))
|
Spacer(modifier = Modifier.weight(0.1f))
|
||||||
@ -346,95 +346,112 @@ fun Game() {
|
|||||||
fontSize = 16.sp
|
fontSize = 16.sp
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.size(5.dp))
|
Spacer(modifier = Modifier.size(5.dp))
|
||||||
Row (
|
|
||||||
|
Row(
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
modifier = Modifier.clickable {
|
horizontalArrangement = Arrangement.SpaceEvenly
|
||||||
opponentHuman = setRadiosFalse()
|
) {
|
||||||
|
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(
|
Column (
|
||||||
selected = opponentHuman,
|
horizontalAlignment = Alignment.Start,
|
||||||
onClick = { opponentHuman = setRadiosFalse() },
|
verticalArrangement = Arrangement.Bottom
|
||||||
)
|
) {
|
||||||
Text(
|
Row (
|
||||||
text = stringResource(id = R.string.opponent_human),
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
fontSize = 16.sp
|
modifier = Modifier.clickable {
|
||||||
)
|
opponentRandom = setRadiosFalse()
|
||||||
}
|
}
|
||||||
Row (
|
){
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
RadioButton(
|
||||||
modifier = Modifier.clickable {
|
selected = opponentRandom,
|
||||||
opponentRandom = setRadiosFalse()
|
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))
|
Spacer(modifier = Modifier.weight(.05f))
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
<string name="app_name">Tic-Tac-Toe</string>
|
<string name="app_name">Tic-Tac-Toe</string>
|
||||||
|
|
||||||
<string name="opponent_header">Choose your opponent:</string>
|
<string name="opponent_header">Choose your opponent:</string>
|
||||||
<string name="opponent_human">Human - Someone next to you.</string>
|
<string name="opponent_human">Human</string>
|
||||||
<string name="opponent_random">AI : Random - Fills any open spot.</string>
|
<string name="opponent_random">AI : Random</string>
|
||||||
<string name="opponent_hard">AI : Hard - Your typical try-hard.</string>
|
<string name="opponent_hard">AI : Hard</string>
|
||||||
<string name="opponent_easy">AI : Easy - Opportunist, may try to win.</string>
|
<string name="opponent_easy">AI : Easy</string>
|
||||||
<string name="opponent_annoying">AI : Stubborn - Won\'t let you win.</string>
|
<string name="opponent_annoying">AI : Stubborn</string>
|
||||||
<string name="opponent_shy">AI : Shy - Too scared to win.</string>
|
<string name="opponent_shy">AI : Shy</string>
|
||||||
|
|
||||||
<string name="link1_text">Website</string>
|
<string name="link1_text">Website</string>
|
||||||
<string name="link1_uri">https://hyperling.com</string>
|
<string name="link1_uri">https://hyperling.com</string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user