New Update: Adding Loading More in FooterView
Several weeks ago, I created a IOS tutorial about how to implement pull to refresh in IOS UITableView. In my Rss reader android app, I also want to add pull to refresh feature so that user can easily update the ListView content. I searched online and spend several to integrate one open source project in my Android ListView example. After that, I find it is quite hard to make some change basing on the open source project because of its poor flexibility. Therefore, I decide to create my own drag to refresh ListView (or called pull to refresh ListView).
In my app, I will create a subclass of ListView which is called RefreshableListView. The new ListView class will allow user to drag down and trigger loading event. So my RefreshableListView will implement the interface OnScrollListener and override the interface functions onScroll and onScrollStateChanged; To track user interactions, I will override the function onTouchEvent as well. Once we drag down the ListView, we will see the headerView which gives a tip “Pull Down to Update”. If we release ListView, the headerView will stay on the top and wait for updating. Once the updating processing finishes, the headerView will shrink back and disappear. Now let’s see the example source code step by step.
Read more