@Test public void testCallDomMethod() throws Exception { module.callDomMethod(null); JSONObject obj = new JSONObject(); for (String m : METHODS) { obj.put(WXBridgeManager.METHOD,m); module.callDomMethod(obj); } obj = new JSONObject(); for (Object[] args:ARGS_CASES ) { JSONArray ary = new JSONArray(); if(args == null){ ary = null; }else { for (Object arg : args ) { ary.add(arg); } } obj.put(WXBridgeManager.ARGS,ary); for (String m : METHODS) { obj.put(WXBridgeManager.METHOD,m); module.callDomMethod(obj); } } }
public void callDomMethod(JSONObject task) { if (task == null) { return; } String method = (String) task.get(WXBridgeManager.METHOD); JSONArray args = (JSONArray) task.get(WXBridgeManager.ARGS); callDomMethod(method,args); }
WXDomModule extends WXModule { public void callDomMethod(JSONObject task) { if (task == null) { return; } String method = (String) task.get(WXBridgeManager.METHOD); JSONArray args = (JSONArray) task.get(WXBridgeManager.ARGS); callDomMethod(method,args); } }
WXDomModule extends WXModule { public void callDomMethod(JSONObject task) { if (task == null) { return; } String method = (String) task.get(WXBridgeManager.METHOD); JSONArray args = (JSONArray) task.get(WXBridgeManager.ARGS); callDomMethod(method,args); } WXDomModule(WXSDKInstance instance); }
WXDomModule extends WXModule { public void callDomMethod(JSONObject task) { if (task == null) { return; } String method = (String) task.get(WXBridgeManager.METHOD); JSONArray args = (JSONArray) task.get(WXBridgeManager.ARGS); callDomMethod(method,args); } WXDomModule(WXSDKInstance instance); void callDomMethod(JSONObject task); Object callDomMethod(String method, JSONArray args); void invokeMethod(String ref, String method, JSONArray args); void createBody(JSONObject element); void updateAttrs(String ref, JSONObject attr); void updateStyle(String ref, JSONObject style); void removeElement(String ref); void addElement(String parentRef, JSONObject element, Integer index); void moveElement(String ref, String parentRef, Integer index); void addEvent(String ref, String type); void removeEvent(String ref, String type); void createFinish(); void refreshFinish(); void updateFinish(); void scrollToElement(String ref, JSONObject options); void addRule(String type, JSONObject options); void getComponentRect(String ref, String callback); }
WXDomModule extends WXModule { public void callDomMethod(JSONObject task) { if (task == null) { return; } String method = (String) task.get(WXBridgeManager.METHOD); JSONArray args = (JSONArray) task.get(WXBridgeManager.ARGS); callDomMethod(method,args); } WXDomModule(WXSDKInstance instance); void callDomMethod(JSONObject task); Object callDomMethod(String method, JSONArray args); void invokeMethod(String ref, String method, JSONArray args); void createBody(JSONObject element); void updateAttrs(String ref, JSONObject attr); void updateStyle(String ref, JSONObject style); void removeElement(String ref); void addElement(String parentRef, JSONObject element, Integer index); void moveElement(String ref, String parentRef, Integer index); void addEvent(String ref, String type); void removeEvent(String ref, String type); void createFinish(); void refreshFinish(); void updateFinish(); void scrollToElement(String ref, JSONObject options); void addRule(String type, JSONObject options); void getComponentRect(String ref, String callback); static final String WXDOM; static final String INVOKE_METHOD; static final String[] METHODS; }