airbnb / epoxy

Epoxy is an Android library for building complex screens in a RecyclerView
https://goo.gl/eIK82p
Apache License 2.0
8.46k stars 730 forks source link

[Question] Detect which header is being sticky #1374

Open DawnNguyenAhiho opened 3 months ago

DawnNguyenAhiho commented 3 months ago

Hi. I'm using epoxy to create my app. My app has 2 section, so that I create 2 sticky header using StickyHeaderLinearLayoutManager. But the problem is my header has a search button. I only want the search button visible on the sticky header (which mean the top header of the RecycleView) and not the header at the middle. Assume that I have header 1 => some element => header 2 => some more element. At first, the header 1 is on the top and "sticky". When I scroll up, the header 2 goes up and then push the header 1 out of the screen. Now the header 2 is "sticky". I want to detect when the header 2 is pushing the header 1 out, and then I can update the visibility for the search button (at header 1 the search button gone, at header 2, the search button visible).