[Taxi-d 280, Taxi-p 130] Taxi乘客屏和司机屏联调测试完成

This commit is contained in:
wangmingjun
2022-06-24 18:41:41 +08:00
parent f35fb9a15e
commit caa5dc7df6
11 changed files with 56 additions and 27 deletions

View File

@@ -394,7 +394,7 @@ public class FrameSurfaceView extends BaseSurfaceView {
public void run() { public void run() {
decodedBitmapByReuse(bitmapIds.get(index), options); decodedBitmapByReuse(bitmapIds.get(index), options);
index++; index++;
if (index < bitmapIds.size()) { if (index < bitmapIds.size() && null != handler) {
handler.post(this); handler.post(this);
} else { } else {
index = 0; index = 0;

View File

@@ -188,8 +188,8 @@ public class BaseTaxiPassengerPresenter extends Presenter<TaxiPassengerBaseFragm
} }
if (TaxiPassengerOrderStatusEnum.OnTheWayToEnd.getCode() == order.orderStatus){ if (TaxiPassengerOrderStatusEnum.OnTheWayToEnd.getCode() == order.orderStatus){
runOnUIThread(() ->{ runOnUIThread(() ->{
mView.showOrHideServingOrderFragment(true);
mView.showOrHideStartAutopilotView(false,false); mView.showOrHideStartAutopilotView(false,false);
mView.showOrHideServingOrderFragment(true);
}); });
TaxiPassengerModel.getInstance().startOrStopReadyToAutopilotoop(false); TaxiPassengerModel.getInstance().startOrStopReadyToAutopilotoop(false);
} }

View File

@@ -298,7 +298,7 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
return; return;
} }
mStartAutopilotView.get().setOnClickStartAutopilotBtnCallback(null); mStartAutopilotView.get().setOnClickStartAutopilotBtnCallback(null);
OverlayViewUtils.dismissOverlayView(mStartAutopilotView.get()); mStartAutopilotView.get().closeAllAnimsAndView();
} }
} }

View File

@@ -11,6 +11,7 @@ import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import com.elegant.utils.UiThreadHandler; import com.elegant.utils.UiThreadHandler;
import com.mogo.eagle.core.utilcode.util.OverlayViewUtils;
import com.mogo.eagle.core.utilcode.util.ToastUtils; import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.och.common.module.wigets.sfv.FrameFinishCallback; import com.mogo.och.common.module.wigets.sfv.FrameFinishCallback;
import com.mogo.och.common.module.wigets.sfv.FrameSurfaceView; import com.mogo.och.common.module.wigets.sfv.FrameSurfaceView;
@@ -28,6 +29,7 @@ public class TaxiPassengerStartAutopilotView extends RelativeLayout implements V
private TextView mStartAutopilotBtn; private TextView mStartAutopilotBtn;
private ImageView mAutopilotBtnBg; private ImageView mAutopilotBtnBg;
private ImageView mCloseIV;
private ITPClickStartAutopilotCallback mClickCallback; private ITPClickStartAutopilotCallback mClickCallback;
public boolean isStarting = false; public boolean isStarting = false;
private AnimationDrawable mAnimationBtnDrawable; private AnimationDrawable mAnimationBtnDrawable;
@@ -63,6 +65,9 @@ public class TaxiPassengerStartAutopilotView extends RelativeLayout implements V
mStartAutopilotBtn = view.findViewById(R.id.taxi_p_start_autopilot); mStartAutopilotBtn = view.findViewById(R.id.taxi_p_start_autopilot);
mStartAutopilotBtn.setOnClickListener(this); mStartAutopilotBtn.setOnClickListener(this);
mCloseIV = view.findViewById(R.id.starting_autopilot_view_close);
mCloseIV.setOnClickListener(this);
mAutopilotBtnBg = view.findViewById(R.id.taxi_p_autopilot_btn_bg); mAutopilotBtnBg = view.findViewById(R.id.taxi_p_autopilot_btn_bg);
svCarStartingFrame = view.findViewById(R.id.taxi_p_autopilot_starting); svCarStartingFrame = view.findViewById(R.id.taxi_p_autopilot_starting);
@@ -93,13 +98,17 @@ public class TaxiPassengerStartAutopilotView extends RelativeLayout implements V
startOrStopLoadingAnim(true); startOrStopLoadingAnim(true);
if (mClickCallback != null) mClickCallback.onClickCallback(); if (mClickCallback != null) mClickCallback.onClickCallback();
} }
}else if (v.getId() == R.id.starting_autopilot_view_close){
OverlayViewUtils.dismissOverlayView(this);
} }
} }
@SuppressLint("UseCompatLoadingForDrawables") @SuppressLint("UseCompatLoadingForDrawables")
public void updateStartAutopilotBtnStatus(boolean isClickable){ public void updateStartAutopilotBtnStatus(boolean isClickable){
svCarStartingFrame.setBackgroundResource(R.drawable.light_00000); if (svCarStartingFrame != null){
svCarStartingFrame.setBackgroundResource(R.drawable.light_00000);
}
if (mStartAutopilotBtn == null) return; if (mStartAutopilotBtn == null) return;
if (isClickable){ //高亮可点击状态下UI if (isClickable){ //高亮可点击状态下UI
@@ -139,13 +148,15 @@ public class TaxiPassengerStartAutopilotView extends RelativeLayout implements V
} }
private void startingCarBgAnimatorDrawable(boolean isStart){ private void startingCarBgAnimatorDrawable(boolean isStart){
if (isStart){ if (isStart && svCarStartingFrame != null){
svCarStartingFrame.setRepeatTimes(-1); svCarStartingFrame.setRepeatTimes(-1);
svCarStartingFrame.setBackground(null); svCarStartingFrame.setBackground(null);
svCarStartingFrame.start(); svCarStartingFrame.start();
}else { }else {
svCarStartingFrame.reset(); if (svCarStartingFrame != null){
svCarStartingFrame.setBackgroundResource(R.drawable.light_00000); svCarStartingFrame.reset();
svCarStartingFrame.setBackgroundResource(R.drawable.light_00000);
}
} }
} }
@@ -167,13 +178,28 @@ public class TaxiPassengerStartAutopilotView extends RelativeLayout implements V
} }
} }
private void clearBgAnimDrawable() { public void clearBgAnimDrawable() {
if (mAnimationBtnDrawable != null) { if (mAnimationBtnDrawable != null) {
mAnimationBtnDrawable.stop(); mAnimationBtnDrawable.stop();
} }
mAnimationBtnDrawable = null; mAnimationBtnDrawable = null;
} }
public void closeAllAnimsAndView(){
clearStartingAnimFrame();
if (mAnimationBtnDrawable != null) {
mAnimationBtnDrawable.stop();
}
isStarting = false;
OverlayViewUtils.dismissOverlayView(this);
}
public void clearStartingAnimFrame(){
if (svCarStartingFrame != null){
svCarStartingFrame.destroy();
}
svCarStartingFrame = null;
}
public void onAutopilotStatusSuccess(){ public void onAutopilotStatusSuccess(){
startOrStopLoadingAnim(false); startOrStopLoadingAnim(false);
} }

