Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: 내역상세 & 성장 레벨 QA #112

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import ac.dnd.mour.android.presentation.common.theme.Caption2
import ac.dnd.mour.android.presentation.common.theme.Gray000
import ac.dnd.mour.android.presentation.common.theme.Gray200
import ac.dnd.mour.android.presentation.common.theme.Gray600
import ac.dnd.mour.android.presentation.common.theme.Gray700
import ac.dnd.mour.android.presentation.common.theme.Gray800
import ac.dnd.mour.android.presentation.common.theme.Headline3
import ac.dnd.mour.android.presentation.common.theme.Primary1
Expand All @@ -28,20 +29,20 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.material.Card
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import java.text.DecimalFormat
import kotlinx.datetime.LocalDate
import java.text.DecimalFormat

@Composable
fun HistoryDetailItem(
Expand All @@ -50,12 +51,13 @@ fun HistoryDetailItem(
) {
val currentViewWidth = LocalConfiguration.current.screenWidthDp.dp

Card(
shape = Shapes.medium,
backgroundColor = Gray000,
modifier = Modifier.clickable {
onClick(relatedHeart)
}
Box(
modifier = Modifier
.clip(Shapes.medium)
.background(Gray000)
.clickable {
onClick(relatedHeart)
}
) {
Box(
modifier = Modifier
Expand Down Expand Up @@ -109,16 +111,18 @@ fun HistoryDetailItem(
fontWeight = FontWeight.Normal
)
if (measureTextWidth(relatedHeart.memo, memeStyle) <= currentViewWidth - 80.dp) {
Row(verticalAlignment = Alignment.CenterVertically) {
Image(
painter = painterResource(R.drawable.ic_board),
contentDescription = null
)
Spacer(modifier = Modifier.width(6.dp))
Text(
text = relatedHeart.memo,
style = memeStyle
)
if (relatedHeart.memo.isNotEmpty()) {
Row(verticalAlignment = Alignment.CenterVertically) {
Image(
painter = painterResource(R.drawable.ic_board),
contentDescription = null
)
Spacer(modifier = Modifier.width(6.dp))
Text(
text = relatedHeart.memo,
style = memeStyle
)
}
}
}
Spacer(modifier = Modifier.height(6.dp))
Expand All @@ -138,7 +142,7 @@ fun HistoryDetailItem(
Text(
text = tag,
style = Caption2.merge(
color = Gray600,
color = Gray700,
fontWeight = FontWeight.Medium
),
lineHeight = 18.sp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import ac.dnd.mour.android.presentation.common.theme.Gray400
import ac.dnd.mour.android.presentation.common.theme.Gray500
import ac.dnd.mour.android.presentation.common.theme.Gray600
import ac.dnd.mour.android.presentation.common.theme.Gray700
import ac.dnd.mour.android.presentation.common.theme.Gray800
import ac.dnd.mour.android.presentation.common.theme.Primary4
import ac.dnd.mour.android.presentation.common.theme.Shapes
import ac.dnd.mour.android.presentation.common.theme.Space24
Expand Down Expand Up @@ -119,13 +120,13 @@ fun HistoryDetailPageScreen(
Text(
text = viewSortType.typeName,
style = Body1.merge(
color = Gray700,
color = Gray800,
fontWeight = FontWeight.Medium
)
)
Spacer(modifier = Modifier.width(2.dp))
Image(
painter = painterResource(R.drawable.ic_chevron_down),
painter = painterResource(R.drawable.ic_chevron_down_history),
contentDescription = null,
modifier = Modifier.size(16.dp)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import ac.dnd.mour.android.presentation.common.theme.Gray200
import ac.dnd.mour.android.presentation.common.theme.Gray600
import ac.dnd.mour.android.presentation.common.theme.Gray700
import ac.dnd.mour.android.presentation.common.theme.Gray800
import ac.dnd.mour.android.presentation.common.theme.Gray900
import ac.dnd.mour.android.presentation.common.theme.Headline1
import ac.dnd.mour.android.presentation.common.theme.Headline3
import ac.dnd.mour.android.presentation.common.theme.Shapes
Expand All @@ -21,7 +22,6 @@ import ac.dnd.mour.android.presentation.ui.main.rememberApplicationState
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
Expand All @@ -32,9 +32,9 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.rememberCoroutineScope
Expand All @@ -57,12 +57,13 @@ fun HistoryDetailGrowthScreen(
handler: CoroutineExceptionHandler
) {
val scope = rememberCoroutineScope()

val scrollState = rememberScrollState()
Column(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier
.background(Gray200)
.padding(horizontal = 20.dp)
.verticalScroll(scrollState)
) {
Box(
modifier = Modifier
Expand All @@ -84,113 +85,109 @@ fun HistoryDetailGrowthScreen(
Text(
text = "성장 단계",
style = Headline1.merge(
color = Gray800,
color = Gray900,
fontWeight = FontWeight.SemiBold
)
)
Spacer(modifier = Modifier.height(2.dp))
Text(
text = "총 6단계",
style = Body1.merge(
color = Gray600,
color = Gray700,
fontWeight = FontWeight.Normal
)
)
Spacer(modifier = Modifier.height(33.dp))
LazyColumn(
verticalArrangement = Arrangement.spacedBy(5.dp)
) {
items(HistoryDetailGrowthType.entries) { type ->
Box(
HistoryDetailGrowthType.entries.forEach { type ->
Box(
modifier = Modifier
.background(Color.Transparent)
.height(102.dp)
) {
Row(
modifier = Modifier
.background(Color.Transparent)
.height(102.dp)
.padding(vertical = 7.dp)
.align(Alignment.Center)
.background(
color = Gray000,
shape = Shapes.large
)
.padding(20.dp)
.wrapContentHeight()
.fillMaxWidth(),
verticalAlignment = Alignment.CenterVertically
) {
Row(
Box(
modifier = Modifier
.padding(vertical = 7.dp)
.align(Alignment.Center)
.background(
color = Gray000,
shape = Shapes.large
color = Gray200,
shape = RoundedCornerShape(6.dp)
)
.padding(20.dp)
.wrapContentHeight()
.fillMaxWidth(),
verticalAlignment = Alignment.CenterVertically
) {
Box(
modifier = Modifier
.background(
color = Gray200,
shape = RoundedCornerShape(6.dp)
)
) {
Image(
painter = painterResource(type.iconImageResource),
contentDescription = null,
contentScale = ContentScale.Crop
)
}
Spacer(modifier = Modifier.width(12.dp))
Column {
Text(
text = type.typeName,
style = Headline3.merge(
color = Gray800,
fontWeight = FontWeight.SemiBold
)
Image(
painter = painterResource(type.iconImageResource),
contentDescription = null,
contentScale = ContentScale.Crop
)
}
Spacer(modifier = Modifier.width(12.dp))
Column {
Text(
text = type.typeName,
style = Headline3.merge(
color = Gray800,
fontWeight = FontWeight.SemiBold
)
Spacer(modifier = Modifier.height(2.dp))
Text(
text = HistoryDetailGrowthType.getTypeString(type),
style = Body1.merge(
color = Gray600,
fontWeight = FontWeight.Normal
)
)
Spacer(modifier = Modifier.height(2.dp))
Text(
text = HistoryDetailGrowthType.getTypeString(type),
style = Body1.merge(
color = Gray600,
fontWeight = FontWeight.Normal
)
}
Box(
modifier = Modifier.fillMaxSize()
) {
Text(
text = "Lv.${type.level}",
modifier = Modifier.align(Alignment.BottomEnd),
style = Body2.merge(
color = Gray600,
fontWeight = FontWeight.Normal
)
)
}
Box(
modifier = Modifier.fillMaxSize()
) {
Text(
text = "Lv.${type.level}",
modifier = Modifier.align(Alignment.BottomEnd),
style = Body2.merge(
color = Gray600,
fontWeight = FontWeight.Normal
)
}
)
}
}

if (model.currentType == type) {
Box(
modifier = Modifier
.padding(end = 20.dp)
.align(Alignment.TopEnd)
.background(
color = Gray700,
shape = RoundedCornerShape(100.dp)
)
.padding(
horizontal = 12.dp,
vertical = 5.dp
)
) {
Text(
text = "현재 달성",
style = Body2.merge(
color = Gray000,
fontWeight = FontWeight.SemiBold
)
if (model.currentType == type) {
Box(
modifier = Modifier
.padding(end = 20.dp)
.align(Alignment.TopEnd)
.background(
color = Gray700,
shape = RoundedCornerShape(100.dp)
)
.padding(
horizontal = 12.dp,
vertical = 5.dp
)
) {
Text(
text = "현재 달성",
style = Body2.merge(
color = Gray000,
fontWeight = FontWeight.SemiBold
)
}
)
}
}
}
}
Spacer(modifier = Modifier.height(31.dp))
Spacer(modifier = Modifier.height(61.dp))
}

LaunchedEffectWithLifecycle(event, handler) {
Expand Down
Loading
Loading