增加车信提前看板显示
调整条件限速,常规限速提前看板,详细看板 调整道路名详细信息
This commit is contained in:
@@ -1,13 +1,8 @@
|
||||
package com.navinfo.omqs.ui.fragment
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.KeyEvent
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.activity.OnBackPressedCallback
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.navigation.fragment.findNavController
|
||||
|
||||
abstract class BaseFragment : Fragment() {
|
||||
// override fun onCreateView(
|
||||
@@ -49,7 +44,7 @@ abstract class BaseFragment : Fragment() {
|
||||
// savedInstanceState: Bundle?
|
||||
// ): View
|
||||
|
||||
fun onBackPressed(): Boolean{
|
||||
open fun onBackPressed(): Boolean{
|
||||
// findNavController().navigateUp()
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.navinfo.omqs.ui.fragment.BaseFragment
|
||||
import com.navinfo.omqs.ui.other.shareViewModels
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import androidx.navigation.findNavController
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import com.navinfo.omqs.ui.dialog.FirstDialog
|
||||
|
||||
@AndroidEntryPoint
|
||||
@@ -70,12 +71,12 @@ class EvaluationResultFragment : BaseFragment(), View.OnClickListener {
|
||||
val mDialog = FirstDialog(context)
|
||||
mDialog.setTitle("提示?")
|
||||
mDialog.setMessage("是否退出,请确认!")
|
||||
mDialog.setPositiveButton("确定", object : FirstDialog.OnClickListener {
|
||||
override fun onClick(dialog: Dialog?, which: Int) {
|
||||
mDialog.dismiss()
|
||||
onBackPressed()
|
||||
}
|
||||
})
|
||||
mDialog.setPositiveButton(
|
||||
"确定"
|
||||
) { _, _ ->
|
||||
mDialog.dismiss()
|
||||
onBackPressed()
|
||||
}
|
||||
mDialog.setNegativeButton("取消", null)
|
||||
mDialog.show()
|
||||
}
|
||||
@@ -315,4 +316,9 @@ class EvaluationResultFragment : BaseFragment(), View.OnClickListener {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBackPressed(): Boolean {
|
||||
findNavController().navigateUp()
|
||||
return true
|
||||
}
|
||||
|
||||
}
|
||||
@@ -137,7 +137,7 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
}
|
||||
} else {
|
||||
liveDataQsRecordBean.value?.run {
|
||||
elementId = bean.elementId
|
||||
elementId = bean.renderEntity.code.toString()
|
||||
linkId = bean.linkId
|
||||
if (linkId.isNotEmpty()) {
|
||||
viewModelScope.launch {
|
||||
@@ -149,7 +149,7 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
}
|
||||
}
|
||||
}
|
||||
val point = GeometryTools.createGeoPoint(bean.geometry)
|
||||
val point = GeometryTools.createGeoPoint(bean.renderEntity.geometry)
|
||||
this.geometry = GeometryTools.createGeometry(point).toText()
|
||||
mapController.animationHandler.animationByLatLon(point.latitude, point.longitude)
|
||||
mapController.markerHandle.addMarker(point, markerTitle)
|
||||
@@ -198,7 +198,7 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
liveDataLeftTypeList.postValue(it)
|
||||
if (bean != null) {
|
||||
val classType2 = roomAppDatabase.getScProblemTypeDao()
|
||||
.findClassTypeByCode(bean.elementCode)
|
||||
.findClassTypeByCode(bean.renderEntity.code)
|
||||
if (classType2 != null) {
|
||||
classType = classType2
|
||||
}
|
||||
|
||||
@@ -13,9 +13,6 @@ class LeftAdapter(private var itemListener: ((Int, String) -> Unit?)? = null) :
|
||||
BaseRecyclerViewAdapter<String>() {
|
||||
private var selectTitle = ""
|
||||
|
||||
override fun getItemViewRes(position: Int): Int {
|
||||
return R.layout.text_item_select
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder {
|
||||
val viewBinding =
|
||||
|
||||
@@ -13,9 +13,6 @@ class MiddleAdapter(private var itemListener: ((Int, String) -> Unit?)? = null)
|
||||
BaseRecyclerViewAdapter<String>() {
|
||||
private var selectTitle = ""
|
||||
|
||||
override fun getItemViewRes(position: Int): Int {
|
||||
return R.layout.text_item_select
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder {
|
||||
val viewBinding =
|
||||
|
||||
@@ -11,9 +11,6 @@ class RightGroupHeaderAdapter(private var itemListener: ((Int, RightBean) -> Uni
|
||||
BaseRecyclerViewAdapter<RightBean>() {
|
||||
private var selectTitle = ""
|
||||
private var groupTitleList = mutableListOf<String>()
|
||||
override fun getItemViewRes(position: Int): Int {
|
||||
return R.layout.text_item_select2
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder {
|
||||
val viewBinding =
|
||||
|
||||
@@ -224,10 +224,6 @@ class SoundtListAdapter(
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun getItemViewRes(position: Int): Int {
|
||||
return R.layout.adapter_sound_list
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -131,10 +131,6 @@ class OfflineMapCityListAdapter(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemViewRes(position: Int): Int {
|
||||
return R.layout.adapter_offline_map_city
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -58,9 +58,6 @@ class QsRecordListAdapter(
|
||||
binding.qsRecordTime.text = qsRecordBean.checkTime
|
||||
}
|
||||
|
||||
override fun getItemViewRes(position: Int): Int {
|
||||
return R.layout.adapter_qs_record_list
|
||||
}
|
||||
|
||||
// 提供set方法
|
||||
fun setOnKotlinItemClickListener(itemClickListener: IKotlinItemClickListener) {
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
package com.navinfo.omqs.ui.fragment.sign
|
||||
|
||||
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.FragmentSignRoadnameBinding
|
||||
import com.navinfo.omqs.ui.activity.map.MainViewModel
|
||||
import com.navinfo.omqs.ui.fragment.BaseFragment
|
||||
|
||||
|
||||
class RoadNameInfoFragment : BaseFragment() {
|
||||
private var _binding: FragmentSignRoadnameBinding? = null
|
||||
private val binding get() = _binding!!
|
||||
|
||||
private val viewModel by activityViewModels<MainViewModel>()
|
||||
private val adapter by lazy { RoadNameInfoAdapter() }
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
|
||||
): View {
|
||||
_binding = FragmentSignRoadnameBinding.inflate(inflater, container, false)
|
||||
return binding.root
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
val layoutManager = LinearLayoutManager(context)
|
||||
//// 设置 RecyclerView 的固定大小,避免在滚动时重新计算视图大小和布局,提高性能
|
||||
binding.roadnameRecyclerview.setHasFixedSize(true)
|
||||
binding.roadnameRecyclerview.layoutManager = layoutManager
|
||||
binding.roadnameRecyclerview.adapter = adapter
|
||||
viewModel.liveDataRoadName.observe(viewLifecycleOwner) {
|
||||
if (it != null && it.isNotEmpty()) {
|
||||
adapter.refreshData(it)
|
||||
} else {
|
||||
activity?.run {
|
||||
supportFragmentManager.beginTransaction().remove(this@RoadNameInfoFragment)
|
||||
.commit()
|
||||
}
|
||||
}
|
||||
}
|
||||
binding.roadnameCancel.setOnClickListener {
|
||||
activity?.run {
|
||||
supportFragmentManager.beginTransaction().remove(this@RoadNameInfoFragment)
|
||||
.commit()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
_binding = null
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.navinfo.omqs.ui.fragment.signMoreInfo
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import com.navinfo.omqs.R
|
||||
import com.navinfo.omqs.databinding.AdapterElectronicEyeBinding
|
||||
import com.navinfo.omqs.ui.other.BaseRecyclerViewAdapter
|
||||
import com.navinfo.omqs.ui.other.BaseViewHolder
|
||||
|
||||
data class ElectronicEyeMoreInfoAdapterItem(
|
||||
val title: String,
|
||||
val text: String
|
||||
)
|
||||
|
||||
class ElectronicEyeInfoAdapter : BaseRecyclerViewAdapter<ElectronicEyeMoreInfoAdapterItem>() {
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder {
|
||||
val viewBinding =
|
||||
AdapterElectronicEyeBinding.inflate(LayoutInflater.from(parent.context), parent, false)
|
||||
return BaseViewHolder(viewBinding)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: BaseViewHolder, position: Int) {
|
||||
val binding: AdapterElectronicEyeBinding =
|
||||
holder.viewBinding as AdapterElectronicEyeBinding
|
||||
val item = data[position]
|
||||
binding.title.text = item.title
|
||||
binding.text.text = item.text
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.navinfo.omqs.ui.fragment.sign
|
||||
package com.navinfo.omqs.ui.fragment.signMoreInfo
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
@@ -9,9 +9,6 @@ import com.navinfo.omqs.ui.other.BaseRecyclerViewAdapter
|
||||
import com.navinfo.omqs.ui.other.BaseViewHolder
|
||||
|
||||
class RoadNameInfoAdapter : BaseRecyclerViewAdapter<RoadNameBean>() {
|
||||
override fun getItemViewRes(position: Int): Int {
|
||||
return R.layout.adapter_road_name
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder {
|
||||
val viewBinding =
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.navinfo.omqs.ui.fragment.signMoreInfo
|
||||
|
||||
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.R
|
||||
import com.navinfo.omqs.databinding.FragmentSignInfoBinding
|
||||
import com.navinfo.omqs.ui.activity.map.MainViewModel
|
||||
import com.navinfo.omqs.ui.fragment.BaseFragment
|
||||
import com.navinfo.omqs.ui.widget.SignUtil
|
||||
|
||||
|
||||
class SignMoreInfoFragment : BaseFragment() {
|
||||
private var _binding: FragmentSignInfoBinding? = null
|
||||
private val binding get() = _binding!!
|
||||
|
||||
private val viewModel by activityViewModels<MainViewModel>()
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
|
||||
): View {
|
||||
_binding = FragmentSignInfoBinding.inflate(inflater, container, false)
|
||||
return binding.root
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
val layoutManager = LinearLayoutManager(context)
|
||||
//// 设置 RecyclerView 的固定大小,避免在滚动时重新计算视图大小和布局,提高性能
|
||||
binding.signInfoRecyclerview.setHasFixedSize(true)
|
||||
binding.signInfoRecyclerview.layoutManager = layoutManager
|
||||
viewModel.liveDataSignMoreInfo.observe(viewLifecycleOwner) {
|
||||
binding.signInfoTitle.text = it.name
|
||||
val drawable = resources.getDrawable(R.drawable.icon_main_moreinfo_text_left, null);
|
||||
drawable.setBounds(
|
||||
0,
|
||||
0,
|
||||
drawable.minimumWidth,
|
||||
drawable.minimumHeight
|
||||
);//必须设置图片大小,否则不显示
|
||||
binding.signInfoTitle.setCompoundDrawables(
|
||||
drawable, null, null, null
|
||||
)
|
||||
|
||||
when (it.code) {
|
||||
//道路名
|
||||
2011 -> {
|
||||
val adapter = RoadNameInfoAdapter()
|
||||
binding.signInfoRecyclerview.adapter = adapter
|
||||
adapter.refreshData(SignUtil.getRoadNameList(it))
|
||||
}
|
||||
//常规点限速
|
||||
4002->{
|
||||
val adapter = ElectronicEyeInfoAdapter()
|
||||
binding.signInfoRecyclerview.adapter = adapter
|
||||
adapter.refreshData(SignUtil.getSpeedLimitMoreInfoText(it))
|
||||
}
|
||||
//条件点限速
|
||||
4003 -> {
|
||||
val adapter = ElectronicEyeInfoAdapter()
|
||||
binding.signInfoRecyclerview.adapter = adapter
|
||||
adapter.refreshData(SignUtil.getConditionLimitMoreInfoText(it))
|
||||
}
|
||||
//电子眼
|
||||
4010
|
||||
-> {
|
||||
val drawable = resources.getDrawable(R.drawable.icon_electronic_eye_left, null);
|
||||
drawable.setBounds(
|
||||
0,
|
||||
0,
|
||||
drawable.minimumWidth,
|
||||
drawable.minimumHeight
|
||||
);//必须设置图片大小,否则不显示
|
||||
binding.signInfoTitle.setCompoundDrawables(
|
||||
drawable, null, null, null
|
||||
)
|
||||
val adapter = ElectronicEyeInfoAdapter()
|
||||
binding.signInfoRecyclerview.adapter = adapter
|
||||
adapter.refreshData(SignUtil.getElectronicEyeMoreInfo(it))
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
binding.signInfoCancel.setOnClickListener {
|
||||
activity?.run {
|
||||
supportFragmentManager.beginTransaction().remove(this@SignMoreInfoFragment)
|
||||
.commit()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
_binding = null
|
||||
}
|
||||
}
|
||||
@@ -58,9 +58,6 @@ class TaskAdapter(
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemViewRes(position: Int): Int {
|
||||
return R.layout.adapter_task
|
||||
}
|
||||
|
||||
fun resetSelect() {
|
||||
selectPosition = -1
|
||||
|
||||
@@ -282,10 +282,6 @@ class TaskListAdapter(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemViewRes(position: Int): Int {
|
||||
return R.layout.adapter_task_list
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user