🛠️ Split Constants
* Split Constants into LinkConstants and ScrollbarConstants
This commit is contained in:
parent
abc276a35d
commit
aabf8ae737
3 changed files with 49 additions and 49 deletions
|
|
@ -1,12 +1,6 @@
|
|||
package ua.acclorite.book_story.presentation.core.constants
|
||||
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.RectangleShape
|
||||
import androidx.compose.ui.unit.dp
|
||||
import my.nanihadesuka.compose.ScrollbarSelectionMode
|
||||
import my.nanihadesuka.compose.ScrollbarSettings
|
||||
import ua.acclorite.book_story.domain.model.Book
|
||||
import ua.acclorite.book_story.domain.model.Category
|
||||
import ua.acclorite.book_story.domain.model.ColorPreset
|
||||
|
|
@ -38,46 +32,4 @@ fun Constants.provideDefaultColorPreset() = ColorPreset(
|
|||
backgroundColor = Color(0xFFFAF8FF), // Blue Light Surface (hardcoded)
|
||||
fontColor = Color(0xFF44464F), // Blue Light OnSurfaceVariant (hardcoded)
|
||||
isSelected = false
|
||||
)
|
||||
|
||||
// Primary Scrollbar
|
||||
@Composable
|
||||
fun Constants.providePrimaryScrollbar() = ScrollbarSettings(
|
||||
thumbUnselectedColor = MaterialTheme.colorScheme.primary,
|
||||
thumbSelectedColor = MaterialTheme.colorScheme.primary.copy(0.8f),
|
||||
hideDelayMillis = 2000,
|
||||
durationAnimationMillis = 300,
|
||||
selectionMode = ScrollbarSelectionMode.Thumb,
|
||||
thumbThickness = 8.dp,
|
||||
scrollbarPadding = 4.dp
|
||||
)
|
||||
|
||||
// Secondary Scrollbar
|
||||
@Composable
|
||||
fun Constants.provideSecondaryScrollbar() = ScrollbarSettings(
|
||||
thumbUnselectedColor = MaterialTheme.colorScheme.onSurfaceVariant.copy(0.5f),
|
||||
hideDelayMillis = 500,
|
||||
durationAnimationMillis = 200,
|
||||
thumbMinLength = 0.4f,
|
||||
selectionMode = ScrollbarSelectionMode.Disabled,
|
||||
thumbThickness = 4.dp,
|
||||
thumbShape = RectangleShape,
|
||||
hideDisplacement = 0.dp,
|
||||
scrollbarPadding = 0.dp
|
||||
)
|
||||
|
||||
// Links
|
||||
fun Constants.provideDownloadLatestReleasePage() =
|
||||
"https://www.github.com/Acclorite/book-story/releases/latest/download/book-story.apk"
|
||||
|
||||
fun Constants.provideReleasesPage() =
|
||||
"https://www.github.com/Acclorite/book-story/releases/latest"
|
||||
|
||||
fun Constants.provideIssuesPage() =
|
||||
"https://www.github.com/Acclorite/book-story/issues"
|
||||
|
||||
fun Constants.provideContributorsPage() =
|
||||
"https://github.com/Acclorite/book-story/graphs/contributors"
|
||||
|
||||
fun Constants.provideTranslationPage() =
|
||||
"https://hosted.weblate.org/projects/book-story"
|
||||
)
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package ua.acclorite.book_story.presentation.core.constants
|
||||
|
||||
fun Constants.provideDownloadLatestReleasePage() =
|
||||
"https://www.github.com/Acclorite/book-story/releases/latest/download/book-story.apk"
|
||||
|
||||
fun Constants.provideReleasesPage() =
|
||||
"https://www.github.com/Acclorite/book-story/releases/latest"
|
||||
|
||||
fun Constants.provideIssuesPage() =
|
||||
"https://www.github.com/Acclorite/book-story/issues"
|
||||
|
||||
fun Constants.provideContributorsPage() =
|
||||
"https://github.com/Acclorite/book-story/graphs/contributors"
|
||||
|
||||
fun Constants.provideTranslationPage() =
|
||||
"https://hosted.weblate.org/projects/book-story"
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package ua.acclorite.book_story.presentation.core.constants
|
||||
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.graphics.RectangleShape
|
||||
import androidx.compose.ui.unit.dp
|
||||
import my.nanihadesuka.compose.ScrollbarSelectionMode
|
||||
import my.nanihadesuka.compose.ScrollbarSettings
|
||||
|
||||
@Composable
|
||||
fun Constants.providePrimaryScrollbar() = ScrollbarSettings(
|
||||
thumbUnselectedColor = MaterialTheme.colorScheme.primary,
|
||||
thumbSelectedColor = MaterialTheme.colorScheme.primary.copy(0.8f),
|
||||
hideDelayMillis = 2000,
|
||||
durationAnimationMillis = 300,
|
||||
selectionMode = ScrollbarSelectionMode.Thumb,
|
||||
thumbThickness = 8.dp,
|
||||
scrollbarPadding = 4.dp
|
||||
)
|
||||
|
||||
@Composable
|
||||
fun Constants.provideSecondaryScrollbar() = ScrollbarSettings(
|
||||
thumbUnselectedColor = MaterialTheme.colorScheme.onSurfaceVariant.copy(0.5f),
|
||||
hideDelayMillis = 500,
|
||||
durationAnimationMillis = 200,
|
||||
thumbMinLength = 0.4f,
|
||||
selectionMode = ScrollbarSelectionMode.Disabled,
|
||||
thumbThickness = 4.dp,
|
||||
thumbShape = RectangleShape,
|
||||
hideDisplacement = 0.dp,
|
||||
scrollbarPadding = 0.dp
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue