package com.gamedog.vididin.main

import android.app.Activity
import com.ama.core.architecture.util.eventbus.NotifyMan
import com.ama.core.architecture.util.setOnClickBatch
import com.ama.core.architecture.widget.BindingDialog
import com.gamedog.vididin.VididinEvents
import com.gamedog.vididin.databinding.DialogBeginnerGiftBinding
import com.gamedog.vididin.router.Router


class BeginnerGiftDialog(activity: Activity) : BindingDialog<DialogBeginnerGiftBinding>(activity, DialogBeginnerGiftBinding::inflate) {

    init {
        build()
    }


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

        mBinding.run {
            setOnClickBatch(tvAction) {
                when (this) {
                    tvAction ->  {
                        if (mActivity is MainActivity) {
                            (mActivity as MainActivity).switchTab(1)
                        }
                        NotifyMan.instance().sendEvent(VididinEvents.EVENT_JUMP_2_FIRST_WITHDRAW, null)
                        dismiss()
                    }
                }
            }
        }
    }

    private fun gotoWatchVideo() {
        Router.Withdraw.startActivity(mActivity)
    }



}

