DpadRecyclerView icon indicating copy to clipboard operation
DpadRecyclerView copied to clipboard

Add support for custom parent alignment based on ViewHolder position

Open rubensousa opened this issue 11 months ago • 0 comments

API example:

val topAlignment = ParentAlignment(fraction = 0f)
recyclerView.setParentAlignmentOverride(object : ParentAlignmentOverride {
    override fun getAlignment(position: Int): ParentAlignment? {
        return if (position == 0) {
            // Align the first position to the top
            topAlignment
        } else {
            // Use default alignment configuration
            null
        }
    }
})
}

interface ParentAlignmentOverride {
    fun getAlignment(position: Int): ParentAlignment?
}

rubensousa avatar Mar 17 '24 11:03 rubensousa