package com.swago.room.dialog

import android.os.Bundle
import android.view.Gravity
import com.swago.baseswago.dialog.BaseXDFragment
import com.swago.baseswago.util.NoDoubleClickListener
import com.swago.baseswago.util.TimeUtil
import com.swago.room.databinding.DialogCanStartLiveBinding
import java.sql.Time

class CanStartLiveDialog : BaseXDFragment<DialogCanStartLiveBinding>() {

    init {
        setGravity(Gravity.BOTTOM)
        setDimAmount(0.5f)
        setCanCancel(false)
    }

    companion object{
        fun newInstance(time:Long): CanStartLiveDialog {
            val args = Bundle()
            args.putLong("time",time)
            val fragment = CanStartLiveDialog()
            fragment.arguments = args
            return fragment
        }
    }

    override fun initOther() {
        arguments?.let {
            val time = it.getLong("time",0L)
            binding.tvTime.text = TimeUtil.convertHours(time)
        }

        binding.tvClose.setOnClickListener(object: NoDoubleClickListener(){
            override fun onClick() {
                dismissAllowingStateLoss()
            }
        })
    }

    override fun initLiveData() {
    }
}