fix: 增加omdb图层管理
@ -5,6 +5,7 @@ plugins {
|
||||
id 'com.google.dagger.hilt.android'
|
||||
id 'realm-android'
|
||||
id 'kotlin-parcelize' // 序列化
|
||||
id 'androidx.navigation.safeargs.kotlin'//Safe Args传递数据
|
||||
}
|
||||
android {
|
||||
namespace 'com.navinfo.omqs'
|
||||
@ -109,6 +110,8 @@ dependencies {
|
||||
|
||||
// 读取spatialite文件
|
||||
implementation 'com.github.sevar83:android-spatialite:2.0.1'
|
||||
//fragment 传递数据
|
||||
implementation "androidx.navigation:navigation-ui-ktx:2.5.3"
|
||||
}
|
||||
//允许引用生成的代码
|
||||
kapt {
|
||||
|
@ -37,7 +37,7 @@
|
||||
},
|
||||
{
|
||||
"table": "OMDB_LANE_NUM",
|
||||
"code": 5002,
|
||||
"code": 2041,
|
||||
"name": "车道数"
|
||||
}
|
||||
]
|
||||
|
15
app/src/main/java/com/navinfo/omqs/bean/SignBean.kt
Normal file
@ -0,0 +1,15 @@
|
||||
package com.navinfo.omqs.bean
|
||||
|
||||
import android.os.Parcelable
|
||||
import kotlinx.parcelize.Parcelize
|
||||
|
||||
@Parcelize
|
||||
data class SignBean(
|
||||
//图标ID
|
||||
val iconId: Int,
|
||||
val distance: Int = 0,
|
||||
val iconText: String = "",
|
||||
val elementId: String = "",
|
||||
val linkId: String,
|
||||
val geometry: String,
|
||||
) : Parcelable
|
@ -67,6 +67,6 @@ open class TaskBean @JvmOverloads constructor(
|
||||
var message: String = ""
|
||||
) : RealmObject() {
|
||||
fun getDownLoadUrl(): String {
|
||||
return "${Constant.SERVER_ADDRESS}devcp/download?fileStr=26"
|
||||
return "${Constant.SERVER_ADDRESS}devcp/download?fileStr=$id"
|
||||
}
|
||||
}
|
@ -20,7 +20,6 @@ import org.oscim.core.MercatorProjection
|
||||
import javax.inject.Inject
|
||||
import kotlin.streams.toList
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.N)
|
||||
class RealmOperateHelper() {
|
||||
@Inject
|
||||
lateinit var niMapController: NIMapController
|
||||
@ -32,6 +31,7 @@ class RealmOperateHelper() {
|
||||
* @param bufferType 点位外扩距离的单位: 米-Meter,像素-PIXEL
|
||||
* @param sort 是否需要排序
|
||||
* */
|
||||
@RequiresApi(Build.VERSION_CODES.N)
|
||||
suspend fun queryLink(
|
||||
point: Point,
|
||||
buffer: Double = DEFAULT_BUFFER,
|
||||
@ -102,6 +102,7 @@ class RealmOperateHelper() {
|
||||
* @param bufferType 点位外扩距离的单位: 米-Meter,像素-PIXEL
|
||||
* @param sort 是否需要排序
|
||||
* */
|
||||
@RequiresApi(Build.VERSION_CODES.N)
|
||||
suspend fun queryElement(
|
||||
point: Point,
|
||||
buffer: Double = DEFAULT_BUFFER,
|
||||
@ -154,12 +155,13 @@ class RealmOperateHelper() {
|
||||
suspend fun queryLinkByLinkPid(linkPid: String): MutableList<RenderEntity> {
|
||||
val result = mutableListOf<RenderEntity>()
|
||||
withContext(Dispatchers.IO) {
|
||||
val realmList = Realm.getDefaultInstance().where(RenderEntity::class.java)
|
||||
val realm = Realm.getDefaultInstance()
|
||||
val realmList = realm.where(RenderEntity::class.java)
|
||||
.notEqualTo("table", "OMDB_RD_LINK")
|
||||
.and()
|
||||
.equalTo("properties['${LinkTable.linkPid}']", linkPid)
|
||||
.findAll()
|
||||
result.addAll(realmList)
|
||||
result.addAll(realm.copyFromRealm(realmList))
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
44
app/src/main/java/com/navinfo/omqs/tools/LayerConfigUtils.kt
Normal file
@ -0,0 +1,44 @@
|
||||
package com.navinfo.omqs.tools
|
||||
|
||||
import com.blankj.utilcode.util.FileIOUtils
|
||||
import com.blankj.utilcode.util.SPStaticUtils
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import com.navinfo.omqs.Constant
|
||||
import com.navinfo.omqs.bean.ImportConfig
|
||||
import java.io.File
|
||||
|
||||
class LayerConfigUtils {
|
||||
companion object {
|
||||
private val omdbConfigFile = File("${Constant.USER_DATA_PATH}", Constant.OMDB_CONFIG)
|
||||
private val otherConfigFile = File("${Constant.USER_DATA_PATH}", Constant.OTHER_CONFIG)
|
||||
private val gson = Gson()
|
||||
|
||||
fun getLayerConfigList(): List<ImportConfig> {
|
||||
// 首先读取Shared文件,如果存在则直接返回,否则读取config文件
|
||||
return SPStaticUtils.getString(Constant.LAYER_MANAGER_CONFIG, null).let {
|
||||
if (this!=null) {
|
||||
val result: List<ImportConfig> = gson.fromJson(it, object : TypeToken<List<ImportConfig>>(){}.type)
|
||||
result
|
||||
} else {
|
||||
LayerConfigUtils.getLayerConfigListFromAssetsFile()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun getLayerConfigListFromAssetsFile(): List<ImportConfig> {
|
||||
val resultList = mutableListOf<ImportConfig>()
|
||||
if (omdbConfigFile.exists()) {
|
||||
val omdbConfiStr = FileIOUtils.readFile2String(omdbConfigFile)
|
||||
val omdbConfig = gson.fromJson<ImportConfig>(omdbConfiStr, ImportConfig::class.java)
|
||||
resultList.add(omdbConfig)
|
||||
}
|
||||
if (otherConfigFile.exists()) {
|
||||
val otherConfiStr = FileIOUtils.readFile2String(otherConfigFile)
|
||||
val otherConfig = gson.fromJson<ImportConfig>(otherConfiStr, ImportConfig::class.java)
|
||||
resultList.add(otherConfig)
|
||||
}
|
||||
return resultList
|
||||
}
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@ package com.navinfo.omqs.ui.activity.login
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.util.DisplayMetrics
|
||||
import android.util.Log
|
||||
import android.widget.Toast
|
||||
import androidx.activity.viewModels
|
||||
@ -33,8 +34,35 @@ class LoginActivity : CheckPermissionsActivity() {
|
||||
binding.lifecycleOwner = this
|
||||
binding.activity = this
|
||||
initView()
|
||||
Log.e("jingo", getScreenParams())
|
||||
}
|
||||
|
||||
private fun getScreenParams(): String {
|
||||
val dm = DisplayMetrics();
|
||||
windowManager.defaultDisplay.getMetrics(dm);
|
||||
val heightPixels = dm.heightPixels;//高的像素
|
||||
val widthPixels = dm.widthPixels;//宽的像素
|
||||
val densityDpi = dm.densityDpi;//dpi
|
||||
val xdpi = dm.xdpi;//xdpi
|
||||
val ydpi = dm.ydpi;//ydpi
|
||||
val density = dm.density;//density=dpi/160,密度比
|
||||
val scaledDensity = dm.scaledDensity;//scaledDensity=dpi/160 字体缩放密度比
|
||||
val heightDP = heightPixels / density;//高度的dp
|
||||
val widthDP = widthPixels / density;//宽度的dp
|
||||
var str = "heightPixels: " + heightPixels + "px";
|
||||
str += "\nwidthPixels: " + widthPixels + "px";
|
||||
str += "\ndensityDpi: " + densityDpi + "dpi";
|
||||
str += "\nxdpi: " + xdpi + "dpi";
|
||||
str += "\nydpi: " + ydpi + "dpi";
|
||||
str += "\ndensity: " + density;
|
||||
str += "\nscaledDensity: " + scaledDensity;
|
||||
str += "\nheightDP: " + heightDP + "dp";
|
||||
str += "\nwidthDP: " + widthDP + "dp";
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 观察登录状态,把Observer提出来是为了防止每次数据变化都会有新的observer创建
|
||||
* 还有为了方便释放(需不需要手动释放?不清楚)不需要释放,当viewmodel观察到activity/fragment 的生命周期时会自动释放
|
||||
|
@ -10,17 +10,24 @@ import androidx.annotation.RequiresApi
|
||||
import androidx.core.view.WindowCompat
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.navigation.findNavController
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.blankj.utilcode.util.SPStaticUtils
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import com.navinfo.collect.library.map.NIMapController
|
||||
import com.navinfo.omqs.Constant
|
||||
import com.navinfo.omqs.R
|
||||
import com.navinfo.omqs.bean.ImportConfig
|
||||
import com.navinfo.omqs.databinding.ActivityMainBinding
|
||||
import com.navinfo.omqs.http.offlinemapdownload.OfflineMapDownloadManager
|
||||
import com.navinfo.omqs.tools.LayerConfigUtils
|
||||
import com.navinfo.omqs.ui.activity.BaseActivity
|
||||
import com.navinfo.omqs.util.FlowEventBus
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import kotlinx.coroutines.launch
|
||||
import com.navinfo.omqs.ui.widget.RecyclerViewSpacesItemDecoration
|
||||
import org.videolan.vlc.Util
|
||||
import javax.inject.Inject
|
||||
|
||||
/**
|
||||
@ -39,12 +46,31 @@ class MainActivity : BaseActivity() {
|
||||
@Inject
|
||||
lateinit var offlineMapDownloadManager: OfflineMapDownloadManager
|
||||
|
||||
private val signAdapter by lazy { SignAdapter() }
|
||||
private val rightController by lazy {
|
||||
findNavController(R.id.main_activity_right_fragment)
|
||||
}
|
||||
|
||||
private val signAdapter by lazy {
|
||||
SignAdapter { position, signBean ->
|
||||
// val directions =
|
||||
// EmptyFragmentDirections.emptyFragmentToEvaluationResultFragment(
|
||||
// )
|
||||
// rightController.navigate(directions)
|
||||
rightController.currentDestination?.let {
|
||||
if (it.id == R.id.EmptyFragment) {
|
||||
val bundle = Bundle()
|
||||
bundle.putParcelable("SignBean", signBean)
|
||||
rightController.navigate(R.id.EvaluationResultFragment, bundle)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
WindowCompat.setDecorFitsSystemWindows(window, false)
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = DataBindingUtil.setContentView(this, R.layout.activity_main)
|
||||
|
||||
//初始化地图
|
||||
mapController.init(
|
||||
this,
|
||||
@ -53,6 +79,8 @@ class MainActivity : BaseActivity() {
|
||||
Constant.MAP_PATH,
|
||||
Constant.USER_DATA_PATH + "/trace.sqlite"
|
||||
)
|
||||
// 在mapController初始化前获取当前OMDB图层显隐
|
||||
viewModel.refreshOMDBLayer(LayerConfigUtils.getLayerConfigList())
|
||||
//关联生命周期
|
||||
binding.lifecycleOwner = this
|
||||
//给xml转递对象
|
||||
@ -63,19 +91,18 @@ class MainActivity : BaseActivity() {
|
||||
binding.mainActivityVoice.setOnTouchListener(object : View.OnTouchListener {
|
||||
@RequiresApi(Build.VERSION_CODES.Q)
|
||||
override fun onTouch(v: View?, event: MotionEvent?): Boolean {
|
||||
Log.e("qj",event?.action.toString())
|
||||
Log.e("qj", event?.action.toString())
|
||||
when (event?.action) {
|
||||
MotionEvent.ACTION_DOWN ->{
|
||||
MotionEvent.ACTION_DOWN -> {
|
||||
voiceOnTouchStart()//Do Something
|
||||
Log.e("qj","voiceOnTouchStart")
|
||||
Log.e("qj", "voiceOnTouchStart")
|
||||
}
|
||||
MotionEvent.ACTION_UP ->{
|
||||
MotionEvent.ACTION_UP -> {
|
||||
voiceOnTouchStop()//Do Something
|
||||
Log.e("qj","voiceOnTouchStop")
|
||||
Log.e("qj", "voiceOnTouchStop")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return v?.onTouchEvent(event) ?: true
|
||||
}
|
||||
})
|
||||
@ -86,6 +113,14 @@ class MainActivity : BaseActivity() {
|
||||
}
|
||||
binding.mainActivitySignRecyclerview.layoutManager = LinearLayoutManager(this)
|
||||
binding.mainActivitySignRecyclerview.adapter = signAdapter
|
||||
//增加4dp的间隔
|
||||
binding.mainActivitySignRecyclerview.addItemDecoration(
|
||||
RecyclerViewSpacesItemDecoration(
|
||||
Util.convertDpToPx(
|
||||
this, 4
|
||||
)
|
||||
)
|
||||
)
|
||||
viewModel.liveDataSignList.observe(this) {
|
||||
signAdapter.refreshData(it)
|
||||
}
|
||||
@ -93,17 +128,7 @@ class MainActivity : BaseActivity() {
|
||||
lifecycleScope.launch {
|
||||
// 初始化地图图层控制接收器
|
||||
FlowEventBus.subscribe<List<ImportConfig>>(lifecycle, Constant.EVENT_LAYER_MANAGER_CHANGE) {
|
||||
// 根据获取到的配置信息,筛选未勾选的图层名称
|
||||
val omdbVisibleList = it.filter { importConfig->
|
||||
importConfig.tableGroupName == "OMDB数据"
|
||||
}.first().tables.filter { tableInfo ->
|
||||
!tableInfo.checked
|
||||
}.map {
|
||||
tableInfo -> tableInfo.table
|
||||
}.toList()
|
||||
com.navinfo.collect.library.system.Constant.HAD_LAYER_INVISIABLE_ARRAY = omdbVisibleList.toTypedArray()
|
||||
// 刷新地图
|
||||
mapController.mMapView.vtmMap.clearMap()
|
||||
viewModel.refreshOMDBLayer(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -158,14 +183,14 @@ class MainActivity : BaseActivity() {
|
||||
naviController.navigate(R.id.EvaluationResultFragment)*/
|
||||
}
|
||||
|
||||
fun voiceOnTouchStart(){
|
||||
viewModel!!.startSoundMetter(this,binding.mainActivityVoice)
|
||||
fun voiceOnTouchStart() {
|
||||
viewModel.startSoundMetter(this, binding.mainActivityVoice)
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.Q)
|
||||
fun voiceOnTouchStop(){
|
||||
if(Constant.IS_VIDEO_SPEED){
|
||||
viewModel!!.stopSoundMeter()
|
||||
fun voiceOnTouchStop() {
|
||||
if (Constant.IS_VIDEO_SPEED) {
|
||||
viewModel.stopSoundMeter()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,6 @@ import androidx.lifecycle.viewModelScope
|
||||
import androidx.navigation.findNavController
|
||||
import com.blankj.utilcode.util.ToastUtils
|
||||
import com.navinfo.collect.library.data.dao.impl.TraceDataBase
|
||||
import com.navinfo.collect.library.data.entity.NiLocation
|
||||
import com.navinfo.collect.library.data.entity.RenderEntity
|
||||
import com.navinfo.collect.library.map.NIMapController
|
||||
import com.navinfo.collect.library.map.handler.OnQsRecordItemClickListener
|
||||
@ -30,9 +29,11 @@ import com.navinfo.collect.library.utils.GeometryToolsKt
|
||||
import com.navinfo.omqs.Constant
|
||||
import com.navinfo.omqs.R
|
||||
import com.navinfo.omqs.bean.ImportConfig
|
||||
import com.navinfo.omqs.bean.SignBean
|
||||
import com.navinfo.omqs.db.RealmOperateHelper
|
||||
import com.navinfo.omqs.ui.dialog.CommonDialog
|
||||
import com.navinfo.omqs.ui.manager.TakePhotoManager
|
||||
import com.navinfo.omqs.ui.widget.SignUtil
|
||||
import com.navinfo.omqs.util.DateTimeUtil
|
||||
import com.navinfo.omqs.util.FlowEventBus
|
||||
import com.navinfo.omqs.util.SoundMeter
|
||||
@ -69,6 +70,7 @@ class MainViewModel @Inject constructor(
|
||||
val liveDataSignList = MutableLiveData<List<SignBean>>()
|
||||
|
||||
var testPoint = GeoPoint(0, 0)
|
||||
|
||||
//语音窗体
|
||||
private var pop: PopupWindow? = null
|
||||
|
||||
@ -87,7 +89,7 @@ class MainViewModel @Inject constructor(
|
||||
})
|
||||
initLocation()
|
||||
viewModelScope.launch {
|
||||
mapController.onMapClickFlow.collect {
|
||||
mapController.onMapClickFlow.collectLatest {
|
||||
testPoint = it
|
||||
}
|
||||
}
|
||||
@ -156,9 +158,12 @@ class MainViewModel @Inject constructor(
|
||||
)
|
||||
signList.add(
|
||||
SignBean(
|
||||
iconId = R.drawable.icon_speed_limit,
|
||||
iconText = element.name,
|
||||
iconId = SignUtil.getSignIcon(element),
|
||||
iconText = SignUtil.getSignText(element),
|
||||
distance = distance.toInt(),
|
||||
elementId = element.id,
|
||||
linkId = linkId,
|
||||
geometry = element.geometry
|
||||
)
|
||||
)
|
||||
}
|
||||
@ -184,6 +189,9 @@ class MainViewModel @Inject constructor(
|
||||
|
||||
override fun onCleared() {
|
||||
super.onCleared()
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
mapController.lineHandler.removeLine()
|
||||
}
|
||||
}
|
||||
|
||||
//点击相机按钮
|
||||
@ -226,7 +234,7 @@ class MainViewModel @Inject constructor(
|
||||
|
||||
fun startSoundMetter(context: Context, v: View) {
|
||||
|
||||
if(mSpeakMode==null){
|
||||
if (mSpeakMode == null) {
|
||||
mSpeakMode = SpeakMode(context as Activity?)
|
||||
}
|
||||
|
||||
@ -270,7 +278,8 @@ class MainViewModel @Inject constructor(
|
||||
}
|
||||
mSpeakMode!!.speakText("结束录音")
|
||||
//获取右侧fragment容器
|
||||
val naviController = (context as Activity).findNavController(R.id.main_activity_right_fragment)
|
||||
val naviController =
|
||||
(context as Activity).findNavController(R.id.main_activity_right_fragment)
|
||||
val bundle = Bundle()
|
||||
bundle.putString("filePath", filePath)
|
||||
naviController.navigate(R.id.EvaluationResultFragment, bundle)
|
||||
@ -300,6 +309,24 @@ class MainViewModel @Inject constructor(
|
||||
if (pop != null && pop!!.isShowing) pop!!.dismiss()
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新OMDB图层显隐
|
||||
* */
|
||||
fun refreshOMDBLayer(layerConfigList: List<ImportConfig>) {
|
||||
// 根据获取到的配置信息,筛选未勾选的图层名称
|
||||
if (layerConfigList!=null && !layerConfigList.isEmpty()) {
|
||||
val omdbVisibleList = layerConfigList.filter { importConfig->
|
||||
importConfig.tableGroupName == "OMDB数据"
|
||||
}.first().tables.filter { tableInfo ->
|
||||
!tableInfo.checked
|
||||
}.map {
|
||||
tableInfo -> tableInfo.table
|
||||
}.toList()
|
||||
com.navinfo.collect.library.system.Constant.HAD_LAYER_INVISIABLE_ARRAY = omdbVisibleList.toTypedArray()
|
||||
// 刷新地图
|
||||
mapController.mMapView.vtmMap.clearMap()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理页面调转
|
||||
|
@ -3,11 +3,13 @@ package com.navinfo.omqs.ui.activity.map
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import com.navinfo.omqs.R
|
||||
import com.navinfo.omqs.bean.SignBean
|
||||
import com.navinfo.omqs.databinding.AdapterSignBinding
|
||||
import com.navinfo.omqs.ui.other.BaseRecyclerViewAdapter
|
||||
import com.navinfo.omqs.ui.other.BaseViewHolder
|
||||
|
||||
class SignAdapter : BaseRecyclerViewAdapter<SignBean>() {
|
||||
class SignAdapter(private var itemListener: ((Int, SignBean) -> Unit?)? = null) :
|
||||
BaseRecyclerViewAdapter<SignBean>() {
|
||||
override fun getItemViewRes(position: Int): Int {
|
||||
return R.layout.adapter_sign
|
||||
}
|
||||
@ -23,5 +25,8 @@ class SignAdapter : BaseRecyclerViewAdapter<SignBean>() {
|
||||
val item = data[position]
|
||||
bd.signMainIcon.background = holder.viewBinding.root.context.getDrawable(item.iconId)
|
||||
bd.signMainIcon.text = item.iconText
|
||||
bd.root.setOnClickListener {
|
||||
itemListener?.invoke(position, item)
|
||||
}
|
||||
}
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
package com.navinfo.omqs.ui.activity.map
|
||||
|
||||
data class SignBean(
|
||||
//图标ID
|
||||
val iconId: Int,
|
||||
val distance: Int = 0,
|
||||
val iconText: String = ""
|
||||
)
|
@ -13,6 +13,7 @@ import androidx.navigation.NavOptions
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
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.fragment.BaseFragment
|
||||
import com.navinfo.omqs.ui.other.shareViewModels
|
||||
@ -24,6 +25,7 @@ class EvaluationResultFragment : BaseFragment(), View.OnClickListener {
|
||||
private lateinit var binding: FragmentEvaluationResultBinding
|
||||
private val viewModel by shareViewModels<EvaluationResultViewModel>("QsRecode")
|
||||
|
||||
// private val args:EmptyFragmentArgs by navArgs()
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
|
||||
): View {
|
||||
@ -80,15 +82,15 @@ class EvaluationResultFragment : BaseFragment(), View.OnClickListener {
|
||||
binding.evaluationVoice.setOnTouchListener(object : View.OnTouchListener {
|
||||
@RequiresApi(Build.VERSION_CODES.Q)
|
||||
override fun onTouch(v: View?, event: MotionEvent?): Boolean {
|
||||
Log.e("qj",event?.action.toString())
|
||||
Log.e("qj", event?.action.toString())
|
||||
when (event?.action) {
|
||||
MotionEvent.ACTION_DOWN ->{
|
||||
MotionEvent.ACTION_DOWN -> {
|
||||
voiceOnTouchStart()//Do Something
|
||||
Log.e("qj","voiceOnTouchStart")
|
||||
Log.e("qj", "voiceOnTouchStart")
|
||||
}
|
||||
MotionEvent.ACTION_UP ->{
|
||||
MotionEvent.ACTION_UP -> {
|
||||
voiceOnTouchStop()//Do Something
|
||||
Log.e("qj","voiceOnTouchStop")
|
||||
Log.e("qj", "voiceOnTouchStop")
|
||||
}
|
||||
}
|
||||
return v?.onTouchEvent(event) ?: true
|
||||
@ -98,17 +100,23 @@ class EvaluationResultFragment : BaseFragment(), View.OnClickListener {
|
||||
/**
|
||||
* 读取元数据
|
||||
*/
|
||||
if (arguments != null) {
|
||||
val id = requireArguments().getString("QsId")
|
||||
//语音路径
|
||||
val filePath = requireArguments().getString("filePath")
|
||||
if (id != null) {
|
||||
viewModel.initData(id)
|
||||
} else {
|
||||
viewModel.initNewData(filePath!!)
|
||||
// val id = args.qsId
|
||||
var id: String = ""
|
||||
var signBean: SignBean? = null
|
||||
var filePath: String = ""
|
||||
arguments?.let {
|
||||
id = it.getString("QsId", "")
|
||||
filePath = it.getString("filePath", "")
|
||||
try {
|
||||
signBean = it.getParcelable("SignBean")
|
||||
} catch (e: java.lang.Exception) {
|
||||
}
|
||||
}
|
||||
|
||||
if (id == null || id.isEmpty()) {
|
||||
viewModel.initNewData(signBean, filePath)
|
||||
} else {
|
||||
viewModel.initNewData("")
|
||||
viewModel.initData(id)
|
||||
}
|
||||
// //监听大分类数据变化
|
||||
// viewModel.liveDataClassTypeList.observe(viewLifecycleOwner) {
|
||||
@ -271,13 +279,13 @@ class EvaluationResultFragment : BaseFragment(), View.OnClickListener {
|
||||
}
|
||||
}
|
||||
|
||||
fun voiceOnTouchStart(){
|
||||
viewModel!!.startSoundMetter(requireActivity(),binding.evaluationVoice)
|
||||
fun voiceOnTouchStart() {
|
||||
viewModel!!.startSoundMetter(requireActivity(), binding.evaluationVoice)
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.Q)
|
||||
fun voiceOnTouchStop(){
|
||||
if(Constant.IS_VIDEO_SPEED){
|
||||
fun voiceOnTouchStop() {
|
||||
if (Constant.IS_VIDEO_SPEED) {
|
||||
viewModel!!.stopSoundMeter()
|
||||
}
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ import com.navinfo.collect.library.data.entity.QsRecordBean
|
||||
import com.navinfo.collect.library.data.entity.RenderEntity.Companion.LinkTable
|
||||
import com.navinfo.collect.library.map.NIMapController
|
||||
import com.navinfo.collect.library.utils.GeometryTools
|
||||
import com.navinfo.omqs.bean.SignBean
|
||||
import com.navinfo.omqs.Constant
|
||||
import com.navinfo.omqs.R
|
||||
import com.navinfo.omqs.bean.ChatMsgEntity
|
||||
@ -108,7 +109,7 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
super.onCleared()
|
||||
Log.e("jingo", "EvaluationResultViewModel 销毁了 ${hashCode()}")
|
||||
mapController.markerHandle.removeMarker(markerTitle)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
mapController.lineHandler.removeLine()
|
||||
}
|
||||
}
|
||||
@ -117,25 +118,44 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
/**
|
||||
* 查询数据库,获取问题分类
|
||||
*/
|
||||
fun initNewData(filePath: String) {
|
||||
fun initNewData(bean: SignBean?,filePath: String) {
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
getClassTypeList()
|
||||
getProblemLinkList()
|
||||
}
|
||||
val geoPoint = mapController.locationLayerHandler.getCurrentGeoPoint()
|
||||
geoPoint?.let {
|
||||
liveDataQsRecordBean.value!!.geometry = GeometryTools.createGeometry(it).toText()
|
||||
mapController.markerHandle.addMarker(geoPoint, markerTitle)
|
||||
viewModelScope.launch {
|
||||
captureLink(geoPoint.longitude, geoPoint.latitude)
|
||||
if (bean == null) {
|
||||
geoPoint?.let {
|
||||
liveDataQsRecordBean.value!!.geometry = GeometryTools.createGeometry(it).toText()
|
||||
mapController.markerHandle.addMarker(geoPoint, markerTitle)
|
||||
viewModelScope.launch {
|
||||
captureLink(geoPoint.longitude, geoPoint.latitude)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
liveDataQsRecordBean.value?.run {
|
||||
elementId = bean.elementId
|
||||
linkId = bean.linkId
|
||||
if (linkId.isNotEmpty()) {
|
||||
viewModelScope.launch {
|
||||
val link = realmOperateHelper.queryLink(linkId)
|
||||
link?.let { l ->
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
mapController.lineHandler.showLine(l.geometry)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
val point = GeometryTools.createGeoPoint(bean.geometry)
|
||||
mapController.markerHandle.addMarker(point, markerTitle)
|
||||
}
|
||||
|
||||
addChatMsgEntity(filePath)
|
||||
}
|
||||
|
||||
/**
|
||||
* 捕捉到路
|
||||
* 捕捉道路
|
||||
*/
|
||||
private suspend fun captureLink(longitude: Double, latitude: Double) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
@ -364,7 +384,7 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
|
||||
fun addChatMsgEntity(filePath: String) {
|
||||
|
||||
if(filePath!=null){
|
||||
if(filePath.isNotEmpty()){
|
||||
var chatMsgEntityList: MutableList<ChatMsgEntity> = ArrayList()
|
||||
if(listDataChatMsgEntityList.value?.isEmpty() == false){
|
||||
chatMsgEntityList = listDataChatMsgEntityList.value!!
|
||||
|
@ -1,7 +1,9 @@
|
||||
package com.navinfo.omqs.ui.fragment.evaluationresult
|
||||
|
||||
import android.os.Build
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import androidx.annotation.RequiresApi
|
||||
import com.navinfo.omqs.R
|
||||
import com.navinfo.omqs.databinding.TextItemSelectBinding
|
||||
import com.navinfo.omqs.ui.other.BaseRecyclerViewAdapter
|
||||
@ -21,6 +23,7 @@ class LeftAdapter(private var itemListener: ((Int, String) -> Unit?)? = null) :
|
||||
return BaseViewHolder(viewBinding)
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.M)
|
||||
override fun onBindViewHolder(holder: BaseViewHolder, position: Int) {
|
||||
val bd = holder.viewBinding as TextItemSelectBinding
|
||||
val title = data[position]
|
||||
|
@ -8,29 +8,17 @@ import com.google.gson.Gson
|
||||
import com.google.gson.reflect.TypeToken
|
||||
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.launch
|
||||
import java.io.File
|
||||
|
||||
class LayerManagerViewModel(): ViewModel() {
|
||||
private val omdbConfigFile = File("${Constant.USER_DATA_PATH}", Constant.OMDB_CONFIG)
|
||||
private val otherConfigFile = File("${Constant.USER_DATA_PATH}", Constant.OTHER_CONFIG)
|
||||
private val gson = Gson()
|
||||
|
||||
fun getLayerConfigList(): List<ImportConfig> {
|
||||
// 首先读取Shared文件,如果存在则直接返回,否则读取config文件
|
||||
val importConfigList: List<ImportConfig>? = SPStaticUtils.getString(Constant.LAYER_MANAGER_CONFIG, null).run {
|
||||
if (this!=null) {
|
||||
gson.fromJson(this, object : TypeToken<List<ImportConfig>>(){}.type)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
if (importConfigList==null) {
|
||||
return getLayerConfigListFromAssetsFile()
|
||||
} else {
|
||||
return importConfigList as List<ImportConfig>
|
||||
}
|
||||
return LayerConfigUtils.getLayerConfigList()
|
||||
}
|
||||
|
||||
fun saveLayerConfigList(listData: List<ImportConfig>) {
|
||||
@ -41,18 +29,4 @@ class LayerManagerViewModel(): ViewModel() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun getLayerConfigListFromAssetsFile(): List<ImportConfig> {
|
||||
val resultList = mutableListOf<ImportConfig>()
|
||||
if (omdbConfigFile.exists()) {
|
||||
val omdbConfiStr = FileIOUtils.readFile2String(omdbConfigFile)
|
||||
val omdbConfig = gson.fromJson<ImportConfig>(omdbConfiStr, ImportConfig::class.java)
|
||||
resultList.add(omdbConfig)
|
||||
}
|
||||
if (otherConfigFile.exists()) {
|
||||
val otherConfiStr = FileIOUtils.readFile2String(otherConfigFile)
|
||||
val otherConfig = gson.fromJson<ImportConfig>(otherConfiStr, ImportConfig::class.java)
|
||||
resultList.add(otherConfig)
|
||||
}
|
||||
return resultList
|
||||
}
|
||||
}
|
@ -50,7 +50,7 @@ class QsRecordListFragment : BaseFragment(){
|
||||
binding.qsRecyclerview.addItemDecoration(itemDecoration)
|
||||
viewModel.getList(requireContext())
|
||||
// itemClick
|
||||
adapter!!.setOnKotlinItemClickListener(object : QsRecordListAdapter.IKotlinItemClickListener {
|
||||
adapter.setOnKotlinItemClickListener(object : QsRecordListAdapter.IKotlinItemClickListener {
|
||||
override fun onItemClickListener(position: Int) {
|
||||
viewModel.onItemClickListener(activity as MainActivity,position)
|
||||
findNavController().popBackStack()
|
||||
|
@ -8,6 +8,10 @@ import android.widget.EditText
|
||||
import androidx.appcompat.widget.AppCompatEditText
|
||||
import com.navinfo.omqs.R
|
||||
|
||||
/**
|
||||
* 滚动嵌套时,处理滚动的edittext
|
||||
*/
|
||||
|
||||
class MyEditeText @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
|
@ -0,0 +1,86 @@
|
||||
package com.navinfo.omqs.ui.widget
|
||||
|
||||
import android.graphics.Rect
|
||||
import android.view.View
|
||||
import androidx.annotation.StringDef
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.recyclerview.widget.RecyclerView.ItemDecoration
|
||||
import java.lang.annotation.Retention
|
||||
import java.lang.annotation.RetentionPolicy
|
||||
|
||||
/**
|
||||
* 用来设置recyclerView 要素间的间隔
|
||||
*/
|
||||
class RecyclerViewSpacesItemDecoration : ItemDecoration {
|
||||
@StringDef(TOP_DECORATION, BOTTOM_DECORATION, LEFT_DECORATION, RIGHT_DECORATION)
|
||||
@Retention(
|
||||
RetentionPolicy.SOURCE
|
||||
)
|
||||
private annotation class Decoration
|
||||
|
||||
private var rightSpace = 0 //右边间距
|
||||
private var topSpace = 0 //上边边间距
|
||||
private var leftSpace = 0 //左边间距
|
||||
private var bottomSpace = 0 //下边间距
|
||||
|
||||
/**
|
||||
* @param bottomSpace 下间距
|
||||
*/
|
||||
constructor(bottomSpace: Int) {
|
||||
this.bottomSpace = bottomSpace
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定某一个属性
|
||||
*
|
||||
* @param decoration decoration
|
||||
* @param space 间距
|
||||
*/
|
||||
constructor(@Decoration decoration: String?, space: Int) {
|
||||
when (decoration) {
|
||||
RIGHT_DECORATION -> rightSpace = space
|
||||
TOP_DECORATION -> topSpace = space
|
||||
LEFT_DECORATION -> leftSpace = space
|
||||
BOTTOM_DECORATION -> bottomSpace = space
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param rightSpace 右间距
|
||||
* @param topSpace 上间距
|
||||
* @param leftSpace 左间距
|
||||
* @param bottomSpace 下间距
|
||||
*/
|
||||
constructor(rightSpace: Int, topSpace: Int, leftSpace: Int, bottomSpace: Int) {
|
||||
this.rightSpace = rightSpace
|
||||
this.topSpace = topSpace
|
||||
this.leftSpace = leftSpace
|
||||
this.bottomSpace = bottomSpace
|
||||
}
|
||||
|
||||
/**
|
||||
* @param outRect Item的矩边界
|
||||
* @param view ItemView
|
||||
* @param parent RecyclerView
|
||||
* @param state RecyclerView的状态
|
||||
*/
|
||||
override fun getItemOffsets(
|
||||
outRect: Rect,
|
||||
view: View,
|
||||
parent: RecyclerView,
|
||||
state: RecyclerView.State
|
||||
) {
|
||||
super.getItemOffsets(outRect, view, parent, state)
|
||||
outRect.top = topSpace
|
||||
outRect.left = leftSpace
|
||||
outRect.right = rightSpace
|
||||
outRect.bottom = bottomSpace
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val TOP_DECORATION = "top_decoration"
|
||||
const val BOTTOM_DECORATION = "bottom_decoration"
|
||||
const val LEFT_DECORATION = "left_decoration"
|
||||
const val RIGHT_DECORATION = "right_decoration"
|
||||
}
|
||||
}
|
153
app/src/main/java/com/navinfo/omqs/ui/widget/SignUtil.kt
Normal file
@ -0,0 +1,153 @@
|
||||
package com.navinfo.omqs.ui.widget
|
||||
|
||||
import android.util.Log
|
||||
import com.navinfo.collect.library.data.entity.RenderEntity
|
||||
import com.navinfo.omqs.R
|
||||
|
||||
class SignUtil {
|
||||
companion object {
|
||||
|
||||
/**
|
||||
* 获取面板上的文字
|
||||
*/
|
||||
fun getSignText(data: RenderEntity): String {
|
||||
return when (data.code) {
|
||||
//常规点限速
|
||||
4002 -> getSpeedLimitText(data)
|
||||
// //道路种别
|
||||
// 2008 -> getKindCodeIcon(data)
|
||||
// //道路方向
|
||||
// 2010 -> getRoadDirection(data)
|
||||
// //车道数
|
||||
// 2041 -> getLaneNumIcon(data)
|
||||
else -> ""
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取限速值文字
|
||||
*/
|
||||
private fun getSpeedLimitText(data: RenderEntity): String {
|
||||
try {
|
||||
//限速标志 0 限速开始 1 限速解除
|
||||
val maxSpeed = data.properties["max_speed"]
|
||||
val minSpeed = data.properties["min_speed"]
|
||||
return if (maxSpeed != "0")
|
||||
maxSpeed.toString()
|
||||
else
|
||||
minSpeed.toString()
|
||||
} catch (e: Exception) {
|
||||
Log.e("jingo", "获取限速面板ICON出错1 $e")
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
/**
|
||||
* 限速图标
|
||||
*/
|
||||
fun getSpeedLimitIcon(data: RenderEntity): Int {
|
||||
try {
|
||||
//限速标志 0 限速开始 1 限速解除
|
||||
val speedFlag = data.properties["speed_flag"]
|
||||
return when (speedFlag) {
|
||||
"1" -> return R.drawable.icon_speed_limit_off
|
||||
else -> return R.drawable.icon_speed_limit
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.e("jingo", "获取限速面板ICON出错2 $e")
|
||||
}
|
||||
return R.drawable.icon_speed_limit
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取看板图标
|
||||
*/
|
||||
|
||||
fun getSignIcon(data: RenderEntity): Int {
|
||||
return when (data.code) {
|
||||
//道路种别
|
||||
2008 -> getKindCodeIcon(data)
|
||||
//道路方向
|
||||
2010 -> getRoadDirection(data)
|
||||
//车道数
|
||||
2041 -> getLaneNumIcon(data)
|
||||
//限速
|
||||
4002 -> getSpeedLimitIcon(data)
|
||||
else -> R.drawable.icon_speed_limit
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取种别图标
|
||||
*/
|
||||
fun getKindCodeIcon(data: RenderEntity): Int {
|
||||
try {
|
||||
val kind = data.properties["kind"]
|
||||
return when (kind!!.toInt()) {
|
||||
1 -> R.mipmap.icon_kind_code_k1
|
||||
2 -> R.mipmap.icon_kind_code_k2
|
||||
3 -> R.mipmap.icon_kind_code_k3
|
||||
4 -> R.mipmap.icon_kind_code_k4
|
||||
6 -> R.mipmap.icon_kind_code_k6
|
||||
7 -> R.mipmap.icon_kind_code_k7
|
||||
8 -> R.mipmap.icon_kind_code_k8
|
||||
9 -> R.mipmap.icon_kind_code_k9
|
||||
10 -> R.mipmap.icon_kind_code_k10
|
||||
11 -> R.mipmap.icon_kind_code_k11
|
||||
13 -> R.mipmap.icon_kind_code_k13
|
||||
15 -> R.mipmap.icon_kind_code_k15
|
||||
else -> R.mipmap.icon_kind_code
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.e("jingo", "获取种别面板ICON出错 $e")
|
||||
}
|
||||
return R.mipmap.icon_kind_code
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取到路线
|
||||
*/
|
||||
fun getLaneNumIcon(data: RenderEntity): Int {
|
||||
try {
|
||||
val lineNum = data.properties["laneNum"]
|
||||
return when (lineNum!!.toInt()) {
|
||||
1 -> R.mipmap.icon_lane_num1
|
||||
2 -> R.mipmap.icon_lane_num2
|
||||
3 -> R.mipmap.icon_lane_num3
|
||||
4 -> R.mipmap.icon_lane_num4
|
||||
5 -> R.mipmap.icon_lane_num5
|
||||
6 -> R.mipmap.icon_lane_num6
|
||||
7 -> R.mipmap.icon_lane_num7
|
||||
8 -> R.mipmap.icon_lane_num8
|
||||
9 -> R.mipmap.icon_lane_num9
|
||||
10 -> R.mipmap.icon_lane_num10
|
||||
11 -> R.mipmap.icon_lane_num11
|
||||
12 -> R.mipmap.icon_lane_num12
|
||||
else -> R.mipmap.icon_lane_num1
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.e("jingo", "获取车道数面板ICON出错 $e")
|
||||
}
|
||||
return R.mipmap.icon_road_direction
|
||||
}
|
||||
|
||||
fun getRoadDirection(data: RenderEntity): Int {
|
||||
try {
|
||||
val direct = data.properties["direct"]
|
||||
return when (direct!!.toInt()) {
|
||||
0 -> R.mipmap.icon_road_direction
|
||||
1 -> R.mipmap.icon_road_direction
|
||||
2 -> R.mipmap.icon_road_direction
|
||||
3 -> R.mipmap.icon_road_direction
|
||||
-99 -> R.mipmap.icon_road_direction
|
||||
else -> R.mipmap.icon_road_direction
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.e("jingo", "获取道路方向面板ICON出错 $e")
|
||||
}
|
||||
return R.mipmap.icon_road_direction
|
||||
}
|
||||
}
|
||||
}
|
BIN
app/src/main/res/drawable-xhdpi/icon_add_data.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
app/src/main/res/drawable-xhdpi/icon_add_voice.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
app/src/main/res/drawable-xhdpi/icon_delete.png
Normal file
After Width: | Height: | Size: 504 B |
BIN
app/src/main/res/drawable-xhdpi/icon_delete_p.png
Normal file
After Width: | Height: | Size: 511 B |
BIN
app/src/main/res/drawable-xhdpi/icon_location.png
Normal file
After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 4.5 KiB |
BIN
app/src/main/res/drawable-xxhdpi/icon_add_data.png
Normal file
After Width: | Height: | Size: 4.9 KiB |
BIN
app/src/main/res/drawable-xxhdpi/icon_add_voice.png
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
app/src/main/res/drawable-xxhdpi/icon_delete.png
Normal file
After Width: | Height: | Size: 504 B |
BIN
app/src/main/res/drawable-xxhdpi/icon_delete_p.png
Normal file
After Width: | Height: | Size: 511 B |
BIN
app/src/main/res/drawable-xxhdpi/icon_location.png
Normal file
After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 8.4 KiB |
6
app/src/main/res/drawable/btn_delete_xml.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<item android:state_enabled="true" android:state_pressed="false" android:drawable="@drawable/icon_delete"/>
|
||||
<item android:state_pressed="true" android:drawable="@drawable/icon_delete_p"/>
|
||||
<item android:state_enabled="false" android:drawable="@drawable/icon_delete"/>
|
||||
</selector>
|
12
app/src/main/res/drawable/icon_speed_limit_off.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval"
|
||||
android:useLevel="false">
|
||||
<stroke
|
||||
android:width="1.33dp"
|
||||
android:color="#000000" />
|
||||
<size
|
||||
android:width="24dp"
|
||||
android:height="24dp" />
|
||||
<solid android:color="@color/white" />
|
||||
|
||||
</shape>
|
@ -44,6 +44,7 @@
|
||||
android:layout_marginTop="20dp"
|
||||
android:onClick="@{()->mainActivity.openMenu()}"
|
||||
android:src="@drawable/baseline_person_24"
|
||||
android:background="@null"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@ -55,36 +56,42 @@
|
||||
app:layout_constraintLeft_toLeftOf="@id/main_activity_person_center"
|
||||
app:layout_constraintTop_toBottomOf="@id/main_activity_person_center" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/main_activity_location"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginBottom="80dp"
|
||||
android:onClick="@{()->viewModel.onClickLocationButton()}"
|
||||
android:src="@drawable/baseline_my_location_24"
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginBottom="108dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent" />
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
tools:ignore="MissingConstraints">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/main_activity_voice"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_marginBottom="120dp"
|
||||
android:src="@drawable/baseline_keyboard_voice_24"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/main_activity_line"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:onClick="@{()->mainActivity.voiceOnclick()}"
|
||||
android:src="@drawable/baseline_keyboard_voice_24"
|
||||
app:layout_constraintBottom_toTopOf="@id/main_activity_voice"
|
||||
app:layout_constraintRight_toRightOf="@id/main_activity_voice" />
|
||||
<ImageButton
|
||||
android:id="@+id/main_activity_voice"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:src="@drawable/icon_add_voice"
|
||||
android:background="@null" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/main_activity_line"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:onClick="@{()->mainActivity.voiceOnclick()}"
|
||||
android:src="@drawable/icon_add_data"
|
||||
android:background="@null" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/main_activity_location"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:onClick="@{()->viewModel.onClickLocationButton()}"
|
||||
android:src="@drawable/icon_location"
|
||||
android:background="@null" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<fragment
|
||||
android:id="@+id/main_activity_middle_fragment"
|
||||
@ -118,6 +125,7 @@
|
||||
android:layout_marginTop="20dp"
|
||||
android:onClick="@{()->mainActivity.openCamera()}"
|
||||
android:src="@drawable/icon_page_video_a1"
|
||||
android:background="@null"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@ -129,6 +137,7 @@
|
||||
android:layout_marginTop="20dp"
|
||||
android:onClick="@{()->mainActivity.openCamera()}"
|
||||
android:src="@drawable/baseline_person_24"
|
||||
android:background="@null"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
@ -1,15 +1,15 @@
|
||||
<RelativeLayout 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="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="193dp"
|
||||
android:layout_height="78dp"
|
||||
android:background="@mipmap/bg_sign"
|
||||
tools:context="com.navinfo.omqs.ui.activity.map.SignAdapter">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sign_main_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginLeft="19dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:background="@drawable/icon_speed_limit"
|
||||
|
@ -28,13 +28,12 @@
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/evaluation_bar"
|
||||
style="@style/Widget.MaterialComponents.Toolbar.Surface"
|
||||
style="@style/card_title_font_default"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="@color/default_blue"
|
||||
android:background="@color/white"
|
||||
app:menu="@menu/evaluation_bar_mean"
|
||||
app:navigationIcon="@drawable/btn_back_xml"
|
||||
app:title="测评结果" />
|
||||
app:title="Mark" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
@ -82,7 +81,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/fm_card_map_down_status_bg"
|
||||
android:onClick="@{fragment.onClick}"
|
||||
android:onClick="@{fragment::onClick}"
|
||||
android:text="@{viewModel.liveDataQsRecordBean.phenomenon}" />
|
||||
|
||||
<TextView
|
||||
@ -91,7 +90,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/fm_card_map_down_status_bg"
|
||||
android:onClick="@{fragment.onClick}"
|
||||
android:onClick="@{fragment::onClick}"
|
||||
android:text="@{viewModel.liveDataQsRecordBean.problemLink}" />
|
||||
|
||||
<TextView
|
||||
@ -100,7 +99,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/fm_card_map_down_status_bg"
|
||||
android:onClick="@{fragment.onClick}"
|
||||
android:onClick="@{fragment::onClick}"
|
||||
android:text="@{viewModel.liveDataQsRecordBean.cause}" />
|
||||
|
||||
<TextView
|
||||
@ -128,6 +127,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/card_title_font_default"
|
||||
android:text="多媒体" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
|
@ -5,7 +5,7 @@
|
||||
<item
|
||||
android:id="@+id/delete"
|
||||
android:contentDescription="删除数据"
|
||||
android:icon="@drawable/baseline_delete_forever_24"
|
||||
android:icon="@drawable/btn_delete_xml"
|
||||
android:title="删除"
|
||||
app:showAsAction="ifRoom" />
|
||||
<item
|
||||
|
BIN
app/src/main/res/mipmap-xxhdpi/icon_kind_code.png
Normal file
After Width: | Height: | Size: 83 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon_kind_code_k1.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon_kind_code_k10.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon_kind_code_k11.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon_kind_code_k13.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon_kind_code_k15.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon_kind_code_k2.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon_kind_code_k3.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon_kind_code_k4.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon_kind_code_k6.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon_kind_code_k7.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon_kind_code_k8.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon_kind_code_k9.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon_lane_num1.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon_lane_num10.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon_lane_num11.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon_lane_num12.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon_lane_num2.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon_lane_num3.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon_lane_num4.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon_lane_num5.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon_lane_num6.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon_lane_num7.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon_lane_num8.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon_lane_num9.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon_road_direction.png
Normal file
After Width: | Height: | Size: 77 KiB |
@ -9,16 +9,25 @@
|
||||
android:id="@+id/EmptyFragment"
|
||||
android:name="com.navinfo.omqs.ui.fragment.empty.EmptyFragment"
|
||||
android:label="空页面"
|
||||
tools:layout="@layout/fragment_empty"></fragment>
|
||||
tools:layout="@layout/fragment_empty">
|
||||
<!-- <action-->
|
||||
<!-- android:id="@+id/EmptyFragment_to_EvaluationResultFragment"-->
|
||||
<!-- app:destination="@id/EvaluationResultFragment" />-->
|
||||
<!-- <argument-->
|
||||
<!-- android:name="QsId"-->
|
||||
<!-- app:argType="string"-->
|
||||
<!-- app:nullable="true" />-->
|
||||
<!-- <argument-->
|
||||
<!-- android:name="SignBean"-->
|
||||
<!-- app:argType="com.navinfo.omqs.ui.activity.map.SignBean"-->
|
||||
<!-- />-->
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/EvaluationResultFragment"
|
||||
android:name="com.navinfo.omqs.ui.fragment.evaluationresult.EvaluationResultFragment"
|
||||
android:label="评测页面"
|
||||
tools:layout="@layout/fragment_evaluation_result">
|
||||
<argument
|
||||
android:name="QsId"
|
||||
app:argType="string"
|
||||
app:nullable="true" />
|
||||
|
||||
</fragment>
|
||||
</navigation>
|
@ -163,6 +163,7 @@
|
||||
<color name="cv_gray_153">#999999</color>
|
||||
<color name="cvm_red">#FF3B30</color>
|
||||
<color name="btn_blue_solid">#108ee9</color>
|
||||
<color name="titleColor">#2631DD</color>
|
||||
<!-- 一键连接对话框背景色 -->
|
||||
<color name="bg_gray2">#d1d1d1</color>
|
||||
<!-- 一键连接时间显示区域背景色 -->
|
||||
|
@ -8,6 +8,7 @@
|
||||
<dimen name="default_widget_padding">10dp</dimen>
|
||||
<dimen name="left_pannel_title_font" comment="左侧弹出框顶部标题字体大小">22sp</dimen>
|
||||
<dimen name="default_font_size" comment="默认字体大小,style中父最顶层">15sp</dimen>
|
||||
<dimen name="card_title_font_size">24sp</dimen>
|
||||
<dimen name="card_title_font_2size">13sp</dimen>
|
||||
<dimen name="card_title_font_3size">10sp</dimen>
|
||||
<dimen name="one">1dp</dimen>
|
||||
|
@ -23,6 +23,15 @@
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
</style>
|
||||
|
||||
<!-- 默认字体 -->
|
||||
<style name="card_title_font_default">
|
||||
<item name="android:gravity">center_vertical</item>
|
||||
<item name="android:textSize">@dimen/card_title_font_size</item>
|
||||
<item name="android:textColor">@color/titleColor</item>
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
</style>
|
||||
|
||||
<!-- 默认字体 -->
|
||||
<style name="content_font_default_size_13sp">
|
||||
<item name="android:gravity">center_vertical</item>
|
||||
|
@ -4,6 +4,7 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath "io.realm:realm-gradle-plugin:10.11.1"
|
||||
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.5.3"
|
||||
}
|
||||
}
|
||||
plugins {
|
||||
@ -11,4 +12,5 @@ plugins {
|
||||
id 'com.android.library' version '7.3.1' apply false
|
||||
id 'org.jetbrains.kotlin.android' version '1.8.0' apply false
|
||||
id 'com.google.dagger.hilt.android' version '2.44' apply false
|
||||
|
||||
}
|
||||
|
@ -249,7 +249,7 @@ public final class NIMapView extends RelativeLayout {
|
||||
|
||||
// 增加比例尺图层
|
||||
NaviMapScaleBar naviMapScaleBar = new NaviMapScaleBar(getVtmMap());
|
||||
naviMapScaleBar.initScaleBarLayer(GLViewport.Position.BOTTOM_LEFT, 25, 60);
|
||||
naviMapScaleBar.initScaleBarLayer(GLViewport.Position.BOTTOM_LEFT, 20, 84);
|
||||
|
||||
// if (gridLayer == null) {
|
||||
// gridLayer = new TileGridLayer(getVtmMap());
|
||||
|
@ -26,7 +26,7 @@ import org.oscim.layers.vector.VectorLayer
|
||||
import org.oscim.layers.vector.geometries.Style
|
||||
import org.oscim.map.Map
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.N)
|
||||
@RequiresApi(Build.VERSION_CODES.M)
|
||||
class LineHandler(context: AppCompatActivity, mapView: NIMapView) : BaseHandler(context, mapView),
|
||||
Map.UpdateListener {
|
||||
|
||||
|
@ -74,7 +74,7 @@ public class OMDBDataDecoder extends TileDecoder {
|
||||
listResult.stream().iterator().forEachRemaining(new Consumer<RenderEntity>() {
|
||||
@Override
|
||||
public void accept(RenderEntity renderEntity) {
|
||||
Log.d("RealmDBTileDataSource", renderEntity.getGeometry());
|
||||
// Log.d("RealmDBTileDataSource", renderEntity.getGeometry());
|
||||
Map<String, Object> properties= new HashMap<>(renderEntity.getProperties().size());
|
||||
properties.putAll(renderEntity.getProperties());
|
||||
parseGeometry(renderEntity.getTable(), renderEntity.getWkt(), properties);
|
||||
|
@ -54,7 +54,7 @@ public class OMDBTileDataSource implements ITileDataSource {
|
||||
mThreadLocalDecoders.get().decode(tile, mapDataSink, listResult);
|
||||
}
|
||||
mapDataSink.completed(QueryResult.SUCCESS);
|
||||
Log.d("RealmDBTileDataSource", "tile:"+tile.getBoundingBox().toString());
|
||||
// Log.d("RealmDBTileDataSource", "tile:"+tile.getBoundingBox().toString());
|
||||
} else {
|
||||
mapDataSink.completed(QueryResult.SUCCESS);
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ public class RealmDBTileDataSource implements ITileDataSource {
|
||||
List<GeometryFeatureEntity> listResult = realmQuery.distinct("id").findAll();
|
||||
mThreadLocalDecoders.get().decode(tile, mapDataSink, listResult);
|
||||
mapDataSink.completed(QueryResult.SUCCESS);
|
||||
Log.d("RealmDBTileDataSource", "tile:"+tile.getBoundingBox().toString());
|
||||
// Log.d("RealmDBTileDataSource", "tile:"+tile.getBoundingBox().toString());
|
||||
} else {
|
||||
mapDataSink.completed(QueryResult.SUCCESS);
|
||||
}
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
package org.videolan.vlc;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.SharedPreferences.Editor;
|
||||
@ -364,10 +365,10 @@ public class Util {
|
||||
return dp;
|
||||
}
|
||||
|
||||
public static int convertDpToPx(int dp) {
|
||||
public static int convertDpToPx(Context context,int dp) {
|
||||
return Math.round(
|
||||
TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp,
|
||||
VLCApplication.getAppResources().getDisplayMetrics())
|
||||
context.getResources().getDisplayMetrics())
|
||||
);
|
||||
}
|
||||
|
||||
|
10
collect-library/src/main/res/drawable/map_zoom_bg_xml.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="72dp" android:height="155dp">
|
||||
<shape android:shape="rectangle">
|
||||
<stroke android:width="3px" android:color="#FFFFF0" />
|
||||
<solid android:color="#FFFFFFFF" />
|
||||
<corners android:radius="36dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
@ -32,6 +32,9 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_marginBottom="48dp"
|
||||
android:background="@drawable/map_zoom_bg_xml"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/nimap_defalut_padding">
|
||||
|
||||
@ -39,7 +42,7 @@
|
||||
android:id="@+id/navinfo_map_zoom_in"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_nimap_default_button"
|
||||
android:background="@null"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:src="@drawable/icon_map_zoom_in" />
|
||||
@ -52,7 +55,7 @@
|
||||
android:id="@+id/navinfo_map_zoom_out"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_nimap_default_button"
|
||||
android:background="@null"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:src="@drawable/icon_map_zoom_out" />
|
||||
|
Before Width: | Height: | Size: 232 B After Width: | Height: | Size: 195 B |
Before Width: | Height: | Size: 274 B After Width: | Height: | Size: 191 B |
Before Width: | Height: | Size: 246 B After Width: | Height: | Size: 156 B |
Before Width: | Height: | Size: 289 B After Width: | Height: | Size: 155 B |
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="nimap_defalut_padding">12dp</dimen>
|
||||
<dimen name="nimap_defalut_padding">5dp</dimen>
|
||||
</resources>
|