@@ -109,28 +109,7 @@ private void extendsLuaView(final LuaView luaView) {
109
109
* 加载数据
110
110
*/
111
111
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 () {
134
113
@ Override
135
114
public boolean onScriptPrepared (ScriptBundle bundle ) {
136
115
return false ;
@@ -143,7 +122,11 @@ public boolean onScriptCompiled(LuaValue value, LuaValue context, LuaValue view)
143
122
144
123
@ Override
145
124
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 ));
147
130
}
148
131
});
149
132
}
0 commit comments