Skip to content

Commit

Permalink
Merge pull request #33 from Team-B1ND/feature/1.0.10
Browse files Browse the repository at this point in the history
Release 1.0.10
  • Loading branch information
8954sood authored Nov 13, 2024
2 parents d62efed + 6bb765c commit b72c935
Show file tree
Hide file tree
Showing 8 changed files with 105 additions and 21 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
40 changes: 37 additions & 3 deletions app/src/main/java/com/b1nd/dodam/designsystem/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,55 @@ 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() {
override fun onCreate(savedInstanceState: Bundle?) {
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)
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion dodam-design-system/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ mavenPublishing {
coordinates(
groupId = "com.b1nd.dodam",
artifactId = "dodam-design-system",
version = "1.0.9"
version = "1.0.10"
)

pom {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
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"
android:fillColor="#0F0F10"/>
<path
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"
android:fillColor="#0F0F10"/>
<path
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"
android:fillColor="#0F0F10"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
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"
android:fillColor="#000000"
android:fillType="evenOdd"/>
</vector>
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -30,6 +33,7 @@ fun DodamAvatar(
contentDescription: String? = null,
colorFilter: ColorFilter? = null,
alpha: Float = DefaultAlpha,
borderStroke: BorderStroke? = null,
contentScale: ContentScale = ContentScale.Fit,
) {

Expand All @@ -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,
Expand All @@ -56,6 +66,13 @@ fun DodamAvatar(
color = DodamTheme.colors.fillNormal,
shape = CircleShape
)
.`if`(borderStroke != null) {
border(
border = borderStroke!!,
shape = CircleShape
)
}

) {
Image(
modifier = Modifier
Expand All @@ -79,15 +96,15 @@ private fun DodamAsyncAvatar(
contentDescription: String?,
colorFilter: ColorFilter?,
alpha: Float,
contentScale: ContentScale
contentScale: ContentScale,
) {
AsyncImage(
modifier = modifier,
model = model,
contentDescription = contentDescription,
colorFilter = colorFilter,
alpha = alpha,
contentScale = contentScale
contentScale = contentScale,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
) {
Expand All @@ -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,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -61,7 +63,9 @@ enum class DodamIcons {
Person,
Dev,
Close,
FullMoonFace;
FullMoonFace,
Pen,
Chart;

val value: ImageVector
@Composable
Expand Down Expand Up @@ -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)
}
}

0 comments on commit b72c935

Please sign in to comment.