Use kotlin.time extensions in some more places
This commit is contained in:
@@ -15,6 +15,7 @@ import eu.kanade.presentation.components.ScrollbarLazyColumn
|
||||
import eu.kanade.presentation.more.settings.screen.SearchableSettings
|
||||
import eu.kanade.presentation.more.settings.widget.PreferenceGroupHeader
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
|
||||
/**
|
||||
* Preference Screen composable which contains a list of [Preference] items
|
||||
@@ -33,7 +34,7 @@ fun PreferenceScreen(
|
||||
LaunchedEffect(Unit) {
|
||||
val i = items.findHighlightedIndex(highlightKey)
|
||||
if (i >= 0) {
|
||||
delay(500)
|
||||
delay(0.5.seconds)
|
||||
state.animateScrollToItem(i)
|
||||
}
|
||||
SearchableSettings.highlightKey = null
|
||||
|
||||
@@ -32,6 +32,7 @@ import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import eu.kanade.presentation.more.settings.LocalPreferenceHighlighted
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
|
||||
@Composable
|
||||
internal fun BasePreferenceWidget(
|
||||
@@ -89,7 +90,7 @@ internal fun Modifier.highlightBackground(highlighted: Boolean): Modifier = comp
|
||||
LaunchedEffect(Unit) {
|
||||
if (highlighted) {
|
||||
highlightFlag = true
|
||||
delay(3000)
|
||||
delay(3.seconds)
|
||||
highlightFlag = false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user