From b9f7660a91b901ea84fca6dde1655513582d64a0 Mon Sep 17 00:00:00 2001 From: arkon Date: Tue, 31 Aug 2021 17:51:15 -0400 Subject: [PATCH] Added a getting started guide action for when the library is empty Co-authored-by: Jays2Kings --- .../kanade/tachiyomi/ui/library/LibraryController.kt | 11 ++++++++++- app/src/main/res/values/strings.xml | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt index 646aab1e07..3d9476fdca 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt @@ -33,7 +33,9 @@ import eu.kanade.tachiyomi.ui.browse.source.globalsearch.GlobalSearchController import eu.kanade.tachiyomi.ui.main.MainActivity import eu.kanade.tachiyomi.ui.manga.MangaController import eu.kanade.tachiyomi.util.system.getResourceColor +import eu.kanade.tachiyomi.util.system.openInBrowser import eu.kanade.tachiyomi.util.system.toast +import eu.kanade.tachiyomi.widget.EmptyView import kotlinx.coroutines.flow.drop import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach @@ -275,7 +277,14 @@ class LibraryController( if (mangaMap.isNotEmpty()) { binding.emptyView.hide() } else { - binding.emptyView.show(R.string.information_empty_library) + binding.emptyView.show( + R.string.information_empty_library, + listOf( + EmptyView.Action(R.string.getting_started_guide, R.drawable.ic_help_24dp) { + activity?.openInBrowser("https://tachiyomi.org/help/guides/getting-started") + } + ), + ) (activity as? MainActivity)?.ready = true } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 16c79fd116..3b33d7905f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -749,7 +749,8 @@ No downloads No recent updates Nothing read recently - Your library is empty. Add series to your library from Browse. + Your library is empty + Getting started guide You have no categories. Tap the plus button to create one for organizing your library. You don\'t have any categories yet. Failed to bypass Cloudflare