Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9262] Android: We need focus and blur events in the lightweight windows

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-05-24T16:11:22.000+0000
Affected Version/sRelease 2.1.0
Fix Version/sRelease 2.1.0, Sprint 2012-10 API
ComponentsAndroid
Labelsapi, qe-testadded
ReporterMauro Parra-Miranda
AssigneeNeeraj Gupta
Created2012-05-24T14:33:11.000+0000
Updated2013-12-10T06:16:43.000+0000

Description

Feature Request

Customer is using a mix of lightweight and heavyweight windows. They want to get the same behavior on lightweight windows when blur and focus, as it happens in heavyweight windows.

Test case

var win1 = Ti.UI.createWindow(
	{backgroundColor:'white',}
	//{fullscreen: false}
	);
var button1 = Ti.UI.createButton();
button1.addEventListener('click', function() {
    var win2 = Ti.UI.createWindow(
    		{backgroundColor:'black',}
    	//{fullscreen: false}
    );
    win2.addEventListener('focus', function() {
        Ti.API.info("win2 focused");
    });
    win2.addEventListener('blur', function() {
        Ti.API.info("win2 blur");
    });
    win2.open();
});
 
win1.add(button1);
win1.addEventListener('focus', function() {
    Ti.API.info("win1 focused");
});
win1.addEventListener('blur', function() {
    Ti.API.info("win1 blur");
});
win1.open();

Comments

  1. Mauro Parra-Miranda 2012-05-24

    Tested this with today's build, working fine. Testcase:
       var win1 = Ti.UI.createWindow({
       	backgroundColor:'white',
       });
       var button1 = Ti.UI.createButton();
       button1.addEventListener('click', function() {
       	var button2 = Ti.UI.createButton();
       	button2.addEventListener('click',function(){
       		win2.close();
       	}); 
           var win2 = Ti.UI.createWindow({
           	backgroundColor:'black',
           });
           win2.addEventListener('focus', function() {
               Ti.API.info("win2 focused");
           });
           win2.addEventListener('blur', function() {
               Ti.API.info("win2 blur");
           });
           win2.add(button2);
           win2.open();
           
       });
        
       
       win1.add(button1);
       win1.addEventListener('focus', function() {
           Ti.API.info("win1 focused");
       });
       win1.addEventListener('blur', function() {
           Ti.API.info("win1 blur");
       });
       win1.open();
       
  2. Dustin Hyde 2012-06-05

    Closing as Fixed. Verified via steps in comments. SDK: 2.1.0.v20120605140359 Studio: 2.1.0.201206041625 OS: Snow Leopard Android: V8 Devices Tested: Nexus One 2.2.2, Nexus S 4.0.4
  3. Shameer Jan 2013-12-10

    Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/4967

JSON Source