[TIMOB-11269] Kitchen sink:Base UI:Window Properties->Toggling height/width changing opacity of window
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | High |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2013-07-26T11:15:21.000+0000 |
| Affected Version/s | Release 3.0.0 |
| Fix Version/s | Release 3.0.2, Release 3.1.0, 2012 Sprint 26 API, 2012 Sprint 26 |
| Components | Android |
| Labels | KitchenSink, api, qe-and100112, qe-testadded |
| Reporter | Shyam Bhadauria |
| Assignee | Karl Rowley |
| Created | 2012-10-05T06:17:10.000+0000 |
| Updated | 2014-06-19T12:43:34.000+0000 |
Description
This is not a regression. It exists as far as 2.0.1.
Toggle height/width changes opacity of window from transparent to opaque. Even if it is resetting it, then it should not take 2 clicks to make it transparent again.
Steps to reproduce:
1) Install the refactored kitchen sink on android device and run it.
2) Go to Base UI -> Window Properties
3) Now press 'Toggle Opacity'.
4) Press button 'Toggle Height/Width' twice.
5) Now press 'Toggle Opacity'.
Expected result:
1) The app should run successfully over device.
2) It should display 5 buttons to perform window actions.
3) It should change the opacity of the window to transparent.
4) It should resize the window to a smaller size (300*300) and then again to full screen size with a black background.
5) It should change the opacity of the window to transparent in single click.
Actual result:
1) The app runs successfully over device.
2) It displays 5 buttons to perform window actions.
3) It changes the opacity of the window to transparent.
4) It resizes the window to a smaller size (300*300) and then again to full screen size with a black background.
5) It do changes the opacity of the window to transparent on a single click. Even though it is opaque, it takes 2 clicks to turn screen transparent.
Pull request https://github.com/appcelerator/titanium_mobile/pull/3582
Here's the Kitchen Sink test case adapted for a lightweight window:
// current window var win = Titanium.UI.createWindow(); // // BACKGROUND COLOR // var button = Titanium.UI.createButton({ title:'Change BG Color', width:220, height:40, top:10 }); button.addEventListener('click', function() { win.backgroundImage = null; win.backgroundColor = '#336699'; }); win.add(button); // // BACKGROUND IMAGE // var buttonImage = Titanium.UI.createButton({ title:'Change BG Image', width:220, height:40, top:60 }); buttonImage.addEventListener('click', function() { win.backgroundImage = '/images/bg.png'; }); win.add(buttonImage); // // TOGGLE WIDTH AND HEIGHT // var buttonWidthHeight = Titanium.UI.createButton({ title:'Toggle Height/Width', width:220, height:40, top:110 }); var full=true; buttonWidthHeight.addEventListener('click', function() { Ti.API.info('in width height'); if (full) { win.height = 300; win.width = 300; win.backgroundColor = 'black'; full=false; } else { // unset them to go back to previous layout win.height = null; win.width = null; win.backgroundColor = null; full=true; } }); win.add(buttonWidthHeight); // // TOGGLE OPACITY PROPERTY // var buttonOpacity = Titanium.UI.createButton({ title:'Toggle Opacity', width:220, height:40, top:160 }); var opacity=true; buttonOpacity.addEventListener('click', function() { if (opacity) { win.opacity = 0.7; opacity=false; } else { win.opacity = 1.0; opacity=true; } }); win.add(buttonOpacity); // // LAYOUT AND DIMENSION PROPERTIES // var buttonLayout = Titanium.UI.createButton({ title:'Layout/Dimension Properties', width:220, height:40, top:210 }); var layout=true; var win1 = null; var win2 = null; buttonLayout.addEventListener('click', function() { if (layout) { win1 = Titanium.UI.createWindow({ height:50, width:200, bottom:50, left:10, backgroundColor:'#336699', borderRadius:10, zIndex:3 }); win2 = Titanium.UI.createWindow({ height:50, width:200, bottom:60, left:20, backgroundColor:'pink', borderRadius:10, zIndex:1 }); win1.open(); win2.open(); layout=false; win.addEventListener('close', function() { win1.close(); win2.close(); layout=true; }); } else { win1.close(); win2.close(); layout=true; } }); win.add(buttonLayout); // // TOGGLE BORDER PROPERTIES // var buttonBorder = Titanium.UI.createButton({ title:'Toggle Border Properties', width:220, height:40, top:260 }); var border=true; buttonBorder.addEventListener('click', function() { if (border) { win.borderWidth = 5; win.borderColor = '#999'; win.borderRadius = 10; border=false; } else { win.borderWidth = 0; win.borderColor = null; win.borderRadius = 0; border=true; } }); // add iphone specific tests if (Titanium.Platform.name == 'iPhone OS') { win.add(buttonBorder); } win.open();Backport task TIMOB-12301 Backport PR https://github.com/appcelerator/titanium_mobile/pull/3720
Closing as fixed. Tested and verified with: Titanium Studio, build: 3.0.1.201212181159 Titanium SDK, build: 3.0.2.v20130123121656 Titanium Studio, build: 3.1.0.v20130123144204 NexusS3 4.0.4 iPhone4S 5.0.1
Reopening to update label
Updated Label. Closing as Fixed. Verified with Environment: Studio: 3.1.1.201306131423 SDK: 3.1.2.v20130725180746 acs:1.0.3 alloy:1.1.3 npm:1.2.14 titanium:3.1.1 titanium-code-processor:1.0.1 OS: OSX 10.8 Device: HTC Desire(v4.0.3),ipad mini(v6.0)