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);
}
Aggregations