Merge remote-tracking branch 'origin/dev_robobus-m1-p-app-module_1.0.0_230112_1.0.0' into dev_robobus-m1-p-app-module_1.0.0_230112_1.0.0

This commit is contained in:
yangyakun
2023-02-22 15:38:05 +08:00
11 changed files with 131 additions and 43 deletions

View File

@@ -14,4 +14,5 @@ interface DrivingInfoCallback {
fun changeOperationStatus(loginStatus : Boolean)
fun showNoTaskView(isTrue : Boolean)
fun updateLineStations(stations: MutableList<PM2Station>)
fun updateStationsInfo(stations: MutableList<PM2Station>, i: Int, isArrived: Boolean)
}

View File

@@ -179,7 +179,6 @@ class PM2DrivingModel private constructor() {
override fun onAutopilotArriveAtStation(arrivalNotification: MessagePad.ArrivalNotification?) {
super.onAutopilotArriveAtStation(arrivalNotification)
//todo 自动驾驶到站接口
}
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
@@ -292,7 +291,7 @@ class PM2DrivingModel private constructor() {
val station: PM2Station = stations[i]
if (station.drivingStatus == BusPassengerConst.STATION_STATUS_STOPPED
&& station.isLeaving && i + 1 < stations.size) {
// mRouteLineInfoCallback.updateStationsInfo(stations, i + 1, false)
mDrivingInfoCallback?.updateStationsInfo(stations as MutableList<PM2Station>, i + 1, false)
if (mNextStationIndex != i + 1) {
mTwoStationsRouts.clear()
startRemainRouteInfo()
@@ -307,7 +306,7 @@ class PM2DrivingModel private constructor() {
mPreRouteIndex = 0
isGoingToNextStation = false
startOrStopCalculateRouteInfo(false)
// mRouteLineInfoCallback.updateStationsInfo(stations, i, true)
mDrivingInfoCallback?.updateStationsInfo(stations as MutableList<PM2Station>, i, true)
return
}
}

View File

@@ -82,6 +82,12 @@ class PM2DrivingPresenter(view: PM2DrivingInfoFragment?) :
PM2ADASModel.INSTANCE.updateHDMapStations(stations)
}
override fun updateStationsInfo(stations: MutableList<PM2Station>, i: Int, isArrived: Boolean) {
UiThreadHandler.post {
mView?.updateStationsInfo(stations,i,isArrived)
}
}
override fun updateAutoStatus(isOpen: Boolean) {
UiThreadHandler.post {
mView?.updateAutoStatus(isOpen)

View File

@@ -19,7 +19,10 @@ import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.bean.PM2Station
import com.mogo.och.bus.passenger.presenter.PM2DrivingPresenter
import com.mogo.och.common.module.utils.DateTimeUtil.*
import com.mogo.och.common.module.utils.NumberFormatUtil
import kotlinx.android.synthetic.m2.p_m2_driving_info_fragment.*
import kotlin.math.ceil
import kotlin.math.roundToInt
/**
* @author: wangmingjun
@@ -111,9 +114,7 @@ class PM2DrivingInfoFragment :
val date = formatCalendarToString(
DateTimeUtils.getCurrentDateTime(), yy_MM_dd)
val weekDay = DateTimeUtils.getWeekDayFromCalendar1(DateTimeUtils.getCurrentDateTime())
current_weekday_tv.text = "$date $weekDay"
"$date $weekDay".also { current_weekday_tv.text = it }
}
fun changeOperationStatus(status:Boolean){
@@ -133,11 +134,19 @@ class PM2DrivingInfoFragment :
line_name_tv.visibility = View.GONE
line_during_tv.visibility = View.GONE
no_line_tv.visibility = View.VISIBLE
updateNoStationView()
overMapView.clearSiteMarkers()
overMapView.clearCustomPolyline()
}
}
private fun updateNoStationView(){
station_name_tv.setTextColor(resources.getColor(R.color.m2_no_line_tv_color))
station_name_title_tv.text = resources.getString(R.string.m2_p_station_title_tv)
station_name_tv.text = resources.getString(R.string.m2_p_empty_tv)
remain_mt.text = resources.getString(R.string.m2_p_empty_remain_km_minute)
}
override fun createPresenter(): PM2DrivingPresenter {
return PM2DrivingPresenter(this)
}
@@ -163,12 +172,40 @@ class PM2DrivingInfoFragment :
BitmapFactory.decodeResource(resources,R.drawable.m2_map_staton_icon),0.5f,0.9f)
}
fun updateStationsInfo(stations: MutableList<PM2Station>, i: Int, isArrived: Boolean){
if (stations.size == 0) return
if (0<= i && i<stations.size){
station_name_tv.setTextColor(resources.getColor(R.color.m2_line_name_tv_color))
station_name_tv.text = stations[i].name
}
if (isArrived){//到站
station_name_title_tv.text = resources.getString(R.string.m2_p_station_title_arrived_tv)
remain_mt.text = resources.getString(R.string.m2_p_empty_remain_km_minute)
}else{ //前往目的地中
station_name_title_tv.text = resources.getString(R.string.m2_p_station_title_tv)
}
}
/**
* 剩余里程和时间
*/
fun updateRemainMT(meters: Long, timeInSecond: Long) { //米。秒
var disUnit = "公里"
var remainDis: String? = "0"
if (meters > 0) {
if (meters / 1000 < 1) {
disUnit = ""
remainDis = meters.toFloat().roundToInt().toString()
} else {
disUnit = "公里"
remainDis = NumberFormatUtil.formatLong(meters.toDouble() / 1000)
}
}
val time = ceil(timeInSecond as Double / 60f).toInt()
"$remainDis$disUnit | $time 分钟".also { remain_mt.text = it }
}
companion object {

View File

@@ -181,7 +181,7 @@ class AdvanceVideoView @JvmOverloads constructor(
}
override fun onProgress(url: String?, length: Int) {
Logger.d(ImageAndVideoRotation.TAG, "download-onProgress")
// Logger.d(ImageAndVideoRotation.TAG, "download-onProgress")
}
override fun onFinished(url: String?, threadBean: ThreadBean?) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line">
<stroke android:color="@color/bus_dashed_line_color"
android:width="1dp" android:dashGap="4dp" android:dashWidth="4dp"/>
<size android:height="1dp"/>
</shape>

View File

@@ -79,7 +79,8 @@
app:day_light_mode="true"/>
<!-- 红绿灯-->
<com.mogo.och.bus.passenger.ui.widget.M2PTrafficLightView android:id="@+id/traffic_light_view"
<com.mogo.och.bus.passenger.ui.widget.M2PTrafficLightView
android:id="@+id/traffic_light_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_12"
@@ -97,8 +98,8 @@
<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_width="@dimen/dp_77"
android:layout_height="@dimen/dp_96"
android:layout_marginRight="@dimen/dp_20"
android:scaleType="fitXY"
app:layout_constraintTop_toTopOf="@+id/img_line_bg"
@@ -107,38 +108,37 @@
android:src="@drawable/m2_line_location_bg"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/line_name_tv"
android:id="@+id/station_name_title_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:text="--"
android:textSize="@dimen/dp_24"
android:text="@string/m2_p_station_title_tv"
android:textSize="@dimen/dp_18"
app:layout_constraintTop_toTopOf="@+id/img_line_location_bg"
app:layout_constraintLeft_toLeftOf="@+id/speed_tv"
android:textColor="@color/m2_line_name_tv_color"/>
android:textColor="@color/m2_line_during_tv_color"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/no_line_tv"
android:id="@+id/station_name_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:text="@string/m2_p_no_line"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toTopOf="@+id/img_line_location_bg"
app:layout_constraintBottom_toBottomOf="@+id/img_line_location_bg"
android:text="@string/m2_p_empty_tv"
android:textSize="@dimen/dp_22"
android:layout_marginTop="@dimen/dp_8"
app:layout_constraintTop_toBottomOf="@+id/station_name_title_tv"
app:layout_constraintLeft_toLeftOf="@+id/speed_tv"
android:textColor="@color/m2_no_line_tv_color"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/line_during_tv"
android:id="@+id/remain_mt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:textSize="@dimen/dp_18"
android:text="--"
app:layout_constraintLeft_toLeftOf="@+id/line_name_tv"
app:layout_constraintTop_toBottomOf="@+id/line_name_tv"
android:textColor="@color/m2_line_during_tv_color"/>
android:text="@string/m2_p_empty_remain_km_minute"
android:textSize="@dimen/dp_16"
android:layout_marginTop="@dimen/dp_8"
app:layout_constraintBottom_toBottomOf="@+id/img_line_location_bg"
app:layout_constraintLeft_toLeftOf="@+id/speed_tv"
android:textColor="@color/m2_no_line_tv_color"/>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/img_time_bg"
@@ -149,25 +149,57 @@
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"
<View
android:id="@+id/dashed_line"
android:layout_width="@dimen/dp_251"
android:layout_height="@dimen/dp_10"
android:background="@drawable/bg_dashed_line"
android:layout_marginTop="@dimen/dp_76"
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"/>
app:layout_constraintStart_toStartOf="@+id/speed_tv"
app:layout_constraintEnd_toEndOf="@+id/img_line_location_bg"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/no_line_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:text="@string/m2_p_no_line"
android:textSize="@dimen/dp_22"
app:layout_constraintTop_toTopOf="@+id/img_time_bg"
app:layout_constraintBottom_toBottomOf="@+id/dashed_line"
app:layout_constraintLeft_toLeftOf="@+id/speed_tv"
android:textColor="@color/m2_no_line_tv_color"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/line_name_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:layout_marginTop="@dimen/dp_16"
android:textSize="@dimen/dp_22"
app:layout_constraintTop_toTopOf="@+id/img_time_bg"
app:layout_constraintLeft_toLeftOf="@+id/speed_tv"
android:textColor="@color/m2_line_name_tv_color"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/line_during_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_4"
android:textSize="@dimen/dp_16"
app:layout_constraintLeft_toLeftOf="@+id/line_name_tv"
app:layout_constraintTop_toBottomOf="@+id/line_name_tv"
android:textColor="@color/m2_line_during_tv_color"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/current_time_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/dp_42"
android:textSize="@dimen/dp_36"
android:textStyle="bold"
android:text="--"
android:layout_marginTop="@dimen/dp_30"
app:layout_constraintTop_toTopOf="@+id/img_time_bg"
app:layout_constraintTop_toBottomOf="@+id/dashed_line"
app:layout_constraintLeft_toLeftOf="@+id/speed_tv"
android:textColor="@color/m2_current_time_tv_color"/>
@@ -175,9 +207,11 @@
android:id="@+id/current_weekday_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="@+id/current_time_tv"
app:layout_constraintTop_toBottomOf="@+id/current_time_tv"
android:textSize="@dimen/dp_18"
android:layout_marginLeft="@dimen/dp_10"
app:layout_constraintLeft_toRightOf="@+id/current_time_tv"
app:layout_constraintBottom_toBottomOf="@+id/current_time_tv"
android:layout_marginBottom="@dimen/dp_6"
android:textSize="@dimen/dp_16"
android:text="--"
android:textColor="@color/m2_line_during_tv_color"/>

View File

@@ -19,4 +19,5 @@
<color name="bus_traffic_light_yellow_color_up">#FFFFE198</color>
<color name="bus_traffic_light_yellow_color_down">#FFFF9B00</color>
<color name="bus_arrived_btn_un_clickable_color">#59FFFFFF</color>
<color name="bus_dashed_line_color">#979797</color>
</resources>

View File

@@ -14,5 +14,10 @@
<string name="m2_over_map_style_path">m2_map_style.data</string>
<string name="m2_over_map_style_extra_path">m2_map_style_extra.data</string>
<string name="m2_p_auto_tv">Auto</string>
<string name="m2_p_station_title_tv">下一站:</string>
<string name="m2_p_station_title_arrived_tv">已到站:</string>
<string name="m2_p_empty_tv">暂无站点</string>
<string name="m2_p_empty_remain_km_minute">—公里 | —分钟</string>
</resources>

View File

@@ -428,8 +428,6 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
}
private void changeAutopilotBtnView(int autopilotStatus, boolean isAnimateRunning) {
CallerLogger.INSTANCE.d(M_BUS + TAG, "onStateChangeChangeAutopilotBtnView: "
+ autopilotStatus + "isAnimateRunning = " + isAnimateRunning);
if (isAnimateRunning && IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
!= autopilotStatus) {
// 主动开启自动驾驶中不为2为0、1则继续loading