Added button for bug reporting in debug build

This commit is contained in:
Jay 2020-02-23 16:01:30 -08:00
parent 420acc59e3
commit 9cea45af1d
4 changed files with 18 additions and 1 deletions

View File

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

View File

@ -0,0 +1,6 @@
<vector android:height="24dp"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"
android:tint="?attr/actionBarTintColor">
<path android:fillColor="#FF000000" android:pathData="M20,8h-2.81c-0.45,-0.78 -1.07,-1.45 -1.82,-1.96L17,4.41 15.59,3l-2.17,2.17C12.96,5.06 12.49,5 12,5c-0.49,0 -0.96,0.06 -1.41,0.17L8.41,3 7,4.41l1.62,1.63C7.88,6.55 7.26,7.22 6.81,8L4,8v2h2.09c-0.05,0.33 -0.09,0.66 -0.09,1v1L4,12v2h2v1c0,0.34 0.04,0.67 0.09,1L4,16v2h2.81c1.04,1.79 2.97,3 5.19,3s4.15,-1.21 5.19,-3L20,18v-2h-2.09c0.05,-0.33 0.09,-0.66 0.09,-1v-1h2v-2h-2v-1c0,-0.34 -0.04,-0.67 -0.09,-1L20,10L20,8zM14,16h-4v-2h4v2zM14,12h-4v-2h4v2z"/>
</vector>

View File

@ -1,6 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_bug_report"
android:title="@string/action_bug_report"
android:icon="@drawable/ic_bug_report_white_24dp"
app:showAsAction="always"/>
<item
android:id="@+id/action_help"
android:title="@string/label_help"

View File

@ -131,6 +131,7 @@
<string name="action_track">Track</string>
<string name="action_sort_by">Sort category by…</string>
<string name="action_switch">Switch</string>
<string name="action_bug_report">Report a Bug</string>
<!-- Operations -->
<string name="loading">Loading…</string>