mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-17 06:27:29 +01:00
Address minor Kotlin compiler warnings
This commit is contained in:
@@ -13,7 +13,7 @@ class SourceDividerItemDecoration(context: Context) : RecyclerView.ItemDecoratio
|
||||
|
||||
init {
|
||||
val a = context.obtainStyledAttributes(intArrayOf(android.R.attr.listDivider))
|
||||
divider = a.getDrawable(0)
|
||||
divider = a.getDrawable(0)!!
|
||||
a.recycle()
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ class CatalogueNavigationView @JvmOverloads constructor(context: Context, attrs:
|
||||
val view = inflate(R.layout.catalogue_drawer_content)
|
||||
((view as ViewGroup).getChildAt(1) as ViewGroup).addView(recycler)
|
||||
addView(view)
|
||||
title.text = context?.getString(R.string.source_search_options)
|
||||
title.text = context.getString(R.string.source_search_options)
|
||||
search_btn.setOnClickListener { onSearchClicked() }
|
||||
reset_btn.setOnClickListener { onResetClicked() }
|
||||
}
|
||||
@@ -37,4 +37,4 @@ class CatalogueNavigationView @JvmOverloads constructor(context: Context, attrs:
|
||||
adapter.updateDataSet(items)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ class CatalogueSearchAdapter(val controller: CatalogueSearchController) :
|
||||
|
||||
override fun onRestoreInstanceState(savedInstanceState: Bundle) {
|
||||
super.onRestoreInstanceState(savedInstanceState)
|
||||
bundle = savedInstanceState.getBundle(HOLDER_BUNDLE_KEY)
|
||||
bundle = savedInstanceState.getBundle(HOLDER_BUNDLE_KEY)!!
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -47,7 +47,7 @@ class ExtensionDetailsController(bundle: Bundle? = null) :
|
||||
}
|
||||
|
||||
override fun createPresenter(): ExtensionDetailsPresenter {
|
||||
return ExtensionDetailsPresenter(args.getString(PKGNAME_KEY))
|
||||
return ExtensionDetailsPresenter(args.getString(PKGNAME_KEY)!!)
|
||||
}
|
||||
|
||||
override fun getTitle(): String? {
|
||||
@@ -119,7 +119,7 @@ class ExtensionDetailsController(bundle: Bundle? = null) :
|
||||
private fun addPreferencesForSource(screen: PreferenceScreen, source: Source, multiSource: Boolean) {
|
||||
val context = screen.context
|
||||
|
||||
// TODO
|
||||
// TODO
|
||||
val dataStore = SharedPreferencesDataStore(/*if (source is HttpSource) {
|
||||
source.preferences
|
||||
} else {*/
|
||||
|
||||
@@ -13,7 +13,7 @@ class ExtensionDividerItemDecoration(context: Context) : RecyclerView.ItemDecora
|
||||
|
||||
init {
|
||||
val a = context.obtainStyledAttributes(intArrayOf(android.R.attr.listDivider))
|
||||
divider = a.getDrawable(0)
|
||||
divider = a.getDrawable(0)!!
|
||||
a.recycle()
|
||||
}
|
||||
|
||||
|
||||
@@ -24,10 +24,10 @@ class ExtensionTrustDialog<T>(bundle: Bundle? = null) : DialogController(bundle)
|
||||
.positiveText(R.string.ext_trust)
|
||||
.negativeText(R.string.ext_uninstall)
|
||||
.onPositive { _, _ ->
|
||||
(targetController as? Listener)?.trustSignature(args.getString(SIGNATURE_KEY))
|
||||
(targetController as? Listener)?.trustSignature(args.getString(SIGNATURE_KEY)!!)
|
||||
}
|
||||
.onNegative { _, _ ->
|
||||
(targetController as? Listener)?.uninstallExtension(args.getString(PKGNAME_KEY))
|
||||
(targetController as? Listener)?.uninstallExtension(args.getString(PKGNAME_KEY)!!)
|
||||
}
|
||||
.build()
|
||||
}
|
||||
|
||||
@@ -119,8 +119,8 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
|
||||
setContentView(R.layout.reader_activity)
|
||||
|
||||
if (presenter.needsInit()) {
|
||||
val manga = intent.extras.getLong("manga", -1)
|
||||
val chapter = intent.extras.getLong("chapter", -1)
|
||||
val manga = intent.extras!!.getLong("manga", -1)
|
||||
val chapter = intent.extras!!.getLong("chapter", -1)
|
||||
|
||||
if (manga == -1L || chapter == -1L) {
|
||||
finish()
|
||||
|
||||
@@ -498,7 +498,7 @@ class ReaderPresenter(
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeFirst(
|
||||
{ view, file -> view.onShareImageResult(file) },
|
||||
{ view, error -> /* Empty */ }
|
||||
{ _, _ -> /* Empty */ }
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -32,9 +32,9 @@ class DownloadPageLoader(
|
||||
return downloadManager.buildPageList(source, manga, chapter.chapter)
|
||||
.map { pages ->
|
||||
pages.map { page ->
|
||||
ReaderPage(page.index, page.url, page.imageUrl, {
|
||||
ReaderPage(page.index, page.url, page.imageUrl) {
|
||||
context.contentResolver.openInputStream(page.uri)
|
||||
}).apply {
|
||||
}.apply {
|
||||
status = Page.READY
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user