Skip to content

Commit

Permalink
merge5
Browse files Browse the repository at this point in the history
  • Loading branch information
LuftVerbot committed Oct 5, 2023
1 parent 2ebf477 commit f705e19
Show file tree
Hide file tree
Showing 44 changed files with 653 additions and 673 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ jobs:
- name: Build app and run unit tests
uses: gradle/gradle-command-action@v2
with:
arguments: lintKotlin assembleStandardRelease testStandardReleaseUnitTest
arguments: lintKotlin assembleStandardRelease testReleaseUnitTest
2 changes: 1 addition & 1 deletion .github/workflows/build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Build app and run unit tests
uses: gradle/gradle-command-action@v2
with:
arguments: lintKotlin assembleStandardRelease testStandardReleaseUnitTest
arguments: lintKotlin assembleStandardRelease testReleaseUnitTest

# Sign APK and create release for tags

Expand Down
1 change: 0 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ dependencies {
// Disk
implementation(libs.disklrucache)
implementation(libs.unifile)
implementation(libs.compress)
implementation(libs.junrar)

// Preferences
Expand Down
5 changes: 1 addition & 4 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,4 @@
##---------------End: proguard configuration for kotlinx.serialization ----------

# XmlUtil
-keep public enum nl.adaptivity.xmlutil.EventType { *; }

# org.apache.commons:commons-compress
-keep,allowoptimization class org.apache.commons.compress.archivers.zip.**
-keep public enum nl.adaptivity.xmlutil.EventType { *; }
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import androidx.compose.runtime.getValue
import androidx.compose.ui.unit.dp
import androidx.paging.LoadState
import androidx.paging.compose.LazyPagingItems
import androidx.paging.compose.itemKey
import eu.kanade.presentation.browse.InLibraryBadge
import eu.kanade.presentation.browse.manga.components.BrowseSourceLoadingItem
import eu.kanade.presentation.library.CommonEntryItemDefaults
Expand Down Expand Up @@ -41,10 +40,7 @@ fun BrowseAnimeSourceComfortableGrid(
}
}

