Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11020] Android: In 2.1.3 RC if borderWidth is used, show/hide on the border does not work and all views added on top will be hidden behind the border

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-09-20T17:09:05.000+0000
Affected Version/sRelease 2.1.3
Fix Version/sRelease 2.1.3, Release 3.0.0, Sprint 2012-19 Core, 2012 Sprint 19
ComponentsAndroid
LabelsSupportTeam, core, qe-testadded
ReporterVarun Joshi
AssigneeAllen Yeung
Created2012-09-20T09:30:49.000+0000
Updated2013-10-07T10:44:45.000+0000

Description

Issue

In 2.1.3.v201209151203192.1.3 RC, on Android: 1. If borderWidth is used the border cannot be hidden using the show()/hide() view functions. 2. Also, any view placed on top of the view that has borderWidth set will be hidden from the view.

Steps to Reproduce

1. Run the code below in 2.1.2GA, notice the red dot in the center of the circle. Tap the hello button to see the View appear and disappear. 2. Using 2.1.3.v20120915120319, notice that there is no red circle, and tapping the button does nothing. {noformat} var win = Ti.UI.createWindow({ backgroundColor : 'white' }); win.open(); var self = Ti.UI.createView(); win.add(self); var loadingIndicatorView = Ti.UI.createView({ backgroundColor : 'black', borderColor : 'black', borderWidth : 52, opacity : .6, top : 5, width : 52, height : 52, borderRadius : 52, zIndex : 1, }); var smallView = Ti.UI.createView({ width : 10, height : 10, backgroundColor : 'red' }); loadingIndicatorView.add(smallView); self.add(loadingIndicatorView); loadingIndicatorView.show(); var button = Ti.UI.createButton({ title : 'Hello', width : 200, height : 100, top : 250 }); var show = false; self.add(button); button.addEventListener('click', function(e) { if (show) { loadingIndicatorView.show(); show = false; } else { show = true loadingIndicatorView.hide(); } }); {noformat} *NOTE: The above code works fine on iOS on 2.1.3 RC build.

Attachments

FileDateSize
Screen Shot 2012-09-20 at 2.28.49 PM.png2012-09-20T14:29:13.000+000077116
Screen Shot 2012-09-20 at 2.36.32 PM.png2012-09-20T14:36:57.000+000012602

Comments

  1. Javier Rayon 2012-09-20

    I want to confirm this bug, which is critical since it may silently destroy any existent UI using border properties. It works fine using 2.1.3.v20120907163110, fails in the reported version.
  2. Allen Yeung 2012-09-20

    PR: https://github.com/appcelerator/titanium_mobile/pull/3013 Please test with modified case:
       var win = Ti.UI.createWindow({
       	backgroundColor : 'white'
       });
       
       var loadingIndicatorView = Ti.UI.createView({
       	backgroundColor : 'black',
       	borderColor : 'black',
       	borderWidth : 12,
       	opacity : .6,
       	top : 5,
       	width : 52,
       	height : 52,
       	borderRadius : 52,
       	zIndex : 1,
       });
       
       var smallView = Ti.UI.createView({
       	width : 10,
       	height : 10,
       	backgroundColor : 'red'
       });
       
       loadingIndicatorView.add(smallView);
       win.add(loadingIndicatorView);
       loadingIndicatorView.show();
       
       var button = Ti.UI.createButton({
       	title : 'Hello',
       	width : 200,
       	height : 100,
       	top : 250
       });
       
       var show = false;
       
       win.add(button);
       button.addEventListener('click', function(e) {
       	if (show) {
       		loadingIndicatorView.show();
       		show = false;
       	} else {
       		show = true
       		loadingIndicatorView.hide();
       
       	}
       });
       win.open();
       
  3. Allen Yeung 2012-09-20

    Backport PR: https://github.com/appcelerator/titanium_mobile/pull/3014
  4. Olga Romero 2012-09-21

    Tested on: osx Mountain Lion 10.8.1 Titanium Studio, build: 2.1.2.201208301612 It is fixed for: Titanium SDK: 3.0.0.v20120921144915 Device: Nexus S3 4.0.4 Note: Issue still occurs on Titanium SDK: 2.1.3.v20120920154617
  5. Olga Romero 2012-09-24

    closing as fixed. Tested with: osx Mountain Lion 10.8.1 Titanium Studio, build: 2.1.2.201208301612 Titanium SDK: 2.1.3.v20120921190208 Titanium SDK: 3.0.0.v20120921144915 Device: Nexus S3 4.0.4

JSON Source