package com.xunao.effectdemo.activity

import android.annotation.SuppressLint
import android.app.Activity
import android.os.Bundle
import android.view.View
import com.xunao.effectdemo.R
import kotlinx.android.synthetic.main.activity_view.*


/**
 * author : 程中强
 * e-mail : 740479946@qq.com
 * date : 2022/8/1610:59
 * desc :
 * version: 1.0
 */
class ActivityViewActivity : Activity(){

    private var click1 = true
    private var click2 = true
    private var click3 = true
    private var click4 = true

    @SuppressLint("ResourceAsColor")
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_view)
        rl1.setOnClickListener{v->
            view1.visibility =if (click1) View.VISIBLE else View.GONE
            click1 = !click1
        }
        rl2.setOnClickListener{v->
            view2.visibility = if (click2) View.VISIBLE else View.GONE
            click2 = !click2
        }
        rl3.setOnClickListener{v->
            view3.visibility = if (click3) View.VISIBLE else View.GONE
            click3 = !click3
        }
        rl4.setOnClickListener{v->
            view4.visibility = if (click4) View.VISIBLE else View.GONE
            click4 = !click4
        }
    }
}