Add in just 1 line of code the well known Pull2Refresh option to your table. Instead of having a lot of code in every view where you want to implement Pull2Refresh, we made a generic base you can now use everywhere! And to suit all your needs, we implemented all important element properties.
To access this module from JavaScript, you would do the following:
var pull2refreshModule = require("nl.icept.pull2refresh");
The pull2refreshModule variable is a reference to the Module object.
Synchronous Method:
pullToRefreshModule.addPullRefreshToTableView(tableView, function() { //update the table });
Asynchronous Method:
pullToRefreshModule.addASyncPullRefreshToTableView(tableView, function() { setTimeout(function() { //update the table
//indicate the refresh is finished, since this is a async refresh
tableView.refreshFinished();
}, 2000);
});
For a complete overview of the options, a example project is included.
{ dateFormat: 'dd-mm-yyyy HH:MM',
backgroundColor: '#e2e7ed',
width: 320,
height: 65,
offset: 65,
border: {
backgroundColor: '#576c89',
hidden: false,
width: undefined,
height: 2,
top: undefined,
bottom: 0,
left: undefined,
right: undefined,
},
statusLabel: {
loadingText: 'Loading...',
pullText: 'Pull down to refresh...',
releaseText: 'Release to refresh...',
hidden: false,
color: '#777c82',
textAlign: "center",
fontSize: 13,
fontWeight: "bold",
width: 320,
height: 'auto',
top: undefined,
bottom: 30,
left: 0,
right: undefined,
},
updateLabel: {
text: 'Last Updated: {date}',
hidden: false,
color: '#777c82',
textAlign: "center",
fontSize: 12,
fontWeight: "normal",
width: 320,
height: 'auto',
top: undefined,
bottom: 15,
left: 0,
right: undefined,
},
activityIndicator: {
width: 30,
height: 30,
hidden: false,
top: undefined,
bottom: 13,
left: 20,
right: undefined,
style: Titanium.UI.iPhone.ActivityIndicatorStyle.DARK
},
imageView: {
image: 'arrow.png',
width: 23,
height: 60,
hidden: false,
top: undefined,
bottom: 5,
left: 20,
right: undefined,
animation: {
rotation: 180,
duration: 180
}
}
}
Martijn Bogaard martijn@icept.nl
After purchase in the Appcelerator Marketplace you get a unlimited, non-transferable 1 seat license. You are free to use this in a unlimited amount of projects but you are not allowed to (re)sell your license.
THIS SOFTWARE IS PROVIDED BY iCept ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.