package com.zxhyis.toolss.ui.page.photocompress.photo

import android.content.Intent
import android.graphics.Color
import android.widget.TextView
import androidx.core.view.updatePadding
import com.blankj.utilcode.util.BarUtils
import com.zxhyis.toolss.R
import com.zxhyis.toolss.base.TopActivity
import com.zxhyis.toolss.databinding.ActivityPreviewCompressionPhotoBinding
import com.zxhyis.toolss.logic.setOnClick


class PreviewCompressionPhotoActivity : TopActivity<ActivityPreviewCompressionPhotoBinding>() {

    private var mPhotoCount: Int = 0

    override fun getViewBinding1(): ActivityPreviewCompressionPhotoBinding {
        return ActivityPreviewCompressionPhotoBinding.inflate(layoutInflater)
    }

    override fun init() {
        BarUtils.setStatusBarLightMode(this, true)
        BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
        vb.root.updatePadding(top = BarUtils.getStatusBarHeight())
        mPhotoCount = intent.getIntExtra("count", 0)
        vb.fanhui.setOnClick(javaClass.simpleName){
            finish()
        }


        val manager = PreviewCompressionManager(this)


        findViewById<TextView>(R.id.btn_compress).setOnClickListener {
            val dialog = CustomDialog(this, R.layout.custom_dialog)
            dialog.setButtonClickListener(R.id.cancel) {
                dialog.dismiss()
            }

            dialog.setButtonClickListener(R.id.btnContinue) {
                CompressionPhotoListActivity.mActivity?.finish()
                val intent = Intent(this, CompressioningActivity::class.java)
                intent.putExtra("mode", manager.getMode())
                startActivity(intent)
                dialog.dismiss()
                finish()
            }
            dialog.show()
        }
    }




}