package com.example.tfat.myapplication.navigationbar

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

class NavigationBarView : RelativeLayout{
    private lateinit var scene : RelativeLayout
    private lateinit var actor : RelativeLayout
    private lateinit var brush : RelativeLayout
    private lateinit var dialogue : RelativeLayout
    private lateinit var image : ImageButton
    private lateinit var settings : ImageButton

    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.navigation_bar_view, this, true)
        scene = rootView.findViewById(R.id.scene)
        actor = rootView.findViewById(R.id.actor)
        brush = rootView.findViewById(R.id.brush)
        dialogue = rootView.findViewById(R.id.dialogue)
//        scene = rootView.scene_btn
//        actor = rootView.actor_btn
//        brush = rootView.brush_btn
//        dialogue = rootView.dialogue_btn
//        image = rootView.image_btn
//        settings = rootView.settings
    }

    fun setonClickSceneBtn(onClickListener: OnClickListener) {
        scene.setOnClickListener(onClickListener)
    }

    fun setonClickActorBtn(onClickListener: OnClickListener) {
        actor.setOnClickListener(onClickListener)
    }

    fun setonClickBrushBtn(onClickListener: OnClickListener) {
        brush.setOnClickListener(onClickListener)
    }

    fun setonClickDialogueBtn(onClickListener: OnClickListener) {
        dialogue.setOnClickListener(onClickListener)
    }
}