Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johannilsson/android-pulltorefresh
DEPRECATED This project aims to provide a reusable pull to refresh widget for Android.
https://github.com/johannilsson/android-pulltorefresh
Last synced: 3 months ago
JSON representation
DEPRECATED This project aims to provide a reusable pull to refresh widget for Android.
- Host: GitHub
- URL: https://github.com/johannilsson/android-pulltorefresh
- Owner: johannilsson
- Created: 2011-01-09T11:12:41.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2020-10-01T14:08:43.000Z (about 4 years ago)
- Last Synced: 2024-06-28T11:33:51.253Z (5 months ago)
- Language: Java
- Homepage:
- Size: 1.42 MB
- Stars: 2,471
- Watchers: 229
- Forks: 1,031
- Open Issues: 39
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Pull To Refresh for Android
**Note** This library is deprecated, a swipe refresh layout is available in the [v4 support library](https://developer.android.com/reference/android/support/v4/widget/SwipeRefreshLayout.html).
---
This project aims to provide a reusable pull to refresh widget for Android.
![Screenshot](https://github.com/johannilsson/android-pulltorefresh/raw/master/android-pull-to-refresh.png)
Repository at .
## Usage
### Layout
``` xml
```
### Activity
``` java
// Set a listener to be invoked when the list should be refreshed.
((PullToRefreshListView) getListView()).setOnRefreshListener(new OnRefreshListener() {
@Override
public void onRefresh() {
// Do work to refresh the list here.
new GetDataTask().execute();
}
});private class GetDataTask extends AsyncTask {
...
@Override
protected void onPostExecute(String[] result) {
mListItems.addFirst("Added after refresh...");
// Call onRefreshComplete when the list has been refreshed.
((PullToRefreshListView) getListView()).onRefreshComplete();
super.onPostExecute(result);
}
}
```### Last Updated
It's possible to add a last updated time using the method `setLastUpdated`
and `onRefreshComplete`. The text provided to these methods will be set below
the Release to refresh text. Note that the time representation is not validated
replaces the previous text, which means that it's possible and recommended to
add a text similar to "Last Update: 15:23". This might be changed in future
versions.## 1.5 Support
To use the widget on 1.5 the necessary drawables needs to be copied to that
projects drawable folder. The drawables needed by the widget can be found in
the drawable-hdpi folder in the library project.## Contributors
* [Jason Knight](http://www.synthable.com/) -
* [Eddie Ringle](http://eddieringle.com/) -
* [Christof Dorner](http://chdorner.com) -
* [Olof Brickarp](http://www.yay.se) -
* [James Smith](http://loopj.com/) -
* [Alex Volovoy](http://bytesharp.com/) -
* Bo Maryniuk
* [kidfolk](https://github.com/kidfolk)
* [Tim Mahoney](https://github.com/timahoney)
* [Richard Guest](https://github.com/quiffman)## Are you using this widget?
If you are using this widget please feel free to add your app to the
[wiki](https://github.com/johannilsson/android-pulltorefresh/wiki/Apps).## License
Copyright (c) 2011 [Johan Nilsson](http://markupartist.com)Licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html)