Skip to content
This repository has been archived by the owner on Mar 9, 2023. It is now read-only.

Commit

Permalink
bump versions, support title via arg
Browse files Browse the repository at this point in the history
  • Loading branch information
FokkeZB committed Nov 13, 2015
1 parent 71f882d commit 6a0a89f
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 15 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
app/widgets/nl.fokkezb.pullToRefresh/views/.DS_Store
app/widgets/nl.fokkezb.pullToRefresh/styles/.DS_Store
app/widgets/nl.fokkezb.pullToRefresh/controllers/.DS_Store
.DS_Store
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ Both platforms share the same API:

## Changelog
* 2.2
* [Expose method to set refreshControl title for iOS](https://github.com/FokkeZB/nl.fokkezb.pullToRefresh/pull/53/files).
* [Exposes hide() and get() methods](https://github.com/FokkeZB/nl.fokkezb.pullToRefresh/pull/52).
* Adds [getter for List](https://github.com/FokkeZB/nl.fokkezb.pullToRefresh/pull/51).
* 2.1
* Adds support for [TiCollectionView](https://github.com/mpociot/TiCollectionView) by [@adesugbaa](https://github.com/adesugbaa).
Expand Down
27 changes: 18 additions & 9 deletions nl.fokkezb.pullToRefresh/controllers/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ $.getList = function() {
refreshControl = Ti.UI.createRefreshControl();
refreshControl.addEventListener('refreshstart', onRefreshstart);

if (args.title) {
setTitle(args.title);
}

list.refreshControl = refreshControl;

$.addTopLevelView(list);
Expand Down Expand Up @@ -76,15 +80,20 @@ function show() {
exports.show = show;

function setTitle(text){
if (text.apiName && text.apiName == 'Ti.UI.AttributedString'){
refreshTitle = text;
} else {
refreshTitle = Ti.UI.createAttributedString({
text: text
});
}

refreshControl.title = refreshTitle;

if (OS_IOS) {

if (text.apiName && text.apiName == 'Ti.UI.AttributedString'){
refreshTitle = text;

} else {
refreshTitle = Ti.UI.createAttributedString({
text: text
});
}

refreshControl.title = refreshTitle;
}
}
exports.setTitle = setTitle;

Expand Down
4 changes: 2 additions & 2 deletions nl.fokkezb.pullToRefresh/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.2.0",
"version": "2.2.1",
"appc-npm": {
"target": {
"alloy": "app/widgets/nl.fokkezb.pulltorefresh"
Expand All @@ -8,7 +8,7 @@
"package.json"
],
"config": {
"nl.fokkezb.pullToRefresh": "2.1.1"
"nl.fokkezb.pullToRefresh": "2.2.1"
}
},
"author": "Fokke Zandbergen",
Expand Down
2 changes: 1 addition & 1 deletion nl.fokkezb.pullToRefresh/widget.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Pull to Refresh Widget",
"description" : "Uniform wrapper for iOS RefreshControl and Android SwipeRefreshLayout.",
"author": "Fokke Zandbergen",
"version": "2.1.1",
"version": "2.2.1",
"copyright":"Copyright (c) 2013-2015",
"license":"Apache 2.0",
"min-alloy-version": "1.5",
Expand Down

0 comments on commit 6a0a89f

Please sign in to comment.