[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() {
decodedBitmapByReuse(bitmapIds.get(index), options);
index++;
if (index < bitmapIds.size()) {
if (index < bitmapIds.size() && null != handler) {
handler.post(this);
} else {
index = 0;

View File

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

View File

@@ -298,7 +298,7 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
return;
}
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 com.elegant.utils.UiThreadHandler;
import com.mogo.eagle.core.utilcode.util.OverlayViewUtils;
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.FrameSurfaceView;
@@ -28,6 +29,7 @@ public class TaxiPassengerStartAutopilotView extends RelativeLayout implements V
private TextView mStartAutopilotBtn;
private ImageView mAutopilotBtnBg;
private ImageView mCloseIV;
private ITPClickStartAutopilotCallback mClickCallback;
public boolean isStarting = false;
private AnimationDrawable mAnimationBtnDrawable;
@@ -63,6 +65,9 @@ public class TaxiPassengerStartAutopilotView extends RelativeLayout implements V
mStartAutopilotBtn = view.findViewById(R.id.taxi_p_start_autopilot);
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);
svCarStartingFrame = view.findViewById(R.id.taxi_p_autopilot_starting);
@@ -93,13 +98,17 @@ public class TaxiPassengerStartAutopilotView extends RelativeLayout implements V
startOrStopLoadingAnim(true);
if (mClickCallback != null) mClickCallback.onClickCallback();
}
}else if (v.getId() == R.id.starting_autopilot_view_close){
OverlayViewUtils.dismissOverlayView(this);
}
}
@SuppressLint("UseCompatLoadingForDrawables")
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 (isClickable){ //高亮可点击状态下UI
@@ -139,13 +148,15 @@ public class TaxiPassengerStartAutopilotView extends RelativeLayout implements V
}
private void startingCarBgAnimatorDrawable(boolean isStart){
if (isStart){
if (isStart && svCarStartingFrame != null){
svCarStartingFrame.setRepeatTimes(-1);
svCarStartingFrame.setBackground(null);
svCarStartingFrame.start();
}else {
svCarStartingFrame.reset();
svCarStartingFrame.setBackgroundResource(R.drawable.light_00000);
if (svCarStartingFrame != null){
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) {
mAnimationBtnDrawable.stop();
}
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(){
startOrStopLoadingAnim(false);
}

View File

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

View File

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

View File

@@ -126,7 +126,7 @@
<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_btn_width">1000px</dimen>
<dimen name="taxi_p_start_autopilot_btn_height">500px</dimen>
<dimen name="taxi_p_start_autopilot_btn_width">520px</dimen>
<dimen name="taxi_p_start_autopilot_btn_height">150px</dimen>
</resources>

View File

@@ -121,6 +121,6 @@
<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_btn_width">1000px</dimen>
<dimen name="taxi_p_start_autopilot_btn_height">500px</dimen>
<dimen name="taxi_p_start_autopilot_btn_width">520px</dimen>
<dimen name="taxi_p_start_autopilot_btn_height">150px</dimen>
</resources>

View File

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

View File

@@ -205,9 +205,14 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
@Override
public void onCurrentOrderStatusChanged(OrderQueryRespBean.Result order) {
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){
TaxiModel.getInstance().startDynamicCalculateRouteInfo();
}
if (TaxiOrderStatusEnum.ArriveAtEnd.getCode() == order.orderStatus ||
TaxiOrderStatusEnum.Cancel.getCode() == order.orderStatus ||
TaxiOrderStatusEnum.JourneyCompleted.getCode() == order.orderStatus){