Skip to content

Commit

Permalink
updated dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
DatL4g committed Nov 10, 2023
1 parent 757f0b4 commit 315e6dc
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.StrokeJoin
import androidx.compose.ui.graphics.drawscope.Fill
import androidx.compose.ui.graphics.drawscope.Stroke
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.text.TextStyle
Expand Down Expand Up @@ -49,6 +51,8 @@ import dev.datlag.burningseries.ui.theme.shape.DiagonalShape
import dev.icerock.moko.resources.compose.stringResource
import io.kamel.core.Resource
import io.kamel.image.asyncPainterResource
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.mapNotNull
import kotlin.math.abs

@OptIn(ExperimentalMaterial3WindowSizeClassApi::class)
Expand Down Expand Up @@ -94,7 +98,21 @@ private fun CompactScreen(component: SeriesComponent) {

Text(
text = title,
modifier = Modifier.road(Alignment.TopStart, Alignment.BottomStart).padding(16.dp),
modifier = Modifier.road(Alignment.TopStart, Alignment.BottomStart).padding(16.dp).background(
color = Color.Black.copy(alpha = run {
val alpha = state.toolbarState.progress
if (alpha < 0.5F) {
if (alpha < 0.3F) {
0F
} else {
alpha
}
} else {
0.5F
}
}),
shape = MaterialTheme.shapes.small
).padding(4.dp),
color = LocalContentColor.current.copy(alpha = run {
val alpha = state.toolbarState.progress
if (alpha < 0.7F) {
Expand Down Expand Up @@ -200,6 +218,7 @@ private fun CompactScreen(component: SeriesComponent) {
@Composable
private fun DefaultScreen(component: SeriesComponent) {
val seriesState by component.seriesState.collectAsStateWithLifecycle()
val title = remember(seriesState) { (seriesState as? SeriesState.Success)?.series?.title ?: component.initialTitle }

when (val current = seriesState) {
is SeriesState.Loading -> {
Expand Down Expand Up @@ -227,7 +246,7 @@ private fun DefaultScreen(component: SeriesComponent) {
TopAppBar(
title = {
Text(
text = component.initialTitle,
text = title,
maxLines = 2,
overflow = TextOverflow.Ellipsis,
softWrap = true
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ complete-kotlin = "1.1.0"
context-menu = "0.2.0"
coroutines = "1.7.3"
datastore = "1.0.0"
decompose = "2.1.3-compose-experimental"
decompose = "2.1.4-compose-experimental"
flowredux = "1.2.0"
grpc = "1.59.0"
instesx = "0.1.0-alpha10"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ data object BurningSeries {
val replacedTitle =
title.replace(Regex("(?:(\\n)*\\t)+", setOf(RegexOption.MULTILINE, RegexOption.IGNORE_CASE)), "\t")
val splitTitle = replacedTitle.trim().split("\t")
val normalizedTitle = splitTitle[0].trim()

val selectedLanguageValue = doc.querySelector(".series-language")?.querySelector("option[selected]")?.getValue()
var selectedLanguage: String? = null
Expand Down Expand Up @@ -170,6 +169,7 @@ data object BurningSeries {
}

val selectedSeason = if (splitTitle.size >= 2) splitTitle[1].trim() else seasons.firstOrNull()?.title ?: String()
val normalizedTitle = splitTitle[0].trim().replace(selectedSeason, String()).trim()

val episodesDoc = doc.querySelector(".serie")?.querySelector(".episodes")?.querySelectorAll("tr") ?: emptyList()
val episodeInfoList = episodesDoc.mapNotNull { episodesElement ->
Expand Down

0 comments on commit 315e6dc

Please sign in to comment.