Merge pull request 'LifeTimeView Count/Hour 분리' (#39) from feature/ISSUE-38 into develop

Reviewed-on: #39
This commit was merged in pull request #39.
This commit is contained in:
2026-03-03 06:23:35 +00:00
3 changed files with 37 additions and 24 deletions

View File

@@ -32,11 +32,11 @@ fun LifeTimeView(
) { ) {
Column(modifier = Modifier Column(modifier = Modifier
//.noRippleClickable(onClick = onClick) //.noRippleClickable(onClick = onClick)
.size(388.px.dp, 276.px.dp) .size(388.px.dp, 258.px.dp)
.clip(RoundedCornerShape(12.px.dp)) .clip(RoundedCornerShape(12.px.dp))
.border(width = 1.px.dp, color = Color(209, 209, 209), shape = RoundedCornerShape(10.px.dp)) .border(width = 1.px.dp, color = Color(209, 209, 209), shape = RoundedCornerShape(10.px.dp))
.background(Color.White) .background(Color.White)
.padding(16.px.dp), .padding(3.px.dp, 16.px.dp),
verticalArrangement = Arrangement.SpaceEvenly, verticalArrangement = Arrangement.SpaceEvenly,
horizontalAlignment = Alignment.CenterHorizontally horizontalAlignment = Alignment.CenterHorizontally
) { ) {
@@ -55,11 +55,11 @@ fun LifeTimeView(
), ),
) )
Spacer(modifier = Modifier.height(10.px.dp)) Spacer(modifier = Modifier.height(2.px.dp))
// Temp 0..7 // Temp 0..7
for (i in 0..lifeTimeTypes.size -1) { for (i in 0..lifeTimeTypes.size -1) {
val hour = when (i) { val value = when (i) {
0 -> lifeTime.lamp 0 -> lifeTime.lamp
1 -> lifeTime.hp5x5 1 -> lifeTime.hp5x5
2 -> lifeTime.hp7x7 2 -> lifeTime.hp7x7
@@ -70,22 +70,35 @@ fun LifeTimeView(
7 -> lifeTime.water 7 -> lifeTime.water
else -> 0 else -> 0
} }
HourItemView( val modifier = Modifier
modifier = Modifier
.fillMaxSize() .fillMaxSize()
.weight(1f) .weight(1f)
.padding( .padding(
start = 20.px.dp, start = 20.px.dp,
end = 20.px.dp, end = 20.px.dp,
//bottom = 10.px.dp //bottom = 10.px.dp
), )
title = lifeTimeTypes[i], val title = lifeTimeTypes[i]
hour = hour, val onItemClick = {
onClick = { Timber.d("onClick > Temp $i ($title)")
Timber.d("onClick > Temp $i (${lifeTimeTypes[i]})")
onClick.invoke(i) onClick.invoke(i)
} }
if (i <= 5) {
CountItemView(
modifier = modifier,
title = title,
count = value,
onClick = onItemClick
) )
} else {
HourItemView(
modifier = modifier,
title = title,
hour = value,
onClick = onItemClick
)
}
if (i < lifeTimeTypes.size -1) { if (i < lifeTimeTypes.size -1) {
HorizontalDivider( HorizontalDivider(

View File

@@ -42,7 +42,7 @@ fun TemperatureView(
.clip(RoundedCornerShape(12.px.dp)) .clip(RoundedCornerShape(12.px.dp))
.border(width = 1.px.dp, color = Color(209, 209, 209), shape = RoundedCornerShape(10.px.dp)) .border(width = 1.px.dp, color = Color(209, 209, 209), shape = RoundedCornerShape(10.px.dp))
.background(Color.White) .background(Color.White)
.padding(16.px.dp), .padding(3.px.dp, 16.px.dp),
verticalArrangement = Arrangement.SpaceEvenly, verticalArrangement = Arrangement.SpaceEvenly,
horizontalAlignment = Alignment.CenterHorizontally horizontalAlignment = Alignment.CenterHorizontally
) { ) {