import { BaseListAdapter , AdapterContainer , Log , } from "../../index" ; import { Container } from "pixi.js" ; export class ListAdapter extends BaseListAdapter < any > { classz : Object | undefined ; constructor ( data ) { super ( data ) ; } param classz setClass ( classz ) { this . classz = classz ; } setBaseListAdapterData ( data ) { this . data = data ; } /**
   * 测量
   */ getRemeasure ( position , convertView ) { if ( ! this . classz ) { throw new Error ( " ListAdapter 请注册class，调用 setClass 注册class" ) ; } let cl = < any > this . classz ; if ( ! convertView ) { convertView = new cl ( ) ; } if ( ! convertView ) { return ; } convertView . _CurrIndex = position ; let isOpen = convertView . measure ( this . getItem ( position ) , position ) ; return { container : convertView , isOpen : ! ! isOpen } ; } getAdapterContainer ( position , convertView , parent ) { if ( ! this . classz ) { throw new Error ( " ListAdapter 请注册class，调用 setClass 注册class" ) ; } let cl = < any > this . classz ; if ( ! convertView ) { convertView = new cl ( ) ; } if ( convertView ) { convertView . _CurrIndex = position ; convertView . setData ( this . getItem ( position ) , position ) ; } return < AdapterContainer > convertView ; } }