use of org.luaj.vm2.Varargs in project LuaViewSDK by alibaba.
the class UIRefreshRecyclerViewMethodMapper method initParams.
@Override
public Varargs initParams(U view, Varargs varargs) {
Varargs ret = super.initParams(view, varargs);
this.reload(view, varargs);
return ret;
}
use of org.luaj.vm2.Varargs in project LuaViewSDK by alibaba.
the class NewIndexFunction method invoke.
@Override
public Varargs invoke(Varargs args) {
LuaValue key = args.arg(2);
Varargs newargs = varargsOf(args.arg(1), args.arg(3));
LuaValue func = metatable.get(key);
if (func.isfunction()) {
// 函数调用
func.invoke(newargs);
} else {
LogUtil.d("[LuaView error]", "property not fount :", key.toString());
}
return NONE;
}
use of org.luaj.vm2.Varargs in project LuaViewSDK by alibaba.
the class UIViewPagerMethodMapper method initParams.
@Override
public Varargs initParams(U view, Varargs varargs) {
Varargs ret = super.initParams(view, varargs);
this.reload(view, varargs);
return ret;
}
use of org.luaj.vm2.Varargs in project LuaViewSDK by alibaba.
the class UIImageViewMethodMapper method setImage.
public LuaValue setImage(U view, Varargs varargs) {
if (varargs.isstring(2)) {
final String url = varargs.optjstring(2, null);
final LuaFunction callback = varargs.optfunction(3, null);
return view.setImageUrl(url, callback);
} else if (varargs.arg(2) instanceof UDData) {
// data
final UDData data = (UDData) varargs.arg(2);
return view.setImageBytes(data != null ? data.bytes() : null);
} else if (varargs.arg(2) instanceof UDBitmap) {
// bitmap
final UDBitmap bitmap = (UDBitmap) varargs.arg(2);
return view.setImageBitmap(bitmap);
}
return view;
}
use of org.luaj.vm2.Varargs in project LuaViewSDK by alibaba.
the class HttpMethodMapper method get.
/**
* get请求
*
* @param http
* @param varargs
* @return
*/
public LuaValue get(U http, Varargs varargs) {
final String url = LuaUtil.getString(varargs, 2);
final LuaTable params = LuaUtil.getTable(varargs, 3, 2);
final LuaFunction callback = LuaUtil.getFunction(varargs, 4, 3, 2);
return http.get(url, params, callback);
}
Aggregations