From 9cea45af1de3bd8c5abfde6bce583a959e2d35ec Mon Sep 17 00:00:00 2001 From: Jay Date: Sun, 23 Feb 2020 16:01:30 -0800 Subject: [PATCH] Added button for bug reporting in debug build --- .../kanade/tachiyomi/ui/setting/SettingsMainController.kt | 5 ++++- app/src/main/res/drawable/ic_bug_report_white_24dp.xml | 6 ++++++ app/src/main/res/menu/settings_main.xml | 7 +++++++ app/src/main/res/values/strings.xml | 1 + 4 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 app/src/main/res/drawable/ic_bug_report_white_24dp.xml diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsMainController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsMainController.kt index 510b020081..20ccb8ccca 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsMainController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsMainController.kt @@ -5,10 +5,10 @@ import android.view.MenuInflater import android.view.MenuItem import androidx.preference.PreferenceScreen import com.bluelinelabs.conductor.Controller +import eu.kanade.tachiyomi.BuildConfig import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction import eu.kanade.tachiyomi.ui.extension.ExtensionController -import eu.kanade.tachiyomi.ui.main.MainActivity import eu.kanade.tachiyomi.util.system.getResourceColor import eu.kanade.tachiyomi.util.system.openInBrowser @@ -81,11 +81,13 @@ class SettingsMainController : SettingsController() { } override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { inflater.inflate(R.menu.settings_main, menu) + menu.findItem(R.id.action_bug_report).isVisible = BuildConfig.DEBUG } override fun onOptionsItemSelected(item: MenuItem): Boolean { when (item.itemId) { R.id.action_help -> activity?.openInBrowser(URL_HELP) + R.id.action_bug_report -> activity?.openInBrowser(URL_BUG_REPORT) else -> return super.onOptionsItemSelected(item) } return true @@ -97,5 +99,6 @@ class SettingsMainController : SettingsController() { private companion object { private const val URL_HELP = "https://tachiyomi.org/help/" + private const val URL_BUG_REPORT = "https://github.com/Jays2Kings/tachiyomiJ2K/issues" } } diff --git a/app/src/main/res/drawable/ic_bug_report_white_24dp.xml b/app/src/main/res/drawable/ic_bug_report_white_24dp.xml new file mode 100644 index 0000000000..a93aba5f4e --- /dev/null +++ b/app/src/main/res/drawable/ic_bug_report_white_24dp.xml @@ -0,0 +1,6 @@ + + + diff --git a/app/src/main/res/menu/settings_main.xml b/app/src/main/res/menu/settings_main.xml index 10bcb4d6f3..271a65233a 100644 --- a/app/src/main/res/menu/settings_main.xml +++ b/app/src/main/res/menu/settings_main.xml @@ -1,6 +1,13 @@ + + + Track Sort category by… Switch + Report a Bug Loading…