Skip to content

Public RecyclerViewOverScrollDecorAdapter.Impl class  #84

Open
@hushenghao

Description

@hushenghao

Used to support custom LayoutManager.

Such as: CarouselLayoutManager, this is material3 built-in LayoutManager, it extends from RecyclerView.LayoutManager

At present only through broken encapsulation methods to access RecyclerViewOverScrollDecorAdapter.Impl

package me.everything.android.ui.overscroll.adapters // same package name

import androidx.recyclerview.widget.RecyclerView

/**
 * CarouselLayoutManager over scroll.
 */
class CarouselOverScrollAdapter(recyclerView: RecyclerView) :
    RecyclerViewOverScrollDecorAdapter(recyclerView, CarouselImpl(recyclerView))

private class CarouselImpl(private val recyclerView: RecyclerView) :
    RecyclerViewOverScrollDecorAdapter.Impl {
    override fun isInAbsoluteStart(): Boolean {
        return !recyclerView.canScrollHorizontally(-1)
    }

    override fun isInAbsoluteEnd(): Boolean {
        return !recyclerView.canScrollHorizontally(1)
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions