修改bug
This commit is contained in:
@@ -524,7 +524,7 @@ class MainActivity : BaseActivity() {
|
||||
/**
|
||||
* 开始测量
|
||||
*/
|
||||
private fun measuringToolOn() {
|
||||
fun measuringToolOn() {
|
||||
val root = binding.mainActivityMeasuringTool.root
|
||||
val valueView = root.findViewById<TextView>(R.id.measuring_tool_value)
|
||||
val unitView = root.findViewById<TextView>(R.id.measuring_tool_value_unit)
|
||||
@@ -673,12 +673,6 @@ class MainActivity : BaseActivity() {
|
||||
viewModel.onClickMenu()
|
||||
}
|
||||
|
||||
/**
|
||||
* 点击测速
|
||||
*/
|
||||
fun onClickCalcDistance() {
|
||||
measuringToolOn()
|
||||
}
|
||||
|
||||
/**
|
||||
* 点击轨迹
|
||||
|
||||
@@ -8,7 +8,6 @@ import android.graphics.drawable.AnimationDrawable
|
||||
import android.graphics.drawable.BitmapDrawable
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.provider.ContactsContract.Data
|
||||
import android.text.TextUtils
|
||||
import android.util.Log
|
||||
import android.view.Gravity
|
||||
@@ -53,11 +52,11 @@ import com.navinfo.omqs.util.SpeakMode
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import io.realm.Realm
|
||||
import io.realm.RealmSet
|
||||
import io.realm.kotlin.where
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.flow.collectLatest
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.locationtech.jts.geom.Geometry
|
||||
import org.oscim.core.GeoPoint
|
||||
import org.oscim.core.MapPosition
|
||||
import org.oscim.map.Map
|
||||
@@ -905,6 +904,19 @@ class MainViewModel @Inject constructor(
|
||||
|
||||
fun showSignMoreInfo(data: RenderEntity) {
|
||||
liveDataSignMoreInfo.value = data
|
||||
if (data.wkt != null) {
|
||||
mapController.markerHandle.removeMarker("moreInfo")
|
||||
mapController.lineHandler.removeLine()
|
||||
when (data.wkt!!.geometryType) {
|
||||
Geometry.TYPENAME_POINT -> {
|
||||
val geoPoint = GeometryTools.createGeoPoint(data.wkt!!.toText())
|
||||
mapController.markerHandle.addMarker(geoPoint, "moreInfo")
|
||||
}
|
||||
Geometry.TYPENAME_LINESTRING -> {
|
||||
mapController.lineHandler.showLine(data.wkt!!.toText())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun sendServerCommand(
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.navinfo.omqs.Constant
|
||||
import com.navinfo.omqs.R
|
||||
import com.navinfo.omqs.bean.SignBean
|
||||
import com.navinfo.omqs.databinding.FragmentEvaluationResultBinding
|
||||
import com.navinfo.omqs.ui.activity.map.MainActivity
|
||||
import com.navinfo.omqs.ui.dialog.FirstDialog
|
||||
import com.navinfo.omqs.ui.fragment.BaseFragment
|
||||
import com.navinfo.omqs.ui.other.shareViewModels
|
||||
@@ -101,6 +102,10 @@ class EvaluationResultFragment : BaseFragment(), View.OnClickListener {
|
||||
mDialog.show()
|
||||
}
|
||||
|
||||
//测距按钮
|
||||
binding.evaluationBarMeasuring.setOnClickListener {
|
||||
(activity as MainActivity).measuringToolOn()
|
||||
}
|
||||
//保存事件
|
||||
binding.evaluationBarSave.setOnClickListener {
|
||||
viewModel.saveData()
|
||||
@@ -194,12 +199,16 @@ class EvaluationResultFragment : BaseFragment(), View.OnClickListener {
|
||||
viewModel.liveDataToastMessage.observe(viewLifecycleOwner) {
|
||||
Toast.makeText(requireContext(), it, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
viewModel.liveDataQsRecordBean.observe(viewLifecycleOwner){
|
||||
binding.evaluationId.text = it.id
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
activity?.run {
|
||||
findNavController(R.id.main_activity_middle_fragment).navigateUp()
|
||||
(this as MainActivity).measuringToolOff()
|
||||
}
|
||||
super.onDestroyView()
|
||||
}
|
||||
@@ -304,6 +313,7 @@ class EvaluationResultFragment : BaseFragment(), View.OnClickListener {
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
private fun takePhoto() {
|
||||
try {
|
||||
val takePictureIntent = Intent(MediaStore.ACTION_IMAGE_CAPTURE)
|
||||
|
||||
@@ -398,6 +398,9 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
} else if (taskBean.cause.isEmpty()) {
|
||||
liveDataToastMessage.postValue("请选择初步分析原因!")
|
||||
return@launch
|
||||
} else if (taskBean.linkId.isEmpty()) {
|
||||
liveDataToastMessage.postValue("没有绑定到任何link,请选择")
|
||||
return@launch
|
||||
}
|
||||
|
||||
val realm = Realm.getDefaultInstance()
|
||||
|
||||
@@ -10,6 +10,9 @@ import com.navinfo.omqs.ui.other.BaseViewHolder
|
||||
|
||||
class ItemAdapter(private var itemListener: ((Int, RenderEntity) -> Unit?)? = null) :
|
||||
BaseRecyclerViewAdapter<RenderEntity>() {
|
||||
|
||||
var selectPosition = -1
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder {
|
||||
val viewBinding =
|
||||
AdapterItemBinding.inflate(LayoutInflater.from(parent.context), parent, false)
|
||||
@@ -19,9 +22,15 @@ class ItemAdapter(private var itemListener: ((Int, RenderEntity) -> Unit?)? = nu
|
||||
override fun onBindViewHolder(holder: BaseViewHolder, position: Int) {
|
||||
val binding = holder.viewBinding as AdapterItemBinding
|
||||
var renderEntity = data[position]
|
||||
|
||||
binding.root.isSelected = selectPosition == position
|
||||
binding.name.text = DataCodeEnum.findTableNameByCode(renderEntity.code)
|
||||
binding.root.setOnClickListener {
|
||||
if (selectPosition != position) {
|
||||
notifyItemChanged(selectPosition)
|
||||
selectPosition = position
|
||||
notifyItemChanged(position)
|
||||
}
|
||||
|
||||
if (itemListener != null) {
|
||||
itemListener!!.invoke(position, renderEntity)
|
||||
}
|
||||
|
||||
@@ -38,15 +38,22 @@ class SignMoreInfoFragment : BaseFragment() {
|
||||
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(
|
||||
val drawableLeft = resources.getDrawable(R.drawable.icon_main_moreinfo_text_left, null);
|
||||
val drawableRight = resources.getDrawable(R.drawable.baseline_edit_note_48, null);
|
||||
drawableLeft.setBounds(
|
||||
0,
|
||||
0,
|
||||
drawable.minimumWidth,
|
||||
drawable.minimumHeight
|
||||
);//必须设置图片大小,否则不显示
|
||||
drawableLeft.minimumWidth,
|
||||
drawableLeft.minimumHeight
|
||||
)//必须设置图片大小,否则不显示
|
||||
drawableRight.setBounds(
|
||||
0,
|
||||
0,
|
||||
drawableRight.minimumWidth,
|
||||
drawableRight.minimumHeight
|
||||
)
|
||||
binding.signInfoTitle.setCompoundDrawables(
|
||||
drawable, null, null, null
|
||||
drawableLeft, null, drawableRight, null
|
||||
)
|
||||
|
||||
when (it.code) {
|
||||
@@ -62,7 +69,7 @@ class SignMoreInfoFragment : BaseFragment() {
|
||||
binding.signInfoRecyclerview.adapter = adapter
|
||||
adapter.refreshData(SignUtil.getLaneBoundaryTypeInfo(it))
|
||||
}
|
||||
DataCodeEnum.OMDB_INTERSECTION.code->{
|
||||
DataCodeEnum.OMDB_INTERSECTION.code -> {
|
||||
val adapter = LaneBoundaryAdapter()
|
||||
binding.signInfoRecyclerview.adapter = adapter
|
||||
adapter.refreshData(SignUtil.getIntersectionInfo(it))
|
||||
@@ -77,7 +84,7 @@ class SignMoreInfoFragment : BaseFragment() {
|
||||
drawable.minimumHeight
|
||||
);//必须设置图片大小,否则不显示
|
||||
binding.signInfoTitle.setCompoundDrawables(
|
||||
drawable, null, null, null
|
||||
drawable, null, drawableRight, null
|
||||
)
|
||||
val adapter = TwoItemAdapter()
|
||||
binding.signInfoRecyclerview.adapter = adapter
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.navinfo.omqs.ui.fragment.tasklist
|
||||
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import com.navinfo.collect.library.data.entity.HadLinkDvoBean
|
||||
import com.navinfo.omqs.R
|
||||
@@ -61,12 +62,11 @@ class TaskAdapter(
|
||||
callback.itemOnClick(bean)
|
||||
}
|
||||
}
|
||||
if (bean.reason != "") {
|
||||
binding.taskEdit.setImageDrawable(binding.root.context.getDrawable(R.drawable.baseline_edit_note_48_select_red))
|
||||
if (bean.reason == "") {
|
||||
binding.taskBadge.visibility = View.GONE
|
||||
} else {
|
||||
binding.taskEdit.setImageDrawable(binding.root.context.getDrawable(R.drawable.selector_task_link_edit_icon))
|
||||
binding.taskBadge.visibility = View.VISIBLE
|
||||
}
|
||||
binding.taskEdit.isSelected = bean.reason != ""
|
||||
binding.taskEdit.setOnClickListener {
|
||||
callback.editOnClick(position, bean)
|
||||
}
|
||||
@@ -84,7 +84,7 @@ class TaskAdapter(
|
||||
notifyItemChanged(selectPosition)
|
||||
selectPosition = i
|
||||
notifyItemChanged(i)
|
||||
if(callback != null){
|
||||
if (callback != null) {
|
||||
callback.scrollPosition(i)
|
||||
}
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user