1.修改布局允许水平旋转2.修复主页访问图层管理崩溃问题3.扩充轨迹字段
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
package com.navinfo.omqs
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.Application
|
||||
import android.content.pm.ActivityInfo
|
||||
import android.content.res.Configuration
|
||||
import android.view.Surface
|
||||
import android.view.WindowManager
|
||||
import com.navinfo.omqs.tools.FileManager
|
||||
import com.navinfo.omqs.ui.manager.TakePhotoManager
|
||||
import com.navinfo.omqs.util.NetUtils
|
||||
@@ -23,5 +28,4 @@ class OMQSApplication : Application() {
|
||||
val hashBytes = messageDigest.digest(inputString.toByteArray())
|
||||
return hashBytes.joinToString("") { "%02x".format(it) };
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,10 +13,15 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
open class BaseActivity : AppCompatActivity() {
|
||||
private var loadingDialog: AlertDialog? = null
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE//横屏
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 显示loading dialog
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.navinfo.omqs.ui.activity.console
|
||||
|
||||
import android.content.Intent
|
||||
import android.content.pm.ActivityInfo
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
@@ -199,7 +200,7 @@ class ConsoleActivity : BaseActivity(), OnClickListener {
|
||||
* 图层设置
|
||||
*/
|
||||
R.id.console_layer_setting_bg, R.id.console_layer_setting_icon_bg -> {
|
||||
/* if (sceneFlag) {
|
||||
if (sceneFlag) {
|
||||
mFragment = LayermanagerFragment()
|
||||
sceneFlag = false
|
||||
TransitionManager.go(bScene, bTransition)
|
||||
@@ -210,7 +211,7 @@ class ConsoleActivity : BaseActivity(), OnClickListener {
|
||||
.replace(fragmentId, mFragment!!).commit()
|
||||
}
|
||||
return
|
||||
}*/
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 测评结果列表
|
||||
|
||||
@@ -78,6 +78,9 @@ class MainViewModel @Inject constructor(
|
||||
|
||||
// var testPoint = GeoPoint(0, 0)
|
||||
|
||||
//uuid标识,用于记录轨迹组
|
||||
val uuid = UUID.randomUUID().toString()
|
||||
|
||||
//语音窗体
|
||||
private var pop: PopupWindow? = null
|
||||
|
||||
@@ -160,15 +163,9 @@ class MainViewModel @Inject constructor(
|
||||
}
|
||||
|
||||
private fun initLocation() {
|
||||
// mapController.locationLayerHandler.setNiLocationListener(NiLocationListener {
|
||||
// addSaveTrace(it)
|
||||
//
|
||||
// })
|
||||
//用于定位点存储到数据库
|
||||
viewModelScope.launch(Dispatchers.Default) {
|
||||
mapController.locationLayerHandler.niLocationFlow.collect { location ->
|
||||
// location.longitude = testPoint.longitude
|
||||
// location.latitude = testPoint.latitude
|
||||
val geometry = GeometryTools.createGeometry(
|
||||
GeoPoint(
|
||||
location.latitude, location.longitude
|
||||
@@ -186,7 +183,13 @@ class MainViewModel @Inject constructor(
|
||||
location.tiley = y
|
||||
}
|
||||
}
|
||||
Log.e("jingo", "定位点插入 ${Thread.currentThread().name}")
|
||||
Log.e("jingo", "定位点插入 ${location.longitude}")
|
||||
location.groupId = uuid
|
||||
try {
|
||||
location.timeStamp = DateTimeUtil.getTime(location.time).toString()
|
||||
}catch (e: Exception){
|
||||
|
||||
}
|
||||
traceDataBase.niLocationDao.insert(location)
|
||||
mapController.mMapView.vtmMap.updateMap(true)
|
||||
}
|
||||
@@ -194,8 +197,6 @@ class MainViewModel @Inject constructor(
|
||||
//用于定位点捕捉道路
|
||||
viewModelScope.launch(Dispatchers.Default) {
|
||||
mapController.locationLayerHandler.niLocationFlow.collectLatest { location ->
|
||||
// location.longitude = testPoint.longitude
|
||||
// location.latitude = testPoint.latitude
|
||||
if (!isSelectRoad()) captureLink(GeoPoint(location.latitude, location.longitude))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.navinfo.omqs.ui.fragment.layermanager
|
||||
|
||||
import android.content.Context
|
||||
import android.widget.Toast
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.blankj.utilcode.util.FileIOUtils
|
||||
@@ -10,7 +12,9 @@ import com.navinfo.omqs.Constant
|
||||
import com.navinfo.omqs.bean.ImportConfig
|
||||
import com.navinfo.omqs.tools.LayerConfigUtils
|
||||
import com.navinfo.omqs.util.FlowEventBus
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import java.io.File
|
||||
|
||||
class LayerManagerViewModel(): ViewModel() {
|
||||
@@ -21,11 +25,15 @@ class LayerManagerViewModel(): ViewModel() {
|
||||
return LayerConfigUtils.getLayerConfigList()
|
||||
}
|
||||
|
||||
fun saveLayerConfigList(listData: List<ImportConfig>) {
|
||||
fun saveLayerConfigList(context: Context, listData: List<ImportConfig>) {
|
||||
SPStaticUtils.put(Constant.EVENT_LAYER_MANAGER_CHANGE, gson.toJson(listData))
|
||||
// 发送新的配置数据
|
||||
viewModelScope.launch {
|
||||
FlowEventBus.post(Constant.EVENT_LAYER_MANAGER_CHANGE, listData)
|
||||
withContext(Dispatchers.Main) {
|
||||
Toast.makeText(context, "设置成功", Toast.LENGTH_SHORT)
|
||||
.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,10 @@ import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.Toast
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import androidx.fragment.app.FragmentController
|
||||
import androidx.fragment.app.viewModels
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import com.blankj.utilcode.util.SPStaticUtils
|
||||
@@ -30,7 +33,9 @@ class LayermanagerFragment : BaseFragment(){
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
val adapter = LayerManagerExpandableListAdapter(requireContext(), viewModel.getLayerConfigList())
|
||||
|
||||
binding.elvLayerManager.setAdapter(adapter)
|
||||
// 默认显示第一个父项下的子类
|
||||
binding.elvLayerManager.expandGroup(0)
|
||||
@@ -43,15 +48,15 @@ class LayermanagerFragment : BaseFragment(){
|
||||
}
|
||||
}
|
||||
|
||||
binding.imgConfirm.setOnClickListener {
|
||||
viewModel.saveLayerConfigList(requireContext(),adapter.parentItems)
|
||||
}
|
||||
|
||||
binding.imgBack.setOnClickListener {
|
||||
findNavController().navigateUp()
|
||||
}
|
||||
|
||||
binding.tvTitle.text = findNavController().currentDestination?.label
|
||||
|
||||
binding.imgConfirm.setOnClickListener { // 用户点击确认,重新设置当前的图层显隐控制
|
||||
viewModel.saveLayerConfigList(adapter.parentItems)
|
||||
}
|
||||
binding.tvTitle.text = "图层管理"
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
|
||||
Reference in New Issue
Block a user