fix: improve TRAIN_OR_LOCO merge display and settings scroll
This commit is contained in:
@@ -771,6 +771,30 @@ fun MergedTrainRecordItem(
|
|||||||
"${recordItem.locoType}-${recordItem.loco}"
|
"${recordItem.locoType}-${recordItem.loco}"
|
||||||
} else null
|
} else null
|
||||||
}
|
}
|
||||||
|
GroupBy.TRAIN_OR_LOCO -> {
|
||||||
|
val latestTrain = mergedRecord.latestRecord.train.trim()
|
||||||
|
val latestLoco = mergedRecord.latestRecord.loco.trim()
|
||||||
|
val recordTrain = recordItem.train.trim()
|
||||||
|
val recordLoco = recordItem.loco.trim()
|
||||||
|
|
||||||
|
when {
|
||||||
|
latestTrain.isNotEmpty() && latestTrain != "<NUL>" &&
|
||||||
|
recordTrain.isNotEmpty() && recordTrain != "<NUL>" &&
|
||||||
|
latestTrain == recordTrain -> {
|
||||||
|
if (recordLoco.isNotEmpty() && recordLoco != "<NUL>") {
|
||||||
|
"${recordItem.locoType}-${recordLoco}"
|
||||||
|
} else null
|
||||||
|
}
|
||||||
|
latestLoco.isNotEmpty() && latestLoco != "<NUL>" &&
|
||||||
|
recordLoco.isNotEmpty() && recordLoco != "<NUL>" &&
|
||||||
|
latestLoco == recordLoco -> {
|
||||||
|
if (recordTrain.isNotEmpty() && recordTrain != "<NUL>") {
|
||||||
|
recordTrain
|
||||||
|
} else null
|
||||||
|
}
|
||||||
|
else -> null
|
||||||
|
}
|
||||||
|
}
|
||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,13 +47,12 @@ fun SettingsScreen(
|
|||||||
val scrollState = rememberScrollState()
|
val scrollState = rememberScrollState()
|
||||||
|
|
||||||
LaunchedEffect(scrollPosition) {
|
LaunchedEffect(scrollPosition) {
|
||||||
if (scrollState.value != scrollPosition) {
|
if (scrollPosition > 0 && scrollState.value != scrollPosition) {
|
||||||
scrollState.scrollTo(scrollPosition)
|
scrollState.animateScrollTo(scrollPosition)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LaunchedEffect(scrollState.value) {
|
LaunchedEffect(scrollState.value) {
|
||||||
delay(50)
|
|
||||||
onScrollPositionChange(scrollState.value)
|
onScrollPositionChange(scrollState.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user