From e3cf8632305283468a5e8366a257d6d6880ca1a6 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 18 Feb 2023 15:52:52 -0500 Subject: [PATCH] Start moving some Compose components to presentation-core module --- app/build.gradle.kts | 1 - .../presentation/browse/BrowseBadges.kt | 2 +- .../presentation/browse/BrowseSourceScreen.kt | 2 +- .../browse/ExtensionDetailsScreen.kt | 6 ++-- .../browse/ExtensionFilterScreen.kt | 2 +- .../presentation/browse/ExtensionsScreen.kt | 2 +- .../presentation/browse/GlobalSearchScreen.kt | 2 +- .../presentation/browse/MigrateMangaScreen.kt | 2 +- .../browse/MigrateSearchScreen.kt | 2 +- .../browse/MigrateSourceScreen.kt | 4 +-- .../browse/SourcesFilterScreen.kt | 2 +- .../presentation/category/CategoryScreen.kt | 2 +- .../CategoryFloatingActionButton.kt | 2 +- .../components/CommonMangaItem.kt | 1 + .../presentation/components/InfoScaffold.kt | 2 +- .../presentation/components/TabbedDialog.kt | 1 + .../presentation/components/TabbedScreen.kt | 1 + .../eu/kanade/presentation/components/Tabs.kt | 1 + .../presentation/history/HistoryScreen.kt | 2 +- .../library/components/LibraryBadges.kt | 2 +- .../library/components/LibraryContent.kt | 2 +- .../library/components/LibraryTabs.kt | 2 +- .../library/components/LibraryToolbar.kt | 2 +- .../kanade/presentation/manga/MangaScreen.kt | 6 ++-- .../presentation/manga/TrackInfoDialogHome.kt | 4 +-- .../manga/TrackInfoDialogSelector.kt | 4 +-- .../presentation/manga/TrackServiceSearch.kt | 4 +-- .../manga/components/MangaCoverDialog.kt | 2 +- .../eu/kanade/presentation/more/LogoHeader.kt | 2 +- .../eu/kanade/presentation/more/MoreScreen.kt | 4 +-- .../more/settings/PreferenceScaffold.kt | 2 +- .../more/settings/screen/AboutScreen.kt | 4 +-- .../settings/screen/ClearDatabaseScreen.kt | 4 +-- .../more/settings/screen/LicensesScreen.kt | 2 +- .../settings/screen/SettingsBackupScreen.kt | 2 +- .../settings/screen/SettingsMainScreen.kt | 2 +- .../settings/screen/SettingsSearchScreen.kt | 4 +-- .../more/settings/screen/WorkerInfoScreen.kt | 2 +- .../widget/AppThemePreferenceWidget.kt | 2 +- .../settings/widget/ListPreferenceWidget.kt | 2 +- .../settings/widget/TriStateListDialog.kt | 2 +- .../presentation/updates/UpdatesScreen.kt | 4 +-- .../webview/WebViewScreenContent.kt | 2 +- .../details/SourcePreferencesScreen.kt | 2 +- .../migration/search/SourceSearchScreen.kt | 4 +-- .../source/browse/BrowseSourceScreen.kt | 4 +-- .../ui/download/DownloadQueueScreen.kt | 6 ++-- .../eu/kanade/tachiyomi/ui/home/HomeScreen.kt | 2 +- .../kanade/tachiyomi/ui/library/LibraryTab.kt | 2 +- .../kanade/tachiyomi/ui/main/MainActivity.kt | 2 +- .../ui/manga/track/TrackInfoDialog.kt | 2 +- .../kanade/tachiyomi/ui/stats/StatsScreen.kt | 2 +- presentation-core/build.gradle.kts | 36 ++++++++++++++++++- .../presentation/core}/components/Badges.kt | 2 +- .../presentation/core}/components/LinkIcon.kt | 2 +- .../presentation/core}/components/Pill.kt | 2 +- .../core/components/material}/AlertDialog.kt | 2 +- .../core/components/material}/Divider.kt | 2 +- .../material}/FloatingActionButton.kt | 2 +- .../core/components/material}/PullRefresh.kt | 2 +- .../core/components/material}/Scaffold.kt | 2 +- .../source/online/HttpSourceFetcher.kt | 20 +++++------ 62 files changed, 121 insertions(+), 84 deletions(-) rename {app/src/main/java/eu/kanade/presentation => presentation-core/src/main/java/tachiyomi/presentation/core}/components/Badges.kt (98%) rename {app/src/main/java/eu/kanade/presentation => presentation-core/src/main/java/tachiyomi/presentation/core}/components/LinkIcon.kt (95%) rename {app/src/main/java/eu/kanade/presentation => presentation-core/src/main/java/tachiyomi/presentation/core}/components/Pill.kt (96%) rename {app/src/main/java/eu/kanade/presentation/components => presentation-core/src/main/java/tachiyomi/presentation/core/components/material}/AlertDialog.kt (98%) rename {app/src/main/java/eu/kanade/presentation/components => presentation-core/src/main/java/tachiyomi/presentation/core/components/material}/Divider.kt (95%) rename {app/src/main/java/eu/kanade/presentation/components => presentation-core/src/main/java/tachiyomi/presentation/core/components/material}/FloatingActionButton.kt (98%) rename {app/src/main/java/eu/kanade/presentation/components => presentation-core/src/main/java/tachiyomi/presentation/core/components/material}/PullRefresh.kt (97%) rename {app/src/main/java/eu/kanade/presentation/components => presentation-core/src/main/java/tachiyomi/presentation/core/components/material}/Scaffold.kt (99%) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 1482cd772..e32992996 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -276,7 +276,6 @@ androidComponents { } tasks { - withType().configureEach { exclude { it.file.path.contains("generated[\\\\/]".toRegex()) } } diff --git a/app/src/main/java/eu/kanade/presentation/browse/BrowseBadges.kt b/app/src/main/java/eu/kanade/presentation/browse/BrowseBadges.kt index b3df79442..00adfba35 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/BrowseBadges.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/BrowseBadges.kt @@ -3,7 +3,7 @@ package eu.kanade.presentation.browse import androidx.compose.material.icons.Icons import androidx.compose.material.icons.outlined.CollectionsBookmark import androidx.compose.runtime.Composable -import eu.kanade.presentation.components.Badge +import tachiyomi.presentation.core.components.Badge @Composable fun InLibraryBadge(enabled: Boolean) { diff --git a/app/src/main/java/eu/kanade/presentation/browse/BrowseSourceScreen.kt b/app/src/main/java/eu/kanade/presentation/browse/BrowseSourceScreen.kt index b1edd5cf1..6862d85da 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/BrowseSourceScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/BrowseSourceScreen.kt @@ -24,7 +24,6 @@ import eu.kanade.presentation.components.AppBar import eu.kanade.presentation.components.EmptyScreen import eu.kanade.presentation.components.EmptyScreenAction import eu.kanade.presentation.components.LoadingScreen -import eu.kanade.presentation.components.Scaffold import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.source.LocalSource import eu.kanade.tachiyomi.source.Source @@ -32,6 +31,7 @@ import eu.kanade.tachiyomi.source.SourceManager import kotlinx.coroutines.flow.StateFlow import tachiyomi.domain.library.model.LibraryDisplayMode import tachiyomi.domain.manga.model.Manga +import tachiyomi.presentation.core.components.material.Scaffold @Composable fun BrowseSourceContent( diff --git a/app/src/main/java/eu/kanade/presentation/browse/ExtensionDetailsScreen.kt b/app/src/main/java/eu/kanade/presentation/browse/ExtensionDetailsScreen.kt index b56d3aa8c..350d096dd 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/ExtensionDetailsScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/ExtensionDetailsScreen.kt @@ -47,10 +47,7 @@ import eu.kanade.domain.extension.interactor.ExtensionSourceItem import eu.kanade.presentation.browse.components.ExtensionIcon import eu.kanade.presentation.components.AppBar import eu.kanade.presentation.components.AppBarActions -import eu.kanade.presentation.components.DIVIDER_ALPHA -import eu.kanade.presentation.components.Divider import eu.kanade.presentation.components.EmptyScreen -import eu.kanade.presentation.components.Scaffold import eu.kanade.presentation.components.ScrollbarLazyColumn import eu.kanade.presentation.components.WarningBanner import eu.kanade.presentation.more.settings.widget.TextPreferenceWidget @@ -61,6 +58,9 @@ import eu.kanade.tachiyomi.extension.model.Extension import eu.kanade.tachiyomi.source.ConfigurableSource import eu.kanade.tachiyomi.ui.browse.extension.details.ExtensionDetailsState import eu.kanade.tachiyomi.util.system.LocaleHelper +import tachiyomi.presentation.core.components.material.DIVIDER_ALPHA +import tachiyomi.presentation.core.components.material.Divider +import tachiyomi.presentation.core.components.material.Scaffold @Composable fun ExtensionDetailsScreen( diff --git a/app/src/main/java/eu/kanade/presentation/browse/ExtensionFilterScreen.kt b/app/src/main/java/eu/kanade/presentation/browse/ExtensionFilterScreen.kt index 7b9a2d665..aa17d9900 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/ExtensionFilterScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/ExtensionFilterScreen.kt @@ -10,11 +10,11 @@ import androidx.compose.ui.res.stringResource import eu.kanade.presentation.components.AppBar import eu.kanade.presentation.components.EmptyScreen import eu.kanade.presentation.components.FastScrollLazyColumn -import eu.kanade.presentation.components.Scaffold import eu.kanade.presentation.more.settings.widget.SwitchPreferenceWidget import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.ui.browse.extension.ExtensionFilterState import eu.kanade.tachiyomi.util.system.LocaleHelper +import tachiyomi.presentation.core.components.material.Scaffold @Composable fun ExtensionFilterScreen( diff --git a/app/src/main/java/eu/kanade/presentation/browse/ExtensionsScreen.kt b/app/src/main/java/eu/kanade/presentation/browse/ExtensionsScreen.kt index 684f0242b..9ed87ff41 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/ExtensionsScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/ExtensionsScreen.kt @@ -40,7 +40,6 @@ import eu.kanade.presentation.browse.components.ExtensionIcon import eu.kanade.presentation.components.EmptyScreen import eu.kanade.presentation.components.FastScrollLazyColumn import eu.kanade.presentation.components.LoadingScreen -import eu.kanade.presentation.components.PullRefresh import eu.kanade.presentation.manga.components.DotSeparatorNoSpaceText import eu.kanade.presentation.theme.header import eu.kanade.presentation.util.padding @@ -53,6 +52,7 @@ import eu.kanade.tachiyomi.extension.model.InstallStep import eu.kanade.tachiyomi.ui.browse.extension.ExtensionUiModel import eu.kanade.tachiyomi.ui.browse.extension.ExtensionsState import eu.kanade.tachiyomi.util.system.LocaleHelper +import tachiyomi.presentation.core.components.material.PullRefresh @Composable fun ExtensionScreen( diff --git a/app/src/main/java/eu/kanade/presentation/browse/GlobalSearchScreen.kt b/app/src/main/java/eu/kanade/presentation/browse/GlobalSearchScreen.kt index fd78be634..8cd6926d5 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/GlobalSearchScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/GlobalSearchScreen.kt @@ -14,7 +14,6 @@ import eu.kanade.presentation.browse.components.GlobalSearchLoadingResultItem import eu.kanade.presentation.browse.components.GlobalSearchResultItem import eu.kanade.presentation.browse.components.GlobalSearchToolbar import eu.kanade.presentation.components.LazyColumn -import eu.kanade.presentation.components.Scaffold import eu.kanade.presentation.util.padding import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.source.CatalogueSource @@ -22,6 +21,7 @@ import eu.kanade.tachiyomi.ui.browse.source.globalsearch.GlobalSearchState import eu.kanade.tachiyomi.ui.browse.source.globalsearch.SearchItemResult import eu.kanade.tachiyomi.util.system.LocaleHelper import tachiyomi.domain.manga.model.Manga +import tachiyomi.presentation.core.components.material.Scaffold @Composable fun GlobalSearchScreen( diff --git a/app/src/main/java/eu/kanade/presentation/browse/MigrateMangaScreen.kt b/app/src/main/java/eu/kanade/presentation/browse/MigrateMangaScreen.kt index 970d479bd..9d5c25874 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/MigrateMangaScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/MigrateMangaScreen.kt @@ -8,11 +8,11 @@ import androidx.compose.ui.Modifier import eu.kanade.presentation.components.AppBar import eu.kanade.presentation.components.EmptyScreen import eu.kanade.presentation.components.FastScrollLazyColumn -import eu.kanade.presentation.components.Scaffold import eu.kanade.presentation.manga.components.BaseMangaListItem import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.ui.browse.migration.manga.MigrateMangaState import tachiyomi.domain.manga.model.Manga +import tachiyomi.presentation.core.components.material.Scaffold @Composable fun MigrateMangaScreen( diff --git a/app/src/main/java/eu/kanade/presentation/browse/MigrateSearchScreen.kt b/app/src/main/java/eu/kanade/presentation/browse/MigrateSearchScreen.kt index acd2a6b4d..12494fab8 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/MigrateSearchScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/MigrateSearchScreen.kt @@ -10,12 +10,12 @@ import eu.kanade.presentation.browse.components.GlobalSearchLoadingResultItem import eu.kanade.presentation.browse.components.GlobalSearchResultItem import eu.kanade.presentation.browse.components.GlobalSearchToolbar import eu.kanade.presentation.components.LazyColumn -import eu.kanade.presentation.components.Scaffold import eu.kanade.tachiyomi.source.CatalogueSource import eu.kanade.tachiyomi.ui.browse.migration.search.MigrateSearchState import eu.kanade.tachiyomi.ui.browse.source.globalsearch.SearchItemResult import eu.kanade.tachiyomi.util.system.LocaleHelper import tachiyomi.domain.manga.model.Manga +import tachiyomi.presentation.core.components.material.Scaffold @Composable fun MigrateSearchScreen( diff --git a/app/src/main/java/eu/kanade/presentation/browse/MigrateSourceScreen.kt b/app/src/main/java/eu/kanade/presentation/browse/MigrateSourceScreen.kt index 79353fedd..deaf28d4a 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/MigrateSourceScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/MigrateSourceScreen.kt @@ -25,8 +25,6 @@ import androidx.compose.ui.text.style.TextOverflow import eu.kanade.domain.source.interactor.SetMigrateSorting import eu.kanade.presentation.browse.components.BaseSourceItem import eu.kanade.presentation.browse.components.SourceIcon -import eu.kanade.presentation.components.Badge -import eu.kanade.presentation.components.BadgeGroup import eu.kanade.presentation.components.EmptyScreen import eu.kanade.presentation.components.LoadingScreen import eu.kanade.presentation.components.ScrollbarLazyColumn @@ -40,6 +38,8 @@ import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.ui.browse.migration.sources.MigrateSourceState import eu.kanade.tachiyomi.util.system.copyToClipboard import tachiyomi.domain.source.model.Source +import tachiyomi.presentation.core.components.Badge +import tachiyomi.presentation.core.components.BadgeGroup @Composable fun MigrateSourceScreen( diff --git a/app/src/main/java/eu/kanade/presentation/browse/SourcesFilterScreen.kt b/app/src/main/java/eu/kanade/presentation/browse/SourcesFilterScreen.kt index a4f187e4e..ffc072a92 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/SourcesFilterScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/SourcesFilterScreen.kt @@ -12,12 +12,12 @@ import eu.kanade.presentation.browse.components.BaseSourceItem import eu.kanade.presentation.components.AppBar import eu.kanade.presentation.components.EmptyScreen import eu.kanade.presentation.components.FastScrollLazyColumn -import eu.kanade.presentation.components.Scaffold import eu.kanade.presentation.more.settings.widget.SwitchPreferenceWidget import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.ui.browse.source.SourcesFilterState import eu.kanade.tachiyomi.util.system.LocaleHelper import tachiyomi.domain.source.model.Source +import tachiyomi.presentation.core.components.material.Scaffold @Composable fun SourcesFilterScreen( diff --git a/app/src/main/java/eu/kanade/presentation/category/CategoryScreen.kt b/app/src/main/java/eu/kanade/presentation/category/CategoryScreen.kt index 5de8d923a..0226f506d 100644 --- a/app/src/main/java/eu/kanade/presentation/category/CategoryScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/category/CategoryScreen.kt @@ -11,13 +11,13 @@ import eu.kanade.presentation.category.components.CategoryContent import eu.kanade.presentation.category.components.CategoryFloatingActionButton import eu.kanade.presentation.components.AppBar import eu.kanade.presentation.components.EmptyScreen -import eu.kanade.presentation.components.Scaffold import eu.kanade.presentation.util.padding import eu.kanade.presentation.util.plus import eu.kanade.presentation.util.topSmallPaddingValues import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.ui.category.CategoryScreenState import tachiyomi.domain.category.model.Category +import tachiyomi.presentation.core.components.material.Scaffold @Composable fun CategoryScreen( diff --git a/app/src/main/java/eu/kanade/presentation/category/components/CategoryFloatingActionButton.kt b/app/src/main/java/eu/kanade/presentation/category/components/CategoryFloatingActionButton.kt index 72057f3d6..ec0310da4 100644 --- a/app/src/main/java/eu/kanade/presentation/category/components/CategoryFloatingActionButton.kt +++ b/app/src/main/java/eu/kanade/presentation/category/components/CategoryFloatingActionButton.kt @@ -7,10 +7,10 @@ import androidx.compose.material3.Icon import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.res.stringResource -import eu.kanade.presentation.components.ExtendedFloatingActionButton import eu.kanade.presentation.util.isScrolledToEnd import eu.kanade.presentation.util.isScrollingUp import eu.kanade.tachiyomi.R +import tachiyomi.presentation.core.components.material.ExtendedFloatingActionButton @Composable fun CategoryFloatingActionButton( diff --git a/app/src/main/java/eu/kanade/presentation/components/CommonMangaItem.kt b/app/src/main/java/eu/kanade/presentation/components/CommonMangaItem.kt index 97d54ce2b..d575abc23 100644 --- a/app/src/main/java/eu/kanade/presentation/components/CommonMangaItem.kt +++ b/app/src/main/java/eu/kanade/presentation/components/CommonMangaItem.kt @@ -40,6 +40,7 @@ import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import eu.kanade.presentation.util.selectedBackground +import tachiyomi.presentation.core.components.BadgeGroup object CommonMangaItemDefaults { val GridHorizontalSpacer = 4.dp diff --git a/app/src/main/java/eu/kanade/presentation/components/InfoScaffold.kt b/app/src/main/java/eu/kanade/presentation/components/InfoScaffold.kt index 3a9d64a8f..e4d32ee8c 100644 --- a/app/src/main/java/eu/kanade/presentation/components/InfoScaffold.kt +++ b/app/src/main/java/eu/kanade/presentation/components/InfoScaffold.kt @@ -8,7 +8,6 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size -import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.windowInsetsPadding import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll @@ -31,6 +30,7 @@ import eu.kanade.presentation.theme.TachiyomiTheme import eu.kanade.presentation.util.ThemePreviews import eu.kanade.presentation.util.padding import eu.kanade.presentation.util.secondaryItemAlpha +import tachiyomi.presentation.core.components.material.Scaffold @Composable fun InfoScaffold( diff --git a/app/src/main/java/eu/kanade/presentation/components/TabbedDialog.kt b/app/src/main/java/eu/kanade/presentation/components/TabbedDialog.kt index 760a7aa1d..5b59035fa 100644 --- a/app/src/main/java/eu/kanade/presentation/components/TabbedDialog.kt +++ b/app/src/main/java/eu/kanade/presentation/components/TabbedDialog.kt @@ -31,6 +31,7 @@ import androidx.compose.ui.unit.dp import androidx.compose.ui.util.fastForEachIndexed import eu.kanade.tachiyomi.R import kotlinx.coroutines.launch +import tachiyomi.presentation.core.components.material.Divider object TabbedDialogPaddings { val Horizontal = 24.dp diff --git a/app/src/main/java/eu/kanade/presentation/components/TabbedScreen.kt b/app/src/main/java/eu/kanade/presentation/components/TabbedScreen.kt index 4cc8d5145..91fb1746a 100644 --- a/app/src/main/java/eu/kanade/presentation/components/TabbedScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/components/TabbedScreen.kt @@ -21,6 +21,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalLayoutDirection import androidx.compose.ui.res.stringResource import kotlinx.coroutines.launch +import tachiyomi.presentation.core.components.material.Scaffold @Composable fun TabbedScreen( diff --git a/app/src/main/java/eu/kanade/presentation/components/Tabs.kt b/app/src/main/java/eu/kanade/presentation/components/Tabs.kt index ce8c4b53f..c4462d910 100644 --- a/app/src/main/java/eu/kanade/presentation/components/Tabs.kt +++ b/app/src/main/java/eu/kanade/presentation/components/Tabs.kt @@ -15,6 +15,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp +import tachiyomi.presentation.core.components.Pill @Composable fun TabIndicator(currentTabPosition: TabPosition) { diff --git a/app/src/main/java/eu/kanade/presentation/history/HistoryScreen.kt b/app/src/main/java/eu/kanade/presentation/history/HistoryScreen.kt index 8b38d310f..3cd4c5530 100644 --- a/app/src/main/java/eu/kanade/presentation/history/HistoryScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/history/HistoryScreen.kt @@ -13,13 +13,13 @@ import androidx.compose.ui.res.stringResource import eu.kanade.presentation.components.AppBarTitle import eu.kanade.presentation.components.EmptyScreen import eu.kanade.presentation.components.LoadingScreen -import eu.kanade.presentation.components.Scaffold import eu.kanade.presentation.components.SearchToolbar import eu.kanade.presentation.history.components.HistoryContent import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.ui.history.HistoryScreenModel import eu.kanade.tachiyomi.ui.history.HistoryState import tachiyomi.domain.history.model.HistoryWithRelations +import tachiyomi.presentation.core.components.material.Scaffold import java.util.Date @Composable diff --git a/app/src/main/java/eu/kanade/presentation/library/components/LibraryBadges.kt b/app/src/main/java/eu/kanade/presentation/library/components/LibraryBadges.kt index cf9ee2d9f..ffa4eb608 100644 --- a/app/src/main/java/eu/kanade/presentation/library/components/LibraryBadges.kt +++ b/app/src/main/java/eu/kanade/presentation/library/components/LibraryBadges.kt @@ -5,9 +5,9 @@ import androidx.compose.material.icons.Icons import androidx.compose.material.icons.outlined.Folder import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable -import eu.kanade.presentation.components.Badge import eu.kanade.presentation.theme.TachiyomiTheme import eu.kanade.presentation.util.ThemePreviews +import tachiyomi.presentation.core.components.Badge @Composable fun DownloadsBadge(count: Long) { diff --git a/app/src/main/java/eu/kanade/presentation/library/components/LibraryContent.kt b/app/src/main/java/eu/kanade/presentation/library/components/LibraryContent.kt index b8ccc2f11..1315ed2ce 100644 --- a/app/src/main/java/eu/kanade/presentation/library/components/LibraryContent.kt +++ b/app/src/main/java/eu/kanade/presentation/library/components/LibraryContent.kt @@ -15,7 +15,6 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalLayoutDirection import eu.kanade.core.prefs.PreferenceMutableState -import eu.kanade.presentation.components.PullRefresh import eu.kanade.presentation.components.rememberPagerState import eu.kanade.tachiyomi.ui.library.LibraryItem import kotlinx.coroutines.delay @@ -23,6 +22,7 @@ import kotlinx.coroutines.launch import tachiyomi.domain.category.model.Category import tachiyomi.domain.library.model.LibraryDisplayMode import tachiyomi.domain.library.model.LibraryManga +import tachiyomi.presentation.core.components.material.PullRefresh import kotlin.time.Duration.Companion.seconds @Composable diff --git a/app/src/main/java/eu/kanade/presentation/library/components/LibraryTabs.kt b/app/src/main/java/eu/kanade/presentation/library/components/LibraryTabs.kt index df3dd4cd7..eb932b691 100644 --- a/app/src/main/java/eu/kanade/presentation/library/components/LibraryTabs.kt +++ b/app/src/main/java/eu/kanade/presentation/library/components/LibraryTabs.kt @@ -7,10 +7,10 @@ import androidx.compose.material3.Tab import androidx.compose.runtime.Composable import androidx.compose.ui.unit.dp import eu.kanade.presentation.category.visualName -import eu.kanade.presentation.components.Divider import eu.kanade.presentation.components.TabIndicator import eu.kanade.presentation.components.TabText import tachiyomi.domain.category.model.Category +import tachiyomi.presentation.core.components.material.Divider @Composable fun LibraryTabs( diff --git a/app/src/main/java/eu/kanade/presentation/library/components/LibraryToolbar.kt b/app/src/main/java/eu/kanade/presentation/library/components/LibraryToolbar.kt index cd7a7ff9b..8c569a3b7 100644 --- a/app/src/main/java/eu/kanade/presentation/library/components/LibraryToolbar.kt +++ b/app/src/main/java/eu/kanade/presentation/library/components/LibraryToolbar.kt @@ -22,10 +22,10 @@ import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.sp import eu.kanade.presentation.components.AppBar import eu.kanade.presentation.components.OverflowMenu -import eu.kanade.presentation.components.Pill import eu.kanade.presentation.components.SearchToolbar import eu.kanade.presentation.theme.active import eu.kanade.tachiyomi.R +import tachiyomi.presentation.core.components.Pill @Composable fun LibraryToolbar( diff --git a/app/src/main/java/eu/kanade/presentation/manga/MangaScreen.kt b/app/src/main/java/eu/kanade/presentation/manga/MangaScreen.kt index ffb33420a..ce3203db1 100644 --- a/app/src/main/java/eu/kanade/presentation/manga/MangaScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/manga/MangaScreen.kt @@ -49,11 +49,8 @@ import androidx.compose.ui.util.fastAny import androidx.compose.ui.util.fastMap import eu.kanade.domain.manga.model.chaptersFiltered import eu.kanade.presentation.components.ChapterDownloadAction -import eu.kanade.presentation.components.ExtendedFloatingActionButton import eu.kanade.presentation.components.LazyColumn import eu.kanade.presentation.components.MangaBottomActionMenu -import eu.kanade.presentation.components.PullRefresh -import eu.kanade.presentation.components.Scaffold import eu.kanade.presentation.components.TwoPanelBox import eu.kanade.presentation.components.VerticalFastScroller import eu.kanade.presentation.manga.components.ChapterHeader @@ -75,6 +72,9 @@ import eu.kanade.tachiyomi.util.lang.toRelativeString import eu.kanade.tachiyomi.util.system.copyToClipboard import tachiyomi.domain.chapter.model.Chapter import tachiyomi.domain.manga.model.Manga +import tachiyomi.presentation.core.components.material.ExtendedFloatingActionButton +import tachiyomi.presentation.core.components.material.PullRefresh +import tachiyomi.presentation.core.components.material.Scaffold import java.text.DateFormat import java.util.Date diff --git a/app/src/main/java/eu/kanade/presentation/manga/TrackInfoDialogHome.kt b/app/src/main/java/eu/kanade/presentation/manga/TrackInfoDialogHome.kt index 48aac34ba..4447894b4 100644 --- a/app/src/main/java/eu/kanade/presentation/manga/TrackInfoDialogHome.kt +++ b/app/src/main/java/eu/kanade/presentation/manga/TrackInfoDialogHome.kt @@ -42,14 +42,14 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp -import eu.kanade.presentation.components.Divider import eu.kanade.presentation.components.DropdownMenu import eu.kanade.presentation.components.TrackLogoIcon -import eu.kanade.presentation.components.VerticalDivider import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.track.TrackService import eu.kanade.tachiyomi.ui.manga.track.TrackItem import eu.kanade.tachiyomi.util.system.copyToClipboard +import tachiyomi.presentation.core.components.material.Divider +import tachiyomi.presentation.core.components.material.VerticalDivider import java.text.DateFormat private const val UnsetStatusTextAlpha = 0.5F diff --git a/app/src/main/java/eu/kanade/presentation/manga/TrackInfoDialogSelector.kt b/app/src/main/java/eu/kanade/presentation/manga/TrackInfoDialogSelector.kt index f87672521..19cd4c5bc 100644 --- a/app/src/main/java/eu/kanade/presentation/manga/TrackInfoDialogSelector.kt +++ b/app/src/main/java/eu/kanade/presentation/manga/TrackInfoDialogSelector.kt @@ -29,8 +29,6 @@ import androidx.compose.ui.draw.clip import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp -import eu.kanade.presentation.components.AlertDialogContent -import eu.kanade.presentation.components.Divider import eu.kanade.presentation.components.ScrollbarLazyColumn import eu.kanade.presentation.components.WheelDatePicker import eu.kanade.presentation.components.WheelTextPicker @@ -39,6 +37,8 @@ import eu.kanade.presentation.util.isScrolledToStart import eu.kanade.presentation.util.minimumTouchTargetSize import eu.kanade.presentation.util.padding import eu.kanade.tachiyomi.R +import tachiyomi.presentation.core.components.material.AlertDialogContent +import tachiyomi.presentation.core.components.material.Divider import java.time.LocalDate import java.time.format.TextStyle diff --git a/app/src/main/java/eu/kanade/presentation/manga/TrackServiceSearch.kt b/app/src/main/java/eu/kanade/presentation/manga/TrackServiceSearch.kt index 36ec519a8..c7b2beb63 100644 --- a/app/src/main/java/eu/kanade/presentation/manga/TrackServiceSearch.kt +++ b/app/src/main/java/eu/kanade/presentation/manga/TrackServiceSearch.kt @@ -56,11 +56,9 @@ import androidx.compose.ui.text.intl.Locale import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.text.toLowerCase import androidx.compose.ui.unit.dp -import eu.kanade.presentation.components.Divider import eu.kanade.presentation.components.EmptyScreen import eu.kanade.presentation.components.LoadingScreen import eu.kanade.presentation.components.MangaCover -import eu.kanade.presentation.components.Scaffold import eu.kanade.presentation.components.ScrollbarLazyColumn import eu.kanade.presentation.util.padding import eu.kanade.presentation.util.plus @@ -68,6 +66,8 @@ import eu.kanade.presentation.util.runOnEnterKeyPressed import eu.kanade.presentation.util.secondaryItemAlpha import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.track.model.TrackSearch +import tachiyomi.presentation.core.components.material.Divider +import tachiyomi.presentation.core.components.material.Scaffold @Composable fun TrackServiceSearch( diff --git a/app/src/main/java/eu/kanade/presentation/manga/components/MangaCoverDialog.kt b/app/src/main/java/eu/kanade/presentation/manga/components/MangaCoverDialog.kt index e946383ca..728a24f8e 100644 --- a/app/src/main/java/eu/kanade/presentation/manga/components/MangaCoverDialog.kt +++ b/app/src/main/java/eu/kanade/presentation/manga/components/MangaCoverDialog.kt @@ -44,12 +44,12 @@ import coil.request.CachePolicy import coil.request.ImageRequest import coil.size.Size import eu.kanade.presentation.components.DropdownMenu -import eu.kanade.presentation.components.Scaffold import eu.kanade.presentation.manga.EditCoverAction import eu.kanade.presentation.util.clickableNoIndication import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.ui.reader.viewer.ReaderPageImageView import tachiyomi.domain.manga.model.Manga +import tachiyomi.presentation.core.components.material.Scaffold @Composable fun MangaCoverDialog( diff --git a/app/src/main/java/eu/kanade/presentation/more/LogoHeader.kt b/app/src/main/java/eu/kanade/presentation/more/LogoHeader.kt index b5d5c1255..7a09c6c2a 100644 --- a/app/src/main/java/eu/kanade/presentation/more/LogoHeader.kt +++ b/app/src/main/java/eu/kanade/presentation/more/LogoHeader.kt @@ -11,8 +11,8 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.painterResource import androidx.compose.ui.unit.dp -import eu.kanade.presentation.components.Divider import eu.kanade.tachiyomi.R +import tachiyomi.presentation.core.components.material.Divider @Composable fun LogoHeader() { diff --git a/app/src/main/java/eu/kanade/presentation/more/MoreScreen.kt b/app/src/main/java/eu/kanade/presentation/more/MoreScreen.kt index b463318d6..55225e43b 100644 --- a/app/src/main/java/eu/kanade/presentation/more/MoreScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/MoreScreen.kt @@ -24,8 +24,6 @@ import androidx.compose.ui.platform.LocalUriHandler import androidx.compose.ui.res.pluralStringResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.vectorResource -import eu.kanade.presentation.components.Divider -import eu.kanade.presentation.components.Scaffold import eu.kanade.presentation.components.ScrollbarLazyColumn import eu.kanade.presentation.components.WarningBanner import eu.kanade.presentation.more.settings.widget.SwitchPreferenceWidget @@ -33,6 +31,8 @@ import eu.kanade.presentation.more.settings.widget.TextPreferenceWidget import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.ui.more.DownloadQueueState import tachiyomi.core.Constants +import tachiyomi.presentation.core.components.material.Divider +import tachiyomi.presentation.core.components.material.Scaffold @Composable fun MoreScreen( diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/PreferenceScaffold.kt b/app/src/main/java/eu/kanade/presentation/more/settings/PreferenceScaffold.kt index a1b9e69ee..012e1f01d 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/PreferenceScaffold.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/PreferenceScaffold.kt @@ -10,8 +10,8 @@ import androidx.compose.material3.Text import androidx.compose.material3.TopAppBar import androidx.compose.runtime.Composable import androidx.compose.ui.res.stringResource -import eu.kanade.presentation.components.Scaffold import eu.kanade.tachiyomi.R +import tachiyomi.presentation.core.components.material.Scaffold @Composable fun PreferenceScaffold( diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/AboutScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/AboutScreen.kt index 931603ef2..1e44080db 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/AboutScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/AboutScreen.kt @@ -21,8 +21,6 @@ import cafe.adriel.voyager.navigator.LocalNavigator import cafe.adriel.voyager.navigator.currentOrThrow import eu.kanade.domain.ui.UiPreferences import eu.kanade.presentation.components.AppBar -import eu.kanade.presentation.components.LinkIcon -import eu.kanade.presentation.components.Scaffold import eu.kanade.presentation.components.ScrollbarLazyColumn import eu.kanade.presentation.more.LogoHeader import eu.kanade.presentation.more.settings.widget.TextPreferenceWidget @@ -42,6 +40,8 @@ import logcat.LogPriority import tachiyomi.core.util.lang.withIOContext import tachiyomi.core.util.lang.withUIContext import tachiyomi.core.util.system.logcat +import tachiyomi.presentation.core.components.LinkIcon +import tachiyomi.presentation.core.components.material.Scaffold import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import java.text.DateFormat diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/ClearDatabaseScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/ClearDatabaseScreen.kt index c3ede3a40..9a79f4d76 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/ClearDatabaseScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/ClearDatabaseScreen.kt @@ -38,11 +38,9 @@ import eu.kanade.domain.source.interactor.GetSourcesWithNonLibraryManga import eu.kanade.presentation.browse.components.SourceIcon import eu.kanade.presentation.components.AppBar import eu.kanade.presentation.components.AppBarActions -import eu.kanade.presentation.components.Divider import eu.kanade.presentation.components.EmptyScreen import eu.kanade.presentation.components.FastScrollLazyColumn import eu.kanade.presentation.components.LoadingScreen -import eu.kanade.presentation.components.Scaffold import eu.kanade.presentation.util.selectedBackground import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.util.system.toast @@ -54,6 +52,8 @@ import tachiyomi.core.util.lang.withNonCancellableContext import tachiyomi.data.Database import tachiyomi.domain.source.model.Source import tachiyomi.domain.source.model.SourceWithCount +import tachiyomi.presentation.core.components.material.Divider +import tachiyomi.presentation.core.components.material.Scaffold import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/LicensesScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/LicensesScreen.kt index 09cbfc658..6bf129772 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/LicensesScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/LicensesScreen.kt @@ -11,8 +11,8 @@ import cafe.adriel.voyager.navigator.currentOrThrow import com.mikepenz.aboutlibraries.ui.compose.LibrariesContainer import com.mikepenz.aboutlibraries.ui.compose.LibraryDefaults import eu.kanade.presentation.components.AppBar -import eu.kanade.presentation.components.Scaffold import eu.kanade.tachiyomi.R +import tachiyomi.presentation.core.components.material.Scaffold class LicensesScreen : Screen { diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsBackupScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsBackupScreen.kt index d20fc98ce..76c7538e1 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsBackupScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsBackupScreen.kt @@ -37,7 +37,6 @@ import androidx.compose.ui.unit.dp import androidx.core.net.toUri import com.hippo.unifile.UniFile import eu.kanade.domain.backup.service.BackupPreferences -import eu.kanade.presentation.components.Divider import eu.kanade.presentation.components.ScrollbarLazyColumn import eu.kanade.presentation.more.settings.Preference import eu.kanade.presentation.util.collectAsState @@ -54,6 +53,7 @@ import eu.kanade.tachiyomi.util.system.DeviceUtil import eu.kanade.tachiyomi.util.system.copyToClipboard import eu.kanade.tachiyomi.util.system.toast import kotlinx.coroutines.launch +import tachiyomi.presentation.core.components.material.Divider import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsMainScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsMainScreen.kt index 63b048625..39198a359 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsMainScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsMainScreen.kt @@ -48,10 +48,10 @@ import cafe.adriel.voyager.navigator.currentOrThrow import eu.kanade.presentation.components.AppBar import eu.kanade.presentation.components.AppBarActions import eu.kanade.presentation.components.LazyColumn -import eu.kanade.presentation.components.Scaffold import eu.kanade.presentation.more.settings.widget.TextPreferenceWidget import eu.kanade.presentation.util.LocalBackPress import eu.kanade.tachiyomi.R +import tachiyomi.presentation.core.components.material.Scaffold object SettingsMainScreen : Screen { diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsSearchScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsSearchScreen.kt index 7dd1543ea..8930612df 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsSearchScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsSearchScreen.kt @@ -50,13 +50,13 @@ import androidx.compose.ui.unit.dp import cafe.adriel.voyager.core.screen.Screen import cafe.adriel.voyager.navigator.LocalNavigator import cafe.adriel.voyager.navigator.currentOrThrow -import eu.kanade.presentation.components.Divider import eu.kanade.presentation.components.EmptyScreen -import eu.kanade.presentation.components.Scaffold import eu.kanade.presentation.more.settings.Preference import eu.kanade.presentation.util.runOnEnterKeyPressed import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.util.system.isLTR +import tachiyomi.presentation.core.components.material.Divider +import tachiyomi.presentation.core.components.material.Scaffold class SettingsSearchScreen : Screen { diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/WorkerInfoScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/WorkerInfoScreen.kt index 48dc95de0..f4c10f244 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/WorkerInfoScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/WorkerInfoScreen.kt @@ -38,13 +38,13 @@ import cafe.adriel.voyager.core.screen.Screen import cafe.adriel.voyager.navigator.LocalNavigator import cafe.adriel.voyager.navigator.currentOrThrow import eu.kanade.presentation.components.LazyColumn -import eu.kanade.presentation.components.Scaffold import eu.kanade.presentation.util.plus import eu.kanade.tachiyomi.R import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.launch +import tachiyomi.presentation.core.components.material.Scaffold object WorkerInfoScreen : Screen { diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/widget/AppThemePreferenceWidget.kt b/app/src/main/java/eu/kanade/presentation/more/settings/widget/AppThemePreferenceWidget.kt index 2600d5735..6a85c84c3 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/widget/AppThemePreferenceWidget.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/widget/AppThemePreferenceWidget.kt @@ -39,7 +39,6 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import eu.kanade.domain.ui.model.AppTheme -import eu.kanade.presentation.components.DIVIDER_ALPHA import eu.kanade.presentation.components.MangaCover import eu.kanade.presentation.theme.TachiyomiTheme import eu.kanade.presentation.util.ThemePreviews @@ -48,6 +47,7 @@ import eu.kanade.presentation.util.secondaryItemAlpha import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.util.system.DeviceUtil import eu.kanade.tachiyomi.util.system.isDynamicColorAvailable +import tachiyomi.presentation.core.components.material.DIVIDER_ALPHA @Composable internal fun AppThemePreferenceWidget( diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/widget/ListPreferenceWidget.kt b/app/src/main/java/eu/kanade/presentation/more/settings/widget/ListPreferenceWidget.kt index 41df13266..2d63969be 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/widget/ListPreferenceWidget.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/widget/ListPreferenceWidget.kt @@ -22,12 +22,12 @@ import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp -import eu.kanade.presentation.components.Divider import eu.kanade.presentation.components.ScrollbarLazyColumn import eu.kanade.presentation.util.isScrolledToEnd import eu.kanade.presentation.util.isScrolledToStart import eu.kanade.presentation.util.minimumTouchTargetSize import eu.kanade.tachiyomi.R +import tachiyomi.presentation.core.components.material.Divider @Composable fun ListPreferenceWidget( diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/widget/TriStateListDialog.kt b/app/src/main/java/eu/kanade/presentation/more/settings/widget/TriStateListDialog.kt index 7f3a2c8a6..682033b7d 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/widget/TriStateListDialog.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/widget/TriStateListDialog.kt @@ -27,11 +27,11 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp -import eu.kanade.presentation.components.Divider import eu.kanade.presentation.components.LazyColumn import eu.kanade.presentation.util.isScrolledToEnd import eu.kanade.presentation.util.isScrolledToStart import eu.kanade.tachiyomi.R +import tachiyomi.presentation.core.components.material.Divider private enum class State { CHECKED, INVERSED, UNCHECKED diff --git a/app/src/main/java/eu/kanade/presentation/updates/UpdatesScreen.kt b/app/src/main/java/eu/kanade/presentation/updates/UpdatesScreen.kt index 770733669..4764dc653 100644 --- a/app/src/main/java/eu/kanade/presentation/updates/UpdatesScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/updates/UpdatesScreen.kt @@ -29,14 +29,14 @@ import eu.kanade.presentation.components.EmptyScreen import eu.kanade.presentation.components.FastScrollLazyColumn import eu.kanade.presentation.components.LoadingScreen import eu.kanade.presentation.components.MangaBottomActionMenu -import eu.kanade.presentation.components.PullRefresh -import eu.kanade.presentation.components.Scaffold import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.download.model.Download import eu.kanade.tachiyomi.ui.updates.UpdatesItem import eu.kanade.tachiyomi.ui.updates.UpdatesState import kotlinx.coroutines.delay import kotlinx.coroutines.launch +import tachiyomi.presentation.core.components.material.PullRefresh +import tachiyomi.presentation.core.components.material.Scaffold import kotlin.time.Duration.Companion.seconds @Composable diff --git a/app/src/main/java/eu/kanade/presentation/webview/WebViewScreenContent.kt b/app/src/main/java/eu/kanade/presentation/webview/WebViewScreenContent.kt index b496a6a05..8cc56af07 100644 --- a/app/src/main/java/eu/kanade/presentation/webview/WebViewScreenContent.kt +++ b/app/src/main/java/eu/kanade/presentation/webview/WebViewScreenContent.kt @@ -25,10 +25,10 @@ import com.google.accompanist.web.rememberWebViewNavigator import com.google.accompanist.web.rememberWebViewState import eu.kanade.presentation.components.AppBar import eu.kanade.presentation.components.AppBarActions -import eu.kanade.presentation.components.Scaffold import eu.kanade.tachiyomi.BuildConfig import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.util.system.setDefaultSettings +import tachiyomi.presentation.core.components.material.Scaffold @Composable fun WebViewScreenContent( diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/details/SourcePreferencesScreen.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/details/SourcePreferencesScreen.kt index d65d2d9bc..f4c9ea37b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/details/SourcePreferencesScreen.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/details/SourcePreferencesScreen.kt @@ -39,13 +39,13 @@ import cafe.adriel.voyager.core.screen.Screen import cafe.adriel.voyager.core.screen.uniqueScreenKey import cafe.adriel.voyager.navigator.LocalNavigator import cafe.adriel.voyager.navigator.currentOrThrow -import eu.kanade.presentation.components.Scaffold import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.preference.SharedPreferencesDataStore import eu.kanade.tachiyomi.source.ConfigurableSource import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.source.getPreferenceKey import eu.kanade.tachiyomi.widget.TachiyomiTextInputEditText.Companion.setIncognito +import tachiyomi.presentation.core.components.material.Scaffold import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/SourceSearchScreen.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/SourceSearchScreen.kt index ab36d8312..3bef46ecf 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/SourceSearchScreen.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/SourceSearchScreen.kt @@ -23,8 +23,6 @@ import cafe.adriel.voyager.core.screen.Screen import cafe.adriel.voyager.navigator.LocalNavigator import cafe.adriel.voyager.navigator.currentOrThrow import eu.kanade.presentation.browse.BrowseSourceContent -import eu.kanade.presentation.components.ExtendedFloatingActionButton -import eu.kanade.presentation.components.Scaffold import eu.kanade.presentation.components.SearchToolbar import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.source.LocalSource @@ -36,6 +34,8 @@ import eu.kanade.tachiyomi.ui.webview.WebViewScreen import kotlinx.coroutines.launch import tachiyomi.core.Constants import tachiyomi.domain.manga.model.Manga +import tachiyomi.presentation.core.components.material.ExtendedFloatingActionButton +import tachiyomi.presentation.core.components.material.Scaffold data class SourceSearchScreen( private val oldManga: Manga, diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceScreen.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceScreen.kt index f14182f06..51fc3d28e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceScreen.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceScreen.kt @@ -43,9 +43,7 @@ import eu.kanade.presentation.browse.MissingSourceScreen import eu.kanade.presentation.browse.components.BrowseSourceToolbar import eu.kanade.presentation.browse.components.RemoveMangaDialog import eu.kanade.presentation.components.ChangeCategoryDialog -import eu.kanade.presentation.components.Divider import eu.kanade.presentation.components.DuplicateMangaDialog -import eu.kanade.presentation.components.Scaffold import eu.kanade.presentation.util.AssistContentScreen import eu.kanade.presentation.util.padding import eu.kanade.tachiyomi.R @@ -62,6 +60,8 @@ import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.receiveAsFlow import tachiyomi.core.Constants import tachiyomi.core.util.lang.launchIO +import tachiyomi.presentation.core.components.material.Divider +import tachiyomi.presentation.core.components.material.Scaffold data class BrowseSourceScreen( private val sourceId: Long, diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadQueueScreen.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadQueueScreen.kt index 8a81e748a..c8e82247a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadQueueScreen.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadQueueScreen.kt @@ -50,14 +50,14 @@ import cafe.adriel.voyager.navigator.LocalNavigator import cafe.adriel.voyager.navigator.currentOrThrow import eu.kanade.presentation.components.AppBar import eu.kanade.presentation.components.EmptyScreen -import eu.kanade.presentation.components.ExtendedFloatingActionButton import eu.kanade.presentation.components.OverflowMenu -import eu.kanade.presentation.components.Pill -import eu.kanade.presentation.components.Scaffold import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.download.DownloadService import eu.kanade.tachiyomi.databinding.DownloadListBinding import tachiyomi.core.util.lang.launchUI +import tachiyomi.presentation.core.components.Pill +import tachiyomi.presentation.core.components.material.ExtendedFloatingActionButton +import tachiyomi.presentation.core.components.material.Scaffold import kotlin.math.roundToInt object DownloadQueueScreen : Screen { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/home/HomeScreen.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/home/HomeScreen.kt index 8522d15f5..475b1cf23 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/home/HomeScreen.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/home/HomeScreen.kt @@ -39,7 +39,6 @@ import eu.kanade.domain.library.service.LibraryPreferences import eu.kanade.domain.source.service.SourcePreferences import eu.kanade.presentation.components.NavigationBar import eu.kanade.presentation.components.NavigationRail -import eu.kanade.presentation.components.Scaffold import eu.kanade.presentation.util.isTabletUi import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.ui.browse.BrowseTab @@ -56,6 +55,7 @@ import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.launch import soup.compose.material.motion.animation.materialFadeThroughIn import soup.compose.material.motion.animation.materialFadeThroughOut +import tachiyomi.presentation.core.components.material.Scaffold import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryTab.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryTab.kt index f2a12caba..d94b0b642 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryTab.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryTab.kt @@ -35,7 +35,6 @@ import eu.kanade.presentation.components.EmptyScreen import eu.kanade.presentation.components.EmptyScreenAction import eu.kanade.presentation.components.LibraryBottomActionMenu import eu.kanade.presentation.components.LoadingScreen -import eu.kanade.presentation.components.Scaffold import eu.kanade.presentation.library.components.LibraryContent import eu.kanade.presentation.library.components.LibraryToolbar import eu.kanade.presentation.util.Tab @@ -56,6 +55,7 @@ import tachiyomi.domain.category.model.Category import tachiyomi.domain.library.model.LibraryManga import tachiyomi.domain.library.model.display import tachiyomi.domain.manga.model.Manga +import tachiyomi.presentation.core.components.material.Scaffold object LibraryTab : Tab { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt index 6b8497fc0..e5536a764 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt @@ -61,7 +61,6 @@ import eu.kanade.presentation.components.AppStateBanners import eu.kanade.presentation.components.DownloadedOnlyBannerBackgroundColor import eu.kanade.presentation.components.IncognitoModeBannerBackgroundColor import eu.kanade.presentation.components.IndexingBannerBackgroundColor -import eu.kanade.presentation.components.Scaffold import eu.kanade.presentation.util.AssistContentScreen import eu.kanade.presentation.util.DefaultNavigatorScreenTransition import eu.kanade.presentation.util.collectAsState @@ -102,6 +101,7 @@ import logcat.LogPriority import tachiyomi.core.Constants import tachiyomi.core.util.system.logcat import tachiyomi.domain.category.model.Category +import tachiyomi.presentation.core.components.material.Scaffold import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import uy.kohesive.injekt.injectLazy diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackInfoDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackInfoDialog.kt index 03d0c5ad8..9c9d553a5 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackInfoDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackInfoDialog.kt @@ -40,7 +40,6 @@ import eu.kanade.domain.chapter.interactor.SyncChaptersWithTrackServiceTwoWay import eu.kanade.domain.track.model.toDbTrack import eu.kanade.domain.track.model.toDomainTrack import eu.kanade.domain.ui.UiPreferences -import eu.kanade.presentation.components.AlertDialogContent import eu.kanade.presentation.manga.TrackChapterSelector import eu.kanade.presentation.manga.TrackDateSelector import eu.kanade.presentation.manga.TrackInfoDialogHome @@ -73,6 +72,7 @@ import tachiyomi.domain.manga.interactor.GetMangaWithChapters import tachiyomi.domain.track.interactor.DeleteTrack import tachiyomi.domain.track.interactor.GetTracks import tachiyomi.domain.track.interactor.InsertTrack +import tachiyomi.presentation.core.components.material.AlertDialogContent import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import java.time.Instant diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/stats/StatsScreen.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/stats/StatsScreen.kt index b4e0f384e..45795b46e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/stats/StatsScreen.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/stats/StatsScreen.kt @@ -11,10 +11,10 @@ import cafe.adriel.voyager.navigator.LocalNavigator import cafe.adriel.voyager.navigator.currentOrThrow import eu.kanade.presentation.components.AppBar import eu.kanade.presentation.components.LoadingScreen -import eu.kanade.presentation.components.Scaffold import eu.kanade.presentation.more.stats.StatsScreenContent import eu.kanade.presentation.more.stats.StatsScreenState import eu.kanade.tachiyomi.R +import tachiyomi.presentation.core.components.material.Scaffold class StatsScreen : Screen { diff --git a/presentation-core/build.gradle.kts b/presentation-core/build.gradle.kts index c8151eb05..8c2218464 100644 --- a/presentation-core/build.gradle.kts +++ b/presentation-core/build.gradle.kts @@ -10,8 +10,42 @@ android { testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") } + + buildFeatures { + compose = true + } + + composeOptions { + kotlinCompilerExtensionVersion = compose.versions.compiler.get() + } } dependencies { - + // Compose + implementation(platform(compose.bom)) + implementation(compose.foundation) + implementation(compose.material3.core) + implementation(compose.material.core) + implementation(compose.material.icons) + implementation(compose.animation) + implementation(compose.animation.graphics) + implementation(compose.ui.tooling) + implementation(compose.ui.util) +} + +tasks { + // See https://kotlinlang.org/docs/reference/experimental.html#experimental-status-of-experimental-api(-markers) + withType { + kotlinOptions.freeCompilerArgs += listOf( + "-opt-in=coil.annotation.ExperimentalCoilApi", + "-opt-in=androidx.compose.foundation.layout.ExperimentalLayoutApi", + "-opt-in=androidx.compose.material.ExperimentalMaterialApi", + "-opt-in=androidx.compose.material3.ExperimentalMaterial3Api", + "-opt-in=androidx.compose.material.ExperimentalMaterialApi", + "-opt-in=androidx.compose.ui.ExperimentalComposeUiApi", + "-opt-in=androidx.compose.foundation.ExperimentalFoundationApi", + "-opt-in=androidx.compose.animation.ExperimentalAnimationApi", + "-opt-in=androidx.compose.animation.graphics.ExperimentalAnimationGraphicsApi", + ) + } } diff --git a/app/src/main/java/eu/kanade/presentation/components/Badges.kt b/presentation-core/src/main/java/tachiyomi/presentation/core/components/Badges.kt similarity index 98% rename from app/src/main/java/eu/kanade/presentation/components/Badges.kt rename to presentation-core/src/main/java/tachiyomi/presentation/core/components/Badges.kt index 60533b79a..f2a004ba2 100644 --- a/app/src/main/java/eu/kanade/presentation/components/Badges.kt +++ b/presentation-core/src/main/java/tachiyomi/presentation/core/components/Badges.kt @@ -1,4 +1,4 @@ -package eu.kanade.presentation.components +package tachiyomi.presentation.core.components import androidx.compose.foundation.background import androidx.compose.foundation.layout.Row diff --git a/app/src/main/java/eu/kanade/presentation/components/LinkIcon.kt b/presentation-core/src/main/java/tachiyomi/presentation/core/components/LinkIcon.kt similarity index 95% rename from app/src/main/java/eu/kanade/presentation/components/LinkIcon.kt rename to presentation-core/src/main/java/tachiyomi/presentation/core/components/LinkIcon.kt index 5dd801ac4..9208c587a 100644 --- a/app/src/main/java/eu/kanade/presentation/components/LinkIcon.kt +++ b/presentation-core/src/main/java/tachiyomi/presentation/core/components/LinkIcon.kt @@ -1,4 +1,4 @@ -package eu.kanade.presentation.components +package tachiyomi.presentation.core.components import androidx.compose.foundation.layout.padding import androidx.compose.material3.Icon diff --git a/app/src/main/java/eu/kanade/presentation/components/Pill.kt b/presentation-core/src/main/java/tachiyomi/presentation/core/components/Pill.kt similarity index 96% rename from app/src/main/java/eu/kanade/presentation/components/Pill.kt rename to presentation-core/src/main/java/tachiyomi/presentation/core/components/Pill.kt index 9f935d1d9..fe5da2d25 100644 --- a/app/src/main/java/eu/kanade/presentation/components/Pill.kt +++ b/presentation-core/src/main/java/tachiyomi/presentation/core/components/Pill.kt @@ -1,4 +1,4 @@ -package eu.kanade.presentation.components +package tachiyomi.presentation.core.components import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.IntrinsicSize diff --git a/app/src/main/java/eu/kanade/presentation/components/AlertDialog.kt b/presentation-core/src/main/java/tachiyomi/presentation/core/components/material/AlertDialog.kt similarity index 98% rename from app/src/main/java/eu/kanade/presentation/components/AlertDialog.kt rename to presentation-core/src/main/java/tachiyomi/presentation/core/components/material/AlertDialog.kt index 1a6751970..74f5ec8f0 100644 --- a/app/src/main/java/eu/kanade/presentation/components/AlertDialog.kt +++ b/presentation-core/src/main/java/tachiyomi/presentation/core/components/material/AlertDialog.kt @@ -1,4 +1,4 @@ -package eu.kanade.presentation.components +package tachiyomi.presentation.core.components.material import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column diff --git a/app/src/main/java/eu/kanade/presentation/components/Divider.kt b/presentation-core/src/main/java/tachiyomi/presentation/core/components/material/Divider.kt similarity index 95% rename from app/src/main/java/eu/kanade/presentation/components/Divider.kt rename to presentation-core/src/main/java/tachiyomi/presentation/core/components/material/Divider.kt index 2082e73cb..a434d6354 100644 --- a/app/src/main/java/eu/kanade/presentation/components/Divider.kt +++ b/presentation-core/src/main/java/tachiyomi/presentation/core/components/material/Divider.kt @@ -1,4 +1,4 @@ -package eu.kanade.presentation.components +package tachiyomi.presentation.core.components.material import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box diff --git a/app/src/main/java/eu/kanade/presentation/components/FloatingActionButton.kt b/presentation-core/src/main/java/tachiyomi/presentation/core/components/material/FloatingActionButton.kt similarity index 98% rename from app/src/main/java/eu/kanade/presentation/components/FloatingActionButton.kt rename to presentation-core/src/main/java/tachiyomi/presentation/core/components/material/FloatingActionButton.kt index ebb29032b..645e318f3 100644 --- a/app/src/main/java/eu/kanade/presentation/components/FloatingActionButton.kt +++ b/presentation-core/src/main/java/tachiyomi/presentation/core/components/material/FloatingActionButton.kt @@ -1,4 +1,4 @@ -package eu.kanade.presentation.components +package tachiyomi.presentation.core.components.material import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.core.CubicBezierEasing diff --git a/app/src/main/java/eu/kanade/presentation/components/PullRefresh.kt b/presentation-core/src/main/java/tachiyomi/presentation/core/components/material/PullRefresh.kt similarity index 97% rename from app/src/main/java/eu/kanade/presentation/components/PullRefresh.kt rename to presentation-core/src/main/java/tachiyomi/presentation/core/components/material/PullRefresh.kt index 25699a6a5..2200b5354 100644 --- a/app/src/main/java/eu/kanade/presentation/components/PullRefresh.kt +++ b/presentation-core/src/main/java/tachiyomi/presentation/core/components/material/PullRefresh.kt @@ -1,4 +1,4 @@ -package eu.kanade.presentation.components +package tachiyomi.presentation.core.components.material import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.PaddingValues diff --git a/app/src/main/java/eu/kanade/presentation/components/Scaffold.kt b/presentation-core/src/main/java/tachiyomi/presentation/core/components/material/Scaffold.kt similarity index 99% rename from app/src/main/java/eu/kanade/presentation/components/Scaffold.kt rename to presentation-core/src/main/java/tachiyomi/presentation/core/components/material/Scaffold.kt index aa76cd92e..7ecd5964c 100644 --- a/app/src/main/java/eu/kanade/presentation/components/Scaffold.kt +++ b/presentation-core/src/main/java/tachiyomi/presentation/core/components/material/Scaffold.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.kanade.presentation.components +package tachiyomi.presentation.core.components.material import androidx.compose.foundation.layout.MutableWindowInsets import androidx.compose.foundation.layout.PaddingValues diff --git a/source-api/src/main/java/eu/kanade/tachiyomi/source/online/HttpSourceFetcher.kt b/source-api/src/main/java/eu/kanade/tachiyomi/source/online/HttpSourceFetcher.kt index 6b5e4a638..76c68e882 100644 --- a/source-api/src/main/java/eu/kanade/tachiyomi/source/online/HttpSourceFetcher.kt +++ b/source-api/src/main/java/eu/kanade/tachiyomi/source/online/HttpSourceFetcher.kt @@ -3,23 +3,23 @@ package eu.kanade.tachiyomi.source.online import eu.kanade.tachiyomi.source.model.Page import rx.Observable -fun HttpSource.getImageUrl(page: Page): Observable { - page.status = Page.State.LOAD_PAGE - return fetchImageUrl(page) - .doOnError { page.status = Page.State.ERROR } - .onErrorReturn { null } - .doOnNext { page.imageUrl = it } - .map { page } -} - fun HttpSource.fetchAllImageUrlsFromPageList(pages: List): Observable { return Observable.from(pages) .filter { !it.imageUrl.isNullOrEmpty() } .mergeWith(fetchRemainingImageUrlsFromPageList(pages)) } -fun HttpSource.fetchRemainingImageUrlsFromPageList(pages: List): Observable { +private fun HttpSource.fetchRemainingImageUrlsFromPageList(pages: List): Observable { return Observable.from(pages) .filter { it.imageUrl.isNullOrEmpty() } .concatMap { getImageUrl(it) } } + +private fun HttpSource.getImageUrl(page: Page): Observable { + page.status = Page.State.LOAD_PAGE + return fetchImageUrl(page) + .doOnError { page.status = Page.State.ERROR } + .onErrorReturn { null } + .doOnNext { page.imageUrl = it } + .map { page } +}