|
|
|
@ -11,8 +11,12 @@ import androidx.compose.foundation.background
|
|
|
|
|
import androidx.compose.foundation.layout.Box
|
|
|
|
|
import androidx.compose.foundation.layout.BoxScope
|
|
|
|
|
import androidx.compose.foundation.layout.Column
|
|
|
|
|
import androidx.compose.foundation.layout.IntrinsicSize
|
|
|
|
|
import androidx.compose.foundation.layout.PaddingValues
|
|
|
|
|
import androidx.compose.foundation.layout.RowScope
|
|
|
|
|
import androidx.compose.foundation.layout.Spacer
|
|
|
|
|
import androidx.compose.foundation.layout.aspectRatio
|
|
|
|
|
import androidx.compose.foundation.layout.fillMaxHeight
|
|
|
|
|
import androidx.compose.foundation.layout.fillMaxWidth
|
|
|
|
|
import androidx.compose.foundation.layout.height
|
|
|
|
|
import androidx.compose.foundation.layout.heightIn
|
|
|
|
@ -45,6 +49,7 @@ import androidx.compose.ui.graphics.RectangleShape
|
|
|
|
|
import androidx.compose.ui.graphics.StrokeCap
|
|
|
|
|
import androidx.compose.ui.graphics.drawscope.Stroke
|
|
|
|
|
import androidx.compose.ui.graphics.graphicsLayer
|
|
|
|
|
import androidx.compose.ui.graphics.painter.Painter
|
|
|
|
|
import androidx.compose.ui.platform.LocalContext
|
|
|
|
|
import androidx.compose.ui.res.painterResource
|
|
|
|
|
import androidx.compose.ui.res.stringResource
|
|
|
|
@ -126,7 +131,7 @@ fun LargeItemButtonWithDrawable(
|
|
|
|
|
onClick: () -> Unit
|
|
|
|
|
) {
|
|
|
|
|
ItemButtonWithDrawable(
|
|
|
|
|
textId, icon, modifier.heightIn(min = LocalDimensions.current.minLargeItemButtonHeight),
|
|
|
|
|
textId, icon, modifier,
|
|
|
|
|
LocalType.current.h8, colors, onClick
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
@ -167,8 +172,13 @@ fun LargeItemButton(
|
|
|
|
|
onClick: () -> Unit
|
|
|
|
|
) {
|
|
|
|
|
ItemButton(
|
|
|
|
|
textId, icon, modifier.heightIn(min = LocalDimensions.current.minLargeItemButtonHeight),
|
|
|
|
|
LocalType.current.h8, colors, onClick
|
|
|
|
|
textId = textId,
|
|
|
|
|
icon = icon,
|
|
|
|
|
modifier = modifier,
|
|
|
|
|
minHeight = LocalDimensions.current.minLargeItemButtonHeight,
|
|
|
|
|
textStyle = LocalType.current.h8,
|
|
|
|
|
colors = colors,
|
|
|
|
|
onClick = onClick
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -181,8 +191,13 @@ fun LargeItemButton(
|
|
|
|
|
onClick: () -> Unit
|
|
|
|
|
) {
|
|
|
|
|
ItemButton(
|
|
|
|
|
text, icon, modifier.heightIn(min = LocalDimensions.current.minLargeItemButtonHeight),
|
|
|
|
|
LocalType.current.h8, colors, onClick
|
|
|
|
|
text = text,
|
|
|
|
|
icon = icon,
|
|
|
|
|
modifier = modifier,
|
|
|
|
|
minHeight = LocalDimensions.current.minLargeItemButtonHeight,
|
|
|
|
|
textStyle = LocalType.current.h8,
|
|
|
|
|
colors = colors,
|
|
|
|
|
onClick = onClick
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -191,6 +206,7 @@ fun ItemButton(
|
|
|
|
|
text: String,
|
|
|
|
|
icon: Int,
|
|
|
|
|
modifier: Modifier,
|
|
|
|
|
minHeight: Dp = LocalDimensions.current.minItemButtonHeight,
|
|
|
|
|
textStyle: TextStyle = LocalType.current.xl,
|
|
|
|
|
colors: ButtonColors = transparentButtonColors(),
|
|
|
|
|
onClick: () -> Unit
|
|
|
|
@ -205,6 +221,7 @@ fun ItemButton(
|
|
|
|
|
modifier = Modifier.align(Alignment.Center)
|
|
|
|
|
)
|
|
|
|
|
},
|
|
|
|
|
minHeight = minHeight,
|
|
|
|
|
textStyle = textStyle,
|
|
|
|
|
colors = colors,
|
|
|
|
|
onClick = onClick
|
|
|
|
@ -219,6 +236,7 @@ fun ItemButton(
|
|
|
|
|
@StringRes textId: Int,
|
|
|
|
|
@DrawableRes icon: Int,
|
|
|
|
|
modifier: Modifier = Modifier,
|
|
|
|
|
minHeight: Dp = LocalDimensions.current.minItemButtonHeight,
|
|
|
|
|
textStyle: TextStyle = LocalType.current.xl,
|
|
|
|
|
colors: ButtonColors = transparentButtonColors(),
|
|
|
|
|
onClick: () -> Unit
|
|
|
|
@ -233,6 +251,7 @@ fun ItemButton(
|
|
|
|
|
modifier = Modifier.align(Alignment.Center)
|
|
|
|
|
)
|
|
|
|
|
},
|
|
|
|
|
minHeight = minHeight,
|
|
|
|
|
textStyle = textStyle,
|
|
|
|
|
colors = colors,
|
|
|
|
|
onClick = onClick
|
|
|
|
@ -249,20 +268,23 @@ fun ItemButton(
|
|
|
|
|
text: String,
|
|
|
|
|
icon: @Composable BoxScope.() -> Unit,
|
|
|
|
|
modifier: Modifier = Modifier,
|
|
|
|
|
minHeight: Dp = LocalDimensions.current.minLargeItemButtonHeight,
|
|
|
|
|
textStyle: TextStyle = LocalType.current.xl,
|
|
|
|
|
colors: ButtonColors = transparentButtonColors(),
|
|
|
|
|
onClick: () -> Unit
|
|
|
|
|
) {
|
|
|
|
|
TextButton(
|
|
|
|
|
modifier = modifier.fillMaxWidth(),
|
|
|
|
|
modifier = modifier.fillMaxWidth()
|
|
|
|
|
.height(IntrinsicSize.Min)
|
|
|
|
|
.heightIn(min = minHeight)
|
|
|
|
|
.padding(horizontal = LocalDimensions.current.xsSpacing),
|
|
|
|
|
colors = colors,
|
|
|
|
|
onClick = onClick,
|
|
|
|
|
shape = RectangleShape,
|
|
|
|
|
) {
|
|
|
|
|
Box(
|
|
|
|
|
modifier = Modifier
|
|
|
|
|
.width(50.dp)
|
|
|
|
|
.wrapContentHeight()
|
|
|
|
|
modifier = Modifier.fillMaxHeight()
|
|
|
|
|
.aspectRatio(1f)
|
|
|
|
|
.align(Alignment.CenterVertically)
|
|
|
|
|
) {
|
|
|
|
|
icon()
|
|
|
|
@ -274,7 +296,6 @@ fun ItemButton(
|
|
|
|
|
text,
|
|
|
|
|
Modifier
|
|
|
|
|
.fillMaxWidth()
|
|
|
|
|
.padding(vertical = LocalDimensions.current.xsSpacing)
|
|
|
|
|
.align(Alignment.CenterVertically),
|
|
|
|
|
style = textStyle
|
|
|
|
|
)
|
|
|
|
@ -371,7 +392,8 @@ fun Modifier.fadingEdges(
|
|
|
|
|
@Composable
|
|
|
|
|
fun Divider(modifier: Modifier = Modifier, startIndent: Dp = 0.dp) {
|
|
|
|
|
HorizontalDivider(
|
|
|
|
|
modifier = modifier.padding(horizontal = LocalDimensions.current.smallSpacing)
|
|
|
|
|
modifier = modifier
|
|
|
|
|
.padding(horizontal = LocalDimensions.current.smallSpacing)
|
|
|
|
|
.padding(start = startIndent),
|
|
|
|
|
color = LocalColors.current.borders,
|
|
|
|
|
)
|
|
|
|
@ -471,4 +493,4 @@ fun LoadingArcOr(loading: Boolean, content: @Composable () -> Unit) {
|
|
|
|
|
AnimatedVisibility(!loading) {
|
|
|
|
|
content()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|