Merge branch 'master' of gitlab.navinfo.com:CollectVehicle/OneMapQS
Conflicts: app/src/main/AndroidManifest.xml app/src/main/java/com/navinfo/omqs/ui/fragment/console/ConsoleFragment.kt app/src/main/java/com/navinfo/omqs/ui/fragment/layermanager/LayerManagerFragment.kt
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
|
||||
*/
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +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.navinfo.omqs.databinding.FragmentLayerManagerBinding
|
||||
@@ -38,11 +42,15 @@ class LayerManagerFragment(private var backListener: (() -> Unit?)? = null) : Ba
|
||||
}
|
||||
}
|
||||
|
||||
binding.imgConfirm.setOnClickListener {
|
||||
viewModel.saveLayerConfigList(requireContext(),adapter.parentItems)
|
||||
}
|
||||
|
||||
binding.imgBack.setOnClickListener {
|
||||
backListener?.invoke()
|
||||
}
|
||||
|
||||
binding.tvTitle.text = "图层设置"//findNavController().currentDestination?.label
|
||||
binding.tvTitle.text = "图层管理"//findNavController().currentDestination?.label
|
||||
|
||||
binding.imgConfirm.setOnClickListener { // 用户点击确认,重新设置当前的图层显隐控制
|
||||
viewModel.saveLayerConfigList(adapter.parentItems)
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,64 +1,68 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@color/bg_left_pannel"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/bg_left_pannel"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/title_layout"
|
||||
style="@style/left_pannel_title_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
style="@style/left_pannel_title_layout">
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/img_back"
|
||||
style="@style/btn_round"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="5dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:background="@drawable/selector_bg_round_button"
|
||||
android:foreground="@drawable/ripple_btn_press"
|
||||
android:src="@drawable/ic_baseline_keyboard_arrow_left_24"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"></androidx.appcompat.widget.AppCompatImageView>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/img_confirm"
|
||||
style="@style/btn_round"
|
||||
android:src="@drawable/ic_baseline_keyboard_arrow_left_24"></androidx.appcompat.widget.AppCompatImageView>
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/selector_bg_round_button"
|
||||
android:foreground="@drawable/ripple_btn_press"
|
||||
android:src="@drawable/ic_baseline_check_24"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"></androidx.appcompat.widget.AppCompatImageView>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/left_pannel_title_font"
|
||||
android:textColor="@color/highFontColor"
|
||||
android:textSize="@dimen/left_pannel_title_font"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"></androidx.appcompat.widget.AppCompatTextView>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/img_confirm"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="5dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:background="@drawable/selector_bg_round_button"
|
||||
android:foreground="@drawable/ripple_btn_press"
|
||||
style="@style/btn_round"
|
||||
android:src="@drawable/ic_baseline_check_24"></androidx.appcompat.widget.AppCompatImageView>
|
||||
app:layout_constraintTop_toTopOf="parent"></androidx.appcompat.widget.AppCompatTextView>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
style="@style/default_card_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_layout"
|
||||
style="@style/default_card_view">
|
||||
app:layout_constraintTop_toBottomOf="@id/title_layout">
|
||||
|
||||
<ExpandableListView
|
||||
android:id="@+id/elv_layer_manager"
|
||||
android:divider="@android:drawable/divider_horizontal_dim_dark"
|
||||
android:dividerHeight="0.1dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
android:layout_height="match_parent"
|
||||
android:divider="@android:drawable/divider_horizontal_dim_dark"
|
||||
android:dividerHeight="0.1dp" />
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
||||
Reference in New Issue
Block a user