2
votes

im using Titanium SDK 3.3.0 and want to disable the "new" ActionBar in Android with the theme solution. Besides a want to use a 9-Patch-Image as splashscreen/loadingscreen.

Referring to the docs and guides: http://docs.appcelerator.com/titanium/3.0/#!/guide/Android_Action_Bar http://docs.appcelerator.com/titanium/3.0/#!/guide/Android_Themes

I have the following Project-Setup:

files for splashscreens:

/platform/android/res/drawable-ldpi/splash.9.png
/platform/android/res/drawable-mdpi/splash.9.png
/platform/android/res/drawable-hdpi/splash.9.png
/platform/android/res/drawable-xhdpi/splash.9.png

theme file: /platform/android/res/values/gsgptheme.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="Theme.GSGP" parent="Theme.AppCompat">
        <!-- Depending on the parent theme, this may be called android:windowActionBar instead of windowActionBar -->
        <item name="android:windowActionBar">false</item>
        <item name="android:windowBackground">@drawable/splash</item>
        <item name="android:windowNoTitle">true</item>
    </style>
</resources>

tiapp.xml:

<android xmlns:android="http://schemas.android.com/apk/res/android">
        <manifest android:installLocation="auto"
            android:versionCode="21" android:versionName="3.1.1">
            <application android:theme="@style/Theme.GSGP"/>
            <uses-sdk android:minSdkVersion="11" android:targetSdkVersion="14"/>
            <supports-screens android:anyDensity="false"/>
        </manifest>
</android>

The Problem is: Titanium doesn't seem to load my theme. On startup I see the default loadingscreen and still have an actionbar. Can anyone see my mistake?

1

1 Answers

0
votes

Need to add something similar to the following in your tiapp.xml file under the android application node. Replace "YourApp" in .YourAppActivity with whatever your app name is.

<activity android:name=".YourAppActivity" android:label="@string/app_name" android:theme="@style/Theme.GSGP" android:configChanges="keyboardHidden|orientation|screenSize">
    <intent-filter>
        <action android:name="android.intent.action.MAIN"/>
        <category android:name="android.intent.category.LAUNCHER"/>
    </intent-filter>
</activity>