[6.2.6]
[taxi-p] [itinerary and speed]
This commit is contained in:
@@ -17,7 +17,6 @@ import kotlinx.android.synthetic.main.taxi_p_itinerary.view.actv_arrived_time
|
||||
import kotlinx.android.synthetic.main.taxi_p_itinerary.view.actv_distance
|
||||
import kotlinx.android.synthetic.main.taxi_p_itinerary.view.actv_distance_unit
|
||||
import kotlinx.android.synthetic.main.taxi_p_itinerary.view.actv_endstation
|
||||
import kotlinx.android.synthetic.main.taxi_p_itinerary.view.actv_speed_value
|
||||
import kotlinx.android.synthetic.main.taxi_p_itinerary.view.actv_surplus_time
|
||||
import kotlinx.android.synthetic.main.taxi_p_itinerary.view.actv_surplus_time_unit
|
||||
import kotlinx.android.synthetic.main.taxi_p_itinerary.view.progress_distance
|
||||
@@ -60,7 +59,7 @@ class ItineraryView : ConstraintLayout, OrderInfoViewModel.ItineraryViewCallback
|
||||
val setondColor = ContextCompat.getColor(context, R.color.taxi_p_44C8FF)
|
||||
val thirdColor = ContextCompat.getColor(context, R.color.taxi_p_8AE4ED)
|
||||
val fourceColor = ContextCompat.getColor(context, R.color.taxi_p_C8F3F4)
|
||||
val bottomColor = ContextCompat.getColor(context, R.color.taxi_p_66476FBE)
|
||||
val bottomColor = ContextCompat.getColor(context, android.R.color.transparent)
|
||||
gradientDrawable.colors = intArrayOf(firstColor, setondColor, thirdColor, fourceColor)
|
||||
gradientDrawable.orientation = GradientDrawable.Orientation.LEFT_RIGHT
|
||||
|
||||
@@ -86,9 +85,6 @@ class ItineraryView : ConstraintLayout, OrderInfoViewModel.ItineraryViewCallback
|
||||
viewModel?.setDistanceCallback(this)
|
||||
}
|
||||
|
||||
override fun setSpeed(speedValue:String){
|
||||
actv_speed_value.text = speedValue
|
||||
}
|
||||
override fun setEndStation(endStation:String){
|
||||
if(endStation.length>9){
|
||||
actv_endstation.text = "${endStation.subSequence(0,9)}…"
|
||||
|
||||
@@ -2,9 +2,6 @@ package com.mogo.och.taxi.passenger.ui.orderinfo
|
||||
|
||||
import androidx.lifecycle.ViewModel
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil
|
||||
import com.mogo.och.common.module.utils.NumberFormatUtil
|
||||
@@ -16,8 +13,7 @@ import com.mogo.och.taxi.passenger.model.TaxiPassengerModel
|
||||
import kotlin.math.abs
|
||||
import kotlin.math.ceil
|
||||
|
||||
class OrderInfoViewModel: ViewModel(), IMoGoChassisLocationGCJ02Listener,
|
||||
IOCHTaxiPassengerOrderStatusCallback {
|
||||
class OrderInfoViewModel: ViewModel(), IOCHTaxiPassengerOrderStatusCallback {
|
||||
|
||||
private val TAG = OrderInfoViewModel::class.java.simpleName
|
||||
|
||||
@@ -30,7 +26,6 @@ class OrderInfoViewModel: ViewModel(), IMoGoChassisLocationGCJ02Listener,
|
||||
disUnit = AbsMogoApplication.getApp().getString(R.string.taxi_p_distance_unit_km)
|
||||
surplusTimeUnit = AbsMogoApplication.getApp().getString(R.string.taxi_p_surplustime)
|
||||
// 设置起点和终点marker和实时车辆位置
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 4, this)
|
||||
TaxiPassengerModel.setOrderStatusCallback(TAG,this)
|
||||
}
|
||||
|
||||
@@ -44,22 +39,12 @@ class OrderInfoViewModel: ViewModel(), IMoGoChassisLocationGCJ02Listener,
|
||||
TaxiPassengerModel.setOrderStatusCallback(TAG,null)
|
||||
}
|
||||
|
||||
override fun onChassisLocationGCJ02(mogoLocation: MogoLocation?) {
|
||||
mogoLocation?.let {
|
||||
UiThreadHandler.post {
|
||||
val speedKM = (abs(it.gnssSpeed) * 3.6f).toInt()
|
||||
viewCallback?.setSpeed(speedKM.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface ItineraryViewCallback{
|
||||
fun setDistanceInfo(surplusdistance:String,distanceUnit:String,
|
||||
surplusTime:String,surplusTimeUnit:String,
|
||||
arrivedTime:String,alreadyGone:Int,distance:Int
|
||||
)
|
||||
fun setEndStation(endStation:String)
|
||||
fun setSpeed(speedValue:String)
|
||||
}
|
||||
|
||||
override fun onCurrentOrderStatusChanged(order: TaxiPassengerOrderQueryRespBean.Result?) {
|
||||
|
||||
@@ -8,7 +8,10 @@ import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.taxi.passenger.R
|
||||
import kotlinx.android.synthetic.main.taxt_p_speed.view.actv_speed_value
|
||||
import kotlin.math.abs
|
||||
|
||||
class SpeedView : ConstraintLayout, IMoGoChassisLocationGCJ02Listener {
|
||||
|
||||
@@ -44,7 +47,12 @@ class SpeedView : ConstraintLayout, IMoGoChassisLocationGCJ02Listener {
|
||||
}
|
||||
|
||||
override fun onChassisLocationGCJ02(mogoLocation: MogoLocation?) {
|
||||
|
||||
mogoLocation?.let {
|
||||
UiThreadHandler.post {
|
||||
val speedKM = (abs(it.gnssSpeed) * 3.6f).toInt()
|
||||
actv_speed_value.text = speedKM.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 272 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 272 KiB |
@@ -2,81 +2,60 @@
|
||||
<merge 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="@dimen/dp_842"
|
||||
android:layout_height="@dimen/dp_510"
|
||||
android:layout_width="@dimen/dp_866"
|
||||
android:layout_height="@dimen/dp_467"
|
||||
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
|
||||
|
||||
|
||||
<View
|
||||
android:id="@+id/v_bottom_bg"
|
||||
android:layout_width="@dimen/dp_842"
|
||||
android:layout_height="@dimen/dp_466"
|
||||
android:layout_marginTop="@dimen/dp_44"
|
||||
android:layout_width="@dimen/dp_866"
|
||||
android:layout_height="@dimen/dp_467"
|
||||
android:background="@drawable/taxi_p_itinerary_bg"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_speed_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_90"
|
||||
android:textColor="@color/taxi_p_203555"
|
||||
android:textSize="@dimen/dp_150"
|
||||
android:fontFamily="@font/din"
|
||||
android:textScaleX="0.9"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:text="68" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_speed_unit"
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/gl_horizontal_top"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_begin="@dimen/dp_50"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/taxi_p_203555"
|
||||
android:textSize="@dimen/dp_35"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/actv_speed_value"
|
||||
app:layout_constraintStart_toEndOf="@+id/actv_speed_value"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:text="KM/H" />
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_endstation"
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/gl_horizontal_center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_begin="@dimen/dp_163"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_90"
|
||||
android:maxLength="10"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/taxi_p_293449"
|
||||
android:textSize="@dimen/dp_35"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/actv_speed_unit"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/actv_speed_unit"
|
||||
android:text="--" />
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_endstation_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
android:layout_marginStart="@dimen/dp_93"
|
||||
android:textColor="@color/taxi_p_004DC4"
|
||||
android:textSize="@dimen/dp_35"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/actv_speed_unit"
|
||||
app:layout_constraintEnd_toStartOf="@+id/actv_endstation"
|
||||
app:layout_constraintTop_toTopOf="@+id/actv_speed_unit"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/gl_horizontal_top"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/gl_horizontal_center"
|
||||
android:text="前往" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_endstation"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLength="10"
|
||||
android:maxLines="1"
|
||||
android:layout_marginStart="@dimen/dp_7"
|
||||
android:textColor="@color/taxi_p_293449"
|
||||
android:textSize="@dimen/dp_35"
|
||||
app:layout_constraintTop_toTopOf="@+id/gl_horizontal_top"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/gl_horizontal_center"
|
||||
app:layout_constraintStart_toEndOf="@+id/actv_endstation_title"
|
||||
android:text="--" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/taxi_p_B37E90BF"
|
||||
android:layout_marginTop="-15dp"
|
||||
app:layout_constraintEnd_toEndOf="@+id/actv_endstation"
|
||||
app:layout_constraintStart_toStartOf="@+id/actv_speed_value"
|
||||
app:layout_constraintTop_toBottomOf="@+id/actv_speed_value" />
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
@@ -164,7 +143,7 @@
|
||||
android:layout_height="@dimen/dp_20"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginBottom="@dimen/dp_66"
|
||||
android:layout_marginStart="@dimen/dp_58"
|
||||
android:layout_marginStart="@dimen/dp_38"
|
||||
android:layout_marginEnd="@dimen/dp_58"
|
||||
android:progress="20"
|
||||
android:maxHeight="@dimen/dp_10"
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/actv_speed_unit"
|
||||
android:text="68" />
|
||||
android:text="--" />
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_speed_unit"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -8,7 +8,10 @@ import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.taxi.passenger.R
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_speed.view.actv_speed_value
|
||||
import kotlin.math.abs
|
||||
|
||||
class SpeedView : ConstraintLayout, IMoGoChassisLocationGCJ02Listener {
|
||||
|
||||
@@ -44,7 +47,12 @@ class SpeedView : ConstraintLayout, IMoGoChassisLocationGCJ02Listener {
|
||||
}
|
||||
|
||||
override fun onChassisLocationGCJ02(mogoLocation: MogoLocation?) {
|
||||
|
||||
mogoLocation?.let {
|
||||
UiThreadHandler.post {
|
||||
val speedKM = (abs(it.gnssSpeed) * 3.6f).toInt()
|
||||
actv_speed_value.text = speedKM.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/actv_speed_unit"
|
||||
android:text="68" />
|
||||
android:text="--" />
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_speed_unit"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
Reference in New Issue
Block a user