Problem
When using one of Android's Holo Light or Dark themes, the ActivityIndicator style differs depending how/when .show(); is called.
When activityIndicator.show(); is called immediately after win1.open() - the image is thicker and darker. When called later - either via setTimeout or the click event of a button, the image is thinner and faded.
The same code without activating a Holo theme creates the same style activity indicator each time.
Test case
var win1 = Titanium.UI.createWindow({
title:'Android Activity Debug',
backgroundColor:'#fff',
fullscreen: false
});
var activityIndicator = Ti.UI.createActivityIndicator({
style: Ti.UI.ActivityIndicatorStyle.DARK,
top: 10,
height: Ti.UI.SIZE,
width: Ti.UI.SIZE
});
win1.add(activityIndicator);
win1.open();
// Calling here renders a thicker, darker image
//activityIndicator.show();
// But - when calling it from setTimeout
// Or from the event handler of a button click
// The indicator appears lighter and thinner
/*
setTimeout(function() {
activityIndicator.show();
}, 2000);
*/
<android xmlns:android="http://schemas.android.com/apk/res/android">
<tool-api-level>14</tool-api-level>
<manifest>
<supports-screens android:anyDensity="true"/>
<uses-sdk android:maxSdkVersion="17"
android:minSdkVersion="8" android:targetSdkVersion="14"/>
<application android:theme="@android:style/Theme.Holo.Light"/>
</manifest>
</android>
Discussions
I initially raised this issue in the following Q & A thread:
http://developer.appcelerator.com/question/154077/android-activityindicator-looks-different-depending-when-show-called
Tried with latest master but couldn't reproduce the issue. Android 4.3, Nexus S