Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android, Half scroll then float

I need to create Android layout similar to Instagram Android app using Vertical LinearLayout consisting of ImageView (please refer to the attached diagram) that is fixed height, "SomeView" (fixed height), and lastly ListView or WebView that will occupy all vertical space regardless content size.

This layout can be scrolled vertically, but after scrolling up and the ImageView becomes out of sight, the "SomeView" component need to float at the top of the screen, and only the ListView remains scrollable.

In this state, when the user scroll down the ListView until the top item in it appears, the ImageView will reappear at the top followed by "SomeView" (it will no longer float), returning to the original layout.

Any ideas on what Android component or examples I should look at? Thanks so much.

Diagram

like image 311
DeckyFx Avatar asked Nov 01 '22 11:11

DeckyFx


1 Answers

You should have a look at sticky headers like this or you could also try the StickyScrollView to start tagging views you want to stick to the top.

Hope that helps.

like image 109
Pawan Kumar Avatar answered Nov 11 '22 12:11

Pawan Kumar