本文整理汇总了Java中org.luaj.vm2.Varargs.optboolean方法的典型用法代码示例。如果您正苦于以下问题:Java Varargs.optboolean方法的具体用法?Java Varargs.optboolean怎么用?Java Varargs.optboolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.luaj.vm2.Varargs
的用法示例。
在下文中一共展示了Varargs.optboolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startAnimationImages
import org.luaj.vm2.Varargs; //导入方法依赖的package包/类
/**
* 开始帧动画
*
* @param view
* @param varargs 时间是秒而不是毫秒
* @return
*/
@Deprecated
public LuaValue startAnimationImages(U view, Varargs varargs) {//TODO 支持UDImageView和UDBitmap
final LuaTable imagesTable = varargs.opttable(2, null);
final double duration = varargs.optdouble(3, 1f);
boolean repeat = false;
if (varargs.isnumber(4)) {
repeat = varargs.optint(4, -1) > 0;
} else {
repeat = varargs.optboolean(4, false);
}
if (imagesTable != null && imagesTable.length() > 0) {
final String[] images = new String[imagesTable.length()];
int i = 0;
for (LuaValue key : imagesTable.keys()) {
images[i++] = imagesTable.get(key).optjstring(null);
}
return view.startAnimationImages(images, (int) duration * 1000, repeat);
}
return view;
}
示例2: invoke
import org.luaj.vm2.Varargs; //导入方法依赖的package包/类
@Override
public Varargs invoke(Varargs args) {
final ActionBar actionBar = LuaViewUtil.getActionBar(getGlobals());
if (actionBar != null) {
final boolean showBack = args.optboolean(2, true);
actionBar.setDisplayHomeAsUpEnabled(showBack);
}
return UDNavigation.this;
}
示例3: invoke
import org.luaj.vm2.Varargs; //导入方法依赖的package包/类
@Override
public Varargs invoke(Varargs args) {
final ActionBar actionBar = LuaViewUtil.getActionBar(getGlobals());
if (actionBar != null) {
final boolean showBack = args.optboolean(2, true);
actionBar.setDisplayHomeAsUpEnabled(showBack);
}
return UDActionBar.this;
}
示例4: scrollToCell
import org.luaj.vm2.Varargs; //导入方法依赖的package包/类
/**
* (x, y, w, h, animate) 滚动到指定位置
*
* @param view
* @param varargs
* @return
*/
public LuaValue scrollToCell(U view, Varargs varargs) {
final int section = LuaUtil.toJavaInt(varargs.arg(2));//lua从1开始
final int rowInSection = LuaUtil.toJavaInt(varargs.arg(3));//lua从1开始
final int offset = DimenUtil.dpiToPx(varargs.arg(4));
final boolean animate = varargs.optboolean(5, true);
return getUDBaseListOrRecyclerView(varargs).scrollToItem(section, rowInSection, offset, animate);
}
示例5: visible
import org.luaj.vm2.Varargs; //导入方法依赖的package包/类
/**
* 显示
*
* @param view
* @param varargs
* @return
*/
public LuaValue visible(U view, Varargs varargs) {
if (varargs.narg() > 1) {
boolean isShow = varargs.optboolean(2, true);
return isShow ? show(view, varargs) : hide(view, varargs);
} else {
return isShow(view, varargs);
}
}
示例6: hidden
import org.luaj.vm2.Varargs; //导入方法依赖的package包/类
/**
* 显示
*
* @param view
* @param varargs
* @return
*/
public LuaValue hidden(U view, Varargs varargs) {
if (varargs.narg() > 1) {
boolean isHide = varargs.optboolean(2, true);
return isHide ? hide(view, varargs) : show(view, varargs);
} else {
return isHide(view, varargs);
}
}
示例7: setShowScrollIndicator
import org.luaj.vm2.Varargs; //导入方法依赖的package包/类
public LuaValue setShowScrollIndicator(U view, Varargs varargs) {
final boolean horizontalIndicator = varargs.optboolean(2, false);
final boolean verticalIndicator = varargs.optboolean(3, false);
view.setHorizontalScrollBarEnabled(horizontalIndicator);
view.setVerticalScrollBarEnabled(verticalIndicator);
return view;
}
示例8: setOffset
import org.luaj.vm2.Varargs; //导入方法依赖的package包/类
public LuaValue setOffset(U view, Varargs varargs) {
final int x = DimenUtil.dpiToPx(varargs.arg(2));
final int y = DimenUtil.dpiToPx(varargs.arg(3));
final boolean smooth = varargs.optboolean(4, false);
if (smooth) {
return view.smoothScrollTo(x, y);
} else {
return view.scrollTo(x, y);
}
}
示例9: scrollTo
import org.luaj.vm2.Varargs; //导入方法依赖的package包/类
/**
* 滚动到某个位置
*
* @param view
* @param varargs
* @return
*/
@Deprecated
public LuaValue scrollTo(U view, Varargs varargs) {
final int x = DimenUtil.dpiToPx(varargs.arg(2));
final int y = DimenUtil.dpiToPx(varargs.arg(3));
final boolean smooth = varargs.optboolean(4, false);
if (smooth) {
return view.smoothScrollTo(x, y);
} else {
return view.scrollTo(x, y);
}
}
示例10: setOffsetBy
import org.luaj.vm2.Varargs; //导入方法依赖的package包/类
public LuaValue setOffsetBy(U view, Varargs varargs) {
final int x = DimenUtil.dpiToPx(varargs.arg(2));
final int y = DimenUtil.dpiToPx(varargs.arg(3));
final boolean smooth = varargs.optboolean(4, false);
if (smooth) {
return view.smoothScrollBy(x, y);
} else {
return view.scrollBy(x, y);
}
}
示例11: scrollBy
import org.luaj.vm2.Varargs; //导入方法依赖的package包/类
/**
* 滚动一段距离
*
* @param view
* @param varargs
* @return
*/
@Deprecated
public LuaValue scrollBy(U view, Varargs varargs) {
final int dx = DimenUtil.dpiToPx(varargs.arg(2));
;
final int dy = DimenUtil.dpiToPx(varargs.arg(3));
final boolean smooth = varargs.optboolean(4, false);
if (smooth) {
return view.smoothScrollBy(dx, dy);
} else {
return view.scrollBy(dx, dy);
}
}
示例12: setSnap
import org.luaj.vm2.Varargs; //导入方法依赖的package包/类
public LuaValue setSnap(U view, Varargs varargs) {
final boolean snap = varargs.optboolean(2, false);
return view.setSnap(snap);
}
示例13: setShowScrollIndicator
import org.luaj.vm2.Varargs; //导入方法依赖的package包/类
public LuaValue setShowScrollIndicator(U view, Varargs varargs) {
final boolean isShow = varargs.optboolean(2, true);
return view.setVerticalScrollBarEnabled(isShow);
}
示例14: setEnabled
import org.luaj.vm2.Varargs; //导入方法依赖的package包/类
public LuaValue setEnabled(U view, Varargs args) {
final boolean enable = args.optboolean(2, true);
return view.setEnabled(enable);
}
示例15: setClipsToBounds
import org.luaj.vm2.Varargs; //导入方法依赖的package包/类
public LuaValue setClipsToBounds(U view, Varargs varargs) {
final boolean clipsToBounds = varargs.optboolean(2, false);
//TODO
return view;
}