-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
744 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
domain/src/main/java/com/whyranoid/domain/model/challenge/BadgeInfo.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.whyranoid.domain.model.challenge | ||
|
||
import androidx.annotation.DrawableRes | ||
|
||
data class BadgeInfo ( | ||
val id: Int, | ||
@DrawableRes val image: Int, | ||
val name: String, | ||
val receivedAt: String = "" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
presentation/src/main/java/com/whyranoid/presentation/component/button/WalkieNormalButton.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package com.whyranoid.presentation.component.button | ||
|
||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material.Button | ||
import androidx.compose.material.ButtonDefaults | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.text.TextStyle | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import androidx.compose.ui.unit.sp | ||
import com.whyranoid.presentation.theme.WalkieTheme | ||
|
||
@Composable | ||
fun WalkieNormalButton( | ||
buttonText: String, | ||
onButtonClick: () -> Unit, | ||
) { | ||
Button( | ||
onClick = { | ||
onButtonClick() | ||
}, | ||
colors = ButtonDefaults.buttonColors( | ||
contentColor = Color.Black, | ||
disabledContentColor = Color.Black, | ||
backgroundColor = Color(0xFFEEEEEE) | ||
), | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.height(34.dp), | ||
shape = RoundedCornerShape(7.dp), | ||
elevation = null | ||
) { | ||
Text( | ||
text = buttonText, | ||
style = TextStyle( | ||
color = Color.Black, | ||
fontSize = 14.sp | ||
) | ||
) | ||
} | ||
} | ||
|
||
@Preview | ||
@Composable | ||
fun WalkieNormalButtonPreview() { | ||
WalkieTheme { | ||
WalkieNormalButton("전체 뱃지 보기") {} | ||
} | ||
} |
72 changes: 72 additions & 0 deletions
72
presentation/src/main/java/com/whyranoid/presentation/reusable/BadgeItem.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package com.whyranoid.presentation.reusable | ||
|
||
import androidx.compose.foundation.Image | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.foundation.layout.heightIn | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.foundation.layout.widthIn | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.res.painterResource | ||
import androidx.compose.ui.text.style.TextAlign | ||
import androidx.compose.ui.text.style.TextOverflow | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import com.whyranoid.domain.model.challenge.BadgeInfo | ||
import com.whyranoid.presentation.R | ||
import com.whyranoid.presentation.theme.WalkieTheme | ||
import com.whyranoid.presentation.theme.WalkieTypography | ||
|
||
@Composable | ||
fun BadgeItem( | ||
badgeInfo: BadgeInfo | ||
) { | ||
Column( | ||
horizontalAlignment = Alignment.CenterHorizontally | ||
) { | ||
Box( | ||
modifier = Modifier | ||
.size(54.dp) | ||
.align(Alignment.CenterHorizontally) | ||
) { | ||
Image( | ||
painter = painterResource(badgeInfo.image), | ||
contentDescription = null | ||
) | ||
} | ||
|
||
Spacer( | ||
modifier = Modifier.height(4.dp) | ||
) | ||
|
||
Text( | ||
text = badgeInfo.name, | ||
textAlign = TextAlign.Center, | ||
maxLines = 2, | ||
overflow = TextOverflow.Ellipsis, | ||
style = WalkieTypography.Body2, | ||
modifier = Modifier | ||
.widthIn(max = 62.dp) | ||
.heightIn(max = 24.dp) | ||
) | ||
} | ||
} | ||
|
||
@Preview | ||
@Composable | ||
private fun BadgePreview() { | ||
WalkieTheme { | ||
BadgeItem( | ||
BadgeInfo( | ||
1, | ||
R.drawable.badge_test_2, | ||
"test" | ||
) | ||
) | ||
} | ||
} |
Oops, something went wrong.