Macadamian/titanium_mobile — pull request #129 by Harutyun (2012-08-09 11:49:33+00:00)
Title:  TIMOB-10224: Blackberry: Implement startLayout, finishLayout, updateLayout methods

Reviewer: Alex

ChangeLog:
- implemented startLayout, finishLayout and updateLayout functiones for UI.View

Test Cases:
- make sure you can successfully build tibb and tibbte
- run the above snippet of code and make sure startLayout, finishLayout and updateLayout working as expected.

properties

var win1 = Titanium.UI.createWindow({
backgroundColor:'#F00'
});

var view = Titanium.UI.createView({
top: 0,
left: 0,
width: 200
});

var label1 = Ti.UI.createLabel({
text: 'Label Demo'
});

view.add(label1);

win1.add(view);

var mybutton=Ti.UI.createButton
(
{top: 100,title: 'get Width'}
);

mybutton.addEventListener
(
'click',
function(e)
{
label1.text = view.getLeft();
}
);

var button1=Ti.UI.createButton
(
{top: 200,title: 'Start Layout'}
);

button1.addEventListener
(
'click',
function(e)
{
view.startLayout();
view.left = 400;
view.top = 200;
}
);

var button2=Ti.UI.createButton
(
{top: 300,title: 'Finish Layout'}
);

button2.addEventListener
(
'click',
function(e)
{
view.finishLayout();
}
);

var button3=Ti.UI.createButton
(
{top: 400,title: 'Update Layout'}
);

button3.addEventListener
(
'click',
function(e)
{
view.updateLayout({top:500, left:100});
}
);

win1.add(mybutton);
win1.add(button1);
win1.add(button2);
win1.add(button3);
win1.open();