Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updating based on platform changes for 2.0.0.GA

  • Loading branch information...
commit c5c8046bf66cba9e6e1683edc61d037b10932cb3 1 parent 634b7c1
@marshall marshall authored
View
2  Resources/examples/activity_indicator.js
@@ -7,7 +7,7 @@ win.backgroundColor = '#13386c';
var actInd = Titanium.UI.createActivityIndicator({
bottom:10,
height:50,
- width:10,
+ width:50,
style:Titanium.UI.iPhone.ActivityIndicatorStyle.PLAIN
});
View
4 Resources/examples/animation_points.js
@@ -34,7 +34,9 @@ var b = Ti.UI.createButton({
win.add(b);
b.addEventListener('click', function()
{
- circle.animate({center:{x:circle.animatedCenter.x,y:circle.animatedCenter.y }});
+ var newLeft = circle.animatedCenter.x - circle.width/2;
+ var newTop = circle.animatedCenter.y - circle.height/2;
+ circle.animate({left:newLeft,top:newTop});
});
circle.animate(a, function()
{
View
6 Resources/examples/basic_animation.js
@@ -25,9 +25,9 @@ win.add(label);
circle.addEventListener('touchmove', function(e)
{
Ti.API.debug('Our event tells us the center is ' + e.x + ', ' + e.y );
- var newX = e.x + circle.animatedCenter.x - circle.width/2;
- var newY = e.y + circle.animatedCenter.y - circle.height/2;
- circle.animate({center:{x:newX,y:newY}, duration:1});
+ var newX = e.x + circle.animatedCenter.x - circle.width;
+ var newY = e.y + circle.animatedCenter.y - circle.height;
+ circle.animate({left:newX,top:newY, duration:1});
});
var mode = 0;
View
21 Resources/examples/contacts_add.js
@@ -23,7 +23,8 @@ var f1 = Ti.UI.createTextField({
borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
top:0,
right:0,
- width:200
+ width:200,
+ height:30
});
v1.add(l1);
v1.add(f1);
@@ -44,7 +45,8 @@ var f2 = Ti.UI.createTextField({
borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
top:0,
right:0,
- width:200
+ width:200,
+ height:30
});
v2.add(l2);
v2.add(f2);
@@ -65,7 +67,8 @@ var f3 = Ti.UI.createTextField({
borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
top:0,
right:0,
- width:200
+ width:200,
+ height:30
});
v3.add(l3);
v3.add(f3);
@@ -86,7 +89,8 @@ var f4 = Ti.UI.createTextField({
borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
top:0,
right:0,
- width:200
+ width:200,
+ height:30
});
v4.add(l4);
v4.add(f4);
@@ -107,7 +111,8 @@ var f5 = Ti.UI.createTextField({
borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
top:0,
right:0,
- width:200
+ width:200,
+ height:30
});
v5.add(l5);
v5.add(f5);
@@ -128,7 +133,8 @@ var f6 = Ti.UI.createTextField({
borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
top:0,
right:0,
- width:200
+ width:200,
+ height:30
});
v6.add(l6);
v6.add(f6);
@@ -148,7 +154,8 @@ var f7 = Ti.UI.createTextField({
borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
top:0,
right:0,
- width:200
+ width:200,
+ height:30
});
v7.add(l7);
v7.add(f7);
View
3  Resources/examples/image_view_scaling.js
@@ -3,7 +3,8 @@ var TIMEOUT_SECS = 2;
var imageView = Titanium.UI.createImageView({
image:'http://www.appcelerator.com/wp-content/uploads/2009/06/titanium_desk.png',
- width: 325
+ width: 325,
+ height:"fill"
});
win.add(imageView);
View
42 Resources/examples/options_dialog.js
@@ -138,7 +138,6 @@ if (isAndroid) {
});
}
-
win.add(button1);
win.add(button2);
win.add(label);
@@ -146,4 +145,43 @@ win.add(label);
if (isAndroid) {
win.add(showCancel);
win.add(button3);
-}
+}
+
+if (!isAndroid) {
+ var button4 = Titanium.UI.createButton({
+ title:'Show w/hide, animated',
+ height:40,
+ width:200,
+ top:250
+ });
+
+ button4.addEventListener('click', function()
+ {
+ if (isAndroid) {
+ dialog.androidView = null;
+ applyButtons();
+ }
+ dialog.show();
+ setTimeout(function(){dialog.hide({animated:true});},2000);
+ });
+
+ var button5 = Titanium.UI.createButton({
+ title:'Show w/hide, nonanimated',
+ height:40,
+ width:200,
+ top:300
+ });
+
+ button5.addEventListener('click', function()
+ {
+ if (isAndroid) {
+ dialog.androidView = null;
+ applyButtons();
+ }
+ dialog.show();
+ setTimeout(function(){dialog.hide({animated:false});},2000);
+ });
+
+ win.add(button4);
+ win.add(button5);
+}
View
3  Resources/examples/push_notification.js
@@ -14,7 +14,8 @@ Titanium.Network.registerForPushNotifications({
types: [
Titanium.Network.NOTIFICATION_TYPE_BADGE,
Titanium.Network.NOTIFICATION_TYPE_ALERT,
- Titanium.Network.NOTIFICATION_TYPE_SOUND
+ Titanium.Network.NOTIFICATION_TYPE_SOUND,
+ Titanium.Network.NOTIFICATION_TYPE_NEWSSTAND
],
success:function(e)
{
View
8 Resources/examples/scroll_views_without_clipping.js
@@ -99,10 +99,6 @@ var tableview3 = Titanium.UI.createTableView({
});
-win.add(tableview);
-win.add(tableview2);
-win.add(tableview3);
-
var image1 = tableview.toImage();
var image2 = tableview2.toImage();
var image3 = tableview3.toImage();
@@ -115,6 +111,10 @@ tableview.visible = false;
tableview2.visible = false;
tableview3.visible = false;
+win.add(tableview);
+win.add(tableview2);
+win.add(tableview3);
+
var scrollView = Titanium.UI.createScrollableView({
views:[iv1,iv2,iv3],
showPagingControl:true,
View
2  Resources/examples/table_view_update_row_objects.js
@@ -10,7 +10,7 @@ function setData()
for (var i=0;i<30;i++)
{
var row = Ti.UI.createTableViewRow({height:50});
- var l1 = Ti.UI.createLabel({text:'Label ' + i, font:{fontSize:14}, color:'#888', left:5});
+ var l1 = Ti.UI.createLabel({text:'Label ' + i, font:{fontSize:14}, color:'#888', left:5, width:Ti.UI.FILL});
row.add(l1);
var image1 = Ti.UI.createImageView({image:'../images/chat.png', right:5,height:23, width:29});
row.add(image1);
View
2  Resources/examples/vertical_layout_basic.js
@@ -9,7 +9,7 @@ header.add(headerLabel);
win.add(header);
// BODY
-var body = Ti.UI.createView({height:'auto', layout:'vertical', backgroundColor:'#fff'});
+var body = Ti.UI.createView({height:Ti.UI.SIZE, layout:'vertical', backgroundColor:'#fff'});
var bodyView1 = Ti.UI.createView({backgroundColor:'#336699', height:100, left:10, right:10});
var bodyView2 = Ti.UI.createView({backgroundColor:'#ff0000', height:50, left:10, right:10, top:10});
View
11 Resources/examples/view_with_size.js
@@ -4,10 +4,8 @@ var win = Ti.UI.currentWindow;
// center of the screen by using the size property to set it
var view = Ti.UI.createView({
- size:{
- width:100,
- height:100
- },
+ width:100,
+ height:100,
backgroundColor:"red"
});
@@ -34,6 +32,9 @@ var button = Ti.UI.createButton({
win.add(button);
button.addEventListener('click',function() {
- view.size = {width:150,height:150};
+ view.updateLayout({
+ width:150,
+ height:150
+ });
label.text = "Box should now be 150x150";
});
View
2  Resources/examples/views.js
@@ -12,7 +12,7 @@ var data = [
{title:'zIndex', hasChild:true, test:'../examples/views_zindex.js'},
{title:'Email Dialog', hasChild:true, test:'../examples/email_dialog.js'},
{title:'Map View', hasChild:true, test:'../examples/map_view.js'},
- {title:'View w/ Size', hasChild:true, test:'../examples/view_with_size.js'},
+ {title:'View updateLayout', hasChild:true, test:'../examples/view_with_size.js'},
{title:'Point Conversion', hasChild:true, test:'../examples/view_point_conversion.js'}
];
View
4 Resources/examples/views_auto_height.js
@@ -4,7 +4,7 @@ win.backgroundColor = '#336699';
var commentTextWrap = Ti.UI.createView({
backgroundColor: '#fff',
borderRadius: 12,
- height: 'auto',
+ height: Ti.UI.SIZE,
width: 300,
top: 10
});
@@ -13,7 +13,7 @@ var commentText = Ti.UI.createLabel({
text: "My containing view should only be as large as I am ",
font: {fontSize: 12},
width: 280,
- height:'auto',
+ height:Ti.UI.SIZE,
top: 10
});
View
10 Resources/examples/web_views.js
@@ -69,7 +69,7 @@ tableview.addEventListener('click', function(e)
if (rowdata.auto === true)
{
- webview = Ti.UI.createWebView({height:'auto',width:'auto'});
+ webview = Ti.UI.createWebView({height:Ti.UI.SIZE,width:Ti.UI.SIZE});
}
else
{
@@ -99,13 +99,9 @@ tableview.addEventListener('click', function(e)
var baseURL = 'http://www.google.com';
xhr.onload = function()
{
- if (Titanium.Platform.name != 'android') { // TIMOB-7840
- webview.setHtml(this.responseText, { baseURL: baseURL });
- } else {
- webview.html = this.responseText;
- }
+ webview.setHtml(this.responseText, { baseURL: baseURL });
};
-
+
// open the client
xhr.open('GET',baseURL);
Please sign in to comment.
Something went wrong with that request. Please try again.