[
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.

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.

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)