[6.4.6]
[fea] [是否展示高精地图轨迹]
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package com.mogo.och.common.module.manager.autopilot.line
|
||||
|
||||
object LineManager {
|
||||
private var lineId: Int = -1
|
||||
@JvmStatic
|
||||
fun setLineId(value: Int) {
|
||||
if (value < 0) {
|
||||
lineId = -1
|
||||
} else {
|
||||
lineId = value
|
||||
}
|
||||
}
|
||||
@JvmStatic
|
||||
fun setLineId(value: Long) {
|
||||
if (value < 0) {
|
||||
lineId = -1
|
||||
} else {
|
||||
lineId = value.toInt()
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getLineId():Int{
|
||||
return lineId
|
||||
}
|
||||
|
||||
fun haveLine(): Boolean {
|
||||
return lineId > 0
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.mogo.och.common.module.wigets.map.drawline
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import androidx.appcompat.widget.AppCompatImageView
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapGlobalTrajectoryDrawManager
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.common.module.R
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class LineView : AppCompatImageView{
|
||||
|
||||
private val TAG = "VisualView"
|
||||
|
||||
constructor(context: Context) : super(context)
|
||||
|
||||
constructor(context: Context, attributeSet: AttributeSet) : super(context, attributeSet)
|
||||
|
||||
constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int) : super(
|
||||
context,
|
||||
attributeSet,
|
||||
defStyleAttr
|
||||
)
|
||||
|
||||
private fun initView() {
|
||||
setImageResource(R.drawable.common_map_line_close)
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
|
||||
onClick {
|
||||
if (CallerMapGlobalTrajectoryDrawManager.hasDrawnGlobalTrajectory()) {
|
||||
CallerMapGlobalTrajectoryDrawManager.clearGlobalTrajectory()
|
||||
setImageResource(R.drawable.common_map_line_close)
|
||||
}else{
|
||||
val drawGlobalTrajectory = CallerMapGlobalTrajectoryDrawManager.drawGlobalTrajectory()
|
||||
if(drawGlobalTrajectory.first){
|
||||
setImageResource(R.drawable.common_map_line_open)
|
||||
}else{
|
||||
setImageResource(R.drawable.common_map_line_close)
|
||||
ToastUtils.showLong(drawGlobalTrajectory.second)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
init {
|
||||
try {
|
||||
initView()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -25,7 +25,7 @@ class OrderStatusView : AppCompatImageView, OrderStatusViewModel.IVisualCallback
|
||||
)
|
||||
|
||||
private fun initView() {
|
||||
setImageResource(R.drawable.common_visual_medium)
|
||||
setImageResource(R.drawable.common_status_unorder)
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
Reference in New Issue
Block a user