In the current architecture, the window has two proxies. One is the wrapper proxy (TiBaseWindowProxy) and the other is the real proxy (TiViewProxy or ActivityWindowProxy). This design leads to many problems, eg. we have two copies of properties in the two proies and we need to keep them sync with each other, we need to take special care of adding / removing children, etc. And this design also affects the performance.
We are going to implement a new architecture for the window. A window is a TiViewProxy. For LW window, this TiViewProxy is associated with the current activity. For HW window, this TiViewProxy is associated with a newly created activity. This new architecture will simplify the current window system, make it more maintainable and improve the performance.
Update on behavior change:
In the new architecture, all the windows are heavyweight. If the developers want the old window behavior which has both lightweight and heavyweight windows, they can enable the property "ti.android.useLegacyWindow" in the tiapp.xml.
<property name="ti.android.useLegacyWindow" type="bool">true</property>
Update on performance improvement:
Did a similar performance experiment as TIMOB-13714 using this new window architecture. The result is posted on the [wiki page](
https://wiki.appcelerator.org/display/spe/Platform+Performance+Improvements#PlatformPerformanceImprovements-Performance_Experiment_for_Windows) (Table 2). The performance to open one heavyweight window with 100 children views is improved by *~120%* compared to the old window implementation.
Steps for FR: 1. Run KS with "ti.android.useLegacyWindow" enabled in the tiapp.xml on 2.3, 3.x and 4.x devices.
*Note:* since the new windows will respect the "width" and "height" properties in the window creation, we need to modify the KS->Base UI->Window(Standalone) test. Please run the KS in https://github.com/appcelerator-developer-relations/KitchenSink/pull/107 . 2. Run Anvil. Should have 371 passed / 35 failed on Android (*Note:* in the latest master, there is a new regression "android/android/android -> jsActivityUrl". So it will be 370 passed / 36 failed). Please also verify that Anvil runs fine on other platforms without new regression (on iOS, it should have 216 passed / 34 failed). 3. Run the attached project "windowtest2" on 3.2 (with the new window architecture) and on 3.1.1.GA to compare the behavior. *Note:* a) A modal window without backgroundColor/Image should have a translucent background. Pre 3.2, it has a black background on 4.0+ devices. b) Pre 3.2, the height/width properties do not work if specified in the open() function. c) Pre 3.2, the activityEnter/ExitAnimation properties is not supported in the close() function. 4. Run TIMOB-10809, TIMOB-9262 and TIMOB-5119 with "ti.android.useLegacyWindow" enabled. 5. Run the below tickets *with and without* "ti.android.useLegacyWindow" enabled. a) Tabgroup events: TIMOB-3139, TIMOB-4063, TIMOB-11031 b) Window events: TIMOB-8648(the first two test cases), TIMOB-8976 c) Window URL: TIMOB-11525 d) Memory leak: TIMOB-12160 6. This PR also adds support for activityEnter/ExitAnimation for window.close() (TIMOB-13543). Please run the test case in TIMOB-13543 and resolve it after the PR is merged. 7. This PR also fixes TIMOB-14482. Please test and resolve it after the PR is merged.
PR: https://github.com/appcelerator/titanium_mobile/pull/4417
KS PR: https://github.com/appcelerator-developer-relations/KitchenSink/pull/107
PR to fix the GC issue (TIMOB-14558): https://github.com/appcelerator/titanium_mobile/pull/4466
backport PR: https://github.com/appcelerator/titanium_mobile/pull/4474 For FR, please follow the above step 1-7 *without* "ti.android.useLegacyWindow" enabled since this property is not introduced in the backport PR. Please also follow the test steps in TIMOB-14558.
3_1_X KS PR: https://github.com/appcelerator-developer-relations/KitchenSink/pull/111
We have verified this feature with passes against our full stack on Android. Closing.
So "For LW window, this TiViewProxy is associated with the current activity. For HW window..." and then in the next paragraph, "In the new architecture, all the windows are heavyweight." Why the talk of both LW and HW, when everything is HW?
The second paragraph actually should be "In the new architecture, all the windows are heavyweight *by default*." If the developers enable the "ti.android.useLegacyWindow" property in the tiapp.xml, they can still use the LW windows.
So that's not a deprecated property that will go away at some point in the future?
Yes. The "ti.android.useLegacyWindow" property will go away and there will be only HW windows on Android in the future.