🛠️ Add .animateItem() modifier to Reader Chapter/Separator
This commit is contained in:
parent
f43059d5ec
commit
dbd9ebff91
2 changed files with 45 additions and 29 deletions
|
|
@ -1,9 +1,11 @@
|
|||
package ua.acclorite.book_story.presentation.reader
|
||||
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.lazy.LazyItemScope
|
||||
import androidx.compose.material3.HorizontalDivider
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
|
|
@ -21,13 +23,21 @@ import ua.acclorite.book_story.domain.reader.ReaderTextAlignment
|
|||
import ua.acclorite.book_story.presentation.core.components.common.HighlightedText
|
||||
|
||||
@Composable
|
||||
fun ReaderLayoutTextChapter(
|
||||
fun LazyItemScope.ReaderLayoutTextChapter(
|
||||
chapter: Chapter,
|
||||
chapterTitleAlignment: ReaderTextAlignment,
|
||||
fontColor: Color,
|
||||
sidePadding: Dp,
|
||||
highlightedReading: Boolean,
|
||||
highlightedReadingThickness: FontWeight
|
||||
) {
|
||||
Column(
|
||||
Modifier
|
||||
.animateItem(
|
||||
fadeInSpec = null,
|
||||
fadeOutSpec = null
|
||||
)
|
||||
.fillMaxWidth()
|
||||
) {
|
||||
Spacer(modifier = Modifier.height(22.dp))
|
||||
if (highlightedReading) {
|
||||
|
|
@ -59,3 +69,4 @@ fun ReaderLayoutTextChapter(
|
|||
HorizontalDivider(color = fontColor.copy(0.4f))
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package ua.acclorite.book_story.presentation.reader
|
||||
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.lazy.LazyItemScope
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.material3.HorizontalDivider
|
||||
import androidx.compose.runtime.Composable
|
||||
|
|
@ -11,13 +12,17 @@ import androidx.compose.ui.unit.Dp
|
|||
import androidx.compose.ui.unit.dp
|
||||
|
||||
@Composable
|
||||
fun ReaderLayoutTextSeparator(
|
||||
fun LazyItemScope.ReaderLayoutTextSeparator(
|
||||
sidePadding: Dp,
|
||||
fontColor: Color
|
||||
) {
|
||||
HorizontalDivider(
|
||||
thickness = 3.dp,
|
||||
modifier = Modifier
|
||||
.animateItem(
|
||||
fadeInSpec = null,
|
||||
fadeOutSpec = null
|
||||
)
|
||||
.padding(horizontal = sidePadding)
|
||||
.clip(CircleShape),
|
||||
color = fontColor.copy(0.3f)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue