From d3fd50f941ac3769bb172b82968bad852405386f Mon Sep 17 00:00:00 2001 From: squallzhjch Date: Fri, 5 May 2023 15:14:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../navinfo/omqs/tools/LayerConfigUtils.kt | 10 ++++--- .../EvaluationResultViewModel.kt | 16 ++++++----- .../library/map/handler/LineHandler.kt | 28 ++++++++++++++----- 3 files changed, 36 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/com/navinfo/omqs/tools/LayerConfigUtils.kt b/app/src/main/java/com/navinfo/omqs/tools/LayerConfigUtils.kt index 41a96486..8a98ce1f 100644 --- a/app/src/main/java/com/navinfo/omqs/tools/LayerConfigUtils.kt +++ b/app/src/main/java/com/navinfo/omqs/tools/LayerConfigUtils.kt @@ -17,8 +17,9 @@ class LayerConfigUtils { fun getLayerConfigList(): List { // 首先读取Shared文件,如果存在则直接返回,否则读取config文件 return SPStaticUtils.getString(Constant.EVENT_LAYER_MANAGER_CHANGE, null).let { - if (this!=null) { - val result: List = gson.fromJson(it, object : TypeToken>(){}.type) + if (it != null) { + val result: List = + gson.fromJson(it, object : TypeToken>() {}.type) result } else { LayerConfigUtils.getLayerConfigListFromAssetsFile() @@ -30,12 +31,13 @@ class LayerConfigUtils { val resultList = mutableListOf() if (omdbConfigFile.exists()) { val omdbConfiStr = FileIOUtils.readFile2String(omdbConfigFile) - val omdbConfig = gson.fromJson(omdbConfiStr, ImportConfig::class.java) + val omdbConfig = gson.fromJson(omdbConfiStr, ImportConfig::class.java) resultList.add(omdbConfig) } if (otherConfigFile.exists()) { val otherConfiStr = FileIOUtils.readFile2String(otherConfigFile) - val otherConfig = gson.fromJson(otherConfiStr, ImportConfig::class.java) + val otherConfig = + gson.fromJson(otherConfiStr, ImportConfig::class.java) resultList.add(otherConfig) } return resultList diff --git a/app/src/main/java/com/navinfo/omqs/ui/fragment/evaluationresult/EvaluationResultViewModel.kt b/app/src/main/java/com/navinfo/omqs/ui/fragment/evaluationresult/EvaluationResultViewModel.kt index a98a769c..c9334af9 100644 --- a/app/src/main/java/com/navinfo/omqs/ui/fragment/evaluationresult/EvaluationResultViewModel.kt +++ b/app/src/main/java/com/navinfo/omqs/ui/fragment/evaluationresult/EvaluationResultViewModel.kt @@ -118,7 +118,7 @@ class EvaluationResultViewModel @Inject constructor( /** * 查询数据库,获取问题分类 */ - fun initNewData(bean: SignBean?,filePath: String) { + fun initNewData(bean: SignBean?, filePath: String) { viewModelScope.launch(Dispatchers.IO) { getClassTypeList() getProblemLinkList() @@ -171,6 +171,7 @@ class EvaluationResultViewModel @Inject constructor( it.linkId = linkList[0].properties[LinkTable.linkPid] ?: "" mapController.lineHandler.showLine(linkList[0].geometry) + Log.e("jingo", "捕捉到的linkId = ${it.linkId}") } else { it.linkId = "" mapController.lineHandler.removeLine() @@ -384,13 +385,13 @@ class EvaluationResultViewModel @Inject constructor( fun addChatMsgEntity(filePath: String) { - if(filePath.isNotEmpty()){ + if (filePath.isNotEmpty()) { var chatMsgEntityList: MutableList = ArrayList() - if(listDataChatMsgEntityList.value?.isEmpty() == false){ + if (listDataChatMsgEntityList.value?.isEmpty() == false) { chatMsgEntityList = listDataChatMsgEntityList.value!! } val chatMsgEntity = ChatMsgEntity() - chatMsgEntity.name = filePath.replace(Constant.USER_DATA_ATTACHEMNT_PATH,"").toString() + chatMsgEntity.name = filePath.replace(Constant.USER_DATA_ATTACHEMNT_PATH, "").toString() chatMsgEntity.voiceUri = Constant.USER_DATA_ATTACHEMNT_PATH chatMsgEntityList.add(chatMsgEntity) @@ -398,7 +399,7 @@ class EvaluationResultViewModel @Inject constructor( var attachmentList: RealmList = RealmList() //赋值处理 - if(liveDataQsRecordBean.value?.attachmentBeanList?.isEmpty() == false){ + if (liveDataQsRecordBean.value?.attachmentBeanList?.isEmpty() == false) { attachmentList = liveDataQsRecordBean.value?.attachmentBeanList!! } @@ -414,7 +415,7 @@ class EvaluationResultViewModel @Inject constructor( fun startSoundMetter(activity: Activity, v: View) { - if(mSpeakMode==null){ + if (mSpeakMode == null) { mSpeakMode = SpeakMode(activity) } @@ -424,7 +425,8 @@ class EvaluationResultViewModel @Inject constructor( pop!!.width = ViewGroup.LayoutParams.MATCH_PARENT pop!!.height = ViewGroup.LayoutParams.WRAP_CONTENT pop!!.setBackgroundDrawable(BitmapDrawable()) - val view = View.inflate(activity as Context, R.layout.cv_card_voice_rcd_hint_window, null) + val view = + View.inflate(activity as Context, R.layout.cv_card_voice_rcd_hint_window, null) pop!!.contentView = view volume = view.findViewById(R.id.volume) } diff --git a/collect-library/src/main/java/com/navinfo/collect/library/map/handler/LineHandler.kt b/collect-library/src/main/java/com/navinfo/collect/library/map/handler/LineHandler.kt index 6079bfcd..6ff737f4 100644 --- a/collect-library/src/main/java/com/navinfo/collect/library/map/handler/LineHandler.kt +++ b/collect-library/src/main/java/com/navinfo/collect/library/map/handler/LineHandler.kt @@ -39,6 +39,9 @@ class LineHandler(context: AppCompatActivity, mapView: NIMapView) : BaseHandler( //绘制线 样式 private val lineStyle: Style + //高亮线绘制线 样式 + private val defaultLineStyle: Style + //线型编辑时的样式 private val editTempStyle: Style @@ -60,14 +63,16 @@ class LineHandler(context: AppCompatActivity, mapView: NIMapView) : BaseHandler( private val mDefaultPathLayer: PathLayer val omdbTaskLinkLayer by lazy { - val omdbTaskLinkLayer = OmdbTaskLinkLayer(mMapView.vtmMap, + val omdbTaskLinkLayer = OmdbTaskLinkLayer( + mMapView.vtmMap, Style.builder() // .stippleColor(context.resources.getColor(R.color.draw_line_red_color, null)) - .fillColor(context.resources.getColor(R.color.draw_line_red_color, null)) - .fillAlpha(0.5f) - .strokeColor(context.resources.getColor(R.color.draw_line_red_color, null)) + .fillColor(context.resources.getColor(R.color.draw_line_red_color, null)) + .fillAlpha(0.5f) + .strokeColor(context.resources.getColor(R.color.draw_line_red_color, null)) .strokeWidth(4f) - .fixed(true).build()) + .fixed(true).build() + ) addLayer(omdbTaskLinkLayer, NIMapView.LAYER_GROUPS.VECTOR) omdbTaskLinkLayer } @@ -84,6 +89,15 @@ class LineHandler(context: AppCompatActivity, mapView: NIMapView) : BaseHandler( .strokeColor(context.resources.getColor(R.color.draw_line_blue2_color, null)) .fixed(true).build() + + defaultLineStyle = Style.builder() + .stippleColor(context.resources.getColor(R.color.draw_line_blue2_color, null)) + .strokeWidth(10f) + .fillColor(context.resources.getColor(R.color.teal_200, null)) + .fillAlpha(0.5f) + .strokeColor(context.resources.getColor(R.color.teal_200, null)) + .fixed(true).build() + newTempStyle = Style.builder().stippleColor(context.resources.getColor(R.color.transparent, null)) .stipple(30).stippleWidth(30f).strokeWidth(4f) @@ -95,8 +109,8 @@ class LineHandler(context: AppCompatActivity, mapView: NIMapView) : BaseHandler( .stipple(30).stippleWidth(30f).strokeWidth(8f) .strokeColor(context.resources.getColor(R.color.draw_line_red_color, null)) .fixed(true).randomOffset(false).build() - mDefaultPathLayer = PathLayer(mMapView.vtmMap, lineStyle) - addLayer(mDefaultPathLayer, NIMapView.LAYER_GROUPS.VECTOR) + mDefaultPathLayer = PathLayer(mMapView.vtmMap, defaultLineStyle) + addLayer(mDefaultPathLayer, NIMapView.LAYER_GROUPS.OPERATE) mPathLayer = PathLayer(mMapView.vtmMap, lineStyle) // addLayer(mPathLayer, NIMapView.LAYER_GROUPS.OPERATE)