Kotlin:How to create sticky header in RecyclerView layout? - kotlin

I'm looking for a way to create a sticky header for an android app that show user the header portion while they can scroll through the list. Is there a way I can keep the header sticky inside RecyclerView? I did look into itemDecorator where it draw over the header with fake header which that is not what I want because the header includes buttons function.
I tried adding android css with nestedScrolling="false". Adding translation but nothing seems to work

Related

Sticky header with Groupie android

does Groupie provide sticky header in RecyclerView in any way?
I need to implement sticky header for my RecyclerView and I was wondering if Groupie have it out of the box before me getting deep into it.
Thanks

How to prevent a header of FlatList from going down when pulling-to-refresh in React Native?

I have a FlatList with a Header. When I pull to refresh now, the header goes down along with all list items:
But I want it to stay on top, so that only items are pulled down:
Such behaviour can be achieved if I'd put my header component not inside the FlatList, but before it. However, it's not suitable as the header will always stay on top, but I need it to scroll away with list items as if it was the part of the list. How can I do that?
I have tried setting a negative margin for the header in the onScroll event, but it doesn't look smooth at all and causes weird effects.
I'd appreciate your ideas on how this can be done.

How to reset scroll and section header in sectionList?

I am using sectionList to create sections for my application. I have two tabs which uses the same section list. The issue that I am facing is that when I click the second tab the data refreshes but the other properties like scroll position doesn't because sectionList is a pure component. This causes the header of the second section to disappear after scrolling to some point because there are lesser headers. The things I tried but did not provide any results are:
Use extraData to indicate re-render required
Cloning entire data

Sectionlist Horizontal with sticky header in React Native?

I've been able to render the Sectionlist in React Native with horizontal={true}, but when I have two problems with the section header.
The header appears as a part of the list, and not above it.
Even with stickySectionHeadersEnabled={true}, the header does not stick and scrolls along with the list.
Expected
How it actually appears
horizontal is a prop of ScrollView. Setting horizontal={true} will render every child component of a ScrollView to be horizontally rendered, be it the header or footer or empty component. If you need a layout as what you have drawn under "Expected", you have to make separate View for that.
It makes sense to make everything horizontally in-line, if you are setting horizontal to true. If a SectionList is rendered horizontal, its sections should come up horizontally. If you don't give section headers in between two sections, how will user differentiate between two sections? If you want to have a section header to start at the top of a new section, that's specific to you and you may have to write your own implementation of that.
That's behaving as intended. horizontal={true} means headers will also be rendered horizontally.
If you want headers to be above the items, you could likely hack it by setting the width of the section header to 0, and place a horizontal header within that element, positioned at the very top, so it overlays over the next element.
According to the ListView documentation, the stickySectionHeadersEnabled prop is not supported when horizontal is set to true. While it doesn't currently say this on the SectionList documentation, I assume it's also true for SectionList.
stickyHeaderIndices
(...) This property is not supported in conjunction with horizontal={true}.

Sencha Touch 2 fixed header

Is there a way to have a fixed non animated header in a sencha app and still retain page animation and browsing history?
I need my header to not animate on a page slide. The way i tried it is:
-main container (v box)
--header container
--card container(card layout)
---card
---card2
---card3
Etc
And I manually switch the cards inside the card container with setActiveItem(index)
The header is never animated in/out but I dont have history now so the only way to have a back button is manually hard coding it with setActiveItwm(prevIndex)
Its an unfortunate and dirty solution maybe somebody else has a better one.
Yes I achieved it using sencha architect to test. From memory I created a base container that had layout vbox. Inside that I had a top tabpanel and under that a tabpanel. I then set the flex on the top panel to 0.2 and the tabpanel to 0.8. That way my header will always be 20% height on any device. I hope this helps.
You require Ext.navigation.View
Use Ext.navigation.View and create basic navigation between views...then hide the navigation view you can do that by making the navigationBar property as hidden:true
Next have a common navigation header as you have mentioned above...
Going forward using a button lets say would be by using
button.up('navigationview').push({xtype: 'card2'});
This button will be somewhere in your card which takes you to next card
Similarly for going back on button click
button.up('navigationview').pop();
button.up('navigationview').pop(2);//Will take you two views back and so on
These buttons will be on your common header