From 6a532b836dd86819e97854e56e7524b1b0608786 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 18 Apr 2020 14:40:18 -0400 Subject: [PATCH] Refactor databinding fields to parent abstract classes --- .../tachiyomi/ui/base/activity/BaseActivity.kt | 5 ++++- .../tachiyomi/ui/base/activity/BaseRxActivity.kt | 5 ++++- .../tachiyomi/ui/base/controller/BaseController.kt | 7 +++++-- .../ui/base/controller/NucleusController.kt | 6 ++++-- .../tachiyomi/ui/base/controller/RxController.kt | 3 ++- .../tachiyomi/ui/category/CategoryController.kt | 4 +--- .../tachiyomi/ui/download/DownloadController.kt | 4 +--- .../tachiyomi/ui/extension/ExtensionController.kt | 4 +--- .../ui/extension/ExtensionDetailsController.kt | 4 +--- .../kanade/tachiyomi/ui/library/LibraryController.kt | 4 +--- .../java/eu/kanade/tachiyomi/ui/main/MainActivity.kt | 4 +--- .../eu/kanade/tachiyomi/ui/manga/MangaController.kt | 4 +--- .../tachiyomi/ui/manga/chapter/ChaptersController.kt | 4 +--- .../tachiyomi/ui/manga/info/MangaInfoController.kt | 4 +--- .../tachiyomi/ui/manga/track/TrackController.kt | 4 +--- .../tachiyomi/ui/migration/MigrationController.kt | 4 +--- .../eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt | 4 +--- .../tachiyomi/ui/recent/history/HistoryController.kt | 4 +--- .../tachiyomi/ui/recent/updates/UpdatesController.kt | 4 +--- .../tachiyomi/ui/setting/SettingsController.kt | 2 +- .../kanade/tachiyomi/ui/source/SourceController.kt | 4 +--- .../ui/source/browse/BrowseSourceController.kt | 4 +--- .../source/global_search/GlobalSearchController.kt | 12 +----------- .../kanade/tachiyomi/ui/webview/WebViewActivity.kt | 4 +--- 24 files changed, 38 insertions(+), 70 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/base/activity/BaseActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/base/activity/BaseActivity.kt index e3d89e5547..01068aa76a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/base/activity/BaseActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/base/activity/BaseActivity.kt @@ -4,6 +4,7 @@ import android.content.res.Configuration import android.os.Build import android.os.Bundle import androidx.appcompat.app.AppCompatActivity +import androidx.viewbinding.ViewBinding import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.preference.PreferenceValues as Values import eu.kanade.tachiyomi.data.preference.PreferencesHelper @@ -11,10 +12,12 @@ import eu.kanade.tachiyomi.ui.security.SecureActivityDelegate import eu.kanade.tachiyomi.util.system.LocaleHelper import uy.kohesive.injekt.injectLazy -abstract class BaseActivity : AppCompatActivity() { +abstract class BaseActivity : AppCompatActivity() { val preferences: PreferencesHelper by injectLazy() + lateinit var binding: VB + @Suppress("LeakingThis") private val secureActivityDelegate = SecureActivityDelegate(this) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/base/activity/BaseRxActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/base/activity/BaseRxActivity.kt index c0fb69fae2..396e9e64f9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/base/activity/BaseRxActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/base/activity/BaseRxActivity.kt @@ -1,16 +1,19 @@ package eu.kanade.tachiyomi.ui.base.activity import android.os.Bundle +import androidx.viewbinding.ViewBinding import eu.kanade.tachiyomi.ui.base.presenter.BasePresenter import eu.kanade.tachiyomi.ui.security.SecureActivityDelegate import eu.kanade.tachiyomi.util.system.LocaleHelper import nucleus.view.NucleusAppCompatActivity -abstract class BaseRxActivity

> : NucleusAppCompatActivity

() { +abstract class BaseRxActivity> : NucleusAppCompatActivity

() { @Suppress("LeakingThis") private val secureActivityDelegate = SecureActivityDelegate(this) + lateinit var binding: VB + init { @Suppress("LeakingThis") LocaleHelper.updateConfiguration(this) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/BaseController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/BaseController.kt index 90d0664c28..c0922d646e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/BaseController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/BaseController.kt @@ -6,6 +6,7 @@ import android.view.MenuItem import android.view.View import android.view.ViewGroup import androidx.appcompat.app.AppCompatActivity +import androidx.viewbinding.ViewBinding import com.bluelinelabs.conductor.Controller import com.bluelinelabs.conductor.ControllerChangeHandler import com.bluelinelabs.conductor.ControllerChangeType @@ -14,9 +15,11 @@ import kotlinx.android.extensions.LayoutContainer import kotlinx.android.synthetic.clearFindViewByIdCache import timber.log.Timber -abstract class BaseController(bundle: Bundle? = null) : RestoreViewOnCreateController(bundle), +abstract class BaseController(bundle: Bundle? = null) : RestoreViewOnCreateController(bundle), LayoutContainer { + lateinit var binding: VB + init { addLifecycleListener(object : LifecycleListener() { override fun postCreateView(controller: Controller, view: View) { @@ -72,7 +75,7 @@ abstract class BaseController(bundle: Bundle? = null) : RestoreViewOnCreateContr fun setTitle() { var parentController = parentController while (parentController != null) { - if (parentController is BaseController && parentController.getTitle() != null) { + if (parentController is BaseController<*> && parentController.getTitle() != null) { return } parentController = parentController.parentController diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/NucleusController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/NucleusController.kt index 5a9250d87c..0786d5e137 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/NucleusController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/NucleusController.kt @@ -1,14 +1,16 @@ package eu.kanade.tachiyomi.ui.base.controller import android.os.Bundle +import androidx.viewbinding.ViewBinding import eu.kanade.tachiyomi.ui.base.presenter.NucleusConductorDelegate import eu.kanade.tachiyomi.ui.base.presenter.NucleusConductorLifecycleListener import nucleus.factory.PresenterFactory import nucleus.presenter.Presenter @Suppress("LeakingThis") -abstract class NucleusController

>(val bundle: Bundle? = null) : RxController(bundle), - PresenterFactory

{ +abstract class NucleusController>(val bundle: Bundle? = null) : + RxController(bundle), + PresenterFactory

{ private val delegate = NucleusConductorDelegate(this) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/RxController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/RxController.kt index d227c1caf8..dd470e79ae 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/RxController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/RxController.kt @@ -3,11 +3,12 @@ package eu.kanade.tachiyomi.ui.base.controller import android.os.Bundle import android.view.View import androidx.annotation.CallSuper +import androidx.viewbinding.ViewBinding import rx.Observable import rx.Subscription import rx.subscriptions.CompositeSubscription -abstract class RxController(bundle: Bundle? = null) : BaseController(bundle) { +abstract class RxController(bundle: Bundle? = null) : BaseController(bundle) { var untilDetachSubscriptions = CompositeSubscription() private set diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/category/CategoryController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/category/CategoryController.kt index de316e2472..0a2a5f84f5 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/category/CategoryController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/category/CategoryController.kt @@ -25,7 +25,7 @@ import reactivecircus.flowbinding.android.view.clicks /** * Controller to manage the categories for the users' library. */ -class CategoryController : NucleusController(), +class CategoryController : NucleusController(), ActionMode.Callback, FlexibleAdapter.OnItemClickListener, FlexibleAdapter.OnItemLongClickListener, @@ -49,8 +49,6 @@ class CategoryController : NucleusController(), */ private var undoHelper: UndoHelper? = null - private lateinit var binding: CategoriesControllerBinding - /** * Creates the presenter for this controller. Not to be manually called. */ diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadController.kt index fdddff8003..ac8cbf0b22 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadController.kt @@ -23,7 +23,7 @@ import rx.android.schedulers.AndroidSchedulers * Controller that shows the currently active downloads. * Uses R.layout.fragment_download_queue. */ -class DownloadController : NucleusController(), +class DownloadController : NucleusController(), DownloadAdapter.DownloadItemListener { /** @@ -41,8 +41,6 @@ class DownloadController : NucleusController(), */ private var isRunning: Boolean = false - private lateinit var binding: DownloadControllerBinding - init { setHasOptionsMenu(true) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionController.kt index d0a4b8d837..da7888e4b5 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionController.kt @@ -32,7 +32,7 @@ import uy.kohesive.injekt.api.get /** * Controller to manage the catalogues available in the app. */ -open class ExtensionController : NucleusController(), +open class ExtensionController : NucleusController(), ExtensionAdapter.OnButtonClickListener, FlexibleAdapter.OnItemClickListener, FlexibleAdapter.OnItemLongClickListener, @@ -49,8 +49,6 @@ open class ExtensionController : NucleusController(), private var query = "" - private lateinit var binding: ExtensionControllerBinding - init { setHasOptionsMenu(true) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionDetailsController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionDetailsController.kt index ffcbc5e1a1..134ee3f47a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionDetailsController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionDetailsController.kt @@ -38,7 +38,7 @@ import reactivecircus.flowbinding.android.view.clicks @SuppressLint("RestrictedApi") class ExtensionDetailsController(bundle: Bundle? = null) : - NucleusController(bundle), + NucleusController(bundle), PreferenceManager.OnDisplayPreferenceDialogListener, DialogPreference.TargetFragment { @@ -46,8 +46,6 @@ class ExtensionDetailsController(bundle: Bundle? = null) : private var preferenceScreen: PreferenceScreen? = null - private lateinit var binding: ExtensionDetailControllerBinding - constructor(pkgName: String) : this(Bundle().apply { putString(PKGNAME_KEY, pkgName) }) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt index e8d46385c2..3988892910 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt @@ -51,7 +51,7 @@ import uy.kohesive.injekt.api.get class LibraryController( bundle: Bundle? = null, private val preferences: PreferencesHelper = Injekt.get() -) : NucleusController(bundle), +) : NucleusController(bundle), RootController, TabbedController, ActionMode.Callback, @@ -126,8 +126,6 @@ class LibraryController( private var tabsVisibilitySubscription: Subscription? = null - private lateinit var binding: LibraryControllerBinding - init { setHasOptionsMenu(true) retainViewMode = RetainViewMode.RETAIN_DETACH 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 fa0f4980c7..32717d8c45 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 @@ -38,7 +38,7 @@ import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.launch import timber.log.Timber -class MainActivity : BaseActivity() { +class MainActivity : BaseActivity() { private lateinit var router: Router @@ -55,8 +55,6 @@ class MainActivity : BaseActivity() { private var isHandlingShortcut: Boolean = false - private lateinit var binding: MainActivityBinding - override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) 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 fa6e404392..22371a6919 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 @@ -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 { putLong(MANGA_EXTRA, manga?.id ?: 0) @@ -63,8 +63,6 @@ class MangaController : RxController, TabbedController { val mangaFavoriteRelay: PublishRelay = PublishRelay.create() - private lateinit var binding: MangaControllerBinding - private val trackingIconRelay: BehaviorRelay = BehaviorRelay.create() private var trackingIconSubscription: Subscription? = null diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersController.kt index 9d4f8822b3..cc36a7e4a5 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersController.kt @@ -40,7 +40,7 @@ import reactivecircus.flowbinding.android.view.clicks import reactivecircus.flowbinding.swiperefreshlayout.refreshes import timber.log.Timber -class ChaptersController : NucleusController(), +class ChaptersController : NucleusController(), ActionMode.Callback, FlexibleAdapter.OnItemClickListener, FlexibleAdapter.OnItemLongClickListener, @@ -64,8 +64,6 @@ class ChaptersController : NucleusController(), private var lastClickPosition = -1 - private lateinit var binding: ChaptersControllerBinding - init { setHasOptionsMenu(true) setOptionsMenuHidden(true) 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 6134c1e077..22ee17cc19 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 @@ -71,13 +71,11 @@ import uy.kohesive.injekt.injectLazy * UI related actions should be called from here. */ class MangaInfoController(private val fromSource: Boolean = false) : - NucleusController(), + NucleusController(), ChangeMangaCategoriesDialog.Listener { private val preferences: PreferencesHelper by injectLazy() - private lateinit var binding: MangaInfoControllerBinding - init { setHasOptionsMenu(true) setOptionsMenuHidden(true) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackController.kt index 50fe07a614..a1524e9615 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackController.kt @@ -17,7 +17,7 @@ import kotlinx.coroutines.flow.onEach import reactivecircus.flowbinding.swiperefreshlayout.refreshes import timber.log.Timber -class TrackController : NucleusController(), +class TrackController : NucleusController(), TrackAdapter.OnClickListener, SetTrackStatusDialog.Listener, SetTrackChaptersDialog.Listener, @@ -25,8 +25,6 @@ class TrackController : NucleusController(), private var adapter: TrackAdapter? = null - private lateinit var binding: TrackControllerBinding - init { // There's no menu, but this avoids a bug when coming from the catalogue, where the menu // disappears if the searchview is expanded diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MigrationController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MigrationController.kt index f4c8c68119..635d1335e6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MigrationController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MigrationController.kt @@ -11,7 +11,7 @@ import eu.kanade.tachiyomi.databinding.MigrationControllerBinding import eu.kanade.tachiyomi.ui.base.controller.NucleusController import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction -class MigrationController : NucleusController(), +class MigrationController : NucleusController(), FlexibleAdapter.OnItemClickListener, SourceAdapter.OnSelectClickListener { @@ -23,8 +23,6 @@ class MigrationController : NucleusController(), setTitle() } - private lateinit var binding: MigrationControllerBinding - override fun createPresenter(): MigrationPresenter { return MigrationPresenter() } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt index b5ce3ba2c4..4bb3f4e5a6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt @@ -70,7 +70,7 @@ import uy.kohesive.injekt.injectLazy * viewers, to which calls from the presenter or UI events are delegated. */ @RequiresPresenter(ReaderPresenter::class) -class ReaderActivity : BaseRxActivity() { +class ReaderActivity : BaseRxActivity() { private val preferences by injectLazy() @@ -102,8 +102,6 @@ class ReaderActivity : BaseRxActivity() { @Suppress("DEPRECATION") private var progressDialog: ProgressDialog? = null - private lateinit var binding: ReaderActivityBinding - companion object { @Suppress("unused") const val LEFT_TO_RIGHT = 1 diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recent/history/HistoryController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recent/history/HistoryController.kt index 99701a95a4..c307f46fc3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recent/history/HistoryController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recent/history/HistoryController.kt @@ -22,7 +22,7 @@ import eu.kanade.tachiyomi.util.system.toast * Uses [R.layout.history_controller]. * UI related actions should be called from here. */ -class HistoryController : NucleusController(), +class HistoryController : NucleusController(), RootController, NoToolbarElevationController, FlexibleAdapter.OnUpdateListener, @@ -37,8 +37,6 @@ class HistoryController : NucleusController(), var adapter: HistoryAdapter? = null private set - private lateinit var binding: HistoryControllerBinding - override fun getTitle(): String? { return resources?.getString(R.string.label_recent_manga) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recent/updates/UpdatesController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recent/updates/UpdatesController.kt index 070bd9ecfb..9aafa9e08b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recent/updates/UpdatesController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recent/updates/UpdatesController.kt @@ -38,7 +38,7 @@ import timber.log.Timber * Uses [R.layout.updates_controller]. * UI related actions should be called from here. */ -class UpdatesController : NucleusController(), +class UpdatesController : NucleusController(), RootController, NoToolbarElevationController, ActionMode.Callback, @@ -59,8 +59,6 @@ class UpdatesController : NucleusController(), var adapter: UpdatesAdapter? = null private set - private lateinit var binding: UpdatesControllerBinding - init { setHasOptionsMenu(true) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsController.kt index d0697eb6db..5880073d4f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsController.kt @@ -61,7 +61,7 @@ abstract class SettingsController : PreferenceController() { fun setTitle() { var parentController = parentController while (parentController != null) { - if (parentController is BaseController && parentController.getTitle() != null) { + if (parentController is BaseController<*> && parentController.getTitle() != null) { return } parentController = parentController.parentController diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceController.kt index 4c1e97c77f..34a0a0b5fc 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceController.kt @@ -44,7 +44,7 @@ import uy.kohesive.injekt.api.get * [SourceAdapter.OnBrowseClickListener] call function data on browse item click. * [SourceAdapter.OnLatestClickListener] call function data on latest item click */ -class SourceController : NucleusController(), +class SourceController : NucleusController(), RootController, FlexibleAdapter.OnItemClickListener, FlexibleAdapter.OnItemLongClickListener, @@ -58,8 +58,6 @@ class SourceController : NucleusController(), */ private var adapter: SourceAdapter? = null - private lateinit var binding: SourceMainControllerBinding - init { setHasOptionsMenu(true) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceController.kt index 81bbebae1c..02ee2d62bf 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceController.kt @@ -53,7 +53,7 @@ import uy.kohesive.injekt.injectLazy * Controller to manage the catalogues available in the app. */ open class BrowseSourceController(bundle: Bundle) : - NucleusController(bundle), + NucleusController(bundle), FlexibleAdapter.OnItemClickListener, FlexibleAdapter.OnItemLongClickListener, FlexibleAdapter.EndlessScrollListener, @@ -95,8 +95,6 @@ open class BrowseSourceController(bundle: Bundle) : */ private var progressItem: ProgressItem? = null - private lateinit var binding: SourceControllerBinding - init { setHasOptionsMenu(true) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchController.kt index d0c42801a7..5205a2c04a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchController.kt @@ -30,7 +30,7 @@ import reactivecircus.flowbinding.appcompat.queryTextEvents open class GlobalSearchController( protected val initialQuery: String? = null, protected val extensionFilter: String? = null -) : NucleusController(), +) : NucleusController(), GlobalSearchCardAdapter.OnMangaClickListener { /** @@ -38,11 +38,6 @@ open class GlobalSearchController( */ protected var adapter: GlobalSearchAdapter? = null - private lateinit var binding: GlobalSearchControllerBinding - - /** - * Called when controller is initialized. - */ init { setHasOptionsMenu(true) } @@ -59,11 +54,6 @@ open class GlobalSearchController( return binding.root } - /** - * Set the title of controller. - * - * @return title. - */ override fun getTitle(): String? { return presenter.query } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewActivity.kt index 3587bf5496..e8ec80ff71 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewActivity.kt @@ -23,14 +23,12 @@ import eu.kanade.tachiyomi.util.view.invisible import eu.kanade.tachiyomi.util.view.visible import uy.kohesive.injekt.injectLazy -class WebViewActivity : BaseActivity() { +class WebViewActivity : BaseActivity() { private val sourceManager by injectLazy() private var bundle: Bundle? = null - private lateinit var binding: WebviewActivityBinding - @SuppressLint("SetJavaScriptEnabled") override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState)