diff --git a/README.md b/README.md index 3afd46b..5e2a156 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![version](https://img.shields.io/badge/version-1.0.9-blue) +![version](https://img.shields.io/badge/version-1.0.10-blue) ## How to use? in your project diff --git a/app/src/main/java/com/b1nd/dodam/designsystem/MainActivity.kt b/app/src/main/java/com/b1nd/dodam/designsystem/MainActivity.kt index c1544ca..d587675 100644 --- a/app/src/main/java/com/b1nd/dodam/designsystem/MainActivity.kt +++ b/app/src/main/java/com/b1nd/dodam/designsystem/MainActivity.kt @@ -3,10 +3,21 @@ package com.b1nd.dodam.designsystem import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.compose.setContent +import androidx.compose.foundation.BorderStroke import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.Icon +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp import com.b1nd.dodam.designsystem.component.AvatarSize import com.b1nd.dodam.designsystem.component.DodamAvatar +import com.b1nd.dodam.designsystem.component.DodamCircularProgressIndicator +import com.b1nd.dodam.designsystem.component.DodamLinerProgressIndicator +import com.b1nd.dodam.designsystem.foundation.DodamIcons @ExperimentalMaterial3Api class MainActivity : ComponentActivity() { @@ -14,10 +25,33 @@ class MainActivity : ComponentActivity() { super.onCreate(savedInstanceState) setContent { DodamTheme { - Column { + Column( + modifier = Modifier.fillMaxSize() + ) { + DodamCircularProgressIndicator( + modifier = Modifier + .padding(horizontal = 20.dp) + .size(40.dp), + progress = 0f + ) + DodamLinerProgressIndicator( + modifier = Modifier.fillMaxWidth(), + progress = 0f + ) + Icon( + modifier = Modifier.size(50.dp), + imageVector = DodamIcons.Pen.value, + contentDescription = null + ) + Icon( + modifier = Modifier.size(50.dp), + imageVector = DodamIcons.Chart.value, + contentDescription = null + ) DodamAvatar( - model = "https://dodam.kr.object.ncloudstorage.com/dodam/6634113f-951b-430c-81c9-957de0e8abddalimo.png", - avatarSize = AvatarSize.Large + model = null, + avatarSize = AvatarSize.ExtraLarge, + borderStroke = BorderStroke(1.dp, DodamTheme.colors.lineAlternative) ) } } diff --git a/dodam-design-system/build.gradle.kts b/dodam-design-system/build.gradle.kts index 6ee926b..e24fb08 100644 --- a/dodam-design-system/build.gradle.kts +++ b/dodam-design-system/build.gradle.kts @@ -80,7 +80,7 @@ mavenPublishing { coordinates( groupId = "com.b1nd.dodam", artifactId = "dodam-design-system", - version = "1.0.9" + version = "1.0.10" ) pom { diff --git a/dodam-design-system/src/commonMain/composeResources/drawable/ic_chart.xml b/dodam-design-system/src/commonMain/composeResources/drawable/ic_chart.xml new file mode 100644 index 0000000..dd8ea18 --- /dev/null +++ b/dodam-design-system/src/commonMain/composeResources/drawable/ic_chart.xml @@ -0,0 +1,15 @@ + + + + + diff --git a/dodam-design-system/src/commonMain/composeResources/drawable/ic_pen.xml b/dodam-design-system/src/commonMain/composeResources/drawable/ic_pen.xml new file mode 100644 index 0000000..1a57a89 --- /dev/null +++ b/dodam-design-system/src/commonMain/composeResources/drawable/ic_pen.xml @@ -0,0 +1,10 @@ + + + diff --git a/dodam-design-system/src/commonMain/kotlin/com/b1nd/dodam/designsystem/component/Avatar.kt b/dodam-design-system/src/commonMain/kotlin/com/b1nd/dodam/designsystem/component/Avatar.kt index e13adf3..bcde259 100644 --- a/dodam-design-system/src/commonMain/kotlin/com/b1nd/dodam/designsystem/component/Avatar.kt +++ b/dodam-design-system/src/commonMain/kotlin/com/b1nd/dodam/designsystem/component/Avatar.kt @@ -1,7 +1,9 @@ package com.b1nd.dodam.designsystem.component +import androidx.compose.foundation.BorderStroke import androidx.compose.foundation.Image import androidx.compose.foundation.background +import androidx.compose.foundation.border import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.CircleShape @@ -20,6 +22,7 @@ import coil3.compose.AsyncImage import coil3.request.ImageRequest import com.b1nd.dodam.designsystem.DodamTheme import com.b1nd.dodam.designsystem.foundation.DodamIcons +import com.b1nd.dodam.designsystem.internal.`if` @Composable @@ -30,6 +33,7 @@ fun DodamAvatar( contentDescription: String? = null, colorFilter: ColorFilter? = null, alpha: Float = DefaultAlpha, + borderStroke: BorderStroke? = null, contentScale: ContentScale = ContentScale.Fit, ) { @@ -40,7 +44,13 @@ fun DodamAvatar( DodamAsyncAvatar( modifier = modifier .size(avatarConfig.backgroundSize) - .clip(CircleShape), + .clip(CircleShape) + .`if`(borderStroke != null) { + border( + border = borderStroke!!, + shape = CircleShape + ) + }, model = model, contentDescription = contentDescription, colorFilter = colorFilter, @@ -56,6 +66,13 @@ fun DodamAvatar( color = DodamTheme.colors.fillNormal, shape = CircleShape ) + .`if`(borderStroke != null) { + border( + border = borderStroke!!, + shape = CircleShape + ) + } + ) { Image( modifier = Modifier @@ -79,7 +96,7 @@ private fun DodamAsyncAvatar( contentDescription: String?, colorFilter: ColorFilter?, alpha: Float, - contentScale: ContentScale + contentScale: ContentScale, ) { AsyncImage( modifier = modifier, @@ -87,7 +104,7 @@ private fun DodamAsyncAvatar( contentDescription = contentDescription, colorFilter = colorFilter, alpha = alpha, - contentScale = contentScale + contentScale = contentScale, ) } diff --git a/dodam-design-system/src/commonMain/kotlin/com/b1nd/dodam/designsystem/component/Indicator.kt b/dodam-design-system/src/commonMain/kotlin/com/b1nd/dodam/designsystem/component/Indicator.kt index 6a48481..48a6352 100644 --- a/dodam-design-system/src/commonMain/kotlin/com/b1nd/dodam/designsystem/component/Indicator.kt +++ b/dodam-design-system/src/commonMain/kotlin/com/b1nd/dodam/designsystem/component/Indicator.kt @@ -55,7 +55,7 @@ fun DodamPageIndicator( @Composable fun DodamLinerProgressIndicator( - modifier: Modifier, + modifier: Modifier = Modifier, @FloatRange(from = 0.0, to = 1.0) progress: Float, disabled: Boolean = false, ) { @@ -70,23 +70,25 @@ fun DodamLinerProgressIndicator( shape = LinerProgressIndicatorDefault.DefaultShape ) ) { - Box( - modifier = Modifier - .weight(progress) - .background( - color = if (disabled) DodamTheme.colors.lineNormal + if (progress != 0f) { + Box( + modifier = Modifier + .weight(progress) + .background( + color = if (disabled) DodamTheme.colors.lineNormal else DodamTheme.colors.primaryNormal, - shape = LinerProgressIndicatorDefault.DefaultShape - ) - .fillMaxHeight() - ) - Spacer(Modifier.weight(1f-progress)) + shape = LinerProgressIndicatorDefault.DefaultShape + ) + .fillMaxHeight() + ) + Spacer(Modifier.weight(1f - progress)) + } } } @Composable fun DodamCircularProgressIndicator( - modifier: Modifier, + modifier: Modifier = Modifier, @FloatRange(from = 0.0, to = 1.0) progress: Float, disabled: Boolean = false, ) { diff --git a/dodam-design-system/src/commonMain/kotlin/com/b1nd/dodam/designsystem/foundation/DodamIcons.kt b/dodam-design-system/src/commonMain/kotlin/com/b1nd/dodam/designsystem/foundation/DodamIcons.kt index 8b64332..2b77244 100644 --- a/dodam-design-system/src/commonMain/kotlin/com/b1nd/dodam/designsystem/foundation/DodamIcons.kt +++ b/dodam-design-system/src/commonMain/kotlin/com/b1nd/dodam/designsystem/foundation/DodamIcons.kt @@ -7,6 +7,7 @@ import com.b1nd.dodam.designsystem.resources.ic_arrow_left import com.b1nd.dodam.designsystem.resources.ic_bell import com.b1nd.dodam.designsystem.resources.ic_bus import com.b1nd.dodam.designsystem.resources.ic_calendar +import com.b1nd.dodam.designsystem.resources.ic_chart import com.b1nd.dodam.designsystem.resources.ic_checkmark import com.b1nd.dodam.designsystem.resources.ic_checkmark_circle import com.b1nd.dodam.designsystem.resources.ic_checkmark_circle_filled @@ -27,6 +28,7 @@ import com.b1nd.dodam.designsystem.resources.ic_megaphone import com.b1nd.dodam.designsystem.resources.ic_menu import com.b1nd.dodam.designsystem.resources.ic_moon_plus import com.b1nd.dodam.designsystem.resources.ic_note +import com.b1nd.dodam.designsystem.resources.ic_pen import com.b1nd.dodam.designsystem.resources.ic_person import com.b1nd.dodam.designsystem.resources.ic_plus import com.b1nd.dodam.designsystem.resources.ic_trash @@ -61,7 +63,9 @@ enum class DodamIcons { Person, Dev, Close, - FullMoonFace; + FullMoonFace, + Pen, + Chart; val value: ImageVector @Composable @@ -95,5 +99,7 @@ enum class DodamIcons { Dev -> vectorResource(Res.drawable.ic_dev) Close -> vectorResource(Res.drawable.ic_close_line) FullMoonFace -> vectorResource(Res.drawable.ic_full_moon_face) + Pen -> vectorResource(Res.drawable.ic_pen) + Chart -> vectorResource(Res.drawable.ic_chart) } }