mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-06-24 14:26:03 +02:00
![arkon](/assets/img/avatar_default.png)
Also renaming the helper composables so it's a bit easier to find/replace everything in forks.
34 lines
1009 B
Kotlin
34 lines
1009 B
Kotlin
package eu.kanade.presentation.more.settings
|
|
|
|
import androidx.compose.foundation.layout.RowScope
|
|
import androidx.compose.runtime.Composable
|
|
import dev.icerock.moko.resources.StringResource
|
|
import eu.kanade.presentation.components.AppBar
|
|
import tachiyomi.presentation.core.components.material.Scaffold
|
|
import tachiyomi.presentation.core.i18n.stringResource
|
|
|
|
@Composable
|
|
fun PreferenceScaffold(
|
|
titleRes: StringResource,
|
|
actions: @Composable RowScope.() -> Unit = {},
|
|
onBackPressed: (() -> Unit)? = null,
|
|
itemsProvider: @Composable () -> List<Preference>,
|
|
) {
|
|
Scaffold(
|
|
topBar = {
|
|
AppBar(
|
|
title = stringResource(titleRes),
|
|
navigateUp = onBackPressed,
|
|
actions = actions,
|
|
scrollBehavior = it,
|
|
)
|
|
},
|
|
content = { contentPadding ->
|
|
PreferenceScreen(
|
|
items = itemsProvider(),
|
|
contentPadding = contentPadding,
|
|
)
|
|
},
|
|
)
|
|
}
|