Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14336] BlackBerry : Layout messes up when a label is added using a click event after the device orientation is changed to portrait from faceup or landscape

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-07-30T00:04:23.000+0000
Affected Version/sRelease 3.1.2
Fix Version/s2013 Sprint 13, 2013 Sprint 15 API, 2013 Sprint 15, Release 3.1.2, Release 3.2.0
ComponentsBlackBerry
Labelsmodule_layout, qe-3.1.2, qe-nfc, qe-testadded, sdk-bb
ReporterLokesh Choudhary
AssigneeRussell McMahon
Created2013-06-21T18:42:26.000+0000
Updated2014-06-19T12:43:35.000+0000

Description

Note : Make sure you have orientation enabled in tiapp.xml & the device is not in portrait mode initially, it can be in faceup or landscape mode Description: 1. Create an app with the code below:

var win = Ti.UI.createWindow({
	title:'Network Test',
	layout:'vertical'
});

var button = Ti.UI.createButton({
	title:'Click for network test',
	top: 50,
	width:Ti.UI.SIZE,
	height:Ti.UI.SIZE

});

button.addEventListener('click',function(e){
	
var socket = Ti.Network.Socket.createUDP();
socket.addEventListener('started', function (e) {
Ti.API.info('Socket started');
});
socket.addEventListener('data', function (e) {
Ti.API.info('Socket received data: '+e.stringData);
Ti.API.info('bytes: '+e.bytesData);
Ti.API.info('address: '+e.address);
Ti.API.info('port: '+e.port);
});
socket.addEventListener('error',function (e) {
Ti.API.info('Socket error: '+e);
});
socket.start({ port: 6100 });

for (var i = 0; i < 5; ++i) {
  socket.sendString({ data: "Hello, World!"});
  socket.sendBytes({ data: [73, 116, 32, 119, 111, 114, 107, 115, 33] });
}

var lbl = Ti.UI.createLabel({
	text:'Please check console for logs',
	color:'red',
	textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,
	top:30
});

win.add(lbl);	
	
});



win.add(button);
win.open();
Senario 1: ----------- 2. Build & run for BB device/emulator 3. After the app is launched make sure it is faceup mode 4. Click on the 'click for network test button' 5. Observe the behavior 6. Close the app & launch it again 7. Now put the device in portrait mode 8. Click on the 'click for network test button' 9. Observe the behavior Actual result: ----------------- 1. At step 5 above : After clicking the button the layout shifts to the right & adds a label 2. At step 9 above : After clicking the button it works as expected Expected Result: ----------------- 1. At step 5 above : After clicking the button the layout should not shift to the right Senario 2: ----------- 2. Build & run for BB device/emulator 3. After the app is launched make sure it is in landscape mode 4. Click on the 'click for network test button' 5. Observe the behavior 6. Close the app & launch it again 7. Now put the device in portrait mode 8. Click on the 'click for network test button' 9. Observe the behavior Actual result: ---------------- 1. At step 5 above : After clicking the button it works as expected 2. At step 9 above : After clicking the button the layout shifts to the right & adds a label Expected Result: ------------------ 1. At step 9 above : After clicking the button the layout should not shift to the right

Comments

  1. Lokesh Choudhary 2013-06-25

    Verified the fix & now adding the label from an event listener does not shift the layout to the right. Environment: Ti Studio : 3.1.1.201306112235 Ti BB SDK : 3.2.0.v20130625113003 Mac OSX : 10.8.4 Alloy : 1.1.3 CLI - 3.1.1 win 7 Win 8 Z10 BB simulator : 10.0.10.822 Z10 device running 10.0.10.88
  2. Priya Agarwal 2013-07-22

    Closing as Fixed. Verified with Environment: Studio: 3.1.2.201307191853 Titanium SDK:3.1.2.v20130718094558 acs:1.0.3 alloy:1.1.3 npm:1.3.2 titanium:3.1.1 titanium-code-processor:1.0.1 OS: OSX 10.8 Device:Blackberry-Z10(v 10.0.10.261) Blackberry SDK: 10.1.0.1020 Label layout does not messes up on orientation change.
  3. Priya Agarwal 2013-07-22

    Reopening. Verified with Environment: Studio: 3.1.2.201307191853 Titanium SDK:3.1.2.v20130718094558 acs:1.0.3 alloy:1.1.3 npm:1.3.2 titanium:3.1.1 titanium-code-processor:1.0.1 OS: OSX 10.8 Device:Blackberry-Z10(v 10.0.10.261) Blackberry SDK: 10.1.0.1020 App works fine in scenario 2 as described in the bug. But still label layout shifts to right on being added when button is clicked when device in face up mode.
  4. Lokesh Choudhary 2013-07-30

    Verified the fix & now adding the label from an event listener does not shift the layout to the right. Environment: Ti Studio : 3.1.1.201306112235 Ti BB SDK : 3.1.2.v20130726192706 Mac OSX : 10.8.4 Alloy : 1.20-alpha CLI - 3.1.1 win 7 Win 8 Z10 BB simulator : 10.0.10.822 Z10 device running 10.0.10.88

JSON Source