[6.1.0]
[charter] [轨迹+订单状态]
This commit is contained in:
@@ -5,14 +5,14 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_72">
|
||||
|
||||
<!--高精地图-->
|
||||
<com.mogo.eagle.core.function.view.MapBizView
|
||||
android:id="@+id/mapBizView"
|
||||
app:isWeatherEnable="false"
|
||||
app:locationIcon3DRes="@raw/m1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<!--魔方控制+开关门-->
|
||||
<com.mogo.och.common.module.wigets.DriverMoFangFunctionView
|
||||
android:layout_width="1116dp"
|
||||
android:layout_height="@dimen/dp_278"
|
||||
@@ -20,7 +20,7 @@
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<!--debugView 开关-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugViewTrigger
|
||||
android:layout_width="@dimen/dp_400"
|
||||
android:layout_height="@dimen/dp_100"
|
||||
@@ -28,7 +28,7 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<!--车速档位加速度-->
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_speed"
|
||||
android:layout_width="@dimen/dp_616"
|
||||
@@ -160,7 +160,7 @@
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--自驾状态和启动开关-->
|
||||
<RelativeLayout
|
||||
android:id="@+id/module_mogo_och_autopilot_status"
|
||||
android:layout_width="@dimen/module_mogo_och_autopilot_status_bg_width"
|
||||
@@ -192,7 +192,7 @@
|
||||
android:textStyle="bold" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<!--订单状态-->
|
||||
<FrameLayout
|
||||
android:id="@+id/module_mogo_och_station_panel_container"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -202,6 +202,7 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/module_mogo_och_autopilot_status"
|
||||
app:layout_goneMarginTop="@dimen/module_mogo_och_station_panel_container_margin_top_no_call" />
|
||||
|
||||
<!--订单信息-->
|
||||
<include
|
||||
android:id="@+id/module_mogo_och_bus_test_bar"
|
||||
layout="@layout/bus_test_bar_view"
|
||||
@@ -211,7 +212,7 @@
|
||||
app:layout_constraintLeft_toLeftOf="@id/module_mogo_och_station_panel_container"
|
||||
app:layout_constraintTop_toBottomOf="@id/module_mogo_och_station_panel_container"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<!--进站按钮-->
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/module_mogo_och_arrived_tv"
|
||||
android:layout_width="@dimen/dp_172"
|
||||
@@ -242,7 +243,7 @@
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80" />
|
||||
</LinearLayout>
|
||||
|
||||
<!--设置信息-->
|
||||
<RelativeLayout
|
||||
android:id="@+id/module_mogo_och_setting_layout"
|
||||
android:layout_width="@dimen/dp_172"
|
||||
@@ -259,6 +260,7 @@
|
||||
android:background="@drawable/bus_setting_btn_bg" />
|
||||
</RelativeLayout>
|
||||
|
||||
<!--异常上报-->
|
||||
<RelativeLayout
|
||||
android:id="@+id/module_mogo_och_badcase_rl"
|
||||
android:layout_width="@dimen/dp_172"
|
||||
@@ -275,6 +277,7 @@
|
||||
android:src="@drawable/icon_bad_case" />
|
||||
</RelativeLayout>
|
||||
|
||||
<!--AI数据采集-->
|
||||
<RelativeLayout
|
||||
android:id="@+id/module_mogo_och_ai_collet_rl"
|
||||
android:layout_width="@dimen/dp_172"
|
||||
@@ -360,7 +363,7 @@
|
||||
app:constraint_referenced_ids="btnAutopilotArrive,btnAutopilotDisable,btnAutopilotEnable
|
||||
,btnAutopilotRunning,btnAutopilotRoute,btnAutopilotPingxing"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<!--小地图-->
|
||||
<com.mogo.eagle.core.function.smp.view.SmallMapView
|
||||
android:id="@+id/smallMapView"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -371,7 +374,7 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
/>
|
||||
|
||||
<!--还车滑块-->
|
||||
<com.magic.mogo.och.charter.view.SlidePanelView
|
||||
android:id="@+id/charter_slide_panel"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -250,8 +250,9 @@ class BusPassengerPresenter(view: MainFragment?) :
|
||||
}
|
||||
val indexInStation =
|
||||
getStationMiddleTrajectory(trajectoryListMogoLocation, sites)
|
||||
drawStationInfo(sites)
|
||||
val drawStationInfo = drawStationInfo(sites)
|
||||
mView?.drawOverMapViewTrajectory(indexInStation)
|
||||
mView?.includePoint(drawStationInfo+indexInStation)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -274,6 +275,7 @@ class BusPassengerPresenter(view: MainFragment?) :
|
||||
temp = LatLng(it.latitude, it.longitude)
|
||||
indexPoint.add(temp)
|
||||
}
|
||||
ToastCharterUtils.showToastShort("没有轨迹点")
|
||||
return indexPoint
|
||||
}
|
||||
|
||||
@@ -314,6 +316,10 @@ class BusPassengerPresenter(view: MainFragment?) :
|
||||
}
|
||||
}
|
||||
}
|
||||
CallerLogger.d(
|
||||
M_BUS_P + TAG,
|
||||
"最小点${minIndex} 最大点:${maxIndex}"
|
||||
)
|
||||
if (minIndex > trajectoryList.size) {
|
||||
minIndex = 0
|
||||
}
|
||||
@@ -331,12 +337,13 @@ class BusPassengerPresenter(view: MainFragment?) :
|
||||
|
||||
}
|
||||
|
||||
fun drawStationInfo(sites: List<SiteInfoResponse.SiteInfo>) {
|
||||
fun drawStationInfo(sites: List<SiteInfoResponse.SiteInfo>): List<LatLng>{
|
||||
val stationsList: MutableList<SiteMarkerBean> = mutableListOf()
|
||||
val stationsNameList: MutableList<SiteMarkerBean> = mutableListOf()
|
||||
val stationIcon =
|
||||
BitmapFactory.decodeResource(context.resources, R.drawable.charter_p_map_staton_icon)
|
||||
var checkMarkView: SiteMarkerBean? = null
|
||||
val includePoint = mutableListOf<LatLng>()
|
||||
sites.forEach {
|
||||
stationsList.add(
|
||||
SiteMarkerBean(
|
||||
@@ -346,6 +353,7 @@ class BusPassengerPresenter(view: MainFragment?) :
|
||||
1f
|
||||
)
|
||||
)
|
||||
includePoint.add(LatLng(it.GcjLat,it.GcjLon))
|
||||
val bitmap = getBitmap(it.siteId!!, it.siteName ?: "", it.isCheck)
|
||||
val siteMarkerBean = SiteMarkerBean(
|
||||
LatLng(it.GcjLat, it.GcjLon),
|
||||
@@ -365,6 +373,7 @@ class BusPassengerPresenter(view: MainFragment?) :
|
||||
stationsNameList.add(checkMarkView!!)
|
||||
}
|
||||
mView?.drawOverMapViewStation(stationsList, stationsNameList)
|
||||
return includePoint
|
||||
}
|
||||
|
||||
private fun getBitmap(siteId: Long, siteName: String, isCheck: Boolean): Bitmap {
|
||||
|
||||
@@ -29,6 +29,7 @@ import com.mogo.och.charter.passenger.ui.bottom.BottomBar
|
||||
import com.mogo.och.charter.passenger.ui.bottom.BottomClickView
|
||||
import com.mogo.och.charter.passenger.ui.dialogfragment.M1CarUserNoOrderFragment
|
||||
import com.mogo.och.charter.passenger.ui.dialogfragment.NoviceGuidanceFragment
|
||||
import com.mogo.och.charter.passenger.ui.lockview.LockManager
|
||||
import com.mogo.och.charter.passenger.ui.statusbar.StatusBarView
|
||||
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils
|
||||
import com.mogo.och.common.module.biz.constant.LoginStatusManager
|
||||
@@ -283,6 +284,10 @@ class MainFragment : MvpFragment<MainFragment?, BusPassengerPresenter?>(), IMogo
|
||||
)
|
||||
}
|
||||
|
||||
fun showOvermapPoint(){
|
||||
omvOverMap.setDebugMode(true)
|
||||
}
|
||||
|
||||
fun showNoviceGuidanceFragment() {
|
||||
if (noviceGuidanceFragment?.get() == null) {
|
||||
noviceGuidanceFragment = WeakReference(NoviceGuidanceFragment.newInstance())
|
||||
@@ -293,6 +298,7 @@ class MainFragment : MvpFragment<MainFragment?, BusPassengerPresenter?>(), IMogo
|
||||
parentFragmentManager,
|
||||
noviceGuidanceFragmentWeak
|
||||
)
|
||||
LockManager.setLock(LockManager.LockStatus.UNLOCK)
|
||||
}
|
||||
|
||||
fun closeOpenAndCloseDoor() {
|
||||
@@ -335,6 +341,9 @@ class MainFragment : MvpFragment<MainFragment?, BusPassengerPresenter?>(), IMogo
|
||||
|
||||
fun drawOverMapViewTrajectory(coordinates: List<LatLng>) {
|
||||
omvOverMap?.drawSitePolyline(coordinates, lineTrajectory)
|
||||
}
|
||||
|
||||
fun includePoint(coordinates: List<LatLng>){
|
||||
omvOverMap?.includeSitePointsAndUpdateCamera(coordinates)
|
||||
}
|
||||
|
||||
|
||||
@@ -103,6 +103,9 @@ open class BottomOrderInfoView @JvmOverloads constructor(
|
||||
actv_order_end_time.text =
|
||||
AbsMogoApplication.getApp().getString(R.string.charter_p_bottom_reach_time)
|
||||
leftTime = -1
|
||||
if(viewState!=ViewState.NormalWithOutOrder){
|
||||
viewState = ViewState.NormalWithOutOrder
|
||||
}
|
||||
notifiBackageView()
|
||||
}
|
||||
|
||||
@@ -120,6 +123,23 @@ open class BottomOrderInfoView @JvmOverloads constructor(
|
||||
val arriveTime = DateTimeUtil.second2Time(timeInSecond)
|
||||
actv_order_end_time.text = arriveTime
|
||||
leftTime = timeInSecond
|
||||
when (leftTime) {
|
||||
in 1..300 -> {
|
||||
if(viewState!=ViewState.Near300){
|
||||
viewState = ViewState.Near300
|
||||
}
|
||||
}
|
||||
in 301..899 -> {
|
||||
if(viewState!=ViewState.Near900){
|
||||
viewState = ViewState.Near900
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
if(viewState!=ViewState.Normal){
|
||||
viewState = ViewState.Normal
|
||||
}
|
||||
}
|
||||
}
|
||||
notifiBackageView()
|
||||
}
|
||||
setViewByOrderStatus(CharterPassengerModel.getCurrentOrderStatus())
|
||||
@@ -130,57 +150,43 @@ open class BottomOrderInfoView @JvmOverloads constructor(
|
||||
if (isCheck) {
|
||||
backageView?.visibility = View.VISIBLE
|
||||
actv_order_null.setTextColor(context.getColor(android.R.color.white))
|
||||
actv_order_end_time_title.setTextColor(context.getColor(android.R.color.white))
|
||||
if(leftTime<900){
|
||||
actv_order_end_time.setTextColor(context.getColor(R.color.charter_p_ff6d2c))
|
||||
if(viewState!=ViewState.Near900){
|
||||
viewState = ViewState.Near900
|
||||
updateState()
|
||||
actv_order_end_time_title.setTextColor(context.getColor(R.color.charter_p_090f28))
|
||||
actv_order_end_time.setTextColor(context.getColor(android.R.color.white))
|
||||
when (viewState) {
|
||||
ViewState.Normal -> {
|
||||
backageView?.setImageResource(R.drawable.charter_p_bottom_bar_select_bg)
|
||||
}
|
||||
}else{
|
||||
actv_order_end_time.setTextColor(context.getColor(android.R.color.white))
|
||||
if(viewState!=ViewState.Normal){
|
||||
viewState = ViewState.Normal
|
||||
updateState()
|
||||
ViewState.Near300 -> {
|
||||
backageView?.setImageResource(R.drawable.charter_p_bottom_bar_select_near900s_bg)
|
||||
}
|
||||
ViewState.Near900 -> {
|
||||
backageView?.setImageResource(R.drawable.charter_p_bottom_bar_select_near900s_bg)
|
||||
}
|
||||
ViewState.NormalWithOutOrder -> backageView?.visibility = View.GONE
|
||||
}
|
||||
} else {
|
||||
actv_order_null.setTextColor(context.getColor(R.color.charter_p_090f28))
|
||||
actv_order_end_time_title.setTextColor(context.getColor(R.color.charter_p_090f28))
|
||||
if(leftTime<900){
|
||||
actv_order_end_time.setTextColor(context.getColor(R.color.charter_p_ff6d2c))
|
||||
if(leftTime<300){//0-300s
|
||||
if(leftTime>0) {
|
||||
backageView?.visibility = View.VISIBLE
|
||||
if (viewState != ViewState.Near300) {
|
||||
viewState = ViewState.Near300
|
||||
updateState()
|
||||
}
|
||||
}else{
|
||||
backageView?.visibility = View.VISIBLE
|
||||
if (viewState != ViewState.Normal) {
|
||||
viewState = ViewState.Normal
|
||||
updateState()
|
||||
}
|
||||
}
|
||||
}else{//300s-900s
|
||||
backageView?.visibility = View.GONE
|
||||
backageView?.visibility = View.GONE
|
||||
when (viewState) {
|
||||
ViewState.Normal -> {
|
||||
actv_order_end_time.setTextColor(context.getColor(R.color.charter_p_0050E1))
|
||||
}
|
||||
ViewState.Near300 -> {
|
||||
backageView?.visibility = View.VISIBLE
|
||||
backageView?.setImageResource(R.drawable.charter_p_bottom_bar_select_near300s_bg)
|
||||
actv_order_end_time.setTextColor(context.getColor(R.color.charter_p_ff6d2c))
|
||||
}
|
||||
ViewState.Near900 -> {
|
||||
actv_order_end_time.setTextColor(context.getColor(R.color.charter_p_ff6d2c))
|
||||
}
|
||||
ViewState.NormalWithOutOrder -> {
|
||||
actv_order_end_time.setTextColor(context.getColor(R.color.charter_p_0050E1))
|
||||
}
|
||||
}else{
|
||||
backageView?.visibility = View.GONE
|
||||
actv_order_end_time.setTextColor(context.getColor(R.color.charter_p_0050E1))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateState(){
|
||||
when (viewState) {
|
||||
ViewState.Normal -> backageView?.setImageResource(R.drawable.charter_p_bottom_bar_select_bg)
|
||||
ViewState.Near300 -> backageView?.setImageResource(R.drawable.charter_p_bottom_bar_select_near300s_bg)
|
||||
ViewState.Near900 -> backageView?.setImageResource(R.drawable.charter_p_bottom_bar_select_near900s_bg)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onStatusChange(currentStatus: OrderStatusEnum) {
|
||||
UiThreadHandler.post {
|
||||
@@ -190,6 +196,6 @@ open class BottomOrderInfoView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
enum class ViewState{
|
||||
Normal,Near300,Near900
|
||||
Normal,Near300,Near900,NormalWithOutOrder
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import androidx.fragment.app.FragmentActivity
|
||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.util.ActivityUtils
|
||||
import com.mogo.och.charter.passenger.R
|
||||
import com.mogo.och.charter.passenger.bean.response.OrderInfoResponse
|
||||
@@ -21,6 +22,7 @@ import kotlinx.android.synthetic.main.charter_p_debug.view.debug_arrive_dest
|
||||
import kotlinx.android.synthetic.main.charter_p_debug.view.debug_change_modle
|
||||
import kotlinx.android.synthetic.main.charter_p_debug.view.debug_show_endview
|
||||
import kotlinx.android.synthetic.main.charter_p_debug.view.debug_show_noviceGuidance
|
||||
import kotlinx.android.synthetic.main.charter_p_debug.view.debug_show_overmap_point
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
@@ -86,6 +88,10 @@ class DebugView @JvmOverloads constructor(
|
||||
debug_show_endview.setOnClickListener {
|
||||
fragment?.showOpenAndCloseDoor()
|
||||
}
|
||||
|
||||
debug_show_overmap_point.onClick {
|
||||
fragment?.showOvermapPoint()
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
|
||||
@@ -29,6 +29,11 @@
|
||||
android:id="@+id/debug_show_endview"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
<TextView
|
||||
android:text="overmap"
|
||||
android:id="@+id/debug_show_overmap_point"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
Reference in New Issue
Block a user