View File

@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"> android:shape="rectangle">
<size android:width="520px" android:height="150px"/>
<corners android:radius="76px"/> <corners android:radius="76px"/>
<gradient <gradient
android:angle="180" android:angle="180"

View File

@@ -15,29 +15,29 @@
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<!-- <com.mogo.och.common.module.wigets.sfv.FrameSurfaceView--> <ImageView
<!-- android:id="@+id/taxi_p_start_autopilot_btn_sfv"--> android:id="@+id/starting_autopilot_view_close"
<!-- android:layout_width="1000px"--> app:layout_constraintTop_toTopOf="parent"
<!-- android:layout_height="500px"--> app:layout_constraintEnd_toEndOf="parent"
<!-- android:clickable="false"--> android:src="@drawable/taxi_p_passenger_arrived_close"
<!-- app:layout_constraintBottom_toBottomOf="parent"--> android:layout_marginEnd="@dimen/dp_70"
<!-- app:layout_constraintLeft_toLeftOf="parent"--> android:layout_marginTop="@dimen/dp_140"
<!-- app:layout_constraintRight_toRightOf="parent" />--> android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<ImageView <ImageView
android:id="@+id/taxi_p_autopilot_btn_bg" android:id="@+id/taxi_p_autopilot_btn_bg"
android:layout_width="1000px" android:layout_width="1000px"
android:layout_height="500px" android:layout_height="500px"
android:clickable="false" android:clickable="false"
android:background="@drawable/anmi_flow"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" /> app:layout_constraintRight_toRightOf="parent" />
<TextView <TextView
android:id="@+id/taxi_p_start_autopilot" android:id="@+id/taxi_p_start_autopilot"
android:layout_width="wrap_content" android:layout_width="@dimen/taxi_p_start_autopilot_btn_width"
android:layout_height="wrap_content" android:layout_height="@dimen/taxi_p_start_autopilot_btn_height"
android:gravity="center" android:gravity="center"
android:text="@string/taxi_p_start_autopilot_txt" android:text="@string/taxi_p_start_autopilot_txt"
android:textColor="@color/taxi_p_start_autopilot_txt_color" android:textColor="@color/taxi_p_start_autopilot_txt_color"

