Tiny padding fixes

Input and output text fields now occupy full screen width
This commit is contained in:
sadellie 2022-11-13 11:49:44 +04:00
parent 8e928d44bf
commit d90ae9220a
2 changed files with 11 additions and 17 deletions

View File

@ -91,10 +91,8 @@ fun MainScreen(
navControllerAction = { navControllerAction(it) },
swapMeasurements = { viewModel.swapUnits() },
processInput = { viewModel.processInput(it) },
deleteDigit = { viewModel.deleteDigit() },
clearInput = { viewModel.clearInput() },
negateInput = { viewModel.negateInput() }
)
deleteDigit = { viewModel.deleteDigit() }
) { viewModel.clearInput() }
}
)
@ -121,14 +119,12 @@ private fun PortraitMainScreenContent(
processInput: (String) -> Unit = {},
deleteDigit: () -> Unit = {},
clearInput: () -> Unit = {},
negateInput: () -> Unit = {},
) {
if (portrait) {
Column(
modifier
.fillMaxSize()
.padding(8.dp),
verticalArrangement = Arrangement.spacedBy(24.dp)
.fillMaxSize(),
verticalArrangement = Arrangement.spacedBy(8.dp)
) {
TopScreenPart(
modifier = Modifier,
@ -146,7 +142,8 @@ private fun PortraitMainScreenContent(
// Keyboard which takes half the screen
Keyboard(
Modifier
.fillMaxSize(),
.fillMaxSize()
.padding(horizontal = 8.dp),
addDigit = processInput,
deleteDigit = deleteDigit,
clearInput = clearInput,
@ -157,8 +154,7 @@ private fun PortraitMainScreenContent(
} else {
Row(
modifier
.fillMaxSize()
.padding(8.dp),
.fillMaxSize(),
horizontalArrangement = Arrangement.spacedBy(8.dp)
) {
TopScreenPart(
@ -181,7 +177,8 @@ private fun PortraitMainScreenContent(
Keyboard(
Modifier
.weight(1f)
.fillMaxSize(),
.fillMaxSize()
.padding(horizontal = 8.dp),
addDigit = processInput,
deleteDigit = deleteDigit,
clearInput = clearInput,

View File

@ -21,10 +21,7 @@ package com.sadellie.unitto.screens.main.components
import androidx.compose.animation.core.FastOutSlowInEasing
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.core.tween
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.*
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.SwapHoriz
import androidx.compose.material3.Icon
@ -105,7 +102,7 @@ fun TopScreenPart(
)
// Unit selection buttons
Row(
modifier = Modifier,
modifier = Modifier.padding(horizontal = 8.dp),
verticalAlignment = Alignment.Bottom,
) {
UnitSelectionButton(