com.isyscore.kotlin.android.LoaderUtil.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of common-android Show documentation
Show all versions of common-android Show documentation
iSysCore Common Android Library
The newest version!
@file:Suppress("DEPRECATION", "unused")
package com.isyscore.kotlin.android
import android.content.AsyncTaskLoader
import android.content.Context
import android.database.Cursor
abstract class BaseClassLoader(context: Context) : AsyncTaskLoader(context) {
abstract override fun loadInBackground(): T
override fun onStartLoading() = forceLoad()
override fun onStopLoading() {
cancelLoad()
}
override fun onReset() = stopLoading()
}
abstract class BaseListLoader(context: Context) : BaseClassLoader>(context) {
abstract override fun loadInBackground(): List
}
abstract class BaseMutableListLoader(context: Context) : BaseClassLoader>(context) {
abstract override fun loadInBackground(): MutableList
}
abstract class BaseCursorLoader(context: Context) : BaseClassLoader(context) {
abstract override fun loadInBackground(): Cursor
}