[6.7.0] add interface in ui view
This commit is contained in:
@@ -3,8 +3,12 @@ package com.mogo.eagle.core.function.hmi.bone
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
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
|
||||
import kotlinx.android.synthetic.main.view_bone_tab.view.carInfoTabView
|
||||
|
||||
class BoneContainerView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
@@ -17,9 +21,27 @@ class BoneContainerView @JvmOverloads constructor(
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
private var logOut: (() -> Unit)? = null
|
||||
|
||||
private fun initView() {
|
||||
clBoneTab.loginOut {
|
||||
logOut?.invoke()
|
||||
}
|
||||
}
|
||||
|
||||
fun addBizView(view: View) {
|
||||
clBoneBiz.addView(view)
|
||||
}
|
||||
|
||||
fun setCarNo(carNo: String){
|
||||
clBoneTab.setCarNo(carNo)
|
||||
}
|
||||
|
||||
fun setLoginInfo(loginNo: String){
|
||||
clBoneTab.setLoginInfo(loginNo)
|
||||
}
|
||||
|
||||
fun loginOut(logOut:(() -> Unit)){
|
||||
this.logOut = logOut
|
||||
}
|
||||
}
|
||||
@@ -42,6 +42,8 @@ class BoneTabLayout @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
private var logOut:(() -> Unit)? = null
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_bone_tab, this, true)
|
||||
initView()
|
||||
@@ -60,6 +62,23 @@ class BoneTabLayout @JvmOverloads constructor(
|
||||
tabSwitchMore.setOnClickListener {
|
||||
updateTabType(TabType.MORE_INFO)
|
||||
}
|
||||
|
||||
carInfoTabView.loginOut {
|
||||
logOut?.invoke()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun setCarNo(carNo: String){
|
||||
carInfoTabView.setCarNo(carNo)
|
||||
}
|
||||
|
||||
fun setLoginInfo(loginNo: String){
|
||||
carInfoTabView.setLoginInfo(loginNo)
|
||||
}
|
||||
|
||||
fun loginOut(logOut:(() -> Unit)){
|
||||
this.logOut = logOut
|
||||
}
|
||||
|
||||
private fun updateTabType(changeType: TabType) {
|
||||
@@ -108,4 +127,5 @@ class BoneTabLayout @JvmOverloads constructor(
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,8 +18,6 @@ class TabSwitchView @JvmOverloads constructor(
|
||||
|
||||
private var tabDefaultRes = -1
|
||||
private var tabClickRes = -1
|
||||
private var tabClickBgRes = -1
|
||||
|
||||
private var isCheck = false
|
||||
|
||||
init {
|
||||
|
||||
Reference in New Issue
Block a user