Created
May 3, 2013 21:20
-
-
Save Josh-Miller/5514257 to your computer and use it in GitHub Desktop.
Appcelerator loading window, loads an activity indicator (will add text to this later). Works for both iOS and Android.
This file contains hidden or 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
| function MessageWindow() { | |
| var win = Titanium.UI.createWindow({ | |
| height:80, | |
| width:175, | |
| borderRadius:10, | |
| touchEnabled:false, | |
| zIndex: 999999999, | |
| backgroundColor:'#ccc', | |
| opacity: 0.7, | |
| borderColor: '#999', | |
| borderWidth: 1 | |
| //The messageWindow should take the same orientation of its parent window, | |
| //we should not try specifying anything here. | |
| //orientationModes : [Titanium.UI.PORTRAIT] | |
| }); | |
| var activityIndicator = Ti.UI.createActivityIndicator({ | |
| message : L("loading_data"), | |
| color : 'white', | |
| height : 50, | |
| width : 50, | |
| font : {fontSize:18,fontWeight:'bold'}, | |
| touchEnabled:false, | |
| style: Titanium.UI.ActivityIndicatorStyle.BIG_DARK | |
| }); | |
| activityIndicator.show(); | |
| win.add(activityIndicator); | |
| Ti.API.info('message win is go!'); | |
| this.open = function(_args) { | |
| win.open(_args); | |
| }; | |
| this.close = function(_args) { | |
| win.close(_args); | |
| }; | |
| this.show = function(_args) { | |
| win.show(_args); | |
| }; | |
| this.hide = function(_args) { | |
| win.hide(_args); | |
| }; | |
| } | |
| module.exports = MessageWindow; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment