Skip to content

Commit

Permalink
Size 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
sodp5 committed Aug 8, 2024
1 parent befa7d8 commit 10347d0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import io.channel.bezier.BezierTheme
import io.channel.bezier.compose.component.loader.properties.BezierLoaderSize
import io.channel.bezier.compose.component.loader.properties.BezierLoaderVariant

private const val StrokeWidthRatio = 0.12f

@Composable
fun BezierLoader(
variant: BezierLoaderVariant,
Expand All @@ -24,7 +26,7 @@ fun BezierLoader(
CircularProgressIndicator(
modifier = Modifier.size(size.size),
color = variant.foregroundColor().color,
strokeWidth = size.strokeWidth,
strokeWidth = size.size * StrokeWidthRatio,
backgroundColor = variant.backgroundColor().color,
strokeCap = StrokeCap.Round,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,20 @@ import androidx.compose.ui.unit.dp

enum class BezierLoaderSize(
internal val size: Dp,
internal val strokeWidth: Dp,
) {
XXSmall(
size = 16.dp,
),
XSmall(
size = 20.dp,
),
Small(
size = 28.dp,
strokeWidth = 4.dp,
size = 24.dp,
),
Medium(
size = 28.dp,
),
Large(
size = 50.dp,
strokeWidth = 6.dp,
),
}

0 comments on commit 10347d0

Please sign in to comment.