解决代码冲突

This commit is contained in:
squallzhjch 2023-05-04 14:51:44 +08:00
parent 1726c93c9d
commit 4b3adaaa97
4 changed files with 27 additions and 22 deletions

View File

@ -1,10 +1,12 @@
package com.navinfo.omqs.ui.activity.map
import android.os.Build
import android.os.Bundle
import android.util.Log
import android.view.MotionEvent
import android.view.View
import androidx.activity.viewModels
import androidx.annotation.RequiresApi
import androidx.core.view.WindowCompat
import androidx.databinding.DataBindingUtil
import androidx.navigation.findNavController
@ -45,7 +47,7 @@ class MainActivity : BaseActivity() {
// )
// rightController.navigate(directions)
rightController.currentDestination?.let {
if(it.id == R.id.EvaluationResultFragment){
if (it.id == R.id.EvaluationResultFragment) {
val bundle = Bundle()
bundle.putParcelable("SignBean", signBean)
rightController.navigate(R.id.EvaluationResultFragment, bundle)
@ -76,15 +78,15 @@ 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")
}
}
@ -154,14 +156,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()
}
}

View File

@ -26,6 +26,7 @@ import com.navinfo.collect.library.map.NIMapController
import com.navinfo.collect.library.map.handler.OnQsRecordItemClickListener
import com.navinfo.collect.library.utils.GeometryTools
import com.navinfo.collect.library.utils.GeometryToolsKt
import com.navinfo.omqs.Constant
import com.navinfo.omqs.R
import com.navinfo.omqs.bean.SignBean
import com.navinfo.omqs.db.RealmOperateHelper

View File

@ -82,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
@ -103,8 +103,10 @@ class EvaluationResultFragment : BaseFragment(), View.OnClickListener {
// 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) {
@ -112,7 +114,7 @@ class EvaluationResultFragment : BaseFragment(), View.OnClickListener {
}
if (id == null || id.isEmpty()) {
viewModel.initNewData(signBean)
viewModel.initNewData(signBean, filePath)
} else {
viewModel.initData(id)
}
@ -277,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()
}
}

View File

@ -384,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!!