[TIMOB-11312] Android: ActivityIndicator: Activity indicator is not working.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2012-10-10T19:43:29.000+0000 |
Affected Version/s | Release 3.0.0 |
Fix Version/s | 2012 Sprint 21 API, 2012 Sprint 21 |
Components | Android |
Labels | api, module_activityindicator, qe-and100112, qe-testadded, regression |
Reporter | Anshu Mittal |
Assignee | Ping Wang |
Created | 2012-10-09T09:31:35.000+0000 |
Updated | 2013-03-13T18:56:41.000+0000 |
Description
Activity indicator is not working
This is regression since the activity indicator works well on 2.1.3 GA.
Steps to reproduce:
1. Create an app using the code below.
2. Launch the app and click the 'show indicator' button.
Actual:
Indicator is not shown.
Expected:
Activity indicator should be dispalyed.
var win1 = Titanium.UI.createWindow({
backgroundColor:'white',
layout:'vertical'
});
var hideIndicatorTimeout = null;
win1.backgroundColor = "red";
win1.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;
});
win1.add(cancelableSwitch);
var showIndicatorButton = Ti.UI.createButton({
title: "Show Indicator"
});
showIndicatorButton.addEventListener('click', function() {
indicator.show();
hideIndicatorTimeout = setTimeout(function() {
indicator.hide();
}, 5000);
});
win1.add(showIndicatorButton);
win1.open();
The Android ActivityIndicator is totally new in 3.0.0 (see TIMOB-6092). It is a view, so it has to be added to the window/view before the show() method is called. The new ActivityIndicator does not have the property "cancelable" any more. Mark the ticket as invalid.
Closing the bug as invalid.