Use bundleOf everywhere I can
This commit is contained in:
parent
86fc50d62b
commit
c999229700
@ -8,6 +8,7 @@ import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.FrameLayout
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.bluelinelabs.conductor.Router
|
||||
@ -214,9 +215,9 @@ class PreMigrationController(bundle: Bundle? = null) :
|
||||
|
||||
fun create(mangaIds: List<Long>): PreMigrationController {
|
||||
return PreMigrationController(
|
||||
Bundle().apply {
|
||||
putLongArray(MANGA_IDS_EXTRA, mangaIds.toLongArray())
|
||||
}
|
||||
bundleOf(
|
||||
MANGA_IDS_EXTRA to mangaIds.toLongArray()
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.Toast
|
||||
import androidx.core.graphics.ColorUtils
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat
|
||||
import com.afollestad.materialdialogs.MaterialDialog
|
||||
@ -500,9 +501,9 @@ class MigrationListController(bundle: Bundle? = null) :
|
||||
|
||||
fun create(config: MigrationProcedureConfig): MigrationListController {
|
||||
return MigrationListController(
|
||||
Bundle().apply {
|
||||
putParcelable(CONFIG_EXTRA, config)
|
||||
}
|
||||
bundleOf(
|
||||
CONFIG_EXTRA to config
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.appcompat.widget.SearchView
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.afollestad.materialdialogs.MaterialDialog
|
||||
import com.afollestad.materialdialogs.list.listItems
|
||||
@ -157,10 +158,10 @@ class SourceController(bundle: Bundle? = null) :
|
||||
}
|
||||
Mode.SMART_SEARCH -> router.pushController(
|
||||
SmartSearchController(
|
||||
Bundle().apply {
|
||||
putLong(SmartSearchController.ARG_SOURCE_ID, source.id)
|
||||
putParcelable(SmartSearchController.ARG_SMART_SEARCH_CONFIG, smartSearchConfig)
|
||||
}
|
||||
bundleOf(
|
||||
SmartSearchController.ARG_SOURCE_ID to source.id,
|
||||
SmartSearchController.ARG_SMART_SEARCH_CONFIG to smartSearchConfig
|
||||
)
|
||||
).withFadeTransaction()
|
||||
)
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.appcompat.widget.SearchView
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
@ -755,9 +756,9 @@ open class BrowseSourceController(bundle: Bundle) :
|
||||
val smartSearchConfig = SourceController.SmartSearchConfig(title)
|
||||
router.pushController(
|
||||
SourceController(
|
||||
Bundle().apply {
|
||||
putParcelable(SourceController.SMART_SEARCH_CONFIG, smartSearchConfig)
|
||||
}
|
||||
bundleOf(
|
||||
SourceController.SMART_SEARCH_CONFIG to smartSearchConfig
|
||||
)
|
||||
).withFadeTransaction()
|
||||
)
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import android.view.MenuInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.appcompat.widget.SearchView
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
@ -49,9 +50,9 @@ open class IndexController :
|
||||
IndexAdapter.ClickListener {
|
||||
|
||||
constructor(source: CatalogueSource?) : super(
|
||||
Bundle().apply {
|
||||
putLong(SOURCE_EXTRA, source?.id ?: 0)
|
||||
}
|
||||
bundleOf(
|
||||
SOURCE_EXTRA to (source?.id ?: 0)
|
||||
)
|
||||
) {
|
||||
this.source = source
|
||||
}
|
||||
|
@ -713,9 +713,9 @@ class MangaController :
|
||||
|
||||
router?.pushController(
|
||||
SourceController(
|
||||
Bundle().apply {
|
||||
putParcelable(SourceController.SMART_SEARCH_CONFIG, smartSearchConfig)
|
||||
}
|
||||
bundleOf(
|
||||
SourceController.SMART_SEARCH_CONFIG to smartSearchConfig
|
||||
)
|
||||
).withFadeTransaction().tag(SMART_SEARCH_SOURCE_TAG)
|
||||
)
|
||||
}
|
||||
@ -751,9 +751,9 @@ class MangaController :
|
||||
|
||||
router?.pushController(
|
||||
BrowseSourceController(
|
||||
Bundle().apply {
|
||||
putParcelable(BrowseSourceController.RECOMMENDS_CONFIG, recommendsConfig)
|
||||
}
|
||||
bundleOf(
|
||||
BrowseSourceController.RECOMMENDS_CONFIG to recommendsConfig
|
||||
)
|
||||
).withFadeTransaction()
|
||||
)
|
||||
}
|
||||
|
@ -306,9 +306,9 @@ class SettingsBackupController : SettingsController() {
|
||||
|
||||
class CreateBackupDialog(bundle: Bundle? = null) : DialogController(bundle) {
|
||||
constructor(type: Int) : this(
|
||||
Bundle().apply {
|
||||
putInt(KEY_TYPE, type)
|
||||
}
|
||||
bundleOf(
|
||||
KEY_TYPE to type
|
||||
)
|
||||
)
|
||||
|
||||
override fun onCreateDialog(savedViewState: Bundle?): Dialog {
|
||||
|
@ -2,6 +2,7 @@ package exh.md.follows
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.Menu
|
||||
import androidx.core.os.bundleOf
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.source.CatalogueSource
|
||||
import eu.kanade.tachiyomi.ui.browse.source.browse.BrowseSourceController
|
||||
@ -13,9 +14,9 @@ import eu.kanade.tachiyomi.ui.browse.source.browse.BrowseSourcePresenter
|
||||
class MangaDexFollowsController(bundle: Bundle) : BrowseSourceController(bundle) {
|
||||
|
||||
constructor(source: CatalogueSource) : this(
|
||||
Bundle().apply {
|
||||
putLong(SOURCE_ID_KEY, source.id)
|
||||
}
|
||||
bundleOf(
|
||||
SOURCE_ID_KEY to source.id
|
||||
)
|
||||
)
|
||||
|
||||
override fun getTitle(): String? {
|
||||
|
@ -4,6 +4,7 @@ import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import eu.kanade.tachiyomi.data.database.DatabaseHelper
|
||||
import eu.kanade.tachiyomi.data.database.models.Manga
|
||||
@ -21,9 +22,9 @@ import uy.kohesive.injekt.api.get
|
||||
|
||||
class MetadataViewController : NucleusController<MetadataViewControllerBinding, MetadataViewPresenter> {
|
||||
constructor(manga: Manga?) : super(
|
||||
Bundle().apply {
|
||||
putLong(MangaController.MANGA_EXTRA, manga?.id ?: 0)
|
||||
}
|
||||
bundleOf(
|
||||
MangaController.MANGA_EXTRA to (manga?.id ?: 0)
|
||||
)
|
||||
) {
|
||||
this.manga = manga
|
||||
if (manga != null) {
|
||||
|
@ -3,6 +3,7 @@ package exh.widget.preference
|
||||
import android.app.Dialog
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.core.view.isVisible
|
||||
import com.afollestad.materialdialogs.MaterialDialog
|
||||
import com.afollestad.materialdialogs.customview.customView
|
||||
@ -35,12 +36,9 @@ class MangadexLoginDialog(bundle: Bundle? = null) : LoginDialogPreference(bundle
|
||||
val scope = CoroutineScope(Job() + Dispatchers.Main)
|
||||
|
||||
constructor(source: MangaDex) : this(
|
||||
Bundle().apply {
|
||||
putLong(
|
||||
"key",
|
||||
source.id
|
||||
)
|
||||
}
|
||||
bundleOf(
|
||||
"key" to source.id
|
||||
)
|
||||
)
|
||||
|
||||
override fun onCreateDialog(savedViewState: Bundle?): Dialog {
|
||||
|
@ -2,6 +2,7 @@ package exh.widget.preference
|
||||
|
||||
import android.app.Dialog
|
||||
import android.os.Bundle
|
||||
import androidx.core.os.bundleOf
|
||||
import com.afollestad.materialdialogs.MaterialDialog
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.track.TrackManager
|
||||
@ -20,7 +21,11 @@ class MangadexLogoutDialog(bundle: Bundle? = null) : DialogController(bundle) {
|
||||
|
||||
val trackManager: TrackManager by injectLazy()
|
||||
|
||||
constructor(source: Source) : this(Bundle().apply { putLong("key", source.id) })
|
||||
constructor(source: Source) : this(
|
||||
bundleOf(
|
||||
"key" to source.id
|
||||
)
|
||||
)
|
||||
|
||||
override fun onCreateDialog(savedViewState: Bundle?): Dialog {
|
||||
return MaterialDialog(activity!!)
|
||||
|
Loading…
x
Reference in New Issue
Block a user