Skip to content

Commit

Permalink
Properties 분리 (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
sodp5 authored Jul 31, 2024
1 parent b437f8a commit d0e5081
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 35 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.channel.bezier.compose.component
package io.channel.bezier.compose.component.loader

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
Expand All @@ -11,10 +11,10 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.StrokeCap
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import io.channel.bezier.BezierTheme
import io.channel.bezier.compose.color_v2.BezierColor
import io.channel.bezier.compose.component.loader.properties.BezierLoaderSize
import io.channel.bezier.compose.component.loader.properties.BezierLoaderVariant

@Composable
fun BezierLoader(
Expand All @@ -30,38 +30,6 @@ fun BezierLoader(
)
}

enum class BezierLoaderVariant(
internal val backgroundColor: @Composable () -> BezierColor,
internal val foregroundColor: @Composable () -> BezierColor,
) {
Primary(
backgroundColor = { BezierTheme.colorSchemes.primaryBgLightest },
foregroundColor = { BezierTheme.colorSchemes.fgBlueNormal },
),
Secondary(
backgroundColor = { BezierTheme.colorSchemes.bgBlackLight },
foregroundColor = { BezierTheme.colorSchemes.fgBlackLight },
),
OnOverlay(
backgroundColor = { BezierTheme.colorSchemes.bgAbsoluteWhiteLightest },
foregroundColor = { BezierTheme.colorSchemes.fgAbsoluteWhiteLight },
),
}

enum class BezierLoaderSize(
internal val size: Dp,
internal val strokeWidth: Dp,
) {
Small(
size = 28.dp,
strokeWidth = 4.dp,
),
Medium(
size = 50.dp,
strokeWidth = 6.dp,
),
}

@Composable
@Preview(showBackground = true)
private fun BezierLoaderPreview() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package io.channel.bezier.compose.component.loader.properties

import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp

enum class BezierLoaderSize(
internal val size: Dp,
internal val strokeWidth: Dp,
) {
Small(
size = 28.dp,
strokeWidth = 4.dp,
),
Medium(
size = 50.dp,
strokeWidth = 6.dp,
),
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package io.channel.bezier.compose.component.loader.properties

import androidx.compose.runtime.Composable
import io.channel.bezier.compose.color_v2.BezierColor
import io.channel.bezier.BezierTheme

enum class BezierLoaderVariant(
internal val backgroundColor: @Composable () -> BezierColor,
internal val foregroundColor: @Composable () -> BezierColor,
) {
Primary(
backgroundColor = { BezierTheme.colorSchemes.primaryBgLightest },
foregroundColor = { BezierTheme.colorSchemes.fgBlueNormal },
),
Secondary(
backgroundColor = { BezierTheme.colorSchemes.bgBlackLight },
foregroundColor = { BezierTheme.colorSchemes.fgBlackLight },
),
OnOverlay(
backgroundColor = { BezierTheme.colorSchemes.bgAbsoluteWhiteLightest },
foregroundColor = { BezierTheme.colorSchemes.fgAbsoluteWhiteLight },
),
}

0 comments on commit d0e5081

Please sign in to comment.