Skip to content

Commit dab9781

Browse files
author
野松
committed
request update: demo update
1 parent 26c26a0 commit dab9781

File tree

1 file changed

+6
-23
lines changed

1 file changed

+6
-23
lines changed

Android/LuaViewDemo/src/com/taobao/luaview/demo/activity/DemoLuaViewActivity.java

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -109,28 +109,7 @@ private void extendsLuaView(final LuaView luaView) {
109109
* 加载数据
110110
*/
111111
public void loadScript(final LuaView luaView) {
112-
// luaView.load(getLuaUri(), new LuaScriptLoader.ScriptExecuteCallback() {
113-
// @Override
114-
// public boolean onScriptPrepared(ScriptBundle bundle) {
115-
// return false;
116-
// }
117-
//
118-
// @Override
119-
// public boolean onScriptCompiled(LuaValue value, LuaValue context, LuaValue view) {
120-
// return false;
121-
// }
122-
//
123-
// @Override
124-
// public void onScriptExecuted(String uri, boolean executedSuccess) {
125-
// //测试调用 lua function
126-
// LogUtil.d("call-lua-function return:", luaView.callLuaFunction("global_fun_test1", 1, "a", 0.1));
127-
// LogUtil.d("call-lua-function return:", JsonUtil.toString(luaView.callLuaFunction("global_fun_test2", 2, "b", 0.2)));
128-
// LogUtil.d("call-window-function return:", luaView.callWindowFunction("window_fun1", 3, "c", 0.3));
129-
// LogUtil.d("call-window-function return:", luaView.callWindowFunction("window_fun2", 4, "d", 0.4));
130-
// }
131-
// });
132-
133-
luaView.load("file:///android_asset/luaview/test.szip", new LuaScriptLoader.ScriptExecuteCallback() {
112+
luaView.load(getLuaUri(), new LuaScriptLoader.ScriptExecuteCallback() {
134113
@Override
135114
public boolean onScriptPrepared(ScriptBundle bundle) {
136115
return false;
@@ -143,7 +122,11 @@ public boolean onScriptCompiled(LuaValue value, LuaValue context, LuaValue view)
143122

144123
@Override
145124
public void onScriptExecuted(String uri, boolean executedSuccess) {
146-
125+
//测试调用 lua function
126+
LogUtil.d("call-lua-function return:", luaView.callLuaFunction("global_fun_test1", 1, "a", 0.1));
127+
LogUtil.d("call-lua-function return:", JsonUtil.toString(luaView.callLuaFunction("global_fun_test2", 2, "b", 0.2)));
128+
LogUtil.d("call-window-function return:", luaView.callWindowFunction("window_fun1", 3, "c", 0.3));
129+
LogUtil.d("call-window-function return:", luaView.callWindowFunction("window_fun2", 4, "d", 0.4));
147130
}
148131
});
149132
}

0 commit comments

Comments
 (0)