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

[Sticky headers]The real Header is invisiable #766

Open
glooong opened this issue Oct 30, 2020 · 0 comments
Open

[Sticky headers]The real Header is invisiable #766

glooong opened this issue Oct 30, 2020 · 0 comments

Comments

@glooong
Copy link

glooong commented Oct 30, 2020

When I use the Sticky Header effect, the real Header is invisiable, like the picture. Why does this happen
Below is my code:
Header:
open class MenuContentTitleItem(var titlePos: Int, private val menuContentAdapter: IMenuContentAdapterBridge) : AbstractHeaderItem()
Adapter:
init {
contentAdapter.setDisplayHeadersAtStartUp(true)
contentAdapter.setStickyHeaders(true)
}

/**
 * Set data to notifyDataSetChanged.
 */
var data: T? = null
    set(value) {
        field = value
        navigatorAdapter.data = value
        setupContentAdapter()
    }

private fun setupContentAdapter() {
    contentAdapter.clear()

    val items = mutableListOf<AbstractFlexibleItem<*>>()
    val titleCount = getTitleItemCount()
    for (titleIndex in 0 until titleCount) {
        items.add(MenuContentTitleItem(titleIndex, contentAdapter))
        val subtitleCount = getSubtitleItemCount(titleIndex)
        for (subtitleIndex in 0 until subtitleCount) {
            items.add(MenuContentSubtitleItem(titleIndex, subtitleIndex, contentAdapter))
            val productCount = getProductItemCount(titleIndex, subtitleIndex)
            for (prodIndex in 0 until productCount) {
                items.add(MenuContentProductItem(titleIndex, subtitleIndex, prodIndex, contentAdapter))
            }
        }
    }
    contentAdapter.addItems(0, items)
}

222222

1111111

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant