[6.2.6]
[taxi-u-p] [路程信息]
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
package com.mogo.och.taxi.passenger;
|
||||
|
||||
import androidx.annotation.IdRes;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author congtaowang
|
||||
* @since 2021/1/15
|
||||
*
|
||||
* 网约车抽象接口
|
||||
*/
|
||||
public interface IMogoOCH extends IMoGoFunctionProvider {
|
||||
|
||||
/**
|
||||
* 初始化网约车容器
|
||||
*
|
||||
* @param activity
|
||||
* @param containerId 容器ID
|
||||
*/
|
||||
void createCoverage(FragmentActivity activity, @IdRes int containerId);
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider;
|
||||
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.och.taxi.passenger.constant.TaxiPassengerConst;
|
||||
@@ -24,7 +25,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
* 网约车-出租车-乘客端
|
||||
*/
|
||||
@Route(path = TaxiPassengerConst.PATH)
|
||||
public class MogoOCHTaxiPassenger implements IMogoOCH {
|
||||
public class MogoOCHTaxiPassenger implements IMoGoFunctionProvider {
|
||||
|
||||
private static final String TAG = "MogoOCHTaxiPassenger";
|
||||
private TaxiPassengerBaseFragment ochTaxiPassengerFragment;
|
||||
@@ -70,11 +71,6 @@ public class MogoOCHTaxiPassenger implements IMogoOCH {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createCoverage(FragmentActivity activity, int containerId) {
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getFunctionName() {
|
||||
|
||||
@@ -5,6 +5,9 @@ import android.graphics.drawable.GradientDrawable
|
||||
import android.graphics.drawable.LayerDrawable
|
||||
import android.graphics.drawable.ScaleDrawable
|
||||
import android.os.Build
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.os.Message
|
||||
import android.util.AttributeSet
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
@@ -12,12 +15,12 @@ import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.findViewTreeViewModelStoreOwner
|
||||
import com.mogo.och.common.module.utils.RxUtils
|
||||
import com.mogo.och.taxi.passenger.R
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_itinerary.view.actv_arrived_time
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_itinerary.view.actv_distance
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_itinerary.view.actv_distance_unit
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_itinerary.view.actv_endstation
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_itinerary.view.actv_speed_value
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_itinerary.view.actv_surplus_time
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_itinerary.view.actv_surplus_time_unit
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_itinerary.view.progress_distance
|
||||
@@ -60,7 +63,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 +89,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)}…"
|
||||
|
||||
@@ -17,8 +17,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
|
||||
|
||||
@@ -31,7 +30,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)
|
||||
}
|
||||
|
||||
@@ -45,22 +43,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: TaxiPassengerOrdersInServiceQueryRespBean.OrderBean?) {
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.mogo.och.taxi.passenger.ui.speed
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
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.och.taxi.passenger.R
|
||||
|
||||
class SpeedView : ConstraintLayout, IMoGoChassisLocationGCJ02Listener {
|
||||
|
||||
private val TAG = "ItineraryView"
|
||||
|
||||
constructor(context: Context) : super(context)
|
||||
|
||||
constructor(context: Context, attributeSet: AttributeSet) : super(context, attributeSet)
|
||||
|
||||
constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int) : super(context, attributeSet, defStyleAttr)
|
||||
|
||||
constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attributeSet, defStyleAttr, defStyleRes)
|
||||
|
||||
private fun initView() {
|
||||
LayoutInflater.from(context).inflate(R.layout.taxt_u_p_speed, this, true)
|
||||
}
|
||||
|
||||
override fun onVisibilityAggregated(isVisible: Boolean) {
|
||||
super.onVisibilityAggregated(isVisible)
|
||||
if(isVisible){
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 4, this)
|
||||
}else{
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
try {
|
||||
initView()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onChassisLocationGCJ02(mogoLocation: MogoLocation?) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 272 KiB |
@@ -48,6 +48,15 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:pnc_size="@dimen/dp_44" />
|
||||
|
||||
<com.mogo.och.taxi.passenger.ui.speed.SpeedView
|
||||
android:id="@+id/speedView"
|
||||
android:layout_width="@dimen/dp_240"
|
||||
android:layout_height="@dimen/dp_120"
|
||||
android:layout_marginTop="@dimen/dp_100"
|
||||
android:layout_marginStart="@dimen/dp_50"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/ck_setting"
|
||||
android:layout_width="@dimen/dp_120"
|
||||
@@ -56,7 +65,7 @@
|
||||
android:layout_marginTop="@dimen/dp_100"
|
||||
android:background="@drawable/taxt_u_p_setting_selector"
|
||||
android:button="@null"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/speedView"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.mogo.och.taxi.passenger.ui.systemsetting.TaxiPSettingView
|
||||
@@ -73,10 +82,10 @@
|
||||
android:id="@+id/romaPView"
|
||||
android:layout_width="@dimen/dp_120"
|
||||
android:layout_height="@dimen/dp_120"
|
||||
android:layout_marginStart="@dimen/dp_220"
|
||||
android:layout_marginStart="@dimen/dp_60"
|
||||
android:layout_marginTop="100dp"
|
||||
android:background="@drawable/taxt_u_p_roma_bg_selector"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/ck_setting"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:roma_close="@drawable/taxt_u_p_roma_bg_selector"
|
||||
app:roma_open="@drawable/taxt_u_p_roma_checked" />
|
||||
|
||||
@@ -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/taxt_u_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/taxt_u_p_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"
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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_240"
|
||||
android:layout_height="@dimen/dp_120"
|
||||
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
|
||||
|
||||
|
||||
<View
|
||||
android:id="@+id/v_bottom_bg"
|
||||
android:layout_width="@dimen/dp_240"
|
||||
android:layout_height="@dimen/dp_120"
|
||||
android:background="@drawable/taxi_u_p_speed_bg"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_speed_value"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/taxi_p_203555"
|
||||
android:textSize="@dimen/dp_78"
|
||||
android:layout_marginEnd="@dimen/dp_6"
|
||||
android:fontFamily="@font/taxt_u_p_din"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/actv_speed_unit"
|
||||
android:text="68" />
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_speed_unit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/taxi_p_203555"
|
||||
android:layout_marginStart="@dimen/dp_6"
|
||||
android:textSize="@dimen/dp_32"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/actv_speed_value"
|
||||
android:fontFamily="@font/taxt_u_p_din"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/actv_speed_value"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:text="KM/h" />
|
||||
|
||||
</merge>
|
||||
Reference in New Issue
Block a user