View File

@@ -63,6 +63,6 @@
<dimen name="taxi_p_route_txt_unit_size">28px</dimen> <dimen name="taxi_p_route_txt_unit_size">28px</dimen>
<dimen name="taxi_p_start_autopilot_txt_size">52px</dimen> <dimen name="taxi_p_start_autopilot_txt_size">52px</dimen>
<dimen name="taxi_p_start_autopilot_btn_width">1000px</dimen> <dimen name="taxi_p_start_autopilot_btn_width">520px</dimen>
<dimen name="taxi_p_start_autopilot_btn_height">500px</dimen> <dimen name="taxi_p_start_autopilot_btn_height">150px</dimen>
</resources> </resources>

View File

@@ -126,7 +126,7 @@
<dimen name="taxi_p_route_txt_unit_size">28px</dimen> <dimen name="taxi_p_route_txt_unit_size">28px</dimen>
<dimen name="taxi_p_start_autopilot_txt_size">52px</dimen> <dimen name="taxi_p_start_autopilot_txt_size">52px</dimen>
<dimen name="taxi_p_start_autopilot_btn_width">1000px</dimen> <dimen name="taxi_p_start_autopilot_btn_width">520px</dimen>
<dimen name="taxi_p_start_autopilot_btn_height">500px</dimen> <dimen name="taxi_p_start_autopilot_btn_height">150px</dimen>
</resources> </resources>

View File

@@ -121,6 +121,6 @@
<dimen name="taxi_p_route_txt_unit_size">28px</dimen> <dimen name="taxi_p_route_txt_unit_size">28px</dimen>
<dimen name="taxi_p_start_autopilot_txt_size">52px</dimen> <dimen name="taxi_p_start_autopilot_txt_size">52px</dimen>
<dimen name="taxi_p_start_autopilot_btn_width">1000px</dimen> <dimen name="taxi_p_start_autopilot_btn_width">520px</dimen>
<dimen name="taxi_p_start_autopilot_btn_height">500px</dimen> <dimen name="taxi_p_start_autopilot_btn_height">150px</dimen>
</resources> </resources>

View File

@@ -262,7 +262,6 @@ public class TaxiModel {
//更新view //更新view
CallerLogger.INSTANCE.d(M_TAXI + TAG, "changeCarStatus:" + mOCHCarStatus); CallerLogger.INSTANCE.d(M_TAXI + TAG, "changeCarStatus:" + mOCHCarStatus);
startOrStopOrderLoop(mOCHCarStatus == 1); startOrStopOrderLoop(mOCHCarStatus == 1);
queryAutopilotStatus(mOCHCarStatus == 1);
String role = ""; String role = "";
if (TaxiDriverRoleEnum.DEMO.getCode() == data.data.purpose) { if (TaxiDriverRoleEnum.DEMO.getCode() == data.data.purpose) {
role = TaxiConst.DEMO_USER; role = TaxiConst.DEMO_USER;

View File

@@ -205,9 +205,14 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
@Override @Override
public void onCurrentOrderStatusChanged(OrderQueryRespBean.Result order) { public void onCurrentOrderStatusChanged(OrderQueryRespBean.Result order) {
CallerLogger.INSTANCE.d(M_TAXI + TAG,"order = "+order.toString()); CallerLogger.INSTANCE.d(M_TAXI + TAG,"order = "+order.toString());
if (TaxiOrderStatusEnum.UserArriveAtStart.getCode() == order.orderStatus){
TaxiModel.getInstance().queryAutopilotStatus(true);
}
if (TaxiOrderStatusEnum.OnTheWayToEnd.getCode() == order.orderStatus){ if (TaxiOrderStatusEnum.OnTheWayToEnd.getCode() == order.orderStatus){
TaxiModel.getInstance().startDynamicCalculateRouteInfo(); TaxiModel.getInstance().startDynamicCalculateRouteInfo();
} }
if (TaxiOrderStatusEnum.ArriveAtEnd.getCode() == order.orderStatus || if (TaxiOrderStatusEnum.ArriveAtEnd.getCode() == order.orderStatus ||
TaxiOrderStatusEnum.Cancel.getCode() == order.orderStatus || TaxiOrderStatusEnum.Cancel.getCode() == order.orderStatus ||
TaxiOrderStatusEnum.JourneyCompleted.getCode() == order.orderStatus){ TaxiOrderStatusEnum.JourneyCompleted.getCode() == order.orderStatus){