[m2]
[3.0.0] [页面改版]
@@ -1,6 +1,7 @@
|
||||
package com.mogo.och.bus.passenger.presenter
|
||||
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import com.amap.api.maps.model.LatLng
|
||||
import com.mogo.commons.mvp.Presenter
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
@@ -81,8 +82,29 @@ class PM2DrivingPresenter(view: PM2DrivingInfoFragment?) :
|
||||
}
|
||||
|
||||
override fun updateLineStations(stations: MutableList<PM2Station>) {
|
||||
|
||||
val stationsList = mutableListOf<LatLng>()
|
||||
val stationsListPass = mutableListOf<LatLng>()
|
||||
|
||||
for (i in stations.indices){
|
||||
val station = stations[i]
|
||||
val latLng = LatLng(station.gcjLat,station.gcjLon)
|
||||
if(station.drivingStatus==1){//行驶信息,0初始值;1已经过;2当前站;3未到站
|
||||
stationsListPass.add(latLng)
|
||||
}else if(station.drivingStatus==2){
|
||||
if(station.isLeaving){
|
||||
stationsListPass.add(latLng)
|
||||
}else{
|
||||
stationsList.add(latLng)
|
||||
}
|
||||
}else{
|
||||
stationsList.add(latLng)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ThreadUtils.runOnUiThread {
|
||||
mView?.updateLineStations(stations)
|
||||
mView?.updateLineStations(stationsList,stationsListPass)
|
||||
}
|
||||
PM2ADASModel.INSTANCE.updateHDMapStations(stations)
|
||||
}
|
||||
|
||||
@@ -55,6 +55,12 @@ class PM2DrivingInfoFragment :
|
||||
|
||||
line_name_tv.setTextColor(resources.getColor(R.color.m2_line_name_tv_color))
|
||||
station_name_tv.setTextColor(resources.getColor(R.color.m2_line_name_tv_color))
|
||||
speed_tv.setVertrial(true)
|
||||
val intArrayOf = intArrayOf(
|
||||
requireContext().resources.getColor(R.color.shuttle_color_43cefe),
|
||||
requireContext().resources.getColor(R.color.shuttle_color_1466fb)
|
||||
)
|
||||
speed_tv.setmColorList(intArrayOf)
|
||||
|
||||
// current_time_tv.onClick {
|
||||
|
||||
@@ -163,6 +169,7 @@ class PM2DrivingInfoFragment :
|
||||
station_name_tv.text = resources.getString(R.string.m2_p_empty_tv)
|
||||
tv_distance.text = resources.getString(R.string.m2_p_empty_remain_km)
|
||||
tv_left_time.text = resources.getString(R.string.m2_p_empty_remain_minute)
|
||||
noLineShow()
|
||||
}
|
||||
|
||||
override fun createPresenter(): PM2DrivingPresenter {
|
||||
@@ -179,16 +186,12 @@ class PM2DrivingInfoFragment :
|
||||
}
|
||||
}
|
||||
|
||||
fun updateLineStations(stations: MutableList<PM2Station>){
|
||||
var stationsList = mutableListOf<LatLng>()
|
||||
for (i in stations.indices){
|
||||
val station = stations[i]
|
||||
var latLng = LatLng(station.gcjLat,station.gcjLon)
|
||||
stationsList.add(latLng)
|
||||
}
|
||||
fun updateLineStations(stations: MutableList<LatLng>,stationsPass: MutableList<LatLng>){
|
||||
overMapView?.let {
|
||||
it.drawSiteMarkers(stationsList,
|
||||
BitmapFactory.decodeResource(resources,R.drawable.m2_map_staton_icon),0.5f,0.9f)
|
||||
it.drawSiteMarkers(stations,
|
||||
BitmapFactory.decodeResource(resources,R.drawable.m2_map_staton_icon),0.5f,0.5f)
|
||||
it.drawSiteMarkers(stationsPass,
|
||||
BitmapFactory.decodeResource(resources,R.drawable.m2_map_staton_arrived_icon),0.5f,0.5f)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,12 +205,10 @@ class PM2DrivingInfoFragment :
|
||||
tv_distance.text = resources.getString(R.string.m2_p_empty_remain_km)
|
||||
tv_left_time.text = resources.getString(R.string.m2_p_empty_remain_minute)
|
||||
tv_next_station_title.text = resources.getString(R.string.m2_p_station_title_arrived_tv)
|
||||
tv_arrived_notice.visibility = View.VISIBLE
|
||||
clg_distance_left_time.visibility = View.GONE
|
||||
haveLineAndArrivedStation()
|
||||
}else{ //前往目的地中
|
||||
tv_next_station_title.text = resources.getString(R.string.shuttle_p_next_station_title)
|
||||
tv_arrived_notice.visibility = View.GONE
|
||||
clg_distance_left_time.visibility = View.VISIBLE
|
||||
haveLineAndArriveingStation()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -234,6 +235,31 @@ class PM2DrivingInfoFragment :
|
||||
"$time 分钟".also { tv_left_time.text = it }
|
||||
}
|
||||
|
||||
fun noLineShow(){
|
||||
// 没有线路展示
|
||||
group_not_select_line.visibility = View.VISIBLE
|
||||
// 下一个站点
|
||||
group_stationinfo.visibility = View.GONE
|
||||
// 距离和剩余大概时间
|
||||
clg_distance_left_time.visibility = View.GONE
|
||||
// 到达站点
|
||||
tv_arrived_notice.visibility = View.GONE
|
||||
}
|
||||
// 有线路正在到站点
|
||||
fun haveLineAndArriveingStation(){
|
||||
group_not_select_line.visibility = View.GONE
|
||||
group_stationinfo.visibility = View.VISIBLE
|
||||
clg_distance_left_time.visibility = View.VISIBLE
|
||||
tv_arrived_notice.visibility = View.GONE
|
||||
}
|
||||
// 有线路到达站点
|
||||
fun haveLineAndArrivedStation(){
|
||||
group_not_select_line.visibility = View.GONE
|
||||
group_stationinfo.visibility = View.VISIBLE
|
||||
clg_distance_left_time.visibility = View.GONE
|
||||
tv_arrived_notice.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val TAG = PM2DrivingInfoFragment::class.java.simpleName
|
||||
const val LOOP_TIME_TEXT = 10 * 1000L
|
||||
|
||||
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 973 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1018 B |
@@ -62,7 +62,7 @@
|
||||
android:maxWidth="@dimen/dp_600"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/m2_line_name_tv_color"
|
||||
android:textSize="@dimen/dp_20"
|
||||
android:textSize="@dimen/dp_26"
|
||||
android:textStyle="bold"
|
||||
app:customGap="0.2"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_line_name_container"
|
||||
@@ -123,20 +123,21 @@
|
||||
|
||||
<com.mogo.och.common.module.wigets.MarqueeTextView
|
||||
android:id="@+id/station_name_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_18"
|
||||
android:ellipsize="marquee"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:gravity="left"
|
||||
android:singleLine="true"
|
||||
android:text="@string/m2_p_empty_tv"
|
||||
android:textColor="@color/m2_line_name_tv_color"
|
||||
android:textSize="@dimen/dp_22"
|
||||
android:textColor="@color/shuttle_color_17417B"
|
||||
android:textSize="@dimen/dp_34"
|
||||
android:textStyle="bold"
|
||||
app:customGap="0.2"
|
||||
app:layout_constraintEnd_toEndOf="@+id/cl_left_container"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_next_station_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_next_station_title"
|
||||
app:layout_constraintEnd_toEndOf="@+id/cl_left_container"
|
||||
app:useCustomGap="true" />
|
||||
|
||||
<!-- region 到下一站距离和时间 -->
|
||||
@@ -152,6 +153,7 @@
|
||||
android:id="@+id/bg_distance_lefttime"
|
||||
android:layout_width="@dimen/dp_182"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:layout_marginTop="@dimen/dp_22"
|
||||
android:background="@drawable/bg_driving_distance_lefttime"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_next_station_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/station_name_tv" />
|
||||
@@ -200,6 +202,7 @@
|
||||
android:gravity="center"
|
||||
android:text="@string/m2_p_arrived_station_title"
|
||||
android:textColor="@color/shuttle_color_1f860d"
|
||||
android:layout_marginTop="@dimen/dp_22"
|
||||
android:textSize="@dimen/dp_18"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_next_station_title"
|
||||
@@ -219,13 +222,13 @@
|
||||
|
||||
|
||||
<!-- 行车卡片-->
|
||||
<TextView
|
||||
<com.mogo.och.common.module.wigets.OCHGradientTextView
|
||||
android:id="@+id/speed_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_50"
|
||||
android:layout_marginTop="@dimen/dp_27"
|
||||
android:text="--"
|
||||
android:text="60"
|
||||
android:textColor="@color/m2_p_speed_tv_color"
|
||||
android:textSize="@dimen/dp_60"
|
||||
android:textStyle="bold"
|
||||
@@ -253,9 +256,10 @@
|
||||
android:gravity="center"
|
||||
android:text="@string/m2_p_auto_tv"
|
||||
android:textColor="@color/m2_button_auto_tv_color"
|
||||
android:layout_marginBottom="@dimen/dp_34"
|
||||
android:textSize="@dimen/dp_18"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/speed_tv"
|
||||
app:layout_constraintTop_toBottomOf="@+id/speed_tv" />
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
<!-- 转向灯 IMoGoChassisLamplightListener-->
|
||||
<com.mogo.och.bus.passenger.ui.widget.M2TurnLightView
|
||||
@@ -308,22 +312,21 @@
|
||||
android:format12Hour="HH:mm"
|
||||
android:format24Hour="HH:mm"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:layout_marginTop="@dimen/dp_25"
|
||||
app:layout_constraintTop_toTopOf="@+id/aciv_speed_time_bg"
|
||||
app:layout_constraintStart_toEndOf="@+id/view_split"
|
||||
android:layout_marginEnd="@dimen/dp_90"
|
||||
android:textColor="@color/shuttle_color_17417B"
|
||||
android:includeFontPadding="false"
|
||||
android:textSize="@dimen/dp_46"
|
||||
android:textStyle="bold" />
|
||||
android:textSize="@dimen/dp_46" />
|
||||
|
||||
<TextClock
|
||||
android:layout_marginStart="@dimen/dp_21"
|
||||
android:id="@+id/viewTextClockDate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:format12Hour="yyyy年MM月dd日 EEEE"
|
||||
android:format24Hour="yyyy年MM月dd日 EEEE"
|
||||
android:format12Hour="yyyy年MM月dd日"
|
||||
android:format24Hour="yyyy年MM月dd日"
|
||||
android:gravity="center"
|
||||
app:layout_constraintBottom_toTopOf="@+id/viewTextClockWeek"
|
||||
app:layout_constraintStart_toEndOf="@+id/view_split"
|
||||
|
||||
@@ -33,4 +33,6 @@
|
||||
<color name="shuttle_color_2d3e5f">#2D3E5F</color>
|
||||
<color name="shuttle_color_1f860d">#1F860D</color>
|
||||
<color name="shuttle_color_b9e7c0">#B9E7C0</color>
|
||||
<color name="shuttle_color_43cefe">#43CEFE</color>
|
||||
<color name="shuttle_color_1466fb">#1466FB</color>
|
||||
</resources>
|
||||