Compare commits
3 Commits
master
...
feature/IS
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
00f2ec73d5 | ||
| 53cd5976bb | |||
|
|
841d9221a6 |
@@ -31,7 +31,7 @@ fun HourItemView(
|
||||
modifier: Modifier = Modifier,
|
||||
hour: Int = 0,
|
||||
onClick: () -> Unit = {},
|
||||
title:String = ""
|
||||
title: String = ""
|
||||
) {
|
||||
Row(modifier = modifier,
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
@@ -129,4 +129,4 @@ fun PreviewHourItemView() {
|
||||
title = "Hour Item View"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ fun LifeTimeView(
|
||||
|
||||
// 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 <= 4) {
|
||||
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(
|
||||
@@ -108,4 +121,4 @@ fun LifeTimeView(
|
||||
@Composable
|
||||
fun PreviewLifeTimeView() {
|
||||
LifeTimeView()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.border
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
@@ -13,15 +14,19 @@ import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material3.HorizontalDivider
|
||||
import androidx.compose.material3.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.text.style.TextAlign
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.laseroptek.raman.const.temperatureTypes
|
||||
import com.laseroptek.raman.data.model.serial.Temperature
|
||||
import com.laseroptek.raman.ui.theme.RobotoTypography
|
||||
import com.laseroptek.raman.utils.ext.px
|
||||
import timber.log.Timber
|
||||
|
||||
@@ -56,7 +61,33 @@ fun TemperatureView(
|
||||
),
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.height(10.px.dp))
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(start = 20.px.dp, end = 20.px.dp),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Spacer(modifier = Modifier.weight(1.5f))
|
||||
Text(
|
||||
modifier = Modifier.weight(1f),
|
||||
text = "Read",
|
||||
style = RobotoTypography.labelMedium,
|
||||
fontSize = 12.px.sp,
|
||||
color = Color.Black,
|
||||
textAlign = TextAlign.End
|
||||
)
|
||||
Text(
|
||||
modifier = Modifier.weight(1f),
|
||||
text = "Write",
|
||||
style = RobotoTypography.labelMedium,
|
||||
fontSize = 12.px.sp,
|
||||
color = Color.Black,
|
||||
textAlign = TextAlign.End
|
||||
)
|
||||
Spacer(modifier = Modifier.weight(1f))
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(2.px.dp))
|
||||
|
||||
// Tempearture
|
||||
for (i in 0..temperatureTypes.size -1) {
|
||||
@@ -116,4 +147,4 @@ fun TemperatureView(
|
||||
@Composable
|
||||
fun PreviewSerialNumber() {
|
||||
TemperatureView()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,25 +75,6 @@ fun TwoCountItemView(
|
||||
)
|
||||
}
|
||||
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.weight(1f)
|
||||
.height(30.px.dp),
|
||||
verticalArrangement = Arrangement.Center,
|
||||
horizontalAlignment = Alignment.Start
|
||||
) {
|
||||
Text(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
text = "Read",
|
||||
style = RobotoTypography.bodyMedium,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 12.px.sp,
|
||||
color = Color.Black,
|
||||
textAlign = TextAlign.End
|
||||
)
|
||||
}
|
||||
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
@@ -113,25 +94,6 @@ fun TwoCountItemView(
|
||||
)
|
||||
}
|
||||
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.weight(1f)
|
||||
.height(30.px.dp),
|
||||
verticalArrangement = Arrangement.Center,
|
||||
horizontalAlignment = Alignment.Start
|
||||
) {
|
||||
Text(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
text = "Write",
|
||||
style = RobotoTypography.bodyMedium,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 12.px.sp,
|
||||
color = Color.Black,
|
||||
textAlign = TextAlign.End
|
||||
)
|
||||
}
|
||||
|
||||
Column(
|
||||
modifier = Modifier
|
||||
//.noRippleClickable(onClick = onDeviceOpTimeClick)
|
||||
|
||||
Reference in New Issue
Block a user