Search in sources :

Example 1 with LVListViewAdapter

use of com.taobao.luaview.view.adapter.LVListViewAdapter in project LuaViewSDK by alibaba.

the class LVListView method initData.

/**
     * 初始化子元素
     */
private void initData(Globals globals) {
    //        initHeaderContainer();
    //        initFooterContainer();
    mAdapter = new LVListViewAdapter(globals, mLuaUserdata);
    this.setAdapter(mAdapter);
    this.setOnItemClickListener(new AdapterView.OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            final UDLuaTable cellData = (UDLuaTable) view.getTag();
            final int row = position - LVListView.this.getHeaderViewsCount();
            mAdapter.onCellClicked(cellData, row);
        }
    });
    this.setOnItemLongClickListener(new OnItemLongClickListener() {

        @Override
        public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
            final UDLuaTable cellData = (UDLuaTable) view.getTag();
            final int row = position - LVListView.this.getHeaderViewsCount();
            return mAdapter.onCellLongClicked(cellData, row);
        }
    });
    this.setSelector(android.R.color.transparent);
    //设置divider颜色透明
    this.setDivider(new ColorDrawable(Color.TRANSPARENT));
    mLuaUserdata.initOnScrollCallback(this);
}
Also used : UDLuaTable(com.taobao.luaview.userdata.base.UDLuaTable) ColorDrawable(android.graphics.drawable.ColorDrawable) LVListViewAdapter(com.taobao.luaview.view.adapter.LVListViewAdapter) AdapterView(android.widget.AdapterView) UDBaseListView(com.taobao.luaview.userdata.list.UDBaseListView) UDView(com.taobao.luaview.userdata.ui.UDView) UDListView(com.taobao.luaview.userdata.list.UDListView) View(android.view.View) ILVListView(com.taobao.luaview.view.interfaces.ILVListView) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView)

Aggregations

ColorDrawable (android.graphics.drawable.ColorDrawable)1 View (android.view.View)1 AdapterView (android.widget.AdapterView)1 ListView (android.widget.ListView)1 UDLuaTable (com.taobao.luaview.userdata.base.UDLuaTable)1 UDBaseListView (com.taobao.luaview.userdata.list.UDBaseListView)1 UDListView (com.taobao.luaview.userdata.list.UDListView)1 UDView (com.taobao.luaview.userdata.ui.UDView)1 LVListViewAdapter (com.taobao.luaview.view.adapter.LVListViewAdapter)1 ILVListView (com.taobao.luaview.view.interfaces.ILVListView)1