订单完成 没有评价默认不关闭评价页面、等下个乘客到达上车地点后关闭评价页面打开验证页面
解决一些内存泄漏 api路径变更
This commit is contained in:
@@ -73,7 +73,7 @@ interface TaxiPassengerServiceApi {
|
||||
* @return
|
||||
*/
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
@POST( "/autopilot-car-hailing/passenger/v2/vehicle/taxi/verification/phone" )
|
||||
@POST( "/autopilot-car-hailing/order/v2/vehicle/taxi/passenger/verification/phone" )
|
||||
Observable<TaxiPassengerBaseRespBean> checkPhoneAndUpdateOrderStatus(@Header ("appId") String appId, @Header("ticket") String ticket, @Body TaxiPassengerCheckPhoneUpdateOrderReqBean data);
|
||||
|
||||
/**
|
||||
|
||||
@@ -151,12 +151,12 @@ public class BaseTaxiPassengerPresenter extends Presenter<TaxiPassengerBaseFragm
|
||||
return;
|
||||
}
|
||||
if (TaxiPassengerOrderStatusEnum.ArriveAtStart.getCode() == order.orderStatus) {
|
||||
runOnUIThread(() -> mView.showOrHidePressengerCheckPager(true, order.startSiteAddr,
|
||||
order.endSiteAddr, order.passengerNum, order.carNumber, order.passengerPhone));
|
||||
runOnUIThread(() -> {
|
||||
mView.showOrHideArrivedEndLayout(false, "");
|
||||
mView.showOrHidePressengerCheckPager(true, order.startSiteAddr,
|
||||
order.endSiteAddr, order.passengerNum, order.carNumber, order.passengerPhone);
|
||||
});
|
||||
return;
|
||||
}else {
|
||||
runOnUIThread(() -> mView.showOrHidePressengerCheckPager(false, "",
|
||||
"", "", "", ""));
|
||||
}
|
||||
if (TaxiPassengerOrderStatusEnum.UserArriveAtStart.getCode() == order.orderStatus
|
||||
|| TaxiPassengerOrderStatusEnum.OnTheWayToEnd.getCode() == order.orderStatus){
|
||||
@@ -175,7 +175,6 @@ public class BaseTaxiPassengerPresenter extends Presenter<TaxiPassengerBaseFragm
|
||||
if (TaxiPassengerOrderStatusEnum.JourneyCompleted.getCode() == order.orderStatus){
|
||||
runOnUIThread(() -> {
|
||||
mView.showOrHideServingOrderFragment(false);
|
||||
mView.showOrHideArrivedEndLayout(false, "");
|
||||
});
|
||||
TaxiPassengerGeocodeSearchModel.getInstance(getContext()).destroyGeocodeSearch();
|
||||
mCurrentPassengerOrder = null;
|
||||
|
||||
@@ -27,9 +27,10 @@ import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.constants.DataTypes;
|
||||
import com.mogo.och.taxi.passenger.R;
|
||||
import com.mogo.och.taxi.passenger.callback.ITaxiPassengerCheckPhoneCallback;
|
||||
import com.mogo.och.taxi.passenger.presenter.BaseTaxiPassengerPresenter;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
|
||||
/**
|
||||
* 网约车基础Fragment,主要负责布局通用界面,处理站点面板和通话面板互斥情况
|
||||
@@ -50,11 +51,10 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
private TaxiPassengerV2XNotificationView mV2XNotificationView;
|
||||
|
||||
// private ConstraintLayout mArrivedEndCL;
|
||||
private View mArrivedEndView;
|
||||
private View ochShadowLayout;
|
||||
private TaxiPassengerCheckView mArrivedCheckView;
|
||||
private TextView mArrivedEndStation;
|
||||
private TextView tvPleaseScore;
|
||||
private WeakReference<View> mArrivedEndView;
|
||||
private WeakReference<View> ochShadowLayout;
|
||||
private WeakReference<TaxiPassengerCheckView> mArrivedCheckView;
|
||||
private WeakReference<TextView> mArrivedEndStation;
|
||||
|
||||
protected TaxiPassengerServingOrderFragment ochServingOrderFragment = null;
|
||||
|
||||
@@ -85,12 +85,9 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
CallerHmiManager.INSTANCE.setProxyNotificationView(mV2XNotificationView);
|
||||
|
||||
// mArrivedEndCL = findViewById(R.id.taxi_p_arrive_end_bg);
|
||||
mArrivedEndView = LayoutInflater.from(getContext()).inflate(R.layout.taxi_p_arrived_end_panel,null);
|
||||
mArrivedEndStation = mArrivedEndView.findViewById(R.id.arrived_end_station);
|
||||
ochShadowLayout = mArrivedEndView.findViewById(R.id.och_shadow_layout);
|
||||
tvPleaseScore = mArrivedEndView.findViewById(R.id.tv_please_score);
|
||||
initArrivedView();
|
||||
initCheckView();
|
||||
|
||||
mArrivedCheckView = new TaxiPassengerCheckView(getContext());
|
||||
mMapswitchBtn = findViewById(R.id.module_och_taxi_swich_map_iv);
|
||||
initListener();
|
||||
|
||||
@@ -101,7 +98,6 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
}else {
|
||||
switchVRFlatMode(false);
|
||||
}
|
||||
//showOrHidePressengerCheckPager(true,"衡山科学城","石鼓收费站","2","京A876589","18811539480");
|
||||
}
|
||||
|
||||
private void initListener(){
|
||||
@@ -119,21 +115,25 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
}
|
||||
}
|
||||
});
|
||||
mArrivedCheckView.setOnCheckPhoneAndUpdateStatusListener(phoneTail -> getPresenter().checkAndUpdateStatus(phoneTail));
|
||||
tvPleaseScore.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
//getPresenter().arrivedAndScore(2);
|
||||
showOrHideArrivedEndLayout(false,"北京");
|
||||
}
|
||||
});
|
||||
findViewById(R.id.iv_temp).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
showOrHideArrivedEndLayout(true,"北京");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initArrivedView(){
|
||||
View mArrivedEndViewInner = LayoutInflater.from(getContext()).inflate(R.layout.taxi_p_arrived_end_panel,null);
|
||||
mArrivedEndView = new WeakReference<>(mArrivedEndViewInner);
|
||||
mArrivedEndStation = new WeakReference<>(mArrivedEndViewInner.findViewById(R.id.arrived_end_station)) ;
|
||||
ochShadowLayout = new WeakReference<>(mArrivedEndViewInner.findViewById(R.id.och_shadow_layout)) ;
|
||||
mArrivedEndViewInner.findViewById(R.id.tv_please_score).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
getPresenter().arrivedAndScore(2);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initCheckView() {
|
||||
TaxiPassengerCheckView mArrivedCheckViewInner = new TaxiPassengerCheckView(getContext());
|
||||
mArrivedCheckView = new WeakReference<>(mArrivedCheckViewInner);
|
||||
mArrivedCheckView.get().setOnCheckPhoneAndUpdateStatusListener(phoneTail -> getPresenter().checkAndUpdateStatus(phoneTail));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -273,13 +273,15 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
*/
|
||||
public void showOrHideArrivedEndLayout(boolean isShow, String arrivedEndStation){
|
||||
if (isShow){
|
||||
OverlayViewUtils.showOverlayView(getActivity(),mArrivedEndView, R.style.och_window_anim_alpha);
|
||||
if(mArrivedEndView.get()==null||ochShadowLayout.get()==null||mArrivedEndStation.get()==null){
|
||||
initArrivedView();
|
||||
}
|
||||
OverlayViewUtils.showOverlayView(getActivity(),mArrivedEndView.get(), R.style.och_window_anim_alpha);
|
||||
Animation trAnimation = AnimationUtils.loadAnimation(getContext(), R.anim.left_to_right);
|
||||
ochShadowLayout.startAnimation(trAnimation);
|
||||
mArrivedEndStation.setText(arrivedEndStation);
|
||||
ochShadowLayout.get().startAnimation(trAnimation);
|
||||
mArrivedEndStation.get().setText(arrivedEndStation);
|
||||
}else {
|
||||
// mArrivedEndCL.setVisibility(View.GONE);
|
||||
OverlayViewUtils.dismissOverlayView(mArrivedEndView);
|
||||
OverlayViewUtils.dismissOverlayView(mArrivedEndView.get());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -290,11 +292,13 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
String phone) {
|
||||
try {
|
||||
if (isShow) {
|
||||
mArrivedCheckView.setData(startSiteAddr, endSiteAddr, passengerNum, carNumber,phone);
|
||||
OverlayViewUtils.showOverlayView(getActivity(), mArrivedCheckView);
|
||||
if(mArrivedCheckView.get()==null){
|
||||
initCheckView();
|
||||
}
|
||||
mArrivedCheckView.get().setData(startSiteAddr, endSiteAddr, passengerNum, carNumber,phone);
|
||||
OverlayViewUtils.showOverlayView(getActivity(), mArrivedCheckView.get());
|
||||
} else {
|
||||
mArrivedCheckView.setData("--", "--", "--", "--","");
|
||||
OverlayViewUtils.dismissOverlayView(mArrivedCheckView);
|
||||
OverlayViewUtils.dismissOverlayView(mArrivedCheckView.get());
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -65,10 +65,13 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/arrived_end_station"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@+id/arrived_end_station_title"
|
||||
app:layout_constraintStart_toStartOf="@+id/arrived_end_station_title"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_31"
|
||||
android:includeFontPadding="false"
|
||||
android:textColor="@android:color/white"
|
||||
|
||||
@@ -75,13 +75,16 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_passenger_start"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_44"
|
||||
android:layout_marginTop="@dimen/dp_86"
|
||||
tools:text="起 点 : 衡山科学城"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:textColor="@color/taxi_autopilot_text_color_normal"
|
||||
android:textSize="@dimen/sp_46"
|
||||
app:layout_constraintEnd_toStartOf="@+id/och_shadow_layout"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_passenger_start_boll"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_passenger_count" />
|
||||
|
||||
@@ -115,17 +118,21 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_passenger_end"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_44"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
tools:text="终 点 : 石鼓收费站"
|
||||
android:textColor="@color/taxi_autopilot_text_color_normal"
|
||||
android:textSize="@dimen/sp_46"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_passenger_end_boll"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_passenger_end_boll"
|
||||
app:layout_constraintEnd_toStartOf="@+id/och_shadow_layout"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_passenger_end_boll" />
|
||||
|
||||
<com.mogo.och.common.module.wigets.OCHBorderShadowLayout
|
||||
android:id="@+id/och_shadow_layout"
|
||||
android:layout_width="929px"
|
||||
android:layout_height="1143px"
|
||||
android:layout_marginEnd="155px"
|
||||
|
||||
@@ -89,6 +89,9 @@ public class OverlayViewUtils {
|
||||
if (windowManager != null && overlayView != null) {
|
||||
windowManager.removeView(overlayView);
|
||||
}
|
||||
if(lastOverlayView!=null&&lastOverlayView==overlayView){
|
||||
lastOverlayView = null;
|
||||
}
|
||||
isShowing = false;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
Reference in New Issue
Block a user