package com.genlot.ninglottery.game.bet;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.FrameLayout;

import java.util.ArrayList;
import java.util.List;

import butterknife.ButterKnife;
import butterknife.Unbinder;

/**
 * @author ZhuYongKang
 * @description 投注界面基类
 * @date 2019/8/28
 */
public abstract class BetView extends FrameLayout {
    public Context mContext;
    private Unbinder mBinder;
    public int mCurrentRow;
    public List<IBetBean> mBetList;

    public BetView(Context context) {
        this(context, null);
    }

    public BetView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public BetView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        this.mContext = context;
        LayoutInflater.from(mContext).inflate(getLayoutID(), this, true);
        mBinder = ButterKnife.bind(this);
        mCurrentRow = 0;
        mBetList = new ArrayList<>();
    }

    @Override
    protected void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        mBinder.unbind();
    }

    public abstract void rowChange(int newRow);

    public abstract int getLayoutID();

    protected abstract void initData();

    public abstract void clear();

    public abstract String[] getBetData();

    public abstract void parseBetData(String[] betData);
}
