package com.ytpm.hydtw.activity

import android.os.Bundle
import android.view.Gravity
import androidx.fragment.app.FragmentActivity
import com.blankj.utilcode.util.ToastUtils
import com.ytpm.hydtw.R
import com.ytpm.hydtw.databinding.ActivityFeedbackBinding

class FeedbackActivity : FragmentActivity() {

    private lateinit var binding: ActivityFeedbackBinding

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        binding = ActivityFeedbackBinding.inflate(layoutInflater)
        initTool()
        initView()
        setContentView(binding.root)
    }

    private fun initTool() {
        binding.barll.title.text = "意见反馈"
        binding.barll.back.setOnClickListener { finish() }
    }

    private fun initView() {
        binding.submit.setOnClickListener {
            if (binding.feedbackContent.text.isNullOrEmpty()) {
                ToastUtils.showShort("请填写反馈内容")
                return@setOnClickListener
            }

            ToastUtils
                .make()
                .setMode(ToastUtils.MODE.DARK)
                .setGravity(Gravity.CENTER, 0, 0)
                .setTopIcon(R.mipmap.icon_success)
                .setDurationIsLong(true)
                .show("提交成功")
            finish()
        }
    }
}