Java Code Examples for org.luaj.vm2.Globals#saveContainer()

The following examples show how to use org.luaj.vm2.Globals#saveContainer() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LVCustomViewPagerIndicator.java    From VideoOS-Android-SDK with GNU General Public License v3.0 6 votes vote down vote up
/**
 * create view
 *
 * @param pos
 * @return
 */
 LuaValue createView(int pos, int currentItem) {
    Globals globals = this.mLuaUserdata.getGlobals();
    //View封装
     LVViewGroup container = createCellLayout();
     UDViewGroup cell = new UDViewGroup(container, globals, null);
    //对外数据封装,必须使用LuaTable
     UDLuaTable cellData = new UDLuaTable(cell);

    //call init

    globals.saveContainer(container);
    this.mLuaUserdata.callCellInit(cellData, pos, currentItem);//初始化
    globals.restoreContainer();

    //set tag
    View view = cellData.getView();
    if (view != null) {
        view.setTag(Constants.RES_LV_TAG, cellData);
    }
    return cellData;
}
 
Example 2
Source File: LVRefreshRecyclerView.java    From VideoOS-Android-SDK with GNU General Public License v3.0 5 votes vote down vote up
private void init(Globals globals) {
    globals.saveContainer(mRecyclerView);
    this.addView(mRecyclerView, LuaViewUtil.createRelativeLayoutParamsMM());
    globals.restoreContainer();

    if (!globals.isRefreshContainerEnable) {
        this.setEnabled(false);
    } else {
        ((UDRefreshRecyclerView) getUserdata()).initPullRefresh();
    }
}
 
Example 3
Source File: LVRefreshListView.java    From VideoOS-Android-SDK with GNU General Public License v3.0 5 votes vote down vote up
private void init(Globals globals) {
    globals.saveContainer(mListView);
    this.addView(mListView, LuaViewUtil.createRelativeLayoutParamsMM());
    globals.restoreContainer();

    if (!globals.isRefreshContainerEnable) {
        this.setEnabled(false);
    } else {
        ((UDRefreshListView) getUserdata()).initPullRefresh();
    }
}
 
Example 4
Source File: LVListView.java    From VideoOS-Android-SDK with GNU General Public License v3.0 4 votes vote down vote up
private void init(Globals globals) {
    globals.saveContainer(this);
    initData(globals);
    globals.restoreContainer();
}
 
Example 5
Source File: LVViewPager.java    From VideoOS-Android-SDK with GNU General Public License v3.0 4 votes vote down vote up
private void init(Globals globals) {
    LuaViewUtil.setId(this);//TODO 必须设置,且每个ViewPager要有唯一id android.content.res.Resources$NotFoundException: Unable to find resource ID #0xffffffff
    globals.saveContainer(this);
    initData(globals);
    globals.restoreContainer();
}