[6.7.0] wsit

This commit is contained in:
EmArrow
2024-09-23 14:55:11 +08:00
parent 0b84e5414a
commit e356b741f0

View File

@@ -5,6 +5,8 @@ import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.function.api.och.IOchFunctionCall
import com.mogo.eagle.core.function.call.och.CallerOchFunctionCallManager
import com.mogo.eagle.core.function.hmi.R
import kotlinx.android.synthetic.main.view_bone_container.view.clBoneBiz
import kotlinx.android.synthetic.main.view_bone_container.view.clBoneTab
@@ -14,7 +16,11 @@ class BoneContainerView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr) {
) : ConstraintLayout(context, attrs, defStyleAttr), IOchFunctionCall {
companion object{
private const val TAG = "BoneContainerView"
}
init {
LayoutInflater.from(context).inflate(R.layout.view_bone_container, this, true)
@@ -23,6 +29,16 @@ class BoneContainerView @JvmOverloads constructor(
private var logOut: (() -> Unit)? = null
override fun onAttachedToWindow() {
super.onAttachedToWindow()
CallerOchFunctionCallManager.addListener(TAG, this)
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
CallerOchFunctionCallManager.removeListener(TAG)
}
private fun initView() {
clBoneTab.loginOut {
logOut?.invoke()