[ 
https://issues.apache.org/jira/browse/WEEX-66?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16139723#comment-16139723
 ] 

ASF GitHub Bot commented on WEEX-66:
------------------------------------

GitHub user YorkShen opened a pull request:

    https://github.com/apache/incubator-weex/pull/643

    * [Android] Add the ability of flatgui

    As it is known to all that the view hierarchy in android should be reduce 
as much as possible. The deeper the view hierarchy is, the worse the android 
app performance . But the front-end engineer is often unaware of the view 
hierarchy in weex until he/she asked android developer for help.
    
    The main problem of deep view hierarchy is that the implementation of view 
is expensive and costs lost of CPU/Memory. The cost of a view is basically 
linear to the length of view hierarchy. It is also unnecessary to create view 
for some components, like <text> and <image> as they mostly draw nothing but 
the objects Weex framework provides. There is no reason we waste limited mobile 
resource to create view in such scenario.
    
    Suppose the following component structure is given, the view hierarchy will 
be the same to the component hierarchy, where there is at least 10 views(if 
there is no children in slider and no wrapper view for slider) and the height 
of the tree is 5. 
    
    
![viewgui](https://gm1.ggpht.com/Cc3V2APSK7kcyIgTq0QiTfvHg3-RfHPAcQ9JOXbxcdAb2IbaJhKpwXgKV8UPQYGZmITtYENCe4l6UvfwBNobEyujGTcaxdVZTcPmcBF_axvPo6zDGOrFOrhDonKjv_1XKb9_awpZqZSPo16sbE8GMXw8EMbnF68NUyYutTIEOQ0u1QRkLbeJGcFbniE1D7_PWcvk0zlTTdr6uS_wjLu6Oqm0IgofMBHx_AbiPRdSDDIaCQwRy0vhJshscPUZ6vAddDy3fIzhwIaoGeBxDjhOsN5bNYKgP4vdLpQo_q34dzpQlmbAp-Fj-sa2iJo4Xz72VrgNbcGbm6lY7dASXW5k9uGkeUgiunhPgKuQGdXHOhpLo6zx8ISHUh2ZQJziNPm-JoTW4rFOG-qCsCwOAISHa3_TtXptZH9oGh8rshkKdEEbYJEbfhQF3O7jG_0trNY-XerNU6e_SWl0Y_qtiu9Esl8cbVhMHVhF1GOM877_pYID4czYmrSdIHOODg3ebY3KBY5bmWD9Fb3ah4mZMwSSSvpHYHN6W6Ok7y8lG5dajS-LOLYvlgnv6TH1AuOVXmwGDJsrUuSOiUayR1dpPtXm0X3T64tMLoqfgU_H9zL98q681mbsJ2gr7iBtek3zaipoAqIRM_CSw8qYILOu5MRLbV_6zb_kPtnCRv1dKxNrqv9rR3RmdeZgFlTDY_15uzzHYVoNXBbQn64D33utuB10rWJP=w1600-h1000-l75-ft)
    
    With Flatten mechanism enable, the view hierarchy will looks like below 
with 2 views and the height of view tree is 3. Note, only rounded-rect is 
marked as view, oval will be marked as a custom drawCommand. 
    
    
![flatgui](https://gm1.ggpht.com/Q8YiQBv15qmFxIJW-Ogl3HEJVR7RYU1k5JPK_5OvKO4p4ubJPl9crFCfB4Na9JzDPU5Q7bXd6u5DgV_MW6_l1EikCyeoFuCBNe0MEZtBNp8qqifVTNFauL6MKsQx6xUpSaNfyGZiXVbfgrZh1qulW2_ZJPf_ZaH1-KyFEyKytl9Ouq9FkTbdgA2m2f7NHOGpE8sFZs0JsTZShXk670IV1wTEyB-sPrwSiqj1VvnpKRI-AZGcz-_UbJ_F6s_LU5NVkehmKyD2b9VyRkRDKvwf2nJ1afSJhg-3RVRojYrVH3A8pK1S055hr4gx9BUp6gqAROVfhS_V61087LBYCGyszdfhHbnnh7thZo26TXFWuK6IiBn7W0bZJxJmCDAGqJZNIYnZz3FxXd6C1go1CQHh78ggneoiPd6gn5qs8Eocak3JYI0FtllryvSycjfODpW1ZrGwZn7dZ1pKOJdOPSeGTqobloNyAKcv3drPmeauCQO3-MAwg-iM_kYbu7V3wy7viL7hjfBMefLL4qXOEwoChBkM3yqwTmsibz34H6pmWeXe-cpKCcJtEZ2kOwGywPGpTw_zM31n2OgslhuSl0AfMMoYWwm8I9m8GRwd2WR8LIgY8WecVBKLfQnqHgzUgKy7nYHTS9p-Dkh9zEuAUi7Nfe5ve0BcVgQeFJ7RC_D1sfutuStG2Vgt97SPzFt9Pz8YBsQAJYXim0utKT3GbgML1SU13Fs=w1600-h1000-l75-ft)
    
    For now, FlatGUI is disabled by default and only support the usage in 
wxcell.
    
    Ref <https://issues.apache.org/jira/browse/WEEX-66>
    
    @nodanger

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/YorkShen/incubator-weex 
android-feature-flatGUI

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-weex/pull/643.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #643
    
----
commit 1520660029b47917ee1d86609ced6c8ec4853fc6
Author: YorkShen <[email protected]>
Date:   2017-08-22T03:37:04Z

    * [android] Init commit for flatGUI

commit 7663f2b6e4bfc62786408573174548294a27e6ac
Author: YorkShen <[email protected]>
Date:   2017-08-24T03:16:41Z

    * [android] Add flag in WXCell to decide whether enable flatGUI.

----


> Support FlatGUI
> ---------------
>
>                 Key: WEEX-66
>                 URL: https://issues.apache.org/jira/browse/WEEX-66
>             Project: Weex
>          Issue Type: New Feature
>            Reporter: YorkShen
>            Assignee: sospartan
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to