package com.zxbw.modulemain.activity

import android.view.View
import com.zxbw.modulemain.R
import com.zxhl.cms.common.base.BaseActivity
import com.zxhl.cms.utils.JumpUtils
import kotlinx.android.synthetic.main.activity_layout_user_question.*
import me.jessyan.autosize.utils.ScreenUtils

/**
 * @author (wangXuewei)
 * @datetime 2022-06-21 15:40 GMT+8
 * @detail :
 */
class UserQuestionActivity : BaseActivity() {

    override fun layoutID(): Int {
        return R.layout.activity_layout_user_question
    }

    override fun init() {
        var statusBarHeight = ScreenUtils.getStatusBarHeight()
        if (statusBarHeight <= 0) {
            statusBarHeight = 40
        }
        id_sys_bar_view.layoutParams.height = statusBarHeight

        id_ll_question_1.setOnClickListener(this)
        id_ll_question_2.setOnClickListener(this)
        id_ll_question_3.setOnClickListener(this)
        id_ll_question_4.setOnClickListener(this)
        id_ll_question_5.setOnClickListener(this)
        id_ll_kefu.setOnClickListener(this)
        id_img_back.setOnClickListener(this)
    }


    override fun onClick(v: View?) {
        when (v) {
            id_ll_question_1 -> {
                if (id_tv_answer_1.visibility == View.VISIBLE) {
                    id_check_question_1.isChecked = false
                    id_tv_answer_1.visibility = View.GONE
                } else {
                    id_check_question_1.isChecked = true
                    id_tv_answer_1.visibility = View.VISIBLE
                }
            }
            id_ll_question_2 -> {
                if (id_tv_answer_2.visibility == View.VISIBLE) {
                    id_check_question_2.isChecked = false
                    id_tv_answer_2.visibility = View.GONE
                } else {
                    id_check_question_2.isChecked = true
                    id_tv_answer_2.visibility = View.VISIBLE
                }
            }
            id_ll_question_3 -> {
                if (id_tv_answer_3.visibility == View.VISIBLE) {
                    id_check_question_3.isChecked = false
                    id_tv_answer_3.visibility = View.GONE
                } else {
                    id_check_question_3.isChecked = true
                    id_tv_answer_3.visibility = View.VISIBLE
                }
            }
            id_ll_question_4 -> {
                if (id_tv_answer_4.visibility == View.VISIBLE) {
                    id_check_question_4.isChecked = false
                    id_tv_answer_4.visibility = View.GONE
                } else {
                    id_check_question_4.isChecked = true
                    id_tv_answer_4.visibility = View.VISIBLE
                }
            }
            id_ll_question_5 -> {
                if (id_tv_answer_5.visibility == View.VISIBLE) {
                    id_check_question_5.isChecked = false
                    id_tv_answer_5.visibility = View.GONE
                } else {
                    id_check_question_5.isChecked = true
                    id_tv_answer_5.visibility = View.VISIBLE
                }
            }
            id_ll_kefu -> {
                JumpUtils.UDesk()
            }
            id_img_back -> {
                finish()
            }
        }

    }

}