Restore setting controller fade
Removes help button in each section, which is jumpy. Fade is nicer though.
This commit is contained in:
parent
c9cb75aee1
commit
0473c36c6f
@ -1,30 +0,0 @@
|
||||
package eu.kanade.tachiyomi.ui.setting
|
||||
|
||||
import android.view.Menu
|
||||
import android.view.MenuInflater
|
||||
import android.view.MenuItem
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.util.system.openInBrowser
|
||||
|
||||
abstract class BaseSettingsController : SettingsController() {
|
||||
|
||||
init {
|
||||
setHasOptionsMenu(true)
|
||||
}
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
|
||||
inflater.inflate(R.menu.settings, menu)
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
when (item.itemId) {
|
||||
R.id.action_help -> activity?.openInBrowser(URL_HELP)
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val URL_HELP = "https://tachiyomi.org/help/"
|
||||
}
|
||||
}
|
@ -31,7 +31,7 @@ import java.util.Locale
|
||||
import java.util.TimeZone
|
||||
import eu.kanade.tachiyomi.data.preference.PreferenceKeys as Keys
|
||||
|
||||
class SettingsAboutController : BaseSettingsController() {
|
||||
class SettingsAboutController : SettingsController() {
|
||||
|
||||
/**
|
||||
* Checks for new releases
|
||||
|
@ -21,7 +21,7 @@ import rx.android.schedulers.AndroidSchedulers
|
||||
import rx.schedulers.Schedulers
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
|
||||
class SettingsAdvancedController : BaseSettingsController() {
|
||||
class SettingsAdvancedController : SettingsController() {
|
||||
|
||||
private val network: NetworkHelper by injectLazy()
|
||||
|
||||
|
@ -29,7 +29,7 @@ import java.io.File
|
||||
import java.util.concurrent.TimeUnit
|
||||
import eu.kanade.tachiyomi.data.preference.PreferenceKeys as Keys
|
||||
|
||||
class SettingsBackupController : BaseSettingsController() {
|
||||
class SettingsBackupController : SettingsController() {
|
||||
|
||||
/**
|
||||
* Flags containing information of what to backup.
|
||||
|
@ -23,7 +23,7 @@ import uy.kohesive.injekt.injectLazy
|
||||
import java.io.File
|
||||
import eu.kanade.tachiyomi.data.preference.PreferenceKeys as Keys
|
||||
|
||||
class SettingsDownloadController : BaseSettingsController() {
|
||||
class SettingsDownloadController : SettingsController() {
|
||||
|
||||
private val db: DatabaseHelper by injectLazy()
|
||||
|
||||
|
@ -5,7 +5,7 @@ import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.util.system.LocaleHelper
|
||||
import eu.kanade.tachiyomi.data.preference.PreferenceKeys as Keys
|
||||
|
||||
class SettingsGeneralController : BaseSettingsController() {
|
||||
class SettingsGeneralController : SettingsController() {
|
||||
|
||||
override fun setupPreferenceScreen(screen: PreferenceScreen) = with(screen) {
|
||||
titleRes = R.string.pref_category_general
|
||||
|
@ -22,7 +22,7 @@ import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
import eu.kanade.tachiyomi.data.preference.PreferenceKeys as Keys
|
||||
|
||||
class SettingsLibraryController : BaseSettingsController() {
|
||||
class SettingsLibraryController : SettingsController() {
|
||||
|
||||
private val db: DatabaseHelper = Injekt.get()
|
||||
|
||||
|
@ -1,11 +1,31 @@
|
||||
package eu.kanade.tachiyomi.ui.setting
|
||||
|
||||
import android.view.Menu
|
||||
import android.view.MenuInflater
|
||||
import android.view.MenuItem
|
||||
import androidx.preference.PreferenceScreen
|
||||
import com.bluelinelabs.conductor.RouterTransaction
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
|
||||
import eu.kanade.tachiyomi.util.system.getResourceColor
|
||||
import eu.kanade.tachiyomi.util.system.openInBrowser
|
||||
|
||||
class SettingsMainController : BaseSettingsController() {
|
||||
class SettingsMainController : SettingsController() {
|
||||
|
||||
init {
|
||||
setHasOptionsMenu(true)
|
||||
}
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
|
||||
inflater.inflate(R.menu.settings, menu)
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
when (item.itemId) {
|
||||
R.id.action_help -> activity?.openInBrowser(URL_HELP)
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item)
|
||||
}
|
||||
|
||||
override fun setupPreferenceScreen(screen: PreferenceScreen) = with(screen) {
|
||||
titleRes = R.string.label_settings
|
||||
@ -63,6 +83,10 @@ class SettingsMainController : BaseSettingsController() {
|
||||
}
|
||||
|
||||
private fun navigateTo(controller: SettingsController) {
|
||||
router.pushController(RouterTransaction.with(controller))
|
||||
router.pushController(controller.withFadeTransaction())
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val URL_HELP = "https://tachiyomi.org/help/"
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import androidx.preference.PreferenceScreen
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.preference.PreferenceKeys as Keys
|
||||
|
||||
class SettingsReaderController : BaseSettingsController() {
|
||||
class SettingsReaderController : SettingsController() {
|
||||
|
||||
override fun setupPreferenceScreen(screen: PreferenceScreen) = with(screen) {
|
||||
titleRes = R.string.pref_category_reader
|
||||
|
@ -17,7 +17,7 @@ import eu.kanade.tachiyomi.widget.preference.TrackLogoutDialog
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
import eu.kanade.tachiyomi.data.preference.PreferenceKeys as Keys
|
||||
|
||||
class SettingsTrackingController : BaseSettingsController(),
|
||||
class SettingsTrackingController : SettingsController(),
|
||||
TrackLoginDialog.Listener,
|
||||
TrackLogoutDialog.Listener {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user