[M2] 1、M2 UI初步调整 2、Date格式命名调整
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package com.mogo.och.bus.passenger.callback
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2023/2/13
|
||||
*/
|
||||
interface AutoPilotStatusCallback {
|
||||
/**
|
||||
* false: 未开启自驾, true : 开启自驾
|
||||
*/
|
||||
fun updateAutoStatus(isOpen: Boolean)
|
||||
|
||||
fun updateAutoStatus(status: Int)
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import android.content.Context
|
||||
import android.os.Handler
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
@@ -19,6 +20,7 @@ import com.mogo.och.bus.passenger.bean.PM2OperationStatusResponse
|
||||
import com.mogo.och.bus.passenger.bean.PM2RoutesResponse
|
||||
import com.mogo.och.bus.passenger.bean.PM2RoutesResult
|
||||
import com.mogo.och.bus.passenger.bean.PM2Station
|
||||
import com.mogo.och.bus.passenger.callback.AutoPilotStatusCallback
|
||||
import com.mogo.och.bus.passenger.callback.DrivingInfoCallback
|
||||
import com.mogo.och.bus.passenger.constant.BusPassengerConst
|
||||
import com.mogo.och.bus.passenger.network.PM2ModelLoopManager
|
||||
@@ -39,14 +41,18 @@ class PM2DrivingModel private constructor() {
|
||||
private var mRoutePoints = mutableListOf<MogoLocation>()
|
||||
private var routesResult: PM2RoutesResult? = null
|
||||
|
||||
private var mCurrentAutoStatus = -1
|
||||
|
||||
var mStations = mutableListOf<PM2Station>()
|
||||
private var mNextStationIndex = 0 // 要到达站的index
|
||||
private var mNextStationIndex = 0 // A-B要到达站的index
|
||||
private var isGoingToNextStation = false //是否前往下一站过程中
|
||||
|
||||
private var mTwoStationsRouts = mutableListOf<MogoLocation>()
|
||||
private var mPreRouteIndex = 0
|
||||
private var mWipePreIndex = 0
|
||||
|
||||
private var mDrivingInfoCallback : DrivingInfoCallback? = null //行程信息
|
||||
private var mDrivingInfoCallback: DrivingInfoCallback? = null //行程信息
|
||||
private var mAutoStatusCallback: AutoPilotStatusCallback? = null //自动驾驶状态
|
||||
|
||||
private val handler = Handler(Handler.Callback { msg ->
|
||||
if (msg.what == MSG_QUERY_BUS_P_STATION) {
|
||||
@@ -78,7 +84,7 @@ class PM2DrivingModel private constructor() {
|
||||
CallerChassisLocationGCJ02ListenerManager.setListenerHz(TAG,5)//设置5hz, 1s返回一次
|
||||
}
|
||||
|
||||
public fun releaseListener(){
|
||||
fun releaseListener(){
|
||||
//自动驾驶状态监听
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
|
||||
@@ -90,6 +96,10 @@ class PM2DrivingModel private constructor() {
|
||||
mDrivingInfoCallback = drivingInfoCallback
|
||||
}
|
||||
|
||||
fun setAutoStatusCallback(autoPilotStatusCallback: AutoPilotStatusCallback){
|
||||
mAutoStatusCallback = autoPilotStatusCallback
|
||||
}
|
||||
|
||||
private val mMapLocationListener: IMoGoChassisLocationGCJ02Listener =
|
||||
object : IMoGoChassisLocationGCJ02Listener{
|
||||
override fun onChassisLocationGCJ02(mogoLocation: MogoLocation?) {
|
||||
@@ -116,7 +126,22 @@ class PM2DrivingModel private constructor() {
|
||||
|
||||
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
|
||||
super.onAutopilotStatusResponse(autoPilotStatusInfo)
|
||||
//todo 自动驾驶状态展示, 注意美化模式下的处理
|
||||
val status = autoPilotStatusInfo.state
|
||||
if (mCurrentAutoStatus == status) return
|
||||
|
||||
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING != status){
|
||||
//美化模式下且行程中
|
||||
if (FunctionBuildConfig.isDemoMode &&
|
||||
mNextStationIndex>= 0 && mNextStationIndex <= mStations.size - 1
|
||||
&& isGoingToNextStation){
|
||||
mAutoStatusCallback?.updateAutoStatus(true)
|
||||
}else{//非美化模式下
|
||||
mAutoStatusCallback?.updateAutoStatus(false)
|
||||
}
|
||||
|
||||
}else{//自驾状态 2
|
||||
mAutoStatusCallback?.updateAutoStatus(true)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -163,6 +188,7 @@ class PM2DrivingModel private constructor() {
|
||||
if (data?.result == null || data.result.sites == null) {
|
||||
routesResult = null
|
||||
mNextStationIndex = 0
|
||||
isGoingToNextStation = false
|
||||
startOrStopCalculateRouteInfo(false)
|
||||
mDrivingInfoCallback?.showNoTaskView(true)
|
||||
return
|
||||
@@ -177,6 +203,7 @@ class PM2DrivingModel private constructor() {
|
||||
override fun onFail(code: Int, msg: String?) {
|
||||
if (code == 1003) {
|
||||
routesResult = null
|
||||
isGoingToNextStation = false
|
||||
startOrStopCalculateRouteInfo(false)
|
||||
queryDriverOperationDelay()
|
||||
return
|
||||
@@ -197,20 +224,22 @@ class PM2DrivingModel private constructor() {
|
||||
mStations.addAll(stations)
|
||||
for (i in stations.indices) {
|
||||
val station: PM2Station = stations[i]
|
||||
if (station.drivingStatus === BusPassengerConst.STATION_STATUS_STOPPED
|
||||
if (station.drivingStatus == BusPassengerConst.STATION_STATUS_STOPPED
|
||||
&& station.isLeaving && i + 1 < stations.size) {
|
||||
// mRouteLineInfoCallback.updateStationsInfo(stations, i + 1, false)
|
||||
if (mNextStationIndex != i + 1) {
|
||||
mTwoStationsRouts.clear()
|
||||
startRemainRouteInfo()
|
||||
}
|
||||
isGoingToNextStation = true
|
||||
mNextStationIndex = i + 1
|
||||
return
|
||||
} else if (station.drivingStatus === BusPassengerConst.STATION_STATUS_STOPPED && !station.isLeaving) {
|
||||
} else if (station.drivingStatus == BusPassengerConst.STATION_STATUS_STOPPED && !station.isLeaving) {
|
||||
if (i == 0) {
|
||||
startOrStopRouteAndWipe(false)
|
||||
}
|
||||
mPreRouteIndex = 0
|
||||
isGoingToNextStation = false
|
||||
startOrStopCalculateRouteInfo(false)
|
||||
// mRouteLineInfoCallback.updateStationsInfo(stations, i, true)
|
||||
return
|
||||
|
||||
@@ -3,12 +3,13 @@ package com.mogo.och.bus.passenger.presenter
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import com.mogo.commons.mvp.Presenter
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.bus.passenger.callback.AutoPilotStatusCallback
|
||||
import com.mogo.och.bus.passenger.callback.DrivingInfoCallback
|
||||
import com.mogo.och.bus.passenger.model.PM2DrivingModel
|
||||
import com.mogo.och.bus.passenger.ui.PM2DrivingInfoFragment
|
||||
|
||||
class PM2DrivingPresenter(view: PM2DrivingInfoFragment?) :
|
||||
Presenter<PM2DrivingInfoFragment?>(view), DrivingInfoCallback {
|
||||
Presenter<PM2DrivingInfoFragment?>(view), DrivingInfoCallback, AutoPilotStatusCallback {
|
||||
|
||||
init {
|
||||
PM2DrivingModel.INSTANCE.init(context)
|
||||
@@ -22,6 +23,7 @@ class PM2DrivingPresenter(view: PM2DrivingInfoFragment?) :
|
||||
|
||||
private fun initListener(){
|
||||
PM2DrivingModel.INSTANCE.setDrivingInfoCallback(this)
|
||||
PM2DrivingModel.INSTANCE.setAutoStatusCallback(this)
|
||||
}
|
||||
|
||||
private fun destroyListener(){
|
||||
@@ -58,4 +60,14 @@ class PM2DrivingPresenter(view: PM2DrivingInfoFragment?) :
|
||||
override fun showNoTaskView(isTrue: Boolean) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun updateAutoStatus(isOpen: Boolean) {
|
||||
UiThreadHandler.post {
|
||||
mView?.updateAutoStatus(isOpen)
|
||||
}
|
||||
}
|
||||
|
||||
override fun updateAutoStatus(status: Int) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,13 @@
|
||||
package com.mogo.och.bus.passenger.ui
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.eagle.core.utilcode.util.DateTimeUtils
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.presenter.PM2DrivingPresenter
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil.*
|
||||
import kotlinx.android.synthetic.m2.p_m2_driving_info_fragment.*
|
||||
|
||||
/**
|
||||
@@ -53,7 +57,7 @@ class PM2DrivingInfoFragment :
|
||||
}
|
||||
|
||||
fun updateCarPlateNum(plateNum : String){
|
||||
car_plate_tv.text = plateNum
|
||||
|
||||
}
|
||||
|
||||
fun updateTaskName(name: String){
|
||||
@@ -65,17 +69,39 @@ class PM2DrivingInfoFragment :
|
||||
}
|
||||
|
||||
fun updateCurrentTime(){
|
||||
// current_time_tv.text =
|
||||
// current_weekday_tv.text =
|
||||
current_time_tv.text = formatCalendarToString(
|
||||
DateTimeUtils.getCurrentDateTime(),HH_mm)
|
||||
|
||||
val date = formatCalendarToString(
|
||||
DateTimeUtils.getCurrentDateTime(), yyyy_MM_dd)
|
||||
val weekDay = DateTimeUtils.getWeekDayFromCalendar1(DateTimeUtils.getCurrentDateTime())
|
||||
current_weekday_tv.text = "$date $weekDay"
|
||||
|
||||
|
||||
}
|
||||
|
||||
fun changeOperationStatus(status:Boolean){
|
||||
if (!status){ //暂无路线
|
||||
|
||||
}else{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
override fun createPresenter(): PM2DrivingPresenter {
|
||||
return PM2DrivingPresenter(this)
|
||||
}
|
||||
|
||||
fun updateAutoStatus(isAutoPilot: Boolean) {
|
||||
if (isAutoPilot){
|
||||
context?.let { auto_tv.setTextColor(ContextCompat.getColor(it,R.color.m2_p_white_color)) }
|
||||
context?.let { auto_tv.background = ContextCompat.getDrawable(it,R.drawable.auto_button_bg) }
|
||||
}else{
|
||||
context?.let { auto_tv.setTextColor(ContextCompat.getColor(it,R.color.m2_button_auto_tv_color)) }
|
||||
context?.let { auto_tv.background = ContextCompat.getDrawable(it,R.drawable.bg_p_m2_auto_bg) }
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val TAG = PM2DrivingInfoFragment::class.java.simpleName
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 46 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.1 KiB |
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/m2_button_un_auto_bg_color"/>
|
||||
<corners android:radius="@dimen/dp_20"/>
|
||||
</shape>
|
||||
@@ -1,144 +1,162 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="@dimen/dp_556">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/driving_view"
|
||||
android:layout_width="@dimen/dp_800"
|
||||
android:layout_height="@dimen/dp_600"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:padding="@dimen/dp_30">
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/img_drive_bg"
|
||||
android:layout_width="@dimen/dp_290"
|
||||
android:layout_height="@dimen/dp_140"
|
||||
android:layout_marginTop="@dimen/dp_24"
|
||||
android:layout_marginLeft="@dimen/dp_24"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:src="@drawable/img_drive_bg"/>
|
||||
|
||||
<!-- 行车卡片-->
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/speed_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0"
|
||||
android:textSize="@dimen/dp_45"
|
||||
android:text="--"
|
||||
android:textColor="@color/m2_p_speed_tv_color"
|
||||
android:textSize="@dimen/dp_56"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintLeft_toLeftOf="@+id/img_drive_bg"
|
||||
android:layout_marginLeft="@dimen/dp_24"
|
||||
app:layout_constraintTop_toTopOf="@+id/img_drive_bg"
|
||||
tools:ignore="SpUsage" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:textSize="@dimen/dp_20"
|
||||
android:layout_marginLeft="@dimen/dp_8"
|
||||
android:textSize="@dimen/dp_18"
|
||||
android:text="KM/H"
|
||||
android:layout_marginBottom="@dimen/dp_16"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/speed_tv"
|
||||
app:layout_constraintLeft_toRightOf="@+id/speed_tv" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/auto_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:text="--"
|
||||
android:textColor="@color/color_FFFFFF"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_width="@dimen/dp_66"
|
||||
android:layout_height="@dimen/dp_38"
|
||||
android:background="@drawable/bg_p_m2_auto_bg"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:text="Auto"
|
||||
android:textSize="@dimen/dp_18"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/m2_button_auto_tv_color"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/speed_tv"
|
||||
app:layout_constraintTop_toBottomOf="@+id/speed_tv" />
|
||||
|
||||
<!-- 转向灯 IMoGoChassisLamplightListener-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.TurnLightViewStatus
|
||||
android:id="@+id/turn_light_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_30"
|
||||
android:layout_width="@dimen/dp_68"
|
||||
android:layout_height="@dimen/dp_38"
|
||||
android:layout_marginLeft="@dimen/dp_12"
|
||||
app:layout_constraintLeft_toRightOf="@+id/auto_tv"
|
||||
app:layout_constraintTop_toTopOf="@+id/auto_tv" />
|
||||
|
||||
<!-- 红绿灯-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.SingleTrafficLightView
|
||||
android:id="@+id/traffic_light_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_30"
|
||||
android:layout_width="@dimen/dp_60"
|
||||
android:layout_height="@dimen/dp_38"
|
||||
android:layout_marginLeft="@dimen/dp_12"
|
||||
app:layout_constraintLeft_toRightOf="@+id/turn_light_view"
|
||||
app:layout_constraintTop_toTopOf="@+id/auto_tv" />
|
||||
|
||||
<View
|
||||
android:id="@+id/dividing_line_1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bus_p_route_line_dividing_view_height"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:background="@color/bus_p_traffic_light_bg_stroke"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/auto_tv" />
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/img_line_bg"
|
||||
android:layout_width="@dimen/dp_290"
|
||||
android:layout_height="@dimen/dp_140"
|
||||
android:layout_marginTop="@dimen/dp_22"
|
||||
app:layout_constraintTop_toBottomOf="@+id/img_drive_bg"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/img_drive_bg"
|
||||
android:src="@drawable/img_line_bg"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/car_plate_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/dividing_line_1"
|
||||
android:textStyle="bold"
|
||||
android:text="--"
|
||||
android:textSize="@dimen/dp_24"/>
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/img_line_location_bg"
|
||||
android:layout_width="@dimen/dp_74"
|
||||
android:layout_height="@dimen/dp_79"
|
||||
android:layout_marginRight="@dimen/dp_20"
|
||||
app:layout_constraintTop_toTopOf="@+id/img_line_bg"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/img_line_bg"
|
||||
app:layout_constraintRight_toRightOf="@+id/img_line_bg"
|
||||
android:src="@drawable/m2_line_location_bg"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/task_name_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toRightOf="@+id/car_plate_tv"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/car_plate_tv"
|
||||
android:textStyle="bold"
|
||||
android:text="--"
|
||||
android:textSize="@dimen/dp_24"
|
||||
android:textColor="@color/bus_p_line_name_color"/>
|
||||
app:layout_constraintTop_toTopOf="@+id/img_line_location_bg"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/speed_tv"
|
||||
android:textColor="@color/m2_line_name_tv_color"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/task_during_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/car_plate_tv"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:textSize="@dimen/dp_20"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:textSize="@dimen/dp_18"
|
||||
android:text="--"
|
||||
android:textColor="@color/bus_p_line_name_color"/>
|
||||
app:layout_constraintLeft_toLeftOf="@+id/task_name_tv"
|
||||
app:layout_constraintTop_toBottomOf="@+id/task_name_tv"
|
||||
android:textColor="@color/m2_line_during_tv_color"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/dividing_line_2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bus_p_route_line_dividing_view_height"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:background="@color/bus_p_traffic_light_bg_stroke"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/task_during_tv" />
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/img_time_bg"
|
||||
android:layout_width="@dimen/dp_290"
|
||||
android:layout_height="@dimen/dp_140"
|
||||
android:layout_marginTop="@dimen/dp_22"
|
||||
app:layout_constraintTop_toBottomOf="@+id/img_line_bg"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/img_drive_bg"
|
||||
android:src="@drawable/img_time_bg"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/img_time_clock_bg"
|
||||
android:layout_width="@dimen/dp_97"
|
||||
android:layout_height="@dimen/dp_66"
|
||||
android:layout_marginRight="@dimen/dp_25"
|
||||
app:layout_constraintTop_toTopOf="@+id/img_time_bg"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/img_time_bg"
|
||||
app:layout_constraintRight_toRightOf="@+id/img_time_bg"
|
||||
android:src="@drawable/clock_bg"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/current_time_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/dividing_line_2"
|
||||
android:textSize="@dimen/dp_24"
|
||||
android:textSize="@dimen/dp_42"
|
||||
android:textStyle="bold"
|
||||
android:text="--"/>
|
||||
android:text="--"
|
||||
app:layout_constraintTop_toTopOf="@+id/img_time_clock_bg"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/speed_tv"
|
||||
android:textColor="@color/m2_current_time_tv_color"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/current_weekday_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/current_time_tv"
|
||||
android:textSize="@dimen/dp_24"
|
||||
android:text="--"/>
|
||||
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
app:layout_constraintLeft_toLeftOf="@+id/current_time_tv"
|
||||
app:layout_constraintTop_toBottomOf="@+id/current_time_tv"
|
||||
android:textSize="@dimen/dp_18"
|
||||
android:text="--"
|
||||
android:textColor="@color/m2_line_during_tv_color"/>
|
||||
|
||||
<!-- 全览地图带站点-->
|
||||
<com.mogo.eagle.core.function.view.OverMapView
|
||||
android:id="@+id/overMapView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_600"
|
||||
app:layout_constraintLeft_toRightOf="@+id/driving_view"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<com.mogo.eagle.core.function.view.OverMapView
|
||||
android:id="@+id/overMapView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -13,19 +13,19 @@
|
||||
|
||||
<!-- 消息盒子气泡-->
|
||||
|
||||
<!-- <com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxBubbleView-->
|
||||
<!-- android:id="@+id/box_bubble_view"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintLeft_toLeftOf="parent" />-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxBubbleView
|
||||
android:id="@+id/box_bubble_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent" />
|
||||
|
||||
<!--pnc行为决策-->
|
||||
<!-- <com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView-->
|
||||
<!-- android:id="@+id/pnc_actions_view"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
|
||||
<!-- app:layout_constraintRight_toRightOf="parent" />-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
|
||||
android:id="@+id/pnc_actions_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,8 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="@dimen/dp_565">
|
||||
|
||||
<!-- 图片或视频广告-->
|
||||
|
||||
|
||||
@@ -1,32 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="bus_p_speed_txt_color">#2D3E5F</color>
|
||||
<color name="bus_p_traffic_light_bg_color">#CCE9EFFC</color>
|
||||
<color name="bus_p_traffic_light_bg_stroke">#C7D2E1</color>
|
||||
<color name="bus_p_driver_number_plate_color">#2D3E5F</color>
|
||||
<color name="bus_p_line_name_color">#0043FF</color>
|
||||
<color name="bus_p_line_operation_time_color">#2D3E5F</color>
|
||||
<color name="bus_p_no_data_color">#596A8A</color>
|
||||
<color name="bus_p_station_circle_color">#D8E5F8</color>
|
||||
<color name="bus_p_start_station_circle_borner_color">#FFB327</color>
|
||||
<color name="bus_p_station_txt_color">#2D3E5F</color>
|
||||
<color name="bus_p_current_station_txt_color">#0043FF</color>
|
||||
<color name="bus_p_middle_station_circle_color2">#276AFE</color>
|
||||
<color name="bus_p_middle_station_circle_color1">#0043FF</color>
|
||||
<color name="bus_p_end_station_circle_borner_color">#276AFE</color>
|
||||
<color name="bus_p_start_tag_bg_color1">#FFC125</color>
|
||||
<color name="bus_p_start_tag_bg_color2">#FF8131</color>
|
||||
<color name="bus_p_end_tag_bg_color1">#31BFF2</color>
|
||||
<color name="bus_p_end_tag_bg_color2">#3257E9</color>
|
||||
<color name="bus_p_end_tag_txt_color">#FFFFFF</color>
|
||||
<color name="bus_p_tag_line_color">#CDDBF6</color>
|
||||
<color name="bus_p_panel_cur_txt_color">#2D3E5F</color>
|
||||
<color name="bus_p_panel_cur_station_txt_color">#0043FF</color>
|
||||
<color name="bus_p_panel_cur_station_tips_color">#2D3E5F</color>
|
||||
<color name="bus_p_panel_cur_station_panel_color">#E6E9EFFC</color>
|
||||
<color name="bus_p_route_view_left_edge_shadow">#33394C63</color>
|
||||
<color name="bus_p_traffic_txt_color">#2D3E5F</color>
|
||||
<color name="bus_p_panel_edge_shadow">#33394C63</color>
|
||||
<color name="m2_p_white_color">#FFFFFF</color>
|
||||
<color name="m2_p_speed_tv_color">#0B1E38</color>
|
||||
<color name="m2_button_auto_tv_color">#2D3E5F</color>
|
||||
<color name="m2_button_un_auto_bg_color">#B3C0D4ED</color>
|
||||
<color name="m2_line_name_tv_color">#0B1E38</color>
|
||||
<color name="m2_line_during_tv_color">#5D7199</color>
|
||||
<color name="m2_current_time_tv_color">#0B1E38</color>
|
||||
|
||||
<color name="bus_traffic_light_red_color_up">#FFFFA28B</color>
|
||||
<color name="bus_traffic_light_red_color_down">#FFDA1100</color>
|
||||
|
||||
@@ -499,7 +499,7 @@ public class OrderModel {
|
||||
|
||||
String lineTime = DateTimeUtil.formatLongToString(
|
||||
busRoutesResult.getTaskTime(),
|
||||
DateTimeUtil.TAXI_HH_mm);
|
||||
DateTimeUtil.HH_mm);
|
||||
|
||||
if (arrivingOrArrivedStationIndex == 0 ||
|
||||
arrivingOrArrivedStation.getDrivingStatus() == STATION_STATUS_STOPPED
|
||||
|
||||
@@ -11,11 +11,12 @@ import java.util.Date;
|
||||
* @date: 2022/5/6
|
||||
*/
|
||||
public class DateTimeUtil {
|
||||
public static final String TAXI_HH_mm = "HH:mm";
|
||||
public static final String TAXI_MM_dd = "MM-dd";
|
||||
public static final String TAXI_MM_dd_HH_mm = "MM-dd HH:mm";
|
||||
public static final String TAXI_yyyy_MM_dd = "yyyy-MM-dd";
|
||||
public static final String TAXI_yyyy_MM_dd_HH_mm = "yyyy-MM-dd HH:mm";
|
||||
public static final String HH_mm = "HH:mm";
|
||||
public static final String MM_dd = "MM-dd";
|
||||
public static final String MM_dd_HH_mm = "MM-dd HH:mm";
|
||||
public static final String yyyy_MM_dd = "yyyy-MM-dd";
|
||||
public static final String yy_MM_dd = "yy-MM-dd";
|
||||
public static final String yyyy_MM_dd_HH_mm = "yyyy-MM-dd HH:mm";
|
||||
|
||||
public static String formatCalendarToString(Calendar calendar, String format){
|
||||
if (calendar == null) return "";
|
||||
@@ -30,8 +31,8 @@ public class DateTimeUtil {
|
||||
|
||||
public static boolean compareDateIsCurrentDay(Calendar targetCalendar){
|
||||
Calendar currentCale = DateTimeUtils.getCurrentDateTime();
|
||||
String currentDay = formatCalendarToString(currentCale, TAXI_yyyy_MM_dd);
|
||||
if (currentDay.equals(formatCalendarToString(targetCalendar, TAXI_yyyy_MM_dd))){
|
||||
String currentDay = formatCalendarToString(currentCale, yyyy_MM_dd);
|
||||
if (currentDay.equals(formatCalendarToString(targetCalendar, yyyy_MM_dd))){
|
||||
return true;
|
||||
}else {
|
||||
return false;
|
||||
|
||||
@@ -334,7 +334,7 @@ public class TaxiPassengerServingOrderFragment extends
|
||||
|
||||
Calendar beforeTime = Calendar.getInstance();
|
||||
beforeTime.add(Calendar.MINUTE,time);
|
||||
String arriveTime = DateTimeUtil.formatCalendarToString(beforeTime,DateTimeUtil.TAXI_HH_mm);
|
||||
String arriveTime = DateTimeUtil.formatCalendarToString(beforeTime,DateTimeUtil.HH_mm);
|
||||
updateOrderDisAndTimeView(remainDis, disUnit,time, arriveTime);
|
||||
updateDriveProcessLoading(new Long(meters).intValue());
|
||||
}
|
||||
|
||||
@@ -429,7 +429,7 @@ object LeftMenuOpen {
|
||||
val beforeTime = Calendar.getInstance()
|
||||
beforeTime.add(Calendar.MINUTE, time)
|
||||
//到达时间
|
||||
val arriveTime = DateTimeUtil.formatCalendarToString(beforeTime, DateTimeUtil.TAXI_HH_mm)
|
||||
val arriveTime = DateTimeUtil.formatCalendarToString(beforeTime, DateTimeUtil.HH_mm)
|
||||
FloatingDistanceInfoUtils.setDistance(meters,remainDis,disUnit,time,arriveTime)
|
||||
}else{
|
||||
FloatingDistanceInfoUtils.setSpeed(speed)
|
||||
|
||||
@@ -22,7 +22,6 @@ import com.mogo.eagle.core.data.map.CenterLine;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.DateTimeUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
@@ -34,7 +33,6 @@ import com.mogo.och.common.module.map.ICommonNaviChangedCallback;
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil;
|
||||
import com.mogo.och.common.module.utils.NumberFormatUtil;
|
||||
import com.mogo.och.common.module.utils.OCHThreadPoolManager;
|
||||
import com.mogo.och.common.module.utils.ToastUtilsOch;
|
||||
import com.mogo.och.common.module.voice.VoiceNotice;
|
||||
import com.mogo.och.common.module.wigets.OCHCommitDialog;
|
||||
import com.mogo.och.taxi.R;
|
||||
@@ -239,8 +237,8 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment
|
||||
mOrderOtherContent3.setVisibility(View.GONE);
|
||||
|
||||
Calendar currentCale = DateTimeUtils.getCurrentDateTime();
|
||||
String currentHM = DateTimeUtil.formatCalendarToString(currentCale, DateTimeUtil.TAXI_HH_mm);
|
||||
String currentDay = DateTimeUtil.formatCalendarToString(currentCale, DateTimeUtil.TAXI_yyyy_MM_dd);
|
||||
String currentHM = DateTimeUtil.formatCalendarToString(currentCale, DateTimeUtil.HH_mm);
|
||||
String currentDay = DateTimeUtil.formatCalendarToString(currentCale, DateTimeUtil.yyyy_MM_dd);
|
||||
String strHtml11 = "<font color=\"#CAD6FF\">已于</font><br>"
|
||||
+ "<b><font color=\"#FFFFFF\"><big><big>" + currentHM + "</big></big></font></b>"
|
||||
+ "<font color=\"#CAD6FF\">" + " " + "到达乘客上车地点</font>";
|
||||
@@ -251,13 +249,13 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment
|
||||
mStationTv32.setText(order.endSiteAddr);
|
||||
currentCale.add(Calendar.MINUTE, 10);
|
||||
String strHtml13 = "";
|
||||
if (currentDay.equals(DateTimeUtil.formatCalendarToString(currentCale, DateTimeUtil.TAXI_yyyy_MM_dd))) {
|
||||
if (currentDay.equals(DateTimeUtil.formatCalendarToString(currentCale, DateTimeUtil.yyyy_MM_dd))) {
|
||||
strHtml13 = "<font color=\"#CAD6FF\">免费等待至 </font>"
|
||||
+ "<b><font color=\"#FFFFFF\"><big>" + DateTimeUtil.formatCalendarToString(currentCale, DateTimeUtil.TAXI_HH_mm) + "</big></b></font>";
|
||||
+ "<b><font color=\"#FFFFFF\"><big>" + DateTimeUtil.formatCalendarToString(currentCale, DateTimeUtil.HH_mm) + "</big></b></font>";
|
||||
|
||||
} else {
|
||||
strHtml13 = "<font color=\"#CAD6FF\">免费等待至</font>"
|
||||
+ "<font color=\"#FFFFFF\"><big>" + DateTimeUtil.formatCalendarToString(currentCale, DateTimeUtil.TAXI_MM_dd_HH_mm) + "</big></font>";
|
||||
+ "<font color=\"#FFFFFF\"><big>" + DateTimeUtil.formatCalendarToString(currentCale, DateTimeUtil.MM_dd_HH_mm) + "</big></font>";
|
||||
}
|
||||
mDistanceAndTime3.setText(Html.fromHtml(strHtml13));
|
||||
|
||||
@@ -315,16 +313,16 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment
|
||||
|
||||
Calendar currentCale = DateTimeUtils.getCurrentDateTime();
|
||||
Calendar startCale = DateTimeUtil.formatLongToCalendar(order.bookingTime);
|
||||
String currentDay = DateTimeUtil.formatCalendarToString(currentCale, DateTimeUtil.TAXI_yyyy_MM_dd);
|
||||
String startDay = DateTimeUtil.formatCalendarToString(startCale, DateTimeUtil.TAXI_yyyy_MM_dd);
|
||||
String currentDay = DateTimeUtil.formatCalendarToString(currentCale, DateTimeUtil.yyyy_MM_dd);
|
||||
String startDay = DateTimeUtil.formatCalendarToString(startCale, DateTimeUtil.yyyy_MM_dd);
|
||||
String strHtml1 = "";
|
||||
if (currentDay.equals(startDay)) {
|
||||
strHtml1 = "<font color=\"#CAD6FF\">乘客将于</font><br>"
|
||||
+ "<b><font color=\"#FFFFFF\"><big><big>" + DateTimeUtil.formatCalendarToString(startCale, DateTimeUtil.TAXI_HH_mm) + "</big></big></font></b>"
|
||||
+ "<b><font color=\"#FFFFFF\"><big><big>" + DateTimeUtil.formatCalendarToString(startCale, DateTimeUtil.HH_mm) + "</big></big></font></b>"
|
||||
+ "<font color=\"#CAD6FF\"> 用车</font>";
|
||||
} else {
|
||||
strHtml1 = "<font color=\"#CAD6FF\">乘客将于</font><br>"
|
||||
+ "<b><font color=\"#FFFFFF\"><big><big>" + DateTimeUtil.formatCalendarToString(startCale, DateTimeUtil.TAXI_MM_dd_HH_mm) + "</big></big></font></b>"
|
||||
+ "<b><font color=\"#FFFFFF\"><big><big>" + DateTimeUtil.formatCalendarToString(startCale, DateTimeUtil.MM_dd_HH_mm) + "</big></big></font></b>"
|
||||
+ "<font color=\"#CAD6FF\"> 用车</font>";
|
||||
}
|
||||
mOrderOtherContent3.setText(Html.fromHtml(strHtml1));
|
||||
|
||||
@@ -94,12 +94,12 @@ public class TaxiGrabOrderFragment extends BaseTaxiUIFragment implements View.On
|
||||
mGrabResultAnimView.setVisibility(View.GONE);
|
||||
Calendar calendar = DateTimeUtil.formatLongToCalendar(order.bookingTime);
|
||||
if (DateTimeUtil.compareDateIsCurrentDay(calendar)){
|
||||
mOrderReserverTime.setText("用车时间:今天 "+ DateTimeUtil.formatCalendarToString(calendar, DateTimeUtil.TAXI_HH_mm));
|
||||
VoiceNotice.showNotice("预约单,今天"+ DateTimeUtil.formatCalendarToString(calendar, DateTimeUtil.TAXI_HH_mm)+"从"
|
||||
mOrderReserverTime.setText("用车时间:今天 "+ DateTimeUtil.formatCalendarToString(calendar, DateTimeUtil.HH_mm));
|
||||
VoiceNotice.showNotice("预约单,今天"+ DateTimeUtil.formatCalendarToString(calendar, DateTimeUtil.HH_mm)+"从"
|
||||
+order.startSiteAddr+"到"+order.endSiteAddr);
|
||||
}else {
|
||||
mOrderReserverTime.setText("用车时间:"+ DateTimeUtil.formatCalendarToString(calendar, DateTimeUtil.TAXI_MM_dd_HH_mm));
|
||||
VoiceNotice.showNotice("预约单,"+ DateTimeUtil.formatCalendarToString(calendar, DateTimeUtil.TAXI_MM_dd)+"从"
|
||||
mOrderReserverTime.setText("用车时间:"+ DateTimeUtil.formatCalendarToString(calendar, DateTimeUtil.MM_dd_HH_mm));
|
||||
VoiceNotice.showNotice("预约单,"+ DateTimeUtil.formatCalendarToString(calendar, DateTimeUtil.MM_dd)+"从"
|
||||
+order.startSiteAddr+"到"+order.endSiteAddr);
|
||||
}
|
||||
mOrderStartStation.setText(order.startSiteAddr);
|
||||
|
||||
@@ -398,7 +398,7 @@ public class TaxiPersonalDialogFragment extends
|
||||
Button orderStatusBt, Button orderTypeBt, TextView orderNumTv){
|
||||
Calendar calendar= Calendar.getInstance();
|
||||
calendar.setTimeInMillis(queryRespBean.createTime);
|
||||
orderTimeTv.setText(DateTimeUtil.formatCalendarToString(calendar, DateTimeUtil.TAXI_HH_mm));
|
||||
orderTimeTv.setText(DateTimeUtil.formatCalendarToString(calendar, DateTimeUtil.HH_mm));
|
||||
startStationTv.setText(queryRespBean.startSiteAddr);
|
||||
endStationTv.setText(queryRespBean.endSiteAddr);
|
||||
orderStatusBt.setText(getOrderStatus(queryRespBean.orderStatus,orderStatusBt));
|
||||
|
||||
@@ -130,9 +130,9 @@ public class TaxiReserveOrdersFragment extends BaseTaxiUIFragment {
|
||||
OrderQueryRespBean.Result order = datas.get(position);
|
||||
Calendar calendar = DateTimeUtil.formatLongToCalendar(order.bookingTime);
|
||||
if (DateTimeUtil.compareDateIsCurrentDay(calendar)){
|
||||
viewHolder.orderTime.setText("用车时间:今天"+ DateTimeUtil.formatCalendarToString(calendar, DateTimeUtil.TAXI_HH_mm));
|
||||
viewHolder.orderTime.setText("用车时间:今天"+ DateTimeUtil.formatCalendarToString(calendar, DateTimeUtil.HH_mm));
|
||||
}else {
|
||||
viewHolder.orderTime.setText("用车时间:"+ DateTimeUtil.formatCalendarToString(calendar, DateTimeUtil.TAXI_MM_dd_HH_mm));
|
||||
viewHolder.orderTime.setText("用车时间:"+ DateTimeUtil.formatCalendarToString(calendar, DateTimeUtil.MM_dd_HH_mm));
|
||||
}
|
||||
viewHolder.orderCancel.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user