Skip to content

Instantly share code, notes, and snippets.

View nelletto's full-sized avatar

Ion Catalin Dragomir nelletto

View GitHub Profile
@raphaelbussa
raphaelbussa / SectionAdapter.kt
Last active February 12, 2019 18:04
SectionAdapter
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
abstract class SectionAdapter : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
private val headerPositions: MutableMap<Int, Int> = mutableMapOf()
private val itemPositions: MutableMap<Int, Int> = mutableMapOf()
private val sectionItemPositions: MutableMap<Int, Int> = mutableMapOf()
private var listSize = 0
private var headerSize = 0