package com.gh.gamecenter.entity

import android.graphics.Color
import android.os.Parcelable
import com.gh.gamecenter.common.entity.Display
import com.google.gson.annotations.SerializedName
import kotlinx.parcelize.Parcelize

/**
 * Created by khy on 2016/12/7.
 */

@Parcelize
data class SubjectRecommendEntity(
    @SerializedName(value = "link", alternate = ["link_id"])
    var link: String? = null,

    @SerializedName("name_normal")
    var nameNormal: String? = null,

    @SerializedName("text", alternate = ["link_text"])
    var text: String? = null,

    var icon: String? = null,

    var name: String? = null,

    @SerializedName("type", alternate = ["link_type"])
    var type: String? = null,

    var order: Boolean = false,

    // 首页入口控制
    var default: Boolean = false,
    @SerializedName("icon_select")
    var iconSelect: String = "",
    @SerializedName("icon_unselect")
    var iconUnselect: String = "",
    @SerializedName("js_code")
    var animationCode: String = "",

    var display: Display = Display(),

    var img: String? = "",
    @SerializedName("tab_show_img")
    var showImgOnSelected: Boolean? = false, // 选中时是否显示图片

    // local variable
    var useLightStyle: Boolean = false,
    var primaryColor: Int = Color.WHITE,
    var offsetRatio: Float = 0f,
    var currentSelectColor: Int = 0,
    var isTopViewShow: Boolean = true,
    var isSlideEmpty: Boolean = false, // 首页轮播图是否为空
) : Parcelable {

    /*init {
        if (primaryColor == Color.WHITE) {
//            val rnd = Random()
//            primaryColor = Color.argb(255, rnd.nextInt(256), rnd.nextInt(256), rnd.nextInt(256))
            useLightStyle = ColorUtils.calculateLuminance(primaryColor) < 0.50
        }
    }*/
}

