Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11639] Blackberry: Window Management

GitHub Issuen/a
TypeStory
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-11-12T20:33:08.000+0000
Affected Version/sn/a
Fix Version/sRelease 3.1.0, 2012 Sprint 23, BB Preview 3
ComponentsBlackBerry
Labelsn/a
ReporterJosh Roesslein
AssigneeJosh Roesslein
Created2012-11-01T21:20:58.000+0000
Updated2017-03-08T18:26:57.000+0000

Description

As a developer, I need the ability to create windows and present them onto a scene so that they can be positioned, sized, and drawn onto the display.

Comments

  1. Josh Roesslein 2012-11-12

    Acceptance Test

    1. Run application. 2. A series of windows should open. First blue, then red, and finally green. 3. For each window as they open the following events should fire in order: "open", "focus", "blur" (last window to open should remain focused) 4. Once all windows are open they should begin to close. First green, then red, and finally blue. 5. For each window as they close the following events should fire in order: "focus" (exclude first window which is focused already), "blur", "close"
       var colors = ['blue', 'red', 'green'],
           windows = [];
       
       function openNextWindow() {
       	Ti.API.info('opening next...');
       
       	var color = colors.pop();
       	if (!color) {
       		clearInterval(interval);
       		interval = setInterval(closeNextWindow, 2000);
       		return;
       	}
       
       	var win = Ti.UI.createWindow();
       
       	win.addEventListener('open', function() {
       		Ti.API.info(color + ' window opened');
       	});
       	win.addEventListener('focus', function() {
       		Ti.API.info(color + ' window focused');
       	});
       	win.addEventListener('blur', function() {
       		Ti.API.info(color + ' window blurred');
       	});
       	win.addEventListener('close', function() {
       		Ti.API.info(color + ' window closed');
       	});
       
       	win.add(Ti.UI.createView({backgroundColor: color, width: 500, height: 500}));
       	win.open();
       	windows.push(win);
       }
       
       function closeNextWindow() {
       	Ti.API.info('closing next...');
       
       	var win = windows.pop();
       	if (!win) {
       		clearInterval(interval);
       		return;
       	}
       
       	win.close();
       }
       
       var interval = setInterval(openNextWindow, 2000);
       
  2. Lee Morris 2017-03-08

    Closing ticket as resolved.

JSON Source