Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

* [Android] Add the ability of FlatGUI #643

Merged
merged 10 commits into from
Sep 13, 2017

Conversation

YorkShen
Copy link
Contributor

@YorkShen 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
Copy link

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 * [Android] Add the ability of flatgui * [Android] Add the ability of FlatGui Aug 24, 2017
@YorkShen YorkShen changed the title * [Android] Add the ability of FlatGui * [Android] Add the ability of FlatGUI Aug 24, 2017
@YorkShen YorkShen force-pushed the android-feature-flatGUI branch 2 times, most recently from 24c0ea0 to e6096d5 Compare September 4, 2017 09:49
@@ -27,7 +32,9 @@
import com.taobao.weex.dom.WXTextDomObject;
import com.taobao.weex.dom.flex.Spacing;
import com.taobao.weex.ui.SimpleComponentHolder;

import com.taobao.weex.ui.flat.FlatGUIIContext;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is FlatGUIIContext write more character 'I'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My mistake, thank you for figuring out.

@YorkShen YorkShen force-pushed the android-feature-flatGUI branch 7 times, most recently from 78d8e94 to 5b207c9 Compare September 13, 2017 08:11
…Android 4.4 or below.

* [android] Fix LayoutParams in Nested Widget/Views.
* [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
@YorkShen YorkShen deleted the android-feature-flatGUI branch September 21, 2017 11:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants