[TIMOB-10801] Android: Allow 9-patch images in splash screen
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-10-19T01:20:45.000+0000 |
Affected Version/s | Release 2.1.2 |
Fix Version/s | 2013 Sprint 21, 2013 Sprint 21 Core, Release 3.2.0 |
Components | Android |
Labels | SupportTeam, androidbuild, api, cb-verified, hard_to_verify, module_splashscreen, qe-testadded |
Reporter | Varun Joshi |
Assignee | Chris Barber |
Created | 2012-09-06T14:06:19.000+0000 |
Updated | 2013-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
File | Date | Size |
---|---|---|
TestProject.zip | 2012-09-06T16:38:54.000+0000 | 2061730 |
Attaching a sample project with 9-patch image as splash screen to test on.
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:
Tried this out and worked for me. Communicated this solution to the customer. Waiting for their reply.
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
This feature will contain a change in the CLI and an update in the doc. Please resolve the ticket until both parts are done.
Pull request: https://github.com/appcelerator/titanium_mobile/pull/4760
[~cbarber] is there a way I can already use this PR? Or will it be release with 3.1.4 scheduled for this week?
[~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.
Can't wait :) ... really
Another pull request? https://github.com/appcelerator/titanium_mobile/pull/4781
PR: https://github.com/appcelerator/titanium_mobile/pull/4781