package com.gamedog.vididin.features.withdraw

import android.app.Activity
import android.content.Intent
import android.view.LayoutInflater
import androidx.activity.viewModels
import com.ama.core.architecture.appBase.AppViewsActivity
import com.ama.core.architecture.util.ResUtil
import com.ama.core.architecture.util.setOnClickBatch
import com.gamedog.vididin.R
import com.gamedog.vididin.main.interfaces.OnTabStyleListener
import com.gamedog.vididin.router.Router
import dagger.hilt.android.AndroidEntryPoint
import kotlin.getValue
import com.gamedog.vididin.databinding.ActivityWithdrawBinding as ViewBinding
import com.gamedog.vididin.main.MainUiState as UiState
import com.gamedog.vididin.main.MainViewModel as ViewModel


@AndroidEntryPoint
class WithDrawActivity : AppViewsActivity<ViewBinding, UiState, ViewModel>(), OnTabStyleListener {

    override val mViewModel: ViewModel by viewModels()
    override fun inflateViewBinding(inflater: LayoutInflater) = ViewBinding.inflate(inflater)

    override fun ViewBinding.initWindowInsets() {
        setImmerseRootView(contentRoot)
    }

    override fun ViewBinding.initViews() {

        with(binding) {
            withdraw01.setNumAndAction(ResUtil.getString(R.string.cash) + " " + 0.1, {

            })
            withdraw01.setSelected()

            withdraw10.setNumAndAction(ResUtil.getString(R.string.cash) + " " + 10, {

            })

            withdraw20.setNumAndAction(ResUtil.getString(R.string.cash) + " " + 20, {

            })

            withdraw50.setNumAndAction(ResUtil.getString(R.string.cash) + " " + 50, {

            })

            withdraw100.setNumAndAction(ResUtil.getString(R.string.cash) + " " + 100, {

            })

            withdraw300.setNumAndAction(ResUtil.getString(R.string.cash) + " " +  300, {

            })

            withdrawPix2.setIconAndText(R.mipmap.pix2, R.string.pix2, {

            })




            setOnClickBatch(tvSacar, withdrawRecord) {
                when(this) {
                    tvSacar -> {

                    }
                    withdrawRecord -> {
                        Router.WithdrawRecord.startActivity(this@WithDrawActivity)
                    }
                }
            }
        }

    }

    override fun ViewBinding.initListeners() {
        //TODO("Not yet implemented")
    }

    override fun ViewBinding.initObservers() {
        //TODO("Not yet implemented")
    }

    override fun ViewBinding.onUiStateCollect(uiState: UiState) {
        //TODO("Not yet implemented")
    }

    override fun onTabIsDarkFont(isDarkFont: Boolean) {
        //TODO("Not yet implemented")
    }


    companion object {
        internal fun startActivity(activity: Activity) {
            activity.startActivity(Intent(activity.applicationContext, WithDrawActivity::class.java))
        }
    }

}