[首页]
This commit is contained in:
yangyakun
2023-07-12 18:34:03 +08:00
parent 805f58482d
commit 1e8d69b1cf
8 changed files with 374 additions and 496 deletions

View File

@@ -1,16 +0,0 @@
package com.mogo.och.taxi.passenger.event;
public class UIStatus {
public static final int LIVE = 0;
public static final int OVERVIEW = 1;
public static final int CONSULT = 2;
public static final int MOVIE = 3;
public int status = LIVE;
public UIStatus(int status) {
this.status = status;
}
}

View File

@@ -131,7 +131,7 @@ public class BaseTaxiPassengerPresenter extends Presenter<TaxiPassengerBaseFragm
// 70 取消订单
if (TaxiPassengerOrderStatusEnum.Cancel.getCode() == order.orderStatus){
runOnUIThread(() -> {
mView.showOrHideServingOrderFragment(false,true);
mView.showOrHideServingOrderFragment(false);
mView.showOrHideOverMapViewFragment(false);
mView.showOrHideStartAutopilotView(false,false);
mView.showOrHidePressengerCheckPager(false, "",
@@ -140,7 +140,6 @@ public class BaseTaxiPassengerPresenter extends Presenter<TaxiPassengerBaseFragm
});
TaxiPassengerModel.INSTANCE.recoverNaviInfo();
TaxiPassengerModel.INSTANCE.startOrStopReadyToAutopilotLoop(false);
TaxiPassengerModel.INSTANCE.cleanStation();
return;
}
// 20 司机到达上车点
@@ -162,15 +161,13 @@ public class BaseTaxiPassengerPresenter extends Presenter<TaxiPassengerBaseFragm
});
//开启轮询司机是否已准备好开启自动驾驶的环境
TaxiPassengerModel.INSTANCE.startDriverReadyToAutopilotLoop();
TaxiPassengerModel.INSTANCE.setStation();
}
if (TaxiPassengerOrderStatusEnum.OnTheWayToEnd.getCode() == order.orderStatus){
runOnUIThread(() ->{
mView.showOrHideStartAutopilotView(false,false);
mView.showOrHideServingOrderFragment(true,true);
mView.showOrHideServingOrderFragment(true);
});
TaxiPassengerModel.INSTANCE.startOrStopReadyToAutopilotLoop(false);
TaxiPassengerModel.INSTANCE.setStation();
}
// 30 用户到达上车点 并通过了手机号后四位验证
// 40 服务中
@@ -192,18 +189,15 @@ public class BaseTaxiPassengerPresenter extends Presenter<TaxiPassengerBaseFragm
TaxiPassengerModel.INSTANCE.recoverNaviInfo();
mView.showOrHideOverMapViewFragment(false);
runOnUIThread(() -> {
mView.showOrHideServingOrderFragment(false,true);
mView.showOrHideServingOrderFragment(false);
mView.showOrHideArrivedEndLayout(true, order.endSiteAddr,order.orderNo);
CallerOrderListenerManager.INSTANCE.invokeOrderStatus(false);
});
TaxiPassengerModel.INSTANCE.cleanStation();
return;
}
// 60 服务完成 页面
if (TaxiPassengerOrderStatusEnum.JourneyCompleted.getCode() == order.orderStatus){
mCurrentPassengerOrder = null;
TaxiPassengerModel.INSTANCE.cleanStation();
return;
}
}

View File

