Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. 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

    Details

      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

        Attachments

          Activity

            People

            • Assignee:
              rmcmahon Russell McMahon
              Reporter:
              lokeshchdhry Lokesh Choudhary (Inactive)
              Reviewer:
              Pedro Enrique (Inactive)
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-16820
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code