feat(android): change from Fragment to a normal View#703
feat(android): change from Fragment to a normal View#703
Conversation
There was a problem hiding this comment.
-
Important: the
MapViewrefactor only forwardsonResume()andonDestroy(), but notonStart(),onPause(),onStop(), low-memory, or saved-state callbacks. Seeandroid/src/ti/map/TiUIMapView.java:96,android/src/ti/map/TiUIMapView.java:1443, andandroid/src/ti/map/ViewProxy.java:125.titanium-sdkshows these lifecycle hooks are available on proxies, so this is a real integration gap, not a platform limitation. The result is likely leaked map resources and broken restore/background behavior after activity pause/recreate. Fix by forwarding the full activity lifecycle toMapView, and if recreation is expected to preserve state, wire instance-state callbacks through toMapView.onCreate(savedState)/onSaveInstanceState(). -
Important:
liteModeandzOrderOnTopwere creation-time options before this change, but the new code always constructs a plainnew MapView(...)and only readsliteModelater as a boolean flag. Seeandroid/src/ti/map/TiUIMapView.java:96andandroid/src/ti/map/TiUIMapView.java:250. That means both public properties are now effectively ignored, which is a behavior regression. Fix by buildingGoogleMapOptionsfrom the proxy properties before creating theMapView.
|
Thanks for the updates! Two issues are still open:
The earlier liteMode/zOrderOnTop regression and the iOS workflow SDK mismatch look fixed. |
|
Thanks for the feedback, I'll do some more tests here 👍 |
hansemannn
left a comment
There was a problem hiding this comment.
Code-wise, this looks very well now! Feel free to merge once functionally tested.
|
Hmmm... |
This reverts commit df6fa60.
|
You are right, it was inferred from the others. Would be good to expose it on the SDK side, but no blocker here anymore. |
I think it is currently the only module that uses Fragments instead of a normal view. This had some issues before (ListView header) and it will fix tidev/titanium-sdk#14214
Also matches the same library versions as #678 (merge first for the action fixes).
Tested:
ti.map-android-6.0.0.zip
(updated 26/04/16 - 19:30)
Lite mode check:
ListView Header/Footer example