Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13796] Android: Implement new window architecture

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-07-10T20:35:10.000+0000
Affected Version/sn/a
Fix Version/s2013 Sprint 14, 2013 Sprint 14 API, Release 3.1.2, Release 3.2.0
ComponentsAndroid
Labelsmodule_window, qe-testadded
ReporterPing Wang
AssigneePing Wang
Created2013-05-08T23:10:00.000+0000
Updated2016-07-07T09:06:54.000+0000

Description

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.

Attachments

FileDateSize
windowtest 2.zip2013-07-03T18:24:48.000+00003735256

Comments

  1. Ping Wang 2013-06-21

    Steps for FR: 1. Run KS with "ti.android.useLegacyWindow" enabled in the tiapp.xml on 2.3, 3.x and 4.x devices.
    <property name="ti.android.useLegacyWindow" type="bool">true</property>
    *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.
  2. Ping Wang 2013-06-25

    PR: https://github.com/appcelerator/titanium_mobile/pull/4417
  3. Ping Wang 2013-07-10

    KS PR: https://github.com/appcelerator-developer-relations/KitchenSink/pull/107
  4. Ping Wang 2013-07-19

    PR to fix the GC issue (TIMOB-14558): https://github.com/appcelerator/titanium_mobile/pull/4466
  5. Ping Wang 2013-07-23

    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.
  6. Ping Wang 2013-08-01

    3_1_X KS PR: https://github.com/appcelerator-developer-relations/KitchenSink/pull/111
  7. Eric Merriman 2013-08-29

    We have verified this feature with passes against our full stack on Android. Closing.
  8. Dawson Toth 2013-10-04

    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?
  9. Ping Wang 2013-10-04

    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.
  10. Dawson Toth 2013-10-04

    So that's not a deprecated property that will go away at some point in the future?
  11. Ping Wang 2013-10-04

    Yes. The "ti.android.useLegacyWindow" property will go away and there will be only HW windows on Android in the future.

JSON Source