New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

* [Android] Add the ability of FlatGUI #643

Merged
merged 10 commits into from Sep 13, 2017

Conversation

Projects
None yet
4 participants
@YorkShen
Contributor

YorkShen commented Aug 24, 2017

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 and 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

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

For now, FlatGUI is disabled by default and only support the usage in wxcell.

Ref https://issues.apache.org/jira/browse/WEEX-66

@notdanger

@weex-bot

This comment has been minimized.

Show comment
Hide comment
@weex-bot

weex-bot Aug 24, 2017

Warnings
⚠️ No Changelog changes!
⚠️ This PR should update related documents as well.
⚠️ Potential BREAK CHANGE. Modify public in android/sdk/src/main/java/com/taobao/weex/ui/component/WXDiv.java
⚠️ Potential BREAK CHANGE. Modify public in android/sdk/src/main/java/com/taobao/weex/ui/component/list/WXListComponent.java
⚠️ Potential BREAK CHANGE. Modify public in android/sdk/src/main/java/com/taobao/weex/ui/component/WXText.java
⚠️ Potential BREAK CHANGE. Modify public in android/sdk/src/main/java/com/taobao/weex/ui/component/WXVContainer.java
⚠️ Potential BREAK CHANGE. Modify public in android/sdk/src/main/java/com/taobao/weex/ui/component/list/WXCell.java
⚠️ Potential BREAK CHANGE. Modify public in android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java
Messages
📖 According to the blame info, we recommended @luics , @sospartan to be the reviewers.

Generated by 🚫 dangerJS

weex-bot commented Aug 24, 2017

Warnings
⚠️ No Changelog changes!
⚠️ This PR should update related documents as well.
⚠️ Potential BREAK CHANGE. Modify public in android/sdk/src/main/java/com/taobao/weex/ui/component/WXDiv.java
⚠️ Potential BREAK CHANGE. Modify public in android/sdk/src/main/java/com/taobao/weex/ui/component/list/WXListComponent.java
⚠️ Potential BREAK CHANGE. Modify public in android/sdk/src/main/java/com/taobao/weex/ui/component/WXText.java
⚠️ Potential BREAK CHANGE. Modify public in android/sdk/src/main/java/com/taobao/weex/ui/component/WXVContainer.java
⚠️ Potential BREAK CHANGE. Modify public in android/sdk/src/main/java/com/taobao/weex/ui/component/list/WXCell.java
⚠️ Potential BREAK CHANGE. Modify public in android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java
Messages
📖 According to the blame info, we recommended @luics , @sospartan to be the reviewers.

Generated by 🚫 dangerJS

@YorkShen YorkShen changed the title from * [Android] Add the ability of flatgui to * [Android] Add the ability of FlatGui Aug 24, 2017

@YorkShen YorkShen changed the title from * [Android] Add the ability of FlatGui to * [Android] Add the ability of FlatGUI Aug 24, 2017

YorkShen added some commits Aug 22, 2017

* [android] Make flat flag like lazy flag and enable it only if it's …
…Android 4.4 or below.

* [android] Fix LayoutParams in Nested Widget/Views.
+ [android] Add garbage collection for FlatGUI.
* [android] Fix the problem of WXSDKInstance.destroy() invoked twice if WXEmbed present.

WXSDKInstance.destroy() will be called by
WXSDKInstance.onActivityDestroy()->WXEmbed.onActivityDestroy() ->WXSDKInstance.onActivityDestroy() -> WXSDKInstance.destroy() and
WXSDKInstance.onActivityDestroy() -> WXSDKInstance.destroy() -> WXEmbed.destroy() -> WXSDKInstance.destroy().

@asfgit asfgit merged commit f9019f4 into apache:0.16-dev Sep 13, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@YorkShen YorkShen deleted the YorkShen:android-feature-flatGUI branch Sep 21, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment