Fix dependency injection and use custom models extending DB ones
This commit is contained in:
@@ -35,7 +35,7 @@ class DownloadAdapter(private val context: Context) : FlexibleAdapter<DownloadHo
|
||||
* @return an identifier for the item.
|
||||
*/
|
||||
override fun getItemId(position: Int): Long {
|
||||
return getItem(position).chapter.id
|
||||
return getItem(position).chapter.id!!
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -262,7 +262,7 @@ class DownloadFragment : BaseRxFragment<DownloadPresenter>() {
|
||||
* @return the holder of the download or null if it's not bound.
|
||||
*/
|
||||
private fun getHolder(download: Download): DownloadHolder? {
|
||||
return recycler.findViewHolderForItemId(download.chapter.id) as? DownloadHolder
|
||||
return recycler.findViewHolderForItemId(download.chapter.id!!) as? DownloadHolder
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,7 @@ import eu.kanade.tachiyomi.data.download.model.DownloadQueue
|
||||
import eu.kanade.tachiyomi.ui.base.presenter.BasePresenter
|
||||
import rx.Observable
|
||||
import timber.log.Timber
|
||||
import javax.inject.Inject
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
|
||||
/**
|
||||
* Presenter of [DownloadFragment].
|
||||
@@ -24,7 +24,7 @@ class DownloadPresenter : BasePresenter<DownloadFragment>() {
|
||||
/**
|
||||
* Download manager.
|
||||
*/
|
||||
@Inject lateinit var downloadManager: DownloadManager
|
||||
val downloadManager: DownloadManager by injectLazy()
|
||||
|
||||
/**
|
||||
* Property to get the queue from the download manager.
|
||||
|
||||
Reference in New Issue
Block a user