Merge branch 'master' of https://gitlab.navinfo.com/CollectVehicle/OneMapQS
Conflicts: vtm
This commit is contained in:
commit
0d3b16503a
@ -9,7 +9,7 @@ data class SignBean(
|
||||
var iconId: Int = 0,
|
||||
//定位点到目标距离
|
||||
val distance: Int = 0,
|
||||
//图表中的问题
|
||||
//左上图标中的文字
|
||||
val iconText: String = "",
|
||||
//绑定的要素id
|
||||
val elementId: String = "",
|
||||
@ -20,7 +20,11 @@ data class SignBean(
|
||||
//名称
|
||||
val name: String,
|
||||
//底部右侧文字
|
||||
val bottomRightText: String,
|
||||
val bottomRightText: String = "",
|
||||
//要素code类型
|
||||
val elementCode: Int
|
||||
val elementCode: Int,
|
||||
//需要展示更多的内容
|
||||
val moreText: String = "",
|
||||
//左上角信息
|
||||
val topRightText: String = ""
|
||||
) : Parcelable
|
@ -16,6 +16,8 @@ import androidx.annotation.RequiresApi
|
||||
import androidx.core.view.WindowCompat
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.navigation.NavController
|
||||
import androidx.navigation.NavDestination
|
||||
import androidx.navigation.findNavController
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
@ -49,7 +51,9 @@ class MainActivity : BaseActivity() {
|
||||
|
||||
var switchFragment = false
|
||||
|
||||
|
||||
/**
|
||||
* 检测是否含有tts插件
|
||||
*/
|
||||
private val someActivityResultLauncher =
|
||||
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
|
||||
if (result.resultCode == Activity.RESULT_OK) {
|
||||
@ -137,7 +141,6 @@ 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())
|
||||
when (event?.action) {
|
||||
MotionEvent.ACTION_DOWN -> {
|
||||
voiceOnTouchStart()//Do Something
|
||||
@ -148,14 +151,13 @@ class MainActivity : BaseActivity() {
|
||||
Log.e("qj", "voiceOnTouchStop")
|
||||
}
|
||||
}
|
||||
|
||||
return v?.onTouchEvent(event) ?: true
|
||||
}
|
||||
})
|
||||
|
||||
viewModel.liveDataQsRecordIdList.observe(this) {
|
||||
//处理页面跳转
|
||||
viewModel.navigation(this, it)
|
||||
viewModel.navigationRightFragment(this, it)
|
||||
}
|
||||
|
||||
viewModel.liveDataMenuState.observe(this) {
|
||||
@ -165,7 +167,6 @@ class MainActivity : BaseActivity() {
|
||||
} else {
|
||||
binding.mainActivityMenuGroup.visibility = View.INVISIBLE
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//道路属性面板
|
||||
@ -215,6 +216,16 @@ class MainActivity : BaseActivity() {
|
||||
viewModel.refreshOMDBLayer(it)
|
||||
}
|
||||
}
|
||||
|
||||
findNavController(R.id.main_activity_right_fragment).addOnDestinationChangedListener { controller, destination, arguments ->
|
||||
if (destination.id == R.id.RightEmptyFragment) {
|
||||
binding.mainActivityRightVisibilityButtonsGroup.visibility = View.VISIBLE
|
||||
} else {
|
||||
binding.mainActivityRightVisibilityButtonsGroup.visibility = View.GONE
|
||||
viewModel.setSelectRoad(false)
|
||||
binding.mainActivitySelectLine.isSelected = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//根据输入的经纬度跳转坐标
|
||||
@ -236,7 +247,7 @@ class MainActivity : BaseActivity() {
|
||||
val x = parts[0].toDouble()
|
||||
val y = parts[0].toDouble()
|
||||
mapController.animationHandler.animationByLatLon(y, x)
|
||||
}else{
|
||||
} else {
|
||||
Toast.makeText(this, "输入格式不正确", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
|
@ -3,7 +3,6 @@ package com.navinfo.omqs.ui.activity.map
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.content.DialogInterface
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.AnimationDrawable
|
||||
import android.graphics.drawable.BitmapDrawable
|
||||
import android.os.Build
|
||||
@ -16,6 +15,7 @@ import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.PopupWindow
|
||||
import androidx.annotation.RequiresApi
|
||||
import androidx.constraintlayout.widget.Group
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
@ -223,7 +223,7 @@ class MainViewModel @Inject constructor(
|
||||
|
||||
val linkId = link.properties[RenderEntity.Companion.LinkTable.linkPid]
|
||||
|
||||
if(linkIdCache!=linkId){
|
||||
if (linkIdCache != linkId) {
|
||||
|
||||
Log.e("jingo", "捕捉到的linkid $linkId ${link.geometry}")
|
||||
mapController.lineHandler.showLine(link.geometry)
|
||||
@ -290,14 +290,11 @@ class MainViewModel @Inject constructor(
|
||||
withContext(Dispatchers.Main) {
|
||||
speakMode?.speakText(speechText)
|
||||
}
|
||||
linkIdCache = linkId ?: ""
|
||||
Log.e("jingo", "自动捕捉数据 共${signList.size}条")
|
||||
} else {
|
||||
mapController.lineHandler.removeLine()
|
||||
}
|
||||
|
||||
linkIdCache = linkId ?: ""
|
||||
|
||||
Log.e("jingo", "自动捕捉数据 共${signList.size}条")
|
||||
|
||||
}else{
|
||||
ToastUtils.showLong("未捕捉到数据")
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -460,27 +457,11 @@ class MainViewModel @Inject constructor(
|
||||
/**
|
||||
* 处理页面调转
|
||||
*/
|
||||
fun navigation(activity: MainActivity, list: List<String>) {
|
||||
fun navigationRightFragment(activity: MainActivity, list: List<String>) {
|
||||
//获取右侧fragment容器
|
||||
val naviController = activity.findNavController(R.id.main_activity_right_fragment)
|
||||
|
||||
naviController.currentDestination?.let { navDestination ->
|
||||
// when (val fragment =
|
||||
// activity.supportFragmentManager.findFragmentById(navDestination.id)) {
|
||||
// //判断右侧的fragment是不是质检数据
|
||||
//// is EvaluationResultFragment -> {
|
||||
//// val viewModelFragment =
|
||||
//// ViewModelProvider(fragment)[EvaluationResultViewModel::class.java]
|
||||
//// viewModelFragment.notifyData(list)
|
||||
//// }
|
||||
// is EmptyFragment -> {
|
||||
// if (list.size == 1) {
|
||||
// val bundle = Bundle()
|
||||
// bundle.putString("QsId", list[0])
|
||||
// naviController.navigate(R.id.EvaluationResultFragment, bundle)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
when (navDestination.id) {
|
||||
R.id.RightEmptyFragment -> {
|
||||
if (list.size == 1) {
|
||||
@ -499,7 +480,7 @@ class MainViewModel @Inject constructor(
|
||||
fun setSelectRoad(select: Boolean) {
|
||||
bSelectRoad = select
|
||||
//去掉缓存
|
||||
linkIdCache = ""
|
||||
linkIdCache = ""
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
mapController.lineHandler.removeLine()
|
||||
liveDataSignList.value = mutableListOf()
|
||||
|
@ -32,6 +32,7 @@ class EmptyFragment : Fragment() {
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
val currentDestination = findNavController().currentDestination
|
||||
//有右侧面板的时候
|
||||
if (currentDestination?.label == "右侧空页面") {
|
||||
currentDestinationLabel = "右侧空页面"
|
||||
(activity as MainActivity).setRightSwitchButton(View.GONE)
|
||||
@ -40,6 +41,7 @@ class EmptyFragment : Fragment() {
|
||||
|
||||
override fun onStop() {
|
||||
super.onStop()
|
||||
//没有有右侧面板的时候
|
||||
if (currentDestinationLabel == "右侧空页面") {
|
||||
(activity as MainActivity).setRightSwitchButton(View.VISIBLE)
|
||||
}
|
||||
|
@ -139,10 +139,6 @@ class PhenomenonFragment :
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
_binding = null
|
||||
Log.e("jingo", "PhenomenonFragment onDestroyView ${hashCode()}")
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
}
|
||||
}
|
@ -6,8 +6,10 @@ import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.navigation.findNavController
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.navinfo.omqs.R
|
||||
import com.navinfo.omqs.databinding.FragmentProblemLinkBinding
|
||||
import com.navinfo.omqs.ui.fragment.BaseFragment
|
||||
import com.navinfo.omqs.ui.other.shareViewModels
|
||||
@ -28,7 +30,6 @@ class ProblemLinkFragment : BaseFragment() {
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
_binding = FragmentProblemLinkBinding.inflate(inflater, container, false)
|
||||
Log.e("jingo", "linkFragment onCreateView ${hashCode()}")
|
||||
return binding.root
|
||||
}
|
||||
|
||||
@ -43,6 +44,9 @@ class ProblemLinkFragment : BaseFragment() {
|
||||
binding.linkRightRecyclerview.layoutManager = rightLayoutManager
|
||||
val rightAdapter = RightGroupHeaderAdapter { _, bean ->
|
||||
viewModel.setProblemLinkMiddleBean(bean)
|
||||
if (activity != null) {
|
||||
requireActivity().findNavController(R.id.main_activity_middle_fragment).navigateUp()
|
||||
}
|
||||
}
|
||||
binding.linkRightRecyclerview.adapter = rightAdapter
|
||||
//右侧菜单增加组标题
|
||||
@ -55,6 +59,7 @@ class ProblemLinkFragment : BaseFragment() {
|
||||
}
|
||||
//右侧菜单查询数据监听
|
||||
viewModel.liveDataRightTypeList.observe(viewLifecycleOwner) {
|
||||
rightAdapter.setSelectTitle(viewModel.liveDataQsRecordBean.value!!.cause)
|
||||
rightAdapter.refreshData(it)
|
||||
}
|
||||
|
||||
@ -82,10 +87,5 @@ class ProblemLinkFragment : BaseFragment() {
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
_binding = null
|
||||
Log.e("jingo", "linkFragment onDestroyView ${hashCode()}")
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
}
|
||||
}
|
BIN
app/src/main/res/drawable-xxhdpi/icon_sign_info.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/icon_sign_info.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.1 KiB |
@ -76,8 +76,8 @@
|
||||
android:id="@+id/main_activity_sign_recyclerview"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxHeight="350dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:maxHeight="350dp"
|
||||
app:layout_constraintLeft_toLeftOf="@id/main_activity_person_center"
|
||||
app:layout_constraintTop_toBottomOf="@id/main_activity_person_center" />
|
||||
|
||||
@ -175,10 +175,10 @@
|
||||
android:drawableLeft="@drawable/icon_main_geometry"
|
||||
android:elevation="2dp"
|
||||
android:gravity="center"
|
||||
android:onClick="@{()->mainActivity.jumpPosition()}"
|
||||
android:paddingLeft="9dp"
|
||||
android:text="经纬度:116.99388424,38.8403844"
|
||||
android:textSize="10sp"
|
||||
android:onClick="@{()->mainActivity.jumpPosition()}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/main_activity_middle_fragment" />
|
||||
|
||||
@ -233,7 +233,6 @@
|
||||
app:layout_constraintBottom_toTopOf="@id/main_activity_add_new"
|
||||
app:layout_constraintRight_toRightOf="@id/main_activity_add_new" />
|
||||
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/main_activity_select_line"
|
||||
style="@style/zoom_btns_style"
|
||||
@ -244,6 +243,12 @@
|
||||
app:layout_constraintBottom_toTopOf="@id/main_activity_voice"
|
||||
app:layout_constraintRight_toRightOf="@id/main_activity_voice" />
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/main_activity_right_visibility_buttons_group"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:constraint_referenced_ids="main_activity_select_line,main_activity_voice,main_activity_add_new" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/main_activity_middle_fragment"
|
||||
android:name="androidx.navigation.fragment.NavHostFragment"
|
||||
|
@ -1,17 +1,22 @@
|
||||
<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="193dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="78dp"
|
||||
android:background="@drawable/bg_sign"
|
||||
tools:context="com.navinfo.omqs.ui.activity.map.SignAdapter">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/sign_main_bg"
|
||||
android:layout_width="193dp"
|
||||
android:layout_height="78dp"
|
||||
android:background="@drawable/bg_sign" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/sign_main_icon_bg"
|
||||
android:layout_marginLeft="19dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"/>
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginLeft="19dp"
|
||||
android:layout_marginTop="4dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sign_main_icon"
|
||||
@ -40,13 +45,23 @@
|
||||
android:id="@+id/sign_bottom_right_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="其他信息"
|
||||
android:layout_alignTop="@id/sign_bottom_text"
|
||||
android:textColor="@color/white"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginRight="15dp"
|
||||
android:textSize="14sp"/>
|
||||
android:gravity="center"
|
||||
android:text="其他信息"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/sign_main_info"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@id/sign_main_bg"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:layout_toRightOf="@id/sign_main_bg"
|
||||
android:background="@drawable/icon_sign_info"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/sign_main_fast_error"
|
||||
|
Loading…
x
Reference in New Issue
Block a user