mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-12 12:08:56 +01:00
Migrate SettingsMainController to Compose
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package eu.kanade.presentation.more
|
||||
package eu.kanade.presentation.more.about
|
||||
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Row
|
||||
@@ -17,6 +17,7 @@ import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import eu.kanade.presentation.components.LinkIcon
|
||||
import eu.kanade.presentation.components.PreferenceRow
|
||||
import eu.kanade.presentation.more.LogoHeader
|
||||
import eu.kanade.tachiyomi.BuildConfig
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.updater.RELEASE_URL
|
||||
@@ -1,4 +1,4 @@
|
||||
package eu.kanade.presentation.more
|
||||
package eu.kanade.presentation.more.about
|
||||
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
@@ -0,0 +1,37 @@
|
||||
package eu.kanade.presentation.more.settings
|
||||
|
||||
import androidx.annotation.StringRes
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.painter.Painter
|
||||
import androidx.compose.ui.input.nestedscroll.NestedScrollConnection
|
||||
import androidx.compose.ui.input.nestedscroll.nestedScroll
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import eu.kanade.presentation.components.PreferenceRow
|
||||
|
||||
@Composable
|
||||
fun SettingsMainScreen(
|
||||
nestedScrollInterop: NestedScrollConnection,
|
||||
sections: List<SettingsSection>,
|
||||
) {
|
||||
LazyColumn(
|
||||
modifier = Modifier.nestedScroll(nestedScrollInterop),
|
||||
) {
|
||||
sections.map {
|
||||
item {
|
||||
PreferenceRow(
|
||||
title = stringResource(it.titleRes),
|
||||
painter = it.painter,
|
||||
onClick = it.onClick,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
data class SettingsSection(
|
||||
@StringRes val titleRes: Int,
|
||||
val painter: Painter,
|
||||
val onClick: () -> Unit,
|
||||
)
|
||||
Reference in New Issue
Block a user