Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14175] Android: ActivityIndicator: ActivityIndicator is not working.

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2013-06-11T23:23:13.000+0000
Affected Version/sRelease 3.1.1
Fix Version/sn/a
ComponentsAndroid
Labelsqe-3.1.1
ReporterParas Mishra
AssigneeIngo Muschenetz
Created2013-06-11T07:32:35.000+0000
Updated2014-06-19T12:43:05.000+0000

Description

Android: ActivityIndicator: ActivityIndicator is not working. This is not regression. Issue occurs since 2.1.4.GA Steps to reproduce: 1. Run the app
var hideIndicatorTimeout = null;
 
		var win = Ti.UI.createWindow({backgroundColor: 'white', layout: 'vertical'});
		
	    win.backgroundColor = "red";
	    win.layout = 'vertical';
		 
		var indicator = Ti.UI.createActivityIndicator({
		  message: "Processing...",
		  cancelable: true  // Indicator will be cancelable by setting this to true.
		});
		indicator.addEventListener('cancel', function() {
		    // Fired when the user has canceled this indicator.
		    clearTimeout(hideIndicatorTimeout);
		    alert("Aborted processing");
		});
		 
		var cancelableSwitch = Titanium.UI.createSwitch({
		    title: 'Cancelable',
		    style: Ti.UI.Android.SWITCH_STYLE_CHECKBOX,
		    value: true
		});
		cancelableSwitch.addEventListener('change',function(e)
		{
		    indicator.cancelable = e.value;
		});
		win.add(cancelableSwitch);
		 
		var showIndicatorButton = Ti.UI.createButton({
		    title: "Show Indicator"
		});
		showIndicatorButton.addEventListener('click', function() {
		    indicator.show();
		    hideIndicatorTimeout = setTimeout(function() {
		        indicator.hide();
		    }, 5000);
		});
		win.add(showIndicatorButton);
                win.open();
2. Make sure "Cancelable" is checked. 3. Press "Show Indicator". See Results. 4. Press "Show Indicator" then press hardware 'Back' before the indicator closes automatically. See Results. Expected : 3: Indicator should appear then disappear after five seconds. 4: Indicator should disappear, then an alert should appear indicating an aborted process. Actual: No ActivityIndicator Occurs.

Comments

  1. Thomas Huelbert 2013-06-11

    eric please validate
  2. Eric Merriman 2013-06-11

    Hello, I'll resolve invalid for now. Paras, please add the indicator to the window. :) For example:
        showIndicatorButton.addEventListener('click', function() {
                   win.add(indicator); // this is the missing part here
                   indicator.show();
                   hideIndicatorTimeout = setTimeout(function() {
                       indicator.hide();
                   }, 5000);
               });
       
    If you are not satisfied with the result, please respond. Otherwise, please close.
  3. Paras Mishra 2013-06-13

    Thanks Eric :) Verified and working fine. Device : Google Nexus 7, Android Version: 4.1 SDK: 3.1.1.v20130611153550 CLI version : 3.1.1-cr OS : MAC OSX 10.7.5 Appcelerator Studio, build: 3.1.1.201306071750 XCode : 4.5.1

JSON Source