Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10801] Android: Allow 9-patch images in splash screen

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-10-19T01:20:45.000+0000
Affected Version/sRelease 2.1.2
Fix Version/s2013 Sprint 21, 2013 Sprint 21 Core, Release 3.2.0
ComponentsAndroid
LabelsSupportTeam, androidbuild, api, cb-verified, hard_to_verify, module_splashscreen, qe-testadded
ReporterVarun Joshi
AssigneeChris Barber
Created2012-09-06T14:06:19.000+0000
Updated2013-11-21T00:29:16.000+0000

Description

Issue

Branding the assets is difficult in Titanium's Splash Screen implementation (that assumes a full-size image file). So, as a workaround we need the 9-patch image to work for the splash screen. However, this does not work. When we add a default.9.png instead of default.png in a density specific folder such as res-port-hdpi, Ti would seem to try to pick a default.png in another density over the default.9.png. If we remove all density specific versions and just used default.9.png, Ti shows a default version of a splash screen that is not an asset in the project. If we rename the default.9.png to just default.png that would show up, just not as a 9-patch.

Sample

Create a default Titanium project and swap the default.png with a 9-patch image (.9.png extension).

Additional Info

There is a need to externally provide brandable assets that must be managed outside of development and inserted into build process. Need a way to limit the build process complexity and want to keep down the number of splash screen assets that have to be created and uploaded.

Attachments

FileDateSize
TestProject.zip2012-09-06T16:38:54.000+00002061730

Comments

  1. Varun Joshi 2012-09-06

    Attaching a sample project with 9-patch image as splash screen to test on.
  2. Hieu Pham 2012-09-11

    This can be done by creating your own theme. 1. Under your project dir, create platform/android/res/drawable-xxxx/splash.png 2. Create theme.xml under platform/android/res/values 3. Content of xml should look something like this:
       <?xml version="1.0" encoding="utf-8"?>
       <resources>
       <style name="Theme.Titanium" parent="android:Theme">
           <item name="android:windowBackground">@drawable/splash</item> //this is the splash image (should work with any extensions as long as it's valid)
       </style>
       </resources>
       
  3. Varun Joshi 2012-09-11

    Tried this out and worked for me. Communicated this solution to the customer. Waiting for their reply.
  4. Mark Mokryn 2013-04-08

    Hi, Is there any update on this issue? I tried to us a 9 patch for splash screen, and saw what someone else already [reported in the Q&A](https://developer.appcelerator.com/question/149184/9-patch-splash-screen-initial-window-does-not-fill-screen). I am using the Holo theme for my project so in any case I needed to define the splash screen in the XML theme file: this worked for me with a standard png but not a 9-patch. SDK 3.0.2, Android 4.1.2 with Holo theme, theme modified as above (i.e. using splash.png and not default.png). UPDATE: From my experience trying to get it to work, the method works as long as no lightweight windows exist under this custom theme. So the recommendation (until this is fixed, if ever) should be to create the custom theme only for the initial activity, and all following views should belong to other activities. Thanks, Mark
  5. Blackbaud Mobile 2013-07-24

  6. Ping Wang 2013-09-27

    This feature will contain a change in the CLI and an update in the doc. Please resolve the ticket until both parts are done.
  7. Chris Barber 2013-10-05

    Pull request: https://github.com/appcelerator/titanium_mobile/pull/4760
  8. Fokke Zandbergen 2013-10-16

    [~cbarber] is there a way I can already use this PR? Or will it be release with 3.1.4 scheduled for this week?
  9. Chris Barber 2013-10-16

    [~fokke] This was implemented as apart of the new and awesome Android build rewrite. It will be available with Titanium SDK 3.2.0. You'll be able to preview it once we merge it into master.
  10. Fokke Zandbergen 2013-10-17

    Can't wait :) ... really
  11. Chris Barber 2013-10-18

    Another pull request? https://github.com/appcelerator/titanium_mobile/pull/4781
  12. Allen Yeung 2013-10-19

    PR: https://github.com/appcelerator/titanium_mobile/pull/4781

JSON Source