Add filters
This commit is contained in:
parent
1270f48422
commit
7afa2861e7
|
|
@ -199,27 +199,26 @@ private fun BleItem(
|
||||||
val highAlpha = ContentAlpha.high
|
val highAlpha = ContentAlpha.high
|
||||||
val disabledAlpha = ContentAlpha.disabled
|
val disabledAlpha = ContentAlpha.disabled
|
||||||
|
|
||||||
var alpha by remember {
|
|
||||||
mutableStateOf(
|
var time by remember {
|
||||||
if(SystemClock.elapsedRealtime() - ble.scanTime > 10_000){
|
mutableLongStateOf(
|
||||||
disabledAlpha
|
SystemClock.elapsedRealtime()
|
||||||
} else {
|
|
||||||
highAlpha
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
LaunchedEffect(ble.scanTime) {
|
LaunchedEffect(ble.scanTime) {
|
||||||
while(true) {
|
while(true) {
|
||||||
alpha = if(SystemClock.elapsedRealtime() - ble.scanTime > 10_000){
|
time = SystemClock.elapsedRealtime()
|
||||||
|
delay(100)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var alpha = if(SystemClock.elapsedRealtime() - ble.scanTime > 10_000){
|
||||||
disabledAlpha
|
disabledAlpha
|
||||||
} else {
|
} else {
|
||||||
highAlpha
|
highAlpha
|
||||||
}
|
}
|
||||||
|
|
||||||
delay(800)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
|
@ -338,8 +337,7 @@ private fun BleItem(
|
||||||
Icon(
|
Icon(
|
||||||
modifier = Modifier.size(16.dp),
|
modifier = Modifier.size(16.dp),
|
||||||
imageVector = Icons.Rounded.ArrowRightAlt,
|
imageVector = Icons.Rounded.ArrowRightAlt,
|
||||||
contentDescription = null,
|
contentDescription = null
|
||||||
tint = color
|
|
||||||
)
|
)
|
||||||
|
|
||||||
Box {
|
Box {
|
||||||
|
|
@ -356,7 +354,7 @@ private fun BleItem(
|
||||||
modifier = Modifier.alpha(0f)
|
modifier = Modifier.alpha(0f)
|
||||||
)
|
)
|
||||||
|
|
||||||
val lastAdv = ((SystemClock.elapsedRealtime() - ble.scanTime) / 1_000)
|
val lastAdv = ((time - ble.scanTime) / 1_000)
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
style = MaterialTheme.typography.bodyMedium,
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue