Question

I am using a ScrollView to display a list of items that are inflated on runtime. Like a feed of updates for the user. While thinking about the options i got to let the user update the view with new notifications I thought about the pull to refresh feature in the twitter app.

Anyone got any idea how and if can it be implemented with a ScrollView ?

Saw there are some implementations for that using ListView but I don't like the idea of changing all of my platform to gain this refresh effect.

Was it helpful?

Solution

There is a solution introduced for implementing pull to refresh for various component which are scrollable like listview and scroollview. Look at ChangeLog link https://github.com/chrisbanes/Android-PullToRefresh

OTHER TIPS

ListView with just one element can be treated as a ScrollView. You can use the implementation for pull-to-refresh ListView and add just one item in it. I had used this trick in the past.

You can do that. You can increase the top margin of the scrollview when the user moves the finger down and the scrollview it's on it's top. Then on release fire the update and decrease the margin with animation.(You have to create your own animation to pull that off). That's the idea. If you want more particular help ask what you cannot implement.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top