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

+ [android] support prerender #343

Merged
merged 3 commits into from
May 15, 2017

Conversation

@Rowandjj
Copy link
Contributor Author

@sospartan pls review it:)

@@ -122,7 +123,8 @@
/**
* Render start time
*/
private long mRenderStartTime;
//this field may accessed outside
public long mRenderStartTime;
Copy link
Contributor

Choose a reason for hiding this comment

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

no public field.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok i'll add setter method

},0);
}

public void replaceContext(@NonNull Context context) {
Copy link
Contributor

Choose a reason for hiding this comment

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

'setContext' is fair enough. Pls add more comments about why context is set-able

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

@Override
public void executeDom(DOMActionContext context) {
super.executeDom(context);
//add by chuyi
Copy link
Contributor

Choose a reason for hiding this comment

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

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i want 'save cached instance' when layout finished. so i add LayoutFinishListener, when createFinish action invoked, the listener will fired too.

import com.taobao.weex.dom.RenderAction;
import com.taobao.weex.dom.RenderActionContext;

class ExecutableAction implements DOMAction, RenderAction {
Copy link
Contributor

Choose a reason for hiding this comment

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

This action post a runnable job to render thread, the name should be more clear. Better add 'render' to the class name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed to ExecutableRenderAction

@@ -57,28 +59,32 @@ void setHandler(Handler handler) {

@JSMethod(uiThread = false)
public void setTimeout(@IntRange(from = 1) int funcId, @IntRange(from = 0) int delay) {
postMessage(WXJSBridgeMsgType.MODULE_TIMEOUT, funcId, delay, Integer.parseInt(mWXSDKInstance.getInstanceId()));
if(mWXSDKInstance != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This file is irrelevant to the PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nope... we want hold timers in preRenderMode

@weex-bot
Copy link

1 Message
📖 Executed 53 tests, with 0 failures (0 unexpected) in 41.687 (41.759) seconds

Generated by 🚫 danger

@asfgit asfgit merged commit 0cb3d98 into apache:0.13-dev May 15, 2017
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