package com.example.tfat.myapplication.navigationbar.scene

import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.RelativeLayout
import com.example.tfat.myapplication.R

class ControlSceneView : RelativeLayout{
    private lateinit var addScene : RelativeLayout
    private lateinit var duplicate : RelativeLayout
    constructor(context : Context) : super(context) {
        initView()
    }

    constructor(context: Context, attrs: AttributeSet): super(context, attrs) {
        initView()
    }

    constructor(context: Context, attrs: AttributeSet, defStyle: Int): super(context, attrs, defStyle) {
        initView()
    }


    private fun initView(){
        val inflater = LayoutInflater.from(context)
        var rootView = inflater.inflate(R.layout.scene_control_view, this, true)
        addScene = rootView.findViewById(R.id.add)
        duplicate = rootView.findViewById(R.id.duplicate)
    }

    fun setonClickAddBtn(onClickListener: OnClickListener) {
        addScene.setOnClickListener(onClickListener)
    }

    fun setonClickDuplicateBtn(onClickListener: OnClickListener) {
        duplicate.setOnClickListener(onClickListener)
    }
}