This library aims to provide a reusable Pull to Refresh widget for Adobe AIR mobile. It was based on Feathers (UI component of Starling Framework). The inherited component is allowed to display a “loading” busy indicator at the top of the list and dispatch a event.
- Supports for Feathers (Version 1.1)
- Currently works with:
- GroupedList (Inherit to: feathers.controls.PullToRefreshGroupedList)
- List (Inherit to: feathers.controls.PullToRefreshList)
First of all, you'll import the class path of the component
import feathers.controls.PullToRefreshList;
import feathers.controls.List;
Define a data set
var data:Array =
[
{ text: "Aardvark" },
{ text: "Alligator" },
{ text: "Alpaca" },
{ text: "Anteater" },
];
Create a PullToRefreshList
var list:List = new PullToRefreshList();
list.dataProvider = new ListCollection(data);
list.addEventListener(PullToRefreshList.PULL_TO_REFRESH_EVENT, listPullToRefreshHandler);
this.addChild(list);
If user pull down the component, you will receive a event
private function listPullToRefreshHandler(event:Event):void{
...
// call server to return some data
...
}
- example (demo)
(Click the link to see demo. Be patient, no preloader!)
Copyright (C) 2013 Marco Wong, http://flash-adobe.blogspot.hk/
Licence Agreement (The MIT License)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.