Created
March 25, 2010 05:25
-
-
Save christaggart/343216 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// CREATE CUSTOM LOADING INDICATOR | |
// | |
var indWin = null; | |
var actInd = null; | |
function showIndicator() | |
{ | |
// window container | |
indWin = Titanium.UI.createWindow({ | |
modal:true, | |
height:150, | |
width:150 | |
}); | |
// black view | |
var indView = Titanium.UI.createView({ | |
height:150, | |
width:150, | |
backgroundColor:'#000', | |
borderRadius:10, | |
opacity:0.8 | |
}); | |
indWin.add(indView); | |
// loading indicator | |
actInd = Titanium.UI.createActivityIndicator({ | |
style:Titanium.UI.iPhone.ActivityIndicatorStyle.BIG, | |
height:30, | |
width:30 | |
}); | |
indWin.add(actInd); | |
// message | |
var message = Titanium.UI.createLabel({ | |
text:'retrieving goodies', | |
color:'#fff', | |
width:'auto', | |
height:'auto', | |
font:{fontSize:20,fontWeight:'bold'}, | |
bottom:20 | |
}); | |
indWin.add(message); | |
indWin.open(); | |
actInd.show(); | |
}; | |
function hideIndicator() | |
{ | |
Ti.API.debug("calling hide INdicator"); | |
actInd.hide(); | |
indWin.close({opacity:0,duration:500}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment