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

import android.app.Activity
import androidx.core.view.isVisible
import com.ama.core.architecture.util.setOnClickBatch
import com.ama.core.architecture.widget.BindingDialog
import com.gamedog.vididin.databinding.DialogDailySignSuccessBinding as ViewBinding


class DailySignSuccessDialog(activity: Activity) : BindingDialog<ViewBinding>(activity, 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 initData(goldNum: Int?, showAdBut: Boolean) : DailySignSuccessDialog {
        mBinding.tvGoldNum.text = "+$goldNum"
        mBinding.tvGoldNumBut.text = "+$goldNum"
        mBinding.flAction.isVisible = showAdBut
        return this
    }


}

