class UI_AutoDetail extends UIBaseComponent {
	private titleDetail: eui.Label;
	private autoDetailTips: eui.Label;

	private detailScroller: eui.Scroller;
	private detailList: eui.DataGroup;
	private btnClose: eui.Button;
	private btnComfirm: eui.Button;

	public constructor() {
		super();
	}

	/**
	 * 绑定事件
	 */
	protected bindEvents(): void {
		super.bindEvents();

		mouse.setButtonMode(this.btnClose, true);

		this.btnClose.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onBtnClose,this);
	}

	/**
	 * 创建完成时调用
	 */
	protected onCreate(): void {
		super.onCreate();

		this.render();
		this.onLangChange();
	}

	private onBtnClose(){
		Auto.instance.closeAutoDetailView();
	}
	

	/**
	 * 渲染UI时调用
	 */
	protected render(): void {
		this.horizontalCenter="0";
		this.verticalCenter="0";

		(this.detailScroller.verticalScrollBar.thumb as eui.Image ).source= "pc_json.pc_board10";
		this.detailList.itemRenderer = UI_AutoDetailItem;
		this.detailList.dataProvider = new eui.ArrayCollection();
	}

	/**
	 * 改变语言时调用
	 */
	protected onLangChange(ev?: egret.Event): void {
		let {Auto} = Lang.instance.lang();

		this.titleDetail.text = Auto.titleDetail;
		this.autoDetailTips.text = Auto.autoDetailTips;

		let arr = [];
		for(let i=0;i<50;i++) {
			let obj = [];
			arr.push(obj)
		}

		(this.detailList.dataProvider as eui.ArrayCollection).source = arr;
		
	}

	/**
	 * 界面关闭时调用
	 */
	public onClose(): void {
	}
}