package com.autotech.we1l.my_classes

import android.os.Bundle
import android.support.v4.app.DialogFragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup

open class BaseDialogFragment : DialogFragment() {

    lateinit var rootView: View


//    override val containerView by unsafeLazy {
//        rootView as ViewGroup
//    }

    fun <T : View> findViewById(id: Int): T? {
        return rootView.findViewById(id)
    }

    open fun setupViews() {

    }

    open fun setupLanguages() {

    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        setupViews()
        setupLanguages()
    }

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        return rootView
    }
}