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:
@@ -31,7 +31,7 @@ fun HourItemView(
|
||||
modifier: Modifier = Modifier,
|
||||
hour: Int = 0,
|
||||
onClick: () -> Unit = {},
|
||||
title:String = ""
|
||||
title: String = ""
|
||||
) {
|
||||
Row(modifier = modifier,
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
|
||||
@@ -32,11 +32,11 @@ fun LifeTimeView(
|
||||
) {
|
||||
Column(modifier = Modifier
|
||||
//.noRippleClickable(onClick = onClick)
|
||||
.size(388.px.dp, 276.px.dp)
|
||||
.size(388.px.dp, 258.px.dp)
|
||||
.clip(RoundedCornerShape(12.px.dp))
|
||||
.border(width = 1.px.dp, color = Color(209, 209, 209), shape = RoundedCornerShape(10.px.dp))
|
||||
.background(Color.White)
|
||||
.padding(16.px.dp),
|
||||
.padding(3.px.dp, 16.px.dp),
|
||||
verticalArrangement = Arrangement.SpaceEvenly,
|
||||
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
|
||||
for (i in 0..lifeTimeTypes.size -1) {
|
||||
val hour = when (i) {
|
||||
val value = when (i) {
|
||||
0 -> lifeTime.lamp
|
||||
1 -> lifeTime.hp5x5
|
||||
2 -> lifeTime.hp7x7
|
||||
@@ -70,22 +70,35 @@ fun LifeTimeView(
|
||||
7 -> lifeTime.water
|
||||
else -> 0
|
||||
}
|
||||
HourItemView(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.weight(1f)
|
||||
.padding(
|
||||
start = 20.px.dp,
|
||||
end = 20.px.dp,
|
||||
//bottom = 10.px.dp
|
||||
),
|
||||
title = lifeTimeTypes[i],
|
||||
hour = hour,
|
||||
onClick = {
|
||||
Timber.d("onClick > Temp $i (${lifeTimeTypes[i]})")
|
||||
onClick.invoke(i)
|
||||
}
|
||||
)
|
||||
val modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.weight(1f)
|
||||
.padding(
|
||||
start = 20.px.dp,
|
||||
end = 20.px.dp,
|
||||
//bottom = 10.px.dp
|
||||
)
|
||||
val title = lifeTimeTypes[i]
|
||||
val onItemClick = {
|
||||
Timber.d("onClick > Temp $i ($title)")
|
||||
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) {
|
||||
HorizontalDivider(
|
||||
|
||||
@@ -42,7 +42,7 @@ fun TemperatureView(
|
||||
.clip(RoundedCornerShape(12.px.dp))
|
||||
.border(width = 1.px.dp, color = Color(209, 209, 209), shape = RoundedCornerShape(10.px.dp))
|
||||
.background(Color.White)
|
||||
.padding(16.px.dp),
|
||||
.padding(3.px.dp, 16.px.dp),
|
||||
verticalArrangement = Arrangement.SpaceEvenly,
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user