Skip to content

Commit

Permalink
merge33
Browse files Browse the repository at this point in the history
  • Loading branch information
LuftVerbot committed Jul 8, 2023
1 parent e2dcc1d commit afb88c9
Show file tree
Hide file tree
Showing 37 changed files with 319 additions and 285 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
| Build | Preview Release | Codefactor | Stable | Translate Aniyomi | Discord Server |
|-------|-----------|-------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------|---------|
| ![CI](https://github.com/aniyomiorg/aniyomi/workflows/CI/badge.svg?branch=master&event=push) | [![latest preview build](https://img.shields.io/github/v/release/aniyomiorg/aniyomi-preview.svg?maxAge=3600&label=download)](https://github.com/aniyomiorg/aniyomi-preview/releases) | [![CodeFactor](https://www.codefactor.io/repository/github/aniyomiorg/aniyomi/badge)](https://www.codefactor.io/repository/github/aniyomiorg/aniyomi) | [![stable release](https://img.shields.io/github/release/aniyomiorg/aniyomi.svg?maxAge=3600&label=download)](https://github.com/aniyomiorg/aniyomi/releases) | [![Translation status](https://hosted.weblate.org/widgets/aniyomi/-/svg-badge.svg)](https://hosted.weblate.org/engage/aniyomi/?utm_source=widget) | [![Discord](https://img.shields.io/discord/841701076242530374?label=discord&labelColor=7289da&color=2c2f33&style=flat)](https://discord.gg/F32UjdJZrR) |
| [![CI](https://github.com/aniyomiorg/aniyomi/actions/workflows/build_push.yml/badge.svg)] (https://github.com/aniyomiorg/aniyomi/actions/workflows/build_push.yml) | [![latest preview build](https://img.shields.io/github/v/release/aniyomiorg/aniyomi-preview.svg?maxAge=3600&label=download)](https://github.com/aniyomiorg/aniyomi-preview/releases) | [![CodeFactor](https://www.codefactor.io/repository/github/aniyomiorg/aniyomi/badge)](https://www.codefactor.io/repository/github/aniyomiorg/aniyomi) | [![stable release](https://img.shields.io/github/release/aniyomiorg/aniyomi.svg?maxAge=3600&label=download)](https://github.com/aniyomiorg/aniyomi/releases) | [![Translation status](https://hosted.weblate.org/widgets/aniyomi/-/svg-badge.svg)](https://hosted.weblate.org/engage/aniyomi/?utm_source=widget) | [![Discord](https://img.shields.io/discord/841701076242530374?label=discord&labelColor=7289da&color=2c2f33&style=flat)](https://discord.gg/F32UjdJZrR) |


# ![app icon](.github/readme-images/app-icon.png)Aniyomi
Expand Down
13 changes: 3 additions & 10 deletions app/src/main/java/eu/kanade/presentation/components/Banners.kt
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ fun AppStateBanners(
val mainInsets = WindowInsets.statusBars
val mainInsetsTop = mainInsets.getTop(density)
SubcomposeLayout(modifier = modifier) { constraints ->
val indexingId = if (indexing) 0 else -1
val indexingPlaceable = subcompose(indexingId) {
val indexingPlaceable = subcompose(0) {
AnimatedVisibility(
visible = indexing,
enter = expandVertically(),
Expand All @@ -83,8 +82,7 @@ fun AppStateBanners(
}.fastMap { it.measure(constraints) }
val indexingHeight = indexingPlaceable.fastMaxBy { it.height }?.height ?: 0

val downloadedId = if (indexing) 1 else 0
val downloadedOnlyPlaceable = subcompose(downloadedId) {
val downloadedOnlyPlaceable = subcompose(1) {
AnimatedVisibility(
visible = downloadedOnlyMode,
enter = expandVertically(),
Expand All @@ -98,12 +96,7 @@ fun AppStateBanners(
}.fastMap { it.measure(constraints) }
val downloadedOnlyHeight = downloadedOnlyPlaceable.fastMaxBy { it.height }?.height ?: 0

val incognitoId = when {
indexing && downloadedOnlyMode -> 3
indexing || downloadedOnlyMode -> 2
else -> 1
}
val incognitoPlaceable = subcompose(incognitoId) {
val incognitoPlaceable = subcompose(2) {
AnimatedVisibility(
visible = incognitoMode,
enter = expandVertically(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ fun EntryDownloadDropdownMenu(
expanded: Boolean,
onDismissRequest: () -> Unit,
onDownloadClicked: (DownloadAction) -> Unit,
includeDownloadAllOption: Boolean = true,
isManga: Boolean,
) {
DropdownMenu(
Expand All @@ -28,7 +27,6 @@ fun EntryDownloadDropdownMenu(
DownloadAction.NEXT_10_ITEMS to pluralStringResource(downloadAmount, 10, 10),
DownloadAction.NEXT_25_ITEMS to pluralStringResource(downloadAmount, 25, 25),
DownloadAction.UNVIEWED_ITEMS to stringResource(downloadUnviewed),
(DownloadAction.ALL_ITEMS to stringResource(R.string.download_all)).takeIf { includeDownloadAllOption },
).map { (downloadAction, string) ->
DropdownMenuItem(
text = { Text(text = string) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,6 @@ fun LibraryBottomActionMenu(
expanded = downloadExpanded,
onDismissRequest = onDismissRequest,
onDownloadClicked = onDownloadClicked,
includeDownloadAllOption = false,
isManga = isManga,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ enum class DownloadAction {
NEXT_10_ITEMS,
NEXT_25_ITEMS,
UNVIEWED_ITEMS,
ALL_ITEMS,
}

enum class EditCoverAction {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import tachiyomi.presentation.core.util.isScrolledToStart
fun TrackStatusSelector(
selection: Int,
onSelectionChange: (Int) -> Unit,
selections: Map<Int, String>,
selections: Map<Int, Int?>,
onConfirm: () -> Unit,
onDismissRequest: () -> Unit,
) {
Expand Down Expand Up @@ -71,7 +71,7 @@ fun TrackStatusSelector(
onClick = null,
)
Text(
text = value,
text = value?.let { stringResource(it) } ?: "",
style = MaterialTheme.typography.bodyLarge.merge(),
modifier = Modifier.padding(start = 24.dp),
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package eu.kanade.presentation.track.anime

import androidx.annotation.StringRes
import androidx.compose.animation.animateContentSize
import androidx.compose.foundation.background
import androidx.compose.foundation.combinedClickable
Expand Down Expand Up @@ -114,7 +115,7 @@ fun AnimeTrackInfoDialogHome(
private fun TrackInfoItem(
title: String,
service: TrackService,
status: String,
@StringRes status: Int?,
onStatusClick: () -> Unit,
episodes: String,
onEpisodesClick: () -> Unit,
Expand Down Expand Up @@ -176,7 +177,7 @@ private fun TrackInfoItem(
Row(modifier = Modifier.height(IntrinsicSize.Min)) {
TrackDetailsItem(
modifier = Modifier.weight(1f),
text = status,
text = status?.let { stringResource(it) } ?: "",
onClick = onStatusClick,
)
VerticalDivider()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package eu.kanade.presentation.track.manga

import androidx.annotation.StringRes
import androidx.compose.animation.animateContentSize
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
Expand Down Expand Up @@ -125,7 +126,7 @@ fun MangaTrackInfoDialogHome(
private fun TrackInfoItem(
title: String,
service: TrackService,
status: String,
@StringRes status: Int?,
onStatusClick: () -> Unit,
chapters: String,
onChaptersClick: () -> Unit,
Expand Down Expand Up @@ -187,7 +188,7 @@ private fun TrackInfoItem(
Row(modifier = Modifier.height(IntrinsicSize.Min)) {
TrackDetailsItem(
modifier = Modifier.weight(1f),
text = status,
text = status?.let { stringResource(it) } ?: "",
onClick = onStatusClick,
)
VerticalDivider()
Expand Down
4 changes: 1 addition & 3 deletions app/src/main/java/eu/kanade/presentation/util/Navigator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package eu.kanade.presentation.util
import androidx.compose.runtime.Composable
import androidx.compose.runtime.ProvidableCompositionLocal
import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.Modifier
import cafe.adriel.voyager.core.screen.Screen
import cafe.adriel.voyager.core.screen.ScreenKey
import cafe.adriel.voyager.core.screen.uniqueScreenKey
Expand Down Expand Up @@ -34,7 +33,7 @@ interface AssistContentScreen {
}

@Composable
fun DefaultNavigatorScreenTransition(navigator: Navigator, modifier: Modifier = Modifier) {
fun DefaultNavigatorScreenTransition(navigator: Navigator) {
val slideDistance = rememberSlideDistance()
ScreenTransition(
navigator = navigator,
Expand All @@ -44,6 +43,5 @@ fun DefaultNavigatorScreenTransition(navigator: Navigator, modifier: Modifier =
slideDistance = slideDistance,
)
},
modifier = modifier,
)
}
Loading

0 comments on commit afb88c9

Please sign in to comment.