How can i implement custom section or header of ListView like Instagram app in android.
http://prsarahevans.com/wp-content/uploads/2011/06/photo.PNG
When scroll up the bar that have userpic, name and time still be there and when other header bar go near it then animate like push it up.
Thank you.
I was able to solve this issue by using scroll listener on the listview. (tested on 2.1)
Lets say for each list row I have a layout like the one below. There is a content part and a header part. It doesn’t matter what view type you use for header or content.
The test layout for the activity is as in the following:
Finally the code for the activity is given below. Here I had to have an adapter which uses ViewHolder to store the header view and also a variable to keep track of the change in the scroll for each successive scroll events (previousTop). This is because of the fact that offsetTopAndBottom() changes offset of the view related to the previous location of it.