[TIMOB-20586] Parity: backgroundColor, backgroundImage, backgroundGradient
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-08-15T21:36:13.000+0000 |
Affected Version/s | Release 5.2.0 |
Fix Version/s | Release 6.2.0 |
Components | Android |
Labels | parity |
Reporter | Hieu Pham |
Assignee | Frankie Merzadyan |
Created | 2016-03-16T22:26:36.000+0000 |
Updated | 2017-08-18T23:59:22.000+0000 |
Description
Behaviors for backgroundColor, image and gradient are different for Android and iOS.
Android: 3 layers with color -> gradient -> image. Everything is bundled up and whatever is on top shows.
iOS: prioritize image over gradient over color, ultimately only displays one.
[~smohammed] can you verify?
[~fmerzadyan] No error occurred with the code above. Mac Version: 10.11.6 Xcode 8.0 Build version 8A218a APPC CLI AND APPC NPM VERSION: {"NPM":"4.2.7","CLI":"5.5.1"} APPC TI CLI VERSION: 5.0.9 APPC ALLOY VERSION: 1.9.2 NODE VERSION: v4.5.0 SELECTED SDK VERSION:Selected :6.0.0.v20161005072811
I think this *ticket is invalid* because user probably didn't put image file in a common folder such as studio-project-folder/Resources/assets folder which is located on the same level as android/ and iphone/ folders. Therefore the
backgroundImage
path to image was incorrect for one of the platforms. Use this to test:However backgroundImage does not load when using live view in Studio (from frequent file changes) which gives the impression that the layer rendering malfunctioned. However as you can see here in the console log underneath loading up a bitmap image is resource intensive and so OOM happens so backgroundImage is not loaded... {noformat} [WARN] : art: Throwing OutOfMemoryError "Failed to allocate a 14745612 byte allocation with 13655792 free bytes and 13MB until OOM" [DEBUG] : skia: --- decoder->decode returned false [ERROR] : TiUIHelper: (main) [59,746] Unable to load bitmap. Not enough memory: Failed to allocate a 14745612 byte allocation with 13655792 free bytes and 13MB until OOM [DEBUG] : Window: Checkpoint: postWindowCreated() [WARN] : EGL_emulation: eglSurfaceAttrib not implemented [WARN] : OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xe99bfc00, error=EGL_SUCCESS [ERROR] : Surface: getSlotFromBufferLocked: unknown buffer: 0xe7fb6a40 [DEBUG] : Window: Window is closed normally. [ERROR] : Surface: getSlotFromBufferLocked: unknown buffer: 0xe7fb8640 [INFO] : APSAnalyticsService: Analytics Service Started [INFO] : APSAnalyticsService: Stopping Analytics Service {noformat}
Then most likely it's because the unit test was written incorrectly on https://github.com/appcelerator/titanium-mobile-mocha-suite/blob/master/Resources/ti.ui.view.test.js This ticket was raised because of some failing unit tests here. We can fix the unit test here so that it test for parity between android and ios. Check out the FIXME comments, likely 1 of those is related to this ticket. Likely this one. https://github.com/appcelerator/titanium-mobile-mocha-suite/blob/master/Resources/ti.ui.view.test.js#L32 right now that particular test is skipping for all 3 platforms. we want it to work for iOS and android, while skipping windows :)
titanium-mobile-mocha-suite master: https://github.com/appcelerator/titanium-mobile-mocha-suite/pull/16
Closing.