[3.4.0]
[车门图标]
This commit is contained in:
@@ -137,8 +137,6 @@ class TaxiPassengerBaseFragment() :
|
||||
// 切换缩放到中视角
|
||||
controller.changeZoom2(0.8f)
|
||||
}
|
||||
// showOrHideArrivedEndLayout(true)
|
||||
showOrHideStartAutopilotView(true)
|
||||
}
|
||||
BottomBar.SelectView.OVERMAPVIEW -> {
|
||||
overMapView.displayCustomOverView()
|
||||
|
||||
@@ -4,14 +4,15 @@ import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.OverlayViewUtils
|
||||
import com.mogo.och.common.module.utils.RxUtils
|
||||
import com.mogo.och.taxi.passenger.R
|
||||
import com.mogo.och.taxi.passenger.callback.ITaxiPassengerCommonCallback
|
||||
import com.mogo.och.taxi.passenger.widget.WindowRelativeLayout
|
||||
import com.shuyu.gsyvideoplayer.GSYVideoManager
|
||||
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
|
||||
import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack
|
||||
import io.reactivex.disposables.Disposable
|
||||
@@ -39,9 +40,6 @@ class ArrivedView : WindowRelativeLayout, ArrivedViewModel.ArrivedViewCallback {
|
||||
|
||||
private val gsyVideoOptionBuilder = GSYVideoOptionBuilder()
|
||||
|
||||
|
||||
var taxiPassengerCommonCallback: ITaxiPassengerCommonCallback?=null
|
||||
|
||||
private fun initView() {
|
||||
d(SceneConstant.M_TAXI_P + TAG, "initView")
|
||||
LayoutInflater.from(context).inflate(R.layout.taxi_p_arrived_end_panel, this, true)
|
||||
@@ -50,7 +48,7 @@ class ArrivedView : WindowRelativeLayout, ArrivedViewModel.ArrivedViewCallback {
|
||||
svp_frame.setIsTouchWigetFull(false)
|
||||
svp_frame.enableshowProgressDialog = false
|
||||
svp_frame.enableDoubleClick = false
|
||||
|
||||
GSYVideoManager.instance().enableRawPlay(AbsMogoApplication.getApp())
|
||||
val url = "android.resource://" + context.packageName + "/" + R.raw.end_video
|
||||
gsyVideoOptionBuilder.setUrl(url)
|
||||
.setCacheWithPlay(false)
|
||||
|
||||
@@ -13,7 +13,11 @@ import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.common.module.utils.AnimatorDrawableUtil
|
||||
import com.mogo.och.taxi.passenger.R
|
||||
import com.mogo.och.taxi.passenger.widget.WindowRelativeLayout
|
||||
import kotlinx.android.synthetic.main.taxi_p_start_autopilot_view.view.actv_front_left_door
|
||||
import kotlinx.android.synthetic.main.taxi_p_start_autopilot_view.view.actv_front_right_door
|
||||
import kotlinx.android.synthetic.main.taxi_p_start_autopilot_view.view.actv_orderinfo
|
||||
import kotlinx.android.synthetic.main.taxi_p_start_autopilot_view.view.actv_rear_left_door
|
||||
import kotlinx.android.synthetic.main.taxi_p_start_autopilot_view.view.actv_rear_right_door
|
||||
import kotlinx.android.synthetic.main.taxi_p_start_autopilot_view.view.starting_autopilot_view_close
|
||||
import kotlinx.android.synthetic.main.taxi_p_start_autopilot_view.view.taxi_p_autopilot_btn_bg
|
||||
import kotlinx.android.synthetic.main.taxi_p_start_autopilot_view.view.taxi_p_autopilot_starting
|
||||
@@ -106,6 +110,45 @@ class StartAutopilotView : WindowRelativeLayout, StartAutopilotViewModel.StartAu
|
||||
actv_orderinfo.text = show
|
||||
}
|
||||
|
||||
override fun setDoorStatus(
|
||||
doorPosition: StartAutopilotViewModel.DoorPosition,
|
||||
isOpen: Boolean
|
||||
) {
|
||||
when (doorPosition) {
|
||||
StartAutopilotViewModel.DoorPosition.FRONT_LEFT -> {
|
||||
if(isOpen){
|
||||
actv_front_left_door.visibility = VISIBLE
|
||||
}else{
|
||||
actv_front_left_door.visibility = GONE
|
||||
}
|
||||
}
|
||||
StartAutopilotViewModel.DoorPosition.FRONT_RIGHT -> {
|
||||
if(isOpen){
|
||||
actv_front_right_door.visibility = VISIBLE
|
||||
}else{
|
||||
actv_front_right_door.visibility = GONE
|
||||
}
|
||||
}
|
||||
StartAutopilotViewModel.DoorPosition.REAR_LEFT -> {
|
||||
if(isOpen){
|
||||
actv_rear_left_door.visibility = VISIBLE
|
||||
}else{
|
||||
actv_rear_left_door.visibility = GONE
|
||||
}
|
||||
}
|
||||
StartAutopilotViewModel.DoorPosition.REAR_RIGHT -> {
|
||||
if(isOpen){
|
||||
actv_rear_right_door.visibility = VISIBLE
|
||||
}else{
|
||||
actv_rear_right_door.visibility = GONE
|
||||
}
|
||||
}
|
||||
else ->{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun closeAllAnimsAndView() {
|
||||
isStarting = false
|
||||
clearStartingAnimFrame()
|
||||
|
||||
@@ -1,40 +1,77 @@
|
||||
package com.mogo.och.taxi.passenger.ui.startautopilot
|
||||
|
||||
import androidx.lifecycle.ViewModel
|
||||
import chassis.Chassis
|
||||
import chassis.Chassis.DoorNumber
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisDoorStateListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisDoorStateListenerManager
|
||||
import com.mogo.och.taxi.passenger.callback.IOCHTaxiPassengerOrderStatusCallback
|
||||
import com.mogo.och.taxi.passenger.model.AutopilotManager
|
||||
import com.mogo.och.taxi.passenger.model.TaxiPassengerModel
|
||||
|
||||
class StartAutopilotViewModel: ViewModel(), IOCHTaxiPassengerOrderStatusCallback {
|
||||
class StartAutopilotViewModel : ViewModel(), IOCHTaxiPassengerOrderStatusCallback,
|
||||
IMoGoChassisDoorStateListener {
|
||||
|
||||
private val TAG = StartAutopilotViewModel::class.java.simpleName
|
||||
|
||||
private var viewCallback:StartAutopilotCallback?=null
|
||||
private var viewCallback: StartAutopilotCallback? = null
|
||||
|
||||
init {
|
||||
TaxiPassengerModel.setOrderStatusCallback(TAG,this)
|
||||
TaxiPassengerModel.setOrderStatusCallback(TAG, this)
|
||||
CallerChassisDoorStateListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
fun setStartAutopilotCallback(viewCallback:StartAutopilotCallback){
|
||||
this.viewCallback = viewCallback
|
||||
TaxiPassengerModel.startOrStopReadyToAutopilotLoop(true)
|
||||
setOrderInfo()
|
||||
}
|
||||
fun setStartAutopilotCallback(viewCallback: StartAutopilotCallback) {
|
||||
this.viewCallback = viewCallback
|
||||
TaxiPassengerModel.startOrStopReadyToAutopilotLoop(true)
|
||||
setOrderInfo()
|
||||
setDoorInfo()
|
||||
}
|
||||
|
||||
private fun setDoorInfo() {
|
||||
val doorList = CallerChassisDoorStateListenerManager.getDoorList()
|
||||
|
||||
doorList?.forEach {
|
||||
when (it.number) {
|
||||
DoorNumber.FRONT_LEFT -> {
|
||||
viewCallback?.setDoorStatus(DoorPosition.FRONT_LEFT,it.status==1)
|
||||
}
|
||||
|
||||
DoorNumber.FRONT_RIGHT -> {
|
||||
viewCallback?.setDoorStatus(DoorPosition.FRONT_RIGHT,it.status==1)
|
||||
}
|
||||
|
||||
DoorNumber.REAR_LEFT -> {
|
||||
viewCallback?.setDoorStatus(DoorPosition.REAR_LEFT,it.status==1)
|
||||
}
|
||||
|
||||
DoorNumber.REAR_RIGHT -> {
|
||||
viewCallback?.setDoorStatus(DoorPosition.REAR_RIGHT,it.status==1)
|
||||
}
|
||||
|
||||
DoorNumber.MIDDLE -> {
|
||||
viewCallback?.setDoorStatus(DoorPosition.MIDDLE,it.status==1)
|
||||
}
|
||||
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun setOrderInfo() {
|
||||
val currentOCHOrder = TaxiPassengerModel.currentOCHOrder
|
||||
currentOCHOrder?.let {
|
||||
val phone = it.passengerPhone
|
||||
var show = ""
|
||||
if(phone.length>8) {
|
||||
if (phone.length > 8) {
|
||||
//截取电话号码前三位
|
||||
val phoneNumPre = phone.substring(0, 3);
|
||||
//截取电话号码后四位
|
||||
val phoneNumFix = phone.substring(7);
|
||||
|
||||
show ="用户:$phoneNumPre****$phoneNumFix 目的地:${it.endSiteAddr}"
|
||||
}else{
|
||||
show ="用户:${phone} 目的地:${it.endSiteAddr}"
|
||||
show = "用户:$phoneNumPre****$phoneNumFix 目的地:${it.endSiteAddr}"
|
||||
} else {
|
||||
show = "用户:${phone} 目的地:${it.endSiteAddr}"
|
||||
}
|
||||
viewCallback?.setOrderInfo(show)
|
||||
}
|
||||
@@ -43,7 +80,7 @@ class StartAutopilotViewModel: ViewModel(), IOCHTaxiPassengerOrderStatusCallback
|
||||
override fun onCleared() {
|
||||
super.onCleared()
|
||||
this.viewCallback = null
|
||||
TaxiPassengerModel.setOrderStatusCallback(TAG,null)
|
||||
TaxiPassengerModel.setOrderStatusCallback(TAG, null)
|
||||
}
|
||||
|
||||
override fun onDriverHasCheckedPilotCondition(isBoarded: Boolean) {
|
||||
@@ -57,10 +94,40 @@ class StartAutopilotViewModel: ViewModel(), IOCHTaxiPassengerOrderStatusCallback
|
||||
AutopilotManager.startAutopilot()
|
||||
}
|
||||
|
||||
override fun onAutopilotSingleDoorState(num: Chassis.DoorNumber, open: Boolean) {
|
||||
super.onAutopilotSingleDoorState(num, open)
|
||||
when (num) {
|
||||
DoorNumber.FRONT_LEFT -> {
|
||||
viewCallback?.setDoorStatus(DoorPosition.FRONT_LEFT,open)
|
||||
}
|
||||
|
||||
DoorNumber.FRONT_RIGHT -> {
|
||||
viewCallback?.setDoorStatus(DoorPosition.FRONT_RIGHT,open)
|
||||
}
|
||||
|
||||
interface StartAutopilotCallback{
|
||||
DoorNumber.REAR_LEFT -> {
|
||||
viewCallback?.setDoorStatus(DoorPosition.REAR_LEFT,open)
|
||||
}
|
||||
|
||||
DoorNumber.REAR_RIGHT -> {
|
||||
viewCallback?.setDoorStatus(DoorPosition.REAR_RIGHT,open)
|
||||
}
|
||||
|
||||
DoorNumber.MIDDLE -> {
|
||||
viewCallback?.setDoorStatus(DoorPosition.MIDDLE,open)
|
||||
}
|
||||
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
interface StartAutopilotCallback {
|
||||
fun handleStartAutopilotBtnStatus(isBoarded: Boolean)
|
||||
fun setOrderInfo(show: String)
|
||||
fun setDoorStatus(doorPosition: DoorPosition,isOpen:Boolean)
|
||||
}
|
||||
|
||||
enum class DoorPosition {
|
||||
FRONT_LEFT, FRONT_RIGHT, REAR_LEFT, REAR_RIGHT, MIDDLE
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,7 @@ import android.widget.TextView
|
||||
import androidx.appcompat.widget.AppCompatImageView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.app.ActivityCompat
|
||||
import com.mogo.eagle.core.utilcode.util.ActivityUtils
|
||||
import com.mogo.eagle.core.utilcode.util.TimeTransformUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.widget.media.video.TextureVideoViewOutlineProvider
|
||||
@@ -418,6 +419,7 @@ class ConsultVideoPlayer : StandardGSYVideoPlayer {
|
||||
frameLayout.setBackgroundColor(Color.BLACK)
|
||||
val lp = LayoutParams(width, height)
|
||||
frameLayout.addView(gsyVideoPlayer, lp)
|
||||
ActivityUtils.getActivityByContext(context)
|
||||
FullVideoUtils.showOverlayView(context as Activity,frameLayout,R.style.och_window_anim_alpha)
|
||||
gsyVideoPlayer.visibility = INVISIBLE
|
||||
frameLayout.visibility = INVISIBLE
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
@@ -9,6 +9,7 @@
|
||||
android:id="@+id/overMapView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:resetDrawable="@null"
|
||||
app:startPointDrawable="@drawable/taxi_p_map_view_dir_start"
|
||||
app:endPointDrawable="@drawable/taxi_p_map_view_dir_end"
|
||||
app:mapStyleExtraPath="style_extra.data"
|
||||
|
||||
@@ -145,16 +145,65 @@
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_front_right_door"
|
||||
android:gravity="center"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@+id/gl_vertical_center"
|
||||
android:layout_marginStart="@dimen/dp_120"
|
||||
android:layout_marginStart="@dimen/dp_106"
|
||||
android:text="右前车门未关"
|
||||
android:textSize="@dimen/dp_35"
|
||||
android:textColor="@color/taxi_p_2B364B"
|
||||
android:background="@drawable/taxi_p_top_right_door_bg"
|
||||
android:background="@drawable/taxi_p_front_right_door_bg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_front_left_door"
|
||||
android:gravity="center"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/gl_vertical_center"
|
||||
android:layout_marginEnd="@dimen/dp_106"
|
||||
android:text="左前车门未关"
|
||||
android:textSize="@dimen/dp_35"
|
||||
android:textColor="@color/taxi_p_2B364B"
|
||||
android:background="@drawable/taxi_p_front_left_door_bg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_rear_left_door"
|
||||
android:gravity="center"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toStartOf="@+id/gl_vertical_center"
|
||||
app:layout_constraintTop_toBottomOf="@+id/actv_front_left_door"
|
||||
android:layout_marginEnd="@dimen/dp_135"
|
||||
android:layout_marginTop="@dimen/dp_87"
|
||||
android:text="左后车门未关"
|
||||
android:textSize="@dimen/dp_35"
|
||||
android:textColor="@color/taxi_p_2B364B"
|
||||
android:background="@drawable/taxi_p_rear_left_door_bg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_rear_right_door"
|
||||
android:gravity="center"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toEndOf="@+id/gl_vertical_center"
|
||||
app:layout_constraintTop_toBottomOf="@+id/actv_front_left_door"
|
||||
android:layout_marginStart="@dimen/dp_135"
|
||||
android:layout_marginTop="@dimen/dp_87"
|
||||
android:text="右后车门未关"
|
||||
android:textSize="@dimen/dp_35"
|
||||
android:textColor="@color/taxi_p_2B364B"
|
||||
android:background="@drawable/taxi_p_rear_right_door_bg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user