Skip to content

Instantly share code, notes, and snippets.

View antonKozyriatskyi's full-sized avatar

Anton Kozyriatskyi antonKozyriatskyi

View GitHub Profile
antonKozyriatskyi / LoadMoreListener.kt
Last active January 29, 2020 09:47
Load more listener for RecyclerView
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
class LoadMoreListener(
private val threshold: Int,
private val listener: OnLoadMoreRequestedListener
) : RecyclerView.OnScrollListener() {
companion object {
fun attach(
antonKozyriatskyi / StickyHeaders.kt
Created February 16, 2019 13:24
Sticky headers for RecyclerView. Supports only one sticky header view type.
package kozyriatskyi.anton.sked.week.stickyheaders
import android.util.SparseIntArray
import android.view.MotionEvent
import android.view.View
import android.view.ViewGroup