Use some more KTX and Compat stuff (#3933)
* Use more KTX extensions * Update Android Studio * Use more Compat classes
This commit is contained in:
@@ -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 com.bluelinelabs.conductor.Controller
|
||||
import com.bluelinelabs.conductor.ControllerChangeHandler
|
||||
import com.bluelinelabs.conductor.ControllerChangeType
|
||||
@@ -31,9 +32,7 @@ class BrowseController :
|
||||
TabbedController {
|
||||
|
||||
constructor(toExtensions: Boolean = false) : super(
|
||||
Bundle().apply {
|
||||
putBoolean(TO_EXTENSIONS_EXTRA, toExtensions)
|
||||
}
|
||||
bundleOf(TO_EXTENSIONS_EXTRA to toExtensions)
|
||||
)
|
||||
|
||||
@Suppress("unused")
|
||||
|
||||
@@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.ui.browse.extension
|
||||
|
||||
import android.app.Dialog
|
||||
import android.os.Bundle
|
||||
import androidx.core.os.bundleOf
|
||||
import com.afollestad.materialdialogs.MaterialDialog
|
||||
import com.bluelinelabs.conductor.Controller
|
||||
import eu.kanade.tachiyomi.R
|
||||
@@ -11,10 +12,10 @@ class ExtensionTrustDialog<T>(bundle: Bundle? = null) : DialogController(bundle)
|
||||
where T : Controller, T : ExtensionTrustDialog.Listener {
|
||||
|
||||
constructor(target: T, signatureHash: String, pkgName: String) : this(
|
||||
Bundle().apply {
|
||||
putString(SIGNATURE_KEY, signatureHash)
|
||||
putString(PKGNAME_KEY, pkgName)
|
||||
}
|
||||
bundleOf(
|
||||
SIGNATURE_KEY to signatureHash,
|
||||
PKGNAME_KEY to pkgName
|
||||
)
|
||||
) {
|
||||
targetController = target
|
||||
}
|
||||
|
||||
+2
-3
@@ -14,6 +14,7 @@ import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.appcompat.view.ContextThemeWrapper
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.preference.Preference
|
||||
import androidx.preference.PreferenceGroupAdapter
|
||||
import androidx.preference.PreferenceManager
|
||||
@@ -55,9 +56,7 @@ class ExtensionDetailsController(bundle: Bundle? = null) :
|
||||
private var preferenceScreen: PreferenceScreen? = null
|
||||
|
||||
constructor(pkgName: String) : this(
|
||||
Bundle().apply {
|
||||
putString(PKGNAME_KEY, pkgName)
|
||||
}
|
||||
bundleOf(PKGNAME_KEY to pkgName)
|
||||
)
|
||||
|
||||
init {
|
||||
|
||||
+2
-3
@@ -8,6 +8,7 @@ import android.view.ContextThemeWrapper
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.preference.DialogPreference
|
||||
import androidx.preference.EditTextPreference
|
||||
import androidx.preference.EditTextPreferenceDialogController
|
||||
@@ -41,9 +42,7 @@ class SourcePreferencesController(bundle: Bundle? = null) :
|
||||
private var preferenceScreen: PreferenceScreen? = null
|
||||
|
||||
constructor(sourceId: Long) : this(
|
||||
Bundle().apply {
|
||||
putLong(SOURCE_ID, sourceId)
|
||||
}
|
||||
bundleOf(SOURCE_ID to sourceId)
|
||||
)
|
||||
|
||||
override fun inflateView(inflater: LayoutInflater, container: ViewGroup): View {
|
||||
|
||||
+5
-4
@@ -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.LinearLayoutManager
|
||||
import eu.davidea.flexibleadapter.FlexibleAdapter
|
||||
import eu.davidea.flexibleadapter.items.IFlexible
|
||||
@@ -19,10 +20,10 @@ class MigrationMangaController :
|
||||
private var adapter: FlexibleAdapter<IFlexible<*>>? = null
|
||||
|
||||
constructor(sourceId: Long, sourceName: String?) : super(
|
||||
Bundle().apply {
|
||||
putLong(SOURCE_ID_EXTRA, sourceId)
|
||||
putString(SOURCE_NAME_EXTRA, sourceName)
|
||||
}
|
||||
bundleOf(
|
||||
SOURCE_ID_EXTRA to sourceId,
|
||||
SOURCE_NAME_EXTRA to sourceName
|
||||
)
|
||||
)
|
||||
|
||||
@Suppress("unused")
|
||||
|
||||
+2
-3
@@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.ui.browse.source.latest
|
||||
|
||||
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,7 @@ import eu.kanade.tachiyomi.ui.browse.source.browse.BrowseSourcePresenter
|
||||
class LatestUpdatesController(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 createPresenter(): BrowseSourcePresenter {
|
||||
|
||||
Reference in New Issue
Block a user