Skip to content

Commit

Permalink
🚀 Chapters Settings' subcategory
Browse files Browse the repository at this point in the history
* Moved "Chapter's title alignment" from Text to the new Chapters subcategory
  • Loading branch information
Acclorite committed Jan 7, 2025
1 parent c9832c3 commit 092bbfd
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import ua.acclorite.book_story.presentation.core.components.common.LazyColumnWit
import ua.acclorite.book_story.presentation.core.components.modal_bottom_sheet.ModalBottomSheet
import ua.acclorite.book_story.presentation.core.util.LocalActivity
import ua.acclorite.book_story.presentation.settings.appearance.colors.ColorsSubcategory
import ua.acclorite.book_story.presentation.settings.reader.chapters.ChaptersSubcategory
import ua.acclorite.book_story.presentation.settings.reader.font.FontSubcategory
import ua.acclorite.book_story.presentation.settings.reader.misc.MiscSubcategory
import ua.acclorite.book_story.presentation.settings.reader.padding.PaddingSubcategory
Expand Down Expand Up @@ -120,6 +121,9 @@ fun ReaderSettingsBottomSheet(
TextSubcategory(
titleColor = { MaterialTheme.colorScheme.onSurface }
)
ChaptersSubcategory(
titleColor = { MaterialTheme.colorScheme.onSurface }
)
TranslatorSubcategory(
titleColor = { MaterialTheme.colorScheme.onSurface },
showDivider = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import androidx.compose.foundation.lazy.LazyListScope
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import ua.acclorite.book_story.presentation.settings.reader.chapters.ChaptersSubcategory
import ua.acclorite.book_story.presentation.settings.reader.font.FontSubcategory
import ua.acclorite.book_story.presentation.settings.reader.misc.MiscSubcategory
import ua.acclorite.book_story.presentation.settings.reader.padding.PaddingSubcategory
Expand All @@ -24,6 +25,9 @@ fun LazyListScope.ReaderSettingsCategory(
TextSubcategory(
titleColor = titleColor
)
ChaptersSubcategory(
titleColor = titleColor
)
ReadingModeSubcategory(
titleColor = titleColor
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
@file:Suppress("FunctionName")

package ua.acclorite.book_story.presentation.settings.reader.chapters

import androidx.compose.foundation.lazy.LazyListScope
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import ua.acclorite.book_story.R
import ua.acclorite.book_story.presentation.settings.components.SettingsSubcategory
import ua.acclorite.book_story.presentation.settings.reader.chapters.components.ChapterTitleAlignmentOption

fun LazyListScope.ChaptersSubcategory(
titleColor: @Composable () -> Color = { MaterialTheme.colorScheme.primary },
title: @Composable () -> String = { stringResource(id = R.string.chapters_reader_settings) },
showTitle: Boolean = true,
showDivider: Boolean = true,
) {
SettingsSubcategory(
titleColor = titleColor,
title = title,
showTitle = showTitle,
showDivider = showDivider
) {
item {
ChapterTitleAlignmentOption()
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ua.acclorite.book_story.presentation.settings.reader.text.components
package ua.acclorite.book_story.presentation.settings.reader.chapters.components

import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import ua.acclorite.book_story.R
import ua.acclorite.book_story.presentation.settings.components.SettingsSubcategory
import ua.acclorite.book_story.presentation.settings.reader.text.components.ChapterTitleAlignmentOption
import ua.acclorite.book_story.presentation.settings.reader.text.components.LineHeightOption
import ua.acclorite.book_story.presentation.settings.reader.text.components.ParagraphHeightOption
import ua.acclorite.book_story.presentation.settings.reader.text.components.ParagraphIndentationOption
Expand All @@ -31,10 +30,6 @@ fun LazyListScope.TextSubcategory(
TextAlignmentOption()
}

item {
ChapterTitleAlignmentOption()
}

item {
LineHeightOption()
}
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-uk/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
<string name="reading_speed_reader_settings">Швидкість читання</string>
<string name="reading_mode_reader_settings">Режим читання</string>
<string name="system_reader_settings">Система</string>
<string name="chapters_reader_settings">Розділи</string>
<string name="theme_appearance_settings">Налаштування теми</string>
<string name="colors_appearance_settings">Кольори</string>
<string name="general_browse_settings">Головні</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@
<string name="reading_speed_reader_settings">Reading speed</string>
<string name="reading_mode_reader_settings">Reading mode</string>
<string name="system_reader_settings">System</string>
<string name="chapters_reader_settings">Chapters</string>
<string name="theme_appearance_settings">Theme preferences</string>
<string name="colors_appearance_settings">Colors</string>
<string name="general_browse_settings">General</string>
Expand Down

0 comments on commit 092bbfd

Please sign in to comment.