@@ -1,115 +1,125 @@
package com.mogo.och.taxi.passenger.ui;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.Lifecycle;
import com.mogo.commons.module.status.MogoStatusManager;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.hmi.ui.widget.RomaPassengerView;
import com.mogo.eagle.core.function.view.MapBizView;
import com.mogo.eagle.core.utilcode.util.DeviceUtils;
import com.mogo.eagle.core.utilcode.util.OverlayViewUtils;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.map.listener.IMogoMapListener;
import com.mogo.map.uicontroller.VisualAngleMode;
import com.mogo.och.taxi.passenger.R;
import com.mogo.och.taxi.passenger.callback.ITPClickStartAutopilotCallback;
import com.mogo.och.taxi.passenger.event.UIStatus;
import com.mogo.och.taxi.passenger.presenter.BaseTaxiPassengerPresenter;
import com.mogo.och.taxi.passenger.ui.comment.TaxiPassengerArrivedView;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.lang.ref.WeakReference;
import java.util.Objects;
package com.mogo.och.taxi.passenger.ui
import android.os.Bundle
import android.view.View
import com.mogo.commons.mvp.MvpFragment
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getState
import com.mogo.eagle.core.function.hmi.ui.widget.RomaPassengerView
import com.mogo.eagle.core.function.view.MapBizView
import com.mogo.eagle.core.utilcode.util.DeviceUtils
import com.mogo.eagle.core.utilcode.util.OverlayViewUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.map.listener.IMogoMapListener
import com.mogo.map.uicontroller.VisualAngleMode
import com.mogo.och.taxi.passenger.R
import com.mogo.och.taxi.passenger.bean.TaxiPassengerScoreUpdateOrderReqBean
import com.mogo.och.taxi.passenger.callback.ITPClickStartAutopilotCallback
import com.mogo.och.taxi.passenger.callback.ITaxiPassengerCommonValueCallback
import com.mogo.och.taxi.passenger.callback.ITaxiPassengerScoreCallback
import com.mogo.och.taxi.passenger.presenter.BaseTaxiPassengerPresenter
import com.mogo.och.taxi.passenger.ui.bottom.BottomBar
import com.mogo.och.taxi.passenger.ui.comment.TaxiPassengerArrivedView
import kotlinx.android.synthetic.main.taxi_p_base_fragment.bottom
import kotlinx.android.synthetic.main.taxi_p_base_fragment.itinerary
import kotlinx.android.synthetic.main.taxi_p_base_fragment.mapBizView
import kotlinx.android.synthetic.main.taxi_p_base_fragment.overMapView
import java.lang.ref.WeakReference
/**
* 网约车基础Fragment主要负责布局通用界面处理站点面板和通话面板互斥情况
* <p>
*
*
* 部分业务放在了此处处理
*
* @author tongchenfei
*/
public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFragment, BaseTaxiPassengerPresenter>
implements IMogoMapListener, TaxiPassengerTaxiView, ITPClickStartAutopilotCallback {
class TaxiPassengerBaseFragment() :
MvpFragment<TaxiPassengerBaseFragment?, BaseTaxiPassengerPresenter?>(), IMogoMapListener,
TaxiPassengerTaxiView, ITPClickStartAutopilotCallback {
public static final String TAG = "TaxiPassengerBaseFragment";
private var romaPView: RomaPassengerView? = null
private MapBizView mapBizView;
private RomaPassengerView romaPView;
/**
* 到达目的地
*/
private var mArrivedEndView: WeakReference<TaxiPassengerArrivedView?>? = null
private WeakReference<TaxiPassengerArrivedView> mArrivedEndView;
private WeakReference<TaxiPassengerCheckView> mArrivedCheckView;
private WeakReference<TaxiPassengerStartAutopilotView> mStartAutopilotView;
protected TaxiPassengerServingOrderFragment ochServingOrderFragment = null;
/**
* 手机号后四位验证
*/
private var mArrivedCheckView: WeakReference<TaxiPassengerCheckView?>? = null
protected OverviewFragment overviewFragment = null;
/**
* 启动自驾页面
*/
private var mStartAutopilotView: WeakReference<TaxiPassengerStartAutopilotView?>? = null
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
EventBus.getDefault().register(this);
return super.onCreateView(inflater, container, savedInstanceState);
override fun getLayoutId(): Int {
return R.layout.taxi_p_base_fragment
}
@Override
protected int getLayoutId() {
return R.layout.taxi_p_base_fragment;
override fun getTagName(): String {
return "BaseOchTaxiPassengerFragment"
}
@Override
public String getTagName() {
return "BaseOchTaxiPassengerFragment";
}
@Override
protected void initViews() {
mapBizView = findViewById(R.id.mapBizView);
romaPView = findViewById(R.id.romaPView);
if(DeviceUtils.isLenovoModel() || DeviceUtils.isEB5Model()){
romaPView.setVisibility(View.VISIBLE);
}else{
romaPView.setVisibility(View.GONE);
override fun initViews() {
romaPView = findViewById(R.id.romaPView)
if (DeviceUtils.isLenovoModel() || DeviceUtils.isEB5Model()) {
romaPView!!.visibility = View.VISIBLE
} else {
romaPView!!.visibility = View.GONE
}
initListener();
onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getState());
initListener()
onAutopilotStatusChanged(getState())
}
@Override
protected void initViews(Bundle savedInstanceState) {
super.initViews(savedInstanceState);
mapBizView.onCreate(savedInstanceState);
override fun initViews(savedInstanceState: Bundle?) {
super.initViews(savedInstanceState)
mapBizView!!.onCreate(savedInstanceState)
overMapView.onCreateView(savedInstanceState)
}
private void initListener() {
private fun initListener() {
bottom.setOverMapApplyClick(object : BottomBar.ApplyClickLintener{
override fun onApplyClick(selectItem: BottomBar.SelectView) {
if(selectItem == BottomBar.SelectView.OVERMAPVIEW){
overMapView.visibility = View.VISIBLE
}else{
overMapView.visibility = View.GONE
}
if(selectItem == BottomBar.SelectView.PRECISIONMAP){
mapBizView.visibility = View.VISIBLE
}else{
mapBizView.visibility = View.GONE
}
}
})
}
private fun initArrivedView() {
mArrivedEndView = WeakReference(TaxiPassengerArrivedView(context))
mArrivedEndView!!.get()!!.iTaxiPassengerScoreCallback = ITaxiPassengerScoreCallback {
taxiPassengerScoreUpdateOrderReqBean: TaxiPassengerScoreUpdateOrderReqBean? ->
presenter?.arrivedAndScore(taxiPassengerScoreUpdateOrderReqBean)
}
}
private void initArrivedView() {
mArrivedEndView = new WeakReference<>(new TaxiPassengerArrivedView(getContext()));
mArrivedEndView.get().setITaxiPassengerScoreCallback((taxiPassengerScoreUpdateOrderReqBean) -> getPresenter().arrivedAndScore(taxiPassengerScoreUpdateOrderReqBean));
private fun initCheckView() {
mArrivedCheckView = WeakReference(
TaxiPassengerCheckView(
context
)
)
mArrivedCheckView!!.get()!!.iTaxiPassengerCommonValueCallback =
ITaxiPassengerCommonValueCallback { phoneTail: String? ->
getPresenter()!!.checkAndUpdateStatus(phoneTail)
}
}
private void initCheckView() {
mArrivedCheckView = new WeakReference<>(new TaxiPassengerCheckView(getContext()));
mArrivedCheckView.get().setITaxiPassengerCommonValueCallback(phoneTail -> getPresenter().checkAndUpdateStatus(phoneTail));
}
@Override
public void onResume() {
super.onResume();
mapBizView.onResume();
override fun onResume() {
super.onResume()
mapBizView!!.onResume()
overMapView.onResume()
}
/**
@@ -117,75 +127,56 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
*
* @param status 2 - running 1 - enable 2 - disable
*/
private int mPrevAPStatus = -1;
public void onAutopilotStatusChanged(int status) {
getActivity().runOnUiThread(() -> {
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING != status) {
// 1. 主动开启自动驾驶中不为2为0、1则继续loading
return;
}
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == status
&& mPrevAPStatus != status) {
// 2. 主动开启自动驾驶中为2则停止loading并isStarting = false
onAutopilotStatusSuccessDone();
}
mPrevAPStatus = status;
});
}
@NonNull
@Override
protected BaseTaxiPassengerPresenter createPresenter() {
return new BaseTaxiPassengerPresenter(this);
}
@Override
public void onLowMemory() {
super.onLowMemory();
mapBizView.onLowMemory();
}
@Override
public void onSaveInstanceState(@NonNull Bundle outState) {
super.onSaveInstanceState(outState);
mapBizView.onSaveInstanceState(outState);
}
@Override
public void onPause() {
super.onPause();
mapBizView.onPause();
}
@Override
public void onDestroyView() {
mapBizView.onDestroy();
super.onDestroyView();
EventBus.getDefault().unregister(this);
removeListener();
}
private void removeListener() {
if (mStartAutopilotView == null || mStartAutopilotView.get() == null) {
return;
private var mPrevAPStatus = -1
fun onAutopilotStatusChanged(status: Int) {
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING != status) {
// 1. 主动开启自动驾驶中不为2为0、1则继续loading
return
}
mStartAutopilotView.get().setOnClickStartAutopilotBtnCallback(null);
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void changeOverview(UIStatus uiStatus) {
if (uiStatus.status == UIStatus.LIVE) {
showOrHideOverMapViewFragment(false);
showOrHideServingOrderFragment(true, false);
} else if (uiStatus.status == UIStatus.OVERVIEW) {
showOrHideOverMapViewFragment(true);
showOrHideServingOrderFragment(false, false);
if ((IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == status
&& mPrevAPStatus != status)
) {
// 2. 主动开启自动驾驶中为2则停止loading并isStarting = false
onAutopilotStatusSuccessDone()
}
mPrevAPStatus = status
}
@Override
public void onMapVisualAngleChanged(VisualAngleMode visualAngleMode) {
override fun createPresenter(): BaseTaxiPassengerPresenter {
return BaseTaxiPassengerPresenter(this)
}
override fun onLowMemory() {
super.onLowMemory()
mapBizView!!.onLowMemory()
}
override fun onSaveInstanceState(outState: Bundle) {
super.onSaveInstanceState(outState)
mapBizView!!.onSaveInstanceState(outState)
}
override fun onPause() {
super.onPause()
mapBizView!!.onPause()
overMapView?.onPause()
}
override fun onDestroyView() {
mapBizView!!.onDestroy()
overMapView?.onDestroy()
super.onDestroyView()
removeListener()
}
private fun removeListener() {
if (mStartAutopilotView == null || mStartAutopilotView!!.get() == null) {
return
}
mStartAutopilotView!!.get()!!.setOnClickStartAutopilotBtnCallback(null)
}
override fun onMapVisualAngleChanged(visualAngleMode: VisualAngleMode) {
//todo ui 切换
}
@@ -194,38 +185,11 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
*
* @param isShow
*/
public void showOrHideServingOrderFragment(boolean isShow, boolean showOrHideLefeMenu) {
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
fun showOrHideServingOrderFragment(isShow: Boolean) {
if (isShow) {
if (ochServingOrderFragment == null) {
ochServingOrderFragment = TaxiPassengerServingOrderFragment.newInstance();
}
if (ochServingOrderFragment.isHidden()) {
transaction
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
.show(ochServingOrderFragment).commitAllowingStateLoss();
return;
}
if (ochServingOrderFragment.isAdded()) {
transaction
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
.show(ochServingOrderFragment).commitAllowingStateLoss();
return;
}
transaction
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
.add(R.id.module_mogo_och_navi_panel_container, ochServingOrderFragment)
.show(ochServingOrderFragment).commitAllowingStateLoss();
itinerary.visibility = View.VISIBLE
} else {
if (ochServingOrderFragment != null) {
transaction
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_CLOSE)
.hide(ochServingOrderFragment).commitAllowingStateLoss();
}
if (showOrHideLefeMenu) {
}
itinerary.visibility = View.GONE
}
}
@@ -234,35 +198,11 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
*
* @param isShow
*/
public void showOrHideOverMapViewFragment(boolean isShow) {
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
fun showOrHideOverMapViewFragment(isShow: Boolean) {
if (isShow) {
if (overviewFragment == null) {
overviewFragment = OverviewFragment.newInstance();
}
if (overviewFragment.isHidden()) {
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
.show(overviewFragment).commitAllowingStateLoss();
transaction.setMaxLifecycle(overviewFragment, Lifecycle.State.RESUMED);
return;
}
if (overviewFragment.isAdded()) {
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
.show(overviewFragment).commitAllowingStateLoss();
transaction.setMaxLifecycle(overviewFragment, Lifecycle.State.RESUMED);
return;
}
transaction
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
.add(R.id.fl_container_overview, overviewFragment)
.show(overviewFragment).commitAllowingStateLoss();
transaction.setMaxLifecycle(overviewFragment, Lifecycle.State.RESUMED);
overMapView.visibility = View.VISIBLE
} else {
if (overviewFragment != null) {
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_CLOSE)
.hide(overviewFragment).commitAllowingStateLoss();
transaction.setMaxLifecycle(overviewFragment, Lifecycle.State.STARTED);
}
overMapView.visibility = View.GONE
}
}
@@ -274,36 +214,40 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
*
* @param isShow
*/
public void showOrHideStartAutopilotView(boolean isShow, boolean isClickable) {
fun showOrHideStartAutopilotView(isShow: Boolean, isClickable: Boolean) {
if (isShow) {
if (mStartAutopilotView == null || mStartAutopilotView.get() == null) {
mStartAutopilotView = new WeakReference<>(new TaxiPassengerStartAutopilotView(getContext()));
if (mStartAutopilotView == null || mStartAutopilotView!!.get() == null) {
mStartAutopilotView = WeakReference(
TaxiPassengerStartAutopilotView(
context
)
)
}
mStartAutopilotView.get().setOnClickStartAutopilotBtnCallback(this);
OverlayViewUtils.showOverlayView(getActivity(), mStartAutopilotView.get());
updateStartAutopilotBtnStatus(isClickable);
mStartAutopilotView!!.get()!!.setOnClickStartAutopilotBtnCallback(this)
OverlayViewUtils.showOverlayView(activity, mStartAutopilotView!!.get())
updateStartAutopilotBtnStatus(isClickable)
} else {
if (mStartAutopilotView == null || mStartAutopilotView.get() == null) {
return;
if (mStartAutopilotView == null || mStartAutopilotView!!.get() == null) {
return
}
mStartAutopilotView.get().setOnClickStartAutopilotBtnCallback(null);
mStartAutopilotView.get().closeAllAnimsAndView();
mStartAutopilotView = null;
mStartAutopilotView!!.get()!!.setOnClickStartAutopilotBtnCallback(null)
mStartAutopilotView!!.get()!!.closeAllAnimsAndView()
mStartAutopilotView = null
}
}
public void updateStartAutopilotBtnStatus(boolean isClickable) {
if (mStartAutopilotView == null || mStartAutopilotView.get() == null) {
return;
fun updateStartAutopilotBtnStatus(isClickable: Boolean) {
if (mStartAutopilotView == null || mStartAutopilotView!!.get() == null) {
return
}
mStartAutopilotView.get().handleStartAutopilotBtnStatus(isClickable);
mStartAutopilotView!!.get()!!.handleStartAutopilotBtnStatus(isClickable)
}
public void onAutopilotStatusSuccessDone() {
if (mStartAutopilotView == null || mStartAutopilotView.get() == null) {
return;
fun onAutopilotStatusSuccessDone() {
if (mStartAutopilotView == null || mStartAutopilotView!!.get() == null) {
return
}
mStartAutopilotView.get().onAutopilotStatusSuccess();
mStartAutopilotView!!.get()!!.onAutopilotStatusSuccess()
}
/**
@@ -317,36 +261,44 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
* @param arrivedEndStation 目的地
* @param orderNo 订单No
*/
public void showOrHideArrivedEndLayout(boolean isShow, String arrivedEndStation, String orderNo) {
fun showOrHideArrivedEndLayout(isShow: Boolean, arrivedEndStation: String?, orderNo: String?) {
if (isShow) {
if (mArrivedEndView == null || mArrivedEndView.get() == null) {
initArrivedView();
if (mArrivedEndView == null || mArrivedEndView!!.get() == null) {
initArrivedView()
}
OverlayViewUtils.showOverlayView(getActivity(), mArrivedEndView.get(), R.style.och_window_anim_alpha);
UiThreadHandler.postDelayed(new Runnable() {
@Override
public void run() {
mArrivedEndView.get().setDataAndStartAnimation(arrivedEndStation, orderNo);
}
//如果在全屏 回收需要300毫秒 后期优化使用单独的播放器
}, 500);
OverlayViewUtils.showOverlayView(
activity,
mArrivedEndView!!.get(),
R.style.och_window_anim_alpha
)
UiThreadHandler.postDelayed(
Runnable {
mArrivedEndView!!.get()!!
.setDataAndStartAnimation(arrivedEndStation, (orderNo)!!)
}, //如果在全屏 回收需要300毫秒 后期优化使用单独的播放器
500
)
} else {
if (mArrivedEndView == null || mArrivedEndView.get() == null) {
return;
if (mArrivedEndView == null || mArrivedEndView!!.get() == null) {
return
}
OverlayViewUtils.dismissOverlayView(mArrivedEndView.get());
OverlayViewUtils.dismissOverlayView(mArrivedEndView!!.get())
}
}
// 20 司机到达上车点
public void preOrderThankPageTenlogic(String startSiteAddr,
String endSiteAddr,
String passengerNum,
String carNumber,
String phone) {
showOrHideArrivedEndLayout(false, "", "");
showOrHidePressengerCheckPager(true, startSiteAddr,
endSiteAddr, passengerNum, carNumber, phone);
fun preOrderThankPageTenlogic(
startSiteAddr: String?,
endSiteAddr: String?,
passengerNum: String?,
carNumber: String?,
phone: String?
) {
showOrHideArrivedEndLayout(false, "", "")
showOrHidePressengerCheckPager(
true, startSiteAddr,
endSiteAddr, passengerNum, carNumber, phone
)
}
/**
@@ -355,26 +307,29 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
* ③ 乘客到达上车点 手机号验证成功后 隐藏乘客验证页面
* ④ debug 使用
*/
public void showOrHidePressengerCheckPager(boolean isShow, String startSiteAddr,
String endSiteAddr,
String passengerNum,
String carNumber,
String phone) {
fun showOrHidePressengerCheckPager(
isShow: Boolean, startSiteAddr: String?,
endSiteAddr: String?,
passengerNum: String?,
carNumber: String?,
phone: String?
) {
try {
if (isShow) {
if (mArrivedCheckView == null || mArrivedCheckView.get() == null) {
initCheckView();
if (mArrivedCheckView == null || mArrivedCheckView!!.get() == null) {
initCheckView()
}
mArrivedCheckView.get().setData(startSiteAddr, endSiteAddr, passengerNum, carNumber, phone);
OverlayViewUtils.showOverlayView(getActivity(), mArrivedCheckView.get());
mArrivedCheckView!!.get()!!
.setData(startSiteAddr, endSiteAddr, passengerNum, carNumber, phone)
OverlayViewUtils.showOverlayView(activity, mArrivedCheckView!!.get())
} else {
if (mArrivedCheckView == null || mArrivedCheckView.get() == null) {
return;
if (mArrivedCheckView == null || mArrivedCheckView!!.get() == null) {
return
}
OverlayViewUtils.dismissOverlayView(mArrivedCheckView.get());
OverlayViewUtils.dismissOverlayView(mArrivedCheckView!!.get())
}
} catch (Exception e) {
e.printStackTrace();
} catch (e: Exception) {
e.printStackTrace()
}
}
@@ -383,20 +338,23 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
*
* @param isSuccess true 打分成功 false 打分失败
*/
public void showArrivedEndLayout2Thank(boolean isSuccess) {
if (mArrivedEndView == null || mArrivedEndView.get() == null) {
initArrivedView();
fun showArrivedEndLayout2Thank(isSuccess: Boolean) {
if (mArrivedEndView == null || mArrivedEndView!!.get() == null) {
initArrivedView()
}
if (isSuccess) {
mArrivedEndView.get().scoreSuccess();
mArrivedEndView!!.get()!!.scoreSuccess()
} else {
mArrivedEndView.get().scoreFail();
mArrivedEndView!!.get()!!.scoreFail()
}
}
@Override
public void onClickCallback() {
mPresenter.startAutopilot();
override fun onClickCallback() {
mPresenter!!.startAutopilot()
}
}
companion object {
@JvmField
val TAG = "TaxiPassengerBaseFragment"
}
}

View File

@@ -5,9 +5,8 @@ import android.util.AttributeSet
import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.och.taxi.passenger.R
import kotlinx.android.synthetic.main.taxi_p_bottom_bar.view.actv_overmapview
import kotlinx.android.synthetic.main.taxi_p_bottom_bar.view.actv_roma
import kotlinx.android.synthetic.main.taxi_p_bottom_bar.view.actv_setting
import kotlinx.android.synthetic.main.taxi_p_bottom_bar.view.actv_overmap
import kotlinx.android.synthetic.main.taxi_p_bottom_bar.view.actv_precisionmap
import kotlinx.android.synthetic.main.taxi_p_bottom_bar.view.actv_video
class BottomBar @JvmOverloads constructor(
@@ -16,81 +15,63 @@ class BottomBar @JvmOverloads constructor(
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr) {
private var checkIndex = SelectView.None
private var checkIndex = SelectView.NONE
private var overMapViewApply:ApplyClickLintener?=null
private var videoApply:ApplyClickLintener?=null
private var romaApply:ApplyClickLintener?=null
private var settingApply:ApplyClickLintener?=null
init {
isClickable = true
LayoutInflater.from(context).inflate(R.layout.taxi_p_bottom_bar, this, true)
setBackgroundResource(R.drawable.taxi_p_bottom_bar_bg)
actv_overmapview.setOnClickListener {
actv_precisionmap.setOnClickListener {
setCheckIndex(SelectView.PRECISIONMAP)
}
actv_overmap.setOnClickListener {
setCheckIndex(SelectView.OVERMAPVIEW)
overMapViewApply?.onApplyClick()
}
actv_video.setOnClickListener {
setCheckIndex(SelectView.VIDEO)
videoApply?.onApplyClick()
}
actv_roma.setOnClickListener {
setCheckIndex(SelectView.ROMA)
romaApply?.onApplyClick()
}
actv_setting.setOnClickListener {
setCheckIndex(SelectView.SETTING)
settingApply?.onApplyClick()
}
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
setCheckIndex(SelectView.PRECISIONMAP)
}
fun setOverMapApplyClick(overMapViewApply:ApplyClickLintener){
this.overMapViewApply = overMapViewApply
}
fun setVideoApplyClick(overMapViewApply:ApplyClickLintener){
this.videoApply = overMapViewApply
}
fun setRomaApplyClick(overMapViewApply:ApplyClickLintener){
this.romaApply = overMapViewApply
}
fun setSettingApplyClick(overMapViewApply:ApplyClickLintener){
this.settingApply = overMapViewApply
}
fun setCheckIndex(index: SelectView){
private fun setCheckIndex(index: SelectView){
if(checkIndex==index){
checkIndex = SelectView.None
return
}else{
checkIndex = index
}
overMapViewApply?.onApplyClick(checkIndex)
if(checkIndex == SelectView.OVERMAPVIEW){
actv_overmapview.setCheckItem(true)
actv_overmap.setCheckItem(true)
}else{
actv_overmapview.setCheckItem(false)
actv_overmap.setCheckItem(false)
}
if(checkIndex == SelectView.VIDEO){
actv_video.setCheckItem(true)
}else{
actv_video.setCheckItem(false)
}
if(checkIndex == SelectView.ROMA){
actv_roma.setCheckItem(true)
if(checkIndex == SelectView.PRECISIONMAP){
actv_precisionmap.setCheckItem(true)
}else{
actv_roma.setCheckItem(false)
actv_precisionmap.setCheckItem(false)
}
if(checkIndex == SelectView.SETTING){
actv_setting.setCheckItem(true)
}else{
actv_setting.setCheckItem(false)
}
}
enum class SelectView{
None,OVERMAPVIEW,VIDEO,ROMA,SETTING
NONE,PRECISIONMAP,OVERMAPVIEW,VIDEO
}
interface ApplyClickLintener{
fun onApplyClick()
fun onApplyClick(selectItem:SelectView)
}
}

View File

@@ -7,8 +7,16 @@ import androidx.appcompat.widget.AppCompatTextView
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.och.taxi.passenger.R
class ItineraryView(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) :
ConstraintLayout(context, attrs, defStyleAttr, defStyleRes) {
class ItineraryView : ConstraintLayout {
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)
// 速度
lateinit var actvSpeedValue: AppCompatTextView

View File

@@ -5,19 +5,21 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.mogo.eagle.core.function.view.OverMapView
android:id="@+id/overMapView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:startPointDrawable="@drawable/taxi_p_map_view_dir_start"
app:endPointDrawable="@drawable/taxi_p_map_view_dir_end"
app:mapStyleExtraPath="map_style_extra.data"
app:mapStylePath="map_style.data" />
<!-- 高精地图 -->
<com.mogo.eagle.core.function.view.MapBizView
android:id="@+id/mapBizView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugViewTrigger
android:layout_width="@dimen/dp_400"
android:layout_height="@dimen/dp_100"
android:longClickable="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<!--pnc行为决策-->
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
android:layout_width="wrap_content"
@@ -27,6 +29,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<!-- 漫游按钮 -->
<com.mogo.eagle.core.function.hmi.ui.widget.RomaPassengerView
android:id="@+id/romaPView"
android:layout_width="100dp"
@@ -39,74 +42,7 @@
app:roma_open="@drawable/iv_roma_taxi_passenger_press_bg"
app:layout_constraintLeft_toLeftOf="parent" />
<Button
android:id="@+id/btnAutopilotDisable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_72"
android:text="模拟 不可自动驾驶"
android:textSize="20sp"
android:visibility="gone"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/btnAutopilotEnable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="模拟 中途人工干预"
android:textSize="20sp"
android:visibility="gone"
app:layout_constraintRight_toRightOf="@id/btnAutopilotDisable"
app:layout_constraintTop_toBottomOf="@id/btnAutopilotDisable" />
<Button
android:id="@+id/btnAutopilotRunning"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="模拟 自动驾驶途中"
android:textSize="20sp"
android:visibility="gone"
app:layout_constraintRight_toRightOf="@id/btnAutopilotDisable"
app:layout_constraintTop_toBottomOf="@id/btnAutopilotEnable" />
<Button
android:id="@+id/btnAutopilotArrive"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="模拟 自动驾驶到站"
android:textSize="20sp"
android:visibility="gone"
app:layout_constraintRight_toRightOf="@id/btnAutopilotDisable"
app:layout_constraintTop_toBottomOf="@id/btnAutopilotRunning" />
<Button
android:id="@+id/btnAutopilotControl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="模拟 站点下发工控"
android:textSize="20sp"
android:visibility="gone"
app:layout_constraintRight_toRightOf="@id/btnAutopilotDisable"
app:layout_constraintTop_toBottomOf="@id/btnAutopilotArrive" />
<androidx.constraintlayout.widget.Group
android:id="@+id/groupTestPanel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
app:constraint_referenced_ids="btnAutopilotArrive,btnAutopilotDisable,btnAutopilotEnable,btnAutopilotRunning,btnAutopilotControl"
tools:visibility="gone" />
<FrameLayout
android:id="@+id/module_mogo_och_navi_panel_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_192"
android:layout_marginRight="@dimen/dp_10"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!-- 红绿灯 -->
<com.mogo.eagle.core.function.hmi.ui.widget.SingleTrafficLightView
android:id="@+id/traffic_light_view"
android:layout_width="wrap_content"
@@ -117,12 +53,23 @@
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!-- 全览地图 -->
<FrameLayout
android:id="@+id/fl_container_overview"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<!-- 路程信息 -->
<com.mogo.och.taxi.passenger.ui.orderinfo.ItineraryView
android:id="@+id/itinerary"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toTopOf="@+id/bottom"
android:layout_width="@dimen/dp_200"
android:layout_height="@dimen/dp_100"/>
<!-- 底部导航栏 -->
<com.mogo.och.taxi.passenger.ui.bottom.BottomBar
android:id="@+id/bottom"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>

View File

@@ -9,8 +9,8 @@
<TextClock
android:id="@+id/cl_order_time"
android:format12Hour="HH:mm MM月dd日 EEEE"
android:format24Hour="HH:mm MM月dd日 EEEE"
android:format12Hour="MM月dd日 HH:mm"
android:format24Hour="MM月dd日 HH:mm"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
@@ -18,28 +18,56 @@
android:layout_height="match_parent"/>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/actv_overmapview_press"
android:id="@+id/actv_precisionmap_press"
android:visibility="gone"
android:src="@drawable/taxi_p_bottom_bar_select_bg"
app:layout_constraintStart_toStartOf="@+id/actv_overmapview"
app:layout_constraintEnd_toEndOf="@+id/actv_overmapview"
app:layout_constraintStart_toStartOf="@+id/actv_precisionmap"
app:layout_constraintEnd_toEndOf="@+id/actv_precisionmap"
android:layout_width="@dimen/dp_359"
android:layout_height="@dimen/dp_107"/>
<com.mogo.och.bus.passenger.ui.view.bottom.BottomCheckView
android:id="@+id/actv_overmapview"
app:backageViewId="@+id/actv_overmapview_press"
android:id="@+id/actv_precisionmap"
app:backageViewId="@+id/actv_precisionmap_press"
app:layout_constraintHorizontal_chainStyle="packed"
app:selectedDrawable="@drawable/charter_p_bottom_softsettiing_press"
app:normalDrawable="@drawable/charter_p_bottom_softsettiing_normal"
app:bottomTitle="全局概览"
app:layout_constraintEnd_toStartOf="@+id/actv_video"
app:bottomTitle="行车实况"
app:layout_constraintEnd_toStartOf="@+id/actv_overmap"
app:layout_constraintStart_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_width="wrap_content"
android:layout_height="match_parent"/>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/actv_overmap_press"
android:visibility="gone"
android:src="@drawable/taxi_p_bottom_bar_select_bg"
app:layout_constraintStart_toStartOf="@+id/actv_overmap"
app:layout_constraintEnd_toEndOf="@+id/actv_overmap"
android:layout_width="@dimen/dp_359"
android:layout_height="@dimen/dp_107"/>
<com.mogo.och.bus.passenger.ui.view.bottom.BottomCheckView
android:id="@+id/actv_overmap"
app:backageViewId="@+id/actv_overmap_press"
app:selectedDrawable="@drawable/charter_p_bottom_softsettiing_press"
app:normalDrawable="@drawable/charter_p_bottom_softsettiing_normal"
app:bottomTitle="全局概览"
app:layout_constraintStart_toEndOf="@+id/actv_precisionmap"
app:layout_constraintEnd_toStartOf="@+id/actv_video"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_width="wrap_content"
android:layout_height="match_parent"/>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/actv_video_press"
android:visibility="gone"
@@ -55,51 +83,7 @@
app:selectedDrawable="@drawable/charter_p_bottom_softsettiing_press"
app:normalDrawable="@drawable/charter_p_bottom_softsettiing_normal"
app:bottomTitle="蘑菇咨询"
app:layout_constraintStart_toEndOf="@+id/actv_overmapview"
app:layout_constraintEnd_toStartOf="@+id/actv_roma"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_width="wrap_content"
android:layout_height="match_parent"/>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/actv_roma_press"
android:visibility="gone"
android:src="@drawable/taxi_p_bottom_bar_select_bg"
app:layout_constraintStart_toStartOf="@+id/actv_roma"
app:layout_constraintEnd_toEndOf="@+id/actv_roma"
android:layout_width="@dimen/dp_359"
android:layout_height="@dimen/dp_107"/>
<com.mogo.och.bus.passenger.ui.view.bottom.BottomCheckView
android:id="@+id/actv_roma"
app:backageViewId="@+id/actv_roma_press"
app:selectedDrawable="@drawable/charter_p_bottom_softsettiing_press"
app:normalDrawable="@drawable/charter_p_bottom_softsettiing_normal"
app:bottomTitle="漫游"
app:layout_constraintStart_toEndOf="@+id/actv_video"
app:layout_constraintEnd_toStartOf="@+id/actv_setting"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_width="wrap_content"
android:layout_height="match_parent"/>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/actv_setting_press"
android:visibility="gone"
android:src="@drawable/taxi_p_bottom_bar_select_bg"
app:layout_constraintStart_toStartOf="@+id/actv_setting"
app:layout_constraintEnd_toEndOf="@+id/actv_setting"
android:layout_width="@dimen/dp_359"
android:layout_height="@dimen/dp_107"/>
<com.mogo.och.bus.passenger.ui.view.bottom.BottomCheckView
android:id="@+id/actv_setting"
app:backageViewId="@+id/actv_setting_press"
app:selectedDrawable="@drawable/charter_p_bottom_softsettiing_press"
app:normalDrawable="@drawable/charter_p_bottom_softsettiing_normal"
app:bottomTitle="线路"
app:layout_constraintStart_toEndOf="@+id/actv_roma"
app:layout_constraintStart_toEndOf="@+id/actv_overmap"
app:layout_constraintEnd_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"

View File

@@ -2,51 +2,73 @@
<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"
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout"
tools:layout_height="wrap_content"
tools:layout_width="wrap_content"
tools:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actv_speed_value"
tools:text="速度"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actv_speed_unit"
tools:text="速度单位"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actv_endstation"
tools:text="目的地"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="目的地" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actv_distance"
tools:text="剩余距离"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="剩余距离" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actv_distance_unit"
tools:text="剩余距离单位"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="剩余距离单位" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actv_surplus_time"
tools:text="剩余时间"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="剩余时间" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actv_surplus_time_unit"
android:text="剩余时间单位"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
android:text="剩余时间单位"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actv_arrived_time"
android:text="到达时间"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
android:text="到达时间"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actv_speed_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="速度" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actv_speed_unit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="速度单位" />
</merge>