diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/adapter/BusPassengerLineStationsAdapter.java b/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/adapter/BusPassengerLineStationsAdapter.java index 565372b4a9..d092b4fb48 100644 --- a/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/adapter/BusPassengerLineStationsAdapter.java +++ b/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/adapter/BusPassengerLineStationsAdapter.java @@ -1,5 +1,9 @@ package com.mogo.och.bus.passenger.adapter; +import static com.mogo.och.bus.passenger.constant.BusPassengerConst.STATION_STATUS_ARRIVING; +import static com.mogo.och.bus.passenger.constant.BusPassengerConst.STATION_STATUS_LEAVING; +import static com.mogo.och.bus.passenger.constant.BusPassengerConst.STATION_STATUS_STOPPED; + import android.content.Context; import android.text.TextUtils; import android.view.LayoutInflater; @@ -19,10 +23,6 @@ import com.mogo.och.common.module.wigets.MarqueeTextView; import java.util.List; -import static com.mogo.och.bus.passenger.constant.BusPassengerConst.STATION_STATUS_ARRIVING; -import static com.mogo.och.bus.passenger.constant.BusPassengerConst.STATION_STATUS_LEAVING; -import static com.mogo.och.bus.passenger.constant.BusPassengerConst.STATION_STATUS_STOPPED; - /** * @author: wangmingjun * @date: 2022/4/6 @@ -58,7 +58,7 @@ public class BusPassengerLineStationsAdapter extends RecyclerView.Adapter mView.updatePlateNum(plateNumber)); +// runOnUIThread(() -> mView.updatePlateNum(plateNumber)); } @Override @@ -131,7 +132,7 @@ public class BaseBusPassengerPresenter extends Presenter stations,int currentStationIndex,boolean isArrived) { + public void updateStationsInfo(List stations, int currentStationIndex, boolean isArrived) { runOnUIThread(() -> mView.updateStationsInfo(stations,currentStationIndex, isArrived)); } @@ -159,6 +160,6 @@ public class BaseBusPassengerPresenter extends Presenter mView.setProgressBarMax()); +// runOnUIThread(() -> mView.setProgressBarMax()); } } diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPBlueToothView.kt b/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPBlueToothView.kt new file mode 100644 index 0000000000..2254892bfd --- /dev/null +++ b/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPBlueToothView.kt @@ -0,0 +1,37 @@ +package com.mogo.och.bus.passenger.ui + +import android.content.Context +import android.util.AttributeSet +import android.view.LayoutInflater +import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener +import com.mogo.eagle.core.function.hmi.ui.widget.BlueToothView +import com.mogo.eagle.core.utilcode.util.ThreadUtils +import com.mogo.och.bus.passenger.R +import kotlinx.android.synthetic.jinlvvan.p_bus_view_blue_tooth.view.* + +/** + * 魔戒蓝牙控件 + * 放置于StatusBar右侧位置 + * todo arrow + */ +class BusPBlueToothView @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0 +) : BlueToothView(context, attrs, defStyleAttr),IMoGoDevaToolsListener { + + init { + LayoutInflater.from(context).inflate(R.layout.p_bus_view_blue_tooth, this, true) + } + + override fun mofangStatus(status: Boolean) { + ThreadUtils.runOnUiThread { + if (status) { + blueView.setImageResource(R.drawable.bus_p_blue_tooth_close) + } else { + blueView.setImageResource(R.drawable.bus_p_blue_tooth_open) + } + } + } + +} \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPStatusBarView.kt b/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPStatusBarView.kt new file mode 100644 index 0000000000..3cbe38d985 --- /dev/null +++ b/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPStatusBarView.kt @@ -0,0 +1,71 @@ +package com.mogo.och.bus.passenger.ui + +import android.annotation.* +import android.content.Context +import android.graphics.Color +import android.util.AttributeSet +import android.view.LayoutInflater +import android.view.ViewGroup +import androidx.constraintlayout.widget.ConstraintLayout +import chassis.ChassisStatesOuterClass +import com.mogo.eagle.core.function.api.autopilot.IMoGoBatteryManagementSystemListener +import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener +import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener +import com.mogo.eagle.core.function.call.autopilot.CallerBatteryManagementSystemListenerManager +import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager +import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager +import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager +import com.mogo.eagle.core.utilcode.kotlin.* +import com.mogo.eagle.core.utilcode.util.ClickUtils +import com.mogo.och.bus.passenger.R +import kotlinx.coroutines.* +import me.jessyan.autosize.utils.AutoSizeUtils + +/** + * @author: wangmingjun + * @date: 2023/2/14 + */ +class BusPStatusBarView @JvmOverloads constructor( + context: Context, attrs: AttributeSet? = null +) : ConstraintLayout(context, attrs), IViewControlListener, IMoGoSkinModeChangeListener{ + + companion object { + const val TAG = "BusPStatusBarView" + } + + init { + LayoutInflater.from(context).inflate(R.layout.p_bus_view_status_bar, this, true) + setBackgroundColor(Color.parseColor("#80FFFFFF")) + isClickable = true + isFocusable = true + } + + + @SuppressLint("ClickableViewAccessibility") + override fun onAttachedToWindow() { + super.onAttachedToWindow() + post { + val params: ViewGroup.LayoutParams = getLayoutParams() + params.height = AutoSizeUtils.dp2px(context,40f) + layoutParams = params + } + //添加view控制 + CallerHmiViewControlListenerManager.addListener(TAG,this) + // 添加换肤监听 + CallerSkinModeListenerManager.addListener(TAG, this) + } + + override fun onSkinModeChange(skinMode: Int) { + when (skinMode) { + 0 -> setStatusBarDarkOrLight(false) + 1 -> setStatusBarDarkOrLight(true) + } + } + + override fun onDetachedFromWindow() { + super.onDetachedFromWindow() + CallerHmiViewControlListenerManager.removeListener(TAG) + CallerSkinModeListenerManager.removeListener(TAG) + CallerDevaToolsManager.hideStatusBar() + } +} \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPassengerBaseFragment.java b/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPassengerBaseFragment.java index fa686d846f..703d4af07e 100644 --- a/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPassengerBaseFragment.java +++ b/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPassengerBaseFragment.java @@ -1,27 +1,17 @@ package com.mogo.och.bus.passenger.ui; import android.os.Bundle; -import android.text.Html; import android.view.LayoutInflater; -import android.view.View; import android.widget.FrameLayout; -import android.widget.ImageView; -import android.widget.TextView; import androidx.annotation.NonNull; -import androidx.core.widget.ContentLoadingProgressBar; +import androidx.appcompat.widget.AppCompatImageView; import com.mogo.commons.mvp.IView; import com.mogo.commons.mvp.MvpFragment; - import com.mogo.commons.mvp.Presenter; -import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; import com.mogo.eagle.core.function.view.MapBizView; -import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr; -import com.mogo.eagle.core.utilcode.util.UiThreadHandler; import com.mogo.och.bus.passenger.R; -import com.mogo.och.bus.passenger.constant.BusPassengerConst; -import com.mogo.och.common.module.utils.NumberFormatUtil; /** * Created on 2022/3/31 @@ -32,19 +22,9 @@ public abstract class BusPassengerBaseFragment 0){ - if (meters / 1000 < 1){ - disUnit = "米"; - dis = String.valueOf(Math.round(meters)); - }else { - disUnit = "公里"; - dis = NumberFormatUtil.formatLong((double)meters / 1000); - } - } - String strHtml2 = "距离 " + "" + dis + "" + " "+disUnit+"" - + "   剩余 " + "" + (int)Math.ceil((double)timeInSecond/ 60f) + "" + " 分钟"; - mCurrentArriveTip.setText(Html.fromHtml(strHtml2)); - } - - private void updateProgressBar(long meters) { - int haveDriven = new Long(meters).intValue(); - int progressInt = SharedPrefsMgr.getInstance(getContext()) - .getInt(BusPassengerConst.BUS_SP_KEY_ORDER_SUM_DIS,0) - haveDriven; - mProgressBar.setProgress(progressInt); - } - - public void setProgressBarMax(){ - int max = SharedPrefsMgr.getInstance(getContext()) - .getInt(BusPassengerConst.BUS_SP_KEY_ORDER_SUM_DIS,0); - mProgressBar.setMax(max); - } - - public void onAutopilotStatusChanged(int status) { - getActivity().runOnUiThread(() -> { - // 3. 其他过程直接更新 - if (mPrevAPStatus != status){ - AutopilotStatusChanged(status); - } - mPrevAPStatus = status; - }); - } - - public void AutopilotStatusChanged(int status) { - if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == status) { - mAutopilotIv.setImageResource(R.drawable.bus_p_auto_nor); - } else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE == status){ - mAutopilotIv.setImageResource(R.drawable.bus_p_un_auto_nor); - } else { - mAutopilotIv.setImageResource(R.drawable.bus_p_un_auto_nor); - } - - } - - public void showOverviewFragment() { - UiThreadHandler.postDelayed(new Runnable() { - @Override - public void run() { - } - },5000L); - } } diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPassengerMapDirectionView.java b/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPassengerMapDirectionView.java index dcc64d082e..193f6e6ced 100644 --- a/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPassengerMapDirectionView.java +++ b/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPassengerMapDirectionView.java @@ -66,7 +66,7 @@ public class BusPassengerMapDirectionView private List mLineMarkers = new ArrayList<>(); - private IBusPassengerMapViewCallback mIBusPassengerMapViewCallback; +// private IBusPassengerMapViewCallback mIBusPassengerMapViewCallback; private BitmapDescriptor mArrivedRes; private BitmapDescriptor mUnArrivedRes; @@ -87,9 +87,9 @@ public class BusPassengerMapDirectionView } } - public void setTaxiPassengerMapViewCallback(IBusPassengerMapViewCallback iBusPassengerMapViewCallback) { - this.mIBusPassengerMapViewCallback = iBusPassengerMapViewCallback; - } +// public void setTaxiPassengerMapViewCallback(IBusPassengerMapViewCallback iBusPassengerMapViewCallback) { +// this.mIBusPassengerMapViewCallback = iBusPassengerMapViewCallback; +// } private void initView(Context context) { CallerLogger.INSTANCE.d(M_BUS_P + TAG, "initView"); @@ -336,7 +336,7 @@ public class BusPassengerMapDirectionView @Override public void onCameraChange(CameraPosition cameraPosition) { - mIBusPassengerMapViewCallback.onCameraChange(cameraPosition.bearing); +// mIBusPassengerMapViewCallback.onCameraChange(cameraPosition.bearing); } @Override diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPassengerRouteFragment.java b/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPassengerRouteFragment.java index d141f4bef7..a1e6fcb047 100644 --- a/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPassengerRouteFragment.java +++ b/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPassengerRouteFragment.java @@ -1,33 +1,34 @@ package com.mogo.och.bus.passenger.ui; -import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P; - +import android.graphics.drawable.AnimationDrawable; import android.os.Bundle; +import android.text.Html; import android.view.View; -import android.view.animation.Animation; -import android.view.animation.RotateAnimation; -import android.widget.ImageView; import android.widget.TextView; import androidx.annotation.NonNull; +import androidx.appcompat.widget.AppCompatImageView; +import androidx.appcompat.widget.AppCompatTextView; import androidx.constraintlayout.widget.ConstraintLayout; +import androidx.constraintlayout.widget.Group; import androidx.recyclerview.widget.RecyclerView; import com.amap.api.maps.model.LatLng; import com.elegant.utils.UiThreadHandler; import com.mogo.commons.debug.DebugConfig; import com.mogo.eagle.core.data.map.MogoLocation; -import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; +import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr; import com.mogo.och.bus.passenger.R; import com.mogo.och.bus.passenger.adapter.BusPassengerLineStationsAdapter; import com.mogo.och.bus.passenger.bean.BusPassengerStation; -import com.mogo.och.bus.passenger.callback.IBusPassengerMapViewCallback; import com.mogo.och.bus.passenger.constant.BusPassengerConst; import com.mogo.och.bus.passenger.presenter.BaseBusPassengerPresenter; import com.mogo.och.bus.passenger.ui.layoutmanager.CenterLayoutManager; import com.mogo.och.bus.passenger.utils.BPRouteDataTestUtils; +import com.mogo.och.common.module.utils.NumberFormatUtil; import com.mogo.och.common.module.wigets.MarqueeTextView; +import com.mogo.och.common.module.wigets.OCHGradientTextView; import java.util.ArrayList; import java.util.List; @@ -37,26 +38,35 @@ import java.util.List; * @date: 2022/4/12 */ public class BusPassengerRouteFragment extends - BusPassengerBaseFragment - implements IBusPassengerMapViewCallback { + BusPassengerBaseFragment { public static final String TAG = "BusPassengerRouteFragment"; private final List mStationsList = new ArrayList<>(); - private TextView mSpeedTv; + private OCHGradientTextView mSpeedTv; private ConstraintLayout mNoLineInfoView; - private TextView mCarPlateNum; private MarqueeTextView mLineName; - private TextView mOperationTime; - private ConstraintLayout mRouteInfoView; + private Group mRouteInfoView; private RecyclerView mStationsListRv; private BusPassengerMapDirectionView mMapDirectionView; - private ImageView mMapArrowIcon; - private RotateAnimation rotateAnimation; - private float lastBearing = 0; +// private ImageView mMapArrowIcon; +// private RotateAnimation rotateAnimation; +// private float lastBearing = 0; private BusPassengerLineStationsAdapter mAdapter; private TextView emptyTv; + private AppCompatImageView mAutopilotIv; + private AppCompatTextView mCurrentArriveStation; + private AppCompatTextView mCurrentArriveStationTitle; + private AppCompatTextView mCurrentArriveTip; + private AppCompatImageView mSpeakArrivedIv; + + /** + * 改变自动驾驶状态 + * + * @param status 2 - running 1 - enable 2 - disable + */ + private int mPrevAPStatus = -1; @Override public int getStationPanelViewId() { @@ -74,13 +84,22 @@ public class BusPassengerRouteFragment extends super.initViews(); mSpeedTv = findViewById(R.id.bus_p_speed_tv); + mSpeedTv.setVertrial(true); + mSpeedTv.setmColorList(new int[]{getResources().getColor(R.color.bus_p_speed_color_start), + getResources().getColor(R.color.bus_p_speed_color_end)}); mNoLineInfoView =findViewById(R.id.bus_p_no_order_data_view); emptyTv = findViewById(R.id.no_order_data_tv); - mCarPlateNum = findViewById(R.id.bus_p_driver_num_plate_tv); +// mCarPlateNum = findViewById(R.id.bus_p_driver_num_plate_tv); mLineName = findViewById(R.id.bus_p_line_name_tv); - mOperationTime = findViewById(R.id.line_operation_time_tv); + mAutopilotIv = findViewById(R.id.auto_status_iv); + mCurrentArriveStation = findViewById(R.id.bus_p_cur_station_name); + mCurrentArriveStationTitle = findViewById(R.id.bus_p_cur_station_title); + mCurrentArriveTip = findViewById(R.id.bus_p_cur_station_tip); + mSpeakArrivedIv = findViewById(R.id.speak_arrived_iv); + +// mOperationTime = findViewById(R.id.line_operation_time_tv); mRouteInfoView = findViewById(R.id.bus_p_line_cl); mStationsListRv = findViewById(R.id.bus_p_line_stations_rl); @@ -90,7 +109,14 @@ public class BusPassengerRouteFragment extends mAdapter = new BusPassengerLineStationsAdapter(getContext(), mStationsList); mStationsListRv.setAdapter(mAdapter); - mMapArrowIcon = findViewById(R.id.bus_p_arrow_nor); +// mMapArrowIcon = findViewById(R.id.bus_p_arrow_nor); + + videoSwitch.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + // TODO: 2023/5/4 漫游视频打开/关闭 + } + }); //测试 if (DebugConfig.isDebug()){ @@ -109,7 +135,6 @@ public class BusPassengerRouteFragment extends super.initViews(savedInstanceState); mMapDirectionView = findViewById(R.id.bus_p_line_map_view); mMapDirectionView.onCreateView(savedInstanceState); - mMapDirectionView.setTaxiPassengerMapViewCallback(this); } @Override @@ -193,6 +218,7 @@ public class BusPassengerRouteFragment extends emptyTv.setText(getString(R.string.bus_p_no_out)); mNoLineInfoView.setVisibility(View.VISIBLE); mRouteInfoView.setVisibility(View.GONE); + mLineName.setText(getContext().getString(R.string.bus_p_no_line)); updateArrivedStation(null,0,true); clearMapView(); clearMapMarkers(); @@ -203,6 +229,7 @@ public class BusPassengerRouteFragment extends if (mNoLineInfoView.getVisibility() == View.GONE){ mNoLineInfoView.setVisibility(View.VISIBLE); mRouteInfoView.setVisibility(View.GONE); + mLineName.setText(getContext().getString(R.string.bus_p_no_line)); updateArrivedStation(null,0,true); clearMapView(); clearMapMarkers(); @@ -217,17 +244,17 @@ public class BusPassengerRouteFragment extends } } - public void updatePlateNum(String plateNum){ - if ("".equals(plateNum) || null == plateNum) { - mCarPlateNum.setText("-- --"); - }else { - mCarPlateNum.setText((plateNum)); - } - } +// public void updatePlateNum(String plateNum){ +// if ("".equals(plateNum) || null == plateNum) { +// mCarPlateNum.setText("-- --"); +// }else { +// mCarPlateNum.setText((plateNum)); +// } +// } public void updateLineInfo(String lineName, String lineDurTime) { mLineName.setText(lineName); - mOperationTime.setText(lineDurTime); +// mOperationTime.setText(lineDurTime); } /** @@ -236,7 +263,7 @@ public class BusPassengerRouteFragment extends * @param currentStationIndex * @param isArrived 是否到站并离开,true 到达当前站 currentStationIndex 未离开, false 正在前往此站 currentStationIndex */ - public void updateStationsInfo(List stations, int currentStationIndex,boolean isArrived) { + public void updateStationsInfo(List stations, int currentStationIndex, boolean isArrived) { updateArrivedStation(stations.get(currentStationIndex).getName(),currentStationIndex,isArrived); mStationsList.clear(); mStationsList.addAll(stations); @@ -260,8 +287,6 @@ public class BusPassengerRouteFragment extends private void updateWayPointList(List stations,int currentStationIndex) { List mLineStationsList = new ArrayList<>(); for (int i = 0; i< stations.size(); i++) {//站点集合 -// LatLng latLng = CoordinateCalculateRouteUtil.coordinateConverterWgsToGcj(getContext() -// ,stations.get(i).getLon(),stations.get(i).getLat());// lat,lon LatLng latLng = new LatLng(stations.get(i).getGcjLat(),stations.get(i).getGcjLon());// lat,lon mLineStationsList.add(latLng); } @@ -276,26 +301,26 @@ public class BusPassengerRouteFragment extends } } - @Override - public void onCameraChange(float bearing) { - startIvCompass(bearing); - } +// @Override +// public void onCameraChange(float bearing) { +//// startIvCompass(bearing); +// } - /** - * 设置指南针旋转 - * - * @param bearing - */ - private void startIvCompass(float bearing) { - bearing = 360 - bearing; - CallerLogger.INSTANCE.d(M_BUS_P + TAG, "startIvCompass: " + bearing); - rotateAnimation = new RotateAnimation(lastBearing, bearing, Animation.RELATIVE_TO_SELF - , 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); - rotateAnimation.setFillAfter(true); - - mMapArrowIcon.startAnimation(rotateAnimation); - lastBearing = bearing; - } +// /** +// * 设置指南针旋转 +// * +// * @param bearing +// */ +// private void startIvCompass(float bearing) { +// bearing = 360 - bearing; +// CallerLogger.INSTANCE.d(M_BUS_P + TAG, "startIvCompass: " + bearing); +// rotateAnimation = new RotateAnimation(lastBearing, bearing, Animation.RELATIVE_TO_SELF +// , 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); +// rotateAnimation.setFillAfter(true); +// +// mMapArrowIcon.startAnimation(rotateAnimation); +// lastBearing = bearing; +// } public void onCarLocationChanged(MogoLocation location) { updateSpeedView((float) location.getGnssSpeed()); @@ -311,4 +336,84 @@ public class BusPassengerRouteFragment extends mStationsListRv.smoothScrollToPosition(position); } } + + public void updateArrivedStation(String station,int currentIndex,boolean isArrived){ + if (null == station){ + mCurrentArriveStation.setText("----"); + mCurrentArriveStationTitle.setText(getResources().getString(R.string.bus_p_cur_station_title_init)); + mCurrentArriveTip.setText(getResources().getString(R.string.bus_p_cur_station_arrived_tip)); + mCurrentArriveTip.setBackgroundResource(R.drawable.cur_station_arrived_bg); + handleArrivingSpeakIconDrawable(); + }else { + mCurrentArriveStation.setText(station); + if (currentIndex == 0){ + mCurrentArriveStationTitle.setText(getResources().getString(R.string.bus_p_cur_station_title_init)); + mCurrentArriveTip.setText(getResources().getString(R.string.bus_p_cur_station_arrived_tip_init)); + mCurrentArriveTip.setBackgroundResource(R.drawable.cur_station_arrived_bg); + handleArrivingSpeakIconDrawable(); + return; + } + if (isArrived){ + mCurrentArriveStationTitle.setText(getResources().getString(R.string.bus_p_cur_station_title)); + mCurrentArriveTip.setText(getResources().getString(R.string.bus_p_cur_station_arrived_tip)); + mCurrentArriveTip.setBackgroundResource(R.drawable.cur_station_arrived_bg); + handleArrivedSpeakIconDrawable(); + }else { + mCurrentArriveStationTitle.setText(getResources().getString(R.string.bus_p_cur_next_station_title)); + mCurrentArriveTip.setBackgroundResource(R.drawable.cur_station_un_arrived_bg); + handleArrivingSpeakIconDrawable(); + } + } + + } + + private void handleArrivedSpeakIconDrawable(){ + AnimationDrawable animationDrawable = (AnimationDrawable) mSpeakArrivedIv.getDrawable(); + animationDrawable.start(); + mSpeakArrivedIv.setVisibility(View.VISIBLE); + } + + private void handleArrivingSpeakIconDrawable(){ + AnimationDrawable animationDrawable = (AnimationDrawable) mSpeakArrivedIv.getDrawable(); + animationDrawable.stop(); + mSpeakArrivedIv.setVisibility(View.GONE); + } + + public void updateRoutePlanningToNextStation(long meters, long timeInSecond){ + //更新进度条 + String dis = "0"; + String disUnit = "公里"; + if (meters > 0){ + if (meters / 1000 < 1){ + disUnit = "米"; + dis = String.valueOf(Math.round(meters)); + }else { + disUnit = "公里"; + dis = NumberFormatUtil.formatLong((double)meters / 1000); + } + } + String strHtml2 = "距离 " + "" + dis + "" + " "+disUnit+"" + + "   剩余 " + "" + (int)Math.ceil((double)timeInSecond/ 60f) + "" + " 分钟"; + mCurrentArriveTip.setText(Html.fromHtml(strHtml2)); + } + + public void onAutopilotStatusChanged(int status) { + getActivity().runOnUiThread(() -> { + // 3. 其他过程直接更新 + if (mPrevAPStatus != status){ + AutopilotStatusChanged(status); + } + mPrevAPStatus = status; + }); + } + + public void AutopilotStatusChanged(int status) { + if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == status) { + mAutopilotIv.setImageResource(R.drawable.bus_p_auto_nor); + } else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE == status){ + mAutopilotIv.setImageResource(R.drawable.bus_p_un_auto_nor); + } else { + mAutopilotIv.setImageResource(R.drawable.bus_p_un_auto_nor); + } + } } diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/auto_close.png b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/auto_close.png new file mode 100644 index 0000000000..bed91e16ee Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/auto_close.png differ diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/auto_open.png b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/auto_open.png new file mode 100644 index 0000000000..8ecc2ca1e9 Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/auto_open.png differ diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bg_bus_p_end_tag_bg.png b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bg_bus_p_end_tag_bg.png new file mode 100644 index 0000000000..a679341790 Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bg_bus_p_end_tag_bg.png differ diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bg_bus_p_start_tag_bg.png b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bg_bus_p_start_tag_bg.png new file mode 100644 index 0000000000..c0fcf5d0ea Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bg_bus_p_start_tag_bg.png differ diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_line_logo.png b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_line_logo.png new file mode 100644 index 0000000000..60064ae514 Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_line_logo.png differ diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_arrive_line_blue.png b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_arrive_line_blue.png new file mode 100644 index 0000000000..88247c204f Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_arrive_line_blue.png differ diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_arrive_line_green.png b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_arrive_line_green.png new file mode 100644 index 0000000000..0fd2398cfb Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_arrive_line_green.png differ diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_blue_tooth_close.png b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_blue_tooth_close.png new file mode 100644 index 0000000000..0c292d2cf3 Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_blue_tooth_close.png differ diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_blue_tooth_open.png b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_blue_tooth_open.png new file mode 100644 index 0000000000..cccf9e10fa Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_blue_tooth_open.png differ diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_map_arrow_arrived.png b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_map_arrow_arrived.png index 445906d280..fea5cfd033 100644 Binary files a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_map_arrow_arrived.png and b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_map_arrow_arrived.png differ diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_map_arrow_un_arrive.png b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_map_arrow_un_arrive.png index 99d8bd7b56..254662d297 100644 Binary files a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_map_arrow_un_arrive.png and b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_map_arrow_un_arrive.png differ diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_no_order_data.png b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_no_order_data.png index a1a5aed070..65625ca374 100755 Binary files a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_no_order_data.png and b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_no_order_data.png differ diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_point_blue.png b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_point_blue.png index bc88e93c1d..ef08c49f25 100755 Binary files a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_point_blue.png and b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_point_blue.png differ diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_point_gray.png b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_point_gray.png index ca325eb42e..deec63de9d 100755 Binary files a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_point_gray.png and b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_point_gray.png differ diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_route_bg.png b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_route_bg.png new file mode 100644 index 0000000000..5c4f302cc2 Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_route_bg.png differ diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_status_bar_logo.png b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_status_bar_logo.png new file mode 100644 index 0000000000..ffaacad3c6 Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/bus_p_status_bar_logo.png differ diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/card_split_line_bg.png b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/card_split_line_bg.png new file mode 100644 index 0000000000..2f392c64b6 Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/card_split_line_bg.png differ diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/cur_station_arrived_bg.png b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/cur_station_arrived_bg.png new file mode 100644 index 0000000000..355af19afc Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/cur_station_arrived_bg.png differ diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/cur_station_un_arrived_bg.png b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/cur_station_un_arrived_bg.png new file mode 100644 index 0000000000..ea4214cf51 Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/cur_station_un_arrived_bg.png differ diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/icon_video_close.png b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/icon_video_close.png new file mode 100644 index 0000000000..8cf2c79113 Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/icon_video_close.png differ diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/icon_video_open.png b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/icon_video_open.png new file mode 100644 index 0000000000..db33b7ae2a Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/icon_video_open.png differ diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/m2_blue_tooth_open.png b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/m2_blue_tooth_open.png new file mode 100644 index 0000000000..cccf9e10fa Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/m2_blue_tooth_open.png differ diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/route_line_name_bg.png b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/route_line_name_bg.png new file mode 100644 index 0000000000..a680b6ea18 Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/route_line_name_bg.png differ diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/speak_arrived_icon_0.png b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/speak_arrived_icon_0.png new file mode 100644 index 0000000000..24a13e704e Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/speak_arrived_icon_0.png differ diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/speak_arrived_icon_1.png b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/speak_arrived_icon_1.png new file mode 100644 index 0000000000..c15a70a3ee Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/speak_arrived_icon_1.png differ diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/speak_arrived_icon_2.png b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/speak_arrived_icon_2.png new file mode 100644 index 0000000000..8c1c118673 Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable-nodpi/speak_arrived_icon_2.png differ diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable/bg_bus_p_end_tag_bg.xml b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable/bg_bus_p_end_tag_bg.xml deleted file mode 100644 index ca8ad81fe2..0000000000 --- a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable/bg_bus_p_end_tag_bg.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable/bg_bus_p_start_tag_bg.xml b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable/bg_bus_p_start_tag_bg.xml deleted file mode 100644 index 7a6d44a4c8..0000000000 --- a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable/bg_bus_p_start_tag_bg.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable/bg_p_speak_icon_arrived.xml b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable/bg_p_speak_icon_arrived.xml new file mode 100644 index 0000000000..a007c6d711 --- /dev/null +++ b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable/bg_p_speak_icon_arrived.xml @@ -0,0 +1,8 @@ + + + + + + + \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable/bg_status_bar.xml b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable/bg_status_bar.xml new file mode 100644 index 0000000000..36611a9a99 --- /dev/null +++ b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable/bg_status_bar.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable/bus_p_route_bg.xml b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable/bus_p_route_bg.xml deleted file mode 100644 index 94dd7c0007..0000000000 --- a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable/bus_p_route_bg.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable/video_btn_selector.xml b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable/video_btn_selector.xml new file mode 100755 index 0000000000..eaa4ae264e --- /dev/null +++ b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/drawable/video_btn_selector.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/bus_p_base_fragment.xml b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/bus_p_base_fragment.xml index 06f31d335e..b01c1ffe3d 100644 --- a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/bus_p_base_fragment.xml +++ b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/bus_p_base_fragment.xml @@ -6,12 +6,18 @@ + + - - - - - - - - - - - - - - - - - - - - - + app:layout_constraintTop_toTopOf="parent"/> - - + + + \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/bus_p_no_data_common_view.xml b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/bus_p_no_data_common_view.xml index 2eefe569cf..83dad197cf 100644 --- a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/bus_p_no_data_common_view.xml +++ b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/bus_p_no_data_common_view.xml @@ -18,7 +18,7 @@ android:id="@+id/no_order_data_tv" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textColor="@color/bus_p_no_data_color" + android:textColor="@color/bus_p_speed_txt_color" android:textSize="@dimen/bus_p_no_data_size" android:layout_marginTop="50dp" app:layout_constraintLeft_toLeftOf="parent" diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/bus_p_route_fragment.xml b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/bus_p_route_fragment.xml index 8567a7a783..ce540144cd 100644 --- a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/bus_p_route_fragment.xml +++ b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/bus_p_route_fragment.xml @@ -3,32 +3,62 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" + android:padding="@dimen/dp_40" android:background="@android:color/transparent"> - - - + + + + + + + + + + + + + + + - + + + + - + android:src="@drawable/auto_close" + app:layout_constraintLeft_toLeftOf="@+id/bus_p_speed_tv" + app:layout_constraintTop_toBottomOf="@+id/bus_p_speed_tv"/> + + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintTop_toTopOf="@+id/bus_p_speed_tv" /> + + + + + + + + + + + + + + + + + + + app:layout_constraintTop_toBottomOf="@+id/split_line_iv" /> - + android:layout_marginTop="@dimen/dp_76" + android:paddingBottom="@dimen/dp_20" + android:paddingLeft="@dimen/dp_30" + android:paddingRight="@dimen/bus_p_route_info_margin_right" + android:requiresFadingEdge="vertical" + app:layout_constraintLeft_toLeftOf="@+id/bus_p_driver_num_plate_tv" + app:layout_constraintTop_toBottomOf="@+id/bus_p_cur_station_name" /> - - + - - - - - - - + - - - + + + + + + + + + + + \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/bus_p_stations_common_item.xml b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/bus_p_stations_common_item.xml index 33dfb22485..79f3639f39 100644 --- a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/bus_p_stations_common_item.xml +++ b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/bus_p_stations_common_item.xml @@ -46,8 +46,7 @@ android:layout_width="@dimen/dp_12" android:layout_height="@dimen/dp_61" android:scaleType="fitXY" - android:layout_marginLeft="8dp" - android:src="@drawable/bus_p_line_blue" + android:background="@color/acc_default_txt_color" app:layout_constraintLeft_toLeftOf="@+id/bus_p_circle" app:layout_constraintRight_toRightOf="@+id/bus_p_circle" app:layout_constraintTop_toTopOf="parent"/> diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/p_bus_view_blue_tooth.xml b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/p_bus_view_blue_tooth.xml new file mode 100644 index 0000000000..69ae14c394 --- /dev/null +++ b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/p_bus_view_blue_tooth.xml @@ -0,0 +1,15 @@ + + + + + + \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/p_bus_view_status_bar.xml b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/p_bus_view_status_bar.xml new file mode 100644 index 0000000000..fef63bbd25 --- /dev/null +++ b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/p_bus_view_status_bar.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/values/colors.xml b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/values/colors.xml index 8e63faf83d..f90349cbaf 100644 --- a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/values/colors.xml +++ b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/values/colors.xml @@ -1,10 +1,10 @@ - #2D3E5F + #5D7199 #CCE9EFFC #C7D2E1 #2D3E5F - #0043FF + #203555 #2D3E5F #596A8A #D8E5F8 @@ -27,4 +27,12 @@ #33394C63 #2D3E5F #33394C63 + + #43CEFE + #1466FB + + #17417B + #6617417B + #A9B6CA + #1F82FB \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/values/dimens.xml b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/values/dimens.xml index e738022b0d..5d1346c20b 100644 --- a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/values/dimens.xml +++ b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/values/dimens.xml @@ -1,13 +1,13 @@ - 700dp + 750dp 40dp 40dp - 40dp + 48dp 40dp 110dp 224dp - 510dp + 422dp 3dp 158dp @@ -23,14 +23,14 @@ 224dp 50dp 50dp - 44dp + 34dp 130dp 38dp - 36dp + 38dp - 110dp - 42dp + 90dp + 27dp 4dp 10dp diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/values/strings.xml b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/values/strings.xml index f921f5e2f3..de49ef21bc 100644 --- a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/values/strings.xml +++ b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/values/strings.xml @@ -1,13 +1,14 @@ - + KM/H 您已收车 暂无班次 + 暂无线路 - 到达站: - 下一站: + 已到站: + 前方到站: 始发站: - 请携带好随身物品下车。 - 欢迎乘坐\'蘑菇车联\'自动驾驶车。 + 请按秩序下车 + 欢迎乘坐蘑菇车联自动驾驶车。 \ No newline at end of file diff --git a/OCH/mogo-och-charter/src/driverm1/java/com/magic/mogo/och/charter/bean/WriteOffPassenger.java b/OCH/mogo-och-charter/src/driverm1/java/com/magic/mogo/och/charter/bean/WriteOffPassenger.java new file mode 100644 index 0000000000..1c97a9edbd --- /dev/null +++ b/OCH/mogo-och-charter/src/driverm1/java/com/magic/mogo/och/charter/bean/WriteOffPassenger.java @@ -0,0 +1,14 @@ +package com.magic.mogo.och.charter.bean; + +import java.io.Serializable; + +/** + * @author: wangmingjun + * @date: 2022/9/23 + */ +public class WriteOffPassenger implements Serializable { + public String phone; + public String orderNo; + public int passengerSize; + public long writeOffTime; +} diff --git a/OCH/mogo-och-charter/src/driverm1/java/com/magic/mogo/och/charter/model/DriverM1Model.kt b/OCH/mogo-och-charter/src/driverm1/java/com/magic/mogo/och/charter/model/DriverM1Model.kt index 0b4159854c..c2c7f0a36a 100644 --- a/OCH/mogo-och-charter/src/driverm1/java/com/magic/mogo/och/charter/model/DriverM1Model.kt +++ b/OCH/mogo-och-charter/src/driverm1/java/com/magic/mogo/och/charter/model/DriverM1Model.kt @@ -7,10 +7,7 @@ import com.alibaba.android.arouter.utils.TextUtils import com.amap.api.maps.model.LatLng import com.elegant.network.utils.GsonUtil import com.magic.mogo.och.charter.R -import com.magic.mogo.och.charter.bean.CheckOrderCountDownResponse -import com.magic.mogo.och.charter.bean.QueryBusinessStatusResponse -import com.magic.mogo.och.charter.bean.QueryCurrentOrderResponse -import com.magic.mogo.och.charter.bean.QueryRoutesResponse +import com.magic.mogo.och.charter.bean.* import com.magic.mogo.och.charter.callback.ChangeDestCallback import com.magic.mogo.och.charter.callback.DriverM1OrderCallback import com.magic.mogo.och.charter.callback.IDriverM1ControllerStatusCallback @@ -33,11 +30,13 @@ import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02Lis import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager.sendMsgToAllClients import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.i import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant import com.mogo.eagle.core.utilcode.util.* import com.mogo.och.common.module.bean.dpmsg.* import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager.pushAppOperationalMsgBox +import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager.registerSocketMessageListener import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager.releaseSocketMessageListener import com.mogo.och.common.module.biz.common.socketmessage.data.* import com.mogo.och.common.module.biz.constant.OchCommonConst @@ -114,18 +113,24 @@ class DriverM1Model { OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(mAdasStartFailureListener) // 监听运营信息 - OCHSocketMessageManager.registerSocketMessageListener( + registerSocketMessageListener( OCHSocketMessageManager.msgMonitorType, mOnSystemMessageListener) //监听开门 - OCHSocketMessageManager.registerSocketMessageListener( + registerSocketMessageListener( OCHSocketMessageManager.msgOperateDoorType, mOnDoorMessageListener) //监听订单结束 - OCHSocketMessageManager.registerSocketMessageListener( + registerSocketMessageListener( OCHSocketMessageManager.msgOrderClosedType, mOnOrderClosedMessageListener) + //监听核销乘客 + registerSocketMessageListener( //监听核销乘客 + OCHSocketMessageManager.msgWriteOffPassengerType, + mWriteOffPassengerOnMessageListener + ) + //监听乘客屏发来的消息 CallerTelematicListenerManager.addListener(TAG,mReceivedMsgListener) @@ -225,13 +230,12 @@ class DriverM1Model { ChangeDestMsg::class.java) as ChangeDestMsg currentChangeDestMsg = changeDestMsg showChangerDestCommitDialog(changeDestMsg) - }else if (msg.type == DPMsgType.TYPE_TASK_DETAILS.type){ - // TODO: 本地拿到订单状态变更 - val changeDestMsg = GsonUtils.fromJson(String(byteArray), - ChangeDestMsg::class.java) as ChangeDestMsg + }else if (msg.type == DPMsgType.TYPE_ARRIVEDEST_STATUS.type){ //乘客屏到站同步 + val arriveDestMsg = GsonUtils.fromJson(String(byteArray), + ArriveDestMsg::class.java) as ArriveDestMsg - // 乘客屏同步的状态信息同步给报站屏, 1、选定目的地成功后同步 2、到站同步 3、包车时间结束同步 - sendMsgToClient(changeDestMsg) + // 2、到站同步 + sendMsgToClient(arriveDestMsg) } d(SceneConstant.M_CHARTER_D,"onReceivedMsg = "+ GsonUtils.toJson(msg)) }catch (e: Exception){ @@ -302,6 +306,21 @@ class DriverM1Model { } } + private val mWriteOffPassengerOnMessageListener: IMogoOnMessageListener = + object : IMogoOnMessageListener { + override fun target(): Class { + return WriteOffPassenger::class.java + } + + override fun onMsgReceived(passenger: WriteOffPassenger?) { + //进行播报 + i(SceneConstant.M_BUS + TAG, "passenger = " + GsonUtil.jsonFromObject(passenger)) + if (passenger != null && passenger.passengerSize == 0) return + val appMsg = AppConnectMsg(false,true,"核销成功,${passenger?.passengerSize}人乘车") + sendMsgToClient(appMsg) + } + } + fun pushOperationalToMsgBox(time : Long,content : String,type: Int = -1){ playDI() pushAppOperationalMsgBox(time, content,type) @@ -463,7 +482,7 @@ class DriverM1Model { * 将业务订单信息保存,鹰眼可取用 */ fun updateAutopilotControlParameters() { - // TODO: 业务信息保存 + // 业务信息保存 val parameters = initAutopilotControlParameters() if (null == parameters) { d(SceneConstant.M_CHARTER_D + TAG, "AutopilotControlParameters is empty.") diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/DriverMoFangFunctionManager.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/DriverMoFangFunctionManager.kt index ed36b2727f..6b4d5a6194 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/DriverMoFangFunctionManager.kt +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/DriverMoFangFunctionManager.kt @@ -1,9 +1,10 @@ package com.mogo.och.common.module.manager import android.annotation.SuppressLint -import android.content.Context +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.sendOperatorSetAcceleratedSpeed import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.sendOperatorSetHorn +import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant import java.util.* @@ -33,6 +34,7 @@ class DriverMoFangFunctionManager private constructor() { timerAcc = Timer() timerAcc!!.schedule(object : TimerTask() { override fun run() { + d(SceneConstant.M_CHARTER_D + TAG,"sendOperatorSetAcceleratedSpeed $isSend $acc") sendOperatorSetAcceleratedSpeed(acc) } }, 0, 500) @@ -42,11 +44,13 @@ class DriverMoFangFunctionManager private constructor() { timerAcc!!.cancel() timerAcc = null } + d(SceneConstant.M_CHARTER_D + TAG,"sendOperatorSetAcceleratedSpeed $isSend $acc") sendOperatorSetAcceleratedSpeed(acc) } } fun reset(){ + d(SceneConstant.M_CHARTER_D + TAG,"sendAcc false 0.0") sendAcc(false,0.0) } @@ -54,12 +58,14 @@ class DriverMoFangFunctionManager private constructor() { * 鸣笛,鸣笛需要手动结束 */ fun sendOperatorSetHornByDriver(){ + d(SceneConstant.M_CHARTER_D + TAG,"sendOperatorSetHorn(1.0)") sendOperatorSetHorn(1.0) if (timerHorn == null) { timerHorn = Timer() } timerHorn!!.schedule(object : TimerTask() { override fun run() { + d(SceneConstant.M_CHARTER_D + TAG,"sendOperatorSetHorn(2.0)") sendOperatorSetHorn(2.0) timerHorn = null } diff --git a/app/build.gradle b/app/build.gradle index 5cdf09452f..e851978795 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -263,7 +263,11 @@ android { buildConfigField 'String', 'URLs', "\"${readFileToJson("dali").replace("\"", "\\\"")}\"" buildConfigField 'String', 'tempConfig', "\"${readFileToJsonTemp("dali").replace("\"", "\\\"")}\"" } - + fuzhou { + dimension "project" + buildConfigField 'String', 'URLs', "\"${readFileToJson("fuzhou").replace("\"", "\\\"")}\"" + buildConfigField 'String', 'tempConfig', "\"${readFileToJsonTemp("fuzhou").replace("\"", "\\\"")}\"" + } // 配置网络环境,QA、线上、演示 qa { dimension "env" @@ -489,7 +493,7 @@ def variantName() { if (taskName.contains("Yantai")) { project.dependencies.add('implementation', project.project(':tts:tts-iflytek')) - }else if (taskName.contains("Mogo")) { + }else if (taskName.contains("Mogo") || taskName.contains("Fuzhou")) { project.dependencies.add('implementation', project.project(':tts:tts-pad')) }else if (taskName.contains("Dali")) { project.dependencies.add('implementation', project.project(':tts:tts-pad')) diff --git a/app/config/tempConfig.json b/app/config/tempConfig.json index b4482bbd28..44007f1d89 100644 --- a/app/config/tempConfig.json +++ b/app/config/tempConfig.json @@ -196,5 +196,87 @@ } ] } + }, + "fuzhou": { + "shuttlepassenger": { + "ads": [ + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357256102/1.jpg", + "type": 0, + "cacheImgPath": "", + "title": "1" + }, + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357382357/2.png", + "type": 0, + "cacheImgPath": "", + "title": "2" + }, + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357557335/3.mp4", + "type": 1, + "cacheImgPath": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357382357/2.png", + "title": "3" + }, + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357598483/4.jpg", + "type": 0, + "cacheImgPath": "", + "title": "4" + }, + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357834634/5.m4v", + "type": 0, + "cacheImgPath": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357598483/4.jpg", + "title": "5" + }, + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676358660379/6.m4v", + "type": 1, + "cacheImgPath": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357598483/4.jpg", + "title": "6" + }, + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360154589/7.jpg", + "type": 0, + "cacheImgPath": "", + "title": "7" + }, + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360185500/8.jpg", + "type": 0, + "cacheImgPath": "", + "title": "8" + }, + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360224773/9.png", + "type": 0, + "cacheImgPath": "", + "title": "9" + }, + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360274126/10.mp4", + "type": 1, + "cacheImgPath": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360224773/9.png", + "title": "10" + } + ] + }, + "shuttlepassengerm2": { + "ads": [ + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1681716116231/6923474a99a1983c9a0410ad3357888d.mov", + "type": 1, + "cacheImgPath": "", + "title": "1" + }, + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1681716116231/6923474a99a1983c9a0410ad3357888d.mov", + "type": 1, + "cacheImgPath": "", + "title": "2" + } + ] + } } } diff --git a/app/config/urlConfig.json b/app/config/urlConfig.json index 1179ea5438..5bba240f8e 100644 --- a/app/config/urlConfig.json +++ b/app/config/urlConfig.json @@ -103,5 +103,40 @@ "bind_driver_qr_url": "https://tech.zhidaohulian.com?pipe=ytsafety&sn=%1$s", "chart_socket_url":"" } + }, + "fuzhou": { + "qa": { + "och_url": "https://och-a.zhidaozhixing.com", + "shuttle_url": "https://och-a.zhidaozhixing.com", + "passport_url": "https://och-a.zhidaozhixing.com/arch/passport/", + "socket_base_url": "https://och-a.zhidaozhixing.com/arch/push/", + "socket_tech_url": "https://och-a.zhidaozhixing.com/arch/", + "eagle_mis_url": "http://eagle-mis-a.zhidaozhixing.com/", + "eagle_dns_url": "http://eagle-dns-a.zhidaozhixing.com/", + "bind_driver_qr_url": "https://tech.zhidaohulian.com?pipe=asafety&sn=%1$s", + "chart_socket_url":"" + }, + "online": { + "och_url": "https://tech.zhidaohulian.com", + "shuttle_url": "https://mogogo-driver.zhidaozhixing.com", + "passport_url": "https://mogogo-driver.zhidaozhixing.com/arch/passport/", + "socket_base_url": "https://mogogo-driver.zhidaozhixing.com/arch/push/", + "socket_tech_url": "https://mogogo-driver.zhidaozhixing.com/arch/", + "eagle_mis_url": "https://mogogo.zhidaozhixing.com/", + "eagle_dns_url": "https://mogogo.zhidaozhixing.com/", + "bind_driver_qr_url": "https://tech.zhidaohulian.com?pipe=asafety&sn=%1$s", + "chart_socket_url":"" + }, + "demo": { + "och_url": "http://tech-dev.zhidaohulian.com", + "shuttle_url": "https://mogogo-driver.zhidaozhixing.com", + "passport_url": "https://mogogo-driver.zhidaozhixing.com/arch/passport/", + "socket_base_url": "https://mogogo-driver.zhidaozhixing.com/arch/push/", + "socket_tech_url": "https://mogogo-driver.zhidaozhixing.com/arch/", + "eagle_mis_url": "https://mogogo.zhidaozhixing.com/", + "eagle_dns_url": "https://mogogo.zhidaozhixing.com/", + "bind_driver_qr_url": "", + "chart_socket_url":"" + } } } diff --git a/app/productFlavors/flavorsFilterConfig.gradle b/app/productFlavors/flavorsFilterConfig.gradle new file mode 100644 index 0000000000..e69de29bb2 diff --git a/app/script/flavorfilter/flavors.json b/app/script/flavorfilter/flavors.json index 9fd192a912..af845a607e 100644 --- a/app/script/flavorfilter/flavors.json +++ b/app/script/flavorfilter/flavors.json @@ -47,5 +47,11 @@ "driver": ["ochM1"], "passenger": ["ochM1"] } + }, + "fuzhou": { + "shuttle" :{ + "driver": ["ochJL","ochM2"], + "passenger": ["ochJL","ochM2"] + } } } \ No newline at end of file