Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for custom parent alignment based on ViewHolder position #200

Closed
rubensousa opened this issue Mar 17, 2024 · 0 comments · Fixed by #259
Closed

Add support for custom parent alignment based on ViewHolder position #200

rubensousa opened this issue Mar 17, 2024 · 0 comments · Fixed by #259
Labels
enhancement New feature or request
Milestone

Comments

@rubensousa
Copy link
Owner

rubensousa commented Mar 17, 2024

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 rubensousa added the enhancement New feature or request label Mar 17, 2024
@rubensousa rubensousa modified the milestone: 1.3.0 Mar 17, 2024
@rubensousa rubensousa added this to the 1.3.0 milestone Jun 2, 2024
@rubensousa rubensousa modified the milestones: 1.3.0, 1.4.0 Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant