Merge branch 'master' of https://gitlab.navinfo.com/CollectVehicle/OneMapQS
This commit is contained in:
commit
05bd11419d
@ -38,6 +38,7 @@ import com.navinfo.omqs.http.offlinemapdownload.OfflineMapDownloadManager
|
|||||||
import com.navinfo.omqs.tools.LayerConfigUtils
|
import com.navinfo.omqs.tools.LayerConfigUtils
|
||||||
import com.navinfo.omqs.ui.activity.BaseActivity
|
import com.navinfo.omqs.ui.activity.BaseActivity
|
||||||
import com.navinfo.omqs.ui.fragment.console.ConsoleFragment
|
import com.navinfo.omqs.ui.fragment.console.ConsoleFragment
|
||||||
|
import com.navinfo.omqs.ui.fragment.itemlist.ItemListFragment
|
||||||
import com.navinfo.omqs.ui.fragment.offlinemap.OfflineMapFragment
|
import com.navinfo.omqs.ui.fragment.offlinemap.OfflineMapFragment
|
||||||
import com.navinfo.omqs.ui.fragment.qsrecordlist.QsRecordListFragment
|
import com.navinfo.omqs.ui.fragment.qsrecordlist.QsRecordListFragment
|
||||||
import com.navinfo.omqs.ui.fragment.signMoreInfo.SignMoreInfoFragment
|
import com.navinfo.omqs.ui.fragment.signMoreInfo.SignMoreInfoFragment
|
||||||
@ -390,6 +391,25 @@ class MainActivity : BaseActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
viewModel.liveDataItemList.observe(this) {
|
||||||
|
if (leftFragment == null || leftFragment !is ItemListFragment) {
|
||||||
|
leftFragment = ItemListFragment {
|
||||||
|
binding.mainActivityLeftFragment.visibility = View.GONE
|
||||||
|
supportFragmentManager.beginTransaction().remove(leftFragment!!).commit()
|
||||||
|
leftFragment = null
|
||||||
|
null
|
||||||
|
}
|
||||||
|
binding.mainActivityLeftFragment.visibility = View.VISIBLE
|
||||||
|
supportFragmentManager.beginTransaction()
|
||||||
|
.replace(R.id.main_activity_left_fragment, leftFragment!!)
|
||||||
|
.commit()
|
||||||
|
} else {
|
||||||
|
supportFragmentManager.beginTransaction()
|
||||||
|
.show(leftFragment!!)
|
||||||
|
.commit()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
// 初始化地图图层控制接收器
|
// 初始化地图图层控制接收器
|
||||||
FlowEventBus.subscribe<List<ImportConfig>>(
|
FlowEventBus.subscribe<List<ImportConfig>>(
|
||||||
|
@ -112,6 +112,11 @@ class MainViewModel @Inject constructor(
|
|||||||
*/
|
*/
|
||||||
val liveDataSignMoreInfo = MutableLiveData<RenderEntity>()
|
val liveDataSignMoreInfo = MutableLiveData<RenderEntity>()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 捕捉到的itemList
|
||||||
|
*/
|
||||||
|
val liveDataItemList = MutableLiveData<List<RenderEntity>>()
|
||||||
|
|
||||||
private var traceTag: String = "TRACE_TAG"
|
private var traceTag: String = "TRACE_TAG"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -473,8 +478,10 @@ class MainViewModel @Inject constructor(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
if (itemList.size > 0) {
|
if (itemList.size == 1) {
|
||||||
liveDataSignMoreInfo.postValue(itemList[0])
|
liveDataSignMoreInfo.postValue(itemList[0])
|
||||||
|
} else {
|
||||||
|
liveDataItemList.postValue(itemList)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.navinfo.omqs.ui.fragment.itemlist
|
||||||
|
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import com.navinfo.collect.library.data.entity.RenderEntity
|
||||||
|
import com.navinfo.collect.library.enums.DataCodeEnum
|
||||||
|
import com.navinfo.omqs.databinding.AdapterItemBinding
|
||||||
|
import com.navinfo.omqs.ui.other.BaseRecyclerViewAdapter
|
||||||
|
import com.navinfo.omqs.ui.other.BaseViewHolder
|
||||||
|
|
||||||
|
class ItemAdapter(private var itemListener: ((Int, RenderEntity) -> Unit?)? = null) :
|
||||||
|
BaseRecyclerViewAdapter<RenderEntity>() {
|
||||||
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder {
|
||||||
|
val viewBinding =
|
||||||
|
AdapterItemBinding.inflate(LayoutInflater.from(parent.context), parent, false)
|
||||||
|
return BaseViewHolder(viewBinding)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onBindViewHolder(holder: BaseViewHolder, position: Int) {
|
||||||
|
val binding = holder.viewBinding as AdapterItemBinding
|
||||||
|
var renderEntity = data[position]
|
||||||
|
|
||||||
|
binding.name.text = DataCodeEnum.findTableNameByCode(renderEntity.code)
|
||||||
|
binding.root.setOnClickListener {
|
||||||
|
if (itemListener != null) {
|
||||||
|
itemListener!!.invoke(position, renderEntity)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,51 @@
|
|||||||
|
package com.navinfo.omqs.ui.fragment.itemlist
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import androidx.fragment.app.activityViewModels
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import com.navinfo.omqs.databinding.FragmentItemListBinding
|
||||||
|
import com.navinfo.omqs.ui.activity.map.MainViewModel
|
||||||
|
import com.navinfo.omqs.ui.fragment.BaseFragment
|
||||||
|
import com.navinfo.omqs.ui.widget.RecycleViewDivider
|
||||||
|
import dagger.hilt.android.AndroidEntryPoint
|
||||||
|
|
||||||
|
|
||||||
|
@AndroidEntryPoint
|
||||||
|
class ItemListFragment(private var backListener: ((ItemListFragment) -> Unit?)? = null) :
|
||||||
|
BaseFragment() {
|
||||||
|
private var _binding: FragmentItemListBinding? = null
|
||||||
|
private val binding get() = _binding!!
|
||||||
|
private val viewModel by activityViewModels<MainViewModel>()
|
||||||
|
private val adapter by lazy {
|
||||||
|
ItemAdapter { _, data ->
|
||||||
|
viewModel.showSignMoreInfo(data)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreateView(
|
||||||
|
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
|
||||||
|
): View {
|
||||||
|
_binding = FragmentItemListBinding.inflate(inflater, container, false)
|
||||||
|
return binding.root
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
|
binding.itemListRecyclerview.layoutManager = LinearLayoutManager(requireContext())
|
||||||
|
binding.itemListRecyclerview.adapter = adapter
|
||||||
|
binding.itemListRecyclerview.addItemDecoration(
|
||||||
|
RecycleViewDivider(
|
||||||
|
requireContext(),
|
||||||
|
LinearLayoutManager.VERTICAL
|
||||||
|
)
|
||||||
|
)
|
||||||
|
viewModel.liveDataItemList.observe(viewLifecycleOwner) {
|
||||||
|
adapter.refreshData(it)
|
||||||
|
}
|
||||||
|
binding.taskBack.setOnClickListener {
|
||||||
|
backListener?.invoke(this)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
15
app/src/main/res/layout/adapter_item.xml
Normal file
15
app/src/main/res/layout/adapter_item.xml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:padding="5dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/name"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="name"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
</FrameLayout>
|
41
app/src/main/res/layout/fragment_item_list.xml
Normal file
41
app/src/main/res/layout/fragment_item_list.xml
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/shape_left_fragment_bg"
|
||||||
|
tools:context=".ui.fragment.itemlist.ItemListFragment">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/task_back"
|
||||||
|
style="@style/btn_round"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:background="@drawable/selector_bg_round_button"
|
||||||
|
android:foreground="@drawable/ripple_btn_press"
|
||||||
|
android:src="@drawable/ic_baseline_keyboard_arrow_left_24"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/task_fragment_title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:text="捕捉列表"
|
||||||
|
android:textColor="@color/default_blue_text_color"
|
||||||
|
android:textSize="16sp"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/item_list_recyclerview"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/task_fragment_title" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -145,6 +145,8 @@
|
|||||||
<xs:attribute name="blend-fill" default="#000000" type="tns:color" use="optional"/>
|
<xs:attribute name="blend-fill" default="#000000" type="tns:color" use="optional"/>
|
||||||
<xs:attribute name="mesh" default="false" type="xs:boolean" use="optional"/>
|
<xs:attribute name="mesh" default="false" type="xs:boolean" use="optional"/>
|
||||||
<xs:attribute name="repeat" default="true" type="xs:boolean" use="optional"/>
|
<xs:attribute name="repeat" default="true" type="xs:boolean" use="optional"/>
|
||||||
|
<!-- 长边坐标轴,默认为s -->
|
||||||
|
<xs:attribute name="longEdge" type="tns:text" default="s"/>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
|
|
||||||
<xs:complexType name="caption">
|
<xs:complexType name="caption">
|
||||||
|
@ -2274,8 +2274,10 @@
|
|||||||
|
|
||||||
<!-- 导流区 -->
|
<!-- 导流区 -->
|
||||||
<m v="OMDB_FILL_AREA">
|
<m v="OMDB_FILL_AREA">
|
||||||
<area use="obj-area" repeat="false" src="assets:omdb/tex_fill_area_3012.png"></area>
|
<area use="obj-area" repeat="true" src="assets:omdb/tex_fill_area_3012.png" longEdge="t"></area>
|
||||||
<text use="area-name"></text>
|
<text use="area-name"></text>
|
||||||
|
<!-- <area use="obj-area" repeat="false"></area>-->
|
||||||
|
<!-- <symbol src="assets:omdb/icon_fill_area_3012.svg"></symbol>-->
|
||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
</rendertheme>
|
</rendertheme>
|
BIN
collect-library/src/main/assets/omdb/area_1.png
Normal file
BIN
collect-library/src/main/assets/omdb/area_1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.8 KiB |
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1692250898311" class="icon" viewBox="0 0 1029 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="17364" width="32.15625" height="32" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M513.998507 838.81472L471.04 771.07712l188.1856-119.35232 42.96192 67.7376z" fill="#ffffff" p-id="17365"></path><path d="M333.571413 717.085013l45.7728-65.870506 180.391254 125.346133-45.7728 65.872213zM525.453653 617.2672l-46.578346-77.31712 327.191893-183.719253 46.578347 77.318826z" fill="#ffffff" p-id="17366"></path><path d="M192.570027 466.875733l39.514453-80.974506 334.77632 151.74656-39.514453 80.974506zM519.231147 358.3488l-58.55232-71.877973L944.546133 74.671787l58.55232 71.877973z" fill="#ffffff" p-id="17367"></path><path d="M50.399573 177.826133l53.072214-73.96352 464.4352 180.007254-53.070507 73.96352z" fill="#ffffff" p-id="17368"></path><path d="M545.8688 973.75232l-71.4752 36.406613L5.927253 90.436267l71.4752-36.404907z" fill="#ffffff" p-id="17369"></path><path d="M552.285867 1009.890987l-71.115094-37.108054L958.660267 57.71264l71.113386 37.108053z" fill="#ffffff" p-id="17370"></path><path d="M471.04 957.44h83.626667v51.2h-83.626667z" fill="#ffffff" p-id="17371"></path></svg>
|
After Width: | Height: | Size: 1.3 KiB |
@ -61,6 +61,18 @@ enum class DataCodeEnum(var tableName: String, var code: String) {
|
|||||||
OMDB_ELECTRONICEYE("电子眼", "4010"),
|
OMDB_ELECTRONICEYE("电子眼", "4010"),
|
||||||
OMDB_TRAFFICLIGHT("交通灯", "4022"),
|
OMDB_TRAFFICLIGHT("交通灯", "4022"),
|
||||||
OMDB_LANEINFO("车信", "4601"),
|
OMDB_LANEINFO("车信", "4601"),
|
||||||
OMDB_LANE_LINK_LG("车道中心线", "5001")
|
OMDB_LANE_LINK_LG("车道中心线", "5001");
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
fun findTableNameByCode(code: String): String? {
|
||||||
|
for (enumInstance in DataCodeEnum.values()) {
|
||||||
|
if (enumInstance.code == code) {
|
||||||
|
return enumInstance.tableName
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null // 若未找到匹配的 code,则返回 null 或其他适当的默认值
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
2
vtm
2
vtm
@ -1 +1 @@
|
|||||||
Subproject commit ebe23ed7731e301669b2b4ea03918e313a63617e
|
Subproject commit 33ba2c17cea19d445f71d2e78fda6ad459aa4822
|
Loading…
x
Reference in New Issue
Block a user