package com.casic.detector.view

import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.os.Bundle
import android.view.Gravity
import com.casic.detector.databinding.ActivityNewObjectDetailBinding
import com.pengxh.kt.lite.base.KotlinBaseActivity
import com.pengxh.kt.lite.extensions.getScreenHeight
import com.pengxh.kt.lite.extensions.getScreenWidth
import com.pengxh.kt.lite.extensions.show
import com.pengxh.kt.lite.utils.Constant

class NewObjectDetailActivity : KotlinBaseActivity<ActivityNewObjectDetailBinding>() {

    override fun initViewBinding(): ActivityNewObjectDetailBinding {
        return ActivityNewObjectDetailBinding.inflate(layoutInflater)
    }

    override fun setupTopBarLayout() {

    }

    override fun observeRequestState() {

    }

    override fun initOnCreate(savedInstanceState: Bundle?) {
        window.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
        window.decorView.setBackgroundColor(Color.TRANSPARENT)
        window.setGravity(Gravity.CENTER)
        val params = window.attributes
        params.width = ((getScreenWidth() * 0.9).toInt())
        params.height = ((getScreenHeight() * 0.3).toInt())
        window.attributes = params

        val identifierId = intent.getStringExtra(Constant.INTENT_PARAM)!!
        binding.identifierIdView.text = identifierId
    }

    override fun initEvent() {
        binding.closeView.setOnClickListener { finish() }
        binding.showImageView.setOnClickListener {
            finish()
            "此对象没相关照片".show(this)
        }
    }
}