Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14751] Android: Modal window is not getting closed

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-08-02T22:09:57.000+0000
Affected Version/sRelease 3.1.2
Fix Version/s2013 Sprint 16, 2013 Sprint 16 API, Release 3.1.2, Release 3.2.0
ComponentsAndroid
Labelsmodule_window, qe-3.1.2, qe-closed-3.1.2, qe-testadded, regression
ReporterDhirendra Jha
AssigneeIngo Muschenetz
Created2013-08-02T09:16:28.000+0000
Updated2013-09-19T21:26:02.000+0000

Description

Note - This is a regression. Issue is not reproducible in 3.1.1.GA build. Steps - 1. Run the below app. 2. Press the "Press me" button. A new modal window is displayed. 3. Press the "close" button. Actual Result - Does not happen anything. It seems that Close button is not tappable. Expected Result - On Close button, model window should close. Note - In the below code, there are two win.open() methods. Above code is working fine in 3.1.1.GA build and it fails in 3.1.2.v20130801190110 build. If we remove one win.open() method then the same code works fine in 3.1.1.GA and 3.1.2.v20130801190110 build. Please confirm the correct behavior according to new window architecture change for Android.
var _window = Ti.UI.createWindow({
	backgroundColor: 'white',
});
		
var button = Ti.UI.createButton({
	title : 'Press me'
});
button.addEventListener('click', function() {
	var button2 = Ti.UI.createButton({
	title : 'close'
});
	var win = Ti.UI.createWindow({
	modal : true,
	backgroundColor : '#c96'
	});
	button2.addEventListener('click', function() {
		win.close();
	});
	win.add(button2);
	win.open();
	win.open();
});
_window.add(button);
_window.open();

Comments

  1. Hieu Pham 2013-08-02

    Additional test case:
       var win = Ti.UI.createWindow({backgroundColor: 'red'});
       var tab = Ti.UI.createTab({window: win, title: "Tab1"});
       var tabgroup = Ti.UI.createTabGroup();
       var actionbar;
       tabgroup.addTab(tab);
       
       var button = Ti.UI.createButton({title: 'list'});
       
       
       win.add(button);
       
       tabgroup.open();
       tabgroup.open();
       
    1. Run code. 2. Should see a tabgroup, but instead it crashes.
  2. Ping Wang 2013-08-02

    PR: https://github.com/appcelerator/titanium_mobile/pull/4531
  3. Hieu Pham 2013-08-02

    master PR: https://github.com/appcelerator/titanium_mobile/pull/4531
  4. Ping Wang 2013-08-02

    3_1_X PR: https://github.com/appcelerator/titanium_mobile/pull/4535
  5. Olga Romero 2013-08-06

    Tested above code and verified correct behavior with: Appcelerator Studio, build: 3.1.2.201308021524 Titanium SDK, build: 3.1.2.v20130806104555 Alloy 1.2.0-alpha6 CLI: 3.1.2-alpha Devices: Nexus7(2) Android version 4.3 GalaxyS3 Android version 4.0.4

JSON Source