package com.atmob.keyboard_android.component.base

import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.ViewGroup
import android.widget.FrameLayout

/**
 * UI组件抽象类，定义生命周期方法
 */
abstract class BaseUIComponent @JvmOverloads constructor(
    context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
) : FrameLayout(context, attrs, defStyleAttr), IUIComponent {
    init {
        val view = LayoutInflater.from(context).inflate(onInflateViewId(), this, true)
        findView(view)
        bindView(view)
    }

    override fun asView(): ViewGroup {
        return this
    }
}