-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
61 changed files
with
3,245 additions
and
263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
appframework/src/main/java/com/alibaba/weex/extend/component/WXComponentSyncTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.alibaba.weex.extend.component; | ||
|
||
import com.taobao.weex.WXSDKInstance; | ||
import com.taobao.weex.annotation.JSMethod; | ||
import com.taobao.weex.dom.WXDomObject; | ||
import com.taobao.weex.ui.component.WXDiv; | ||
import com.taobao.weex.ui.component.WXVContainer; | ||
import com.taobao.weex.utils.WXLogUtils; | ||
|
||
/** | ||
* Created by zhengshihan on 2016/12/30. | ||
*/ | ||
|
||
public class WXComponentSyncTest extends WXDiv { | ||
|
||
public WXComponentSyncTest(WXSDKInstance instance, WXDomObject dom, WXVContainer parent) { | ||
super(instance, dom, parent); | ||
} | ||
|
||
@JSMethod (uiThread = false) | ||
public void testSyncCall(){ | ||
WXLogUtils.d("11WXComponentSyncTest :"+ Thread.currentThread().getName()); | ||
} | ||
|
||
@JSMethod (uiThread = true) | ||
public void testAsyncCall(){ | ||
WXLogUtils.e("22WXComponentSynTest :"+ Thread.currentThread().getName() ); | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
appframework/src/main/java/com/alibaba/weex/extend/module/SyncTestModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package com.alibaba.weex.extend.module; | ||
|
||
import com.taobao.weex.annotation.JSMethod; | ||
import com.taobao.weex.common.WXModule; | ||
|
||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
/** | ||
* Created by zhengshihan on 2016/12/28. | ||
*/ | ||
|
||
public class SyncTestModule extends WXModule { | ||
|
||
@JSMethod(uiThread = false) | ||
public ArrayList getArray(){ | ||
ArrayList list = new ArrayList(); | ||
list.add("ArrayList test 1"); | ||
list.add("ArrayList test 2"); | ||
return list; | ||
} | ||
@JSMethod(uiThread = false) | ||
public String getString(){ | ||
|
||
return "getString :i am string "; | ||
} | ||
|
||
@JSMethod(uiThread = false) | ||
public int getNumber(){ | ||
return 1111; | ||
} | ||
|
||
/** | ||
* JSON NOT allow KeyValue as non-string value | ||
* @return | ||
*/ | ||
@JSMethod(uiThread = false) | ||
public Object getObject(){ | ||
ArrayList list = new ArrayList(); | ||
list.add("222"); | ||
list.add("test"); | ||
Map map = new HashMap(); | ||
map.put(11,"test11"); | ||
map.put("22","test22"); | ||
list.add(map); | ||
return list; | ||
|
||
} | ||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.