🚀 Add divider to Subcategories
* Added divider to the end of each subcategory * Created SettingsSubcategory composable, which manages subcategory's appearance
This commit is contained in:
parent
998de11536
commit
2dbd70e439
18 changed files with 261 additions and 388 deletions
|
|
@ -58,6 +58,7 @@ fun BrowseFilterBottomSheet() {
|
|||
LazyColumn(Modifier.fillMaxSize()) {
|
||||
BrowseGeneralSubcategory(
|
||||
showTitle = false,
|
||||
showDivider = false,
|
||||
topPadding = 16.dp,
|
||||
bottomPadding = 8.dp + it
|
||||
)
|
||||
|
|
@ -68,6 +69,7 @@ fun BrowseFilterBottomSheet() {
|
|||
LazyColumn(Modifier.fillMaxSize()) {
|
||||
BrowseFilterSubcategory(
|
||||
showTitle = false,
|
||||
showDivider = false,
|
||||
topPadding = 16.dp,
|
||||
bottomPadding = 8.dp + it
|
||||
)
|
||||
|
|
@ -78,6 +80,7 @@ fun BrowseFilterBottomSheet() {
|
|||
LazyColumn(Modifier.fillMaxSize()) {
|
||||
BrowseSortSubcategory(
|
||||
showTitle = false,
|
||||
showDivider = false,
|
||||
topPadding = 16.dp,
|
||||
bottomPadding = 8.dp + it
|
||||
)
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@ fun ReaderSettingsBottomSheet() {
|
|||
)
|
||||
MiscSubcategory(
|
||||
titleColor = { MaterialTheme.colorScheme.onSurface },
|
||||
showDivider = false,
|
||||
topPadding = 22.dp,
|
||||
bottomPadding = 8.dp + it
|
||||
)
|
||||
|
|
@ -113,6 +114,7 @@ fun ReaderSettingsBottomSheet() {
|
|||
)
|
||||
TranslatorSubcategory(
|
||||
titleColor = { MaterialTheme.colorScheme.onSurface },
|
||||
showDivider = false,
|
||||
topPadding = 22.dp,
|
||||
bottomPadding = 8.dp + it
|
||||
)
|
||||
|
|
@ -123,6 +125,7 @@ fun ReaderSettingsBottomSheet() {
|
|||
LazyColumn(Modifier.fillMaxSize()) {
|
||||
ColorsSubcategory(
|
||||
showTitle = false,
|
||||
showDivider = false,
|
||||
backgroundColor = { MaterialTheme.colorScheme.surfaceContainer },
|
||||
topPadding = 16.dp,
|
||||
bottomPadding = 8.dp + it
|
||||
|
|
|
|||
|
|
@ -0,0 +1,67 @@
|
|||
@file:Suppress("FunctionName")
|
||||
|
||||
package ua.acclorite.book_story.presentation.screens.settings.components
|
||||
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.lazy.LazyListScope
|
||||
import androidx.compose.material3.HorizontalDivider
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.coerceAtLeast
|
||||
import androidx.compose.ui.unit.dp
|
||||
import ua.acclorite.book_story.presentation.core.components.CategoryTitle
|
||||
|
||||
/**
|
||||
* Settings Subcategory.
|
||||
* Root for all Subcategories.
|
||||
*
|
||||
* @param titleColor The color of the title.
|
||||
* @param title The title.
|
||||
* @param showTitle Whether title should be shown.
|
||||
* @param showDivider Whether divider at the end of the category should be shown.
|
||||
* @param topPadding Top padding.
|
||||
* @param bottomPadding Bottom padding.
|
||||
* @param content Settings to be placed inside this subcategory.
|
||||
*/
|
||||
fun LazyListScope.SettingsSubcategory(
|
||||
titleColor: @Composable () -> Color,
|
||||
title: @Composable () -> String,
|
||||
showTitle: Boolean,
|
||||
showDivider: Boolean,
|
||||
topPadding: Dp,
|
||||
bottomPadding: Dp,
|
||||
content: LazyListScope.() -> Unit
|
||||
) {
|
||||
item {
|
||||
if (showTitle) {
|
||||
CategoryTitle(
|
||||
title = title.invoke(),
|
||||
color = titleColor.invoke(),
|
||||
modifier = Modifier
|
||||
.padding(
|
||||
top = topPadding,
|
||||
bottom = 8.dp
|
||||
)
|
||||
)
|
||||
} else {
|
||||
Spacer(
|
||||
modifier = Modifier.height((topPadding - 8.dp).coerceAtLeast(0.dp))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
content()
|
||||
|
||||
item {
|
||||
if (showDivider) {
|
||||
Spacer(modifier = Modifier.height(10.dp))
|
||||
HorizontalDivider()
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(bottomPadding))
|
||||
}
|
||||
}
|
||||
|
|
@ -31,6 +31,7 @@ fun LazyListScope.AppearanceSettingsCategory(
|
|||
)
|
||||
ColorsSubcategory(
|
||||
titleColor = titleColor,
|
||||
showDivider = false,
|
||||
topPadding = 22.dp,
|
||||
bottomPadding = bottomPadding
|
||||
)
|
||||
|
|
|
|||
|
|
@ -2,20 +2,14 @@
|
|||
|
||||
package ua.acclorite.book_story.presentation.screens.settings.nested.appearance.components.subcategories
|
||||
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.lazy.LazyListScope
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.coerceAtLeast
|
||||
import androidx.compose.ui.unit.dp
|
||||
import ua.acclorite.book_story.R
|
||||
import ua.acclorite.book_story.presentation.core.components.CategoryTitle
|
||||
import ua.acclorite.book_story.presentation.screens.settings.components.SettingsSubcategory
|
||||
import ua.acclorite.book_story.presentation.screens.settings.nested.appearance.components.settings.ColorPresetSetting
|
||||
import ua.acclorite.book_story.presentation.screens.settings.nested.appearance.components.settings.FastColorPresetChangeSetting
|
||||
|
||||
|
|
@ -28,27 +22,18 @@ fun LazyListScope.ColorsSubcategory(
|
|||
title: @Composable () -> String = { stringResource(id = R.string.colors_appearance_settings) },
|
||||
backgroundColor: @Composable () -> Color = { MaterialTheme.colorScheme.surfaceContainerLow },
|
||||
showTitle: Boolean = true,
|
||||
showDivider: Boolean = true,
|
||||
topPadding: Dp,
|
||||
bottomPadding: Dp
|
||||
) {
|
||||
item {
|
||||
if (showTitle) {
|
||||
CategoryTitle(
|
||||
title = title.invoke(),
|
||||
color = titleColor.invoke(),
|
||||
modifier = Modifier
|
||||
.padding(
|
||||
top = topPadding,
|
||||
bottom = 8.dp
|
||||
)
|
||||
)
|
||||
} else {
|
||||
Spacer(
|
||||
modifier = Modifier.height((topPadding - 8.dp).coerceAtLeast(0.dp))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
SettingsSubcategory(
|
||||
titleColor = titleColor,
|
||||
title = title,
|
||||
showTitle = showTitle,
|
||||
showDivider = showDivider,
|
||||
topPadding = topPadding,
|
||||
bottomPadding = bottomPadding
|
||||
) {
|
||||
item {
|
||||
ColorPresetSetting(backgroundColor = backgroundColor.invoke())
|
||||
}
|
||||
|
|
@ -56,10 +41,5 @@ fun LazyListScope.ColorsSubcategory(
|
|||
item {
|
||||
FastColorPresetChangeSetting()
|
||||
}
|
||||
|
||||
item {
|
||||
Spacer(
|
||||
modifier = Modifier.height(bottomPadding)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -2,20 +2,14 @@
|
|||
|
||||
package ua.acclorite.book_story.presentation.screens.settings.nested.appearance.components.subcategories
|
||||
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.lazy.LazyListScope
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.coerceAtLeast
|
||||
import androidx.compose.ui.unit.dp
|
||||
import ua.acclorite.book_story.R
|
||||
import ua.acclorite.book_story.presentation.core.components.CategoryTitle
|
||||
import ua.acclorite.book_story.presentation.screens.settings.components.SettingsSubcategory
|
||||
import ua.acclorite.book_story.presentation.screens.settings.nested.appearance.components.settings.AbsoluteDarkSetting
|
||||
import ua.acclorite.book_story.presentation.screens.settings.nested.appearance.components.settings.DarkThemeSetting
|
||||
import ua.acclorite.book_story.presentation.screens.settings.nested.appearance.components.settings.PureDarkSetting
|
||||
|
|
@ -30,27 +24,18 @@ fun LazyListScope.ThemePreferencesSubcategory(
|
|||
titleColor: @Composable () -> Color = { MaterialTheme.colorScheme.primary },
|
||||
title: @Composable () -> String = { stringResource(id = R.string.theme_appearance_settings) },
|
||||
showTitle: Boolean = true,
|
||||
showDivider: Boolean = true,
|
||||
topPadding: Dp,
|
||||
bottomPadding: Dp
|
||||
) {
|
||||
item {
|
||||
if (showTitle) {
|
||||
CategoryTitle(
|
||||
title = title.invoke(),
|
||||
color = titleColor.invoke(),
|
||||
modifier = Modifier
|
||||
.padding(
|
||||
top = topPadding,
|
||||
bottom = 8.dp
|
||||
)
|
||||
)
|
||||
} else {
|
||||
Spacer(
|
||||
modifier = Modifier.height((topPadding - 8.dp).coerceAtLeast(0.dp))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
SettingsSubcategory(
|
||||
titleColor = titleColor,
|
||||
title = title,
|
||||
showTitle = showTitle,
|
||||
showDivider = showDivider,
|
||||
topPadding = topPadding,
|
||||
bottomPadding = bottomPadding
|
||||
) {
|
||||
item {
|
||||
DarkThemeSetting()
|
||||
}
|
||||
|
|
@ -70,10 +55,5 @@ fun LazyListScope.ThemePreferencesSubcategory(
|
|||
item {
|
||||
AbsoluteDarkSetting()
|
||||
}
|
||||
|
||||
item {
|
||||
Spacer(
|
||||
modifier = Modifier.height(bottomPadding)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -29,6 +29,7 @@ fun LazyListScope.BrowseSettingsCategory(
|
|||
bottomPadding = 0.dp
|
||||
)
|
||||
BrowseSortSubcategory(
|
||||
showDivider = false,
|
||||
topPadding = 22.dp,
|
||||
bottomPadding = bottomPadding
|
||||
)
|
||||
|
|
|
|||
|
|
@ -2,20 +2,14 @@
|
|||
|
||||
package ua.acclorite.book_story.presentation.screens.settings.nested.browse.components.subcategories
|
||||
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.lazy.LazyListScope
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.coerceAtLeast
|
||||
import androidx.compose.ui.unit.dp
|
||||
import ua.acclorite.book_story.R
|
||||
import ua.acclorite.book_story.presentation.core.components.CategoryTitle
|
||||
import ua.acclorite.book_story.presentation.screens.settings.components.SettingsSubcategory
|
||||
import ua.acclorite.book_story.presentation.screens.settings.nested.browse.components.settings.BrowseFilterSetting
|
||||
|
||||
/**
|
||||
|
|
@ -26,32 +20,18 @@ fun LazyListScope.BrowseFilterSubcategory(
|
|||
titleColor: @Composable () -> Color = { MaterialTheme.colorScheme.primary },
|
||||
title: @Composable () -> String = { stringResource(id = R.string.filter_browse_settings) },
|
||||
showTitle: Boolean = true,
|
||||
showDivider: Boolean = true,
|
||||
topPadding: Dp,
|
||||
bottomPadding: Dp
|
||||
) {
|
||||
item {
|
||||
if (showTitle) {
|
||||
CategoryTitle(
|
||||
title = title.invoke(),
|
||||
color = titleColor.invoke(),
|
||||
modifier = Modifier
|
||||
.padding(
|
||||
top = topPadding,
|
||||
bottom = 8.dp
|
||||
)
|
||||
)
|
||||
} else {
|
||||
Spacer(
|
||||
modifier = Modifier.height((topPadding - 8.dp).coerceAtLeast(0.dp))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
SettingsSubcategory(
|
||||
titleColor = titleColor,
|
||||
title = title,
|
||||
showTitle = showTitle,
|
||||
showDivider = showDivider,
|
||||
topPadding = topPadding,
|
||||
bottomPadding = bottomPadding
|
||||
) {
|
||||
BrowseFilterSetting()
|
||||
|
||||
item {
|
||||
Spacer(
|
||||
modifier = Modifier.height(bottomPadding)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -2,20 +2,14 @@
|
|||
|
||||
package ua.acclorite.book_story.presentation.screens.settings.nested.browse.components.subcategories
|
||||
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.lazy.LazyListScope
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.coerceAtLeast
|
||||
import androidx.compose.ui.unit.dp
|
||||
import ua.acclorite.book_story.R
|
||||
import ua.acclorite.book_story.presentation.core.components.CategoryTitle
|
||||
import ua.acclorite.book_story.presentation.screens.settings.components.SettingsSubcategory
|
||||
import ua.acclorite.book_story.presentation.screens.settings.nested.browse.components.settings.BrowseFilesStructureSetting
|
||||
import ua.acclorite.book_story.presentation.screens.settings.nested.browse.components.settings.BrowseGridSizeSetting
|
||||
import ua.acclorite.book_story.presentation.screens.settings.nested.browse.components.settings.BrowseLayoutSetting
|
||||
|
|
@ -29,27 +23,18 @@ fun LazyListScope.BrowseGeneralSubcategory(
|
|||
titleColor: @Composable () -> Color = { MaterialTheme.colorScheme.primary },
|
||||
title: @Composable () -> String = { stringResource(id = R.string.general_browse_settings) },
|
||||
showTitle: Boolean = true,
|
||||
showDivider: Boolean = true,
|
||||
topPadding: Dp,
|
||||
bottomPadding: Dp
|
||||
) {
|
||||
item {
|
||||
if (showTitle) {
|
||||
CategoryTitle(
|
||||
title = title.invoke(),
|
||||
color = titleColor.invoke(),
|
||||
modifier = Modifier
|
||||
.padding(
|
||||
top = topPadding,
|
||||
bottom = 8.dp
|
||||
)
|
||||
)
|
||||
} else {
|
||||
Spacer(
|
||||
modifier = Modifier.height((topPadding - 8.dp).coerceAtLeast(0.dp))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
SettingsSubcategory(
|
||||
titleColor = titleColor,
|
||||
title = title,
|
||||
showTitle = showTitle,
|
||||
showDivider = showDivider,
|
||||
topPadding = topPadding,
|
||||
bottomPadding = bottomPadding
|
||||
) {
|
||||
item {
|
||||
BrowseFilesStructureSetting()
|
||||
}
|
||||
|
|
@ -65,10 +50,5 @@ fun LazyListScope.BrowseGeneralSubcategory(
|
|||
item {
|
||||
BrowseGridSizeSetting()
|
||||
}
|
||||
|
||||
item {
|
||||
Spacer(
|
||||
modifier = Modifier.height(bottomPadding)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -2,20 +2,14 @@
|
|||
|
||||
package ua.acclorite.book_story.presentation.screens.settings.nested.browse.components.subcategories
|
||||
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.lazy.LazyListScope
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.coerceAtLeast
|
||||
import androidx.compose.ui.unit.dp
|
||||
import ua.acclorite.book_story.R
|
||||
import ua.acclorite.book_story.presentation.core.components.CategoryTitle
|
||||
import ua.acclorite.book_story.presentation.screens.settings.components.SettingsSubcategory
|
||||
import ua.acclorite.book_story.presentation.screens.settings.nested.browse.components.settings.BrowseSortOrderSetting
|
||||
|
||||
/**
|
||||
|
|
@ -26,32 +20,18 @@ fun LazyListScope.BrowseSortSubcategory(
|
|||
titleColor: @Composable () -> Color = { MaterialTheme.colorScheme.primary },
|
||||
title: @Composable () -> String = { stringResource(id = R.string.sort_browse_settings) },
|
||||
showTitle: Boolean = true,
|
||||
showDivider: Boolean = true,
|
||||
topPadding: Dp,
|
||||
bottomPadding: Dp
|
||||
) {
|
||||
item {
|
||||
if (showTitle) {
|
||||
CategoryTitle(
|
||||
title = title.invoke(),
|
||||
color = titleColor.invoke(),
|
||||
modifier = Modifier
|
||||
.padding(
|
||||
top = topPadding,
|
||||
bottom = 8.dp
|
||||
)
|
||||
)
|
||||
} else {
|
||||
Spacer(
|
||||
modifier = Modifier.height((topPadding - 8.dp).coerceAtLeast(0.dp))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
SettingsSubcategory(
|
||||
titleColor = titleColor,
|
||||
title = title,
|
||||
showTitle = showTitle,
|
||||
showDivider = showDivider,
|
||||
topPadding = topPadding,
|
||||
bottomPadding = bottomPadding
|
||||
) {
|
||||
BrowseSortOrderSetting()
|
||||
|
||||
item {
|
||||
Spacer(
|
||||
modifier = Modifier.height(bottomPadding)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -25,9 +25,7 @@ fun LazyListScope.GeneralSettingsCategory(
|
|||
bottomPadding: Dp = 48.dp
|
||||
) {
|
||||
item {
|
||||
Spacer(
|
||||
modifier = Modifier.height((topPadding - 8.dp).coerceAtLeast(0.dp))
|
||||
)
|
||||
Spacer(modifier = Modifier.height((topPadding - 8.dp).coerceAtLeast(0.dp)))
|
||||
}
|
||||
|
||||
item {
|
||||
|
|
@ -43,8 +41,6 @@ fun LazyListScope.GeneralSettingsCategory(
|
|||
}
|
||||
|
||||
item {
|
||||
Spacer(
|
||||
modifier = Modifier.height(bottomPadding)
|
||||
)
|
||||
Spacer(modifier = Modifier.height(bottomPadding))
|
||||
}
|
||||
}
|
||||
|
|
@ -50,6 +50,7 @@ fun LazyListScope.ReaderSettingsCategory(
|
|||
)
|
||||
MiscSubcategory(
|
||||
titleColor = titleColor,
|
||||
showDivider = false,
|
||||
topPadding = 22.dp,
|
||||
bottomPadding = bottomPadding
|
||||
)
|
||||
|
|
|
|||
|
|
@ -2,20 +2,14 @@
|
|||
|
||||
package ua.acclorite.book_story.presentation.screens.settings.nested.reader.components.subcategories
|
||||
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.lazy.LazyListScope
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.coerceAtLeast
|
||||
import androidx.compose.ui.unit.dp
|
||||
import ua.acclorite.book_story.R
|
||||
import ua.acclorite.book_story.presentation.core.components.CategoryTitle
|
||||
import ua.acclorite.book_story.presentation.screens.settings.components.SettingsSubcategory
|
||||
import ua.acclorite.book_story.presentation.screens.settings.nested.reader.components.settings.FontFamilySetting
|
||||
import ua.acclorite.book_story.presentation.screens.settings.nested.reader.components.settings.FontSizeSetting
|
||||
import ua.acclorite.book_story.presentation.screens.settings.nested.reader.components.settings.FontStyleSetting
|
||||
|
|
@ -29,27 +23,18 @@ fun LazyListScope.FontSubcategory(
|
|||
titleColor: @Composable () -> Color = { MaterialTheme.colorScheme.primary },
|
||||
title: @Composable () -> String = { stringResource(id = R.string.font_reader_settings) },
|
||||
showTitle: Boolean = true,
|
||||
showDivider: Boolean = true,
|
||||
topPadding: Dp,
|
||||
bottomPadding: Dp
|
||||
) {
|
||||
item {
|
||||
if (showTitle) {
|
||||
CategoryTitle(
|
||||
title = title.invoke(),
|
||||
color = titleColor.invoke(),
|
||||
modifier = Modifier
|
||||
.padding(
|
||||
top = topPadding,
|
||||
bottom = 8.dp
|
||||
)
|
||||
)
|
||||
} else {
|
||||
Spacer(
|
||||
modifier = Modifier.height((topPadding - 8.dp).coerceAtLeast(0.dp))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
SettingsSubcategory(
|
||||
titleColor = titleColor,
|
||||
title = title,
|
||||
showTitle = showTitle,
|
||||
showDivider = showDivider,
|
||||
topPadding = topPadding,
|
||||
bottomPadding = bottomPadding
|
||||
) {
|
||||
item {
|
||||
FontFamilySetting()
|
||||
}
|
||||
|
|
@ -65,10 +50,5 @@ fun LazyListScope.FontSubcategory(
|
|||
item {
|
||||
LetterSpacingSetting()
|
||||
}
|
||||
|
||||
item {
|
||||
Spacer(
|
||||
modifier = Modifier.height(bottomPadding)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -2,20 +2,14 @@
|
|||
|
||||
package ua.acclorite.book_story.presentation.screens.settings.nested.reader.components.subcategories
|
||||
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.lazy.LazyListScope
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.coerceAtLeast
|
||||
import androidx.compose.ui.unit.dp
|
||||
import ua.acclorite.book_story.R
|
||||
import ua.acclorite.book_story.presentation.core.components.CategoryTitle
|
||||
import ua.acclorite.book_story.presentation.screens.settings.components.SettingsSubcategory
|
||||
import ua.acclorite.book_story.presentation.screens.settings.nested.reader.components.settings.FullscreenSetting
|
||||
import ua.acclorite.book_story.presentation.screens.settings.nested.reader.components.settings.KeepScreenOnSetting
|
||||
|
||||
|
|
@ -27,27 +21,18 @@ fun LazyListScope.MiscSubcategory(
|
|||
titleColor: @Composable () -> Color = { MaterialTheme.colorScheme.primary },
|
||||
title: @Composable () -> String = { stringResource(id = R.string.misc_reader_settings) },
|
||||
showTitle: Boolean = true,
|
||||
showDivider: Boolean = true,
|
||||
topPadding: Dp,
|
||||
bottomPadding: Dp
|
||||
) {
|
||||
item {
|
||||
if (showTitle) {
|
||||
CategoryTitle(
|
||||
title = title.invoke(),
|
||||
color = titleColor.invoke(),
|
||||
modifier = Modifier
|
||||
.padding(
|
||||
top = topPadding,
|
||||
bottom = 8.dp
|
||||
)
|
||||
)
|
||||
} else {
|
||||
Spacer(
|
||||
modifier = Modifier.height((topPadding - 8.dp).coerceAtLeast(0.dp))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
SettingsSubcategory(
|
||||
titleColor = titleColor,
|
||||
title = title,
|
||||
showTitle = showTitle,
|
||||
showDivider = showDivider,
|
||||
topPadding = topPadding,
|
||||
bottomPadding = bottomPadding
|
||||
) {
|
||||
item {
|
||||
FullscreenSetting()
|
||||
}
|
||||
|
|
@ -55,10 +40,5 @@ fun LazyListScope.MiscSubcategory(
|
|||
item {
|
||||
KeepScreenOnSetting()
|
||||
}
|
||||
|
||||
item {
|
||||
Spacer(
|
||||
modifier = Modifier.height(bottomPadding)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -2,20 +2,14 @@
|
|||
|
||||
package ua.acclorite.book_story.presentation.screens.settings.nested.reader.components.subcategories
|
||||
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.lazy.LazyListScope
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.coerceAtLeast
|
||||
import androidx.compose.ui.unit.dp
|
||||
import ua.acclorite.book_story.R
|
||||
import ua.acclorite.book_story.presentation.core.components.CategoryTitle
|
||||
import ua.acclorite.book_story.presentation.screens.settings.components.SettingsSubcategory
|
||||
import ua.acclorite.book_story.presentation.screens.settings.nested.reader.components.settings.CutoutPaddingSetting
|
||||
import ua.acclorite.book_story.presentation.screens.settings.nested.reader.components.settings.SidePaddingSetting
|
||||
|
||||
|
|
@ -27,27 +21,18 @@ fun LazyListScope.PaddingSubcategory(
|
|||
titleColor: @Composable () -> Color = { MaterialTheme.colorScheme.primary },
|
||||
title: @Composable () -> String = { stringResource(id = R.string.padding_reader_settings) },
|
||||
showTitle: Boolean = true,
|
||||
showDivider: Boolean = true,
|
||||
topPadding: Dp,
|
||||
bottomPadding: Dp
|
||||
) {
|
||||
item {
|
||||
if (showTitle) {
|
||||
CategoryTitle(
|
||||
title = title.invoke(),
|
||||
color = titleColor.invoke(),
|
||||
modifier = Modifier
|
||||
.padding(
|
||||
top = topPadding,
|
||||
bottom = 8.dp
|
||||
)
|
||||
)
|
||||
} else {
|
||||
Spacer(
|
||||
modifier = Modifier.height((topPadding - 8.dp).coerceAtLeast(0.dp))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
SettingsSubcategory(
|
||||
titleColor = titleColor,
|
||||
title = title,
|
||||
showTitle = showTitle,
|
||||
showDivider = showDivider,
|
||||
topPadding = topPadding,
|
||||
bottomPadding = bottomPadding
|
||||
) {
|
||||
item {
|
||||
SidePaddingSetting()
|
||||
}
|
||||
|
|
@ -55,10 +40,5 @@ fun LazyListScope.PaddingSubcategory(
|
|||
item {
|
||||
CutoutPaddingSetting()
|
||||
}
|
||||
|
||||
item {
|
||||
Spacer(
|
||||
modifier = Modifier.height(bottomPadding)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -2,20 +2,14 @@
|
|||
|
||||
package ua.acclorite.book_story.presentation.screens.settings.nested.reader.components.subcategories
|
||||
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.lazy.LazyListScope
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.coerceAtLeast
|
||||
import androidx.compose.ui.unit.dp
|
||||
import ua.acclorite.book_story.R
|
||||
import ua.acclorite.book_story.presentation.core.components.CategoryTitle
|
||||
import ua.acclorite.book_story.presentation.screens.settings.components.SettingsSubcategory
|
||||
import ua.acclorite.book_story.presentation.screens.settings.nested.reader.components.settings.LineHeightSetting
|
||||
import ua.acclorite.book_story.presentation.screens.settings.nested.reader.components.settings.ParagraphHeightSetting
|
||||
import ua.acclorite.book_story.presentation.screens.settings.nested.reader.components.settings.ParagraphIndentationSetting
|
||||
|
|
@ -29,27 +23,18 @@ fun LazyListScope.TextSubcategory(
|
|||
titleColor: @Composable () -> Color = { MaterialTheme.colorScheme.primary },
|
||||
title: @Composable () -> String = { stringResource(id = R.string.text_reader_settings) },
|
||||
showTitle: Boolean = true,
|
||||
showDivider: Boolean = true,
|
||||
topPadding: Dp,
|
||||
bottomPadding: Dp
|
||||
) {
|
||||
item {
|
||||
if (showTitle) {
|
||||
CategoryTitle(
|
||||
title = title.invoke(),
|
||||
color = titleColor.invoke(),
|
||||
modifier = Modifier
|
||||
.padding(
|
||||
top = topPadding,
|
||||
bottom = 8.dp
|
||||
)
|
||||
)
|
||||
} else {
|
||||
Spacer(
|
||||
modifier = Modifier.height((topPadding - 8.dp).coerceAtLeast(0.dp))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
SettingsSubcategory(
|
||||
titleColor = titleColor,
|
||||
title = title,
|
||||
showTitle = showTitle,
|
||||
showDivider = showDivider,
|
||||
topPadding = topPadding,
|
||||
bottomPadding = bottomPadding
|
||||
) {
|
||||
item {
|
||||
TextAlignmentSetting()
|
||||
}
|
||||
|
|
@ -65,10 +50,5 @@ fun LazyListScope.TextSubcategory(
|
|||
item {
|
||||
ParagraphIndentationSetting()
|
||||
}
|
||||
|
||||
item {
|
||||
Spacer(
|
||||
modifier = Modifier.height(bottomPadding)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -2,20 +2,14 @@
|
|||
|
||||
package ua.acclorite.book_story.presentation.screens.settings.nested.reader.components.subcategories
|
||||
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.lazy.LazyListScope
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.coerceAtLeast
|
||||
import androidx.compose.ui.unit.dp
|
||||
import ua.acclorite.book_story.R
|
||||
import ua.acclorite.book_story.presentation.core.components.CategoryTitle
|
||||
import ua.acclorite.book_story.presentation.screens.settings.components.SettingsSubcategory
|
||||
import ua.acclorite.book_story.presentation.screens.settings.nested.reader.components.settings.DoubleClickTranslationSetting
|
||||
|
||||
/**
|
||||
|
|
@ -26,34 +20,20 @@ fun LazyListScope.TranslatorSubcategory(
|
|||
titleColor: @Composable () -> Color = { MaterialTheme.colorScheme.primary },
|
||||
title: @Composable () -> String = { stringResource(id = R.string.translator_reader_settings) },
|
||||
showTitle: Boolean = true,
|
||||
showDivider: Boolean = true,
|
||||
topPadding: Dp,
|
||||
bottomPadding: Dp
|
||||
) {
|
||||
item {
|
||||
if (showTitle) {
|
||||
CategoryTitle(
|
||||
title = title.invoke(),
|
||||
color = titleColor.invoke(),
|
||||
modifier = Modifier
|
||||
.padding(
|
||||
top = topPadding,
|
||||
bottom = 8.dp
|
||||
)
|
||||
)
|
||||
} else {
|
||||
Spacer(
|
||||
modifier = Modifier.height((topPadding - 8.dp).coerceAtLeast(0.dp))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
SettingsSubcategory(
|
||||
titleColor = titleColor,
|
||||
title = title,
|
||||
showTitle = showTitle,
|
||||
showDivider = showDivider,
|
||||
topPadding = topPadding,
|
||||
bottomPadding = bottomPadding
|
||||
) {
|
||||
item {
|
||||
DoubleClickTranslationSetting()
|
||||
}
|
||||
|
||||
item {
|
||||
Spacer(
|
||||
modifier = Modifier.height(bottomPadding)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -12,6 +12,7 @@ import ua.acclorite.book_story.presentation.screens.settings.nested.appearance.c
|
|||
fun LazyListScope.startAppearanceScreen() {
|
||||
ThemePreferencesSubcategory(
|
||||
title = { stringResource(id = R.string.start_theme_preferences) },
|
||||
showDivider = false,
|
||||
topPadding = 16.dp,
|
||||
bottomPadding = 8.dp
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue