[TIMOB-17215] Android Module Resources cannot be overridden
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | High |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2014-07-07T16:23:59.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 3.3.0, Release 3.4.0 |
| Components | Tooling |
| Labels | module_xml, overwrite, qe-testadded, xml |
| Reporter | Mads Moller |
| Assignee | Chris Barber |
| Created | 2014-06-25T07:28:01.000+0000 |
| Updated | 2014-07-07T16:23:59.000+0000 |
Description
Its not possible to override resources such as xml or images that is used by a android module. e.g. changing the theme of a module's activity.
So the app folder APPFOLDER/platform/android/res/ will not override the MODULEFOLDER/platform/android/res/
This makes modules very unflexible to style/setup.
Thank you. And to confirm, this exists as of 3.2.0?
Correct
Master pull request: https://github.com/appcelerator/titanium_mobile/pull/5850 3_3_X pull request: https://github.com/appcelerator/titanium_mobile/pull/5851 I also added warning messages whenever a resource or xml value is being overwritten. This is useful to make sure you are overwriting the module's resources.
Hi Chris, That was quick :) Will it also take into account the tiapp.xml manifest changes? Lets say I want to override an module activity within my tiapp with a new custom android theme. will that work as well ? cheers
I need a test app and functional review steps before I can review this PR. [~viezel] can you attach a test project?
To test, I simply created the folder
platform/android/res/valuesand create astrings.xmlfile in it with the following contents:Next, enable the Facebook module in the<?xml version="1.0" encoding="UTF-8"?> <resources> <string name="test" formatted="false">Test</string> <string name="com_facebook_loginview_log_in_button">Log Me In</string> </resources>tiapp.xml:Run:<modules> <module platform="android">facebook</module> </modules>Examine the generatedbuild/android/res/values/strings.xmland make sure that the "com_facebook_loginview_log_in_button" says "Log Me In" instead of "Log In".Using the steps described by Chris, the change works as expected.
Verified fixed on: Mac OSX 10.9.3 Appcelerator Studio, build: 3.3.0.201406271159 Titanium SDK, build: 3.3.0.v20140701104113 Titanium CLI, build: 3.3.0-rc4 Alloy: 1.4.0-rc3 Followed test steps provided by [~cbarber]. Module resource has been overridden successfully. "com_facebook_loginview_log_in_button" says "Log Me In" as expected. Closing.