This repository has been archived by the owner on Sep 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xcore.min.js
60 lines (59 loc) · 21.4 KB
/
xcore.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*!
* @module xcore
* @description A library that brings custom view modules and utilities to
develop applications faster and efficiently using Titanium
* @version 1.0
* @author Zeeshan Mian | @zmian
* @link https://github.com/zmian/xcore-titanium
* @license MIT
*/
Object.prototype.hasOwnProperty("renameProperty")||Ti.API.error("[xcore.Utils] renameProperty is required.");
var Utilities={toPixel:function(a){return a*Ti.Platform.displayCaps.dpi/160},addPropertyAlias:function(a,b,c){a||(a=[]);if(0!==a.length)for(var d=0,e=a.length;d<e;d++)a[d][c]=a[d][b];return a},replace:function(a,b,c){a||(a=[]);if(0!==a.length)for(var d=0,e=a.length;d<e;d++)a[d].renameProperty(b,c);return a},newListWithOnlyOneProperty:function(a,b,c){a||(a=[]);for(var d=[],e=0,f=a.length;e<f;e++){var h={};h[c]=a[e][b];d.push(h)}return d},extend:function(a,b){for(var c in b)try{a[c]=b[c].constructor===
Object?Utilities.extend(a[c],b[c]):b[c]}catch(d){a[c]=b[c]}return a},extendWithExclude:function(a,b,c){for(var d in b){if(c instanceof Array)for(var e in c);try{a[d]=b[d].constructor===Object?Utilities.extend(a[d],b[d]):b[d]}catch(f){a[d]=b[d]}}return a},defaults:function(a,b){a||(a={});b||(b={});var c=Utilities.extend(b,a);c.hasOwnProperty("set")&&_.isFunction(c.set)&&c.set();return c},executeFunctionByName:function(a,b){for(var c=Array.prototype.slice.call(arguments,2),d=a.split("."),e=d.pop(),
f=0;f<d.length;f++)b=b[d[f]];return b[e].apply(b,c)}};
function FlexView(a){a||(a={});a=_.extend({borderColor:"#000",borderWidth:0},a);var b=ui.view({width:Ti.UI.SIZE,height:Ti.UI.SIZE,backgroundColor:"blue"}),c=ui.view(a);b.add(c);"undefined"!==typeof a.borderTopWidth&&c.add(createBorderView(a.borderTopWidth,a.borderColor,"top"));"undefined"!==typeof a.borderBottomWidth&&c.add(createBorderView(a.borderBottomWidth,a.borderColor,"bottom"));"undefined"!==typeof a.borderLeftWidth&&c.add(createBorderView(a.borderLeftWidth,a.borderColor,"left"));"undefined"!==
typeof a.borderRightWidth&&c.add(createBorderView(a.borderRightWidth,a.borderColor,"right"));return b}function createBorderView(a,b,c){b=ui.view({width:"100%",height:a,backgroundColor:b});switch(c){case "left":b.left=0;b.width=a;b.height="100%";break;case "right":b.right=0;b.width=a;b.height="100%";break;case "bottom":b.bottom=0;break;default:b.top=0}return b}
function createButtonView(a){a=Utilities.defaults(a,{title:" ",backgroundPaddingTop:6,backgroundPaddingRight:6,backgroundPaddingBottom:6,backgroundPaddingLeft:6});var b=Ti.UI.createButton(a);a=Ti.UI.createLabel({text:a.title,width:Ti.UI.SIZE,height:Ti.UI.SIZE,backgroundPaddingTop:a.backgroundPaddingTop,backgroundPaddingRight:a.backgroundPaddingRight,backgroundPaddingBottom:a.backgroundPaddingBottom,backgroundPaddingLeft:a.backgroundPaddingLeft});b.add(a);b.applyProperties({width:Ti.UI.SIZE,height:Ti.UI.SIZE,
title:" "});return b}
function GridView(a){var b=[],c=a.views,d=[],e=0,f=0,h=null;a=_.extend({debug:!1,width:Ti.UI.SIZE,height:Ti.UI.SIZE,contentWidth:"auto",contentHeight:"auto",scrollType:"vertical",cellWidth:95*Ti.Platform.displayCaps.dpi/160,cellHeight:95*Ti.Platform.displayCaps.dpi/160,cellPadding:0,cellMargin:10*Ti.Platform.displayCaps.dpi/160,rowMargin:10*Ti.Platform.displayCaps.dpi/160,columns:3,borderWidth:0,rows:0,views:[],_ignoreClicks:!0,dynamicWidth:!1,selectedStateEnabled:!1,set:function(){"layout"in this&&
delete this.layout;if(1>this.rows||!_.isNumber(this.rows))this.rows=this.views.length/this.columns;1===this.rows&&(this.rows=1,this.columns=this.views.length,this.layout="horizontal")}},a);a.set();delete a.set;var g=Ti.UI.createScrollView(a),m=function(b,c){var f=Ti.UI.createView({left:0===b?0:a.cellMargin,width:(a.dynamicWidth?c:a.cellWidth)+a.cellPadding,height:a.cellHeight+a.cellPadding,_columnIndex:b,_ignoreClicks:!1});if(a.cellBackgroundColor||a.cellBackgroundSelectedColor||a.cellBackgroundImage||
a.cellBackgroundSelectedImage){var d=a.cellBackgroundColor||"transparent",e=a.cellBackgroundSelectedColor||"transparent",g=a.cellBackgroundImage||void 0,h=a.cellBackgroundSelectedImage||void 0;f.backgroundImage=g;f.backgroundColor=d;if(a.cellBackgroundSelectedColor||a.cellBackgroundSelectedImage)f.addEventListener("touchstart",function(){f.backgroundImage=h;f.backgroundColor=e}),f.addEventListener("touchend",function(){f.backgroundImage=g;f.backgroundColor=d}),f.addEventListener("touchmove",function(){f.backgroundImage=
g;f.backgroundColor=d})}return f};if(1===a.rows)for(var k=0;k<a.columns;k++){if(a.views[e]){0!==k&&a.borderColor&&g.add(createBorder(1,a.borderColor,"left"));a.views[e].cellIndex=e;var l=m(k,a.views[e].width);l.add(a.views[e]);d.push(l);g.add(l);e++}}else for(var n=0;n<a.rows;n++){var p=Ti.UI.createView({layout:"horizontal",focusable:!1,top:n*(a.cellHeight+a.rowMargin),height:a.cellHeight+a.rowMargin,_rowIndex:n,_ignoreClicks:!0});0!==n&&a.borderColor&&g.add(createBorder(1,a.borderColor,"top"));for(k=
0;k<a.columns;k++)a.views[e]&&(0!==k&&a.borderColor&&g.add(createBorder(1,a.borderColor,"left")),a.views[e].cellIndex=e,l=m(k,a.views[e].width),l.add(a.views[e]),d.push(l),p.add(l),e++);b.push(p);g.add(p)}a.rowMarginRight&&(a.rowMarginTop||(a.rowMarginTop=0),a.rowMarginBottom||(a.rowMarginBottom=0),g.add(Ti.UI.createView({width:a.rowMarginRight,height:a.cellHeight+a.rowMarginTop+a.rowMarginBottom})));var q=function(){if(0!==b.length&&0!==d.length){f=a.cellHeight?a.cellHeight+a.cellPadding:d[0].toImage().height;
for(var c=0;c<b.length;c++)b[c].top=c*(f+a.rowMargin),b[c].height=f}};g.addEventListener("singletap",function(b){var c=b.source,f={};if(!c._ignoreClicks){if("undefined"===typeof c.cellIndex)if("undefined"!==typeof c._columnIndex)c=c.children[0];else if("undefined"!==typeof c.parent.cellIndex)c=c.parent;else{Ti.API.error("[xcore.UI.GridView] Unable to find clicked cell.");Ti.API.error("Event Trace: "+JSON.stringify(b));return}f=c.parent;a.callback&&a.callback({x:b.x,y:b.y,type:b.type,rowIndex:f.parent._rowIndex||
0,columnIndex:f._columnIndex||0,cellIndex:c.cellIndex,source:c});a.selectedStateEnabled&&c.setSelectedState&&c.setNormalState&&(null!==h&&h.setNormalState(),h=c,h.setSelectedState())}});g.update=function(b){var f=b.cellHeight;a.cellWidth=a.cellWidth||b.cellWidth;a.cellHeight=a.cellWidth||f;for(b=0;b<d.length;b++)c[b].width=a.cellWidth,c[b].height=a.cellHeight,d[b].width=a.cellWidth+a.cellPadding,d[b].height=a.cellHeight+a.cellPadding;q();g.fireEvent("update",{cellWidth:a.cellWidth,cellHeight:a.cellHeight})};
a.selectedStateEnabled&&(g.clearSelectedState=function(){null!==h&&h.setNormalState()});q();0!==d.length?("auto"===a.width&&(g.width=a.cellWidth?a.cellWidth+a.cellPadding:d[0].toImage().width),"auto"===a.height&&(g.height=a.cellHeight?a.cellHeight+a.cellPadding:d[0].toImage().height*a.rows)):("auto"===a.width&&(g.width=Ti.UI.SIZE),"auto"===a.height&&(g.height=Ti.UI.SIZE));1===a.rows&&0!==d.length&&(a.rowMarginTop&&(g.height+=a.rowMarginTop),a.rowMarginBottom&&(g.height+=a.rowMarginBottom),a.rowMarginLeft&&
(d[0].left=a.rowMarginLeft));a.debug&&function(){Ti.API.log("");Ti.API.log("[xcore.UI.GridView] Set `DEBUG` flag to `false` to turn off these logs.");Ti.API.log("-----------------------------------------------------------------------");Ti.API.log("[xcore.UI.GridView] Number of Rows: "+b.length);Ti.API.log("[xcore.UI.GridView] Number of Cells: "+c.length);Ti.API.log("[xcore.UI.GridView] Number of Columns: "+d.length);Ti.API.log("[xcore.UI.GridView] Grid width: "+g.width);Ti.API.log("[xcore.UI.GridView] Grid height: "+
g.height);Ti.API.log("[xcore.UI.GridView] options: {");_.each(a,function(a,b,c){Ti.API.log("[xcore.UI.GridView] "+b+": "+a)});Ti.API.log("[xcore.UI.GridView] };");Ti.API.log("-----------------------------------------------------------------------");Ti.API.log("")}();g.getCell=function(a){a=g.views[a||0];a||(a=Ti.UI.createView(),a.error=!0);return a};return g}
function createBorder(a,b,c){b=ui.view({width:"100%",height:a,backgroundColor:b});"top"===c&&(b.top=0);"bottom"===c&&(b.bottom=0);"left"===c&&(b.left=0,b.width=a,b.height="100%");"right"===c&&(b.right=0,b.width=a,b.height="100%");return b}
function CarouselView(a){a||(a={});a.data||a.views||Ti.API.error("[xcore.UI.CarouselView] `data` or `views` array not found.");a=_.extend({debug:!1,dynamicWidth:!1,cellPadding:0,rowPadding:10,rowMargin:0,columns:3,rows:0,zIndex:9999,views:[],data:[],cell:{},cellName:"",set:function(){0===this.views.length&&(this.views=CarouselViewCell({data:this.data,cell:this.cell,cellName:this.cellName}));this.dynamicWidth||(this.cellWidth=this.cellWidth||this.views[0].width,this.cellHeight=this.cellHeight||this.views[0].height);
switch(this.layout){case "grid":this.width||(this.width="100%");this.height||(this.height=2*(this.cellHeight+this.rowMargin+this.cellPadding));this.cellMargin="undefined"===typeof this.cellMargin?1:this.cellMargin;this.verticalBounce="undefined"===typeof this.verticalBounce?!0:this.verticalBounce;this.fitToWidth="undefined"===typeof this.fitToWidth?!0:this.fitToWidth;"undefined"===typeof this.top&&(this.bottom||(this.bottom=0));break;case "vertical":this.columns=1;this.width||(this.width="auto");
this.height||(this.height="100%");this.cellMargin="undefined"===typeof this.cellMargin?1:this.cellMargin;this.verticalBounce="undefined"===typeof this.verticalBounce?!0:this.verticalBounce;break;default:this.rows=1,this.width||(this.width="100%"),this.height||(this.height="auto"),this.cellMargin="undefined"===typeof this.cellMargin?10:this.cellMargin,this.rowMarginTop="undefined"===typeof this.rowMarginTop?this.cellMargin:this.rowMarginTop,this.rowMarginBottom="undefined"===typeof this.rowMarginBottom?
this.cellMargin:this.rowMarginBottom,this.rowMarginLeft="undefined"===typeof this.rowMarginLeft?this.cellMargin:this.rowMarginLeft,this.rowMarginRight="undefined"===typeof this.rowMarginRight?this.cellMargin:this.rowMarginRight,this.horizontalBounce="undefined"===typeof this.horizontalBounce?!0:this.horizontalBounce,"undefined"===typeof this.bottom&&(this.top||(this.top=0))}}},a);a.set();delete a.set;if("grid"==a.layout&&a.fitToWidth){var b=Math.floor(App.SECTION_WIDTH*(1/a.columns)-1/a.columns*a.cellMargin);
a.cellPadding=b-a.cellWidth;Ti.Gesture.addEventListener("orientationchange",function(d){b=Math.floor(App.SECTION_WIDTH*(1/a.columns)-1/a.columns*a.cellMargin);a.cellPadding=b-a.cellWidth;c.update(a)})}var c=GridView(a);a.debug&&function(){Ti.API.log("");Ti.API.log("[xcore.UI.CarouselView] Set `DEBUG` flag to `false` to turn off these logs.");Ti.API.log("---------------------------------------------------------------------------");_.each(a,function(a,b,c){"data"===b?Ti.API.log("[xcore.UI.CarouselView] "+
b+": "+JSON.stringify(a)):Ti.API.log("[xcore.UI.CarouselView] "+b+": "+a)});Ti.API.log("---------------------------------------------------------------------------");Ti.API.log("")}();return c}
function CarouselViewCell(a){a=Utilities.defaults(a,{data:[],cell:{},cellName:"ItemViews.ThumbView",set:function(){this.data||(this.data=[]);this.cell||(this.cell={});this.cellName||(this.cellName="ItemViews.ThumbView")}});var b=[];_.map(a.data,function(c,d){a.cell.data=c;var e=Utilities.executeFunctionByName(a.cellName,this,a.cell);b.push(e)});return b}
function SwappableView(a){a=Utilities.defaults(a,{scrollingEnabled:!1,disableBounce:!0,transitionEnabled:!0,cacheSize:9});var b=Ti.UI.createScrollableView(a);b.showView=function(c){a.transitionEnabled?b.scrollToView(c):b.setCurrentPage(c)};return b}
function RatingView(a,b,c){function d(a){f=a;e.fireEvent("ratingChanged",{currentValue:f});a=0;for(var b=h.length;a<b;a++)a>=f?(c.outline&&(h[a].text="\u2606"),h[a].color=c.color):h[a].color=c.selectedColor}c=Utilities.defaults(c,{touchEnabled:!0,color:"#2000",selectedColor:"#000",outline:!0,shadowColor:"transparent",shadowOffset:{x:0,y:1},size:18,padding:3});var e=Ti.UI.createView({layout:"horizontal",width:Ti.UI.SIZE,height:Ti.UI.SIZE});c.top&&(e.top=c.top);for(var f,h=[],g=0;g<b;g++){var m=Ti.UI.createLabel({text:"\u2605",
font:{fontFamily:"Helvetica Neue",fontSize:c.size,fontWeight:500},left:c.padding,shadowColor:c.shadowColor,shadowOffset:c.shadowOffset});c.touchEnabled&&function(){var a=g;m.addEventListener("click",function(){d(a+1)})}();h.push(m);e.add(m)}e.changeRating=d;d(a);return e}
function PickerView(a){a||(a={});for(var b=Ti.UI.createPicker({selectionIndicator:!0}),c=0,d=_.size(a.data);c<d;c++){var e=Ti.UI.createPickerColumn();b.add(e);for(var f=0,h=a.data[c].length;f<h;f++){_.isString(a.data[c][f].title)||(a.data[c][f].title=a.data[c][f].title.toString(),Ti.API.error("[xcore.UI.PickerView] args options.data."+c+"["+f+"].title value must be a string."));"undefined"===typeof a.data[c][f].value&&(a.data[c][f].value=a.data[c][f].title);var g=Ti.UI.createPickerRow(a.data[c][f]);
e.addRow(g)}}b.addEventListener("change",function(b){a.callback&&a.callback(b)});return b}function TableView(a){a||(a={});var b=Ti.UI.createTableView({objName:"customTableView",separatorColor:"#8cc3d6",backgroundColor:"transparent"}),c=[];_.map(a.data,function(a,b){var f=new TableViewRow({data:a});c.push(f)});b.setData(c);return b}
function TableViewRow(a){a||(a={});a.padding=20;var b=Ti.UI.createTableViewRow({className:"customRowView",objName:"customRowView",selectionStyle:Ti.UI.iPhone.TableViewCellSelectionStyle.NONE}),c=Ti.UI.createView({width:"95%",height:Ti.UI.SIZE,top:a.padding});b.add(c);c.addEventListener("touchstart",function(a){c.backgroundColor="#3000"});c.addEventListener("touchend",function(a){c.backgroundColor="transparent"});c.addEventListener("touchmove",function(a){c.backgroundColor="transparent"});var d=Ti.UI.createImageView({backgroundImage:MediaUrlBuilder(a.data.image),
width:133,height:133,top:0,left:0,borderRadius:66.5,borderWidth:10,borderColor:"#fff"});c.add(d);d=Ti.UI.createView({layout:"vertical",height:Ti.UI.SIZE,top:0,left:d.width+a.padding});c.add(d);var e=Ti.UI.createLabel({text:a.data.name,left:0,font:{fontFamily:"Rockwell Regular",fontSize:22,fontWeight:"bold"},color:"#666666"});d.add(e);a.data.about&&(a=Ti.UI.createLabel({text:a.data.about,left:0,font:{fontFamily:"Helvetica Neue",fontSize:16},color:"#666666"}),d.add(a));a=Ti.UI.createButton({title:"Deals",
backgroundImage:"images/button-normal.png",width:120,height:35,top:5,left:0,bubbleParent:!1,font:{fontFamily:"Helvetica Neue",fontSize:18},color:"#fff",shadowColor:"red",shadowOffset:{x:0,y:-1}});d.add(a);return b}var IS_RETINA="high"===Ti.Platform.displayCaps.density;
function TabBarController(){var a={},b=[],c=Ti.UI.createWindow(),d=Ti.UI.createWindow({navBarHidden:!0}),e=Ti.UI.iPhone.createNavigationGroup({window:d});c.add(e);c.open();a.open=function(a,h){a.hasTabBar&&!a.differentStyleTabBars&&(a.tabBarView.backgroundImage="transparent",a.tabBarView.backgroundColor="transparent");if(0==d.children.length&&a.hasTabBar){if(b.push(a),d.add(a),!a.differentStyleTabBars){var g=Ti.UI.createView({bottom:0,width:"100%",height:a.tabBarView.height,backgroundImage:a.tabBarView.barImage,
backgroundColor:a.tabBarView.barColor,zIndex:-10});c.add(g)}}else if(a.hasTabBar)for(b.push(a),e.open(a),ui.button({width:100,height:31,backgroundImage:"images/back-button.png",backgroundSelectedImage:"images/back-button-selected.png"}),g=0;g<a.tabs.length;g++){var m=ui.label({text:"\u279c",width:50,textAlign:"center",color:"#7f7f7f",shadowColor:"#8000",shadowOffset:{x:0,y:-1},font:{fontFamily:"Rockwell",fontSize:38},transform:Ti.UI.create2DMatrix().rotate(180)});a.tabs[g].window.leftNavButton=m;
m.addEventListener("singletap",function(){e.close(a);b.pop()})}else{h||(h={});try{_.last(b).activeTab.navGroup.open(a)}catch(k){Ti.API.error("xcore.UI module: TabBarController unable to open the requested window.")}}};return a}
function createTabGroup(a){a||(a={});a=extend({width:"100%",height:50,left:0,right:0,bottom:0,backgroundImage:a.barImage||"transparent",backgroundColor:a.barColor||"transparent"},a);var b=Ti.UI.createWindow({hasTabBar:!0});b.windowsView=Ti.UI.createWindow({bottom:a.height});b.tabBarView=Ti.UI.createView(a);var c=Ti.UI.createView({layout:"horizontal",width:Ti.UI.SIZE});b.tabBarView.add(c);b.add(b.windowsView);b.add(b.tabBarView);b.tabs=[];b.activeTab=null;b.previousTab=null;var d=function(a){var b=
a.backgroundImage;a.backgroundImage=a.backgroundSelectedImage;a.backgroundSelectedImage=b;b=a.title.color;a.title.color=a.title.colorSelected;a.title.colorSelected=b;b=a.icon.image;a.icon.image=a.icon.imageSelected;a.icon.imageSelected=b},e={push:function(a){var c=b.tabs;c.push(a);b.tabs=c},pop:function(a){var c=b.tabs;c.pop(a);b.tabs=c}};b.addTab=function(a){a.addEventListener("click",function(c){b.setActiveTab(a)});b.windowsView.add(a.navGroup);c.add(a);e.push(a)};b.removeTab=function(a){b.windowsView.remove(a.navGroup);
c.remove(a);e.pop(a)};b.setActiveTab=function(a){a.active||(b.previousTab=b.activeTab,b.activeTab=a,d(b.activeTab),b.activeTab.navGroup.zIndex=1,b.activeTab.navGroup.active=!0,b.activeTab.active=!0,null!==b.previousTab&&(d(b.previousTab),b.previousTab.navGroup.zIndex=0,b.previousTab.navGroup.active=!1,b.previousTab.active=!1))};return b}
function createTab(a){a||(a={});a=extend({width:64,top:0,bottom:0,font:{fontSize:10,fontWeight:IS_RETINA?"normal":"bold"},color:"#fff",colorSelected:"#fff",icon:"transparent",iconSelected:"transparent",title:"TITLE"},a);var b=Ti.UI.createView(a);b.icon=Ti.UI.createImageView({top:6,image:a.icon,imageSelected:a.iconSelected});b.add(b.icon);b.title=Ti.UI.createLabel({bottom:1,text:a.title,font:a.font,color:a.color,colorSelected:a.colorSelected});b.add(b.title);b.active=!1;b.navGroup=Ti.UI.iPhone.createNavigationGroup({window:b.window,
zIndex:0,active:!1});return b}function extend(a,b){for(var c in b)try{a[c]=b[c].constructor===Object?extend(a[c],b[c]):b[c]}catch(d){a[c]=b[c]}return a}
var Slidr=function(){function a(a){a||(a={});var b=Ti.UI.createScrollView({contentWidth:"auto",contentHeight:"auto",width:"100%",height:"100%",layout:"vertical",maxZoomScale:1,verticalBounce:!l.disableBounce,scrollingEnabled:!0,_meta:{className:a.className||"topLevelSlide",index:a.index}});b.addEventListener("X-swipe",function(a){n("scrolling: "+JSON.stringify(a));a=d("vertical",b._meta.index);n("instance.width "+h);n("instance.height"+f);n("slides # "+a)});return b}function b(b,f){f||(f={});
var h="::addSlide("+(b instanceof Array?"array":typeof b).toUpperCase()+" slide, "+JSON.stringify(f)+") ",k;n(h+"method invoked.");k=0<=f.parentIndex&&f.parentIndex<d("horizontal");f.reset&&(e.setViews([]),g=[]);if(b instanceof Array)if(k){n(h+"adding an array of slides as children.");for(var l=0;l<b.length;l++)g[f.parentIndex?f.parentIndex:0][0].add(b[l]),c(b[l],f.parentIndex)}else for(n(h+"adding an array of top-level slides."),l=0;l<b.length;l++)k=a(),k.add(b[l]),c(k),e.addView(k);else k?(n(h+
"add slide as a child."),g[f.parentIndex?f.parentIndex:0][0].add(b),c(b,f.parentIndex)):(n(h+"adding a top-level slide."),k=a(),k.add(b),c(k),e.addView(k));m.horizontalSlides=g.length;for(k=m.totalSlides=0;k<m.horizontalSlides;k++)g[k?k:0][0]._meta.index=k,m.totalSlides+=g[k].length;n(h+"count: "+JSON.stringify(m));n("")}function c(a,b){0<=b?g[b].push(a):g.push([a])}function d(a,b){return"horizontal"===a?m.horizontalSlides:"vertical"===a&&m.horizontalSlides?b?g[b].length:0:m.totalSlides}require("lib/underscore");
var e={},f=0,h=0,g=[],m={totalSlides:0,horizontalSlides:0},k=!0,l={debug:!1,width:"78%",height:"80%",slides:[],clipSlides:!1,transitionEnabled:!0,scrollingEnabled:!0,disableBounce:!1,showPagingControl:!0,pagingControlColor:"transparent"},n=function(a){l.debug&&k&&(Ti.API.log(""),Ti.API.log("[xcore.UI.Slidr] Set `debug` flag to `false` to turn off these logs."),Ti.API.log("--------------------------------------------------------------------"),k=!1);l.debug&&Ti.API.log("[xcore.UI.Slidr] "+a)};return function(a){l=
Utilities.defaults(a,l);l.clipViews=l.clipSlides;e=XUI.SwappableView(l);0!==l.slides.length&&b(l.slides,{reset:!0});h=e.toImage().width;f=e.toImage().height;e.VERSION="0.0.1";e.addSlide=b;return e}}(),ActivityIndicator=function(){function a(){c=Ti.UI.createWindow(e);c.applyProperties({layout:"composite"});var a=Ti.UI.createView({width:Ti.UI.SIZE,height:Ti.UI.SIZE,layout:"vertical"});c.add(a);var d=b();a.add(d);if(e.message){var m=Ti.UI.createLabel({top:6,text:e.message,font:e.font,color:e.color});
a.add(m)}c.addEventListener("close",function(a){d.hide()});a.addEventListener("postlayout",function(a){f("postLayout callback");d.show();a=a.source.rect.height>a.source.rect.width?a.source.rect.height:a.source.rect.width;c.width=a+e.padding;c.height=a+e.padding});return c}function b(){var a;a="white"===e.style?"small"===e.size?"PLAIN":"BIG":"small"===e.size?"DARK":"BIG_DARK";var b=Ti.UI.createActivityIndicator({style:"iPhone OS"===Ti.Platform.name?Ti.UI.iPhone.ActivityIndicatorStyle[a]:Ti.UI.ActivityIndicatorStyle[a]});
f("spinner type = "+a);return b}var c={},d=!0,e={debug:!1,width:Ti.UI.SIZE,height:Ti.UI.SIZE,backgroundColor:"#8000",color:"#8fff",style:"white",size:"small",font:{fontFamily:"Helvetica Neue",fontSize:14},padding:26,borderRadius:10,message:"Loading"},f=function(a){e.debug&&d&&(Ti.API.log(""),Ti.API.log("[xcore.UI.ActivityIndicator] Set `debug` flag to `false` to turn off these logs."),Ti.API.log("--------------------------------------------------------------------------------"),d=!1);e.debug&&Ti.API.log("[xcore.UI.ActivityIndicator] "+
a)};return function(b){e=Utilities.defaults(b,e);a();c.VERSION="0.0.1";return c}}(),xcore=module.exports={UI:{GridView:GridView,CarouselView:CarouselView,CarouselViewCell:CarouselViewCell,SwappableView:SwappableView,Slidr:Slidr,RatingView:RatingView,PickerView:PickerView,TableView:TableView,TabBarController:TabBarController,createTabGroup:createTabGroup,createTab:createTab,createBorderView:createBorderView,createButtonView:createButtonView,ActivityIndicator:ActivityIndicator},Utils:Utilities};