[6.5.0][视角切换] 增加漫游视角场景,解决视角切换开关不生效问题
This commit is contained in:
@@ -10,6 +10,7 @@ import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.data.map.*
|
||||
import com.mogo.eagle.core.function.angle.scenes.CrossRoad
|
||||
import com.mogo.eagle.core.function.angle.scenes.Default
|
||||
import com.mogo.eagle.core.function.angle.scenes.Roma
|
||||
import com.mogo.eagle.core.function.api.map.angle.*
|
||||
import com.mogo.eagle.core.function.api.map.angle.IMoGoVisualAngleChangeProvider.OnMoGoVisualAngleSceneChangeListener
|
||||
import com.mogo.eagle.core.function.api.map.angle.Scene
|
||||
@@ -143,17 +144,7 @@ class MoGoVisualAngleChangeProvider: IMoGoVisualAngleChangeProvider {
|
||||
@Volatile
|
||||
private var prevJob: Job? = null
|
||||
|
||||
@Volatile
|
||||
private var mLevel:Boolean = false
|
||||
|
||||
override fun updateLongSightLevel(level:Boolean){
|
||||
mLevel = level
|
||||
}
|
||||
|
||||
override fun changeScene(scene: Scene) {
|
||||
if(mLevel){
|
||||
return
|
||||
}
|
||||
prevJob?.safeCancel()
|
||||
scope.launch {
|
||||
val delay = scene.delay
|
||||
@@ -190,7 +181,9 @@ class MoGoVisualAngleChangeProvider: IMoGoVisualAngleChangeProvider {
|
||||
} else {
|
||||
CallerMapUIServiceManager.getMapUIController()?.setAllGesturesEnabled(true)
|
||||
}
|
||||
it.changeMapVisualAngle(angle, null)
|
||||
if (target !is Roma) {
|
||||
it.changeMapVisualAngle(angle, null)
|
||||
}
|
||||
} finally {
|
||||
if (prev == null || prev.javaClass != target.javaClass) {
|
||||
notifyChanged(target)
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.angle.scenes
|
||||
|
||||
import com.mogo.eagle.core.function.api.map.angle.Scene
|
||||
import com.mogo.map.uicontroller.VisualAngleMode
|
||||
import com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_CROSS
|
||||
import com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_CROSS_NEW
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.mogo.eagle.core.function.angle.scenes
|
||||
|
||||
import com.mogo.eagle.core.function.api.map.angle.Scene
|
||||
import com.mogo.map.uicontroller.VisualAngleMode
|
||||
import com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ROMA
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
/**
|
||||
* 漫游场景
|
||||
*/
|
||||
class Roma(val delayTime: Long = 2, val unit: TimeUnit = TimeUnit.SECONDS): Scene {
|
||||
|
||||
override val angle: VisualAngleMode
|
||||
get() = MAP_STYLE_VR_ROMA
|
||||
override val priority: Int
|
||||
get() = 1
|
||||
override val displayThreshold: Long
|
||||
get() = -1
|
||||
override val delay: Long
|
||||
get() = unit.toMillis(delayTime)
|
||||
override val isCanSwitch: Boolean
|
||||
get() = false
|
||||
override val isCanTouch: Boolean
|
||||
get() = false
|
||||
}
|
||||
@@ -23,6 +23,8 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_RO
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ROMA_REQUEST_ERROR
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ROMA_REQUEST_OK
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ROMA_ROUTE_MODE
|
||||
import com.mogo.eagle.core.function.angle.scenes.Default
|
||||
import com.mogo.eagle.core.function.angle.scenes.Roma
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener
|
||||
import com.mogo.eagle.core.function.api.map.roma.IMoGoAiCloudIdentifyDataListener
|
||||
@@ -37,7 +39,7 @@ import com.mogo.eagle.core.function.call.map.CallerMapIdentifyManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRomaListener
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRomaListener.invokeRomaViewStatus
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.updateLongSightLevel
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
|
||||
import com.mogo.eagle.core.function.utils.MapRomaTrace
|
||||
import com.mogo.eagle.core.function.utils.MapRomaTrace.Companion.getCurrentCNode
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
@@ -153,7 +155,8 @@ class RomaManager() : IMoGoPlanningRottingListener,
|
||||
CallerMapIdentifyManager.updateRoam(TAG, true)
|
||||
CallerMapUIServiceManager.getMapUIController()?.visualAngleLock(true)
|
||||
CallerMapUIServiceManager.getMapUIController()?.setScrollGesturesEnable(false)
|
||||
updateLongSightLevel(true)
|
||||
// updateLongSightLevel(true)
|
||||
CallerVisualAngleManager.changeScene(Roma(0))
|
||||
requestRangeOfIdentify(true)
|
||||
}
|
||||
|
||||
@@ -161,7 +164,8 @@ class RomaManager() : IMoGoPlanningRottingListener,
|
||||
private fun closeRoma(manual: Boolean = true) {
|
||||
CallerMapUIServiceManager.getMapUIController()?.visualAngleLock(false)
|
||||
CallerMapUIServiceManager.getMapUIController()?.setScrollGesturesEnable(true)
|
||||
updateLongSightLevel(false)
|
||||
// updateLongSightLevel(false)
|
||||
CallerVisualAngleManager.changeScene(Default(0))
|
||||
requestRangeOfIdentify(false)
|
||||
MapIdentifySubscriber.instance.clearAiCloudRoma()
|
||||
// 主动关闭roma,回到中景视角
|
||||
@@ -219,7 +223,8 @@ class RomaManager() : IMoGoPlanningRottingListener,
|
||||
"endRange" to END_METRE
|
||||
), true
|
||||
)
|
||||
updateLongSightLevel(false)
|
||||
// updateLongSightLevel(false)
|
||||
CallerVisualAngleManager.changeScene(Default(0))
|
||||
CallerMapRomaListener.invokeMapRoma(false)
|
||||
CallerMapIdentifyManager.updateRoam("", false)
|
||||
if (DebugConfig.isDebug()) {
|
||||
|
||||
@@ -4,8 +4,6 @@ import com.alibaba.android.arouter.facade.template.IProvider
|
||||
|
||||
interface IMoGoVisualAngleChangeProvider: IProvider {
|
||||
|
||||
fun updateLongSightLevel(level: Boolean)
|
||||
|
||||
fun changeScene(scene: Scene)
|
||||
|
||||
fun getCurrentScene(): Scene
|
||||
|
||||
@@ -6,7 +6,6 @@ import com.mogo.eagle.core.data.constants.*
|
||||
import com.mogo.eagle.core.function.api.map.angle.*
|
||||
import com.mogo.eagle.core.function.api.map.angle.IMoGoVisualAngleChangeProvider.OnMoGoVisualAngleSceneChangeListener
|
||||
|
||||
|
||||
/**
|
||||
* 高精地图视角管理类,根据业务需要,以业务回调/直接调用地图 ,对地图进行改变
|
||||
*/
|
||||
@@ -30,10 +29,6 @@ object CallerVisualAngleManager {
|
||||
return provider?.getCurrentScene() ?: throw AssertionError()
|
||||
}
|
||||
|
||||
fun updateLongSightLevel(level: Boolean) {
|
||||
provider?.updateLongSightLevel(level)
|
||||
}
|
||||
|
||||
fun addListener(tag: String, listener: OnMoGoVisualAngleSceneChangeListener) {
|
||||
provider?.addListener(tag, listener)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user