diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/details/ExtensionDetailsController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/details/ExtensionDetailsController.kt index a1cc1572f..9d7043810 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/details/ExtensionDetailsController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/details/ExtensionDetailsController.kt @@ -14,6 +14,7 @@ import android.view.MenuItem import android.view.View import android.view.ViewGroup import androidx.appcompat.view.ContextThemeWrapper +import androidx.core.net.toUri import androidx.core.os.bundleOf import androidx.preference.Preference import androidx.preference.PreferenceGroupAdapter @@ -175,10 +176,13 @@ class ExtensionDetailsController(bundle: Bundle? = null) : override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { inflater.inflate(R.menu.extension_details, menu) + + menu.findItem(R.id.action_history).isVisible = presenter.extension?.isUnofficial == false } override fun onOptionsItemSelected(item: MenuItem): Boolean { when (item.itemId) { + R.id.action_history -> openCommitHistory() R.id.action_enable_all -> toggleAllSources(true) R.id.action_disable_all -> toggleAllSources(false) R.id.action_open_in_settings -> openInSettings() @@ -202,6 +206,13 @@ class ExtensionDetailsController(bundle: Bundle? = null) : } } + private fun openCommitHistory() { + val pkgName = presenter.extension!!.pkgName.substringAfter("eu.kanade.tachiyomi.extension.") + val url = "https://github.com/tachiyomiorg/tachiyomi-extensions/commits/master/src/${pkgName.replace(".", "/")}" + val intent = Intent(Intent.ACTION_VIEW, url.toUri()) + startActivity(intent) + } + private fun openInSettings() { val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS).apply { data = Uri.fromParts("package", presenter.pkgName, null) diff --git a/app/src/main/res/menu/extension_details.xml b/app/src/main/res/menu/extension_details.xml index 4887cc6ee..dcdbdef1c 100644 --- a/app/src/main/res/menu/extension_details.xml +++ b/app/src/main/res/menu/extension_details.xml @@ -1,6 +1,13 @@ + +