Skip to content

Commit

Permalink
Enhance some minor UI things (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
costular authored Oct 30, 2023
1 parent 4795726 commit e1b7f53
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,10 @@ private fun TasksContent(
shouldShowTaskOrderTutorial = state.shouldShowCardOrderTutorial,
onDismissTaskOrderTutorial = onDismissTaskOrderTutorial,
padding = PaddingValues(
horizontal = AppTheme.dimens.contentMargin,
vertical = AppTheme.dimens.spacingLarge,
start = AppTheme.dimens.contentMargin,
end = AppTheme.dimens.contentMargin,
top = AppTheme.dimens.spacingLarge,
bottom = ContentPaddingForFAB.dp,
),
modifier = modifier
.fillMaxSize()
Expand Down Expand Up @@ -454,3 +456,5 @@ fun AgendaPreview() {
)
}
}

private const val ContentPaddingForFAB = 90
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
Expand All @@ -29,7 +30,11 @@ fun TasksSettingsSection(
) {
SettingSwitch(
start = {
Icon(imageVector = Icons.Outlined.FastForward, contentDescription = null)
Icon(
imageVector = Icons.Outlined.FastForward,
contentDescription = null,
modifier = Modifier.align(Alignment.Top)
)
},
title = {
Column {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
Expand Down Expand Up @@ -33,8 +34,8 @@ fun SettingItem(
title: @Composable () -> Unit,
onClick: () -> Unit,
modifier: Modifier = Modifier,
start: @Composable (() -> Unit)? = null,
end: @Composable (() -> Unit)? = null,
start: @Composable (RowScope.() -> Unit)? = null,
end: @Composable (RowScope.() -> Unit)? = null,
) {
Row(
horizontalArrangement = Arrangement.SpaceBetween,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.costular.atomtasks.settings

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.size
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.OpenInNew
Expand All @@ -9,8 +8,8 @@ import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.graphics.vector.rememberVectorPainter
import androidx.compose.ui.text.style.TextOverflow
Expand All @@ -27,11 +26,12 @@ fun SettingLink(
) {
SettingItem(
start = {
Image(
Icon(
painter = rememberVectorPainter(icon),
contentDescription = null,
modifier = Modifier.size(24.dp),
colorFilter = ColorFilter.tint(MaterialTheme.colorScheme.primary),
modifier = Modifier
.size(24.dp)
.align(Alignment.Top),
)
},
title = title,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.size
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ChevronRight
import androidx.compose.material.icons.outlined.Palette
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.graphics.vector.rememberVectorPainter
Expand All @@ -31,7 +32,9 @@ fun SettingOption(
Icon(
painter = rememberVectorPainter(icon),
contentDescription = null,
modifier = Modifier.size(24.dp),
modifier = Modifier
.size(24.dp)
.align(Alignment.Top),
)
},
title = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.costular.atomtasks.settings

import androidx.compose.foundation.layout.RowScope
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.FlashOn
import androidx.compose.material3.Icon
Expand All @@ -21,7 +22,7 @@ fun SettingSwitch(
isSelected: Boolean,
onSelect: (isSelected: Boolean) -> Unit,
modifier: Modifier = Modifier,
start: @Composable (() -> Unit)? = null,
start: @Composable (RowScope.() -> Unit)? = null,
) {
SettingItem(
title = title,
Expand Down

0 comments on commit e1b7f53

Please sign in to comment.