Added a getting started guide action for when the library is empty

Co-authored-by: Jays2Kings <Jays2Kings@users.noreply.github.com>
This commit is contained in:
arkon 2021-08-31 17:51:15 -04:00
parent 18b5250ed1
commit b9f7660a91
2 changed files with 12 additions and 2 deletions

View file

@ -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.main.MainActivity
import eu.kanade.tachiyomi.ui.manga.MangaController import eu.kanade.tachiyomi.ui.manga.MangaController
import eu.kanade.tachiyomi.util.system.getResourceColor 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.util.system.toast
import eu.kanade.tachiyomi.widget.EmptyView
import kotlinx.coroutines.flow.drop import kotlinx.coroutines.flow.drop
import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.flow.onEach
@ -275,7 +277,14 @@ class LibraryController(
if (mangaMap.isNotEmpty()) { if (mangaMap.isNotEmpty()) {
binding.emptyView.hide() binding.emptyView.hide()
} else { } 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 (activity as? MainActivity)?.ready = true
} }

View file

@ -749,7 +749,8 @@
<string name="information_no_downloads">No downloads</string> <string name="information_no_downloads">No downloads</string>
<string name="information_no_recent">No recent updates</string> <string name="information_no_recent">No recent updates</string>
<string name="information_no_recent_manga">Nothing read recently</string> <string name="information_no_recent_manga">Nothing read recently</string>
<string name="information_empty_library">Your library is empty. Add series to your library from Browse.</string> <string name="information_empty_library">Your library is empty</string>
<string name="getting_started_guide">Getting started guide</string>
<string name="information_empty_category">You have no categories. Tap the plus button to create one for organizing your library.</string> <string name="information_empty_category">You have no categories. Tap the plus button to create one for organizing your library.</string>
<string name="information_empty_category_dialog">You don\'t have any categories yet.</string> <string name="information_empty_category_dialog">You don\'t have any categories yet.</string>
<string name="information_cloudflare_bypass_failure">Failed to bypass Cloudflare</string> <string name="information_cloudflare_bypass_failure">Failed to bypass Cloudflare</string>