diff --git a/app/shortcuts.xml b/app/shortcuts.xml
index 347128b03f..9ba1137fcf 100644
--- a/app/shortcuts.xml
+++ b/app/shortcuts.xml
@@ -38,8 +38,8 @@
android:icon="@drawable/sc_explore_48dp"
android:shortcutDisabledMessage="@string/app_not_available"
android:shortcutId="show_catalogues"
- android:shortcutLongLabel="@string/label_sources"
- android:shortcutShortLabel="@string/label_sources">
+ android:shortcutLongLabel="@string/browse"
+ android:shortcutShortLabel="@string/browse">
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/BrowseController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/BrowseController.kt
new file mode 100644
index 0000000000..b409c7f29c
--- /dev/null
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/BrowseController.kt
@@ -0,0 +1,145 @@
+package eu.kanade.tachiyomi.ui.browse
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import com.bluelinelabs.conductor.Controller
+import com.bluelinelabs.conductor.ControllerChangeHandler
+import com.bluelinelabs.conductor.ControllerChangeType
+import com.bluelinelabs.conductor.Router
+import com.bluelinelabs.conductor.RouterTransaction
+import com.bluelinelabs.conductor.support.RouterPagerAdapter
+import com.google.android.material.badge.BadgeDrawable
+import com.google.android.material.tabs.TabLayout
+import eu.kanade.tachiyomi.R
+import eu.kanade.tachiyomi.data.preference.PreferencesHelper
+import eu.kanade.tachiyomi.databinding.PagerControllerBinding
+import eu.kanade.tachiyomi.ui.base.controller.RootController
+import eu.kanade.tachiyomi.ui.base.controller.RxController
+import eu.kanade.tachiyomi.ui.base.controller.TabbedController
+import eu.kanade.tachiyomi.ui.browse.extension.ExtensionController
+import eu.kanade.tachiyomi.ui.browse.source.SourceController
+import kotlinx.android.synthetic.main.main_activity.tabs
+import uy.kohesive.injekt.injectLazy
+
+class BrowseController :
+ RxController,
+ RootController,
+ TabbedController {
+
+ constructor(toExtensions: Boolean = false) : super(
+ Bundle().apply {
+ putBoolean(TO_EXTENSIONS_EXTRA, toExtensions)
+ }
+ )
+
+ @Suppress("unused")
+ constructor(bundle: Bundle) : this(bundle.getBoolean(TO_EXTENSIONS_EXTRA))
+
+ private val preferences: PreferencesHelper by injectLazy()
+
+ private val toExtensions = args.getBoolean(TO_EXTENSIONS_EXTRA, false)
+
+ private var adapter: BrowseAdapter? = null
+
+ override fun getTitle(): String? {
+ return resources!!.getString(R.string.browse)
+ }
+
+ override fun inflateView(inflater: LayoutInflater, container: ViewGroup): View {
+ binding = PagerControllerBinding.inflate(inflater)
+ return binding.root
+ }
+
+ override fun onViewCreated(view: View) {
+ super.onViewCreated(view)
+
+ adapter = BrowseAdapter()
+ binding.pager.adapter = adapter
+
+ if (toExtensions) {
+ binding.pager.currentItem = EXTENSIONS_CONTROLLER
+ }
+ }
+
+ override fun onDestroyView(view: View) {
+ super.onDestroyView(view)
+ adapter = null
+ }
+
+ override fun onChangeStarted(handler: ControllerChangeHandler, type: ControllerChangeType) {
+ super.onChangeStarted(handler, type)
+ if (type.isEnter) {
+ activity?.tabs?.apply {
+ setupWithViewPager(binding.pager)
+
+ // Show badge on tab for extension updates
+ setExtensionUpdateBadge()
+ }
+ }
+ }
+
+ override fun configureTabs(tabs: TabLayout) {
+ with(tabs) {
+ tabGravity = TabLayout.GRAVITY_FILL
+ tabMode = TabLayout.MODE_FIXED
+ }
+ }
+
+ override fun cleanupTabs(tabs: TabLayout) {
+ // Remove extension update badge
+ tabs.getTabAt(EXTENSIONS_CONTROLLER)?.removeBadge()
+ }
+
+ fun pushController(transaction: RouterTransaction) {
+ router.pushController(transaction)
+ }
+
+ fun setExtensionUpdateBadge() {
+ activity?.tabs?.apply {
+ val updates = preferences.extensionUpdatesCount().get()
+ if (updates > 0) {
+ val badge: BadgeDrawable = getTabAt(1)!!.orCreateBadge
+ badge.isVisible = true
+ } else {
+ getTabAt(EXTENSIONS_CONTROLLER)!!.removeBadge()
+ }
+ }
+ }
+
+ private inner class BrowseAdapter : RouterPagerAdapter(this@BrowseController) {
+
+ private val tabTitles = listOf(
+ R.string.label_sources,
+ R.string.label_extensions
+ )
+ .map { resources!!.getString(it) }
+
+ override fun getCount(): Int {
+ return tabTitles.size
+ }
+
+ override fun configureRouter(router: Router, position: Int) {
+ if (!router.hasRootController()) {
+ val controller: Controller = when (position) {
+ SOURCES_CONTROLLER -> SourceController()
+ EXTENSIONS_CONTROLLER -> ExtensionController()
+ else -> error("Wrong position $position")
+ }
+ router.setRoot(RouterTransaction.with(controller))
+ }
+ }
+
+ override fun getPageTitle(position: Int): CharSequence {
+ return tabTitles[position]
+ }
+ }
+
+ companion object {
+ const val TO_EXTENSIONS_EXTRA = "to_extensions"
+
+ const val SOURCES_CONTROLLER = 0
+ const val EXTENSIONS_CONTROLLER = 1
+ }
+}
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionAdapter.kt
similarity index 94%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionAdapter.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionAdapter.kt
index 1ace42adc2..5a2b3c1d31 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionAdapter.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionAdapter.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.extension
+package eu.kanade.tachiyomi.ui.browse.extension
import eu.davidea.flexibleadapter.FlexibleAdapter
import eu.davidea.flexibleadapter.items.IFlexible
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionController.kt
similarity index 95%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionController.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionController.kt
index 71d56a04f5..860013a693 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionController.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionController.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.extension
+package eu.kanade.tachiyomi.ui.browse.extension
import android.view.LayoutInflater
import android.view.Menu
@@ -21,6 +21,7 @@ import eu.kanade.tachiyomi.extension.ExtensionUpdateJob
import eu.kanade.tachiyomi.extension.model.Extension
import eu.kanade.tachiyomi.ui.base.controller.NucleusController
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
+import eu.kanade.tachiyomi.ui.browse.BrowseController
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
@@ -93,7 +94,7 @@ open class ExtensionController :
when (item.itemId) {
R.id.action_search -> expandActionViewFromInteraction = true
R.id.action_settings -> {
- router.pushController(
+ (parentController as BrowseController).pushController(
(RouterTransaction.with(ExtensionFilterController()))
.popChangeHandler(SettingsExtensionsFadeChangeHandler())
.pushChangeHandler(FadeChangeHandler())
@@ -182,7 +183,7 @@ open class ExtensionController :
private fun openDetails(extension: Extension.Installed) {
val controller = ExtensionDetailsController(extension.pkgName)
- router.pushController(controller.withFadeTransaction())
+ (parentController as BrowseController).pushController(controller.withFadeTransaction())
}
private fun openTrustDialog(extension: Extension.Untrusted) {
@@ -194,6 +195,9 @@ open class ExtensionController :
binding.extSwipeRefresh.isRefreshing = false
this.extensions = extensions
drawExtensions()
+
+ // Update badge on parent controller tab
+ (parentController as BrowseController).setExtensionUpdateBadge()
}
fun drawExtensions() {
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionDetailsController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionDetailsController.kt
similarity index 99%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionDetailsController.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionDetailsController.kt
index a84e6d744e..69fd1b51aa 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionDetailsController.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionDetailsController.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.extension
+package eu.kanade.tachiyomi.ui.browse.extension
import android.annotation.SuppressLint
import android.content.Context
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionDetailsPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionDetailsPresenter.kt
similarity index 96%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionDetailsPresenter.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionDetailsPresenter.kt
index 51e58c34b7..a9760b7588 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionDetailsPresenter.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionDetailsPresenter.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.extension
+package eu.kanade.tachiyomi.ui.browse.extension
import android.os.Bundle
import eu.kanade.tachiyomi.extension.ExtensionManager
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionDividerItemDecoration.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionDividerItemDecoration.kt
similarity index 97%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionDividerItemDecoration.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionDividerItemDecoration.kt
index 6bef0da268..839d199562 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionDividerItemDecoration.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionDividerItemDecoration.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.extension
+package eu.kanade.tachiyomi.ui.browse.extension
import android.content.Context
import android.graphics.Canvas
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionFilterController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionFilterController.kt
similarity index 97%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionFilterController.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionFilterController.kt
index 6a4c8f904d..5675b6d40b 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionFilterController.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionFilterController.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.extension
+package eu.kanade.tachiyomi.ui.browse.extension
import androidx.preference.PreferenceScreen
import eu.kanade.tachiyomi.R
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionGroupHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionGroupHolder.kt
similarity index 92%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionGroupHolder.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionGroupHolder.kt
index cd98f0941e..fdea101574 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionGroupHolder.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionGroupHolder.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.extension
+package eu.kanade.tachiyomi.ui.browse.extension
import android.annotation.SuppressLint
import android.view.View
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionGroupItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionGroupItem.kt
similarity index 96%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionGroupItem.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionGroupItem.kt
index 3da04552e5..8c65ea2259 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionGroupItem.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionGroupItem.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.extension
+package eu.kanade.tachiyomi.ui.browse.extension
import android.view.View
import androidx.recyclerview.widget.RecyclerView
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionHolder.kt
similarity index 98%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionHolder.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionHolder.kt
index 10b16b42c9..456806b381 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionHolder.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionHolder.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.extension
+package eu.kanade.tachiyomi.ui.browse.extension
import android.view.View
import eu.kanade.tachiyomi.R
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionItem.kt
similarity index 97%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionItem.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionItem.kt
index 017918b9a8..ddea87cc72 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionItem.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionItem.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.extension
+package eu.kanade.tachiyomi.ui.browse.extension
import android.view.View
import androidx.recyclerview.widget.RecyclerView
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionPresenter.kt
similarity index 99%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionPresenter.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionPresenter.kt
index ae77e52a74..cf1be5fe41 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionPresenter.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionPresenter.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.extension
+package eu.kanade.tachiyomi.ui.browse.extension
import android.app.Application
import android.os.Bundle
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionTrustDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionTrustDialog.kt
similarity index 96%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionTrustDialog.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionTrustDialog.kt
index 458a60f4b1..3a91724aaa 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionTrustDialog.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionTrustDialog.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.extension
+package eu.kanade.tachiyomi.ui.browse.extension
import android.app.Dialog
import android.os.Bundle
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionViewUtils.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionViewUtils.kt
similarity index 88%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionViewUtils.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionViewUtils.kt
index b3a30e4d93..a4bae24846 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionViewUtils.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionViewUtils.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.extension
+package eu.kanade.tachiyomi.ui.browse.extension
import android.content.Context
import android.content.pm.PackageManager
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/LangHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/LangHolder.kt
similarity index 91%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/LangHolder.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/LangHolder.kt
index f22bf6b02d..c0da896c3c 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/LangHolder.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/LangHolder.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source
+package eu.kanade.tachiyomi.ui.browse.source
import android.view.View
import eu.davidea.flexibleadapter.FlexibleAdapter
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/LangItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/LangItem.kt
similarity index 96%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/LangItem.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/LangItem.kt
index a1513fa48f..fe0e6b389d 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/LangItem.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/LangItem.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source
+package eu.kanade.tachiyomi.ui.browse.source
import android.view.View
import androidx.recyclerview.widget.RecyclerView
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceAdapter.kt
similarity index 96%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceAdapter.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceAdapter.kt
index 206d26a915..8f9557d70d 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceAdapter.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceAdapter.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source
+package eu.kanade.tachiyomi.ui.browse.source
import eu.davidea.flexibleadapter.FlexibleAdapter
import eu.davidea.flexibleadapter.items.IFlexible
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceController.kt
similarity index 93%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceController.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceController.kt
index 3d5fe1daca..c9603514da 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceController.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceController.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source
+package eu.kanade.tachiyomi.ui.browse.source
import android.Manifest.permission.WRITE_EXTERNAL_STORAGE
import android.view.LayoutInflater
@@ -23,13 +23,13 @@ import eu.kanade.tachiyomi.databinding.SourceMainControllerBinding
import eu.kanade.tachiyomi.source.CatalogueSource
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.ui.base.controller.NucleusController
-import eu.kanade.tachiyomi.ui.base.controller.RootController
import eu.kanade.tachiyomi.ui.base.controller.requestPermissionsSafe
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
+import eu.kanade.tachiyomi.ui.browse.BrowseController
+import eu.kanade.tachiyomi.ui.browse.source.browse.BrowseSourceController
+import eu.kanade.tachiyomi.ui.browse.source.globalsearch.GlobalSearchController
+import eu.kanade.tachiyomi.ui.browse.source.latest.LatestUpdatesController
import eu.kanade.tachiyomi.ui.setting.SettingsSourcesController
-import eu.kanade.tachiyomi.ui.source.browse.BrowseSourceController
-import eu.kanade.tachiyomi.ui.source.globalsearch.GlobalSearchController
-import eu.kanade.tachiyomi.ui.source.latest.LatestUpdatesController
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
@@ -46,7 +46,6 @@ import uy.kohesive.injekt.api.get
*/
class SourceController :
NucleusController(),
- RootController,
FlexibleAdapter.OnItemClickListener,
FlexibleAdapter.OnItemLongClickListener,
SourceAdapter.OnBrowseClickListener,
@@ -178,7 +177,7 @@ class SourceController :
*/
private fun openCatalogue(source: CatalogueSource, controller: BrowseSourceController) {
preferences.lastUsedCatalogueSource().set(source.id)
- router.pushController(controller.withFadeTransaction())
+ (parentController as BrowseController).pushController(controller.withFadeTransaction())
}
/**
@@ -206,7 +205,7 @@ class SourceController :
}
fun performGlobalSearch(query: String) {
- router.pushController(GlobalSearchController(query).withFadeTransaction())
+ (parentController as BrowseController).pushController(GlobalSearchController(query).withFadeTransaction())
}
/**
@@ -219,7 +218,7 @@ class SourceController :
when (item.itemId) {
// Initialize option to open catalogue settings.
R.id.action_settings -> {
- router.pushController(
+ (parentController as BrowseController).pushController(
(RouterTransaction.with(SettingsSourcesController()))
.popChangeHandler(SettingsSourcesFadeChangeHandler())
.pushChangeHandler(FadeChangeHandler())
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceDividerItemDecoration.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceDividerItemDecoration.kt
similarity index 97%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceDividerItemDecoration.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceDividerItemDecoration.kt
index b5df257e92..a64de84011 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceDividerItemDecoration.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceDividerItemDecoration.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source
+package eu.kanade.tachiyomi.ui.browse.source
import android.content.Context
import android.graphics.Canvas
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceHolder.kt
similarity index 97%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceHolder.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceHolder.kt
index 683f7ad348..d9c1df465b 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceHolder.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceHolder.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source
+package eu.kanade.tachiyomi.ui.browse.source
import android.view.View
import eu.kanade.tachiyomi.R
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceItem.kt
similarity index 96%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceItem.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceItem.kt
index 19a466e38e..56008a5a92 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceItem.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceItem.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source
+package eu.kanade.tachiyomi.ui.browse.source
import android.view.View
import androidx.recyclerview.widget.RecyclerView
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourcePresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourcePresenter.kt
similarity index 98%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/SourcePresenter.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourcePresenter.kt
index 3c9225f67e..65aab36dd2 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourcePresenter.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourcePresenter.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source
+package eu.kanade.tachiyomi.ui.browse.source
import android.os.Bundle
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceController.kt
similarity index 99%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceController.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceController.kt
index 70723fab90..b6633ba5d8 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceController.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceController.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source.browse
+package eu.kanade.tachiyomi.ui.browse.source.browse
import android.content.res.Configuration
import android.os.Bundle
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourcePresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourcePresenter.kt
similarity index 93%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourcePresenter.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourcePresenter.kt
index f342f2e651..318a44ec4d 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourcePresenter.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourcePresenter.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source.browse
+package eu.kanade.tachiyomi.ui.browse.source.browse
import android.os.Bundle
import eu.davidea.flexibleadapter.items.IFlexible
@@ -15,19 +15,19 @@ import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.ui.base.presenter.BasePresenter
-import eu.kanade.tachiyomi.ui.source.filter.CheckboxItem
-import eu.kanade.tachiyomi.ui.source.filter.CheckboxSectionItem
-import eu.kanade.tachiyomi.ui.source.filter.GroupItem
-import eu.kanade.tachiyomi.ui.source.filter.HeaderItem
-import eu.kanade.tachiyomi.ui.source.filter.SelectItem
-import eu.kanade.tachiyomi.ui.source.filter.SelectSectionItem
-import eu.kanade.tachiyomi.ui.source.filter.SeparatorItem
-import eu.kanade.tachiyomi.ui.source.filter.SortGroup
-import eu.kanade.tachiyomi.ui.source.filter.SortItem
-import eu.kanade.tachiyomi.ui.source.filter.TextItem
-import eu.kanade.tachiyomi.ui.source.filter.TextSectionItem
-import eu.kanade.tachiyomi.ui.source.filter.TriStateItem
-import eu.kanade.tachiyomi.ui.source.filter.TriStateSectionItem
+import eu.kanade.tachiyomi.ui.browse.source.filter.CheckboxItem
+import eu.kanade.tachiyomi.ui.browse.source.filter.CheckboxSectionItem
+import eu.kanade.tachiyomi.ui.browse.source.filter.GroupItem
+import eu.kanade.tachiyomi.ui.browse.source.filter.HeaderItem
+import eu.kanade.tachiyomi.ui.browse.source.filter.SelectItem
+import eu.kanade.tachiyomi.ui.browse.source.filter.SelectSectionItem
+import eu.kanade.tachiyomi.ui.browse.source.filter.SeparatorItem
+import eu.kanade.tachiyomi.ui.browse.source.filter.SortGroup
+import eu.kanade.tachiyomi.ui.browse.source.filter.SortItem
+import eu.kanade.tachiyomi.ui.browse.source.filter.TextItem
+import eu.kanade.tachiyomi.ui.browse.source.filter.TextSectionItem
+import eu.kanade.tachiyomi.ui.browse.source.filter.TriStateItem
+import eu.kanade.tachiyomi.ui.browse.source.filter.TriStateSectionItem
import rx.Observable
import rx.Subscription
import rx.android.schedulers.AndroidSchedulers
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/NoResultsException.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/NoResultsException.kt
new file mode 100644
index 0000000000..cf52294e7b
--- /dev/null
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/NoResultsException.kt
@@ -0,0 +1,3 @@
+package eu.kanade.tachiyomi.ui.browse.source.browse
+
+class NoResultsException : Exception()
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/Pager.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/Pager.kt
similarity index 94%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/Pager.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/Pager.kt
index 378839f7af..77284e5a85 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/Pager.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/Pager.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source.browse
+package eu.kanade.tachiyomi.ui.browse.source.browse
import com.jakewharton.rxrelay.PublishRelay
import eu.kanade.tachiyomi.source.model.MangasPage
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/ProgressItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/ProgressItem.kt
similarity index 97%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/ProgressItem.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/ProgressItem.kt
index 3d73b808a0..0edf8fefd0 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/ProgressItem.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/ProgressItem.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source.browse
+package eu.kanade.tachiyomi.ui.browse.source.browse
import android.view.View
import android.widget.ProgressBar
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourceFilterSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceFilterSheet.kt
similarity index 97%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourceFilterSheet.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceFilterSheet.kt
index de43b828a8..0c462e2841 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourceFilterSheet.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceFilterSheet.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source.browse
+package eu.kanade.tachiyomi.ui.browse.source.browse
import android.app.Activity
import android.content.Context
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourceGridHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceGridHolder.kt
similarity index 97%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourceGridHolder.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceGridHolder.kt
index edbbe91a7d..c26174c34d 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourceGridHolder.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceGridHolder.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source.browse
+package eu.kanade.tachiyomi.ui.browse.source.browse
import android.view.View
import com.bumptech.glide.load.engine.DiskCacheStrategy
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourceHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceHolder.kt
similarity index 94%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourceHolder.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceHolder.kt
index c80ea9094b..90743afda4 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourceHolder.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceHolder.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source.browse
+package eu.kanade.tachiyomi.ui.browse.source.browse
import android.view.View
import eu.davidea.flexibleadapter.FlexibleAdapter
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourceItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceItem.kt
similarity index 97%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourceItem.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceItem.kt
index 24fec5205c..e3f89c8961 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourceItem.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceItem.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source.browse
+package eu.kanade.tachiyomi.ui.browse.source.browse
import android.view.Gravity
import android.view.View
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourceListHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceListHolder.kt
similarity index 97%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourceListHolder.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceListHolder.kt
index 23ff9c6642..acf36de164 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourceListHolder.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourceListHolder.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source.browse
+package eu.kanade.tachiyomi.ui.browse.source.browse
import android.view.View
import com.bumptech.glide.load.engine.DiskCacheStrategy
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourcePager.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourcePager.kt
similarity index 95%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourcePager.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourcePager.kt
index 7720dc8f54..d771098c21 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourcePager.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/SourcePager.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source.browse
+package eu.kanade.tachiyomi.ui.browse.source.browse
import eu.kanade.tachiyomi.source.CatalogueSource
import eu.kanade.tachiyomi.source.model.FilterList
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/CheckboxItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/CheckboxItem.kt
similarity index 96%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/CheckboxItem.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/CheckboxItem.kt
index 7e63267cb6..beb52ec52c 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/CheckboxItem.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/CheckboxItem.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source.filter
+package eu.kanade.tachiyomi.ui.browse.source.filter
import android.view.View
import android.widget.CheckBox
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/GroupItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/GroupItem.kt
similarity index 97%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/GroupItem.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/GroupItem.kt
index 574f7e9bb0..4da238864c 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/GroupItem.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/GroupItem.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source.filter
+package eu.kanade.tachiyomi.ui.browse.source.filter
import android.view.View
import android.widget.ImageView
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/HeaderItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/HeaderItem.kt
similarity index 96%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/HeaderItem.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/HeaderItem.kt
index e04cd55c40..7c0692036d 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/HeaderItem.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/HeaderItem.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source.filter
+package eu.kanade.tachiyomi.ui.browse.source.filter
import android.annotation.SuppressLint
import android.view.View
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/SectionItems.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/SectionItems.kt
similarity index 97%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/SectionItems.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/SectionItems.kt
index 5ce745e037..12e1eb4aff 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/SectionItems.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/SectionItems.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source.filter
+package eu.kanade.tachiyomi.ui.browse.source.filter
import eu.davidea.flexibleadapter.items.ISectionable
import eu.kanade.tachiyomi.source.model.Filter
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/SelectItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/SelectItem.kt
similarity index 97%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/SelectItem.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/SelectItem.kt
index 2c872e6c0c..25cf8b57f6 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/SelectItem.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/SelectItem.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source.filter
+package eu.kanade.tachiyomi.ui.browse.source.filter
import android.view.View
import android.widget.ArrayAdapter
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/SeparatorItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/SeparatorItem.kt
similarity index 96%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/SeparatorItem.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/SeparatorItem.kt
index 8b07d08380..af21aeabb1 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/SeparatorItem.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/SeparatorItem.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source.filter
+package eu.kanade.tachiyomi.ui.browse.source.filter
import android.annotation.SuppressLint
import android.view.View
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/SortGroup.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/SortGroup.kt
similarity index 97%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/SortGroup.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/SortGroup.kt
index e0023268ea..48dc25fea8 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/SortGroup.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/SortGroup.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source.filter
+package eu.kanade.tachiyomi.ui.browse.source.filter
import android.view.View
import androidx.recyclerview.widget.RecyclerView
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/SortItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/SortItem.kt
similarity index 98%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/SortItem.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/SortItem.kt
index 0341669b47..8f8e09dac5 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/SortItem.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/SortItem.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source.filter
+package eu.kanade.tachiyomi.ui.browse.source.filter
import android.view.View
import android.widget.CheckedTextView
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/TextItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/TextItem.kt
similarity index 97%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/TextItem.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/TextItem.kt
index 86a0c60b10..d3d4eb3f7f 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/TextItem.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/TextItem.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source.filter
+package eu.kanade.tachiyomi.ui.browse.source.filter
import android.view.View
import android.widget.EditText
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/TriStateItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/TriStateItem.kt
similarity index 98%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/TriStateItem.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/TriStateItem.kt
index 529fa935e2..bd8c53f112 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/TriStateItem.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/TriStateItem.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source.filter
+package eu.kanade.tachiyomi.ui.browse.source.filter
import android.view.View
import android.widget.CheckedTextView
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/globalsearch/GlobalSearchAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchAdapter.kt
similarity index 97%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/globalsearch/GlobalSearchAdapter.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchAdapter.kt
index e9f520291d..6d29abcfb6 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/globalsearch/GlobalSearchAdapter.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchAdapter.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source.globalsearch
+package eu.kanade.tachiyomi.ui.browse.source.globalsearch
import android.os.Bundle
import android.os.Parcelable
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/globalsearch/GlobalSearchCardAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchCardAdapter.kt
similarity index 92%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/globalsearch/GlobalSearchCardAdapter.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchCardAdapter.kt
index f0ca3e11b2..d9a8f430c3 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/globalsearch/GlobalSearchCardAdapter.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchCardAdapter.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source.globalsearch
+package eu.kanade.tachiyomi.ui.browse.source.globalsearch
import eu.davidea.flexibleadapter.FlexibleAdapter
import eu.kanade.tachiyomi.data.database.models.Manga
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/globalsearch/GlobalSearchCardHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchCardHolder.kt
similarity index 97%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/globalsearch/GlobalSearchCardHolder.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchCardHolder.kt
index 8fd987cbf8..6b740cee41 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/globalsearch/GlobalSearchCardHolder.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchCardHolder.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source.globalsearch
+package eu.kanade.tachiyomi.ui.browse.source.globalsearch
import android.view.View
import com.bumptech.glide.load.engine.DiskCacheStrategy
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/globalsearch/GlobalSearchCardItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchCardItem.kt
similarity index 95%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/globalsearch/GlobalSearchCardItem.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchCardItem.kt
index 4fd8fe358b..9c3637a6d2 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/globalsearch/GlobalSearchCardItem.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchCardItem.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source.globalsearch
+package eu.kanade.tachiyomi.ui.browse.source.globalsearch
import android.view.View
import androidx.recyclerview.widget.RecyclerView
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/globalsearch/GlobalSearchController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchController.kt
similarity index 99%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/globalsearch/GlobalSearchController.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchController.kt
index e70b247c4d..8e4b27d316 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/globalsearch/GlobalSearchController.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchController.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source.globalsearch
+package eu.kanade.tachiyomi.ui.browse.source.globalsearch
import android.os.Bundle
import android.view.LayoutInflater
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/globalsearch/GlobalSearchHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchHolder.kt
similarity index 98%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/globalsearch/GlobalSearchHolder.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchHolder.kt
index 91db3e83a4..f1cb5a74cd 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/globalsearch/GlobalSearchHolder.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchHolder.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source.globalsearch
+package eu.kanade.tachiyomi.ui.browse.source.globalsearch
import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/globalsearch/GlobalSearchItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchItem.kt
similarity index 97%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/globalsearch/GlobalSearchItem.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchItem.kt
index 34dd955030..fbfb28bc2b 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/globalsearch/GlobalSearchItem.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchItem.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source.globalsearch
+package eu.kanade.tachiyomi.ui.browse.source.globalsearch
import android.view.View
import androidx.recyclerview.widget.RecyclerView
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/globalsearch/GlobalSearchPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchPresenter.kt
similarity index 98%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/globalsearch/GlobalSearchPresenter.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchPresenter.kt
index a71370f252..3be5ee5db4 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/globalsearch/GlobalSearchPresenter.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchPresenter.kt
@@ -1,4 +1,4 @@
-package eu.kanade.tachiyomi.ui.source.globalsearch
+package eu.kanade.tachiyomi.ui.browse.source.globalsearch
import android.os.Bundle
import eu.kanade.tachiyomi.data.database.DatabaseHelper
@@ -12,7 +12,7 @@ import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.ui.base.presenter.BasePresenter
-import eu.kanade.tachiyomi.ui.source.browse.BrowseSourcePresenter
+import eu.kanade.tachiyomi.ui.browse.source.browse.BrowseSourcePresenter
import rx.Observable
import rx.Subscription
import rx.android.schedulers.AndroidSchedulers
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/latest/LatestUpdatesController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/latest/LatestUpdatesController.kt
similarity index 80%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/latest/LatestUpdatesController.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/latest/LatestUpdatesController.kt
index 19df0b0146..ba2e504a9a 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/latest/LatestUpdatesController.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/latest/LatestUpdatesController.kt
@@ -1,11 +1,11 @@
-package eu.kanade.tachiyomi.ui.source.latest
+package eu.kanade.tachiyomi.ui.browse.source.latest
import android.os.Bundle
import android.view.Menu
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.source.CatalogueSource
-import eu.kanade.tachiyomi.ui.source.browse.BrowseSourceController
-import eu.kanade.tachiyomi.ui.source.browse.BrowseSourcePresenter
+import eu.kanade.tachiyomi.ui.browse.source.browse.BrowseSourceController
+import eu.kanade.tachiyomi.ui.browse.source.browse.BrowseSourcePresenter
/**
* Controller that shows the latest manga from the catalogue. Inherit [BrowseSourceController].
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/latest/LatestUpdatesPager.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/latest/LatestUpdatesPager.kt
similarity index 84%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/latest/LatestUpdatesPager.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/latest/LatestUpdatesPager.kt
index ca55cdcf97..97eccfc149 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/latest/LatestUpdatesPager.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/latest/LatestUpdatesPager.kt
@@ -1,8 +1,8 @@
-package eu.kanade.tachiyomi.ui.source.latest
+package eu.kanade.tachiyomi.ui.browse.source.latest
import eu.kanade.tachiyomi.source.CatalogueSource
import eu.kanade.tachiyomi.source.model.MangasPage
-import eu.kanade.tachiyomi.ui.source.browse.Pager
+import eu.kanade.tachiyomi.ui.browse.source.browse.Pager
import rx.Observable
import rx.android.schedulers.AndroidSchedulers
import rx.schedulers.Schedulers
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/latest/LatestUpdatesPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/latest/LatestUpdatesPresenter.kt
similarity index 65%
rename from app/src/main/java/eu/kanade/tachiyomi/ui/source/latest/LatestUpdatesPresenter.kt
rename to app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/latest/LatestUpdatesPresenter.kt
index fbbfa0185e..964c0b3c6d 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/latest/LatestUpdatesPresenter.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/latest/LatestUpdatesPresenter.kt
@@ -1,8 +1,8 @@
-package eu.kanade.tachiyomi.ui.source.latest
+package eu.kanade.tachiyomi.ui.browse.source.latest
import eu.kanade.tachiyomi.source.model.FilterList
-import eu.kanade.tachiyomi.ui.source.browse.BrowseSourcePresenter
-import eu.kanade.tachiyomi.ui.source.browse.Pager
+import eu.kanade.tachiyomi.ui.browse.source.browse.BrowseSourcePresenter
+import eu.kanade.tachiyomi.ui.browse.source.browse.Pager
/**
* Presenter of [LatestUpdatesController]. Inherit BrowseCataloguePresenter.
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt
index 9bb9112011..61e90461b6 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt
@@ -21,15 +21,14 @@ import eu.kanade.tachiyomi.ui.base.controller.NoToolbarElevationController
import eu.kanade.tachiyomi.ui.base.controller.RootController
import eu.kanade.tachiyomi.ui.base.controller.TabbedController
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
+import eu.kanade.tachiyomi.ui.browse.BrowseController
+import eu.kanade.tachiyomi.ui.browse.source.globalsearch.GlobalSearchController
import eu.kanade.tachiyomi.ui.download.DownloadController
-import eu.kanade.tachiyomi.ui.extension.ExtensionController
import eu.kanade.tachiyomi.ui.library.LibraryController
import eu.kanade.tachiyomi.ui.manga.MangaController
import eu.kanade.tachiyomi.ui.more.MoreController
import eu.kanade.tachiyomi.ui.recent.history.HistoryController
import eu.kanade.tachiyomi.ui.recent.updates.UpdatesController
-import eu.kanade.tachiyomi.ui.source.SourceController
-import eu.kanade.tachiyomi.ui.source.globalsearch.GlobalSearchController
import eu.kanade.tachiyomi.util.lang.launchUI
import eu.kanade.tachiyomi.util.system.WebViewUtil
import eu.kanade.tachiyomi.util.system.toast
@@ -95,7 +94,7 @@ class MainActivity : BaseActivity() {
R.id.nav_library -> setRoot(LibraryController(), id)
R.id.nav_updates -> setRoot(UpdatesController(), id)
R.id.nav_history -> setRoot(HistoryController(), id)
- R.id.nav_sources -> setRoot(SourceController(), id)
+ R.id.nav_browse -> setRoot(BrowseController(), id)
R.id.nav_more -> setRoot(MoreController(), id)
}
} else if (!isHandlingShortcut) {
@@ -173,9 +172,9 @@ class MainActivity : BaseActivity() {
private fun setExtensionsBadge() {
val updates = preferences.extensionUpdatesCount().get()
if (updates > 0) {
- binding.bottomNav.getOrCreateBadge(R.id.nav_more).number = updates
+ binding.bottomNav.getOrCreateBadge(R.id.nav_browse).number = updates
} else {
- binding.bottomNav.removeBadge(R.id.nav_more)
+ binding.bottomNav.removeBadge(R.id.nav_browse)
}
}
@@ -208,13 +207,13 @@ class MainActivity : BaseActivity() {
SHORTCUT_LIBRARY -> setSelectedNavItem(R.id.nav_library)
SHORTCUT_RECENTLY_UPDATED -> setSelectedNavItem(R.id.nav_updates)
SHORTCUT_RECENTLY_READ -> setSelectedNavItem(R.id.nav_history)
- SHORTCUT_CATALOGUES -> setSelectedNavItem(R.id.nav_sources)
+ SHORTCUT_CATALOGUES -> setSelectedNavItem(R.id.nav_browse)
SHORTCUT_EXTENSIONS -> {
if (router.backstackSize > 1) {
router.popToRoot()
}
- setSelectedNavItem(R.id.nav_more)
- router.pushController(ExtensionController().withFadeTransaction())
+ router.pushController(BrowseController(true).withFadeTransaction())
+ setSelectedNavItem(R.id.nav_browse)
}
SHORTCUT_MANGA -> {
val extras = intent.extras ?: return false
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt
index f49fe7ba13..eac86a4201 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt
@@ -18,7 +18,7 @@ import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.database.DatabaseHelper
import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.data.track.TrackManager
-import eu.kanade.tachiyomi.databinding.MangaControllerBinding
+import eu.kanade.tachiyomi.databinding.PagerControllerBinding
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceManager
import eu.kanade.tachiyomi.ui.base.controller.RxController
@@ -33,7 +33,7 @@ import rx.Subscription
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
-class MangaController : RxController, TabbedController {
+class MangaController : RxController, TabbedController {
constructor(manga: Manga?, fromSource: Boolean = false) : super(
Bundle().apply {
@@ -75,7 +75,7 @@ class MangaController : RxController, TabbedController {
}
override fun inflateView(inflater: LayoutInflater, container: ViewGroup): View {
- binding = MangaControllerBinding.inflate(inflater)
+ binding = PagerControllerBinding.inflate(inflater)
return binding.root
}
@@ -87,11 +87,11 @@ class MangaController : RxController, TabbedController {
requestPermissionsSafe(arrayOf(WRITE_EXTERNAL_STORAGE), 301)
adapter = MangaDetailAdapter()
- binding.mangaPager.offscreenPageLimit = 3
- binding.mangaPager.adapter = adapter
+ binding.pager.offscreenPageLimit = 3
+ binding.pager.adapter = adapter
if (!fromSource) {
- binding.mangaPager.currentItem = CHAPTERS_CONTROLLER
+ binding.pager.currentItem = CHAPTERS_CONTROLLER
}
}
@@ -103,7 +103,7 @@ class MangaController : RxController, TabbedController {
override fun onChangeStarted(handler: ControllerChangeHandler, type: ControllerChangeType) {
super.onChangeStarted(handler, type)
if (type.isEnter) {
- activity?.tabs?.setupWithViewPager(binding.mangaPager)
+ activity?.tabs?.setupWithViewPager(binding.pager)
trackingIconSubscription = trackingIconRelay.subscribe { setTrackingIconInternal(it) }
}
}
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt
index fe8af18a80..1f3c760105 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt
@@ -21,14 +21,14 @@ import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.HttpSource
import eu.kanade.tachiyomi.ui.base.controller.NucleusController
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
+import eu.kanade.tachiyomi.ui.browse.source.browse.BrowseSourceController
+import eu.kanade.tachiyomi.ui.browse.source.globalsearch.GlobalSearchController
import eu.kanade.tachiyomi.ui.library.ChangeMangaCategoriesDialog
import eu.kanade.tachiyomi.ui.library.LibraryController
import eu.kanade.tachiyomi.ui.main.MainActivity
import eu.kanade.tachiyomi.ui.manga.MangaController
import eu.kanade.tachiyomi.ui.recent.history.HistoryController
import eu.kanade.tachiyomi.ui.recent.updates.UpdatesController
-import eu.kanade.tachiyomi.ui.source.browse.BrowseSourceController
-import eu.kanade.tachiyomi.ui.source.globalsearch.GlobalSearchController
import eu.kanade.tachiyomi.ui.webview.WebViewActivity
import eu.kanade.tachiyomi.util.system.copyToClipboard
import eu.kanade.tachiyomi.util.system.toast
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SearchController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SearchController.kt
index 6a9fdda735..43e22220bd 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SearchController.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SearchController.kt
@@ -8,8 +8,8 @@ import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
import eu.kanade.tachiyomi.ui.base.controller.DialogController
-import eu.kanade.tachiyomi.ui.source.globalsearch.GlobalSearchController
-import eu.kanade.tachiyomi.ui.source.globalsearch.GlobalSearchPresenter
+import eu.kanade.tachiyomi.ui.browse.source.globalsearch.GlobalSearchController
+import eu.kanade.tachiyomi.ui.browse.source.globalsearch.GlobalSearchPresenter
import eu.kanade.tachiyomi.util.view.gone
import eu.kanade.tachiyomi.util.view.visible
import uy.kohesive.injekt.injectLazy
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SearchPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SearchPresenter.kt
index d5307480dd..b701e97e58 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SearchPresenter.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SearchPresenter.kt
@@ -8,9 +8,9 @@ import eu.kanade.tachiyomi.source.CatalogueSource
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
-import eu.kanade.tachiyomi.ui.source.globalsearch.GlobalSearchCardItem
-import eu.kanade.tachiyomi.ui.source.globalsearch.GlobalSearchItem
-import eu.kanade.tachiyomi.ui.source.globalsearch.GlobalSearchPresenter
+import eu.kanade.tachiyomi.ui.browse.source.globalsearch.GlobalSearchCardItem
+import eu.kanade.tachiyomi.ui.browse.source.globalsearch.GlobalSearchItem
+import eu.kanade.tachiyomi.ui.browse.source.globalsearch.GlobalSearchPresenter
import eu.kanade.tachiyomi.util.chapter.syncChaptersWithSource
import rx.Observable
import rx.android.schedulers.AndroidSchedulers
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreController.kt
index d475809fcb..7be87b07c1 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreController.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreController.kt
@@ -3,15 +3,12 @@ package eu.kanade.tachiyomi.ui.more
import androidx.preference.PreferenceScreen
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.preference.PreferenceKeys as Keys
-import eu.kanade.tachiyomi.data.preference.PreferencesHelper
import eu.kanade.tachiyomi.ui.base.controller.RootController
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
import eu.kanade.tachiyomi.ui.download.DownloadController
-import eu.kanade.tachiyomi.ui.extension.ExtensionController
import eu.kanade.tachiyomi.ui.migration.MigrationController
import eu.kanade.tachiyomi.ui.setting.SettingsController
import eu.kanade.tachiyomi.ui.setting.SettingsMainController
-import eu.kanade.tachiyomi.util.preference.badgePreference
import eu.kanade.tachiyomi.util.preference.iconRes
import eu.kanade.tachiyomi.util.preference.iconTint
import eu.kanade.tachiyomi.util.preference.onClick
@@ -21,7 +18,6 @@ import eu.kanade.tachiyomi.util.preference.switchPreference
import eu.kanade.tachiyomi.util.preference.titleRes
import eu.kanade.tachiyomi.util.system.getResourceColor
import eu.kanade.tachiyomi.util.system.openInBrowser
-import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
class MoreController : SettingsController(), RootController {
@@ -39,15 +35,6 @@ class MoreController : SettingsController(), RootController {
}
preferenceCategory {
- badgePreference {
- titleRes = R.string.label_extensions
- iconRes = R.drawable.ic_extension_24dp
- iconTint = tintColor
- setBadge(Injekt.get().extensionUpdatesCount().get())
- onClick {
- router.pushController(ExtensionController().withFadeTransaction())
- }
- }
preference {
titleRes = R.string.label_download_queue
iconRes = R.drawable.ic_file_download_black_24dp
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/NoResultsException.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/NoResultsException.kt
deleted file mode 100644
index 744718def9..0000000000
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/NoResultsException.kt
+++ /dev/null
@@ -1,3 +0,0 @@
-package eu.kanade.tachiyomi.ui.source.browse
-
-class NoResultsException : Exception()
diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/preference/PreferenceDSL.kt b/app/src/main/java/eu/kanade/tachiyomi/util/preference/PreferenceDSL.kt
index 4cb24e0648..03ead952b7 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/util/preference/PreferenceDSL.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/util/preference/PreferenceDSL.kt
@@ -13,7 +13,6 @@ import androidx.preference.PreferenceManager
import androidx.preference.PreferenceScreen
import androidx.preference.SwitchPreferenceCompat
import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat
-import eu.kanade.tachiyomi.widget.preference.BadgePreference
import eu.kanade.tachiyomi.widget.preference.IntListPreference
import eu.kanade.tachiyomi.widget.preference.SwitchPreferenceCategory
@@ -57,10 +56,6 @@ inline fun PreferenceGroup.multiSelectListPreference(block: (@DSL MultiSelectLis
return initThenAdd(MultiSelectListPreference(context), block).also(::initDialog)
}
-inline fun PreferenceGroup.badgePreference(block: (@DSL BadgePreference).() -> Unit): BadgePreference {
- return initThenAdd(BadgePreference(context), block)
-}
-
inline fun PreferenceScreen.preferenceCategory(block: (@DSL PreferenceCategory).() -> Unit): PreferenceCategory {
return addThenInit(PreferenceCategory(context), block)
}
diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/system/LocaleHelper.kt b/app/src/main/java/eu/kanade/tachiyomi/util/system/LocaleHelper.kt
index 6f28bfa1d7..5ae9383fa9 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/util/system/LocaleHelper.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/util/system/LocaleHelper.kt
@@ -7,7 +7,7 @@ import android.os.Build
import android.view.ContextThemeWrapper
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
-import eu.kanade.tachiyomi.ui.source.SourcePresenter
+import eu.kanade.tachiyomi.ui.browse.source.SourcePresenter
import java.util.Locale
import uy.kohesive.injekt.injectLazy
diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/preference/BadgePreference.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/preference/BadgePreference.kt
deleted file mode 100644
index b0a97ab1aa..0000000000
--- a/app/src/main/java/eu/kanade/tachiyomi/widget/preference/BadgePreference.kt
+++ /dev/null
@@ -1,37 +0,0 @@
-package eu.kanade.tachiyomi.widget.preference
-
-import android.content.Context
-import android.util.AttributeSet
-import androidx.preference.Preference
-import androidx.preference.PreferenceViewHolder
-import eu.kanade.tachiyomi.R
-import eu.kanade.tachiyomi.util.view.gone
-import eu.kanade.tachiyomi.util.view.visible
-import kotlinx.android.synthetic.main.pref_badge.view.badge
-
-class BadgePreference @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) :
- Preference(context, attrs) {
-
- private var badgeNumber: Int = 0
-
- init {
- widgetLayoutResource = R.layout.pref_badge
- }
-
- override fun onBindViewHolder(holder: PreferenceViewHolder) {
- super.onBindViewHolder(holder)
-
- if (badgeNumber > 0) {
- holder.itemView.badge.text = badgeNumber.toString()
- holder.itemView.badge.visible()
- } else {
- holder.itemView.badge.text = null
- holder.itemView.badge.gone()
- }
- }
-
- fun setBadge(number: Int) {
- this.badgeNumber = number
- notifyChanged()
- }
-}
diff --git a/app/src/main/res/drawable/round_textview_background.xml b/app/src/main/res/drawable/round_textview_background.xml
deleted file mode 100644
index fb61cf1ed5..0000000000
--- a/app/src/main/res/drawable/round_textview_background.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
diff --git a/app/src/main/res/layout/manga_info_controller.xml b/app/src/main/res/layout/manga_info_controller.xml
index c30600c116..38e7c9944d 100644
--- a/app/src/main/res/layout/manga_info_controller.xml
+++ b/app/src/main/res/layout/manga_info_controller.xml
@@ -5,7 +5,7 @@
android:id="@id/swipe_refresh"
android:layout_width="match_parent"
android:layout_height="match_parent"
- tools:context="eu.kanade.tachiyomi.ui.source.browse.BrowseSourceController">
+ tools:context=".ui.browse.source.browse.BrowseSourceController">
diff --git a/app/src/main/res/layout/pref_badge.xml b/app/src/main/res/layout/pref_badge.xml
deleted file mode 100644
index 471c1caba3..0000000000
--- a/app/src/main/res/layout/pref_badge.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
diff --git a/app/src/main/res/layout/source_controller.xml b/app/src/main/res/layout/source_controller.xml
index 1e45b2725e..235ab64c24 100644
--- a/app/src/main/res/layout/source_controller.xml
+++ b/app/src/main/res/layout/source_controller.xml
@@ -14,7 +14,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
- tools:context="eu.kanade.tachiyomi.ui.source.browse.BrowseSourceController">
+ tools:context=".ui.browse.source.browse.BrowseSourceController">
+ android:title="@string/browse" />