From a1e31549a223f2a0d2006814db443702c9fc0138 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 5 Jun 2021 18:01:34 -0400 Subject: [PATCH] Add shortcut to tracking guide on website --- .../sources/MigrationSourcesController.kt | 6 ++---- .../ui/setting/SettingsTrackingController.kt | 16 ++++++++++++++++ app/src/main/res/menu/settings_tracking.xml | 11 +++++++++++ app/src/main/res/values/strings.xml | 1 + 4 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 app/src/main/res/menu/settings_tracking.xml diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/sources/MigrationSourcesController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/sources/MigrationSourcesController.kt index 08683c5977..d8124724e3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/sources/MigrationSourcesController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/sources/MigrationSourcesController.kt @@ -72,8 +72,6 @@ class MigrationSourcesController : parentController!!.router.pushController(controller.withFadeTransaction()) return false } - - companion object { - const val HELP_URL = "https://tachiyomi.org/help/guides/source-migration/" - } } + +private const val HELP_URL = "https://tachiyomi.org/help/guides/source-migration/" diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsTrackingController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsTrackingController.kt index 20263fe712..dbf72ef6ef 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsTrackingController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsTrackingController.kt @@ -1,6 +1,9 @@ package eu.kanade.tachiyomi.ui.setting import android.app.Activity +import android.view.Menu +import android.view.MenuInflater +import android.view.MenuItem import androidx.preference.PreferenceScreen import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.track.NoLoginTrackService @@ -112,6 +115,17 @@ class SettingsTrackingController : updatePreference(trackManager.bangumi.id) } + override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { + inflater.inflate(R.menu.settings_tracking, menu) + } + + override fun onOptionsItemSelected(item: MenuItem): Boolean { + when (item.itemId) { + R.id.action_tracking_help -> activity?.openInBrowser(HELP_URL) + } + return super.onOptionsItemSelected(item) + } + private fun updatePreference(id: Int) { val pref = findPreference(Keys.trackUsername(id)) as? LoginPreference pref?.notifyChanged() @@ -125,3 +139,5 @@ class SettingsTrackingController : updatePreference(service.id) } } + +private const val HELP_URL = "https://tachiyomi.org/help/guides/tracking/" diff --git a/app/src/main/res/menu/settings_tracking.xml b/app/src/main/res/menu/settings_tracking.xml new file mode 100644 index 0000000000..cdab602071 --- /dev/null +++ b/app/src/main/res/menu/settings_tracking.xml @@ -0,0 +1,11 @@ + + + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 20946c7892..6087f93e6b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -378,6 +378,7 @@ Manga in excluded categories will not be downloaded even if they are also in included categories. + Tracking guide Update chapter progress after reading Track silently when adding manga to library Services