Add shortcut to tracking guide on website

This commit is contained in:
arkon 2021-06-05 18:01:34 -04:00
parent 71d225c562
commit a1e31549a2
4 changed files with 30 additions and 4 deletions

View file

@ -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/"

View file

@ -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/"

View file

@ -0,0 +1,11 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_tracking_help"
android:icon="@drawable/ic_help_24dp"
android:title="@string/tracking_guide"
app:iconTint="?attr/colorOnPrimary"
app:showAsAction="ifRoom" />
</menu>

View file

@ -378,6 +378,7 @@
<string name="pref_download_new_categories_details">Manga in excluded categories will not be downloaded even if they are also in included categories.</string>
<!-- Tracking section -->
<string name="tracking_guide">Tracking guide</string>
<string name="pref_auto_update_manga_sync">Update chapter progress after reading</string>
<string name="pref_auto_add_track">Track silently when adding manga to library</string>
<string name="services">Services</string>