package com.gingersoft.gsa.cloud.bean;

import android.view.inputmethod.EditorInfo;

import java.util.List;

import lombok.Data;

/**
 * @author 宇航.
 * User: admin
 * Date: 2020/11/20
 * Time: 10:45
 * Use: 多功能列表item實體類，多功能adapter使用
 */
@Data
public class InfoMultiBean {
    /**
     * 顯示一條分割線
     */
    public static final int ITEM_TYPE_LINE = 0;

    /**
     * 顯示一條字體加粗的標題
     */
    public static final int ITEM_TYPE_TITLE = 1;

    /**
     * 顯示輸入框
     */
    public static final int ITEM_TYPE_INPUT = 2;
    /**
     * 選中時顯示列表，如果不添加列表數據，則是單選按鈕
     */
    public static final int ITEM_TYPE_SHOW_LIST = 4;
    /**
     * 選中時顯示彈窗
     */
    public static final int ITEM_TYPE_SHOW_DIALOG = 5;


    /**
     * item類型
     */
    public int itemType;
    /**
     * 用於顯示的標題
     */
    private String showTitle;
    /**
     * 是否必填
     */
    private boolean isRequired;

    /**
     * 提示文字
     */
    private String hintText;
    /**
     * 顯示的值
     */
    private String showValue;
    /**
     * 選中狀態
     */
    private boolean isChecked;
    /**
     * 當類型為輸入框時，限制輸入的內容格式
     */
    private int inputType = EditorInfo.TYPE_CLASS_TEXT;
    /**
     * 點擊展開有其他item
     */
    private List<InfoMultiBean> infoMultiBeans;

    public InfoMultiBean(int itemType) {
        this.itemType = itemType;
    }

    public InfoMultiBean(int itemType, String showTitle, boolean isRequired, String hintText, String showValue) {
        this.itemType = itemType;
        this.showTitle = showTitle;
        this.isRequired = isRequired;
        this.hintText = hintText;
        this.showValue = showValue;
    }

    public InfoMultiBean(int itemType, String showTitle) {
        this.itemType = itemType;
        this.showTitle = showTitle;
    }

    public InfoMultiBean(int itemType, String showTitle, boolean isRequired, String hintText) {
        this.itemType = itemType;
        this.showTitle = showTitle;
        this.isRequired = isRequired;
        this.hintText = hintText;
    }

//    public String getShowValue() {
//        if(showValue == null){
//            return "";
//        }
//        return showValue;
//    }


    public boolean isChecked() {
        return isChecked;
    }

    public void setChecked(boolean checked) {
        isChecked = checked;
    }
}
