Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16626] Android: Changing the opacity into a view have a flashing loading indicator

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-05-14T18:26:49.000+0000
Affected Version/sRelease 3.2.1
Fix Version/s2014 Sprint 10, 2014 Sprint 10 SDK, Release 3.3.0
ComponentsAndroid
Labelsmodule_activityindicator, qe-testadded, regression, supportTeam, triage
ReporterEduardo Gomez
AssigneeVishal Duggal
Created2014-03-14T18:20:56.000+0000
Updated2014-05-15T23:27:37.000+0000

Description

Issue description

Since Titanium Project upgraded from the 3.1.3.GA TiSDK to the 3.2.0.GA and 3.2.1.GA SDK the splash screen and/or loading indicators flicker when the app is starting up. Sometimes the indicator is barely visible and other times the screen flickers. That sample code does reproduce the issue. It was verified (the loading indicator was made a bit larger to clarify the issue and uploaded a video here: https://www.dropbox.com/s/vp5mrhuay0h1nsu/IMG_0874.MOV

Devices affected

Seems to only happen on subset of devices with Gingerbread. i.e Samsung Galaxy Note running Android 2.3.6 and Droid Razr 2.3.6. Not reproducible on Android 4.0.X though.

Steps to replicate

Get and run sample: https://www.dropbox.com/s/vfi2gmvf7c5zknt/APP-212883_TestCase.zip

Launch app at device

Monitor activity indicator. From time to time the issue occurs.

Attachments

FileDateSize
app.js2014-03-17T16:29:45.000+00004122

Comments

  1. Daniel Fortner 2014-03-28

    We can cancel the 3.2.3 request. 3.3.0 will work!
  2. Vishal Duggal 2014-05-14

    Pull pending against master https://github.com/appcelerator/titanium_mobile/pull/5681
  3. Vishal Duggal 2014-05-14

    Simplified Test Cases TEST CASE 1
       var activityIndicator = null;
       var inAnimation = null;
       var outAnimation = null;
       
       function createActivityIndicator() {
       	var indicator;
       	indicator = Titanium.UI.createActivityIndicator({
       		bottom : 10,
       		height : 50,
       		width : 50,
       		color : 'white',
       		font : {
       			fontWeight : 'bold'
       		},
       		message : '',
       		style : Ti.UI.ActivityIndicatorStyle.BIG,
       	});
       
       	return indicator;
       }
       
       function createActivityBackground() {
       	return Titanium.UI.createView({
       		backgroundColor : 'black',
       		opacity : 0,
       		bottom : 0,
       		height : 70,
       	});
       }
       
       
       //Resources/mbanking/ui/bootstrap-initialization.js:213 - function createWindow()
       var bootStrapWindow = Ti.UI.createWindow({
       	backgroundColor: 'red',
       	exitOnClose:false
       });
       
       //create activity indicator
       if (activityIndicator == null) {
       	bgView = createActivityBackground();
       	bootStrapWindow.add(bgView);
       	activityIndicator = createActivityIndicator();
       	bgView.add(activityIndicator);
       }
       
       bootStrapWindow.addEventListener('open', function() {
       	
       	_showActivity('Loading');
       
       
       	var loginWindow = Ti.UI.createWindow({
       		backgroundColor : 'blue',
       		exitOnClose : true,
       		//fullscreen : false, navBarHidden : true
       	});
       	loginWindow.add(Ti.UI.createLabel({
       		top : 50,
       		left : 25,
       		text : 'Enter your user ID to sign on to MyBank Service.:'
       	}));
       	loginWindow.add(Ti.UI.createTextField({
       		top : 75,
       		left : 20,
       		width : '80%',
       		backgroundColor : 'white',
       		hintText : 'User ID'
       	}));
       	setTimeout(function() {
       		
       		
       		Ti.API.info(' loginWindow Opened ');
       
       		if (activityIndicator != null) {
       			activityIndicator.hide();
       		}
       		var closeAni = Ti.UI.createAnimation({
       			opacity : 0,
       			duration : 100
       		});
       		bootStrapWindow.close(closeAni);
       		//bootStrapWindow.close();
       		loginWindow.open();
       		
       	}, 10000);
       });
       
       bootStrapWindow.open();
       
       
       function _showActivity(message) {
       	if (message) {
       		//activityIndicator.setMessage(message);
       	}
       
       	if (bgView != null) {
       		if (inAnimation == null) {
       			inAnimation = createInAnimation();
       		}
       		Ti.API.info(' Running Animation ');
       		bgView.animate(inAnimation, function() {
       			if (activityIndicator != null) {
       				activityIndicator.show();
       			}
       		});
       	}
       }
       
       function createInAnimation() {
       	return Ti.UI.createAnimation({
       		opacity : 0.7,
       		duration : 500
       	});
       }
       
    TEST CASE 2
       var win = Ti.UI.createWindow({backgroundColor:'white'});
       
       var v1 = Ti.UI.createView({
         height:70,
         opacity:0,
         backgroundColor:'red'
       });
       
       
       var v2 = Ti.UI.createView({
         height:50,
         width:50,
         backgroundColor:'green'
       });
       
       
       v1.add(v2);
       
       win.add(v1);
       
       var b1 = Ti.UI.createButton({
         title:'0',
         left:0,
         bottom:0
       });
       
       var b2 = Ti.UI.createButton({
         title:'0.5',
         bottom:0
       });
       
       var b3 = Ti.UI.createButton({
         title:'1',
         right:0,
         bottom:0
       });
       
       win.add(b1);
       win.add(b2);
       win.add(b3);
       
       b1.addEventListener('click',function(e){
         v1.opacity = 0;
       });
       
       b2.addEventListener('click',function(e){
         v1.opacity = 0.5;
       });
       b3.addEventListener('click',function(e){
         v1.opacity = 1;
       });
       
       win.open();
       
  4. Lokesh Choudhary 2014-05-15

    Verified the fix. The activity indicator/loading indicator does not flash. Closing. Environment: Appc Studio : 3.3.0.201405121247 Ti SDK : 3.3.0.v20140515151935 Mac OSX : 10.8.5 Alloy : 1.4.0-alpha CLI - 3.3.0-dev Sony xperia- android 2.3.7 Nexus 5 - android 4.4.2

JSON Source