mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-06-23 22:06:05 +02:00
46e734fc8e
* Migrate to multiplatform string resources * Move plurals translations into separate files * Fix lint check on generated files
44 lines
1.3 KiB
Kotlin
44 lines
1.3 KiB
Kotlin
package eu.kanade.presentation.more.settings.screen
|
|
|
|
import androidx.compose.foundation.layout.RowScope
|
|
import androidx.compose.runtime.Composable
|
|
import androidx.compose.runtime.ReadOnlyComposable
|
|
import cafe.adriel.voyager.core.screen.Screen
|
|
import dev.icerock.moko.resources.StringResource
|
|
import eu.kanade.presentation.more.settings.Preference
|
|
import eu.kanade.presentation.more.settings.PreferenceScaffold
|
|
import eu.kanade.presentation.util.LocalBackPress
|
|
|
|
interface SearchableSettings : Screen {
|
|
|
|
@Composable
|
|
@ReadOnlyComposable
|
|
fun getTitleRes(): StringResource
|
|
|
|
@Composable
|
|
fun getPreferences(): List<Preference>
|
|
|
|
@Composable
|
|
fun RowScope.AppBarAction() {
|
|
}
|
|
|
|
@Composable
|
|
override fun Content() {
|
|
val handleBack = LocalBackPress.current
|
|
PreferenceScaffold(
|
|
titleRes = getTitleRes(),
|
|
onBackPressed = if (handleBack != null) handleBack::invoke else null,
|
|
actions = { AppBarAction() },
|
|
itemsProvider = { getPreferences() },
|
|
)
|
|
}
|
|
|
|
companion object {
|
|
// HACK: for the background blipping thingy.
|
|
// The title of the target PreferenceItem
|
|
// Set before showing the destination screen and reset after
|
|
// See BasePreferenceWidget.highlightBackground
|
|
var highlightKey: String? = null
|
|
}
|
|
}
|