diff --git a/app/shortcuts.xml b/app/shortcuts.xml index 347128b03..9ba1137fc 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 000000000..b409c7f29 --- /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 1ace42adc..5a2b3c1d3 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 71d56a04f..860013a69 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 a84e6d744..69fd1b51a 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 51e58c34b..a9760b758 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 6bef0da26..839d19956 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 6a4c8f904..5675b6d40 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 cd98f0941..fdea10157 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 3da04552e..8c65ea225 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 10b16b42c..456806b38 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 017918b9a..ddea87cc7 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 ae77e52a7..cf1be5fe4 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 458a60f4b..3a91724aa 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 b3a30e4d9..a4bae2484 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 f22bf6b02..c0da896c3 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 a1513fa48..fe0e6b389 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 206d26a91..8f9557d70 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 3d5fe1dac..c9603514d 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 b5df257e9..a64de8401 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 683f7ad34..d9c1df465 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 19a466e38..56008a5a9 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 3c9225f67..65aab36dd 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 70723fab9..b6633ba5d 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 f342f2e65..318a44ec4 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 000000000..cf52294e7 --- /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 378839f7a..77284e5a8 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 3d73b808a..0edf8fefd 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 de43b828a..0c462e284 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 edbbe91a7..c26174c34 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 c80ea9094..90743afda 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 24fec5205..e3f89c896 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 23ff9c664..acf36de16 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 7720dc8f5..d771098c2 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 7e63267cb..beb52ec52 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 574f7e9bb..4da238864 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 e04cd55c4..7c0692036 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 5ce745e03..12e1eb4af 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 2c872e6c0..25cf8b57f 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 8b07d0838..af21aeabb 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 e0023268e..48dc25fea 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 0341669b4..8f8e09dac 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 86a0c60b1..d3d4eb3f7 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 529fa935e..bd8c53f11 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 e9f520291..6d29abcfb 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 f0ca3e11b..d9a8f430c 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 8fd987cbf..6b740cee4 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 4fd8fe358..9c3637a6d 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 e70b247c4..8e4b27d31 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 91db3e83a..f1cb5a74c 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 34dd95503..fbfb28bc2 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 a71370f25..3be5ee5db 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 19df0b014..ba2e504a9 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 ca55cdcf9..97eccfc14 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 fbbfa0185..964c0b3c6 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 9bb911201..61e90461b 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 f49fe7ba1..eac86a420 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 fe8af18a8..1f3c76010 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 6a9fdda73..43e22220b 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 d5307480d..b701e97e5 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 d475809fc..7be87b07c 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 744718def..000000000 --- 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 4cb24e064..03ead952b 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 6f28bfa1d..5ae9383fa 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 b0a97ab1a..000000000 --- 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 fb61cf1ed..000000000 --- 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 c30600c11..38e7c9944 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 471c1caba..000000000 --- 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 1e45b2725..235ab64c2 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" />