ClickableIcon: Remove unwanted left margin

This commit is contained in:
Patryk Michalik
2021-08-05 17:52:29 +02:00
parent 7b2b9a73b3
commit 2cf27dbb2c
3 changed files with 4 additions and 7 deletions
@@ -29,7 +29,6 @@ fun ClickableIcon(
Box(
contentAlignment = Alignment.Center,
modifier = modifier
.padding(start = 8.dp)
.size(height = 40.dp, width = 40.dp)
.clip(CircleShape)
.addIf(onClick != null) {
@@ -187,7 +187,7 @@ fun TopBar(
) {
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier.height(56.dp)
modifier = Modifier.height(56.dp).padding(horizontal = 8.dp)
) {
AnimatedVisibility(visible = showBackArrow) {
ClickableIcon(
@@ -199,9 +199,7 @@ fun TopBar(
Text(
text = label,
style = MaterialTheme.typography.h6,
modifier = Modifier.padding(
start = animateDpAsState(targetValue = if (showBackArrow) 8.dp else 16.dp).value
)
modifier = Modifier.padding(start = 8.dp)
)
}
}
@@ -56,7 +56,6 @@ fun TopBar(
label: String
) {
val navController = LocalNavController.current
val labelPaddingStart = if (backArrowVisible) 8.dp else 16.dp
val navBackStackEntry by navController.currentBackStackEntryAsState()
val currentRoute = navBackStackEntry?.destination?.route
@@ -66,6 +65,7 @@ fun TopBar(
modifier = Modifier
.fillMaxWidth()
.height(topBarSize)
.padding(horizontal = 8.dp)
) {
if (backArrowVisible) {
ClickableIcon(
@@ -77,7 +77,7 @@ fun TopBar(
Text(
text = label,
style = MaterialTheme.typography.h6,
modifier = Modifier.padding(start = labelPaddingStart, end = 24.dp),
modifier = Modifier.padding(start = 8.dp),
color = MaterialTheme.colors.onSurface,
maxLines = 1,
overflow = TextOverflow.Ellipsis