{ "id": "62301", "key": "TIMOB-1669", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "8", "description": "", "name": "Needs more info" }, "resolutiondate": "2012-07-26T11:43:56.000+0000", "created": "2011-04-15T02:58:55.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [], "versions": [ { "id": "11225", "name": "Release 1.5.0", "archived": true, "released": true, "releaseDate": "2010-12-14" } ], "issuelinks": [ { "id": "19392", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "94532", "key": "TIMOB-9901", "fields": { "summary": "TiAPI: Review and clean up platform bugs and reduce bug count by 20%.", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } } ], "assignee": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-07-26T22:24:07.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "{html}
The below code shows the text has a less than 1 opacity when the\r\ngradient is behind the text.
\r\n\r\nhttp://developer.appcelerator.com/s3/retrieve/ticket/39411/helpdesk...
\r\nvar window = Titanium.UI.createWindow();
\r\nvar win = Ti.UI.currentWindow;
\r\nvar xhr = Titanium.Network.createHTTPClient();
\r\nxhr.onload = function()
\r\n{ var doc = this.responseXML.documentElement;
Ti.API.log(this.responseText);
\r\nvar prices = doc.getElementsByTagName(\"prices\");\r\nTi.API.log(doc.getElementsByTagName(\"goldcurrent\").item(0).text); /\r\nvar goldCurrent = prices.item(0); var goldChange =\r\nprices.item(1); var silverCurrent = prices.item(2); var\r\nsilverChange = prices.item(3); var platinumCurrent =\r\nprices.item(4); var platinumChange = prices.item(5); var\r\npalladiumCurrent = prices.item(6); var palladiumChange =\r\nprices.item(7); /
\r\nvar goldCurrent =\r\ndoc.getElementsByTagName(\"goldcurrent\").item(0).text; var\r\ngoldChange = doc.getElementsByTagName(\"goldchange\").item(0).text;\r\nvar silverCurrent =\r\ndoc.getElementsByTagName(\"silvercurrent\").item(0).text; var\r\nsilverChange =\r\ndoc.getElementsByTagName(\"silverchange\").item(0).text; var\r\nplatinumCurrent =\r\ndoc.getElementsByTagName(\"platinumcurrent\").item(0).text; var\r\nplatinumChange =\r\ndoc.getElementsByTagName(\"platinumchange\").item(0).text; var\r\npalladiumCurrent =\r\ndoc.getElementsByTagName(\"palladiumcurrent\").item(0).text; var\r\npalladiumChange =\r\ndoc.getElementsByTagName(\"palladiumchange\").item(0).text;
\r\ngoldCurrentNumber = goldCurrent; silverCurrentNumber =\r\nsilverCurrent; platinumCurrentNumber = platinumCurrent;\r\npalladiumCurrentNumber = palladiumCurrent;
\r\ngoldChangeNumber = goldChange; silverChangeNumber =\r\nsilverChange; platinumChangeNumber = platinumChange;\r\npalladiumChangeNumber = palladiumChange;
\r\nif (goldChange >= 0) {
\r\n\r\ngoldChangeColor = 'green';
\r\n
\r\n} else if (goldChange < 0 ) {
\r\n\r\ngoldChangeColor = 'red';
\r\n
\r\n}
\r\nif (silverChange >= 0) {
\r\n\r\nsilverChangeColor = 'green';
\r\n
\r\n} else if (silverChange < 0) {
\r\n\r\nsilverChangeColor = 'red';
\r\n
\r\n}
\r\nif (platinumChange >= 0) {
\r\n\r\nplatinumChangeColor = 'green';
\r\n
\r\n} else if (platinumChange < 0) {
\r\n\r\nplatinumChangeColor = 'red';
\r\n
\r\n}
\r\nif (palladiumChange >= 0) {
\r\n\r\npalladiumChangeColor = 'green';
\r\n
\r\n} else if (palladiumChange < 0) {
\r\n\r\npalladiumChangeColor = 'red';
\r\n
\r\n}
\r\nvar goldPriceView = Titanium.UI.createView({
\r\n\r\ncontentWidth:500,\r\ncontentHeight:50,\r\ntop:90,\r\nheight:30,\r\nwidth:300,\r\nborderWidth:'2px',\r\nborderColor:'#1b1e19',\r\nborderRadius:10,\r\nbackgroundColor:'#000000'
\r\n
\r\n}); window.add(goldPriceView);
\r\nvar goldCurrentLabel = Ti.UI.createLabel({
\r\n\r\nfont:{fontSize:20, fontFamily:'Courier-BoldOblique'},\r\ncolor:goldChangeColor,\r\nleft:10,\r\ntext:'$'+goldCurrentNumber
\r\n
\r\n}); goldPriceView.add(goldCurrentLabel);
\r\nvar goldChangeLabel = Ti.UI.createLabel({
\r\n\r\n font:{fontSize:20, fontFamily:'Courier-BoldOblique'},\r\ncolor:goldChangeColor,\r\nleft:150,\r\ntext:goldChangeNumber
\r\n
\r\n});
\r\n\r\ngoldPriceView.add(goldChangeLabel);
\r\n
\r\nvar silverPriceView = Titanium.UI.createView({
\r\n\r\ncontentWidth:500,\r\ncontentHeight:50,\r\ntop:145,\r\nheight:30,\r\nwidth:300,\r\nborderWidth:'2px',\r\nborderColor:'#1b1e19',\r\nborderRadius:10,\r\nbackgroundColor:'#000000'
\r\n
\r\n}); window.add(silverPriceView);
\r\nvar silverCurrentLabel = Ti.UI.createLabel({
\r\n\r\nfont:{fontSize:20, fontFamily:'Courier-BoldOblique'},\r\ncolor:silverChangeColor,\r\nleft:10,\r\ntext:'$'+silverCurrentNumber
\r\n
\r\n}); silverPriceView.add(silverCurrentLabel);
\r\nvar silverChangeLabel = Ti.UI.createLabel({
\r\n\r\nfont:{fontSize:20, fontFamily:'Courier-BoldOblique'},\r\ncolor:silverChangeColor,\r\nleft:150,\r\ntext:silverChangeNumber
\r\n
\r\n}); silverPriceView.add(silverChangeLabel);
\r\nvar platinumPriceView = Titanium.UI.createView({
\r\n\r\ncontentWidth:500,\r\ncontentHeight:50,\r\ntop:200,\r\nheight:30,\r\nwidth:300,\r\nborderWidth:'2px',\r\nborderColor:'#1b1e19',\r\nborderRadius:10,\r\nbackgroundColor:'#000000'
\r\n
\r\n}); window.add(platinumPriceView);
\r\nvar platinumCurrentLabel = Ti.UI.createLabel({
\r\n\r\nfont:{fontSize:20, fontFamily:'Courier-BoldOblique'},\r\ncolor:platinumChangeColor, \r\nleft:10,\r\ntext:'$'+platinumCurrentNumber
\r\n
\r\n}); platinumPriceView.add(platinumCurrentLabel);
\r\nvar platinumChangeLabel = Ti.UI.createLabel({
\r\n\r\nfont:{fontSize:20, fontFamily:'Courier-BoldOblique'},\r\ncolor:platinumChangeColor,\r\nleft:150,\r\ntext:platinumChangeNumber
\r\n
\r\n}); platinumPriceView.add(platinumChangeLabel);
\r\nvar palladiumPriceView = Titanium.UI.createView({
\r\n\r\ncontentWidth:500,\r\ncontentHeight:50,\r\ntop:255,\r\nheight:30,\r\nwidth:300,\r\nborderWidth:'2px',\r\nborderColor:'#1b1e19',\r\nborderRadius:10,\r\nbackgroundColor:'#000000'
\r\n
\r\n}); window.add(palladiumPriceView);
\r\nvar palladiumCurrentLabel = Ti.UI.createLabel({
\r\n\r\nfont:{fontSize:20, fontFamily:'Courier-BoldOblique'},\r\ncolor:'green',\r\nleft:10,\r\ntext:'$'+palladiumCurrentNumber
\r\n
\r\n}); palladiumPriceView.add(palladiumCurrentLabel);
\r\nvar palladiumChangeLabel = Ti.UI.createLabel({
\r\n\r\nfont:{fontSize:20, fontFamily:'Courier-BoldOblique'},\r\ncolor:'green',\r\nleft:150,\r\ntext:palladiumChangeNumber
\r\n
\r\n}); palladiumPriceView.add(palladiumChangeLabel);
\r\n};
\r\nxhr.open('GET','http://m.hayekinstitute.ca/app/freetest.php');
\r\nxhr.send();
var title = Titanium.UI.createImageView({
\r\nimage:'img/metalsmobile.png', bottom:425, right:60 });\r\nwindow.add(title);
var spotprice = Titanium.UI.createLabel({
\r\nbottom:380, left:20, font:{fontSize:16, fontFamily:'Helvetica'},\r\ntext:'Spot Price', color:'#ffffff' }); window.add(spotprice);
var info = Titanium.UI.createImageView({
\r\nimage:\"img/infoicon.png\", bottom:430, left:250 });\r\nwindow.add(info);
info.addEventListener('click', function()
\r\n{
var t = Titanium.UI.create2DMatrix(); t = t.scale(0);
\r\nvar w = Titanium.UI.createWindow({
\r\n\r\nbackgroundColor:'#336699',\r\nborderWidth:8,\r\nborderColor:'#999',\r\nheight:400,\r\nwidth:300,\r\nborderRadius:10,\r\nopacity:0.92,\r\ntransform:t
\r\n
\r\n});
\r\n// create first transform to go beyond normal size var t1 =\r\nTitanium.UI.create2DMatrix(); t1 = t1.scale(1.1); var a =\r\nTitanium.UI.createAnimation(); a.transform = t1; a.duration =\r\n200;
\r\n// when this animation completes, scale to normal size\r\na.addEventListener('complete', function() {
\r\n\r\nTitanium.API.info('here in complete');\r\nvar t2 = Titanium.UI.create2DMatrix();\r\nt2 = t2.scale(1.0);\r\nw.animate({transform:t2, duration:200});
\r\n
\r\n});
\r\n// create a button to close window var b =\r\nTitanium.UI.createButton({
\r\n\r\ntitle:'Close',\r\nheight:30,\r\nwidth:150,\r\ntop:25
\r\n
\r\n}); w.add(b); b.addEventListener('click', function() {
\r\n\r\nvar t3 = Titanium.UI.create2DMatrix();\r\nt3 = t3.scale(0);\r\nw.close({transform:t3,duration:300});
\r\n
\r\n});
\r\n//create the scroll view
\r\nvar f =\r\nTitanium.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory,\r\n'info.txt');
\r\nvar contents = f.read();
\r\nvar creditsView = Titanium.UI.createScrollView({
\r\n\r\nbottom:20,\r\nheight:310,\r\nwidth:260,\r\ncontentWidth:'auto',\r\ncontentHeight:3000,\r\nbackgroundColor:'grey',\r\nshowVerticalScrollIndicator:true
\r\n
\r\n}); w.add(creditsView);
\r\nvar creditsLabel = Titanium.UI.createLabel({
\r\n\r\ntext:contents.text,\r\ncolor:'#ffffff'
\r\n
\r\n}); creditsView.add(creditsLabel);
\r\nw.open(a);
\r\n});
\r\nvar change = Titanium.UI.createLabel({
\r\nbottom:380, left:160, font:{fontSize:16, fontFamily:'Helvetica'},\r\ntext:'Change', color:'#ffffff' }); window.add(change);
var goldView = Ti.UI.createView({
\r\nheight:25, width:300, bottom:390, borderRadius:5,\r\nbackgroundGradient:{
\r\ntype:'linear',\r\ncolors:[{color:'#5b9dc7',position:0.0},{color:'#000000',position:1.0}]
\r\n
\r\n} }); window.add(goldView);
\r\nvar goldLabel = Titanium.UI.createLabel({
\r\ntext:'Gold', font:{fontSize:24}, color:'#ffffff', left:10 });\r\ngoldView.add(goldLabel);
goldView.addEventListener('click', function()
\r\n{ var w = Titanium.UI.createWindow({
\r\nheight:0,\r\nbackgroundColor:'#000',\r\nbottom:0,
\r\n
\r\n});
\r\nvar goldViewLabel = Titanium.UI.createLabel({
\r\n\r\ntext:'Gold',\r\nfont:{fontSize:30},\r\ncolor:'#ffffff',\r\nleft:10,\r\nbottom:360
\r\n
\r\n}); w.add(goldViewLabel);
\r\nvar goldCurrentLabel = Titanium.UI.createLabel({
\r\n\r\ntext:'Current Price',\r\nfont:{fontSize:24},\r\ncolor:'#ffffff',\r\nleft:10,\r\nbottom:275
\r\n
\r\n}); w.add(goldCurrentLabel);
\r\nvar goldChangeLabel = Titanium.UI.createLabel({
\r\n\r\ntext:'Price Change',\r\nfont:{fontSize:24},\r\ncolor:'#ffffff',\r\nleft:10,\r\ntop:30
\r\n
\r\n}); w.add(goldChangeLabel);
\r\n// create window open animation var a =\r\nTitanium.UI.createAnimation(); a.height = 440; a.duration =\r\n300;
\r\n// create a button to close window var b =\r\nTitanium.UI.createButton({
\r\n\r\ntitle:'Close',\r\nheight:30,\r\nwidth:150,\r\nbottom:20
\r\n
\r\n}); w.add(b); b.addEventListener('click', function() {
\r\n\r\na.height = 0;\r\nw.close(a);
\r\n
\r\n});
\r\n//TODO: var xml variables -> prices in this window
\r\nvar goldCurrentView = Titanium.UI.createView({
\r\n\r\ntop:100,\r\nheight:100,\r\nwidth:300,\r\nborderWidth:'2px',\r\nborderColor:'#1b1e19',\r\nborderRadius:10,\r\nbackgroundColor:'#000000'
\r\n
\r\n}); w.add(goldCurrentView);
\r\nvar goldCurrentLabel = Ti.UI.createLabel({
\r\n\r\nfont:{fontSize:50, fontFamily:'Courier-BoldOblique'},\r\ncolor:goldChangeColor,\r\nleft:10,\r\ntext:'$'+goldCurrentNumber
\r\n
\r\n}); goldCurrentView.add(goldCurrentLabel);
\r\nvar goldChangeView = Titanium.UI.createView({
\r\n\r\ntop:250,\r\nheight:100,\r\nwidth:300,\r\nborderWidth:'2px',\r\nborderColor:'#1b1e19',\r\nborderRadius:10,\r\nbackgroundColor:'#000000'
\r\n
\r\n}); w.add(goldChangeView);
\r\nvar goldChangeLabel = Ti.UI.createLabel({
\r\n\r\nfont:{fontSize:50, fontFamily:'Courier-BoldOblique'},\r\ncolor:goldChangeColor,\r\ntext:goldChangeNumber
\r\n
\r\n}); goldChangeView.add(goldChangeLabel);
\r\nvar timeLabel = Titanium.UI.createLabel({
\r\n\r\nfont:{fontSize:14},\r\nleft:10,\r\ntop:300,\r\ncolor:'#ffffff',\r\ntext:'Prices updated every 15 minutes'
\r\n
\r\n}); w.add(timeLabel);
\r\nw.open(a); });
\r\nvar silverView = Ti.UI.createView({
\r\nheight:25, width:300, bottom:335, borderRadius:5,\r\nbackgroundGradient:{
\r\ntype:'linear',\r\ncolors:[{color:'#6cac42',position:0.0},{color:'#000000',position:1.0}]
\r\n
\r\n} }); window.add(silverView);
\r\nsilverView.addEventListener('click', function()
\r\n{ var w = Titanium.UI.createWindow({
\r\nheight:0,\r\nbackgroundColor:'#000',\r\nbottom:0
\r\n
\r\n});
\r\nvar silverViewLabel = Titanium.UI.createLabel({
\r\n\r\ntext:'Silver',\r\nfont:{fontSize:30},\r\ncolor:'#ffffff',\r\nleft:10,\r\nbottom:360
\r\n
\r\n}); w.add(silverViewLabel);
\r\nvar silverCurrentLabel = Titanium.UI.createLabel({
\r\n\r\ntext:'Current Price',\r\nfont:{fontSize:24},\r\ncolor:'#ffffff',\r\nleft:10,\r\nbottom:275
\r\n
\r\n}); w.add(silverCurrentLabel);
\r\nvar silverChangeLabel = Titanium.UI.createLabel({
\r\n\r\ntext:'Price Change',\r\nfont:{fontSize:24},\r\ncolor:'#ffffff',\r\nleft:10,\r\ntop:30
\r\n
\r\n}); w.add(silverChangeLabel);
\r\n// create window open animation var a =\r\nTitanium.UI.createAnimation(); a.height = 440; a.duration =\r\n300;
\r\n// create a button to close window var b =\r\nTitanium.UI.createButton({
\r\n\r\ntitle:'Close',\r\nheight:30,\r\nwidth:150,\r\nbottom:20
\r\n
\r\n}); w.add(b); b.addEventListener('click', function() {
\r\n\r\na.height = 0;\r\nw.close(a);
\r\n
\r\n});
\r\n//TODO: var xml variables -> prices in this window
\r\nvar silverCurrentView = Titanium.UI.createView({
\r\n\r\ntop:100,\r\nheight:100,\r\nwidth:300,\r\nborderWidth:'2px',\r\nborderColor:'#1b1e19',\r\nborderRadius:10,\r\nbackgroundColor:'#000000'
\r\n
\r\n}); w.add(silverCurrentView);
\r\nvar silverCurrentLabel = Ti.UI.createLabel({
\r\n\r\nfont:{fontSize:50, fontFamily:'Courier-BoldOblique'},\r\ncolor:'green',\r\nleft:10,\r\ntext:'$'+silverCurrentNumber\r\n//text:'$'+'1101.31'
\r\n
\r\n}); silverCurrentView.add(silverCurrentLabel);
\r\nvar silverChangeView = Titanium.UI.createView({
\r\n\r\ntop:250,\r\nheight:100,\r\nwidth:300,\r\nborderWidth:'2px',\r\nborderColor:'#1b1e19',\r\nborderRadius:10,\r\nbackgroundColor:'#000000'
\r\n
\r\n}); w.add(silverChangeView);
\r\nvar silverChangeLabel = Ti.UI.createLabel({
\r\n\r\nfont:{fontSize:50, fontFamily:'Courier-BoldOblique'},\r\n//color:silverChangeColor,\r\ncolor:'green',\r\ntext:silverChangeNumber
\r\n
\r\n}); silverChangeView.add(silverChangeLabel);
\r\nvar timeLabel = Titanium.UI.createLabel({
\r\n\r\nfont:{fontSize:14},\r\nleft:10,\r\ntop:300,\r\ncolor:'#ffffff',\r\ntext:'Prices updated every 15 minutes'
\r\n
\r\n}); w.add(timeLabel);
\r\nw.open(a); });
\r\nvar silverLabel = Titanium.UI.createLabel({
\r\ntext:'Silver', font:{fontSize:24}, color:'#ffffff', left:10 });\r\nsilverView.add(silverLabel);
var platinumView = Titanium.UI.createView({
\r\nheight:25, width:300, bottom:280, borderRadius:5,\r\nbackgroundGradient:{
\r\ntype:'linear',\r\ncolors:[{color:'#9b3c41',position:0.0},{color:'#000000',position:1.0}]
\r\n
\r\n} }); window.add(platinumView);
\r\nplatinumView.addEventListener('click', function()
\r\n{ var w = Titanium.UI.createWindow({
\r\nheight:0,\r\nbackgroundColor:'#000',\r\nbottom:0
\r\n
\r\n});
\r\nvar platinumViewLabel = Titanium.UI.createLabel({
\r\n\r\ntext:'Platinum',\r\nfont:{fontSize:30},\r\ncolor:'#ffffff',\r\nleft:10,\r\nbottom:360
\r\n
\r\n}); w.add(platinumViewLabel);
\r\nvar platinumCurrentLabel = Titanium.UI.createLabel({
\r\n\r\ntext:'Current Price',\r\nfont:{fontSize:24},\r\ncolor:'#ffffff',\r\nleft:10,\r\nbottom:275
\r\n
\r\n}); w.add(platinumCurrentLabel);
\r\nvar platinumChangeLabel = Titanium.UI.createLabel({
\r\n\r\ntext:'Price Change',\r\nfont:{fontSize:24},\r\ncolor:'#ffffff',\r\nleft:10,\r\ntop:30
\r\n
\r\n}); w.add(platinumChangeLabel);
\r\n// create window open animation var a =\r\nTitanium.UI.createAnimation(); a.height = 440; a.duration =\r\n300;
\r\n// create a button to close window var b =\r\nTitanium.UI.createButton({
\r\n\r\ntitle:'Close',\r\nheight:30,\r\nwidth:150,\r\nbottom:20
\r\n
\r\n}); w.add(b); b.addEventListener('click', function() {
\r\n\r\na.height = 0;\r\nw.close(a);
\r\n
\r\n});
\r\n//TODO: var xml variables -> prices in this window
\r\nvar platinumCurrentView = Titanium.UI.createView({
\r\n\r\ntop:100,\r\nheight:100,\r\nwidth:300,\r\nborderWidth:'2px',\r\nborderColor:'#1b1e19',\r\nborderRadius:10,\r\nbackgroundColor:'#000000'
\r\n
\r\n}); w.add(platinumCurrentView);
\r\nvar platinumCurrentLabel = Ti.UI.createLabel({
\r\n\r\nfont:{fontSize:50, fontFamily:'Courier-BoldOblique'},\r\ncolor:platinumChangeColor,\r\nleft:10,\r\ntext:'$'+platinumCurrentNumber
\r\n
\r\n}); platinumCurrentView.add(platinumCurrentLabel);
\r\nvar platinumChangeView = Titanium.UI.createView({
\r\n\r\ntop:250,\r\nheight:100,\r\nwidth:300,\r\nborderWidth:'2px',\r\nborderColor:'#1b1e19',\r\nborderRadius:10,\r\nbackgroundColor:'#000000'
\r\n
\r\n}); w.add(platinumChangeView);
\r\nvar platinumChangeLabel = Ti.UI.createLabel({
\r\n\r\nfont:{fontSize:50, fontFamily:'Courier-BoldOblique'},\r\ncolor:platinumChangeColor,\r\ntext:platinumChangeNumber
\r\n
\r\n}); platinumChangeView.add(platinumChangeLabel);
\r\nvar timeLabel = Titanium.UI.createLabel({
\r\n\r\nfont:{fontSize:14},\r\nleft:10,\r\ntop:300,\r\ncolor:'#ffffff',\r\ntext:'Prices updated every 15 minutes'
\r\n
\r\n}); w.add(timeLabel);
\r\nw.open(a); });
\r\nvar platinumLabel = Titanium.UI.createLabel({
\r\ntext:'Platinum', font:{fontSize:24}, color:'#ffffff', left:10 });\r\nplatinumView.add(platinumLabel);
var palladiumView = Titanium.UI.createView({
\r\nheight:25, width:300, bottom:225, borderRadius:5,\r\nbackgroundGradient:{
\r\ntype:'linear',\r\ncolors:[{color:'#e26820',position:0.0},{color:'#000000',position:1.0}]
\r\n
\r\n} }); window.add(palladiumView);
\r\npalladiumView.addEventListener('click', function()
\r\n{ var w = Titanium.UI.createWindow({
\r\nheight:0,\r\nbackgroundColor:'#000',\r\nbottom:0
\r\n
\r\n});
\r\nvar palladiumViewLabel = Titanium.UI.createLabel({
\r\n\r\ntext:'Palladium',\r\nfont:{fontSize:30},\r\ncolor:'#ffffff',\r\nleft:10,\r\nbottom:360
\r\n
\r\n}); w.add(palladiumViewLabel);
\r\nvar palladiumCurrentLabel = Titanium.UI.createLabel({
\r\n\r\ntext:'Current Price',\r\nfont:{fontSize:24},\r\ncolor:'#ffffff',\r\nleft:10,\r\nbottom:275
\r\n
\r\n}); w.add(palladiumCurrentLabel);
\r\nvar palladiumChangeLabel = Titanium.UI.createLabel({
\r\n\r\ntext:'Price Change',\r\nfont:{fontSize:24},\r\ncolor:'#ffffff',\r\nleft:10,\r\ntop:30
\r\n
\r\n}); w.add(palladiumChangeLabel);
\r\n// create window open animation var a =\r\nTitanium.UI.createAnimation(); a.height = 440; a.duration =\r\n300;
\r\n// create a button to close window var b =\r\nTitanium.UI.createButton({
\r\n\r\ntitle:'Close',\r\nheight:30,\r\nwidth:150,\r\nbottom:20
\r\n
\r\n}); w.add(b); b.addEventListener('click', function() {
\r\n\r\na.height = 0;\r\nw.close(a);
\r\n
\r\n});
\r\n//TODO: var xml variables -> prices in this window
\r\nvar palladiumCurrentView = Titanium.UI.createView({
\r\n\r\ntop:100,\r\nheight:100,\r\nwidth:300,\r\nborderWidth:'2px',\r\nborderColor:'#1b1e19',\r\nborderRadius:10,\r\nbackgroundColor:'#000000'
\r\n
\r\n}); w.add(palladiumCurrentView);
\r\nvar palladiumCurrentLabel = Ti.UI.createLabel({
\r\n\r\nfont:{fontSize:50, fontFamily:'Courier-BoldOblique'},\r\ncolor:palladiumChangeColor,\r\nleft:10,\r\ntext:'$'+palladiumCurrentNumber
\r\n
\r\n}); palladiumCurrentView.add(palladiumCurrentLabel);
\r\nvar palladiumChangeView = Titanium.UI.createView({
\r\n\r\ntop:250,\r\nheight:100,\r\nwidth:300,\r\nborderWidth:'2px',\r\nborderColor:'#1b1e19',\r\nborderRadius:10,\r\nbackgroundColor:'#000000'
\r\n
\r\n}); w.add(palladiumChangeView);
\r\nvar palladiumChangeLabel = Ti.UI.createLabel({
\r\n\r\nfont:{fontSize:50, fontFamily:'Courier-BoldOblique'},\r\ncolor:palladiumChangeColor,\r\ntext:palladiumChangeNumber
\r\n
\r\n}); palladiumChangeView.add(palladiumChangeLabel);
\r\nvar timeLabel = Titanium.UI.createLabel({
\r\n\r\nfont:{fontSize:14},\r\nleft:10,\r\ntop:300,\r\ncolor:'#ffffff',\r\ntext:'Prices updated every 15 minutes'
\r\n
\r\n}); w.add(timeLabel);
\r\nw.open(a); });
\r\nvar palladiumLabel = Titanium.UI.createLabel({
\r\ntext:'Palladium', font:{fontSize:24}, color:'#ffffff', left:10 });\r\npalladiumView.add(palladiumLabel);
var news = Titanium.UI.createWebView({
\r\nurl:\"http://hayekinstitute.ca/kitcoiphone/kitco.php\",\r\nbottom:0,\r\nheight:160,\r\nwidth:320,\r\nborderRadius:10,\r\nbackgroundColor:'#99b7e9'
\r\n
\r\n});
\r\nnews.addEventListener('click',function(e){
\r\nTi.Platform.openURL(e.source.url);
\r\n
\r\n});
\r\nwindow.add(news);
\r\nwindow.open({
\r\nfullscreen:true, modal:true });