[fea]
[展示所有事件]
This commit is contained in:
yangyakun
2024-07-18 14:46:23 +08:00
parent 776688625d
commit 21918ec895
2 changed files with 38 additions and 34 deletions

View File

@@ -32,21 +32,21 @@ class OverMapView @JvmOverloads constructor(
private val listener = object : TravelRealityView.OnDrawListener{
override fun onDraw(eventList: List<EventDrawBean>, isEvent: Boolean) {
if(isEvent){
eventDrawBeansTrue.clear()
eventDrawBeansTrue.addAll(eventList)
}else{
eventDrawBeansFalse.clear()
eventDrawBeansFalse.addAll(eventList)
}
iconListItemAdapter?.let {
it.setDataList(eventDrawBeansTrue+eventDrawBeansFalse)
if(it.itemCount==0){
ovbv_bottom_icons_cl.visibility = GONE
}else{
ovbv_bottom_icons_cl.visibility = VISIBLE
}
}
// if(isEvent){
// eventDrawBeansTrue.clear()
// eventDrawBeansTrue.addAll(eventList)
// }else{
// eventDrawBeansFalse.clear()
// eventDrawBeansFalse.addAll(eventList)
// }
// iconListItemAdapter?.let {
// it.setDataList(eventDrawBeansTrue+eventDrawBeansFalse)
// if(it.itemCount==0){
// ovbv_bottom_icons_cl.visibility = GONE
// }else{
// ovbv_bottom_icons_cl.visibility = VISIBLE
// }
// }
}
}
@@ -66,12 +66,14 @@ class OverMapView @JvmOverloads constructor(
//ovbv_bottom_icons?.setHasFixedSize(true)
iconListItemAdapter = IconListItemAdapter(
context, mutableListOf(
EventDrawBean(R.drawable.mogo_quanxi_lukou, "全息路口"),
EventDrawBean(R.drawable.mogo_jingzhi_nor, "静止事件"),
EventDrawBean(R.drawable.mogo_shigong_image, "道路施工"),
EventDrawBean(R.drawable.mogo_shigu_nor, "交通事故")
)
)
ovbv_bottom_icons?.adapter = iconListItemAdapter
ovbv_bottom_icons_cl.visibility = GONE
travelRealityView.setOnDrawListener(listener)

View File

@@ -33,21 +33,21 @@ class OverMapView @JvmOverloads constructor(
private val listener = object :TravelRealityView.OnDrawListener{
override fun onDraw(eventList: List<EventDrawBean>, isEvent: Boolean) {
if(isEvent){
eventDrawBeansTrue.clear()
eventDrawBeansTrue.addAll(eventList)
}else{
eventDrawBeansFalse.clear()
eventDrawBeansFalse.addAll(eventList)
}
iconListItemAdapter?.let {
it.setDataList(eventDrawBeansTrue+eventDrawBeansFalse)
if(it.itemCount==0){
ovbv_bottom_icons.visibility = GONE
}else{
ovbv_bottom_icons.visibility = VISIBLE
}
}
// if(isEvent){
// eventDrawBeansTrue.clear()
// eventDrawBeansTrue.addAll(eventList)
// }else{
// eventDrawBeansFalse.clear()
// eventDrawBeansFalse.addAll(eventList)
// }
// iconListItemAdapter?.let {
// it.setDataList(eventDrawBeansTrue+eventDrawBeansFalse)
// if(it.itemCount==0){
// ovbv_bottom_icons.visibility = GONE
// }else{
// ovbv_bottom_icons.visibility = VISIBLE
// }
// }
}
}
@@ -77,12 +77,14 @@ class OverMapView @JvmOverloads constructor(
//ovbv_bottom_icons?.setHasFixedSize(true)
iconListItemAdapter = IconListItemAdapter(
context, mutableListOf(
EventDrawBean(R.drawable.mogo_quanxi_lukou, "全息路口"),
EventDrawBean(R.drawable.mogo_jingzhi_nor, "静止事件"),
EventDrawBean(R.drawable.mogo_shigong_image, "道路施工"),
EventDrawBean(R.drawable.mogo_shigu_nor, "交通事故")
)
)
ovbv_bottom_icons?.adapter = iconListItemAdapter
ovbv_bottom_icons.visibility = GONE
travelRealityView.setOnDrawListener(listener)