This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object DelegatesExt { | |
fun notNullSingleValueVar<T : Any>(): ReadWriteProperty<Any?, T> = NotNullSingleValueVar() | |
fun longPreference(context: Context, name: String, default: Long) = LongPreference(context, name, | |
default) | |
} | |
private class NotNullSingleValueVar<T : Any> : ReadWriteProperty<Any?, T> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LoadMoreScrollListener(val layoutManager: LinearLayoutManager, val onLoadMore: () -> Unit) : RecyclerView.OnScrollListener() { | |
companion object { | |
private val ITEMS_BEFORE_LAST_ITEM = 5 | |
private val TAG = LoadMoreScrollListener::class.javaClass.canonicalName | |
} | |
private var isLoading: Boolean = false | |
override fun onScrolled(recyclerView: RecyclerView?, dx: Int, dy: Int) { |