package com.gamedog.vididin.main.fragments.task

import android.content.Context
import com.ama.core.architecture.util.setOnClickBatch
import com.ama.core.architecture.widget.BindingDialog
import com.gamedog.vididin.databinding.DialogDailySignSuccessBinding as ViewBinding


class DailySignSuccessDialog(context: Context) : BindingDialog<ViewBinding>(context, ViewBinding::inflate) {

    init {
        build()
    }

    private fun build() {
        with()
        setCenter()
        setCanCancel(false)
        setMaskValue(0.9f)
        setWidthRatio(0.93)


        mBinding.run {
            setOnClickBatch(flAction, ivClose) {
                when (this) {
                    ivClose ->  {
                        dismiss()
                    }
                    flAction ->  {
                        dismiss()
                        gotoWatchAdPage()
                    }
                }
            }
        }
    }

    private fun gotoWatchAdPage() {
        //TODO("Not yet implemented")
    }

    fun setRewardNum(goldNum: Int?) : DailySignSuccessDialog {
        mBinding.tvGoldNum.text = "+$goldNum"
        return this
    }


}

