Merge branch 'master' of gitlab.navinfo.com:CollectVehicle/OneMapQS
This commit is contained in:
commit
c1f4774b43
@ -637,6 +637,7 @@ class ImportPreProcess {
|
||||
referenceEntity.name = "${renderEntity.name}参考方向"
|
||||
referenceEntity.table = renderEntity.table
|
||||
referenceEntity.enable = renderEntity.enable
|
||||
referenceEntity.code = renderEntity.code
|
||||
referenceEntity.taskId = renderEntity.taskId
|
||||
referenceEntity.zoomMin = renderEntity.zoomMin
|
||||
referenceEntity.zoomMax = renderEntity.zoomMax
|
||||
|
@ -444,7 +444,7 @@ class RealmOperateHelper() {
|
||||
}
|
||||
if (clazz.name == RenderEntity::class.jvmName) {
|
||||
// 筛选不显示的数据
|
||||
if (com.navinfo.collect.library.system.Constant.HAD_LAYER_INVISIABLE_ARRAY != null && com.navinfo.collect.library.system.Constant.HAD_LAYER_INVISIABLE_ARRAY.size > 0) {
|
||||
if (com.navinfo.collect.library.system.Constant.HAD_LAYER_INVISIABLE_ARRAY != null && com.navinfo.collect.library.system.Constant.HAD_LAYER_INVISIABLE_ARRAY.isNotEmpty()) {
|
||||
realmQuery.beginGroup()
|
||||
for (type in com.navinfo.collect.library.system.Constant.HAD_LAYER_INVISIABLE_ARRAY) {
|
||||
realmQuery.notEqualTo("table", type)
|
||||
|
@ -377,7 +377,7 @@ class MainViewModel @Inject constructor(
|
||||
if (naviEngineStatus == 1) {
|
||||
naviEngineNew.let {
|
||||
// naviMutex.lock()
|
||||
if (testRealm == null)
|
||||
if (testRealm == null)
|
||||
testRealm = realmOperateHelper.getSelectTaskRealmInstance()
|
||||
if (currentTaskBean != null) {
|
||||
naviEngineNew.bindingRoute(
|
||||
@ -899,12 +899,12 @@ class MainViewModel @Inject constructor(
|
||||
)
|
||||
|
||||
val newLineString = GeometryTools.createLineString(linePoints)
|
||||
linkId?.let {
|
||||
if (linkId.isNotEmpty()) {
|
||||
val time = System.currentTimeMillis()
|
||||
val elementList = realmOperateHelper.queryLinkByLinkPid(realm, it)
|
||||
val elementList = realmOperateHelper.queryLinkByLinkPid(realm, linkId)
|
||||
Log.e(
|
||||
"jingo",
|
||||
"捕捉到数据 ${elementList.size} 个 ${System.currentTimeMillis() - time}"
|
||||
"捕捉到数据 $linkId ${elementList.size} 个 ${System.currentTimeMillis() - time}"
|
||||
)
|
||||
for (element in elementList) {
|
||||
if (element.code == DataCodeEnum.OMDB_LINK_NAME.code) {
|
||||
@ -924,7 +924,7 @@ class MainViewModel @Inject constructor(
|
||||
)
|
||||
Log.e(
|
||||
"jingo",
|
||||
"捕捉到的数据code ${DataCodeEnum.findTableNameByCode(element.code)}"
|
||||
"捕捉到的数据code $linkId ${DataCodeEnum.findTableNameByCode(element.code)}"
|
||||
)
|
||||
when (element.code) {
|
||||
DataCodeEnum.OMDB_MULTI_DIGITIZED.code,//上下线分离
|
||||
@ -1002,9 +1002,9 @@ class MainViewModel @Inject constructor(
|
||||
|
||||
val entityList = realmOperateHelper.getSelectTaskRealmTools(
|
||||
realm, RenderEntity::class.java, true
|
||||
).and().equalTo("table", DataCodeEnum.OMDB_RESTRICTION.name).and()
|
||||
).equalTo("table", DataCodeEnum.OMDB_RESTRICTION.name)
|
||||
.equalTo(
|
||||
"properties['linkIn']", it
|
||||
"linkPid", linkId
|
||||
).findAll()
|
||||
if (entityList.isNotEmpty()) {
|
||||
val outList = entityList.distinct()
|
||||
@ -1016,7 +1016,6 @@ class MainViewModel @Inject constructor(
|
||||
true
|
||||
)
|
||||
.equalTo("table", DataCodeEnum.OMDB_RD_LINK_KIND.name)
|
||||
.and()
|
||||
.equalTo(
|
||||
"linkPid",
|
||||
outLink
|
||||
@ -1052,7 +1051,6 @@ class MainViewModel @Inject constructor(
|
||||
if (!hisRoadName) {
|
||||
liveDataRoadName.postValue(null)
|
||||
}
|
||||
Log.e("jingo", "另一个地方查询数据库")
|
||||
realm.close()
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
|
@ -25,7 +25,7 @@ interface OnSignAdapterClickListener {
|
||||
fun onErrorClick(signBean: SignBean)
|
||||
}
|
||||
|
||||
data class LaneInfoItem(val id: Int, val type: Int)
|
||||
data class LaneInfoItem(var id: Int, var type: Int)
|
||||
|
||||
class SignAdapter(private var listener: OnSignAdapterClickListener?) :
|
||||
BaseRecyclerViewAdapter<SignBean>() {
|
||||
|
@ -18,6 +18,7 @@ import androidx.navigation.findNavController
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.navinfo.collect.library.enums.DataCodeEnum
|
||||
import com.navinfo.omqs.Constant
|
||||
import com.navinfo.omqs.R
|
||||
import com.navinfo.omqs.bean.SignBean
|
||||
@ -28,7 +29,9 @@ import com.navinfo.omqs.ui.fragment.BaseFragment
|
||||
import com.navinfo.omqs.ui.other.shareViewModels
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
|
||||
|
||||
/**
|
||||
* 评测结果页面
|
||||
*/
|
||||
@AndroidEntryPoint
|
||||
class EvaluationResultFragment : BaseFragment(), View.OnClickListener {
|
||||
private lateinit var binding: FragmentEvaluationResultBinding
|
||||
@ -191,6 +194,13 @@ class EvaluationResultFragment : BaseFragment(), View.OnClickListener {
|
||||
viewModel.initData(id)
|
||||
}
|
||||
|
||||
/**
|
||||
* 车信编辑备注
|
||||
*/
|
||||
viewModel.liveDataLanInfoChange.observe(viewLifecycleOwner) {
|
||||
binding.evaluationDescription.setText(it)
|
||||
}
|
||||
|
||||
viewModel.listDataChatMsgEntityList.observe(viewLifecycleOwner) {
|
||||
adapter.refreshData(it)
|
||||
}
|
||||
@ -205,6 +215,17 @@ class EvaluationResultFragment : BaseFragment(), View.OnClickListener {
|
||||
}
|
||||
viewModel.liveDataQsRecordBean.observe(viewLifecycleOwner) {
|
||||
binding.evaluationId.text = it.id
|
||||
binding.evaluationProblemType.text = it.problemType
|
||||
|
||||
if(it.classCode == DataCodeEnum.OMDB_LANEINFO.code) {
|
||||
when (it.problemType) {
|
||||
"遗漏", "错误" -> {
|
||||
activity?.run {
|
||||
findNavController(R.id.main_activity_middle_fragment).navigate(R.id.LineInfoEditFragment)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import android.graphics.Bitmap
|
||||
import android.graphics.drawable.AnimationDrawable
|
||||
import android.graphics.drawable.BitmapDrawable
|
||||
import android.os.Build
|
||||
import android.provider.ContactsContract.Data
|
||||
import android.text.TextUtils
|
||||
import android.util.Log
|
||||
import android.view.Gravity
|
||||
@ -20,10 +21,8 @@ import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.blankj.utilcode.util.ToastUtils
|
||||
import com.navinfo.collect.library.data.entity.AttachmentBean
|
||||
import com.navinfo.collect.library.data.entity.HadLinkDvoBean
|
||||
import com.navinfo.collect.library.data.entity.QsRecordBean
|
||||
import com.navinfo.collect.library.data.entity.TaskBean
|
||||
import com.navinfo.collect.library.data.entity.*
|
||||
import com.navinfo.collect.library.enums.DataCodeEnum
|
||||
import com.navinfo.collect.library.map.NIMapController
|
||||
import com.navinfo.collect.library.map.OnGeoPointClickListener
|
||||
import com.navinfo.collect.library.utils.GeometryTools
|
||||
@ -34,8 +33,10 @@ import com.navinfo.omqs.bean.ScProblemTypeBean
|
||||
import com.navinfo.omqs.bean.SignBean
|
||||
import com.navinfo.omqs.db.RealmOperateHelper
|
||||
import com.navinfo.omqs.db.RoomAppDatabase
|
||||
import com.navinfo.omqs.ui.activity.map.LaneInfoItem
|
||||
import com.navinfo.omqs.ui.dialog.FirstDialog
|
||||
import com.navinfo.omqs.util.DateTimeUtil
|
||||
import com.navinfo.omqs.util.SignUtil
|
||||
import com.navinfo.omqs.util.SoundMeter
|
||||
import com.navinfo.omqs.util.SpeakMode
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
@ -58,6 +59,17 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
private val sharedPreferences: SharedPreferences
|
||||
) : ViewModel(), SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
|
||||
/**
|
||||
* 关联的数据
|
||||
*/
|
||||
var renderEntity: RenderEntity? = null
|
||||
|
||||
/**
|
||||
* 车信列表
|
||||
*/
|
||||
var laneInfoList: MutableList<LaneInfoItem>? = null
|
||||
|
||||
var liveDataLanInfoChange = MutableLiveData<String>()
|
||||
|
||||
private val TAG = "点选marker"
|
||||
|
||||
@ -153,6 +165,13 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
*/
|
||||
fun initNewData(bean: SignBean?, filePath: String) {
|
||||
|
||||
if (bean != null) {
|
||||
renderEntity = bean.renderEntity
|
||||
if (renderEntity!!.code == DataCodeEnum.OMDB_LANEINFO.code) {
|
||||
laneInfoList = SignUtil.getLineInfoIcons(renderEntity!!)
|
||||
}
|
||||
}
|
||||
|
||||
//查询元数据
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
/**
|
||||
@ -252,6 +271,13 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
* //获取问题分类列表
|
||||
*/
|
||||
fun getClassTypeList(bean: SignBean? = null) {
|
||||
if (bean != null) {
|
||||
renderEntity = bean.renderEntity
|
||||
if (renderEntity!!.code == DataCodeEnum.OMDB_LANEINFO.code) {
|
||||
laneInfoList = SignUtil.getLineInfoIcons(renderEntity!!)
|
||||
}
|
||||
}
|
||||
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
Log.e("jingo", "获取问题分类列表 SSS")
|
||||
val list = roomAppDatabase.getScProblemTypeDao().findClassTypeList()
|
||||
@ -307,13 +333,16 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
)
|
||||
)
|
||||
}
|
||||
val problemLinkB = liveDataQsRecordBean.value!!.problemLink.isEmpty()
|
||||
val causeB = liveDataQsRecordBean.value!!.cause.isEmpty()
|
||||
if (liveDataQsRecordBean.value!!.problemLink.isEmpty()) {
|
||||
liveDataQsRecordBean.value!!.problemLink = middleList[0]
|
||||
}
|
||||
if (liveDataQsRecordBean.value!!.cause.isEmpty()) {
|
||||
liveDataQsRecordBean.value!!.cause = rightList[0].text
|
||||
}
|
||||
liveDataQsRecordBean.postValue(liveDataQsRecordBean.value)
|
||||
if (problemLinkB && causeB)
|
||||
liveDataQsRecordBean.postValue(liveDataQsRecordBean.value)
|
||||
// liveDataMiddleTypeList.postValue(middleList)
|
||||
liveDataRightTypeList.postValue(rightList)
|
||||
}
|
||||
@ -342,14 +371,17 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
)
|
||||
)
|
||||
}
|
||||
if (liveDataQsRecordBean.value!!.problemType.isEmpty()) {
|
||||
val problemTypeB = liveDataQsRecordBean.value!!.problemType.isEmpty()
|
||||
val phenomenonB = liveDataQsRecordBean.value!!.phenomenon.isEmpty()
|
||||
if (problemTypeB) {
|
||||
liveDataQsRecordBean.value!!.problemType = typeTitleList[0]
|
||||
}
|
||||
// liveDataMiddleTypeList.postValue(typeTitleList)
|
||||
if (liveDataQsRecordBean.value!!.phenomenon.isEmpty()) {
|
||||
if (phenomenonB) {
|
||||
liveDataQsRecordBean.value!!.phenomenon = phenomenonRightList[0].text
|
||||
}
|
||||
liveDataQsRecordBean.postValue(liveDataQsRecordBean.value)
|
||||
if (problemTypeB && phenomenonB)
|
||||
liveDataQsRecordBean.postValue(liveDataQsRecordBean.value)
|
||||
liveDataRightTypeList.postValue(phenomenonRightList)
|
||||
}
|
||||
}
|
||||
@ -389,7 +421,6 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
*/
|
||||
|
||||
fun saveData() {
|
||||
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
val taskBean = liveDataQsRecordBean.value!!
|
||||
if (liveDataTaskBean.value == null) {
|
||||
@ -510,13 +541,28 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
}
|
||||
}
|
||||
liveDataQsRecordBean.value?.attachmentBeanList = it.attachmentBeanList
|
||||
liveDataLanInfoChange.value = it.description
|
||||
// 显示语音数据到界面
|
||||
getChatMsgEntityList()
|
||||
realm.close()
|
||||
if (it.elementId == DataCodeEnum.OMDB_LANEINFO.code) {
|
||||
val realm2 = realmOperateHelper.getSelectTaskRealmInstance()
|
||||
val r = realm2.where(RenderEntity::class.java)
|
||||
.equalTo("table", DataCodeEnum.OMDB_LANEINFO.name)
|
||||
.equalTo("linkPid", it.linkId).findFirst()
|
||||
if (r != null) {
|
||||
renderEntity = realm2.copyFromRealm(r)
|
||||
laneInfoList = SignUtil.getLineInfoIcons(renderEntity!!)
|
||||
}
|
||||
realm2.close()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
liveDataToastMessage.postValue("数据读取失败")
|
||||
realm.close()
|
||||
}
|
||||
realm.close()
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -603,8 +649,9 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
mSoundMeter!!.setmListener(object : SoundMeter.OnSoundMeterListener {
|
||||
@RequiresApi(Build.VERSION_CODES.Q)
|
||||
override fun onSuccess(filePath: String?) {
|
||||
if (!TextUtils.isEmpty(filePath) && File(filePath).exists()) {
|
||||
if (File(filePath) == null || File(filePath).length() < 1600) {
|
||||
filePath?.let {
|
||||
val file = File(it)
|
||||
if (file.exists() && file.length() < 1600) {
|
||||
ToastUtils.showLong("语音时间太短,无效!")
|
||||
mSpeakMode!!.speakText("语音时间太短,无效")
|
||||
stopSoundMeter()
|
||||
@ -613,7 +660,6 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
}
|
||||
|
||||
mSpeakMode!!.speakText("结束录音")
|
||||
|
||||
addChatMsgEntity(filePath!!)
|
||||
}
|
||||
|
||||
@ -661,7 +707,7 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
bitmap.compress(Bitmap.CompressFormat.JPEG, 90, out)
|
||||
out.flush()
|
||||
out.close()
|
||||
var picList = mutableListOf<String>()
|
||||
val picList = mutableListOf<String>()
|
||||
if (liveDataPictureList.value == null) {
|
||||
picList.add(file.absolutePath)
|
||||
} else {
|
||||
@ -694,4 +740,109 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加车信
|
||||
*/
|
||||
fun updateLaneInfo(index: Int, id: Int, type: Int) {
|
||||
laneInfoList?.let {
|
||||
val laneInfoItem = it[index]
|
||||
if (laneInfoItem.id != id || laneInfoItem.type != type) {
|
||||
laneInfoItem.id = id
|
||||
laneInfoItem.type = type
|
||||
editLaneInfoProblem()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加车信
|
||||
*/
|
||||
fun addLaneInfo(id: Int, type: Int): Int {
|
||||
laneInfoList?.let {
|
||||
it.add(LaneInfoItem(id, type))
|
||||
editLaneInfoProblem()
|
||||
return it.size
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除车信
|
||||
*/
|
||||
fun backspaceLaneInfo() {
|
||||
laneInfoList?.let {
|
||||
if (it.isNotEmpty()) {
|
||||
it.removeLast()
|
||||
editLaneInfoProblem()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除车信
|
||||
*/
|
||||
fun removeAllLaneInfo() {
|
||||
laneInfoList?.clear()
|
||||
}
|
||||
|
||||
/**
|
||||
* 组织车信备注文字
|
||||
*/
|
||||
private fun editLaneInfoProblem() {
|
||||
laneInfoList?.let {
|
||||
liveDataQsRecordBean.value?.let { bean ->
|
||||
var strBuffer = StringBuffer()
|
||||
if (bean.problemType == "遗漏")
|
||||
strBuffer.append("车信缺失,车道从左到右分别是:")
|
||||
else if (bean.problemType == "错误")
|
||||
strBuffer.append("车信错误,车道从左到右分别是:")
|
||||
for (item in it) {
|
||||
when (item.id) {
|
||||
R.drawable.laneinfo_1 -> strBuffer.append("[直(1)")
|
||||
R.drawable.laneinfo_2 -> strBuffer.append("[左(2)")
|
||||
R.drawable.laneinfo_3 -> strBuffer.append("[右(3)")
|
||||
R.drawable.laneinfo_5 -> strBuffer.append("[左斜前(5)")
|
||||
R.drawable.laneinfo_6 -> strBuffer.append("[右斜前(6)")
|
||||
R.drawable.laneinfo_4 -> strBuffer.append("[调(4)")
|
||||
R.drawable.laneinfo_7 -> strBuffer.append("[反向调(7)")
|
||||
R.drawable.laneinfo_1_2 -> strBuffer.append("[左直(1,2)")
|
||||
R.drawable.laneinfo_1_5 -> strBuffer.append("[左斜前直(1,5)")
|
||||
R.drawable.laneinfo_2_5 -> strBuffer.append("[左左斜前(2,5)")
|
||||
R.drawable.laneinfo_2_6 -> strBuffer.append("[左右斜前(2,6)")
|
||||
R.drawable.laneinfo_1_3 -> strBuffer.append("[直右(1,3)")
|
||||
R.drawable.laneinfo_1_6 -> strBuffer.append("[右斜前直(1,6)")
|
||||
R.drawable.laneinfo_3_5 -> strBuffer.append("[左斜前右(3,5)")
|
||||
R.drawable.laneinfo_3_6 -> strBuffer.append("[右斜前右(3,6)")
|
||||
R.drawable.laneinfo_2_3 -> strBuffer.append("[左右(2,3)")
|
||||
R.drawable.laneinfo_5_6 -> strBuffer.append("[左斜前右斜前(5,6)")
|
||||
R.drawable.laneinfo_1_4 -> strBuffer.append("[直调(1,4)")
|
||||
R.drawable.laneinfo_4_5 -> strBuffer.append("[调左斜前(4,5)")
|
||||
R.drawable.laneinfo_2_4 -> strBuffer.append("[左调(2,4)")
|
||||
R.drawable.laneinfo_3_4 -> strBuffer.append("[右调(3,4)")
|
||||
R.drawable.laneinfo_4_6 -> strBuffer.append("[调右斜前(4,6)")
|
||||
R.drawable.laneinfo_1_7 -> strBuffer.append("[直反向调(1,7)")
|
||||
R.drawable.laneinfo_1_2_3 -> strBuffer.append("[左直右(1,2,3)")
|
||||
R.drawable.laneinfo_1_2_4 -> strBuffer.append("[调左直(1,2,4)")
|
||||
R.drawable.laneinfo_1_2_5 -> strBuffer.append("[左左斜前直(1,2,5)")
|
||||
R.drawable.laneinfo_1_2_6 -> strBuffer.append("[左直右斜前(1,2,6)")
|
||||
R.drawable.laneinfo_1_3_4 -> strBuffer.append("[调直右(1,3,4)")
|
||||
R.drawable.laneinfo_1_3_5 -> strBuffer.append("[左斜前直右(1,3,5)")
|
||||
R.drawable.laneinfo_1_3_6 -> strBuffer.append("[直右斜前右(1,3,6)")
|
||||
R.drawable.laneinfo_2_3_4 -> strBuffer.append("[调左右(2,3,4)")
|
||||
R.drawable.laneinfo_0 -> strBuffer.append("[不允许存在(0)")
|
||||
}
|
||||
if (item.type == 1) {
|
||||
strBuffer.append("(附加)]")
|
||||
} else if (item.type == 2) {
|
||||
strBuffer.append("(公交)]")
|
||||
} else {
|
||||
strBuffer.append("]")
|
||||
}
|
||||
}
|
||||
liveDataQsRecordBean.value!!.description = strBuffer.toString()
|
||||
liveDataLanInfoChange.value = strBuffer.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,331 @@
|
||||
package com.navinfo.omqs.ui.fragment.evaluationresult
|
||||
|
||||
import android.graphics.PorterDuff
|
||||
import android.graphics.PorterDuffColorFilter
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.AdapterView
|
||||
import android.widget.ImageView
|
||||
import com.navinfo.omqs.R
|
||||
import com.navinfo.omqs.databinding.FragmentLineInfoEditBinding
|
||||
import com.navinfo.omqs.ui.fragment.BaseFragment
|
||||
import com.navinfo.omqs.ui.other.shareViewModels
|
||||
|
||||
class LaneInfoEditFragment : BaseFragment() {
|
||||
private var _binding: FragmentLineInfoEditBinding? = null
|
||||
private val binding get() = _binding!!
|
||||
private val viewModel by shareViewModels<EvaluationResultViewModel>("QsRecode")
|
||||
|
||||
/**
|
||||
* 车道类型
|
||||
*/
|
||||
private var laneType = 0
|
||||
private var selectView: ImageView? = null
|
||||
private lateinit var laneInfoItemsAdapter: LaneInfoItemsAdapter
|
||||
private lateinit var laneInfoItemsAdapter2: LaneInfoItems2Adapter
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
_binding = FragmentLineInfoEditBinding.inflate(inflater, container, false)
|
||||
return binding.root
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
initLaneInfo()
|
||||
initFLowLayout()
|
||||
|
||||
binding.laneInfoBackspace.setOnClickListener {
|
||||
if (binding.laneInfoTopContainer.childCount < 4) {
|
||||
binding.laneInfoTopContainer.removeAllViews()
|
||||
} else {
|
||||
binding.laneInfoTopContainer.removeViewAt(binding.laneInfoTopContainer.childCount - 1)
|
||||
val view =
|
||||
binding.laneInfoTopContainer.getChildAt(binding.laneInfoTopContainer.childCount - 1)
|
||||
binding.laneInfoTopContainer.removeView(view)
|
||||
if (view == selectView) {
|
||||
selectView = null
|
||||
}
|
||||
}
|
||||
viewModel.backspaceLaneInfo()
|
||||
}
|
||||
binding.laneInfoRadio1.setOnClickListener {
|
||||
laneType = 0
|
||||
laneInfoItemsAdapter.setType(laneType)
|
||||
}
|
||||
binding.laneInfoRadio2.setOnClickListener {
|
||||
laneType = 1
|
||||
laneInfoItemsAdapter.setType(laneType)
|
||||
}
|
||||
binding.laneInfoRadio3.setOnClickListener {
|
||||
laneType = 2
|
||||
laneInfoItemsAdapter.setType(laneType)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun initFLowLayout() {
|
||||
|
||||
val itemList: MutableList<Int> = mutableListOf()
|
||||
|
||||
itemList.add(R.drawable.laneinfo_1)
|
||||
itemList.add(R.drawable.laneinfo_2)
|
||||
itemList.add(R.drawable.laneinfo_3)
|
||||
itemList.add(R.drawable.laneinfo_5)
|
||||
itemList.add(R.drawable.laneinfo_6)
|
||||
itemList.add(R.drawable.laneinfo_4)
|
||||
itemList.add(R.drawable.laneinfo_7)
|
||||
itemList.add(R.drawable.laneinfo_1_2)
|
||||
itemList.add(R.drawable.laneinfo_1_5)
|
||||
itemList.add(R.drawable.laneinfo_2_5)
|
||||
itemList.add(R.drawable.laneinfo_2_6)
|
||||
itemList.add(R.drawable.laneinfo_1_3)
|
||||
itemList.add(R.drawable.laneinfo_1_6)
|
||||
itemList.add(R.drawable.laneinfo_3_5)
|
||||
itemList.add(R.drawable.laneinfo_3_6)
|
||||
itemList.add(R.drawable.laneinfo_2_3)
|
||||
itemList.add(R.drawable.laneinfo_5_6)
|
||||
itemList.add(R.drawable.laneinfo_1_4)
|
||||
itemList.add(R.drawable.laneinfo_4_5)
|
||||
itemList.add(R.drawable.laneinfo_2_4)
|
||||
itemList.add(R.drawable.laneinfo_3_4)
|
||||
itemList.add(R.drawable.laneinfo_4_6)
|
||||
itemList.add(R.drawable.laneinfo_1_7)
|
||||
itemList.add(R.drawable.laneinfo_1_2_3)
|
||||
itemList.add(R.drawable.laneinfo_1_2_4)
|
||||
itemList.add(R.drawable.laneinfo_1_2_5)
|
||||
itemList.add(R.drawable.laneinfo_1_2_6)
|
||||
itemList.add(R.drawable.laneinfo_1_3_4)
|
||||
itemList.add(R.drawable.laneinfo_1_3_5)
|
||||
itemList.add(R.drawable.laneinfo_1_3_6)
|
||||
itemList.add(R.drawable.laneinfo_2_3_4)
|
||||
itemList.add(R.drawable.laneinfo_0)
|
||||
|
||||
laneInfoItemsAdapter = LaneInfoItemsAdapter(itemList)
|
||||
|
||||
binding.laneInfoGridview.adapter = laneInfoItemsAdapter
|
||||
binding.laneInfoGridview.onItemClickListener =
|
||||
AdapterView.OnItemClickListener { parent, view, position, id ->
|
||||
val resId = laneInfoItemsAdapter.getItem(position) as Int
|
||||
//如果选中了一个view
|
||||
if (selectView != null) {
|
||||
|
||||
val drawable = requireContext().getDrawable(resId)
|
||||
val color = when (laneType) {
|
||||
1 -> requireContext().resources.getColor(R.color.lane_info_1)
|
||||
2 -> requireContext().resources.getColor(R.color.lane_info_2)
|
||||
else -> requireContext().resources.getColor(R.color.white)
|
||||
}
|
||||
// 创建 PorterDuffColorFilter 对象
|
||||
val colorFilter = PorterDuffColorFilter(color, PorterDuff.Mode.SRC_IN)
|
||||
// 将 PorterDuffColorFilter 设置给 Drawable
|
||||
drawable!!.colorFilter = colorFilter
|
||||
selectView!!.scaleType = ImageView.ScaleType.FIT_XY
|
||||
selectView!!.setColorFilter(color, PorterDuff.Mode.SRC_IN)
|
||||
selectView!!.setImageDrawable(drawable)
|
||||
viewModel.updateLaneInfo(selectView!!.tag as Int, resId, laneType)
|
||||
} else {
|
||||
//如果一条车道都没有,左侧先加一条虚线
|
||||
if (binding.laneInfoTopContainer.childCount == 0) {
|
||||
val lineViewS = View(context)
|
||||
lineViewS.layoutParams = ViewGroup.LayoutParams(24, 110)
|
||||
lineViewS.background =
|
||||
requireContext().getDrawable(R.drawable.shape_vertical_dashed_line)
|
||||
binding.laneInfoTopContainer.addView(lineViewS, lineViewS.layoutParams)
|
||||
}
|
||||
|
||||
val imageView = ImageView(context)
|
||||
val drawable =
|
||||
requireContext().getDrawable(laneInfoItemsAdapter.getItem(position) as Int)
|
||||
val color = when (laneType) {
|
||||
1 -> requireContext().resources.getColor(R.color.lane_info_1)
|
||||
2 -> requireContext().resources.getColor(R.color.lane_info_2)
|
||||
else -> requireContext().resources.getColor(R.color.white)
|
||||
}
|
||||
// 创建 PorterDuffColorFilter 对象
|
||||
val colorFilter = PorterDuffColorFilter(color, PorterDuff.Mode.SRC_IN)
|
||||
// 将 PorterDuffColorFilter 设置给 Drawable
|
||||
drawable!!.colorFilter = colorFilter
|
||||
imageView.setColorFilter(color, PorterDuff.Mode.SRC_IN)
|
||||
imageView.layoutParams = ViewGroup.LayoutParams(45, 100)
|
||||
imageView.scaleType = ImageView.ScaleType.FIT_XY
|
||||
imageView.setImageDrawable(drawable)
|
||||
imageView.tag = viewModel.addLaneInfo(resId, laneType)
|
||||
binding.laneInfoTopContainer.addView(imageView)
|
||||
imageView.setOnClickListener {
|
||||
selectView = if (selectView == it) {
|
||||
selectView!!.setBackgroundColor(requireContext().resources.getColor(R.color.gray))
|
||||
null
|
||||
} else {
|
||||
if (selectView != null) {
|
||||
selectView!!.setBackgroundColor(
|
||||
requireContext().resources.getColor(
|
||||
R.color.gray
|
||||
)
|
||||
)
|
||||
}
|
||||
imageView.setBackgroundColor(requireContext().resources.getColor(R.color.lane_info_0))
|
||||
it as ImageView
|
||||
}
|
||||
}
|
||||
|
||||
//右侧加虚线
|
||||
val lineViewE = View(context)
|
||||
lineViewE.layoutParams = ViewGroup.LayoutParams(24, 110)
|
||||
lineViewE.background =
|
||||
requireContext().getDrawable(R.drawable.shape_vertical_dashed_line)
|
||||
binding.laneInfoTopContainer.addView(lineViewE)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
val itemList2: MutableList<List<Int>> = mutableListOf()
|
||||
itemList2.add(listOf(R.drawable.laneinfo_2, R.drawable.laneinfo_1, R.drawable.laneinfo_3))
|
||||
itemList2.add(listOf(R.drawable.laneinfo_1_2, R.drawable.laneinfo_1, R.drawable.laneinfo_1_3))
|
||||
itemList2.add(listOf(R.drawable.laneinfo_2, R.drawable.laneinfo_1, R.drawable.laneinfo_1_3))
|
||||
itemList2.add(listOf(R.drawable.laneinfo_2_4, R.drawable.laneinfo_1, R.drawable.laneinfo_3))
|
||||
itemList2.add(listOf(R.drawable.laneinfo_1_2, R.drawable.laneinfo_1, R.drawable.laneinfo_3))
|
||||
itemList2.add(listOf(R.drawable.laneinfo_2_4, R.drawable.laneinfo_1, R.drawable.laneinfo_1_3))
|
||||
|
||||
itemList2.add(listOf(R.drawable.laneinfo_2, R.drawable.laneinfo_1, R.drawable.laneinfo_1, R.drawable.laneinfo_3))
|
||||
itemList2.add(listOf(R.drawable.laneinfo_1_2, R.drawable.laneinfo_1, R.drawable.laneinfo_1, R.drawable.laneinfo_1_3))
|
||||
itemList2.add(listOf(R.drawable.laneinfo_2, R.drawable.laneinfo_1, R.drawable.laneinfo_1, R.drawable.laneinfo_1_3))
|
||||
itemList2.add(listOf(R.drawable.laneinfo_2_4, R.drawable.laneinfo_1, R.drawable.laneinfo_1, R.drawable.laneinfo_3))
|
||||
itemList2.add(listOf(R.drawable.laneinfo_1_2, R.drawable.laneinfo_1, R.drawable.laneinfo_1, R.drawable.laneinfo_3))
|
||||
itemList2.add(listOf(R.drawable.laneinfo_2_4, R.drawable.laneinfo_1, R.drawable.laneinfo_1, R.drawable.laneinfo_1_3))
|
||||
|
||||
laneInfoItemsAdapter2 = LaneInfoItems2Adapter(itemList2)
|
||||
|
||||
binding.laneInfoGridview2.adapter = laneInfoItemsAdapter2
|
||||
binding.laneInfoGridview2.onItemClickListener =
|
||||
AdapterView.OnItemClickListener { parent, view, position, id ->
|
||||
val listIds = laneInfoItemsAdapter2.getItem(position) as List<Int>
|
||||
//如果选中了一个view
|
||||
if (selectView != null) {
|
||||
selectView = null
|
||||
}
|
||||
binding.laneInfoTopContainer.removeAllViews()
|
||||
viewModel.removeAllLaneInfo()
|
||||
for (resId in listIds) {
|
||||
val lineViewS = View(context)
|
||||
lineViewS.layoutParams = ViewGroup.LayoutParams(24, 110)
|
||||
lineViewS.background =
|
||||
requireContext().getDrawable(R.drawable.shape_vertical_dashed_line)
|
||||
binding.laneInfoTopContainer.addView(lineViewS, lineViewS.layoutParams)
|
||||
val imageView = ImageView(context)
|
||||
val drawable =
|
||||
requireContext().getDrawable(resId)
|
||||
val color = when (laneType) {
|
||||
1 -> requireContext().resources.getColor(R.color.lane_info_1)
|
||||
2 -> requireContext().resources.getColor(R.color.lane_info_2)
|
||||
else -> requireContext().resources.getColor(R.color.white)
|
||||
}
|
||||
// 创建 PorterDuffColorFilter 对象
|
||||
val colorFilter = PorterDuffColorFilter(color, PorterDuff.Mode.SRC_IN)
|
||||
// 将 PorterDuffColorFilter 设置给 Drawable
|
||||
drawable!!.colorFilter = colorFilter
|
||||
imageView.setColorFilter(color, PorterDuff.Mode.SRC_IN)
|
||||
imageView.layoutParams = ViewGroup.LayoutParams(45, 100)
|
||||
imageView.scaleType = ImageView.ScaleType.FIT_XY
|
||||
imageView.setImageDrawable(drawable)
|
||||
imageView.tag = viewModel.addLaneInfo(resId, laneType)
|
||||
binding.laneInfoTopContainer.addView(imageView)
|
||||
imageView.setOnClickListener {
|
||||
selectView = if (selectView == it) {
|
||||
selectView!!.setBackgroundColor(requireContext().resources.getColor(R.color.gray))
|
||||
null
|
||||
} else {
|
||||
if (selectView != null) {
|
||||
selectView!!.setBackgroundColor(
|
||||
requireContext().resources.getColor(
|
||||
R.color.gray
|
||||
)
|
||||
)
|
||||
}
|
||||
imageView.setBackgroundColor(requireContext().resources.getColor(R.color.lane_info_0))
|
||||
it as ImageView
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//右侧加虚线
|
||||
val lineViewE = View(context)
|
||||
lineViewE.layoutParams = ViewGroup.LayoutParams(24, 110)
|
||||
lineViewE.background =
|
||||
requireContext().getDrawable(R.drawable.shape_vertical_dashed_line)
|
||||
binding.laneInfoTopContainer.addView(lineViewE)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
_binding = null
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化车道信息
|
||||
*/
|
||||
private fun initLaneInfo() {
|
||||
if (viewModel.laneInfoList != null) {
|
||||
val container = binding.laneInfoTopContainer
|
||||
container.removeAllViews()
|
||||
val lineViewS = View(context)
|
||||
lineViewS.layoutParams = ViewGroup.LayoutParams(24, 110)
|
||||
lineViewS.background =
|
||||
requireContext().getDrawable(R.drawable.shape_vertical_dashed_line)
|
||||
container.addView(lineViewS, lineViewS.layoutParams)
|
||||
for (i in viewModel.laneInfoList!!.indices) {
|
||||
val laneInfo = viewModel.laneInfoList!![i]
|
||||
val imageView = ImageView(context)
|
||||
val drawable = requireContext().getDrawable(laneInfo.id)
|
||||
val color = when (laneInfo.type) {
|
||||
1 -> requireContext().resources.getColor(R.color.lane_info_1)
|
||||
2 -> requireContext().resources.getColor(R.color.lane_info_2)
|
||||
else -> requireContext().resources.getColor(R.color.white)
|
||||
}
|
||||
// 创建 PorterDuffColorFilter 对象
|
||||
val colorFilter = PorterDuffColorFilter(color, PorterDuff.Mode.SRC_IN)
|
||||
// 将 PorterDuffColorFilter 设置给 Drawable
|
||||
drawable!!.colorFilter = colorFilter
|
||||
// 将 Drawable 设置给 ImageView
|
||||
imageView.scaleType = ImageView.ScaleType.FIT_XY
|
||||
imageView.setColorFilter(color, PorterDuff.Mode.SRC_IN)
|
||||
imageView.setImageDrawable(drawable)
|
||||
// 将 ImageView 的颜色设置为红色
|
||||
imageView.layoutParams = ViewGroup.LayoutParams(45, 100)
|
||||
container.addView(imageView, imageView.layoutParams)
|
||||
if (i < viewModel.laneInfoList!!.size - 1) {
|
||||
val lineView = View(context)
|
||||
lineView.layoutParams = ViewGroup.LayoutParams(24, 110)
|
||||
lineView.background =
|
||||
requireContext().getDrawable(R.drawable.shape_vertical_dashed_line)
|
||||
container.addView(lineView, lineView.layoutParams)
|
||||
}
|
||||
imageView.tag = i
|
||||
imageView.setOnClickListener {
|
||||
selectView = if (selectView == it) {
|
||||
selectView!!.setBackgroundColor(requireContext().resources.getColor(R.color.gray))
|
||||
null
|
||||
} else {
|
||||
if (selectView != null) {
|
||||
selectView!!.setBackgroundColor(requireContext().resources.getColor(R.color.gray))
|
||||
}
|
||||
imageView.setBackgroundColor(requireContext().resources.getColor(R.color.lane_info_0))
|
||||
it as ImageView
|
||||
}
|
||||
}
|
||||
}
|
||||
val lineViewE = View(context)
|
||||
lineViewE.layoutParams = ViewGroup.LayoutParams(24, 110)
|
||||
lineViewE.background =
|
||||
requireContext().getDrawable(R.drawable.shape_vertical_dashed_line)
|
||||
container.addView(lineViewE, lineViewE.layoutParams)
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,107 @@
|
||||
package com.navinfo.omqs.ui.fragment.evaluationresult;
|
||||
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.PorterDuffColorFilter;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import com.navinfo.omqs.R;
|
||||
import com.navinfo.omqs.databinding.LaneinfoItemBinding;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车信图标gridView
|
||||
*/
|
||||
public class LaneInfoItems2Adapter extends BaseAdapter {
|
||||
List<List<Integer>> dataList;
|
||||
//车道类型 0:普通,1,附加车道,2,公交车道
|
||||
private int type = 0;
|
||||
|
||||
LaneInfoItems2Adapter(List<List<Integer>> data) {
|
||||
dataList = data;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return dataList.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int position) {
|
||||
return dataList.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
ViewHolder holder;
|
||||
if (convertView == null) {
|
||||
LaneinfoItemBinding viewBinding =
|
||||
LaneinfoItemBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false);
|
||||
holder = new ViewHolder();
|
||||
holder.layout = viewBinding.laneinfoItemLayout;
|
||||
convertView = viewBinding.getRoot();
|
||||
convertView.setTag(holder);
|
||||
} else {
|
||||
holder = (ViewHolder) convertView.getTag();
|
||||
}
|
||||
List<Integer> list = dataList.get(position);
|
||||
holder.layout.removeAllViews();
|
||||
for (int i : list) {
|
||||
View lineViewS = new View(parent.getContext());
|
||||
lineViewS.setLayoutParams(new ViewGroup.LayoutParams(24, 90));
|
||||
lineViewS.setBackground(parent.getContext().getDrawable(R.drawable.shape_vertical_dashed_line));
|
||||
holder.layout.addView(lineViewS);
|
||||
|
||||
ImageView imageView = new ImageView(parent.getContext());
|
||||
Drawable drawable = parent.getContext().getDrawable(i);
|
||||
int color;
|
||||
switch (type) {
|
||||
case 1:
|
||||
color = parent.getContext().getResources().getColor(R.color.lane_info_1);
|
||||
break;
|
||||
case 2:
|
||||
color = parent.getContext().getResources().getColor(R.color.lane_info_2);
|
||||
break;
|
||||
default:
|
||||
color = parent.getContext().getResources().getColor(R.color.white);
|
||||
break;
|
||||
}
|
||||
// 创建 PorterDuffColorFilter 对象
|
||||
PorterDuffColorFilter colorFilter = new PorterDuffColorFilter(color, PorterDuff.Mode.SRC_IN);
|
||||
// 将 PorterDuffColorFilter 设置给 Drawable
|
||||
drawable.setColorFilter(colorFilter);
|
||||
imageView.setColorFilter(color, PorterDuff.Mode.SRC_IN);
|
||||
imageView.setBackground(drawable);
|
||||
imageView.setLayoutParams(new ViewGroup.LayoutParams(36, 80));
|
||||
holder.layout.addView(imageView);
|
||||
}
|
||||
View lineViewS = new View(parent.getContext());
|
||||
lineViewS.setLayoutParams(new ViewGroup.LayoutParams(24, 90));
|
||||
lineViewS.setBackground(parent.getContext().getDrawable(R.drawable.shape_vertical_dashed_line));
|
||||
holder.layout.addView(lineViewS);
|
||||
return convertView;
|
||||
}
|
||||
|
||||
private class ViewHolder {
|
||||
LinearLayout layout;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
if (type != this.type) {
|
||||
this.type = type;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package com.navinfo.omqs.ui.fragment.evaluationresult;
|
||||
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.PorterDuffColorFilter;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import com.navinfo.omqs.R;
|
||||
import com.navinfo.omqs.databinding.LaneinfoItemBinding;
|
||||
import com.navinfo.omqs.util.SignUtil;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车信图标gridView
|
||||
*/
|
||||
public class LaneInfoItemsAdapter extends BaseAdapter {
|
||||
List<Integer> dataList;
|
||||
//车道类型 0:普通,1,附加车道,2,公交车道
|
||||
private int type = 0;
|
||||
|
||||
LaneInfoItemsAdapter(List<Integer> data) {
|
||||
dataList = data;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return dataList.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int position) {
|
||||
return dataList.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
ViewHolder holder;
|
||||
if (convertView == null) {
|
||||
LaneinfoItemBinding viewBinding =
|
||||
LaneinfoItemBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false);
|
||||
holder = new ViewHolder();
|
||||
holder.layout = viewBinding.laneinfoItemLayout;
|
||||
convertView = viewBinding.getRoot();
|
||||
convertView.setTag(holder);
|
||||
} else {
|
||||
holder = (ViewHolder) convertView.getTag();
|
||||
}
|
||||
ImageView imageView = new ImageView(parent.getContext());
|
||||
Drawable drawable = parent.getContext().getDrawable(dataList.get(position));
|
||||
int color;
|
||||
switch (type) {
|
||||
case 1:
|
||||
color = parent.getContext().getResources().getColor(R.color.lane_info_1);
|
||||
break;
|
||||
case 2:
|
||||
color = parent.getContext().getResources().getColor(R.color.lane_info_2);
|
||||
break;
|
||||
default:
|
||||
color = parent.getContext().getResources().getColor(R.color.white);
|
||||
break;
|
||||
}
|
||||
// 创建 PorterDuffColorFilter 对象
|
||||
PorterDuffColorFilter colorFilter = new PorterDuffColorFilter(color, PorterDuff.Mode.SRC_IN);
|
||||
// 将 PorterDuffColorFilter 设置给 Drawable
|
||||
drawable.setColorFilter(colorFilter);
|
||||
imageView.setBackground(drawable);
|
||||
holder.layout.removeAllViews();
|
||||
holder.layout.addView(imageView);
|
||||
return convertView;
|
||||
}
|
||||
|
||||
private class ViewHolder {
|
||||
LinearLayout layout;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
if (type != this.type) {
|
||||
this.type = type;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
}
|
@ -17,6 +17,9 @@ import com.navinfo.omqs.ui.fragment.BaseFragment
|
||||
import com.navinfo.omqs.ui.other.shareViewModels
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
|
||||
/**
|
||||
* 问题现象页面
|
||||
*/
|
||||
@AndroidEntryPoint
|
||||
class PhenomenonFragment :
|
||||
BaseFragment() {
|
||||
|
@ -12,6 +12,9 @@ import com.navinfo.omqs.databinding.FragmentProblemLinkBinding
|
||||
import com.navinfo.omqs.ui.fragment.BaseFragment
|
||||
import com.navinfo.omqs.ui.other.shareViewModels
|
||||
|
||||
/**
|
||||
* 问题环节页面
|
||||
*/
|
||||
class ProblemLinkFragment : BaseFragment() {
|
||||
private var _binding: FragmentProblemLinkBinding? = null
|
||||
private val binding get() = _binding!!
|
||||
|
306
app/src/main/java/com/navinfo/omqs/ui/widget/FlowLayout.kt
Normal file
306
app/src/main/java/com/navinfo/omqs/ui/widget/FlowLayout.kt
Normal file
@ -0,0 +1,306 @@
|
||||
package com.navinfo.omqs.ui.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.util.AttributeSet
|
||||
import android.util.SparseArray
|
||||
import android.util.TypedValue
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.annotation.IntDef
|
||||
|
||||
/**
|
||||
* desc:
|
||||
* Created by huangxy on 2018/8/15.
|
||||
*/
|
||||
class FlowLayout @JvmOverloads constructor(
|
||||
context: Context?,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ViewGroup(context, attrs, defStyleAttr) {
|
||||
private var mLine: Line? = null
|
||||
|
||||
//所有的子控件
|
||||
private var mViews: SparseArray<View?>? = null
|
||||
|
||||
/**
|
||||
* 横向间隔
|
||||
*/
|
||||
private var mHorizontalSpacing = DEFAULT_SPACING
|
||||
|
||||
/**
|
||||
* 纵向间隔
|
||||
*/
|
||||
private var mVerticalSpacing = DEFAULT_SPACING
|
||||
|
||||
/**
|
||||
* 当前行已用的宽度,由子View宽度加上横向间隔
|
||||
*/
|
||||
private var mUsedWidth = 0
|
||||
|
||||
/**
|
||||
* 代表每一行的集合
|
||||
*/
|
||||
private val mLines: MutableList<Line?> = ArrayList()
|
||||
|
||||
//子View的对齐方式
|
||||
private var isAlignByCenter = 1
|
||||
|
||||
/**
|
||||
* 最大的行数
|
||||
*/
|
||||
private val mMaxLinesCount = Int.MAX_VALUE
|
||||
|
||||
/**
|
||||
* 是否需要布局,只用于第一次
|
||||
*/
|
||||
var mNeedLayout = true
|
||||
|
||||
interface AlienState {
|
||||
@IntDef(value = [RIGHT, LEFT, CENTER])
|
||||
annotation class Val
|
||||
companion object {
|
||||
const val RIGHT = 0
|
||||
const val LEFT = 1
|
||||
const val CENTER = 2
|
||||
}
|
||||
}
|
||||
|
||||
fun setAlignByCenter(@AlienState.Val isAlignByCenter: Int) {
|
||||
this.isAlignByCenter = isAlignByCenter
|
||||
requestLayoutInner()
|
||||
}
|
||||
|
||||
private fun requestLayoutInner() {
|
||||
Handler(Looper.getMainLooper()).post { requestLayout() }
|
||||
}
|
||||
|
||||
fun setAdapter(list: List<*>, res: Int, mItemView: ItemView<*>) {
|
||||
removeAllViews()
|
||||
val layoutPadding = dipToPx(context, 8f)
|
||||
setHorizontalSpacing(layoutPadding)
|
||||
setVerticalSpacing(layoutPadding)
|
||||
val size = list.size
|
||||
for (i in 0 until size) {
|
||||
val item = list[i]!!
|
||||
val inflate = LayoutInflater.from(context).inflate(res, null)
|
||||
mItemView.getCover(item, ViewHolder(inflate), inflate, i)
|
||||
addView(inflate)
|
||||
}
|
||||
}
|
||||
|
||||
abstract class ItemView<T> {
|
||||
abstract fun getCover(item: Any, holder: ViewHolder, inflate: View?, position: Int)
|
||||
}
|
||||
|
||||
inner class ViewHolder(var mConvertView: View) {
|
||||
init {
|
||||
mViews = SparseArray()
|
||||
}
|
||||
|
||||
fun <T : View?> getView(viewId: Int): T? {
|
||||
var view = mViews!![viewId]
|
||||
if (view == null) {
|
||||
view = mConvertView.findViewById(viewId)
|
||||
mViews!!.put(viewId, view)
|
||||
}
|
||||
try {
|
||||
return view as T?
|
||||
} catch (e: ClassCastException) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
fun setImageView(viewId: Int, imageView: ImageView) {
|
||||
getView<ViewGroup>(viewId)?.addView(imageView)
|
||||
}
|
||||
|
||||
fun setText(viewId: Int, text: String?) {
|
||||
val view = getView<TextView>(viewId)!!
|
||||
view.text = text
|
||||
}
|
||||
}
|
||||
|
||||
fun setHorizontalSpacing(spacing: Int) {
|
||||
if (mHorizontalSpacing != spacing) {
|
||||
mHorizontalSpacing = spacing
|
||||
requestLayoutInner()
|
||||
}
|
||||
}
|
||||
|
||||
fun setVerticalSpacing(spacing: Int) {
|
||||
if (mVerticalSpacing != spacing) {
|
||||
mVerticalSpacing = spacing
|
||||
requestLayoutInner()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
|
||||
val sizeWidth = MeasureSpec.getSize(widthMeasureSpec) - paddingRight - paddingLeft
|
||||
val sizeHeight = MeasureSpec.getSize(heightMeasureSpec) - paddingTop - paddingBottom
|
||||
val modeWidth = MeasureSpec.getMode(widthMeasureSpec)
|
||||
val modeHeight = MeasureSpec.getMode(heightMeasureSpec)
|
||||
restoreLine() // 还原数据,以便重新记录
|
||||
val count = childCount
|
||||
for (i in 0 until count) {
|
||||
val child = getChildAt(i)
|
||||
if (child.visibility == GONE) {
|
||||
continue
|
||||
}
|
||||
val childWidthMeasureSpec = MeasureSpec.makeMeasureSpec(
|
||||
sizeWidth,
|
||||
if (modeWidth == MeasureSpec.EXACTLY) MeasureSpec.AT_MOST else modeWidth
|
||||
)
|
||||
val childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(
|
||||
sizeHeight,
|
||||
if (modeHeight == MeasureSpec.EXACTLY) MeasureSpec.AT_MOST else modeHeight
|
||||
)
|
||||
// 测量child
|
||||
child.measure(childWidthMeasureSpec, childHeightMeasureSpec)
|
||||
if (mLine == null) {
|
||||
mLine = Line()
|
||||
}
|
||||
val childWidth = child.measuredWidth
|
||||
mUsedWidth += childWidth // 增加使用的宽度
|
||||
if (mUsedWidth <= sizeWidth) { // 使用宽度小于总宽度,该child属于这一行。
|
||||
mLine!!.addView(child) // 添加child
|
||||
mUsedWidth += mHorizontalSpacing // 加上间隔
|
||||
if (mUsedWidth >= sizeWidth) { // 加上间隔后如果大于等于总宽度,需要换行
|
||||
if (!newLine()) {
|
||||
break
|
||||
}
|
||||
}
|
||||
} else { // 使用宽度大于总宽度。需要换行
|
||||
if (mLine!!.viewCount == 0) { // 如果这行一个child都没有,即使占用长度超过了总长度,也要加上去,保证每行都有至少有一个child
|
||||
mLine!!.addView(child) // 添加child
|
||||
if (!newLine()) { // 换行
|
||||
break
|
||||
}
|
||||
} else { // 如果该行有数据了,就直接换行
|
||||
if (!newLine()) { // 换行
|
||||
break
|
||||
}
|
||||
// 在新的一行,不管是否超过长度,先加上去,因为这一行一个child都没有,所以必须满足每行至少有一个child
|
||||
mLine!!.addView(child)
|
||||
mUsedWidth += childWidth + mHorizontalSpacing
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mLine != null && mLine!!.viewCount > 0 && !mLines.contains(mLine)) {
|
||||
// 由于前面采用判断长度是否超过最大宽度来决定是否换行,则最后一行可能因为还没达到最大宽度,所以需要验证后加入集合中
|
||||
mLines.add(mLine)
|
||||
}
|
||||
val totalWidth = MeasureSpec.getSize(widthMeasureSpec)
|
||||
var totalHeight = 0
|
||||
val linesCount = mLines.size
|
||||
for (i in 0 until linesCount) { // 加上所有行的高度
|
||||
totalHeight += mLines[i]!!.mHeight
|
||||
}
|
||||
totalHeight += mVerticalSpacing * (linesCount - 1) // 加上所有间隔的高度
|
||||
totalHeight += paddingTop + paddingBottom // 加上padding
|
||||
// 设置布局的宽高,宽度直接采用父view传递过来的最大宽度,而不用考虑子view是否填满宽度,因为该布局的特性就是填满一行后,再换行
|
||||
// 高度根据设置的模式来决定采用所有子View的高度之和还是采用父view传递过来的高度
|
||||
setMeasuredDimension(totalWidth, resolveSize(totalHeight, heightMeasureSpec))
|
||||
}
|
||||
|
||||
private fun restoreLine() {
|
||||
mLines.clear()
|
||||
mLine = Line()
|
||||
mUsedWidth = 0
|
||||
}
|
||||
|
||||
override fun onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int) {
|
||||
if (changed) {
|
||||
val left = paddingLeft //获取最初的左上点
|
||||
var top = paddingTop
|
||||
val count = mLines.size
|
||||
for (i in 0 until count) {
|
||||
val line = mLines[i]
|
||||
line!!.LayoutView(left, top) //摆放每一行中子View的位置
|
||||
top += line.mHeight + mVerticalSpacing //为下一行的top赋值
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增加一行
|
||||
*/
|
||||
private fun newLine(): Boolean {
|
||||
mLines.add(mLine)
|
||||
if (mLines.size < mMaxLinesCount) {
|
||||
mLine = Line()
|
||||
mUsedWidth = 0
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
internal inner class Line {
|
||||
var mWidth = 0 // 该行中所有的子View累加的宽度
|
||||
var mHeight = 0 // 该行中所有的子View中高度的那个子View的高度
|
||||
var views: MutableList<View> = ArrayList()
|
||||
fun addView(view: View) { // 往该行中添加一个
|
||||
views.add(view)
|
||||
mWidth += view.measuredWidth
|
||||
val childHeight = view.measuredHeight
|
||||
mHeight = if (mHeight < childHeight) childHeight else mHeight //高度等于一行中最高的View
|
||||
}
|
||||
|
||||
val viewCount: Int
|
||||
get() = views.size
|
||||
|
||||
//摆放行中子View的位置
|
||||
fun LayoutView(l: Int, t: Int) {
|
||||
var left = l
|
||||
val count = viewCount
|
||||
val layoutWidth = measuredWidth - paddingLeft - paddingRight //行的总宽度
|
||||
//剩余的宽度,是除了View和间隙的剩余空间
|
||||
val surplusWidth = layoutWidth - mWidth - mHorizontalSpacing * (count - 1)
|
||||
if (surplusWidth >= 0) {
|
||||
for (i in 0 until count) {
|
||||
val view = views[i]
|
||||
val childWidth = view.measuredWidth
|
||||
val childHeight = view.measuredHeight
|
||||
//计算出每个View的顶点,是由最高的View和该View高度的差值除以2
|
||||
var topOffset = ((mHeight - childHeight) / 2.0 + 0.5).toInt()
|
||||
if (topOffset < 0) {
|
||||
topOffset = 0
|
||||
}
|
||||
|
||||
//布局View
|
||||
if (i == 0) {
|
||||
when (isAlignByCenter) {
|
||||
AlienState.CENTER -> left += surplusWidth / 2
|
||||
AlienState.RIGHT -> left += surplusWidth
|
||||
else -> left = 0
|
||||
}
|
||||
}
|
||||
view.layout(
|
||||
left,
|
||||
t + topOffset,
|
||||
left + childWidth,
|
||||
t + topOffset + childHeight
|
||||
)
|
||||
left += childWidth + mVerticalSpacing //为下一个View的left赋值
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val DEFAULT_SPACING = 20
|
||||
fun dipToPx(ctx: Context, dip: Float): Int {
|
||||
return TypedValue.applyDimension(
|
||||
TypedValue.COMPLEX_UNIT_DIP,
|
||||
dip,
|
||||
ctx.resources.displayMetrics
|
||||
).toInt()
|
||||
}
|
||||
}
|
||||
}
|
@ -22,6 +22,8 @@ class NaviEngineNew(
|
||||
DataCodeEnum.OMDB_LINK_NAME.name,
|
||||
)
|
||||
|
||||
// private latestRoute
|
||||
// private
|
||||
|
||||
private val locationList = mutableListOf<NiLocation>()
|
||||
|
||||
@ -45,8 +47,6 @@ class NaviEngineNew(
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
latestRoute?.let {
|
||||
|
||||
val res2 =
|
||||
|
@ -1702,7 +1702,7 @@ class SignUtil {
|
||||
/**
|
||||
* 获取车信图标
|
||||
*/
|
||||
fun getLineInfoIcons(renderEntity: RenderEntity): List<LaneInfoItem> {
|
||||
fun getLineInfoIcons(renderEntity: RenderEntity): MutableList<LaneInfoItem> {
|
||||
val list = mutableListOf<LaneInfoItem>()
|
||||
try {
|
||||
var laneinfoGroup = renderEntity.properties["laneinfoGroup"]
|
||||
@ -1718,7 +1718,7 @@ class SignUtil {
|
||||
for (i in 0 until itemArray.length()) {
|
||||
val itemObject = itemArray[i]
|
||||
val type = typeArray[i]
|
||||
var laneInfo = "laneinfo_${itemObject.toString().replace(",", "_")}"
|
||||
val laneInfo = "laneinfo_${itemObject.toString().replace(",", "_")}"
|
||||
list.add(
|
||||
LaneInfoItem(
|
||||
id = getResId(
|
||||
@ -1739,7 +1739,7 @@ class SignUtil {
|
||||
/**
|
||||
* 通过字符串名称获取资源id
|
||||
*/
|
||||
private fun getResId(variableName: String, c: Class<*>): Int {
|
||||
fun getResId(variableName: String, c: Class<*>): Int {
|
||||
return try {
|
||||
val idField: Field = c.getDeclaredField(variableName)
|
||||
idField.getInt(idField)
|
||||
|
@ -4,12 +4,21 @@
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="30">
|
||||
<path
|
||||
android:pathData="M10.947,29.277l-0.034,-19.755l2.048,0.838l0.032,18.901z"
|
||||
android:fillColor="#00C800"/>
|
||||
android:pathData="M10.938,29.033l0.027,-20.687l2.037,-0.136l-0.016,20.83z"
|
||||
android:strokeWidth="1"
|
||||
android:fillColor="#00C800"
|
||||
android:fillType="nonZero"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M11.226,11.553l10.101,-6.226l-0.601,4.448l2.223,-1.305l0.684,-5.724l-5.484,-2.023l-2.296,1.506l4.597,1.476l-9.535,5.817z"
|
||||
android:fillColor="#00C800"/>
|
||||
android:pathData="M14.223,4.92C15.325,4.562 17.12,4.485 17.12,4.485L20.138,4.497L17.274,1.022L19.861,0.96L23.471,5.48L19.867,10.106L17.113,10.037L20.251,6.347L16.921,6.331C16.921,6.331 15.296,6.324 14.165,7.119C13.035,7.913 12.992,9.509 12.986,9.896C12.981,10.284 10.68,8.767 11.057,8.081C11.711,6.524 12.646,5.428 14.223,4.92Z"
|
||||
android:strokeWidth="1"
|
||||
android:fillColor="#00C800"
|
||||
android:fillType="nonZero"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M12.769,18.262C12.502,12.908 3.819,12.899 3.917,18.379L3.943,26.328L0.432,23.234L0.367,25.297L5.004,29.196L9.432,25.322L9.439,23.058L5.942,26.233L5.96,18.779C6.043,15.185 10.721,15.318 10.908,18.685L12.769,18.262Z"
|
||||
android:fillColor="#00C800"/>
|
||||
android:pathData="M12.931,18.041C12.664,12.687 3.981,12.678 4.079,18.158L4.105,26.107L0.594,23.013L0.529,25.076L5.166,28.975L9.594,25.101L9.6,22.837L6.104,26.012L6.122,18.558C6.205,14.964 10.883,15.097 11.07,18.464L12.931,18.041Z"
|
||||
android:strokeWidth="1"
|
||||
android:fillColor="#00C800"
|
||||
android:fillType="nonZero"
|
||||
android:strokeColor="#00000000"/>
|
||||
</vector>
|
||||
|
@ -51,9 +51,9 @@
|
||||
android:layout_marginRight="5dp"
|
||||
android:background="@color/transparent"
|
||||
android:src="@drawable/icon_delete"
|
||||
app:layout_constraintBottom_toBottomOf="@id/evaluation_bar_save"
|
||||
app:layout_constraintRight_toLeftOf="@id/evaluation_bar_save"
|
||||
app:layout_constraintTop_toTopOf="@id/evaluation_bar_save"
|
||||
app:layout_constraintBottom_toBottomOf="@id/evaluation_bar_save" />
|
||||
app:layout_constraintTop_toTopOf="@id/evaluation_bar_save" />
|
||||
|
||||
|
||||
<ImageButton
|
||||
@ -62,9 +62,9 @@
|
||||
android:layout_height="40dp"
|
||||
android:background="@color/transparent"
|
||||
android:src="@drawable/measuring_tool_distance"
|
||||
app:layout_constraintBottom_toBottomOf="@id/evaluation_bar_save"
|
||||
app:layout_constraintRight_toLeftOf="@id/evaluation_bar_delete"
|
||||
app:layout_constraintTop_toTopOf="@id/evaluation_bar_save"
|
||||
app:layout_constraintBottom_toBottomOf="@id/evaluation_bar_save"/>
|
||||
app:layout_constraintTop_toTopOf="@id/evaluation_bar_save" />
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="0dp"
|
||||
@ -84,6 +84,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="7dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@ -97,8 +98,7 @@
|
||||
<TextView
|
||||
android:id="@+id/evaluation_id"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@ -152,7 +152,7 @@
|
||||
android:id="@+id/evaluation_problem_type"
|
||||
style="@style/evaluation_fragment_text_style"
|
||||
android:onClick="@{fragment::onClick}"
|
||||
android:text="@{viewModel.liveDataQsRecordBean.problemType}" />
|
||||
android:text="" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@ -223,6 +223,7 @@
|
||||
android:text="问题描述" />
|
||||
|
||||
<com.navinfo.omqs.ui.widget.MyEditeText
|
||||
android:id="@+id/evaluation_description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shape_rect_white_2dp_bg"
|
||||
@ -235,7 +236,6 @@
|
||||
android:paddingLeft="12dp"
|
||||
android:paddingTop="2dp"
|
||||
android:paddingBottom="2dp"
|
||||
android:text="@={viewModel.liveDataQsRecordBean.description}"
|
||||
android:textSize="12sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
107
app/src/main/res/layout/fragment_line_info_edit.xml
Normal file
107
app/src/main/res/layout/fragment_line_info_edit.xml
Normal file
@ -0,0 +1,107 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout 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:layout_marginTop="55dp"
|
||||
tools:context=".ui.fragment.evaluationresult.LaneInfoEditFragment">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="@dimen/fragment_phenomenon_width"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="right"
|
||||
android:background="@drawable/shape_middle_fragment_bg"
|
||||
android:clickable="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<HorizontalScrollView
|
||||
android:id="@+id/lane_info_top_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="10dp"
|
||||
android:requiresFadingEdge="horizontal"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:gravity="center_horizontal"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/lane_info_top_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/gray"
|
||||
android:orientation="horizontal"
|
||||
android:padding="5dp" />
|
||||
</HorizontalScrollView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/lane_info_radiogroup"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/lane_info_radio_1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="true"
|
||||
android:text="普通车道"
|
||||
android:textColor="@color/lane_info_0" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/lane_info_radio_2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="false"
|
||||
android:text="附加车道"
|
||||
android:textColor="@color/lane_info_1" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/lane_info_radio_3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="false"
|
||||
android:text="公交车道"
|
||||
android:textColor="@color/lane_info_2" />
|
||||
</RadioGroup>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/lane_info_backspace"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/icon_back_n" />
|
||||
</LinearLayout>
|
||||
|
||||
<GridView
|
||||
android:id="@+id/lane_info_gridview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:horizontalSpacing="2dp"
|
||||
android:numColumns="8"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
android:scrollbars="none"
|
||||
android:verticalSpacing="2dp" />
|
||||
|
||||
<GridView
|
||||
android:id="@+id/lane_info_gridview2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:horizontalSpacing="2dp"
|
||||
android:numColumns="2"
|
||||
android:layout_marginTop="8dp"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
android:scrollbars="none"
|
||||
android:verticalSpacing="2dp" />
|
||||
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
11
app/src/main/res/layout/laneinfo_item.xml
Normal file
11
app/src/main/res/layout/laneinfo_item.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/laneinfo_item_layout"
|
||||
android:padding="2dp"
|
||||
android:orientation="horizontal"
|
||||
android:background="@color/gray"
|
||||
android:gravity="center"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp">
|
||||
|
||||
</LinearLayout>
|
@ -30,5 +30,9 @@
|
||||
android:name="com.navinfo.omqs.ui.fragment.tasklink.TaskLinkMiddleFragment"
|
||||
android:label="新增评测Link属性选择页面"
|
||||
tools:layout="@layout/fragment_task_link_middle"></fragment>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/LineInfoEditFragment"
|
||||
android:name="com.navinfo.omqs.ui.fragment.evaluationresult.LaneInfoEditFragment"
|
||||
android:label="车信问题编辑页面"
|
||||
tools:layout="@layout/fragment_line_info_edit"></fragment>
|
||||
</navigation>
|
@ -29,7 +29,7 @@ open class QsRecordBean @JvmOverloads constructor(
|
||||
/**
|
||||
* linkPid 绑定的道路ID
|
||||
*/
|
||||
var linkId: String = "84207223282277331",
|
||||
var linkId: String = "",
|
||||
/**
|
||||
*问题分类
|
||||
*/
|
||||
|
@ -132,7 +132,7 @@ public class OMDBTileDataSource implements ITileDataSource {
|
||||
List<RenderEntity> listResult = realmQuery.findAll();
|
||||
long newTime = System.currentTimeMillis() - time;
|
||||
|
||||
Log.e("jingo", "当前OMDBTileDataSource " + Thread.currentThread().hashCode() + " 当前realm " + realm.hashCode() + " 查询耗时" + newTime + " 条数" + listResult.size());
|
||||
// Log.e("jingo", "当前OMDBTileDataSource " + Thread.currentThread().hashCode() + " 当前realm " + realm.hashCode() + " 查询耗时" + newTime + " 条数" + listResult.size());
|
||||
// 数据记录的tile号是以正外接tile号列表,此处过滤并未与当前tile相交的数据
|
||||
if (!listResult.isEmpty()) {
|
||||
Polygon tilePolygon = GeometryTools.getTilePolygon(tile);
|
||||
|
Loading…
x
Reference in New Issue
Block a user