From a37f3eb70922557cd0e4ed0c05d3563850b49757 Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 12 Jan 2024 09:27:59 -0500 Subject: [PATCH] Better message for empty extensions list --- .../kanade/presentation/browse/ExtensionsScreen.kt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 1b8b48a1e..8e6c7913b 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/ExtensionsScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/ExtensionsScreen.kt @@ -40,11 +40,14 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp +import cafe.adriel.voyager.navigator.LocalNavigator +import cafe.adriel.voyager.navigator.currentOrThrow import dev.icerock.moko.resources.StringResource import eu.kanade.presentation.browse.components.BaseBrowseItem import eu.kanade.presentation.browse.components.ExtensionIcon import eu.kanade.presentation.components.WarningBanner import eu.kanade.presentation.manga.components.DotSeparatorNoSpaceText +import eu.kanade.presentation.more.settings.screen.browse.ExtensionReposScreen import eu.kanade.presentation.util.rememberRequestPackageInstallsPermissionState import eu.kanade.tachiyomi.extension.model.Extension import eu.kanade.tachiyomi.extension.model.InstallStep @@ -52,6 +55,7 @@ import eu.kanade.tachiyomi.ui.browse.extension.ExtensionUiModel import eu.kanade.tachiyomi.ui.browse.extension.ExtensionsScreenModel import eu.kanade.tachiyomi.util.system.LocaleHelper import eu.kanade.tachiyomi.util.system.launchRequestPackageInstallsPermission +import kotlinx.collections.immutable.persistentListOf import tachiyomi.i18n.MR import tachiyomi.presentation.core.components.FastScrollLazyColumn import tachiyomi.presentation.core.components.material.PullRefresh @@ -59,6 +63,7 @@ import tachiyomi.presentation.core.components.material.padding import tachiyomi.presentation.core.components.material.topSmallPaddingValues import tachiyomi.presentation.core.i18n.stringResource import tachiyomi.presentation.core.screens.EmptyScreen +import tachiyomi.presentation.core.screens.EmptyScreenAction import tachiyomi.presentation.core.screens.LoadingScreen import tachiyomi.presentation.core.theme.header import tachiyomi.presentation.core.util.plus @@ -80,6 +85,8 @@ fun ExtensionScreen( onClickUpdateAll: () -> Unit, onRefresh: () -> Unit, ) { + val navigator = LocalNavigator.currentOrThrow + PullRefresh( refreshing = state.isRefreshing, onRefresh = onRefresh, @@ -96,6 +103,13 @@ fun ExtensionScreen( EmptyScreen( stringRes = msg, modifier = Modifier.padding(contentPadding), + actions = persistentListOf( + EmptyScreenAction( + stringRes = MR.strings.label_extension_repos, + icon = Icons.Outlined.Settings, + onClick = { navigator.push(ExtensionReposScreen()) }, + ), + ), ) } else -> {