Skip to content

Commit b72c935

Browse files
authored
Merge pull request #33 from Team-B1ND/feature/1.0.10
Release 1.0.10
2 parents d62efed + 6bb765c commit b72c935

File tree

8 files changed

+105
-21
lines changed

8 files changed

+105
-21
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![version](https://img.shields.io/badge/version-1.0.9-blue)
1+
![version](https://img.shields.io/badge/version-1.0.10-blue)
22

33
## How to use?
44
in your project

app/src/main/java/com/b1nd/dodam/designsystem/MainActivity.kt

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,55 @@ package com.b1nd.dodam.designsystem
33
import android.os.Bundle
44
import androidx.activity.ComponentActivity
55
import androidx.activity.compose.setContent
6+
import androidx.compose.foundation.BorderStroke
67
import androidx.compose.foundation.layout.Column
8+
import androidx.compose.foundation.layout.fillMaxSize
9+
import androidx.compose.foundation.layout.fillMaxWidth
10+
import androidx.compose.foundation.layout.padding
11+
import androidx.compose.foundation.layout.size
712
import androidx.compose.material3.ExperimentalMaterial3Api
13+
import androidx.compose.material3.Icon
14+
import androidx.compose.ui.Modifier
15+
import androidx.compose.ui.unit.dp
816
import com.b1nd.dodam.designsystem.component.AvatarSize
917
import com.b1nd.dodam.designsystem.component.DodamAvatar
18+
import com.b1nd.dodam.designsystem.component.DodamCircularProgressIndicator
19+
import com.b1nd.dodam.designsystem.component.DodamLinerProgressIndicator
20+
import com.b1nd.dodam.designsystem.foundation.DodamIcons
1021

1122
@ExperimentalMaterial3Api
1223
class MainActivity : ComponentActivity() {
1324
override fun onCreate(savedInstanceState: Bundle?) {
1425
super.onCreate(savedInstanceState)
1526
setContent {
1627
DodamTheme {
17-
Column {
28+
Column(
29+
modifier = Modifier.fillMaxSize()
30+
) {
31+
DodamCircularProgressIndicator(
32+
modifier = Modifier
33+
.padding(horizontal = 20.dp)
34+
.size(40.dp),
35+
progress = 0f
36+
)
37+
DodamLinerProgressIndicator(
38+
modifier = Modifier.fillMaxWidth(),
39+
progress = 0f
40+
)
41+
Icon(
42+
modifier = Modifier.size(50.dp),
43+
imageVector = DodamIcons.Pen.value,
44+
contentDescription = null
45+
)
46+
Icon(
47+
modifier = Modifier.size(50.dp),
48+
imageVector = DodamIcons.Chart.value,
49+
contentDescription = null
50+
)
1851
DodamAvatar(
19-
model = "https://dodam.kr.object.ncloudstorage.com/dodam/6634113f-951b-430c-81c9-957de0e8abddalimo.png",
20-
avatarSize = AvatarSize.Large
52+
model = null,
53+
avatarSize = AvatarSize.ExtraLarge,
54+
borderStroke = BorderStroke(1.dp, DodamTheme.colors.lineAlternative)
2155
)
2256
}
2357
}

dodam-design-system/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ mavenPublishing {
8080
coordinates(
8181
groupId = "com.b1nd.dodam",
8282
artifactId = "dodam-design-system",
83-
version = "1.0.9"
83+
version = "1.0.10"
8484
)
8585

8686
pom {
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="24dp"
3+
android:height="24dp"
4+
android:viewportWidth="24"
5+
android:viewportHeight="24">
6+
<path
7+
android:pathData="M3,22.5H7.5V7.66C7.5,7.156 7.09,6.75 6.58,6.75H3.92C3.41,6.75 3,7.156 3,7.66L3,22.5C3.5,22.5 2.454,22.5 3,22.5Z"
8+
android:fillColor="#0F0F10"/>
9+
<path
10+
android:pathData="M13.33,12.75H10.67C10.16,12.75 9.75,13.156 9.75,13.66V22.5H14.25V13.66C14.25,13.156 13.84,12.75 13.33,12.75Z"
11+
android:fillColor="#0F0F10"/>
12+
<path
13+
android:pathData="M16.5,22.5H21V5.407C21,4.905 20.59,4.5 20.08,4.5H17.42C16.91,4.5 16.5,4.905 16.5,5.407V22.5Z"
14+
android:fillColor="#0F0F10"/>
15+
</vector>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="24dp"
3+
android:height="24dp"
4+
android:viewportWidth="24"
5+
android:viewportHeight="24">
6+
<path
7+
android:pathData="M8.909,21.292L3.629,22.052C3.184,22.113 2.737,21.962 2.42,21.643C2.104,21.325 1.955,20.876 2.019,20.432L2.779,15.152C2.878,14.436 3.208,13.773 3.719,13.262L13.469,3.522C14.724,2.222 16.583,1.701 18.331,2.159C20.08,2.616 21.445,3.981 21.902,5.73C22.36,7.478 21.839,9.337 20.539,10.592L10.799,20.352C10.288,20.863 9.625,21.194 8.909,21.292ZM12.299,10.702C12.007,10.995 12.007,11.469 12.299,11.762C12.592,12.055 13.066,12.055 13.359,11.762L17.569,7.552C17.844,7.257 17.836,6.796 17.551,6.511C17.265,6.225 16.804,6.217 16.509,6.492L12.299,10.702Z"
8+
android:fillColor="#000000"
9+
android:fillType="evenOdd"/>
10+
</vector>

dodam-design-system/src/commonMain/kotlin/com/b1nd/dodam/designsystem/component/Avatar.kt

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package com.b1nd.dodam.designsystem.component
22

3+
import androidx.compose.foundation.BorderStroke
34
import androidx.compose.foundation.Image
45
import androidx.compose.foundation.background
6+
import androidx.compose.foundation.border
57
import androidx.compose.foundation.layout.Box
68
import androidx.compose.foundation.layout.size
79
import androidx.compose.foundation.shape.CircleShape
@@ -20,6 +22,7 @@ import coil3.compose.AsyncImage
2022
import coil3.request.ImageRequest
2123
import com.b1nd.dodam.designsystem.DodamTheme
2224
import com.b1nd.dodam.designsystem.foundation.DodamIcons
25+
import com.b1nd.dodam.designsystem.internal.`if`
2326

2427

2528
@Composable
@@ -30,6 +33,7 @@ fun DodamAvatar(
3033
contentDescription: String? = null,
3134
colorFilter: ColorFilter? = null,
3235
alpha: Float = DefaultAlpha,
36+
borderStroke: BorderStroke? = null,
3337
contentScale: ContentScale = ContentScale.Fit,
3438
) {
3539

@@ -40,7 +44,13 @@ fun DodamAvatar(
4044
DodamAsyncAvatar(
4145
modifier = modifier
4246
.size(avatarConfig.backgroundSize)
43-
.clip(CircleShape),
47+
.clip(CircleShape)
48+
.`if`(borderStroke != null) {
49+
border(
50+
border = borderStroke!!,
51+
shape = CircleShape
52+
)
53+
},
4454
model = model,
4555
contentDescription = contentDescription,
4656
colorFilter = colorFilter,
@@ -56,6 +66,13 @@ fun DodamAvatar(
5666
color = DodamTheme.colors.fillNormal,
5767
shape = CircleShape
5868
)
69+
.`if`(borderStroke != null) {
70+
border(
71+
border = borderStroke!!,
72+
shape = CircleShape
73+
)
74+
}
75+
5976
) {
6077
Image(
6178
modifier = Modifier
@@ -79,15 +96,15 @@ private fun DodamAsyncAvatar(
7996
contentDescription: String?,
8097
colorFilter: ColorFilter?,
8198
alpha: Float,
82-
contentScale: ContentScale
99+
contentScale: ContentScale,
83100
) {
84101
AsyncImage(
85102
modifier = modifier,
86103
model = model,
87104
contentDescription = contentDescription,
88105
colorFilter = colorFilter,
89106
alpha = alpha,
90-
contentScale = contentScale
107+
contentScale = contentScale,
91108
)
92109
}
93110

dodam-design-system/src/commonMain/kotlin/com/b1nd/dodam/designsystem/component/Indicator.kt

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ fun DodamPageIndicator(
5555

5656
@Composable
5757
fun DodamLinerProgressIndicator(
58-
modifier: Modifier,
58+
modifier: Modifier = Modifier,
5959
@FloatRange(from = 0.0, to = 1.0) progress: Float,
6060
disabled: Boolean = false,
6161
) {
@@ -70,23 +70,25 @@ fun DodamLinerProgressIndicator(
7070
shape = LinerProgressIndicatorDefault.DefaultShape
7171
)
7272
) {
73-
Box(
74-
modifier = Modifier
75-
.weight(progress)
76-
.background(
77-
color = if (disabled) DodamTheme.colors.lineNormal
73+
if (progress != 0f) {
74+
Box(
75+
modifier = Modifier
76+
.weight(progress)
77+
.background(
78+
color = if (disabled) DodamTheme.colors.lineNormal
7879
else DodamTheme.colors.primaryNormal,
79-
shape = LinerProgressIndicatorDefault.DefaultShape
80-
)
81-
.fillMaxHeight()
82-
)
83-
Spacer(Modifier.weight(1f-progress))
80+
shape = LinerProgressIndicatorDefault.DefaultShape
81+
)
82+
.fillMaxHeight()
83+
)
84+
Spacer(Modifier.weight(1f - progress))
85+
}
8486
}
8587
}
8688

8789
@Composable
8890
fun DodamCircularProgressIndicator(
89-
modifier: Modifier,
91+
modifier: Modifier = Modifier,
9092
@FloatRange(from = 0.0, to = 1.0) progress: Float,
9193
disabled: Boolean = false,
9294
) {

dodam-design-system/src/commonMain/kotlin/com/b1nd/dodam/designsystem/foundation/DodamIcons.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import com.b1nd.dodam.designsystem.resources.ic_arrow_left
77
import com.b1nd.dodam.designsystem.resources.ic_bell
88
import com.b1nd.dodam.designsystem.resources.ic_bus
99
import com.b1nd.dodam.designsystem.resources.ic_calendar
10+
import com.b1nd.dodam.designsystem.resources.ic_chart
1011
import com.b1nd.dodam.designsystem.resources.ic_checkmark
1112
import com.b1nd.dodam.designsystem.resources.ic_checkmark_circle
1213
import com.b1nd.dodam.designsystem.resources.ic_checkmark_circle_filled
@@ -27,6 +28,7 @@ import com.b1nd.dodam.designsystem.resources.ic_megaphone
2728
import com.b1nd.dodam.designsystem.resources.ic_menu
2829
import com.b1nd.dodam.designsystem.resources.ic_moon_plus
2930
import com.b1nd.dodam.designsystem.resources.ic_note
31+
import com.b1nd.dodam.designsystem.resources.ic_pen
3032
import com.b1nd.dodam.designsystem.resources.ic_person
3133
import com.b1nd.dodam.designsystem.resources.ic_plus
3234
import com.b1nd.dodam.designsystem.resources.ic_trash
@@ -61,7 +63,9 @@ enum class DodamIcons {
6163
Person,
6264
Dev,
6365
Close,
64-
FullMoonFace;
66+
FullMoonFace,
67+
Pen,
68+
Chart;
6569

6670
val value: ImageVector
6771
@Composable
@@ -95,5 +99,7 @@ enum class DodamIcons {
9599
Dev -> vectorResource(Res.drawable.ic_dev)
96100
Close -> vectorResource(Res.drawable.ic_close_line)
97101
FullMoonFace -> vectorResource(Res.drawable.ic_full_moon_face)
102+
Pen -> vectorResource(Res.drawable.ic_pen)
103+
Chart -> vectorResource(Res.drawable.ic_chart)
98104
}
99105
}

0 commit comments

Comments
 (0)