items(
count = animeList.itemCount,
key = animeList.itemKey { it.value.id },
) { index ->
items(count = animeList.itemCount) { index ->
val anime by animeList[index]?.collectAsState() ?: return@items
BrowseAnimeSourceComfortableGridItem(
anime = anime,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import androidx.compose.runtime.getValue
import androidx.compose.ui.unit.dp
import androidx.paging.LoadState
import androidx.paging.compose.LazyPagingItems
import androidx.paging.compose.itemKey
import eu.kanade.presentation.browse.InLibraryBadge
import eu.kanade.presentation.browse.manga.components.BrowseSourceLoadingItem
import eu.kanade.presentation.library.CommonEntryItemDefaults
Expand Down Expand Up @@ -41,10 +40,7 @@ fun BrowseAnimeSourceCompactGrid(
}
}

items(
count = animeList.itemCount,
key = animeList.itemKey { it.value.id },
) { index ->
items(count = animeList.itemCount) { index ->
val anime by animeList[index]?.collectAsState() ?: return@items
BrowseAnimeSourceCompactGridItem(
anime = anime,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import androidx.compose.runtime.getValue
import androidx.compose.ui.unit.dp
import androidx.paging.LoadState
import androidx.paging.compose.LazyPagingItems
import androidx.paging.compose.itemKey
import androidx.paging.compose.items
import eu.kanade.presentation.browse.InLibraryBadge
import eu.kanade.presentation.browse.manga.components.BrowseSourceLoadingItem
Expand Down Expand Up @@ -35,10 +34,7 @@ fun BrowseAnimeSourceList(
}
}

items(
count = animeList.itemCount,
key = animeList.itemKey { it.value.id },
) { index ->
items(count = animeList.itemCount) { index ->
val anime by animeList[index]?.collectAsState() ?: return@items
BrowseAnimeSourceListItem(
anime = anime,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import androidx.compose.runtime.getValue
import androidx.compose.ui.unit.dp
import androidx.paging.LoadState
import androidx.paging.compose.LazyPagingItems
import androidx.paging.compose.itemKey
import eu.kanade.presentation.browse.InLibraryBadge
import eu.kanade.presentation.library.CommonEntryItemDefaults
import eu.kanade.presentation.library.EntryComfortableGridItem
Expand Down Expand Up @@ -40,10 +39,7 @@ fun BrowseMangaSourceComfortableGrid(
}
}

items(
count = mangaList.itemCount,
key = mangaList.itemKey { it.value.id },
) { index ->
items(count = mangaList.itemCount) { index ->
val manga by mangaList[index]?.collectAsState() ?: return@items
BrowseMangaSourceComfortableGridItem(
manga = manga,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import androidx.compose.runtime.getValue
import androidx.compose.ui.unit.dp
import androidx.paging.LoadState
import androidx.paging.compose.LazyPagingItems
import androidx.paging.compose.itemKey
import eu.kanade.presentation.browse.InLibraryBadge
import eu.kanade.presentation.library.CommonEntryItemDefaults
import eu.kanade.presentation.library.EntryCompactGridItem
Expand Down Expand Up @@ -40,10 +39,7 @@ fun BrowseMangaSourceCompactGrid(
}
}

items(
count = mangaList.itemCount,
key = mangaList.itemKey { it.value.id },
) { index ->
items(count = mangaList.itemCount) { index ->
val manga by mangaList[index]?.collectAsState() ?: return@items
BrowseMangaSourceCompactGridItem(
manga = manga,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import androidx.compose.runtime.getValue
import androidx.compose.ui.unit.dp
import androidx.paging.LoadState
import androidx.paging.compose.LazyPagingItems
import androidx.paging.compose.itemKey
import androidx.paging.compose.items
import eu.kanade.presentation.browse.InLibraryBadge
import eu.kanade.presentation.library.CommonEntryItemDefaults
Expand All @@ -34,10 +33,7 @@ fun BrowseMangaSourceList(
}
}

items(
count = mangaList.itemCount,
key = mangaList.itemKey { it.value.id },
) { index ->
items(count = mangaList.itemCount) { index ->
val manga by mangaList[index]?.collectAsState() ?: return@items
BrowseMangaSourceListItem(
manga = manga,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Dialog
import androidx.compose.ui.window.DialogProperties
import cafe.adriel.voyager.core.annotation.InternalVoyagerApi
import cafe.adriel.voyager.core.lifecycle.DisposableEffectIgnoringConfiguration
import cafe.adriel.voyager.core.screen.Screen
import cafe.adriel.voyager.navigator.Navigator
import cafe.adriel.voyager.transitions.ScreenTransition
import eu.kanade.presentation.util.Screen
import eu.kanade.presentation.util.isTabletUi
import tachiyomi.presentation.core.components.AdaptiveSheet as AdaptiveSheetImpl

@OptIn(InternalVoyagerApi::class)
@Composable
fun NavigatorAdaptiveSheet(
screen: Screen,
Expand Down
68 changes: 51 additions & 17 deletions app/src/main/java/eu/kanade/presentation/components/AppBar.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.PlainTooltipBox
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBar
import androidx.compose.material3.TopAppBarDefaults
Expand Down Expand Up @@ -203,21 +204,36 @@ fun AppBarActions(
var showMenu by remember { mutableStateOf(false) }

actions.filterIsInstance<AppBar.Action>().map {
IconButton(
onClick = it.onClick,
enabled = it.enabled,
PlainTooltipBox(
tooltip = { Text(it.title) },
) {
Icon(
imageVector = it.icon,
contentDescription = it.title,
)
IconButton(
onClick = it.onClick,
enabled = it.enabled,
modifier = Modifier.tooltipAnchor(),
) {
Icon(
imageVector = it.icon,
contentDescription = it.title,
)
}
}
}

val overflowActions = actions.filterIsInstance<AppBar.OverflowAction>()
if (overflowActions.isNotEmpty()) {
IconButton(onClick = { showMenu = !showMenu }) {
Icon(Icons.Outlined.MoreVert, contentDescription = stringResource(R.string.abc_action_menu_overflow_description))
PlainTooltipBox(
tooltip = { Text(stringResource(R.string.abc_action_menu_overflow_description)) },
) {
IconButton(
onClick = { showMenu = !showMenu },
modifier = Modifier.tooltipAnchor(),
) {
Icon(
Icons.Outlined.MoreVert,
contentDescription = stringResource(R.string.abc_action_menu_overflow_description),
)
}
}

DropdownMenu(
Expand Down Expand Up @@ -327,17 +343,35 @@ fun SearchToolbar(
if (!searchEnabled) {
// Don't show search action
} else if (searchQuery == null) {
IconButton(onClick) {
Icon(Icons.Outlined.Search, contentDescription = stringResource(R.string.action_search))
PlainTooltipBox(
tooltip = { Text(stringResource(R.string.action_search)) },
) {
IconButton(
onClick = onClick,
modifier = Modifier.tooltipAnchor(),
) {
Icon(
Icons.Outlined.Search,
contentDescription = stringResource(R.string.action_search),
)
}
}
} else if (searchQuery.isNotEmpty()) {
IconButton(
onClick = {
onClick()
focusRequester.requestFocus()
},
PlainTooltipBox(
tooltip = { Text(stringResource(R.string.action_reset)) },
) {
Icon(Icons.Outlined.Close, contentDescription = stringResource(R.string.action_reset))
IconButton(
onClick = {
onClick()
focusRequester.requestFocus()
},
modifier = Modifier.tooltipAnchor(),
) {
Icon(
Icons.Outlined.Close,
contentDescription = stringResource(R.string.action_reset),
)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.foundation.pager.rememberPagerState
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.MoreVert
import androidx.compose.material3.Icon
Expand All @@ -31,7 +32,6 @@ import kotlinx.coroutines.launch
import tachiyomi.presentation.core.components.HorizontalPager
import tachiyomi.presentation.core.components.material.Divider
import tachiyomi.presentation.core.components.material.TabIndicator
import tachiyomi.presentation.core.components.rememberPagerState

object TabbedDialogPaddings {
val Horizontal = 24.dp
Expand Down Expand Up @@ -84,7 +84,7 @@ fun TabbedDialog(

HorizontalPager(
modifier = Modifier.animateContentSize(),
count = tabTitles.size,
pageCount = tabTitles.size,
state = pagerState,
verticalAlignment = Alignment.Top,
) { page ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import androidx.compose.foundation.layout.calculateEndPadding
import androidx.compose.foundation.layout.calculateStartPadding
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.pager.PagerState
import androidx.compose.foundation.pager.rememberPagerState
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.ScrollableTabRow
import androidx.compose.material3.SnackbarHost
Expand All @@ -25,11 +27,9 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import kotlinx.coroutines.launch
import tachiyomi.presentation.core.components.HorizontalPager
import tachiyomi.presentation.core.components.PagerState
import tachiyomi.presentation.core.components.material.Scaffold
import tachiyomi.presentation.core.components.material.TabIndicator
import tachiyomi.presentation.core.components.material.TabText
import tachiyomi.presentation.core.components.rememberPagerState

@Composable
fun TabbedScreen(
Expand Down Expand Up @@ -105,7 +105,7 @@ fun TabbedScreen(
}

HorizontalPager(
count = tabs.size,
pageCount = tabs.size,
modifier = Modifier.fillMaxSize(),
state = state,
verticalAlignment = Alignment.Top,
Expand Down
28 changes: 16 additions & 12 deletions app/src/main/java/eu/kanade/presentation/entries/EntryToolbar.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import androidx.compose.ui.draw.alpha
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import eu.kanade.presentation.components.AppBar
import eu.kanade.presentation.components.AppBarActions
import eu.kanade.presentation.components.EntryDownloadDropdownMenu
import eu.kanade.presentation.components.OverflowMenu
import eu.kanade.tachiyomi.R
Expand Down Expand Up @@ -77,18 +79,20 @@ fun EntryToolbar(
},
actions = {
if (isActionMode) {
IconButton(onClick = onSelectAll) {
Icon(
imageVector = Icons.Outlined.SelectAll,
contentDescription = stringResource(R.string.action_select_all),
)
}
IconButton(onClick = onInvertSelection) {
Icon(
imageVector = Icons.Outlined.FlipToBack,
contentDescription = stringResource(R.string.action_select_inverse),
)
}
AppBarActions(
listOf(
AppBar.Action(
title = stringResource(R.string.action_select_all),
icon = Icons.Outlined.SelectAll,
onClick = onSelectAll,
),
AppBar.Action(
title = stringResource(R.string.action_select_inverse),
icon = Icons.Outlined.FlipToBack,
onClick = onInvertSelection,
),
),
)
} else {
if (onClickDownload != null) {
val (downloadExpanded, onDownloadExpanded) = remember { mutableStateOf(false) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ import androidx.compose.ui.unit.dp
import cafe.adriel.voyager.core.model.StateScreenModel
import cafe.adriel.voyager.core.model.coroutineScope
import cafe.adriel.voyager.core.model.rememberScreenModel
import cafe.adriel.voyager.core.screen.Screen
import eu.kanade.core.util.asFlow
import eu.kanade.presentation.components.TabbedDialogPaddings
import eu.kanade.presentation.util.Screen
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.animesource.model.Video
import eu.kanade.tachiyomi.data.download.anime.AnimeDownloadManager
Expand Down Expand Up @@ -81,7 +81,7 @@ class EpisodeOptionsDialogScreen(
private val episodeId: Long,
private val animeId: Long,
private val sourceId: Long,
) : Screen() {
) : Screen {

@Composable
override fun Content() {
Expand Down
Loading

0 comments on commit f705e19

Please sign in to comment.