Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2486] Android Theme.Holo don't dysplay splash screens

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionCannot Reproduce
Resolution Date2014-01-01T22:32:46.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsandroid, holo, ics, styles, theme, tiapp.xml
ReporterEzoom Agency
AssigneeRitu Agrawal
Created2013-05-28T14:23:33.000+0000
Updated2016-03-08T07:41:32.000+0000

Description

Setting the application manifest to Holo themes make the splash screens not work, doesn't matter where you put it. *Steps:* 1 - Add the manifest part to your tiapp.xml 2 - Use one android visual component like the one on the code bellow 3 - Compile to an android device *Adicional notes/Questions:* 1 - Not setting this theme will make that the default theme is always the 2.2 versions theme 2 - Why there isn't a way to just set the theme on tiapp.xml without using android manifest? *Related Q&A* [Android theme not properly set](http://developer.appcelerator.com/question/152933/android-theme-not-properly-set) [How do you build your app with Holo theme?](http://developer.appcelerator.com/question/130719/how-do-you-build-your-app-with-holo-theme) *Testing code bellow:* *app.js*
var parentView = Ti.UI.createWindow();

// Create a ProgressBar.
var aProgressBar = Ti.UI.createProgressBar({
	min : 0,
	max : 10,
	value : 0,
	width : '200dp',
	height : '70dp',
	color : '#444',
	message : 'Measuring Progress',
	font : {fontSize:14, fontWeight:'bold'},
	style : Ti.UI.iPhone.ProgressBarStyle.PLAIN,
	top : 60
});

// Add to the parent view.
parentView.add(aProgressBar);
aProgressBar.show();

// Sample timer to demonstrate ProgressBar functionality.
var val = 0;
var interval = setInterval(function() {
	if (val <= 10) {
		aProgressBar.value = val;
		aProgressBar.message = 'Progress: ' + val + ' of 10';
		val++;
	} else {
		aProgressBar.message = 'Progress complete!';
		clearInterval(interval);
	}
}, 500);

parentView.open();
*tiapp.xml*
.....
    <android xmlns:android="http://schemas.android.com/apk/res/android">
    	<manifest android:installLocation="auto" android:versionCode="1" android:versionName="1.0">
    		<application android:theme="@android:style/Theme.Holo.Light">
				<activity android:name=".TesteActivity" android:theme="@android:style/Theme.Holo.Light">
					<intent-filter>
						<action android:name="android.intent.action.MAIN"/>
						<category android:name="android.intent.category.LAUNCHER"/>
					</intent-filter>
				</activity>				
			</application>

        </manifest>       	
    </android> 
...
<sdk-version>3.1.0.GA</sdk-version>

Attachments

FileDateSize
ThemeTest.zip2013-05-29T12:13:15.000+00002897433

Comments

  1. Carter Lathrop 2013-05-29

    Hello, Would you mind zipping up the sample project that demonstrates this bug? Following the directions you provided has not been able to display a Holo theme on my device. Hopefully by using an app that you already have configured with a theme we can replicate the issue and come to a resolution more quickly. Thanks for your cooperation, Carter
  2. Ezoom Agency 2013-05-29

    After more and more tests I discovered that I need to use a custom values/theme.xml like this to work:
       <?xml version="1.0" encoding="utf-8"?>
       <resources>
       	<style name="LightTheme" parent="@android:style/Theme.Holo.Light">
       	    <item name="android:windowBackground">@drawable/background</item>
       	    <item name="android:windowNoTitle">true</item>
       	</style>
       </resources>
       
    There is one thing that could be done to really improve the way it works, and avoid this kind of problem that is, allow us to just set the theme on tiapp.xml without using android manifest, and custom files, like a normal tag like this: *Holo.Light* I'll attach a zip file soon, just need to clean the stuff.
  3. Ezoom Agency 2013-05-29

    File attached: Working project, with theme Holo.Light set. Just to clear a bit here: *Problems* 1 - The default Titanium/Android theme is always 2.2 version, eve if you set min/target sdk to 14, wich is actually wrong, thi should be variable using the default device theme. 2 - To workaround this would need to copy the manifest.xml application tag into our tiapp.xml, and change the places where it uses Theme.Titanium to Theme.Holo.Light(as a example), but it won't show splash screens this way. 3 - To workaround problems 1 and 2, we need to have the same structure as in this zip file: **tiapp.xml, application and activity tag set to custom theme "@style/MyThemeName" **platform/android/res/values/theme.xml setting a custom theme using as parent the android themes Theme.Holo.Light(as a example), and creating an item tag for the splash screen(like in the zip files) *Fix needed* Android default theme should be the device default theme, not always the titanium default android 2.2 theme. *Improvements needed* To force a theme we could have a tiapp.xml tag called where we could set custom/default themes for the application
  4. Carter Lathrop 2013-05-30

    Ezoom, Thank you for your suggestions and insight into theme settings with Titanium. In order to keep tickets organized we would need two new tickets created in the form of "improvement" tickets. This is so that we can keep tickets organized and specific for logging purposes. If you would mind creating these two tickets I would be happy to review them and pass them along to engineering for them to fulfill. The tickets should reflect the info you provided in your last comment, specifically, one ticket should read, "Android default theme should be the device default theme, not always the titanium default android 2.2 theme." and the other should be "To force a theme we could have a tiapp.xml tag called where we could set custom/default themes for the application" along with any more information in the description. Thank you for bringing this to our attention, Carter
  5. Ygor Lemos 2013-08-05

    Have you guys created the improvement tickets for this? If so, would you mind to link them against this one?
  6. Ritu Agrawal 2014-01-01

    We cannot reproduce the issue with the splash screen and there is already an existing ticket TIMOB-14778 to cover the improvements suggested in this ticket. Please follow along that ticket for further updates.

JSON Source