package com.kdanmobile.reader.view

import android.content.Context
import android.graphics.Color
import android.support.constraint.ConstraintLayout
import android.util.AttributeSet
import android.view.View
import com.kdanmobile.reader.R
import kotlinx.android.synthetic.main.view_color_opacity_displayer.view.*

/**
 * 現在不顯示透明度的放大鏡，暫時不會用到這個 View，但請不要刪除它 QAQ
 */
class ColorOpacityDisplayerView @JvmOverloads constructor(
        context: Context,
        attrs: AttributeSet? = null,
        defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr) {
    init {
        View.inflate(context, R.layout.view_color_opacity_displayer, this)
    }

    var color = Color.BLACK
        set(value) {
            field = value
            update()
        }

    private fun update() {
        view_colorOpacityDisplayer_color.setBackgroundColor(color)
    }
}