diff --git a/.gitignore b/.gitignore index 3ec053d928..f11e27d274 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ /build /captures .externalNativeBuild -.cxx \ No newline at end of file +.cxx +.gitlab-ci.yml \ No newline at end of file diff --git a/OCH/bus/driver/src/jinlvvan/java/com/mogo/och/bus/model/OrderModel.java b/OCH/bus/driver/src/jinlvvan/java/com/mogo/och/bus/model/OrderModel.java index 0c12f4cad9..84d8af86be 100644 --- a/OCH/bus/driver/src/jinlvvan/java/com/mogo/och/bus/model/OrderModel.java +++ b/OCH/bus/driver/src/jinlvvan/java/com/mogo/och/bus/model/OrderModel.java @@ -7,7 +7,6 @@ import static com.mogo.och.bus.constant.BusConst.STATION_STATUS_STOPPED; import android.content.Context; import android.os.Handler; -import android.os.Message; import android.text.TextUtils; import androidx.annotation.NonNull; @@ -81,7 +80,6 @@ import java.util.ArrayList; import java.util.List; import io.reactivex.exceptions.UndeliverableException; -import io.reactivex.functions.Consumer; import io.reactivex.plugins.RxJavaPlugins; import mogo.telematics.pad.MessagePad; @@ -98,6 +96,7 @@ public class OrderModel { private int backgroundCurrentStationIndex = 0;//A->B 此处值是A站点索引 private static volatile OrderModel sInstance; + private static final byte[] obj = new byte[0]; private Context mContext; private final List stationList = new ArrayList<>(); private BusRoutesResult busRoutesResult = null; @@ -125,20 +124,20 @@ public class OrderModel { private LoginService loginService; - private final Handler handler = new Handler(new Handler.Callback() { - @Override - public boolean handleMessage(Message msg) { - if (msg.what == MSG_QUERY_BUS_STATION) { - queryBusRoutes(); - return true; - } - return false; + private final Handler handler = new Handler(msg -> { + if (msg.what == MSG_QUERY_BUS_STATION) { + queryBusRoutes(); + return true; } + return false; }); + private OrderModel() { + } + public static OrderModel getInstance() { if (sInstance == null) { - synchronized (OrderModel.class) { + synchronized (obj) { if (sInstance == null) { sInstance = new OrderModel(); } @@ -147,10 +146,6 @@ public class OrderModel { return sInstance; } - private OrderModel() { - - } - public void init() { mContext = AbsMogoApplication.getApp(); loginService = (LoginService) ARouter.getInstance().build(OchCommonConst.LOGINSERVICE).navigation(); @@ -171,7 +166,7 @@ public class OrderModel { OCHSocketMessageManager.INSTANCE.registerSocketMessageListener(//监听核销乘客 OCHSocketMessageManager.msgWriteOffPassengerType, - mWriteOffPassengeOnMessageListener); + mWriteOffPassengerOnMessageListener); AbnormalFactorsLoopManager.INSTANCE.startLoopAbnormalFactors(mContext); @@ -180,38 +175,35 @@ public class OrderModel { //2022.1.28 // 调用Disposable.dispose() 时候会出现InterruptedException 导致出现崩溃 // The exception could not be delivered to the consumer because it has already canceled/disposed - // the flow or the excTeption has nowhere to go to begin with - RxJavaPlugins.setErrorHandler(new Consumer() { - @Override - public void accept(Throwable e) { - if (e instanceof UndeliverableException) { - e = e.getCause(); - CallerLogger.d(M_BUS + TAG, "UndeliverableException"); - } - if ((e instanceof IOException)) {// - // fine, irrelevant network problem or API that throws on cancellation - CallerLogger.d(M_BUS + TAG, "IOException"); - return; - } - if (e instanceof InterruptedException) { - // fine, some blocking code was interrupted by a dispose call - CallerLogger.d(M_BUS + TAG, "InterruptedException"); - return; - } - if ((e instanceof NullPointerException) || (e instanceof IllegalArgumentException)) { - // that's likely a bug in the application - CallerLogger.d(M_BUS + TAG, "NullPointerException or IllegalArgumentException"); - Thread.currentThread().getUncaughtExceptionHandler().uncaughtException(Thread.currentThread(), e); - return; - } - if (e instanceof IllegalStateException) { - // that's a bug in RxJava or in a custom operator - CallerLogger.d(M_BUS + TAG, "IllegalStateException"); - Thread.currentThread().getUncaughtExceptionHandler().uncaughtException(Thread.currentThread(), e); - return; - } - CallerLogger.d(M_BUS + TAG, "Undeliverable exception"); + // the flow or the exception has nowhere to go to begin with + RxJavaPlugins.setErrorHandler(e -> { + if (e instanceof UndeliverableException) { + e = e.getCause(); + CallerLogger.d(M_BUS + TAG, "UndeliverableException"); } + if ((e instanceof IOException)) { + // fine, irrelevant network problem or API that throws on cancellation + CallerLogger.d(M_BUS + TAG, "IOException"); + return; + } + if (e instanceof InterruptedException) { + // fine, some blocking code was interrupted by a dispose call + CallerLogger.d(M_BUS + TAG, "InterruptedException"); + return; + } + if ((e instanceof NullPointerException) || (e instanceof IllegalArgumentException)) { + // that's likely a bug in the application + CallerLogger.d(M_BUS + TAG, "NullPointerException or IllegalArgumentException"); + Thread.currentThread().getUncaughtExceptionHandler().uncaughtException(Thread.currentThread(), e); + return; + } + if (e instanceof IllegalStateException) { + // that's a bug in RxJava or in a custom operator + CallerLogger.d(M_BUS + TAG, "IllegalStateException"); + Thread.currentThread().getUncaughtExceptionHandler().uncaughtException(Thread.currentThread(), e); + return; + } + CallerLogger.d(M_BUS + TAG, "Undeliverable exception"); }); } @@ -234,7 +226,7 @@ public class OrderModel { } }; - private final IMogoOnMessageListener mWriteOffPassengeOnMessageListener = + private final IMogoOnMessageListener mWriteOffPassengerOnMessageListener = new IMogoOnMessageListener() { @Override public Class target() { @@ -272,11 +264,8 @@ public class OrderModel { this.mControllerStatusCallback = callback; } - private final ITrajectoryListener trajectoryListener = new ITrajectoryListener() { - @Override - public void trajectoryCallback(@NonNull List routeArrivied, @NonNull List routeArriving, @NonNull MogoLocation location) { + private final ITrajectoryListener trajectoryListener = (routeArrivied, routeArriving, location) -> { - } }; private final IMoGoPlanningRottingListener moGoAutopilotPlanningListener = new IMoGoPlanningRottingListener() { @@ -361,11 +350,6 @@ public class OrderModel { TrajectoryAndDistanceManager.INSTANCE.removeListener(TAG); } - private Object readResolve() { - // 阻止反序列化,必须实现 Serializable 接口 - return sInstance; - } - private final IMogoStatusChangedListener mMogoStatusChangedListener = new IMogoStatusChangedListener() { // VR mode变更回调 @Override @@ -444,8 +428,6 @@ public class OrderModel { CallerLogger.d(M_BUS + TAG, "judgeArrivedStation() = 刚过站且在15m内"); onArriveAt(null); //无自动驾驶到站信息传null } - - return; } } @@ -621,10 +603,7 @@ public class OrderModel { leaveTTSTips(nextStation,nextStationKr); if (busRoutesResult != null) { - boolean isLastStop = false; - if (leaveIndex + 1 == stationList.size() - 1) { - isLastStop = true; - } + boolean isLastStop = leaveIndex + 1 == stationList.size() - 1; //给bus外屏发送 BusSendTripInfoManager.INSTANCE.sendBusTripInfo(BusSendTripInfoManager.LEAVE_STATION , busRoutesResult.getName() @@ -768,10 +747,7 @@ public class OrderModel { private void arriveStationSuccess(int arrivedStationIndex, String departureStopName, String arriveStation, String arriveStationKr) { if (busRoutesResult != null) { - boolean isLastStop = false; - if (arrivedStationIndex == busRoutesResult.getSites().size() - 1) { - isLastStop = true; - } + boolean isLastStop = arrivedStationIndex == busRoutesResult.getSites().size() - 1; //给bus外屏发送 BusSendTripInfoManager.INSTANCE.sendBusTripInfo(BusSendTripInfoManager.ARRIVE_STATION , busRoutesResult.getName() @@ -845,12 +821,7 @@ public class OrderModel { //车站10s后播报 private void leaveTTSTips(String nextStation,String nextStationKr) { - UiThreadHandler.postDelayed(new Runnable() { - @Override - public void run() { - VoiceManager.INSTANCE.leaveStationBus(nextStation,nextStationKr); - } - },DELAY_10S); + UiThreadHandler.postDelayed(() -> VoiceManager.INSTANCE.leaveStationBus(nextStation,nextStationKr),DELAY_10S); } /** @@ -981,16 +952,12 @@ public class OrderModel { } } - Runnable tip3Runnable = new Runnable() { - @Override - public void run() { - - if (backgroundCurrentStationIndex == 0 && stationList.get(0).getDrivingStatus() == STATION_STATUS_STOPPED - && !stationList.get(0).isLeaving()){ - tipStartTask("3"); - }else { - removeTipRunnables(); - } + Runnable tip3Runnable = () -> { + if (backgroundCurrentStationIndex == 0 && stationList.get(0).getDrivingStatus() == STATION_STATUS_STOPPED + && !stationList.get(0).isLeaving()){ + tipStartTask("3"); + }else { + removeTipRunnables(); } }; @@ -1005,16 +972,11 @@ public class OrderModel { VoiceNotice.showNotice(tips); } - Runnable tip1Runnable = new Runnable() { - @Override - public void run() { - if (backgroundCurrentStationIndex == 0 && stationList != null && - stationList.get(0).getDrivingStatus() == STATION_STATUS_STOPPED - && !stationList.get(0).isLeaving()){ - tipStartTask("1"); - }else { - removeTipRunnables(); - } + Runnable tip1Runnable = () -> { + if (backgroundCurrentStationIndex == 0 && stationList.get(0).getDrivingStatus() == STATION_STATUS_STOPPED && !stationList.get(0).isLeaving()){ + tipStartTask("1"); + }else { + removeTipRunnables(); } }; @@ -1205,7 +1167,7 @@ public class OrderModel { } public void triggerStartServiceEvent(boolean isRestart, boolean send) { - if (stationList == null || backgroundCurrentStationIndex >= stationList.size() - 1) { + if (backgroundCurrentStationIndex >= stationList.size() - 1) { return; } BusStationBean currentStation = stationList.get(backgroundCurrentStationIndex); @@ -1215,7 +1177,7 @@ public class OrderModel { } public void triggerUnableStartAPReasonEvent() { - if (stationList == null || backgroundCurrentStationIndex >= stationList.size() - 1) { + if (backgroundCurrentStationIndex >= stationList.size() - 1) { return; } BusStationBean currentStation = stationList.get(backgroundCurrentStationIndex); @@ -1253,8 +1215,8 @@ public class OrderModel { } private AutopilotControlParameters initAutopilotControlParameters(int leaveIndex) { - BusStationBean currentStation = null; - BusStationBean nextStation = null; + BusStationBean currentStation; + BusStationBean nextStation; if (leaveIndex < 0) { if (backgroundCurrentStationIndex + 1 > stationList.size() - 1 || !isGoingToNextStation) { diff --git a/OCH/bus/driver/src/main/java/com/mogo/och/bus/bean/BusRoutesResult.java b/OCH/bus/driver/src/main/java/com/mogo/och/bus/bean/BusRoutesResult.java index 4b652d30df..66b7189524 100644 --- a/OCH/bus/driver/src/main/java/com/mogo/och/bus/bean/BusRoutesResult.java +++ b/OCH/bus/driver/src/main/java/com/mogo/och/bus/bean/BusRoutesResult.java @@ -46,7 +46,7 @@ public class BusRoutesResult { return sites; } - public void setSite(List site) { + public void setSites(List sites) { this.sites = sites; } diff --git a/OCH/bus/driver/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java b/OCH/bus/driver/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java index 43eebbf35c..bedb5d6436 100644 --- a/OCH/bus/driver/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java +++ b/OCH/bus/driver/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java @@ -22,7 +22,6 @@ import androidx.constraintlayout.widget.Group; 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.IMoGoAutopilotRecordListener; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager; @@ -60,7 +59,7 @@ import record_cache.RecordPanelOuterClass; * * @author tongchenfei */ -public abstract class BaseBusTabFragment> extends MvpFragment implements IMogoMapListener, IMoGoAutopilotRecordListener { +public abstract class BaseBusTabFragment> extends MvpFragment implements IMogoMapListener { private static final String TAG = "BaseBusTabFragment"; @@ -206,7 +205,6 @@ public abstract class BaseBusTabFragment if (mBadcaseBtn != null) { CallerDevaToolsManager.INSTANCE.initBadCase(mBadcaseBtn); - CallerAutopilotRecordListenerManager.INSTANCE.addListener(TAG, this); } //消息盒子 @@ -299,18 +297,6 @@ public abstract class BaseBusTabFragment EventBus.getDefault().unregister(this); } - @Override - public void onAutopilotRecordResult(@Nullable RecordPanelOuterClass.RecordPanel recordPanel) { - } - - @Override - public void onAutopilotRecordConfig(@NonNull MessagePad.RecordDataConfig config) { - } - - @Override - public void onBagManagerResult(@NonNull BagManagerOuterClass.BagManager bagManager) { - } - /** * 测试到站 */ diff --git a/OCH/bus/driver/src/main/java/com/mogo/och/bus/model/BusLineModel.java b/OCH/bus/driver/src/main/java/com/mogo/och/bus/model/BusLineModel.java index b116e97940..f863019acf 100644 --- a/OCH/bus/driver/src/main/java/com/mogo/och/bus/model/BusLineModel.java +++ b/OCH/bus/driver/src/main/java/com/mogo/och/bus/model/BusLineModel.java @@ -1,11 +1,10 @@ package com.mogo.och.bus.model; import android.content.Context; -import android.util.Log; import com.mogo.commons.AbsMogoApplication; +import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr; import com.mogo.eagle.core.utilcode.util.NetworkUtils; -import com.mogo.eagle.core.utilcode.util.SharedPrefs; import com.mogo.eagle.core.utilcode.util.ToastUtils; import com.mogo.och.bus.R; import com.mogo.och.bus.bean.BusQueryLineTaskResponse; @@ -24,9 +23,13 @@ public class BusLineModel { private static volatile BusLineModel sInstance; private Context mContext; private IBusLinesCallback mBusLinesCallback; + private static final byte[] obj = new byte[0]; + + private BusLineModel() { + } public static BusLineModel getInstance() { if ( sInstance == null ) { - synchronized ( BusLineModel.class ) { + synchronized ( obj ) { if ( sInstance == null ) { sInstance = new BusLineModel(); } @@ -34,9 +37,7 @@ public class BusLineModel { } return sInstance; } - private BusLineModel() { - } public void init() { mContext = AbsMogoApplication.getApp(); } @@ -79,7 +80,7 @@ public class BusLineModel { /** * 通过线路id 查询线路排班表 - * @param lineId + * @param lineId 线路id * @param position 位置 */ public void queryBusLineTasksById(int lineId, int position,boolean autoRefresh){ @@ -120,7 +121,7 @@ public class BusLineModel { OrderServiceManager.switchLine(mContext,taskId, new OchCommonServiceCallback() { @Override public void onSuccess(BusRoutesResponse o) { - SharedPrefs.getInstance(mContext).putInt(BusSwitchLineActivity.LASTCOMMITLINEID,lineId); + SharedPrefsMgr.getInstance(mContext).putInt(BusSwitchLineActivity.LASTCOMMITLINEID,lineId); if (mBusLinesCallback != null){ mBusLinesCallback.onChangeLineIdSuccess(); } diff --git a/OCH/bus/driver/src/main/java/com/mogo/och/bus/ui/BusSwitchLineActivity.kt b/OCH/bus/driver/src/main/java/com/mogo/och/bus/ui/BusSwitchLineActivity.kt index 57d37c2805..eff63dd20b 100644 --- a/OCH/bus/driver/src/main/java/com/mogo/och/bus/ui/BusSwitchLineActivity.kt +++ b/OCH/bus/driver/src/main/java/com/mogo/och/bus/ui/BusSwitchLineActivity.kt @@ -12,7 +12,7 @@ import androidx.constraintlayout.widget.ConstraintLayout import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import com.mogo.commons.mvp.MvpActivity -import com.mogo.eagle.core.utilcode.util.SharedPrefs +import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr import com.mogo.och.bus.presenter.BusLinePresenter import com.mogo.och.bus.ui.adapter.SwitchLineAdapter import com.mogo.och.bus.bean.BusQueryLinesResponse @@ -118,7 +118,7 @@ class BusSwitchLineActivity : MvpActivity showNoData(true) return } - var lastCommitLineid = SharedPrefs.getInstance(this).getInt(LASTCOMMITLINEID, -1) + val lastCommitLineid = SharedPrefsMgr.getInstance(this).getInt(LASTCOMMITLINEID, -1) if (data.data != null && data.data.size > 0) { showNoData(false) mData.clear() diff --git a/OCH/bus/driver/src/main/java/com/mogo/och/bus/ui/adapter/OpenItemAnimator.java b/OCH/bus/driver/src/main/java/com/mogo/och/bus/ui/adapter/OpenItemAnimator.java index 1571739e3b..15ff420cc1 100644 --- a/OCH/bus/driver/src/main/java/com/mogo/och/bus/ui/adapter/OpenItemAnimator.java +++ b/OCH/bus/driver/src/main/java/com/mogo/och/bus/ui/adapter/OpenItemAnimator.java @@ -11,7 +11,6 @@ import androidx.annotation.NonNull; import androidx.core.view.ViewCompat; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.RecyclerView; -import androidx.recyclerview.widget.SimpleItemAnimator; import java.util.ArrayList; import java.util.List; @@ -28,19 +27,19 @@ public class OpenItemAnimator extends DefaultItemAnimator { private static TimeInterpolator sDefaultInterpolator; - private ArrayList mPendingRemovals = new ArrayList<>(); - private ArrayList mPendingAdditions = new ArrayList<>(); - private ArrayList mPendingMoves = new ArrayList<>(); - private ArrayList mPendingChanges = new ArrayList<>(); + private final ArrayList mPendingRemovals = new ArrayList<>(); + private final ArrayList mPendingAdditions = new ArrayList<>(); + private final ArrayList mPendingMoves = new ArrayList<>(); + private final ArrayList mPendingChanges = new ArrayList<>(); - ArrayList> mAdditionsList = new ArrayList<>(); - ArrayList> mMovesList = new ArrayList<>(); - ArrayList> mChangesList = new ArrayList<>(); + private final ArrayList> mAdditionsList = new ArrayList<>(); + private final ArrayList> mMovesList = new ArrayList<>(); + private final ArrayList> mChangesList = new ArrayList<>(); - ArrayList mAddAnimations = new ArrayList<>(); - ArrayList mMoveAnimations = new ArrayList<>(); - ArrayList mRemoveAnimations = new ArrayList<>(); - ArrayList mChangeAnimations = new ArrayList<>(); + private final ArrayList mAddAnimations = new ArrayList<>(); + private final ArrayList mMoveAnimations = new ArrayList<>(); + private final ArrayList mRemoveAnimations = new ArrayList<>(); + private final ArrayList mChangeAnimations = new ArrayList<>(); private static class MoveInfo { public RecyclerView.ViewHolder holder; @@ -102,20 +101,16 @@ public class OpenItemAnimator extends DefaultItemAnimator { mPendingRemovals.clear(); // Next, move stuff if (movesPending) { - final ArrayList moves = new ArrayList<>(); - moves.addAll(mPendingMoves); + final ArrayList moves = new ArrayList<>(mPendingMoves); mMovesList.add(moves); mPendingMoves.clear(); - Runnable mover = new Runnable() { - @Override - public void run() { - for (MoveInfo moveInfo : moves) { - animateMoveImpl(moveInfo.holder, moveInfo.fromX, moveInfo.fromY, - moveInfo.toX, moveInfo.toY); - } - moves.clear(); - mMovesList.remove(moves); + Runnable mover = () -> { + for (MoveInfo moveInfo : moves) { + animateMoveImpl(moveInfo.holder, moveInfo.fromX, moveInfo.fromY, + moveInfo.toX, moveInfo.toY); } + moves.clear(); + mMovesList.remove(moves); }; if (removalsPending) { View view = moves.get(0).holder.itemView; @@ -126,19 +121,15 @@ public class OpenItemAnimator extends DefaultItemAnimator { } // Next, change stuff, to run in parallel with move animations if (changesPending) { - final ArrayList changes = new ArrayList<>(); - changes.addAll(mPendingChanges); + final ArrayList changes = new ArrayList<>(mPendingChanges); mChangesList.add(changes); mPendingChanges.clear(); - Runnable changer = new Runnable() { - @Override - public void run() { - for (ChangeInfo change : changes) { - animateChangeImpl(change); - } - changes.clear(); - mChangesList.remove(changes); + Runnable changer = () -> { + for (ChangeInfo change : changes) { + animateChangeImpl(change); } + changes.clear(); + mChangesList.remove(changes); }; if (removalsPending) { RecyclerView.ViewHolder holder = changes.get(0).oldHolder; @@ -149,19 +140,15 @@ public class OpenItemAnimator extends DefaultItemAnimator { } // Next, add stuff if (additionsPending) { - final ArrayList additions = new ArrayList<>(); - additions.addAll(mPendingAdditions); + final ArrayList additions = new ArrayList<>(mPendingAdditions); mAdditionsList.add(additions); mPendingAdditions.clear(); - Runnable adder = new Runnable() { - @Override - public void run() { - for (RecyclerView.ViewHolder holder : additions) { - animateAddImpl(holder); - } - additions.clear(); - mAdditionsList.remove(additions); + Runnable adder = () -> { + for (RecyclerView.ViewHolder holder : additions) { + animateAddImpl(holder); } + additions.clear(); + mAdditionsList.remove(additions); }; if (removalsPending || movesPending || changesPending) { long removeDuration = removalsPending ? getRemoveDuration() : 0; @@ -341,8 +328,8 @@ public class OpenItemAnimator extends DefaultItemAnimator { final ViewPropertyAnimator oldViewAnim = view.animate().setDuration( getChangeDuration()); mChangeAnimations.add(changeInfo.oldHolder); - oldViewAnim.translationX(changeInfo.toX - changeInfo.fromX); - oldViewAnim.translationY(changeInfo.toY - changeInfo.fromY); + oldViewAnim.translationX((float) (changeInfo.toX - changeInfo.fromX)); + oldViewAnim.translationY((float) (changeInfo.toY - changeInfo.fromY)); oldViewAnim.alpha(0).setListener(new AnimatorListenerAdapter() { @Override public void onAnimationStart(Animator animator) { @@ -480,25 +467,25 @@ public class OpenItemAnimator extends DefaultItemAnimator { } // animations should be ended by the cancel above. - //noinspection PointlessBooleanExpression,ConstantConditions + //noinspection Pointless BooleanExpression,ConstantConditions if (mRemoveAnimations.remove(item) && DEBUG) { throw new IllegalStateException("after animation is cancelled, item should not be in " + "mRemoveAnimations list"); } - //noinspection PointlessBooleanExpression,ConstantConditions + //noinspection Pointless BooleanExpression,ConstantConditions if (mAddAnimations.remove(item) && DEBUG) { throw new IllegalStateException("after animation is cancelled, item should not be in " + "mAddAnimations list"); } - //noinspection PointlessBooleanExpression,ConstantConditions + //noinspection Pointless BooleanExpression,ConstantConditions if (mChangeAnimations.remove(item) && DEBUG) { throw new IllegalStateException("after animation is cancelled, item should not be in " + "mChangeAnimations list"); } - //noinspection PointlessBooleanExpression,ConstantConditions + //noinspection Pointless BooleanExpression,ConstantConditions if (mMoveAnimations.remove(item) && DEBUG) { throw new IllegalStateException("after animation is cancelled, item should not be in " + "mMoveAnimations list"); diff --git a/OCH/bus/driver/src/main/java/com/mogo/och/bus/util/BusTrajectoryManager.java b/OCH/bus/driver/src/main/java/com/mogo/och/bus/util/BusTrajectoryManager.java index 6c9165e94e..613fb2d050 100644 --- a/OCH/bus/driver/src/main/java/com/mogo/och/bus/util/BusTrajectoryManager.java +++ b/OCH/bus/driver/src/main/java/com/mogo/och/bus/util/BusTrajectoryManager.java @@ -10,6 +10,7 @@ import com.mogo.och.bus.bean.BusRoutesResult; import com.mogo.och.bus.constant.BusConst; import com.mogo.och.bus.model.OrderModel; import com.mogo.och.common.module.biz.constant.LoginStatusManager; +import com.mogo.och.common.module.manager.orderlogmanager.OchChainLogManager; import com.zhidao.socket.utils.LoginStatusUtil; import java.util.concurrent.TimeUnit; @@ -72,30 +73,36 @@ public class BusTrajectoryManager { if ("ISYS_INIT_TRAJECTORY_START".equals(guardianInfo.getCode())) { // 1. 轨迹管理_轨迹开始下载(本地已有对应轨迹也触发) CallerLogger.d(M_BUS + TAG, "onAutopilotGuardian() 轨迹开始下载"); + OchChainLogManager.writeChainLog("轨迹监控","onAutopilotGuardian() 轨迹开始下载", true, OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY); // ToastUtils.showShort("轨迹开始下载"); stopTrajReqLoop(); } else if ("ISYS_INIT_TRAJECTORY_SUCCESS".equals(guardianInfo.getCode())) { // 2. 轨迹管理_轨迹下载成功(本地已有对应轨迹也触发) CallerLogger.d(M_BUS + TAG, "onAutopilotGuardian() 轨迹下载成功"); + OchChainLogManager.writeChainLog("轨迹监控","onAutopilotGuardian() 轨迹下载成功", true, OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY); // ToastUtils.showShort("轨迹下载成功"); stopTrajReqLoop(); } else if ("ISYS_INIT_TRAJECTORY_FAILURE".equals(guardianInfo.getCode())) { // 3. 轨迹管理_轨迹下载失败,本地无对应轨迹 CallerLogger.d(M_BUS + TAG, "onAutopilotGuardian() " + "轨迹下载失败,本地无对应轨迹"); + OchChainLogManager.writeChainLog("轨迹监控","onAutopilotGuardian() 轨迹下载失败,本地无对应轨迹", true, OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY); // ToastUtils.showShort("轨迹下载失败,本地无对应轨迹"); } else if ("ISYS_INIT_TRAJECTORY_WARNING".equals(guardianInfo.getCode())) { // 4. 轨迹管理_轨迹下载失败,本地有对应轨迹,认为成功 CallerLogger.d(M_BUS + TAG, "onAutopilotGuardian() " + "轨迹下载失败,本地有对应轨迹,认为成功"); + OchChainLogManager.writeChainLog("轨迹监控","onAutopilotGuardian() 轨迹下载失败,本地有对应轨迹,认为成功", true, OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY); // ToastUtils.showShort("轨迹下载失败,本地有对应轨迹,认为成功"); } else if ("ISYS_INIT_TRAJECTORY_TIMEOUT".equals(guardianInfo.getCode())) { // 5. 轨迹管理_轨迹下载超时 CallerLogger.d(M_BUS + TAG, "onAutopilotGuardian() 轨迹下载超时"); + OchChainLogManager.writeChainLog("轨迹监控","onAutopilotGuardian() 轨迹下载超时", true, OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY); // ToastUtils.showShort("轨迹下载超时"); } else if ("ISSM_FUNC_AUTO_PILOT_READY".equals(guardianInfo.getCode())) { // 收到ssm的自动驾驶变为ready,再次下发轨迹下载.解决:域控重启,或者102域控启动太早,107节点初始化未完成导致的轨迹未进行下载。 CallerLogger.d(M_BUS + TAG, "onAutopilotGuardian() ssm ready,再次发起下载"); + OchChainLogManager.writeChainLog("轨迹监控","onAutopilotGuardian() 再次发起下载", true, OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY); syncTrajectoryInfo(); } } @@ -186,7 +193,7 @@ public class BusTrajectoryManager { CallerLogger.e(M_BUS + TAG, "sendTrajectoryReq(): mAutoPilotLine is null!!!"); return; } - + OchChainLogManager.writeChainLog("轨迹监控","sendTrajectoryReq() 下发轨迹 轨迹id"+mAutoPilotLine.getLineId(), true, OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY); CallerAutoPilotControlManager.INSTANCE.sendTrajectoryDownloadReq(mAutoPilotLine); CallerLogger.d(M_BUS + TAG, "sendTrajectoryReq(): " + GsonUtils.toJson(mAutoPilotLine)); diff --git a/OCH/bus/driver/src/main/java/com/mogo/och/bus/view/BusArcView.java b/OCH/bus/driver/src/main/java/com/mogo/och/bus/view/BusArcView.java index a9e7bdff5d..29525b0169 100644 --- a/OCH/bus/driver/src/main/java/com/mogo/och/bus/view/BusArcView.java +++ b/OCH/bus/driver/src/main/java/com/mogo/och/bus/view/BusArcView.java @@ -24,13 +24,13 @@ import com.mogo.och.bus.R; public class BusArcView extends View { //中心的文字描述 - private String mDes = "KM/H"; + private final String mDes = "KM/H"; //根据数据显示的圆弧Paint private Paint mArcPaint; //圆弧颜色 private int mArcColor; //圆弧的画笔的宽度 - private float mStrokeWith = getResources().getDimension(R.dimen.bus_ext_arcView_stroke_with); + private final float mStrokeWith = getResources().getDimension(R.dimen.bus_ext_arcView_stroke_with); //文字描述的paint private Paint mTextPaint; @@ -39,9 +39,9 @@ public class BusArcView extends View { //当前数据 private int currentValue; //最大数据 - private int maxValue = 240; + private final int maxValue = 240; //圆弧背景的开始和结束间的夹角大小 - private float mAngle = 270; + private final float mAngle = 270; //上次绘制圆弧夹角 private float lastAngle = 0; @@ -75,13 +75,13 @@ public class BusArcView extends View { mTextPaint.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); //绘制中心的数值 mTextPaint.getTextBounds(mValue, 0, mValue.length(), mRect); - canvas.drawText(mValue, getWidth() / 2, getHeight() / 2 + mRect.height() / 2 - 10, mTextPaint); + canvas.drawText(mValue, getWidth() / 2.0f, getHeight() / 2.0f + mRect.height() / 2.0f - 10, mTextPaint); mTextPaint.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL)); //绘制中心文字描述 mTextPaint.setTextSize(getResources().getDimension(R.dimen.bus_ext_arcView_des_text_size)); mTextPaint.getTextBounds(mDes, 0, mDes.length(), mRect); - canvas.drawText(mDes, getWidth() / 2, getHeight() * 17 / 20 + mRect.height() / 2, mTextPaint); + canvas.drawText(mDes, getWidth() / 2.0f, getHeight() * 17.0f / 20.0f + mRect.height() / 2.0f, mTextPaint); } private void drawArc(Canvas canvas) { @@ -135,13 +135,10 @@ public class BusArcView extends View { ValueAnimator progressAnimator = ValueAnimator.ofFloat(startAngle, currentAngle); progressAnimator.setDuration(time); progressAnimator.setTarget(mIncludedAngle); - progressAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { - @Override - public void onAnimationUpdate(ValueAnimator animation) { - mIncludedAngle = (float) animation.getAnimatedValue(); - //重新绘制,不然不会出现效果 - postInvalidate(); - } + progressAnimator.addUpdateListener(animation -> { + mIncludedAngle = (float) animation.getAnimatedValue(); + //重新绘制,不然不会出现效果 + postInvalidate(); }); //开始执行动画 progressAnimator.start(); diff --git a/OCH/bus/driver/src/main/java/com/mogo/och/bus/view/SlidePanelView.java b/OCH/bus/driver/src/main/java/com/mogo/och/bus/view/SlidePanelView.java index e010f37a76..7219b7b20d 100644 --- a/OCH/bus/driver/src/main/java/com/mogo/och/bus/view/SlidePanelView.java +++ b/OCH/bus/driver/src/main/java/com/mogo/och/bus/view/SlidePanelView.java @@ -22,7 +22,6 @@ import android.view.animation.DecelerateInterpolator; import androidx.annotation.Nullable; import com.mogo.commons.AbsMogoApplication; -import com.mogo.eagle.core.utilcode.util.BitmapHelper; import com.mogo.och.bus.R; import me.jessyan.autosize.AutoSizeConfig; @@ -93,7 +92,7 @@ public class SlidePanelView extends View { private ObjectAnimator matrixAnim; private String blockText = STRING_SLIDE_TO_RIGHT; - private Paint.FontMetrics blockTextMetrics = new Paint.FontMetrics(); + private final Paint.FontMetrics blockTextMetrics = new Paint.FontMetrics(); private static final int GRADIENT_OFFSET = 200; @@ -250,7 +249,7 @@ public class SlidePanelView extends View { private void startBlockBackAnim() { ObjectAnimator blockBackanimator = ObjectAnimator.ofInt(this, "blockOffset", blockOffset, 0); blockBackanimator.setInterpolator(new DecelerateInterpolator()); - blockBackanimator.setDuration(1000 * blockOffset / getWidth()); + blockBackanimator.setDuration(1000L * blockOffset / getWidth()); blockBackanimator.start(); lastX = 0; } @@ -259,15 +258,15 @@ public class SlidePanelView extends View { protected void onDraw(Canvas canvas) { super.onDraw(canvas); // 画背景 - canvas.drawRoundRect(bgRectF, (float) getHeight() / 2, (float) getHeight() / 2, bgPaint); + canvas.drawRoundRect(bgRectF, (float) getHeight() / 2.0f, (float) getHeight() / 2.0f, bgPaint); // 画文字 gradientMatrix.setTranslate(matrixTranslate, 0); textGradient.setLocalMatrix(gradientMatrix); canvas.save(); - canvas.drawText(blockText, blockWidth + BLOCK_START_X + textMarginLeft, textOffset, textPaint); + canvas.drawText(blockText, (float) (blockWidth + BLOCK_START_X + textMarginLeft), textOffset, textPaint); canvas.restore(); // 画滑块 - canvas.drawBitmap(bmBlock, BLOCK_START_X + blockOffset, BLOCK_START_Y, blockPaint); + canvas.drawBitmap(bmBlock, (float) (BLOCK_START_X + blockOffset), (float) BLOCK_START_Y, blockPaint); } public interface OnSlidePanelMoveToEndListener { diff --git a/OCH/bus/passenger/build.gradle b/OCH/bus/passenger/build.gradle index 6732195e81..391d65936f 100644 --- a/OCH/bus/passenger/build.gradle +++ b/OCH/bus/passenger/build.gradle @@ -68,8 +68,9 @@ dependencies { implementation project(":OCH:mogo-och-common-module") compileOnly project(":libraries:mogo-map") implementation project(':core:mogo-core-res') - testImplementation 'junit:junit:4.12' + androidTestImplementation rootProject.ext.dependencies.androidxjunit + testImplementation rootProject.ext.dependencies.junit } apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString() \ No newline at end of file diff --git a/OCH/bus/passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/MogoOCHBusPassenger.java b/OCH/bus/passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/MogoOCHBusPassenger.java index 5d1778ca79..cf1643aa61 100644 --- a/OCH/bus/passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/MogoOCHBusPassenger.java +++ b/OCH/bus/passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/MogoOCHBusPassenger.java @@ -47,7 +47,7 @@ public class MogoOCHBusPassenger implements IMogoOCH { this.mContainerId = containerId; showFragment(); - if (AppIdentityModeUtils.isJL(FunctionBuildConfig.appIdentityMode)) { + if (AppIdentityModeUtils.isJL(FunctionBuildConfig.appIdentityMode) && activity != null) { MultiDisplayUtils.INSTANCE.startActWithSecond(activity, VideoPlayerActivity.class); } diff --git a/OCH/bus/passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/model/BusPassengerModel.kt b/OCH/bus/passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/model/BusPassengerModel.kt index f3a411dbe5..2dc3afbc48 100644 --- a/OCH/bus/passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/model/BusPassengerModel.kt +++ b/OCH/bus/passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/model/BusPassengerModel.kt @@ -517,14 +517,10 @@ object BusPassengerModel { } // if (DebugConfig.isDebug()) { - // ToastUtils.showShort("到达目的地"); + // ToastUtils.showShort("到达目的地") // } mADASStatusCallback?.onAutopilotArriveEnd() } - - override fun onAutopilotStatusRespByQuery(status: SystemStatusInfo.StatusInfo) {} - - override fun onSystemStatus(statusInf: SsmInfo.SsmStatusInf) {} } private val moGoAutopilotPlanningListener: IMoGoPlanningRottingListener = object : IMoGoPlanningRottingListener { diff --git a/OCH/bus/passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPassengerBaseFragment.java b/OCH/bus/passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPassengerBaseFragment.java index c3a0911815..77b7012c04 100644 --- a/OCH/bus/passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPassengerBaseFragment.java +++ b/OCH/bus/passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPassengerBaseFragment.java @@ -58,6 +58,11 @@ public abstract class BusPassengerBaseFragment openOrCloseLiveVideo()); CallerTelematicListenerManager.INSTANCE.addListener(TAG, new IReceivedMsgListener() { + @Override + public void onDemoMode(boolean isDemoMode) { + + } + @Override public void onReceivedServerSn(@Nullable String sn) { diff --git a/OCH/bus/passenger/src/main/java/com/mogo/och/bus/passenger/utils/BusPassengerMapAssetStyleUtil.java b/OCH/bus/passenger/src/main/java/com/mogo/och/bus/passenger/utils/BusPassengerMapAssetStyleUtil.java index edab28cb78..3cad825966 100644 --- a/OCH/bus/passenger/src/main/java/com/mogo/och/bus/passenger/utils/BusPassengerMapAssetStyleUtil.java +++ b/OCH/bus/passenger/src/main/java/com/mogo/och/bus/passenger/utils/BusPassengerMapAssetStyleUtil.java @@ -19,7 +19,10 @@ public class BusPassengerMapAssetStyleUtil { is1 = context.getResources().getAssets().open(fileName); //eg. over_view_style.data int lenght1 = is1.available(); buffer1 = new byte[lenght1]; - is1.read(buffer1); + int count = 0; + while ((count = is1.read(buffer1)) > 0) { + is1.read(buffer1); + } } catch (IOException e) { e.printStackTrace(); } finally { diff --git a/OCH/bus/passenger/src/test/java/com/mogo/och/bus/passenger/ExampleUnitTest.java b/OCH/bus/passenger/src/test/java/com/mogo/och/bus/passenger/ExampleUnitTest.java index d940b2948f..dd13881f86 100644 --- a/OCH/bus/passenger/src/test/java/com/mogo/och/bus/passenger/ExampleUnitTest.java +++ b/OCH/bus/passenger/src/test/java/com/mogo/och/bus/passenger/ExampleUnitTest.java @@ -8,7 +8,7 @@ import org.junit.Test; * @see Testing documentation */ public class ExampleUnitTest { - @Test + //@Test public void addition_isCorrect() { } diff --git a/OCH/charter/driver/build.gradle b/OCH/charter/driver/build.gradle index 92631f28d4..f28ba4dcbd 100644 --- a/OCH/charter/driver/build.gradle +++ b/OCH/charter/driver/build.gradle @@ -64,7 +64,8 @@ dependencies { implementation project(":OCH:mogo-och-common-module") compileOnly project(":libraries:mogo-map") - testImplementation 'junit:junit:4.12' + androidTestImplementation rootProject.ext.dependencies.androidxjunit + testImplementation rootProject.ext.dependencies.junit } apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString() \ No newline at end of file diff --git a/OCH/charter/driver/src/main/AndroidManifest.xml b/OCH/charter/driver/src/main/AndroidManifest.xml index f9cccd9894..46a1d0cace 100644 --- a/OCH/charter/driver/src/main/AndroidManifest.xml +++ b/OCH/charter/driver/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ - + \ No newline at end of file diff --git a/OCH/charter/driver/src/main/java/com/magic/mogo/och/charter/base/CharterBaseFragment.kt b/OCH/charter/driver/src/main/java/com/magic/mogo/och/charter/base/CharterBaseFragment.kt index 04355d8e1d..51c1dd5405 100644 --- a/OCH/charter/driver/src/main/java/com/magic/mogo/och/charter/base/CharterBaseFragment.kt +++ b/OCH/charter/driver/src/main/java/com/magic/mogo/och/charter/base/CharterBaseFragment.kt @@ -12,6 +12,7 @@ import androidx.constraintlayout.widget.Group import com.magic.mogo.och.charter.R import com.magic.mogo.och.charter.constant.CharterConst import com.magic.mogo.och.charter.view.SlidePanelView +import com.magic.mogo.och.charter.view.autopilot.AutopilotStatusView import com.mogo.commons.mvp.IView import com.mogo.commons.mvp.MvpFragment import com.mogo.commons.mvp.Presenter @@ -54,16 +55,13 @@ abstract class CharterBaseFragment?>() : private val TAG = "BaseBusTabFragment" - private var ctvAutopilotStatus: RelativeLayout? = null - private var ctvAutopilotStatusIv: ImageView? = null - private var ctvAutopilotStatusTv: TextView? = null + private var ctvAutopilotStatus: AutopilotStatusView? = null protected var mSettingBtn: RelativeLayout? = null protected var mBadcaseBtn: RelativeLayout? = null protected var mAICollectBtn: RelativeLayout? = null private var flStationPanelContainer: FrameLayout? = null private var mapBizView: MapBizView? = null private var groupTestPanel: Group? = null - private var mTrafficDataView: TrafficDataView? = null protected var slidePanelView: SlidePanelView? = null //远景和中景的切换 private var mSwitchMapModeImage: ImageView? = null @@ -87,16 +85,13 @@ abstract class CharterBaseFragment?>() : override fun initViews() { mapBizView = findViewById(R.id.mapBizView) groupTestPanel = findViewById(R.id.groupTestPanel) - ctvAutopilotStatus = findViewById(R.id.module_mogo_och_autopilot_status) - ctvAutopilotStatusIv = findViewById(R.id.bus_autopilot_btn_iv) - ctvAutopilotStatusTv = findViewById(R.id.bus_autopolot_btn_tv) + ctvAutopilotStatus = findViewById(R.id.autopilot_status) flStationPanelContainer = findViewById(R.id.module_mogo_och_station_panel_container) slidePanelView = findViewById(R.id.charter_slide_panel) slidePanelView?.setText(resources.getString(R.string.charter_back_car)) slidePanelView?.setOnSlidePanelMoveToEndListener(onSlideToEndListener) - mTrafficDataView = findViewById(R.id.bus_arc) as TrafficDataView? LayoutInflater.from(context).inflate(getStationPanelViewId(), flStationPanelContainer) mSwitchMapModeLayout = findViewById(R.id.bus_switch_model_layout) mSwitchMapModeImage = findViewById(R.id.bus_switch_model_icon) @@ -122,12 +117,6 @@ abstract class CharterBaseFragment?>() : } }) initListener() - setAutopilotBtnStatus(getState()) - ctvAutopilotStatus!!.setOnClickListener(object : OnPreventFastClickListener() { - override fun onClickImpl(v: View) { - restartAutopilot() - } - }) // 模拟 不可自动驾驶,目前场景是刚开机,adas还未和工控机连接 findViewById(R.id.btnAutopilotDisable)!!.setOnClickListener { view: View? -> @@ -194,6 +183,11 @@ abstract class CharterBaseFragment?>() : } }) smallMapView = findViewById(R.id.smallMapView) + + ctvAutopilotStatus?.setOnLongClickListener { + debugTestBar() + true + } } override fun initViews(savedInstanceState: Bundle?) { @@ -308,90 +302,6 @@ abstract class CharterBaseFragment?>() : SoundPoolHelper.getSoundPoolHelper().playSoundWithRedId(context, R.raw.bus_di) } - /** - * 改变自动驾驶状态 - * - * @param autopilotStatus 0:不可用 1:可用状态 2:自动驾驶中 - */ - fun onAutopilotStatusChanged(autopilotStatus: Int) { - requireActivity().runOnUiThread { - changeAutopilotBtnView( - autopilotStatus, - isAnimateRunning - ) - } - } - - private fun setAutopilotBtnStatus(autopilotStatus: Int) { - if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE - == autopilotStatus - ) { //0不可用 - ctvAutopilotStatusTv!!.setTextColor(resources.getColor(R.color.charter_autopilot_text_color_disable)) - ctvAutopilotStatusTv!!.text = - resources.getString(R.string.charter_loading_autopilot_runnig_tv) - ctvAutopilotStatusIv!!.setImageResource(R.drawable.charter_disable_autopilot_icon) -// ctvAutopilotStatus!!.isSelected = false - ctvAutopilotStatus!!.isClickable = true - ctvAutopilotStatus!!.background = getDrawable(R.drawable.charter_autopilot_0_1_status_bg) - }else{ - ctvAutopilotStatusTv!!.setTextColor(resources.getColor(R.color.charter_autopilot_text_color_normal)) - ctvAutopilotStatusIv!!.setImageResource(R.drawable.charter_ic_autopilot) - ctvAutopilotStatusTv!!.text = - resources.getString(R.string.charter_loading_autopilot_runnig_tv) - ctvAutopilotStatus!!.isClickable = true - if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE == autopilotStatus) { //1可用 - ctvAutopilotStatus!!.background = getDrawable(R.drawable.charter_autopilot_0_1_status_bg) - } else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == autopilotStatus) { - ctvAutopilotStatus!!.background = getDrawable(R.drawable.charter_autopilot_2_status_bg) - } else if (IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING - == autopilotStatus){ - ctvAutopilotStatusTv!!.text = - resources.getString(R.string.charter_loading_autopilot_pingxing_tv) - ctvAutopilotStatus!!.isClickable = false - ctvAutopilotStatus!!.background = getDrawable(R.drawable.charter_pingxingjiashi) - } - } - } - - open fun updateAutopilotStatus(autopilotStatus: Int) { - if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING - == autopilotStatus - ) { //2 running - ctvAutopilotStatusIv!!.setImageResource(R.drawable.charter_right_autopilot_icon) - ctvAutopilotStatusTv!!.setTextColor(resources.getColor(R.color.charter_autopilot_text_color_normal)) - ctvAutopilotStatusTv!!.text = - resources.getString(R.string.charter_loading_autopilot_success_tv) -// ctvAutopilotStatus!!.isSelected = false - ctvAutopilotStatus!!.isClickable = false - } else { - ctvAutopilotStatusIv!!.setImageResource(R.drawable.charter_wrong_autopilot_icon) - ctvAutopilotStatusTv!!.setTextColor(resources.getColor(R.color.charter_autopilot_text_color_normal)) - ctvAutopilotStatusTv!!.text = - resources.getString(R.string.charter_loading_autopilot_failure_tv) - ctvAutopilotStatus!!.isClickable = false -// ctvAutopilotStatus!!.isSelected = false - } - UiThreadHandler.postDelayed({ setAutopilotBtnStatus(autopilotStatus) }, 1000) - } - - private fun changeAutopilotBtnView(autopilotStatus: Int, isAnimateRunning: Boolean) { - if (isAnimateRunning && IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING - != autopilotStatus - ) { - // 主动开启自动驾驶中,不为2(为0、1)则继续loading - return - } - if (isAnimateRunning) { - stopAnimAndUpdateBtnStatus() - } else { - setAutopilotBtnStatus(autopilotStatus) - } - } - - open fun stopAnimAndUpdateBtnStatus() { - stopAutopilotAnimation() - updateAutopilotStatus(getState()) - } /** @@ -408,74 +318,13 @@ abstract class CharterBaseFragment?>() : */ abstract fun getStationPanelViewId(): Int - /** - * 重新开启自动驾驶 - */ - abstract fun restartAutopilot() - /** * 模拟自动驾驶返回状态 * * @param status */ private fun debugAutoPilotStatus(status: Int){ - setAutopilotBtnStatus(status) - } - /** - * 开启自动驾驶中间动画 - */ - @SuppressLint("ObjectAnimatorBinding") - open fun startAutopilotAnimation() { - isAnimateRunning = true - ctvAutopilotStatusTv!!.text = resources.getString(R.string.charter_loading_autopilot_tv) - ctvAutopilotStatusTv!!.setTextColor(resources.getColor(R.color.charter_autopilot_text_color_normal)) -// ctvAutopilotStatus!!.isSelected = false - ctvAutopilotStatus!!.isClickable = true - ctvAutopilotStatusIv!!.setImageResource(R.drawable.charter_loading_autopilot_icon) - if (autopilotLoadingAnimator == null) { - autopilotLoadingAnimator = - ObjectAnimator.ofFloat(ctvAutopilotStatusIv, "rotation", 0f, 360f) - autopilotLoadingAnimator?.interpolator = LinearInterpolator() - autopilotLoadingAnimator?.repeatCount = -1 //无限循环 - autopilotLoadingAnimator?.duration = 1000 //设置持续时间 - } - autopilotLoadingAnimator!!.start() //动画开始 - startingAutoApilotCountDown() - } - - private fun startingAutoApilotCountDown() { - //10s 若自动驾驶没有开启,则结束动画 - UiThreadHandler.postDelayed({ - //未启动成功做处理 - if (isAnimateRunning) { // 只判断动画是否在进行,根据自动驾驶当前状态去设置自动驾驶状态 - stopAutopilotAnimation() - updateAutopilotStatus(getState()) - } - }, CharterConst.TIMER_START_AUTOPILOT_INTERVAL) - } - - /** - * 停止自动驾驶中间动画 - */ - protected open fun stopAutopilotAnimation() { - if (autopilotLoadingAnimator != null) { - autopilotLoadingAnimator!!.end() - ctvAutopilotStatusIv!!.clearAnimation() - autopilotLoadingAnimator = null - isAnimateRunning = false - } - } - - /** - * 迈速表实时更新 - * - * @param newSpeed - */ - open fun updateSpeedView(newSpeed: Float) { - val speed = (abs(newSpeed) * 3.6f).toInt() // 倒车时工控机反馈定位信息中speed为负值 - if (mTrafficDataView != null) { - mTrafficDataView!!.updateSpeedWithValue(speed) - } + ctvAutopilotStatus?.setAutopilotBtnStatus(status) } override fun onDestroy() { diff --git a/OCH/charter/driver/src/main/java/com/magic/mogo/och/charter/callback/IDriverM1ControllerStatusCallback.kt b/OCH/charter/driver/src/main/java/com/magic/mogo/och/charter/callback/IDriverM1ControllerStatusCallback.kt index d0826bb748..f9c63e9ea5 100644 --- a/OCH/charter/driver/src/main/java/com/magic/mogo/och/charter/callback/IDriverM1ControllerStatusCallback.kt +++ b/OCH/charter/driver/src/main/java/com/magic/mogo/och/charter/callback/IDriverM1ControllerStatusCallback.kt @@ -1,7 +1,5 @@ package com.magic.mogo.och.charter.callback -import com.mogo.eagle.core.data.map.MogoLocation - /** * Created on 2021/9/10 * @@ -14,6 +12,4 @@ interface IDriverM1ControllerStatusCallback { //启动自驾失败 fun onStartAdasFailure() - //速度更新 - fun updateSpeed(gnssInfo: MogoLocation) } \ No newline at end of file diff --git a/OCH/charter/driver/src/main/java/com/magic/mogo/och/charter/fragment/DriverM1Fragment.kt b/OCH/charter/driver/src/main/java/com/magic/mogo/och/charter/fragment/DriverM1Fragment.kt index ecf8215f7a..c670bad905 100644 --- a/OCH/charter/driver/src/main/java/com/magic/mogo/och/charter/fragment/DriverM1Fragment.kt +++ b/OCH/charter/driver/src/main/java/com/magic/mogo/och/charter/fragment/DriverM1Fragment.kt @@ -168,13 +168,6 @@ class DriverM1Fragment : CharterBaseFragment(view),ILoginCallback, DriverM1OrderCallback, ChangeDestCallback, - IMoGoAutopilotStatusListener, OCHPlanningActionsCallback, - IDriverM1ControllerStatusCallback { + IMoGoAutopilotStatusListener, OCHPlanningActionsCallback{ companion object{ private const val TAG = "DriverM1Presenter" @@ -55,7 +55,6 @@ class DriverM1Presenter(view: DriverM1Fragment?) : StopSideManager.addListener(TAG,this) DriverM1Model.get().setDriverM1OrderCallback(this) DriverM1Model.get().setChangeDestCallback(this) - DriverM1Model.get().setControllerStatusCallback(this) } private fun releaseListener() { @@ -63,7 +62,6 @@ class DriverM1Presenter(view: DriverM1Fragment?) : CallerAutoPilotStatusListenerManager.removeListener(TAG) DriverM1Model.get().setDriverM1OrderCallback(null) DriverM1Model.get().setChangeDestCallback(null) - DriverM1Model.get().setControllerStatusCallback(null) } override fun onDestroy(owner: LifecycleOwner) { @@ -92,13 +90,6 @@ class DriverM1Presenter(view: DriverM1Fragment?) : DriverM1Model.get().logout() } - fun restartAutopilot() { - // todo 启动自驾必须有订单路线 - if (DriverM1Model.get().isHaveOrder()) { - DriverM1Model.get().restartAutopilot() - } - } - fun driverEndLease() { DriverM1Model.get().driverEndLease() } @@ -145,7 +136,6 @@ class DriverM1Presenter(view: DriverM1Fragment?) : } override fun onAutopilotStatusResponse(state: Int) { - mView?.onAutopilotStatusChanged(state) when(state){ // IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE -> { // // @@ -182,6 +172,12 @@ class DriverM1Presenter(view: DriverM1Fragment?) : OPERATION_ROAD_SIDE_TYPE ) } + StopSideStatus.EndingSuccess -> { + BeautifyManager.notifyViewChange(BeautifyManager.ChangeTypeEnum.STOPSITE_SUCCESS) + } + StopSideStatus.NOTHING -> { + BeautifyManager.notifyViewChange(BeautifyManager.ChangeTypeEnum.STOPSITE_SUCCESS_RUN) + } StopSideStatus.EndingFaile, StopSideStatus.NOSTART-> { DriverM1Model.get().pushOperationalToMsgBox( @@ -193,21 +189,4 @@ class DriverM1Presenter(view: DriverM1Fragment?) : } } - override fun startOpenAutopilot() { - ThreadUtils.runOnUiThread { - mView?.startAutopilotAnimation() - } - } - - override fun onStartAdasFailure() { - ThreadUtils.runOnUiThread { - mView?.stopAnimAndUpdateBtnStatus() - } - } - - override fun updateSpeed(gnssInfo: MogoLocation) { - ThreadUtils.runOnUiThread { - mView?.updateSpeedView(gnssInfo.gnssSpeed) - } - } } diff --git a/OCH/charter/driver/src/main/java/com/magic/mogo/och/charter/view/SlidePanelView.kt b/OCH/charter/driver/src/main/java/com/magic/mogo/och/charter/view/SlidePanelView.kt index 03047a13b5..74c639ca82 100644 --- a/OCH/charter/driver/src/main/java/com/magic/mogo/och/charter/view/SlidePanelView.kt +++ b/OCH/charter/driver/src/main/java/com/magic/mogo/och/charter/view/SlidePanelView.kt @@ -85,9 +85,9 @@ class SlidePanelView @JvmOverloads constructor( val size = AutoSizeUtils.dp2px(context, 120f) val opts = BitmapFactory.Options() opts.inDensity = AutoSizeConfig.getInstance().initDensity.toInt() - bmBlock = BitmapFactory.decodeResource(resources, R.drawable.charter_base_slide_block, opts) as Bitmap - bmBlock = Bitmap.createScaledBitmap(bmBlock!!, size, size, true) as Bitmap - blockWidth = bmBlock!!.width + bmBlock = BitmapFactory.decodeResource(resources, R.drawable.charter_base_slide_block, opts) + bmBlock = Bitmap.createScaledBitmap(bmBlock!!, size, size, true) + blockWidth = bmBlock!!.getWidth() } override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { @@ -210,6 +210,7 @@ class SlidePanelView @JvmOverloads constructor( ) canvas.restore() // 画滑块 + canvas.drawBitmap( bmBlock!!, (BLOCK_START_X + blockOffset).toFloat(), diff --git a/OCH/charter/driver/src/main/java/com/magic/mogo/och/charter/view/autopilot/AutopilotStatusView.kt b/OCH/charter/driver/src/main/java/com/magic/mogo/och/charter/view/autopilot/AutopilotStatusView.kt new file mode 100644 index 0000000000..aa06ab956b --- /dev/null +++ b/OCH/charter/driver/src/main/java/com/magic/mogo/och/charter/view/autopilot/AutopilotStatusView.kt @@ -0,0 +1,152 @@ +package com.magic.mogo.och.charter.view.autopilot + +import android.animation.ObjectAnimator +import android.content.Context +import android.util.AttributeSet +import android.view.LayoutInflater +import android.view.animation.LinearInterpolator +import android.widget.RelativeLayout +import androidx.core.content.ContextCompat +import androidx.lifecycle.ViewModelProvider +import androidx.lifecycle.findViewTreeViewModelStoreOwner +import com.magic.mogo.och.charter.R +import com.mogo.eagle.core.utilcode.kotlin.onClick +import com.mogo.eagle.core.utilcode.util.ResourceUtils +import kotlinx.android.synthetic.main.charter_autopilot_status.view.bus_autopilot_btn_iv +import kotlinx.android.synthetic.main.charter_autopilot_status.view.bus_autopolot_btn_tv + +/** + * 剩余时间和结束订单入口 + */ +class AutopilotStatusView : RelativeLayout,AutopilotStatusViewModel.IAutopilotStatusCallback { + + private val TAG = "AutopilotStatusView" + + constructor(context: Context) : super(context) + + constructor(context: Context, attributeSet: AttributeSet) : super(context, attributeSet) + + constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int) : super( + context, + attributeSet, + defStyleAttr + ) + + var viewModel:AutopilotStatusViewModel?=null + + private lateinit var autopilotLoadingAnimator: ObjectAnimator + + private fun initView() { + LayoutInflater.from(context).inflate(R.layout.charter_autopilot_status, this, true) + autopilotLoadingAnimator = ObjectAnimator.ofFloat(bus_autopilot_btn_iv, "rotation", 0f, 360f) + autopilotLoadingAnimator.interpolator = LinearInterpolator() + autopilotLoadingAnimator.repeatCount = -1 //无限循环 + autopilotLoadingAnimator.duration = 1000 //设置持续时间 + onClick { + viewModel?.restartAutopilot() + } + } + + override fun startAutopilotSuccess(){ + bus_autopilot_btn_iv.setImageResource(R.drawable.charter_right_autopilot_icon) + bus_autopolot_btn_tv.setTextColor(ContextCompat.getColor(context,R.color.charter_autopilot_text_color_normal)) + bus_autopolot_btn_tv.text = resources.getString(R.string.charter_loading_autopilot_success_tv) + isClickable = false + } + + override fun startAutopilotFail(){ + bus_autopilot_btn_iv.setImageResource(R.drawable.charter_wrong_autopilot_icon) + bus_autopolot_btn_tv.setTextColor(ContextCompat.getColor(context,R.color.charter_autopilot_text_color_normal)) + bus_autopolot_btn_tv.text = resources.getString(R.string.charter_loading_autopilot_failure_tv) + isClickable = false + } + + fun setAutopilotBtnStatus(autopilotStatus: Int) { + viewModel?.setUIMode(autopilotStatus) + } + + /** + * 开始动画展示 + */ + override fun startAutopilotAnimation() { + bus_autopolot_btn_tv.text = resources.getString(R.string.charter_loading_autopilot_tv) + bus_autopolot_btn_tv.setTextColor(ContextCompat.getColor(context,R.color.charter_autopilot_text_color_normal)) + isClickable = true + bus_autopilot_btn_iv.setImageResource(R.drawable.charter_loading_autopilot_icon) + autopilotLoadingAnimator.start() //动画开始 + } + + /** + * 结束动画展示 + */ + override fun stopAutopilotAnimation() { + autopilotLoadingAnimator.end() + bus_autopilot_btn_iv.clearAnimation() + } + + /** + * 自动驾驶不可用 + */ + override fun autopilotDisable(){ + bus_autopolot_btn_tv.setTextColor(ContextCompat.getColor(context,R.color.charter_autopilot_text_color_disable)) + bus_autopolot_btn_tv.text = resources.getString(R.string.charter_loading_autopilot_runnig_tv) + bus_autopilot_btn_iv.setImageResource(R.drawable.charter_disable_autopilot_icon) + isClickable = true + background = ResourceUtils.getDrawable(R.drawable.charter_autopilot_0_1_status_bg) + } + + /** + * 底盘准备好了可以启动自动驾驶 + */ + override fun canStartAutopilot(){ + bus_autopolot_btn_tv.setTextColor(ContextCompat.getColor(context,R.color.charter_autopilot_text_color_normal)) + bus_autopolot_btn_tv.text = resources.getString(R.string.charter_loading_autopilot_runnig_tv) + bus_autopilot_btn_iv.setImageResource(R.drawable.charter_ic_autopilot) + isClickable = true + background = ResourceUtils.getDrawable(R.drawable.charter_autopilot_0_1_status_bg) + } + + /** + * 自动驾驶中 + */ + override fun inAutopilot(){ + bus_autopolot_btn_tv.setTextColor(ContextCompat.getColor(context,R.color.charter_autopilot_text_color_normal)) + bus_autopolot_btn_tv.text = resources.getString(R.string.charter_loading_autopilot_runnig_tv) + bus_autopilot_btn_iv.setImageResource(R.drawable.charter_ic_autopilot) + isClickable = true + background = ResourceUtils.getDrawable(R.drawable.charter_autopilot_2_status_bg) + } + + /** + * 平行驾驶中 + */ + override fun inRemoteDriver(){ + bus_autopolot_btn_tv.setTextColor(ContextCompat.getColor(context,R.color.charter_autopilot_text_color_normal)) + bus_autopolot_btn_tv.text = resources.getString(R.string.charter_loading_autopilot_pingxing_tv) + bus_autopilot_btn_iv.setImageResource(R.drawable.charter_ic_autopilot) + isClickable = false + background = ResourceUtils.getDrawable(R.drawable.charter_pingxingjiashi) + } + + override fun onAttachedToWindow() { + super.onAttachedToWindow() + viewModel = findViewTreeViewModelStoreOwner()?.let { + ViewModelProvider(it).get(AutopilotStatusViewModel::class.java) + } + viewModel?.setAutopilotStatusCallback(this) + } + + override fun onDetachedFromWindow() { + super.onDetachedFromWindow() + } + + init { + try { + initView() + } catch (e: Exception) { + e.printStackTrace() + } + } + + +} \ No newline at end of file diff --git a/OCH/charter/driver/src/main/java/com/magic/mogo/och/charter/view/autopilot/AutopilotStatusViewModel.kt b/OCH/charter/driver/src/main/java/com/magic/mogo/och/charter/view/autopilot/AutopilotStatusViewModel.kt new file mode 100644 index 0000000000..900b62800a --- /dev/null +++ b/OCH/charter/driver/src/main/java/com/magic/mogo/och/charter/view/autopilot/AutopilotStatusViewModel.kt @@ -0,0 +1,208 @@ +package com.magic.mogo.och.charter.view.autopilot + +import androidx.lifecycle.ViewModel +import com.magic.mogo.och.charter.bean.QueryCurrentOrderResponse.Result.Companion.ARRIVED +import com.magic.mogo.och.charter.bean.QueryCurrentOrderResponse.Result.Companion.ARRIVING +import com.magic.mogo.och.charter.callback.IDriverM1ControllerStatusCallback +import com.magic.mogo.och.charter.constant.CharterConst +import com.magic.mogo.och.charter.model.DriverM1Model +import com.mogo.commons.voice.AIAssist +import com.mogo.eagle.core.data.config.FunctionBuildConfig +import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS_P +import com.mogo.eagle.core.utilcode.util.ThreadUtils +import com.mogo.eagle.core.utilcode.util.ToastUtils +import com.mogo.eagle.core.utilcode.util.UiThreadHandler +import com.mogo.och.common.module.manager.beautifymode.BeautifyManager +import com.mogo.och.common.module.manager.beautifymode.IBeautifyModeCallback +import com.mogo.och.common.module.manager.orderlogmanager.OchChainLogManager +import com.mogo.och.common.module.manager.stopsidemanager.StopSideManager +import com.mogo.och.common.module.manager.stopsidemanager.StopSideStatus +import com.mogo.och.common.module.utils.RxUtils +import java.util.concurrent.atomic.AtomicBoolean + +class AutopilotStatusViewModel: ViewModel(), IDriverM1ControllerStatusCallback, + IMoGoAutopilotStatusListener, IBeautifyModeCallback { + + private val TAG = AutopilotStatusViewModel::class.java.simpleName + + private var viewCallback:IAutopilotStatusCallback?=null + + private var isAnimateRunning = AtomicBoolean(false) + + + init { + DriverM1Model.get().setControllerStatusCallback(this) + } + + override fun onCleared() { + super.onCleared() + this.viewCallback = null + CallerAutoPilotStatusListenerManager.removeListener(TAG) + } + + fun setAutopilotStatusCallback(viewCallback:IAutopilotStatusCallback){ + this.viewCallback = viewCallback + CallerAutoPilotStatusListenerManager.addListener(TAG, this) + BeautifyManager.setStatusChangeListener(TAG,this) + this.setUIMode(CallerAutoPilotStatusListenerManager.getState()) + } + + fun restartAutopilot() { + // todo 启动自驾必须有订单路线 + if(isAnimateRunning.get()){ + ToastUtils.showShort("启动自驾中") + }else { + if (DriverM1Model.get().isHaveOrder()) { + DriverM1Model.get().restartAutopilot() + CallerLogger.d(M_BUS_P + TAG, "启动自驾") + } +// startOpenAutopilot() // TODO: 需要注释 + } + } + + /** + * 启动自驾 + */ + override fun startOpenAutopilot() { + ThreadUtils.runOnUiThread( { + isAnimateRunning.set(true) + this.viewCallback?.startAutopilotAnimation() + },ThreadUtils.MODE.QUEUE) + //20s 若自动驾驶没有开启,则结束动画 + UiThreadHandler.postDelayed({ + //20s 超时来判断自驾状态 + assertStartAutopiloState(CallerAutoPilotStatusListenerManager.getState()); + }, CharterConst.TIMER_START_AUTOPILOT_INTERVAL) + } + + /** + * 自驾不符合条件启动(底盘返回的) + */ + override fun onStartAdasFailure() { + ThreadUtils.runOnUiThread( { + // 底盘自驾判断无法启动自驾 + assertStartAutopiloState(CallerAutoPilotStatusListenerManager.getState()) + },ThreadUtils.MODE.QUEUE) + } + + /** + * 自驾状态回调 + */ + override fun onAutopilotStatusResponse(state: Int) { + if (isAnimateRunning.get() && IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING != state) { + // 主动开启自动驾驶中,不为2(为0、1)则继续loading + return + } + ThreadUtils.runOnUiThread( { + // 自驾状态变更回调(可能成功可能失败) + assertStartAutopiloState(state) + },ThreadUtils.MODE.QUEUE) + } + + private fun assertStartAutopiloState(state: Int){ + if(isAnimateRunning.get()){ + isAnimateRunning.set(false) + if(state==IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING){ + viewCallback?.startAutopilotSuccess() + }else{ + viewCallback?.startAutopilotFail() + } + this.viewCallback?.stopAutopilotAnimation() + RxUtils.createSubscribe(1_000) { + setUIMode(state) + } + }else{ + setUIMode(state) + } + } + + fun setUIMode(state:Int){ + CallerLogger.d(M_BUS_P + TAG, "新的状态:${state}") + if (FunctionBuildConfig.isDemoMode) {// 美化模式 + viewCallback?.inAutopilot() + val busOrderResult = DriverM1Model.get().getBusOrderResult() + if(busOrderResult==null){//无订单车闲置|车辆不闲置 + //是否强制绘制引导线 + FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false + OchChainLogManager.writeChainLog("车辆状态${state}","美化模式-无订单车闲置|车辆不闲置") + }else{ + if(busOrderResult.lineId==0||busOrderResult.siteId==0){//有订单无线路 + //是否强制绘制引导线 + FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false + CallerLogger.d(M_BUS_P + TAG, "美化模式-有订单-无线路") + OchChainLogManager.writeChainLog("车辆状态${state}","美化模式-有订单-无线路") + }else{ + if (busOrderResult.arriveStatus==ARRIVED) { + // 到站不绘制引导线 + FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false + OchChainLogManager.writeChainLog("车辆状态${state}","美化模式-有订单-到站") + return + } + if (StopSideManager.stopSiteStatus== StopSideStatus.EndingSuccess) { + // 靠边停车成功不绘制引导线 + FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false + OchChainLogManager.writeChainLog("车辆状态${state}","美化模式-有订单-靠边停车") + return + } + FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true + OchChainLogManager.writeChainLog("车辆状态${state}","美化模式-有订单-强制有引导线") + } + } + }else{ + when (state) { + IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE -> { + // 自动驾驶未就绪 + viewCallback?.autopilotDisable() + } + IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE -> { + // 自动驾驶状态就绪可启动自驾 + viewCallback?.canStartAutopilot() + } + IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> { + // 自动驾驶中 + viewCallback?.inAutopilot() + } + IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING -> { + // 平行驾驶中 + viewCallback?.inRemoteDriver() + } + else -> {} + } + } + } + + override fun dispatchStatus(typeEnum: BeautifyManager.ChangeTypeEnum) { + ThreadUtils.runOnUiThread( { + // 自驾状态变更回调(可能成功可能失败) + setUIMode(CallerAutoPilotStatusListenerManager.getState()) + },ThreadUtils.MODE.QUEUE) + } + + interface IAutopilotStatusCallback{ + /** + * 开始动画 + */ + fun startAutopilotAnimation() + + /** + * 结束动画 + */ + fun stopAutopilotAnimation() + // 进入自动驾驶 + fun inAutopilot() + // 自动驾驶不可用 + fun autopilotDisable() + // 自动驾驶不可用 + fun canStartAutopilot() + // 进入平行驾驶 + fun inRemoteDriver() + // 启动自驾成功 + fun startAutopilotSuccess() + // 启动自驾失败 + fun startAutopilotFail() + } + +} \ No newline at end of file diff --git a/OCH/charter/driver/src/main/java/com/magic/mogo/och/charter/view/carstatus/CarStatusView.kt b/OCH/charter/driver/src/main/java/com/magic/mogo/och/charter/view/carstatus/CarStatusView.kt new file mode 100644 index 0000000000..3ea6d0e068 --- /dev/null +++ b/OCH/charter/driver/src/main/java/com/magic/mogo/och/charter/view/carstatus/CarStatusView.kt @@ -0,0 +1,40 @@ +package com.magic.mogo.och.charter.view.carstatus + +import android.content.Context +import android.util.AttributeSet +import androidx.lifecycle.ViewModelProvider +import androidx.lifecycle.findViewTreeViewModelStoreOwner +import com.mogo.eagle.core.function.hmi.ui.widget.TrafficDataView + +class CarStatusView : TrafficDataView, CarStatusViewModel.ICarStatusCallback { + + private val TAG = "CarStatusView" + + constructor(context: Context) : super(context) + + constructor(context: Context, attributeSet: AttributeSet) : super(context, attributeSet) + + constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int) : super( + context, + attributeSet, + defStyleAttr + ) + + var viewModel:CarStatusViewModel?=null + + override fun onAttachedToWindow() { + super.onAttachedToWindow() + viewModel = findViewTreeViewModelStoreOwner()?.let { + ViewModelProvider(it).get(CarStatusViewModel::class.java) + } + viewModel?.setAutopilotStatusCallback(this) + } + + override fun onDetachedFromWindow() { + super.onDetachedFromWindow() + } + + override fun updateSpeedWithCurrentValue(speed: Int) { + updateSpeedWithValue(speed) + } +} \ No newline at end of file diff --git a/OCH/charter/driver/src/main/java/com/magic/mogo/och/charter/view/carstatus/CarStatusViewModel.kt b/OCH/charter/driver/src/main/java/com/magic/mogo/och/charter/view/carstatus/CarStatusViewModel.kt new file mode 100644 index 0000000000..c64e42e8b9 --- /dev/null +++ b/OCH/charter/driver/src/main/java/com/magic/mogo/och/charter/view/carstatus/CarStatusViewModel.kt @@ -0,0 +1,48 @@ +package com.magic.mogo.och.charter.view.carstatus + +import androidx.lifecycle.ViewModel +import com.magic.mogo.och.charter.model.DriverM1Model +import com.mogo.eagle.core.data.map.MogoLocation +import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener +import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener +import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager +import com.mogo.eagle.core.utilcode.util.ThreadUtils +import kotlin.math.abs + +class CarStatusViewModel: ViewModel(), IMoGoAutopilotStatusListener, + IMoGoChassisLocationGCJ02Listener { + + private val TAG = CarStatusViewModel::class.java.simpleName + + private var viewCallback:ICarStatusCallback?=null + + + init { + + } + + override fun onCleared() { + super.onCleared() + this.viewCallback = null + CallerChassisLocationGCJ02ListenerManager.removeListener(DriverM1Model.TAG) + } + + fun setAutopilotStatusCallback(viewCallback:ICarStatusCallback){ + this.viewCallback = viewCallback + CallerChassisLocationGCJ02ListenerManager.addListener(DriverM1Model.TAG, 10, this) + } + + interface ICarStatusCallback{ + fun updateSpeedWithCurrentValue(speed:Int) + } + + override fun onChassisLocationGCJ02(mogoLocation: MogoLocation?) { + mogoLocation?.let { + val speed = (abs(it.gnssSpeed) * 3.6f).toInt() // 倒车时工控机反馈定位信息中speed为负值 + ThreadUtils.runOnUiThread( { + viewCallback?.updateSpeedWithCurrentValue(speed) + },ThreadUtils.MODE.QUEUE) + } + } + +} \ No newline at end of file diff --git a/OCH/charter/driver/src/main/res/drawable/charter_autopilot_0_1_status_bg.xml b/OCH/charter/driver/src/main/res/drawable/charter_autopilot_0_1_status_bg.xml index 62d3a1173a..8c1d9e64ed 100644 --- a/OCH/charter/driver/src/main/res/drawable/charter_autopilot_0_1_status_bg.xml +++ b/OCH/charter/driver/src/main/res/drawable/charter_autopilot_0_1_status_bg.xml @@ -1,8 +1,6 @@ - - - - + + diff --git a/OCH/charter/driver/src/main/res/layout/charter_autopilot_status.xml b/OCH/charter/driver/src/main/res/layout/charter_autopilot_status.xml new file mode 100644 index 0000000000..ae9faef3d4 --- /dev/null +++ b/OCH/charter/driver/src/main/res/layout/charter_autopilot_status.xml @@ -0,0 +1,30 @@ + + + + + + + \ No newline at end of file diff --git a/OCH/charter/driver/src/main/res/layout/charter_base_fragment.xml b/OCH/charter/driver/src/main/res/layout/charter_base_fragment.xml index 8497b888f8..b34a7b46ba 100644 --- a/OCH/charter/driver/src/main/res/layout/charter_base_fragment.xml +++ b/OCH/charter/driver/src/main/res/layout/charter_base_fragment.xml @@ -29,7 +29,7 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" /> - + app:layout_constraintTop_toTopOf="parent"/> - - - - - + tools:visibility="visible" + android:layout_marginLeft="@dimen/dp_13"/> - - - - - diff --git a/OCH/charter/passenger/build.gradle b/OCH/charter/passenger/build.gradle index aca041d1ff..e84da8b7da 100644 --- a/OCH/charter/passenger/build.gradle +++ b/OCH/charter/passenger/build.gradle @@ -62,7 +62,9 @@ dependencies { implementation project(":OCH:mogo-och-common-module") compileOnly project(":libraries:mogo-map") implementation project(':core:mogo-core-res') - testImplementation 'junit:junit:4.12' + + androidTestImplementation rootProject.ext.dependencies.androidxjunit + testImplementation rootProject.ext.dependencies.junit } diff --git a/OCH/charter/passenger/src/main/AndroidManifest.xml b/OCH/charter/passenger/src/main/AndroidManifest.xml index e40c8b4775..05140a5254 100644 --- a/OCH/charter/passenger/src/main/AndroidManifest.xml +++ b/OCH/charter/passenger/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ - + \ No newline at end of file diff --git a/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/MogoOCHBusPassenger.kt b/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/MogoOCHBusPassenger.kt index 13be59b9b7..33007cf843 100644 --- a/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/MogoOCHBusPassenger.kt +++ b/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/MogoOCHBusPassenger.kt @@ -44,8 +44,8 @@ class MogoOCHBusPassenger : IMoGoFunctionProvider { val supportFragmentManager: FragmentManager? = mActivity?.supportFragmentManager if (mPassengerFragment == null) { - d(SceneConstant.M_TAXI_P + com.mogo.och.charter.passenger.MogoOCHBusPassenger.Companion.TAG, "准备add fragment======") - var fragmentByTag: Fragment? = supportFragmentManager?.findFragmentByTag(MainFragment.TAG) + d(SceneConstant.M_TAXI_P + TAG, "准备add fragment======") + val fragmentByTag: Fragment? = supportFragmentManager?.findFragmentByTag(MainFragment.TAG) mPassengerFragment = if (fragmentByTag is MainFragment){ fragmentByTag }else{ @@ -58,7 +58,7 @@ class MogoOCHBusPassenger : IMoGoFunctionProvider { } return } - d(SceneConstant.M_TAXI_P + com.mogo.och.charter.passenger.MogoOCHBusPassenger.Companion.TAG, "准备show fragment") + d(SceneConstant.M_TAXI_P + TAG, "准备show fragment") supportFragmentManager?.beginTransaction()?.show(mPassengerFragment!!) ?.commitAllowingStateLoss() } @@ -71,6 +71,6 @@ class MogoOCHBusPassenger : IMoGoFunctionProvider { } companion object { - private val TAG = com.mogo.och.charter.passenger.MogoOCHBusPassenger::class.java.simpleName + private val TAG = MogoOCHBusPassenger::class.java.simpleName } } \ No newline at end of file diff --git a/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/model/CharterPassengerModel.kt b/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/model/CharterPassengerModel.kt index 7f7b84ffa4..cebda9766f 100644 --- a/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/model/CharterPassengerModel.kt +++ b/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/model/CharterPassengerModel.kt @@ -22,6 +22,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS_P +import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr import com.mogo.eagle.core.utilcode.util.* import com.mogo.och.charter.passenger.R import com.mogo.och.common.module.manager.loopmanager.LoopInfo @@ -42,6 +43,7 @@ import com.mogo.och.common.module.biz.network.OchCommonServiceCallback import com.mogo.och.common.module.manager.CharterSendTripInfoManager import com.mogo.och.common.module.manager.CharterSendTripInfoManager.LEAVE_STATION import com.mogo.och.common.module.manager.autopilotmanager.OCHAdasAbilityManager +import com.mogo.och.common.module.manager.beautifymode.BeautifyManager import com.mogo.och.common.module.manager.orderlogmanager.OchChainLogManager import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil import com.mogo.och.common.module.utils.DateTimeUtil @@ -311,7 +313,7 @@ object CharterPassengerModel { } //监听网络变化,避免启动机器时无网导致无法更新订单信息 - private val mNetWorkIntentListener = IMogoIntentListener { intentStr, intent -> + private val mNetWorkIntentListener = IMogoIntentListener { intentStr, _ -> d(M_BUS_P + TAG, "onIntentReceived = %s", intentStr) if (ConnectivityManager.CONNECTIVITY_ACTION == intentStr) { if (NetworkUtils.isConnected(mContext)) { @@ -385,7 +387,7 @@ object CharterPassengerModel { this.orderInfo?.orderNo?.let { if (it != orderData.orderNo) { // orderNo 变后清理 - SharedPrefs.getInstance(mContext).remove("${it}$min5Speak") + SharedPrefsMgr.getInstance(mContext).remove("${it}$min5Speak") } } if (order.lineId == null || order.lineId == 0L || order.siteId == null || order.siteId == 0L) { @@ -561,7 +563,7 @@ object CharterPassengerModel { .subscribe { millisUntilFinished -> if (millisUntilFinished <= 900L) { orderInfo?.let { - val isPlayed = SharedPrefs.getInstance(mContext) + val isPlayed = SharedPrefsMgr.getInstance(mContext) .getBoolean("${it.orderNo}$min5Speak", false) if (!isPlayed) { //发送 通知 @@ -572,7 +574,7 @@ object CharterPassengerModel { ) VoiceManager.surplus15min(VoiceFocusManager.getVoiceCmdCallBack()) d(M_BUS_P + TAG, "倒计时15分钟${it.orderNo}") - SharedPrefs.getInstance(mContext) + SharedPrefsMgr.getInstance(mContext) .putBoolean("${it.orderNo}$min5Speak", true) } } @@ -736,6 +738,7 @@ object CharterPassengerModel { d(M_BUS_P + TAG, "${this.orderInfo?.orderNo}新的状态:$orderStatus") OchChainLogManager.writeChainLog(this.orderInfo.toString(),"新的状态:$orderStatus") this.orderStatus = orderStatus + BeautifyManager.notifyViewChange(BeautifyManager.ChangeTypeEnum.ORDER_STATU_CHANGE) for (callback in orderStatusChangeListeners.values) { callback.onStatusChange(this.orderStatus) } @@ -964,6 +967,7 @@ object CharterPassengerModel { if (order != null && lineId != null && siteId != null) { OchChainLogManager.writeChainLog(this.orderInfo.toString(),"到站成功:${order.siteName}") + BeautifyManager.notifyViewChange(BeautifyManager.ChangeTypeEnum.ARRIVED_DEST) VoiceManager.arrivedStation( order.siteName!!, order.siteNameKr ?: "", diff --git a/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/presenter/BusPassengerPresenter.kt b/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/presenter/BusPassengerPresenter.kt index 5cc59a047f..8018df7053 100644 --- a/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/presenter/BusPassengerPresenter.kt +++ b/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/presenter/BusPassengerPresenter.kt @@ -11,14 +11,13 @@ import com.mogo.commons.AbsMogoApplication import com.mogo.commons.voice.AIAssist import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager import com.mogo.eagle.core.function.call.order.CallerOrderListenerManager import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager import com.mogo.eagle.core.function.view.SiteMarkerBean import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS_P -import com.mogo.eagle.core.utilcode.util.SharedPrefs +import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr import com.mogo.och.charter.passenger.R import com.mogo.och.charter.passenger.bean.response.LineInfoResponse import com.mogo.och.charter.passenger.bean.response.OrderInfoResponse @@ -34,6 +33,7 @@ import com.mogo.och.charter.passenger.ui.overmapview.MakerWithSiteName import com.mogo.och.charter.passenger.ui.overmapview.MakerWithSiteNamewithCheck import com.mogo.och.common.module.biz.network.OchCommonServiceCallback import com.mogo.och.common.module.manager.autopilotmanager.OCHAdasAbilityManager +import com.mogo.och.common.module.manager.beautifymode.BeautifyManager import com.mogo.och.common.module.manager.stopsidemanager.StopSideManager import com.mogo.och.common.module.manager.devicemanage.callback.LightAirconditionDoorCallback import com.mogo.och.common.module.manager.stopsidemanager.OCHPlanningActionsCallback @@ -149,14 +149,14 @@ class BusPassengerPresenter(view: MainFragment?) : } private fun clearShowNoviceGuidanceSharedPrefs() { - SharedPrefs.getInstance(context).remove(KEY4SHOWNOVICEGUIDANCE) + SharedPrefsMgr.getInstance(context).remove(KEY4SHOWNOVICEGUIDANCE) } private fun showNoviceGuidance() { CallerLogger.d(M_BUS_P + TAG, "showNoviceGuidance") val currentOrderInfo = CharterPassengerModel.getCurrentOrderInfo() currentOrderInfo?.orderNo?.let { order -> - val stringSet = SharedPrefs.getInstance(context).getStringSet(KEY4SHOWNOVICEGUIDANCE) + val stringSet = SharedPrefsMgr.getInstance(context).getStringSet(KEY4SHOWNOVICEGUIDANCE) if (stringSet == null) { @@ -208,6 +208,7 @@ class BusPassengerPresenter(view: MainFragment?) : } StopSideStatus.EndingSuccess -> { + BeautifyManager.notifyViewChange(BeautifyManager.ChangeTypeEnum.STOPSITE_SUCCESS) ToastCharterUtils.showToastShort("靠边停车成功") VoiceNotice.showNotice( context.getString(R.string.charter_p_stop_site_success), diff --git a/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/ui/MainFragment.kt b/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/ui/MainFragment.kt index 6209889156..7e6fae56b7 100644 --- a/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/ui/MainFragment.kt +++ b/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/ui/MainFragment.kt @@ -42,9 +42,9 @@ import kotlinx.android.synthetic.main.charter_p_main_fragment.biz_softcontrol import kotlinx.android.synthetic.main.charter_p_main_fragment.biz_video import kotlinx.android.synthetic.main.charter_p_main_fragment.mapBizView import kotlinx.android.synthetic.main.charter_p_main_fragment.omvOverMap -import kotlinx.android.synthetic.main.charter_p_main_fragment.viewBusPM1MsgBoxBubble -import kotlinx.android.synthetic.main.charter_p_main_fragment.viewBusPM1MsgBoxButton -import kotlinx.android.synthetic.main.charter_p_main_fragment.viewBusPM1MsgBoxList +//import kotlinx.android.synthetic.main.charter_p_main_fragment.viewBusPM1MsgBoxBubble +//import kotlinx.android.synthetic.main.charter_p_main_fragment.viewBusPM1MsgBoxButton +//import kotlinx.android.synthetic.main.charter_p_main_fragment.viewBusPM1MsgBoxList import org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.ThreadMode @@ -104,20 +104,20 @@ class MainFragment : MvpFragment(), IMogo override fun initViews() { omvOverMap.hideResetView() - viewBusPM1MsgBoxButton.setClickListener(object : MMsgBoxButtonView.ClickListener { - override fun showMsgBoxList(show: Boolean) { - if (show) { - viewBusPM1MsgBoxList.visibility = View.VISIBLE - viewBusPM1MsgBoxBubble.visibility = View.GONE - viewBusPM1MsgBoxBubble.isShowData(false) - } else { - viewBusPM1MsgBoxList.visibility = View.GONE - viewBusPM1MsgBoxBubble.visibility = View.VISIBLE - viewBusPM1MsgBoxBubble.isShowData(true) - } - } - - }) +// viewBusPM1MsgBoxButton.setClickListener(object : MMsgBoxButtonView.ClickListener { +// override fun showMsgBoxList(show: Boolean) { +// if (show) { +// viewBusPM1MsgBoxList.visibility = View.VISIBLE +// viewBusPM1MsgBoxBubble.visibility = View.GONE +// viewBusPM1MsgBoxBubble.isShowData(false) +// } else { +// viewBusPM1MsgBoxList.visibility = View.GONE +// viewBusPM1MsgBoxBubble.visibility = View.VISIBLE +// viewBusPM1MsgBoxBubble.isShowData(true) +// } +// } +// +// }) bb_boorombar.setCheckChangeListener(object : BottomBar.ApplyClickLintener { override fun onApplyClick(selectItem: BottomBar.SelectView): Boolean { diff --git a/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/ui/dialogfragment/NoviceGuidanceFragment.kt b/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/ui/dialogfragment/NoviceGuidanceFragment.kt index 661c1abedb..74167e212e 100644 --- a/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/ui/dialogfragment/NoviceGuidanceFragment.kt +++ b/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/ui/dialogfragment/NoviceGuidanceFragment.kt @@ -14,6 +14,7 @@ import com.mogo.commons.mvp.MvpDialogFragment import com.mogo.commons.voice.AIAssist import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS_P +import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr import com.mogo.eagle.core.utilcode.util.* import com.mogo.och.charter.passenger.R import com.mogo.och.charter.passenger.model.CharterPassengerModel @@ -160,7 +161,7 @@ class NoviceGuidanceFragment : val currentOrderInfo = CharterPassengerModel.getCurrentOrderInfo() currentOrderInfo?.orderNo?.let { order -> val orderNoSet = mutableSetOf(order) - SharedPrefs.getInstance(requireContext()) + SharedPrefsMgr.getInstance(requireContext()) .putStringSet(BusPassengerPresenter.KEY4SHOWNOVICEGUIDANCE, orderNoSet) } } diff --git a/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/ui/statusbar/StatusBarView.kt b/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/ui/statusbar/StatusBarView.kt index 888bdb0c7a..20352dba05 100644 --- a/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/ui/statusbar/StatusBarView.kt +++ b/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/ui/statusbar/StatusBarView.kt @@ -1,6 +1,5 @@ package com.mogo.och.charter.passenger.ui.statusbar -import android.annotation.SuppressLint import android.content.Context import android.os.SystemClock import android.util.AttributeSet @@ -14,22 +13,24 @@ import chassis.ChassisStatesOuterClass import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener 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.CallerAutoPilotStatusListenerManager 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.function.call.telematic.CallerTelematicManager -import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.util.ClickUtils import com.mogo.eagle.core.utilcode.util.UiThreadHandler import com.mogo.och.charter.passenger.R +import com.mogo.och.charter.passenger.bean.response.OrderInfoResponse +import com.mogo.och.charter.passenger.model.CharterPassengerModel +import com.mogo.och.charter.passenger.model.OrderStatusEnum import com.mogo.och.charter.passenger.ui.debugview.DebugEvent +import com.mogo.och.common.module.manager.beautifymode.BeautifyManager +import com.mogo.och.common.module.manager.beautifymode.IBeautifyModeCallback import com.mogo.och.common.module.manager.loopmanager.BizLoopManager import com.mogo.och.common.module.manager.loopmanager.LoopInfo +import com.mogo.och.common.module.manager.stopsidemanager.StopSideManager +import com.mogo.och.common.module.manager.stopsidemanager.StopSideStatus import kotlinx.android.synthetic.main.charter_p_statusview_datetime.view.aciv_connect_driver_status import kotlinx.android.synthetic.main.charter_p_statusview_datetime.view.actv_auto_status import kotlinx.android.synthetic.main.charter_p_statusview_datetime.view.bizz_view @@ -44,7 +45,8 @@ class StatusBarView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 -) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoSkinModeChangeListener, IViewControlListener, IMoGoBatteryManagementSystemListener, IMoGoAutopilotStatusListener { +) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoBatteryManagementSystemListener, IMoGoAutopilotStatusListener, + IBeautifyModeCallback { companion object { const val TAG = "StatusBarView" @@ -85,17 +87,12 @@ class StatusBarView @JvmOverloads constructor( params.height = AutoSizeUtils.dp2px(context,47f) layoutParams = params } - //添加view控制 - CallerHmiViewControlListenerManager.addListener(TAG,this) - CallerHmiViewControlListenerManager.setListenerHz(TAG,5) - // 添加换肤监听 - CallerSkinModeListenerManager.addListener(TAG, this) - + //电池电量监听 CallerBatteryManagementSystemListenerManager.addListener(TAG,this) - + //自动驾驶状态监听 CallerAutoPilotStatusListenerManager.addListener(TAG, this) - updateStatusBarRightView(FunctionBuildConfig.isDemoMode, "demoMode", DemoModeView(this.context)) + BeautifyManager.setStatusChangeListener(TAG,this) bizz_view.setOnClickListener { continuousClick(bizz) } @@ -104,8 +101,7 @@ class StatusBarView @JvmOverloads constructor( progress.progress = 50 tv_power_cos.text = "50%" - val state = CallerAutoPilotStatusListenerManager.getState() - setAutoPilotStatusInfo(state) + setAutoPilotStatusInfo(CallerAutoPilotStatusListenerManager.getState()) BizLoopManager.setLoopFunction(TAG, LoopInfo(3, ::showConnectStatusWithDriver)) } @@ -122,27 +118,58 @@ class StatusBarView @JvmOverloads constructor( } private fun setAutoPilotStatusInfo(state: Int) { - when (state) { - IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE -> { - actv_auto_status.text = "安全接管中" + if (FunctionBuildConfig.isDemoMode) {// 美化模式 + actv_auto_status.text = "自动驾驶中" + when (CharterPassengerModel.getCurrentOrderStatus()) { + OrderStatusEnum.Nothing -> {// 初始状态 + //是否强制绘制引导线 + FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false + } + OrderStatusEnum.NoOrderUnuse -> {//无订单车闲置 + //是否强制绘制引导线 + FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false + } + OrderStatusEnum.OrderNoLine -> {//有订单无线路 + //是否强制绘制引导线 + FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false + } + OrderStatusEnum.OrdersWithLine -> {//有订单有线路 是否到站 + //是否强制绘制引导线 + CharterPassengerModel.getCurrentOrderInfo()?.let { + if(it.arriveStatus == OrderInfoResponse.ARRIVED){ + // 到站不绘制引导线 + FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false + return + } + if (StopSideManager.stopSiteStatus== StopSideStatus.EndingSuccess) { + // 靠边停车成功不绘制引导线 + FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false + return + } + FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true + } + } + OrderStatusEnum.NoOrderUse -> {// 无订单车不闲置 + //是否强制绘制引导线 + FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false + } } - IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE -> { - actv_auto_status.text = "安全接管中" + }else{ + when (state) { + IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE -> { + actv_auto_status.text = "安全接管中" + } + IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE -> { + actv_auto_status.text = "安全接管中" + } + IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> { + actv_auto_status.text = "自动驾驶中" + } + IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING -> { + actv_auto_status.text = "远程代驾中" + } + else -> {} } - IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> { - actv_auto_status.text = "自动驾驶中" - } - IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING -> { - actv_auto_status.text = "远程代驾中" - } - else -> {} - } - } - - override fun onSkinModeChange(skinMode: Int) { - when (skinMode) { - 0 -> setStatusBarDarkOrLight(false) - 1 -> setStatusBarDarkOrLight(true) } } @@ -152,21 +179,16 @@ class StatusBarView @JvmOverloads constructor( } } - override fun updateStatusBarLeftView(insert: Boolean, tag: String, viewGroup: ViewGroup) { - - } - - @SuppressLint("SetTextI18n") - override fun updateStatusBarDownloadView(insert: Boolean, tag: String, progress: Int) { - - } - override fun onDetachedFromWindow() { super.onDetachedFromWindow() - CallerHmiViewControlListenerManager.removeListener(TAG) - CallerSkinModeListenerManager.removeListener(TAG) CallerDevaToolsManager.hideStatusBar() + //定时任务 BizLoopManager.removeLoopFunction(TAG) + //电池电量监听 + CallerBatteryManagementSystemListenerManager.removeListener(TAG) + //自动驾驶状态监听 + CallerAutoPilotStatusListenerManager.removeListener(TAG) + BeautifyManager.setStatusChangeListener(TAG,null) } override fun onBatteryManagementSystemStates(states: ChassisStatesOuterClass.BMSSystemStates) { @@ -179,5 +201,11 @@ class StatusBarView @JvmOverloads constructor( tv_power_cos.text = "${bmsSoc.roundToInt()}%" } } + + override fun dispatchStatus(typeEnum: BeautifyManager.ChangeTypeEnum) { + UiThreadHandler.post( { + setAutoPilotStatusInfo(CallerAutoPilotStatusListenerManager.getState()) + },UiThreadHandler.MODE.QUEUE) + } } diff --git a/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/utils/BusPassengerMapAssetStyleUtil.java b/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/utils/BusPassengerMapAssetStyleUtil.java index 09807fa2b8..b2da8e2513 100644 --- a/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/utils/BusPassengerMapAssetStyleUtil.java +++ b/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/utils/BusPassengerMapAssetStyleUtil.java @@ -19,7 +19,10 @@ public class BusPassengerMapAssetStyleUtil { is1 = context.getResources().getAssets().open(fileName); //eg. over_view_style.data int lenght1 = is1.available(); buffer1 = new byte[lenght1]; - is1.read(buffer1); + int count = 0; + while ((count = is1.read(buffer1)) > 0) { + is1.read(buffer1); + } } catch (IOException e) { e.printStackTrace(); } finally { diff --git a/OCH/charter/passenger/src/main/res/drawable-nodpi/charter_p_guidace_1.webp b/OCH/charter/passenger/src/main/res/drawable-nodpi/charter_p_guidace_1.webp index c7a69ec5c8..9f79104dce 100644 Binary files a/OCH/charter/passenger/src/main/res/drawable-nodpi/charter_p_guidace_1.webp and b/OCH/charter/passenger/src/main/res/drawable-nodpi/charter_p_guidace_1.webp differ diff --git a/OCH/charter/passenger/src/main/res/drawable-nodpi/charter_p_guidace_2.webp b/OCH/charter/passenger/src/main/res/drawable-nodpi/charter_p_guidace_2.webp index 9a52c9671a..2ebbc255c5 100644 Binary files a/OCH/charter/passenger/src/main/res/drawable-nodpi/charter_p_guidace_2.webp and b/OCH/charter/passenger/src/main/res/drawable-nodpi/charter_p_guidace_2.webp differ diff --git a/OCH/charter/passenger/src/main/res/drawable-nodpi/charter_p_guidace_3.webp b/OCH/charter/passenger/src/main/res/drawable-nodpi/charter_p_guidace_3.webp index 4f732eeb63..80805e1672 100644 Binary files a/OCH/charter/passenger/src/main/res/drawable-nodpi/charter_p_guidace_3.webp and b/OCH/charter/passenger/src/main/res/drawable-nodpi/charter_p_guidace_3.webp differ diff --git a/OCH/charter/passenger/src/main/res/drawable-nodpi/charter_p_guidace_4.webp b/OCH/charter/passenger/src/main/res/drawable-nodpi/charter_p_guidace_4.webp index 99bfd7223f..6969cca934 100644 Binary files a/OCH/charter/passenger/src/main/res/drawable-nodpi/charter_p_guidace_4.webp and b/OCH/charter/passenger/src/main/res/drawable-nodpi/charter_p_guidace_4.webp differ diff --git a/OCH/charter/passenger/src/main/res/drawable-nodpi/charter_p_image_welcome_nor.webp b/OCH/charter/passenger/src/main/res/drawable-nodpi/charter_p_image_welcome_nor.webp index 8533cad601..ba4dc7c893 100644 Binary files a/OCH/charter/passenger/src/main/res/drawable-nodpi/charter_p_image_welcome_nor.webp and b/OCH/charter/passenger/src/main/res/drawable-nodpi/charter_p_image_welcome_nor.webp differ diff --git a/OCH/charter/passenger/src/main/res/layout/charter_p_devices_unlock.xml b/OCH/charter/passenger/src/main/res/layout/charter_p_devices_unlock.xml index 1d0f8c7b27..944b5ff4ff 100644 --- a/OCH/charter/passenger/src/main/res/layout/charter_p_devices_unlock.xml +++ b/OCH/charter/passenger/src/main/res/layout/charter_p_devices_unlock.xml @@ -50,9 +50,10 @@ diff --git a/OCH/charter/passenger/src/main/res/layout/charter_p_main_fragment.xml b/OCH/charter/passenger/src/main/res/layout/charter_p_main_fragment.xml index 96a4bc6821..43dcded38a 100644 --- a/OCH/charter/passenger/src/main/res/layout/charter_p_main_fragment.xml +++ b/OCH/charter/passenger/src/main/res/layout/charter_p_main_fragment.xml @@ -7,7 +7,7 @@ + + @@ -52,45 +62,24 @@ app:layout_constraintEnd_toEndOf="@+id/mapBizView" app:layout_constraintStart_toStartOf="parent" /> - - - - - - - + + app:layout_constraintEnd_toEndOf="@+id/zv_msg_pop_bottom" + app:layout_constraintBottom_toTopOf="@+id/zv_msg_pop_bottom" /> - + app:layout_constraintBottom_toTopOf="@+id/bb_boorombar" + android:layout_marginBottom="@dimen/dp_m_2" + app:layout_constraintStart_toStartOf="parent" /> \ No newline at end of file diff --git a/OCH/mogo-och-common-module/build.gradle b/OCH/mogo-och-common-module/build.gradle index e7d98bb6e2..d45239d994 100644 --- a/OCH/mogo-och-common-module/build.gradle +++ b/OCH/mogo-och-common-module/build.gradle @@ -49,6 +49,7 @@ dependencies { implementation rootProject.ext.dependencies.androidxappcompat implementation rootProject.ext.dependencies.material testImplementation 'junit:junit:4.12' + testImplementation project(path: ':OCH:mogo-och-common-module') androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' implementation rootProject.ext.dependencies.amapnavi3dmap diff --git a/OCH/mogo-och-common-module/src/debug/java/com/mogo/och/common/module/debug/DebugDataDispatch.kt b/OCH/mogo-och-common-module/src/debug/java/com/mogo/och/common/module/debug/DebugDataDispatch.kt index 3b4fd0068a..c9970599ec 100644 --- a/OCH/mogo-och-common-module/src/debug/java/com/mogo/och/common/module/debug/DebugDataDispatch.kt +++ b/OCH/mogo-och-common-module/src/debug/java/com/mogo/och/common/module/debug/DebugDataDispatch.kt @@ -2,6 +2,7 @@ package com.mogo.och.common.module.debug import android.content.Intent import android.os.Environment +import android.os.SystemClock import chassis.Chassis import chassis.Chassis.DoorNumber import chassis.VehicleStateOuterClass @@ -10,10 +11,12 @@ import com.google.gson.reflect.TypeToken import com.mogo.eagle.core.data.enums.DataSourceType import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager +import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotStatisticsListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerChassisDoorStateListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerChassisGnssListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager +import com.mogo.eagle.core.function.call.autopilot.CallerPlanningActionsListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant @@ -24,6 +27,7 @@ import com.mogo.och.common.module.debug.location.MogoLocationExit import com.mogo.och.common.module.manager.distancemamager.TrajectoryAndDistanceManager import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil import com.mogo.och.common.module.view.DebugFloatWindow +import com.zhjt.mogo.adas.data.bean.AutopilotStatistics import mogo.telematics.pad.MessagePad import mogo_msg.MogoReportMsg import java.io.BufferedReader @@ -43,20 +47,30 @@ object DebugDataDispatch { const val carLightSwitch = "lightSwitch" const val trajectoryStation = "trajectoryStation" const val showDebugView = "showDebugView" + const val stateAutopilot = "stateAutopilot" + const val stateAutopilotFail = "stateAutopilotFail" + const val stopSite = "stopSite" -// aadb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "location" --es path "1111/11111" +// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "location" --es path "1111/11111" // adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "globalPath" --es path "sy73.json" // adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "carDoor" --ei doorPostion 1 --ei doorStatus 1 // adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "trunAroud" --es code "IMAP_TRA_LOADED" // adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "lightSwitch" --ei lightPostion 0 +// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "stateAutopilot" --ei autopilotMode 0 --ei autopilotState 0 +// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "stateAutopilotFail" // adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "trajectoryStation" --ef startLon 116.74053643938474 --ef startLat 40.200487993233246 --ef endLon 116.73876977409685 --ef endLat 40.20179054129441 --el lineID 8 +// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "stopSite" --ei state 6 --ei action 1 val ROOT_PATH = - Environment.getExternalStorageDirectory().absolutePath + File.separator + "MLog" + File.separator + "APPLog" + File.separator //程序外部存储跟目录 + Environment.getExternalStorageDirectory().absolutePath + File.separator + "MLog" + File.separator + "APP_mock" + File.separator //程序外部存储跟目录 fun disPathc(type: String?, frequency: Int, sourceFilePath: String?, intent: Intent) { + val file = File(ROOT_PATH); + if(file.exists()){ + + } when (type) { globalPathMock -> { sourceFilePath?.let { @@ -118,6 +132,35 @@ object DebugDataDispatch { val debugFloatWindow = DebugFloatWindow(ActivityUtils.getTopActivity()) debugFloatWindow.showFloatWindow() } + stateAutopilot -> { + val autopilotState = intent.getIntExtra("autopilotState", 0) + val autopilotMode = intent.getIntExtra("autopilotMode", 0) + CallerAutoPilotStatusListenerManager.updateAutoPilotStatus(autopilotState,autopilotMode) + } + stateAutopilotFail -> { + val newBuilder = MogoReportMsg.MogoReportMessage.newBuilder() + newBuilder.code = "100" + newBuilder.msg = "adb 模拟指令" + newBuilder.timestampBuilder.sec = 0 + newBuilder.timestampBuilder.nsec = 0 + newBuilder.src = "2" + newBuilder.level = "" + var autopilotStatistics = + AutopilotStatistics(1, SystemClock.elapsedRealtime(), null, newBuilder.build()) + CallerAutopilotStatisticsListenerManager.invokeAutopilotStatistics(autopilotStatistics) + } + stopSite -> { + val state = intent.getIntExtra("state", 0) + val action = intent.getIntExtra("action", 0) + val pncAction = MessagePad.PlanningActionMsg.newBuilder() + val planningaction = MessagePad.ParkScenarioPlanningAction.newBuilder() + val drivingAction = MessagePad.ParkScenarioDrivingAction.newBuilder() + drivingAction.drivingState = MessagePad.ParkScenarioDrivingState.forNumber(state) + drivingAction.drivingAction = MessagePad.DrivingAction.forNumber(action) + planningaction.actionMsg = drivingAction.build() + pncAction.parkScenarioAction = planningaction.build() + CallerPlanningActionsListenerManager.invokePNCActions(pncAction.build()) + } else -> {} } } diff --git a/OCH/mogo-och-common-module/src/debug/java/com/mogo/och/common/module/utils/CollectionUtils.java b/OCH/mogo-och-common-module/src/debug/java/com/mogo/och/common/module/utils/CollectionUtils.java index a8ae762168..f4218e1544 100644 --- a/OCH/mogo-och-common-module/src/debug/java/com/mogo/och/common/module/utils/CollectionUtils.java +++ b/OCH/mogo-och-common-module/src/debug/java/com/mogo/och/common/module/utils/CollectionUtils.java @@ -13,13 +13,17 @@ public class CollectionUtils { OkHttpClient okHttpClient = OkHttpFactory.Companion.getOkHttpClient(); List interceptors = okHttpClient.interceptors(); Field pro = getDeclaredField(interceptors, "list"); - pro.setAccessible(true); - List modifyerList = null; - try { - modifyerList = (List) pro.get(interceptors); - modifyerList.add(new SimpleInterceptor()); - } catch (IllegalAccessException e) { - e.printStackTrace(); + if(pro != null){ + pro.setAccessible(true); + List modifierList; + try { + modifierList = (List) pro.get(interceptors); + if(modifierList != null){ + modifierList.add(new SimpleInterceptor()); + } + } catch (IllegalAccessException e) { + e.printStackTrace(); + } } } /** @@ -32,7 +36,10 @@ public class CollectionUtils { * @since:2019年2月26日 下午4:06:16 */ public static Field getDeclaredField(Object object, String fieldName){ - Field field = null ; + if(fieldName == null){ + return null; + } + Field field; Class clazz = object.getClass() ; for(; clazz != Object.class ; clazz = clazz.getSuperclass()) { try { diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/biz/model/OchCommonLoginModel.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/biz/model/OchCommonLoginModel.kt index 223f60effa..4be8d6a160 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/biz/model/OchCommonLoginModel.kt +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/biz/model/OchCommonLoginModel.kt @@ -4,9 +4,8 @@ import android.annotation.SuppressLint import android.content.Context import com.mogo.eagle.core.data.BaseData import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager +import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr import com.mogo.eagle.core.utilcode.util.NetworkUtils -import com.mogo.eagle.core.utilcode.util.SharedPrefs -import com.mogo.eagle.core.utilcode.util.ToastUtils import com.mogo.och.common.module.R import com.mogo.och.common.module.biz.bean.TaxiLoginReqBean import com.mogo.och.common.module.biz.bean.TaxiLoginRespBean @@ -100,8 +99,8 @@ object OchCommonLoginModel { // 获取验证码成功 ToastCharterUtils.showToastShort(mContext?.getString(R.string.module_och_taxi_login_login_success)) LoginStatusManager.setLoginStatus(TaxiLoginStatusEnum.Login) - mContext?.let { - SharedPrefs.getInstance(it).putString("och_account", phone) + mContext?.let { c -> + SharedPrefsMgr.getInstance(c).putString("och_account", phone) } iTaxiLoginCallback?.loginSuccess() } else { diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/biz/model/OchCommonLoginStatusDefaultModel.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/biz/model/OchCommonLoginStatusDefaultModel.kt index 9e32bd2aa5..a2d0ece58f 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/biz/model/OchCommonLoginStatusDefaultModel.kt +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/biz/model/OchCommonLoginStatusDefaultModel.kt @@ -3,16 +3,14 @@ package com.mogo.och.common.module.biz.model import android.annotation.SuppressLint import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant +import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr import com.mogo.eagle.core.utilcode.util.GsonUtils -import com.mogo.eagle.core.utilcode.util.SharedPrefs -import com.mogo.eagle.core.utilcode.util.TimeUtils import com.mogo.och.common.module.bean.dpmsg.BusCacheKey import com.mogo.och.common.module.bean.dpmsg.LoginCacheStatus import com.mogo.och.common.module.biz.bean.DriverStatusQueryRespBean import com.mogo.och.common.module.biz.callback.ILoginCallback import com.mogo.och.common.module.biz.callback.ILoginViewCallback import com.mogo.och.common.module.biz.constant.LoginStatusManager -import com.mogo.och.common.module.biz.constant.LoginStatusManager.isLogin import com.mogo.och.common.module.utils.DateTimeUtil import com.mogo.och.data.manager.cache.CacheDataManager @@ -29,10 +27,10 @@ object OchCommonLoginStatusDefaultModel : OchCommonLoginStatusModel() { override fun loginSuccess(data: DriverStatusQueryRespBean?) { CallerLogger.d(SceneConstant.M_TAXI + TAG, "loginSuccess:${LoginStatusManager.isLogin()}") if (LoginStatusManager.isLogin()) { - SharedPrefs.getInstance(mContext).putString("och_account", data?.data?.phone) + SharedPrefsMgr.getInstance(mContext).putString("och_account", data?.data?.phone) loginViewCallback?.hideLoginDialogFragment() } else { - SharedPrefs.getInstance(mContext).putString("och_account", "") + SharedPrefsMgr.getInstance(mContext).putString("och_account", "") loginViewCallback?.showLoginDialogFragment() } loginCallback?.loginSuccess(data) @@ -42,8 +40,7 @@ object OchCommonLoginStatusDefaultModel : OchCommonLoginStatusModel() { } private fun updateLoginLocalStatus(loginStatus: Int = 0) { - var loginCacheStatus = LoginCacheStatus(loginStatus,DateTimeUtil.getCurrentTimeStamp()) - + val loginCacheStatus = LoginCacheStatus(loginStatus,DateTimeUtil.getCurrentTimeStamp()) CacheDataManager.instance.putCacheData(mContext, BusCacheKey.BUS_LOGIN_STATUS_CACHE, GsonUtils.toJson(loginCacheStatus)) } diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/beautifymode/BeautifyManager.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/beautifymode/BeautifyManager.kt new file mode 100644 index 0000000000..e962cdaca6 --- /dev/null +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/beautifymode/BeautifyManager.kt @@ -0,0 +1,65 @@ +package com.mogo.och.common.module.manager.beautifymode + +import com.mogo.eagle.core.data.config.FunctionBuildConfig +import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener +import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener +import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager +import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager +import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import java.util.concurrent.ConcurrentHashMap + +object BeautifyManager : IViewControlListener, IReceivedMsgListener { + + private val TAG = BeautifyManager::class.java.simpleName + + enum class ChangeTypeEnum{ + BEAUTIFY_TYPE,// 美化模式变化 + ORDER_STATU_CHANGE,// 订单状态发生变化 + ARRIVED_DEST,// 到站 + STOPSITE_SUCCESS,// 靠边停车成功 + STOPSITE_SUCCESS_RUN// 靠边停车成功后恢复为正在驾驶 + } + + private val orderStatusChangeListeners = ConcurrentHashMap() + + init { + if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { + CallerHmiViewControlListenerManager.addListener(TAG,this) + } else if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) { + CallerTelematicListenerManager.addListener(TAG,this) + } + } + + fun setStatusChangeListener(tag: String, orderStatusChangeListener: IBeautifyModeCallback?) { + if (tag.isBlank()) return + if (orderStatusChangeListener == null) { + orderStatusChangeListeners.remove(tag) + return + } + orderStatusChangeListeners[tag] = orderStatusChangeListener + } + + + fun notifyViewChange(typeEnum: ChangeTypeEnum){ + CallerLogger.d(TAG,"美化模式变化原因:${typeEnum}") + orderStatusChangeListeners.forEach { + it.value.dispatchStatus(typeEnum) + } + } + + override fun onReceivedMsg(type: Int, byteArray: ByteArray) { + + } + + override fun onDemoMode(isDemoMode: Boolean) { + notifyViewChange(ChangeTypeEnum.BEAUTIFY_TYPE) + } + + override fun updateFuncMode(tag: String, boolean: Boolean) { + if (tag == IViewControlListener.FUNC_MODE_DEMO) { + notifyViewChange(ChangeTypeEnum.BEAUTIFY_TYPE) + } + } + +} \ No newline at end of file diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/beautifymode/IBeautifyModeCallback.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/beautifymode/IBeautifyModeCallback.kt new file mode 100644 index 0000000000..b07c013249 --- /dev/null +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/beautifymode/IBeautifyModeCallback.kt @@ -0,0 +1,6 @@ +package com.mogo.och.common.module.manager.beautifymode + + +interface IBeautifyModeCallback { + fun dispatchStatus(typeEnum: BeautifyManager.ChangeTypeEnum) +} \ No newline at end of file diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/distancemamager/TrajectoryAndDistanceManager.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/distancemamager/TrajectoryAndDistanceManager.kt index fa3ebe8443..fb6b7234e0 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/distancemamager/TrajectoryAndDistanceManager.kt +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/distancemamager/TrajectoryAndDistanceManager.kt @@ -670,18 +670,24 @@ object TrajectoryAndDistanceManager : IMoGoPlanningRottingListener { return if (redCatche.isNullOrEmpty()) { distanceWithStartStation() } else { - distanceWithTrajectory(redCatche) + val currentPoint = + CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02() + distanceWithTrajectory(redCatche,currentPoint) } } else { return if (this.lineId == 0L || this.lineId == null) { - distanceWithTrajectory(mRoutePoints!!) + val currentPoint = + CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02() + distanceWithTrajectory(mRoutePoints!!,currentPoint) } else { if (lineId != this.lineId) { // 判断距离起始站的距离 distanceWithStartStation() } else { - distanceWithTrajectory(mRoutePoints!!) + val currentPoint = + CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02() + distanceWithTrajectory(mRoutePoints!!,currentPoint) } } } @@ -715,9 +721,7 @@ object TrajectoryAndDistanceManager : IMoGoPlanningRottingListener { /** * 距离轨迹的距离 */ - private fun distanceWithTrajectory(redCatche: MutableList): String { - val currentPoint = - CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02() + fun distanceWithTrajectory(redCatche: MutableList,currentPoint:MogoLocation): String { // 判断距离轨迹的距离 val carLocationInfo: Triple = CoordinateCalculateRouteUtil.getNearestPointInfo( @@ -725,8 +729,7 @@ object TrajectoryAndDistanceManager : IMoGoPlanningRottingListener { redCatche.size - 1, redCatche, currentPoint, - 2, - useHeading = false + 2 ) if (carLocationInfo.third <= OchCommonConst.AUTOMATIC_PLANNING_MAX_DISTANCE) { return ""// 可以启动自驾 diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/loopmanager/BizLoopManager.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/loopmanager/BizLoopManager.kt index ff512902fa..f40e96513c 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/loopmanager/BizLoopManager.kt +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/loopmanager/BizLoopManager.kt @@ -73,7 +73,11 @@ object BizLoopManager { override fun onSubscribe(d: Disposable) {} override fun onError(e: Throwable) {} override fun onComplete() { - loopInfo.function.invoke() + try { + loopInfo.function.invoke() + }catch (e:Throwable){ + CallerLogger.e(TAG,"$tag:--$e") + } CallerLogger.d(TAG, "${aLong}正在执行方法${tag}_${Thread.currentThread().name}") } override fun onNext(t: String) {} diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/orderlogmanager/OchChainLogManager.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/orderlogmanager/OchChainLogManager.kt index a4417e2b64..6dd342e160 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/orderlogmanager/OchChainLogManager.kt +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/orderlogmanager/OchChainLogManager.kt @@ -16,6 +16,7 @@ object OchChainLogManager { private val TAG = OchChainLogManager::class.java.simpleName const val EVENT_KEY_INFE_WITH_CHANGE = "event_key_och_common_info_and_changeinfo" + const val EVENT_KEY_INFE_WITH_TRAJECTORY = "event_key_och_trajectory_info" /** * @param Info 订单详细信息 @@ -27,19 +28,24 @@ object OchChainLogManager { nodeAliasCode = ChainConstant.CHAIN_CODE_OCH_COMMON_DISTANCE, paramIndexes = [0,1] ) - fun writeChainLog(Info: String, changeInfo: String,upload:Boolean = true) { - d(SceneConstant.M_OCHCOMMON + TAG, Info) - d(SceneConstant.M_OCHCOMMON + TAG, changeInfo) - if(upload) { - val plateNum = AppConfigInfo.plateNumber - val params = HashMap() - params["sn"] = MoGoAiCloudClientConfig.getInstance().sn - params["env"] = DebugConfig.getNetMode() - params["plate_number"] = if (TextUtils.isEmpty(plateNum)) "" else plateNum - params["time"] = DateTimeUtils.getTimeText(DateTimeUtils.yyyy_MM_dd_HH_mm_ss) - params["info"] = Info - params["changeInfo"] = changeInfo - MogoAnalyticUtils.track(EVENT_KEY_INFE_WITH_CHANGE, params) + @JvmStatic + fun writeChainLog(Info: String, changeInfo: String,upload:Boolean = true,eventID:String=EVENT_KEY_INFE_WITH_CHANGE) { + try { + d(SceneConstant.M_OCHCOMMON + TAG, Info) + d(SceneConstant.M_OCHCOMMON + TAG, changeInfo) + if(upload) { + val plateNum = AppConfigInfo.plateNumber + val params = HashMap() + params["sn"] = MoGoAiCloudClientConfig.getInstance().sn + params["env"] = DebugConfig.getNetMode() + params["plate_number"] = if (TextUtils.isEmpty(plateNum)) "" else plateNum + params["time"] = DateTimeUtils.getTimeText(DateTimeUtils.yyyy_MM_dd_HH_mm_ss) + params["info"] = Info + params["changeInfo"] = changeInfo + MogoAnalyticUtils.track(eventID, params) + } + }catch (e:Exception){ + e.printStackTrace() } } diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/stopsidemanager/StopSideManager.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/stopsidemanager/StopSideManager.kt index f67668de5d..fbf4e26315 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/stopsidemanager/StopSideManager.kt +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/stopsidemanager/StopSideManager.kt @@ -186,7 +186,12 @@ object StopSideManager : IMoGoAutopilotPlanningActionsListener { // 只响应第一次 }else{ stopSiteStatus = StopSideStatus.NOTHING - CallerLogger.d(SceneConstant.M_BUS+ TAG,"进入正常驾驶") + M_LISTENERS.forEach { + val tag = it.key + val listener = it.value + CallerLogger.d(SceneConstant.M_BUS+ TAG,"进入正常驾驶") + listener.onStartAutopilotFailure(StopSideStatus.NOTHING,false,"进入正常行驶中") + } } } else -> {} diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/map/AmapNaviToDestinationModel.java b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/map/AmapNaviToDestinationModel.java index 16ff649e03..d49a3f7a34 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/map/AmapNaviToDestinationModel.java +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/map/AmapNaviToDestinationModel.java @@ -25,7 +25,7 @@ import com.amap.api.navi.model.NaviLatLng; import com.mogo.commons.AbsMogoApplication; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.util.NetworkUtils; -import com.mogo.och.common.module.utils.DateTimeUtil; +import com.mogo.eagle.core.utilcode.util.ThreadUtils; import com.mogo.och.common.module.utils.PermissionUtil; import com.mogo.och.common.module.wigets.toast.ToastCharterUtils; @@ -45,7 +45,7 @@ public class AmapNaviToDestinationModel implements AMapNaviListener { protected final List sList = new ArrayList(); protected final List eList = new ArrayList(); protected List mWayPointList = new ArrayList(); - private ICommonNaviChangedCallback mNaviChangedCallback; + private volatile ICommonNaviChangedCallback mNaviChangedCallback; private AtomicInteger errorCount = new AtomicInteger(0); private boolean isPlay; @@ -61,26 +61,31 @@ public class AmapNaviToDestinationModel implements AMapNaviListener { } public void initAMapNavi(NaviLatLng startLatLng, NaviLatLng endLatLng) { - try { - CallerLogger.i( TAG, "initAMapNavi()"); - mAMapNavi = AMapNavi.getInstance(AbsMogoApplication.getApp()); - mAMapNavi.addAMapNaviListener(this); - mAMapNavi.setUseInnerVoice(true, true); - sList.add(startLatLng); - eList.add(endLatLng); - } catch (Exception e) { - e.printStackTrace(); - } + ThreadUtils.getSinglePool().execute(() -> { + try { + CallerLogger.i(TAG, "initAMapNavi()"); + mAMapNavi = AMapNavi.getInstance(AbsMogoApplication.getApp()); + mAMapNavi.addAMapNaviListener(this); + mAMapNavi.setUseInnerVoice(true, true); + sList.add(startLatLng); + eList.add(endLatLng); + } catch (Exception e) { + e.printStackTrace(); + } + }); } public void setVoiceIsMute(boolean isPlay) { - if (mAMapNavi == null) return; - this.isPlay = isPlay; - if (isPlay) { - mAMapNavi.startSpeak(); - } else { - mAMapNavi.stopSpeak(); - } + ThreadUtils.getSinglePool().execute(() -> { + if (mAMapNavi == null) return; + CallerLogger.i(TAG, "setVoiceIsMute()--"+isPlay); + this.isPlay = isPlay; + if (isPlay) { + mAMapNavi.startSpeak(); + } else { + mAMapNavi.stopSpeak(); + } + }); } public AMapNavi getmAMapNavi() { @@ -88,16 +93,18 @@ public class AmapNaviToDestinationModel implements AMapNaviListener { } public void destroyAmaNavi() { - if (mAMapNavi != null) { - CallerLogger.i( TAG, "destroyAmaNavi()"); - isPlay = false; - sList.clear(); - eList.clear(); - mAMapNavi.stopNavi(); - mAMapNavi.destroy(); - mAMapNavi = null; - mNaviChangedCallback = null; - } + ThreadUtils.getSinglePool().execute(() -> { + CallerLogger.i(TAG, "destroyAmaNavi()"); + if (mAMapNavi != null) { + isPlay = false; + sList.clear(); + eList.clear(); + mAMapNavi.stopNavi(); + mAMapNavi.destroy(); + mAMapNavi = null; + mNaviChangedCallback = null; + } + }); } public void setTaxiNaviChangedCallback(ICommonNaviChangedCallback callback) { @@ -124,26 +131,28 @@ public class AmapNaviToDestinationModel implements AMapNaviListener { * 说明: 以上参数都是boolean类型,其中multipleroute参数表示是否多条路线,如果为true则此策略会算出多条路线。 * 注意: 不走高速与高速优先不能同时为true 高速优先与避免收费不能同时为true */ - int strategy = 0; - try { - //再次强调,最后一个参数为true时代表多路径,否则代表单路径 - strategy = mAMapNavi.strategyConvert(true, false, false, false, false); - } catch (Exception e) { - e.printStackTrace(); - } - mAMapNavi.calculateDriveRoute(sList, eList, mWayPointList, strategy); + ThreadUtils.getSinglePool().execute(() -> { + int strategy = 0; + try { + //再次强调,最后一个参数为true时代表多路径,否则代表单路径 + strategy = mAMapNavi.strategyConvert(true, false, false, false, false); + } catch (Exception e) { + e.printStackTrace(); + } + mAMapNavi.calculateDriveRoute(sList, eList, mWayPointList, strategy); + }); } @Override public void onCalculateRouteSuccess(int[] ints) { //多路径算路成功回调 - mAMapNavi.startNavi(NaviType.GPS); + ThreadUtils.getSinglePool().execute(() -> mAMapNavi.startNavi(NaviType.GPS)); } @Override public void onNaviInfoUpdate(NaviInfo naviinfo) { //导航过程中的信息更新,请看NaviInfo的具体说明 - CallerLogger.i( TAG, "距离=" + naviinfo.getPathRetainDistance() + ", 剩余时间 " + naviinfo.getPathRetainTime()); + CallerLogger.i(TAG, "距离=" + naviinfo.getPathRetainDistance() + ", 剩余时间 " + naviinfo.getPathRetainTime()); if (null != mNaviChangedCallback) { mNaviChangedCallback.onCurrentNaviDistAndTimeChanged(naviinfo.getPathRetainDistance(), naviinfo.getPathRetainTime());// 米、秒 } diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/CoordinateCalculateRouteUtil.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/CoordinateCalculateRouteUtil.kt index 36018e3b40..97735b8d7a 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/CoordinateCalculateRouteUtil.kt +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/CoordinateCalculateRouteUtil.kt @@ -732,7 +732,7 @@ object CoordinateCalculateRouteUtil { } distanceMap.clear() Logger.d(SceneConstant.M_OCHCOMMON + "calculateRouteSumLength", - "计算时间:${startTime-System.currentTimeMillis()}") + "计算时间:${System.currentTimeMillis()-startTime}") return getNearestPointInfo(preIndex,endIndex,mRoutePoints,location,type,size+2) } @@ -759,7 +759,7 @@ object CoordinateCalculateRouteUtil { } distanceMap.clear() Logger.d(SceneConstant.M_OCHCOMMON + "calculateRouteSumLength", - "计算时间:${startTime-System.currentTimeMillis()}") + "计算时间:${System.currentTimeMillis()-startTime}") return Triple(currentIndex,preIndexDistance?.isNext,preIndexDistance!!.distance) }else{ currentIndex = preIndex+1 @@ -770,7 +770,7 @@ object CoordinateCalculateRouteUtil { } distanceMap.clear() Logger.d(SceneConstant.M_OCHCOMMON + "calculateRouteSumLength", - "计算时间:${startTime-System.currentTimeMillis()}") + "计算时间:${System.currentTimeMillis()-startTime}") return Triple(currentIndex,preIndexNextDistance?.isNext,preIndexNextDistance!!.distance) } } @@ -832,7 +832,7 @@ object CoordinateCalculateRouteUtil { } distanceMap.clear() Logger.d(SceneConstant.M_OCHCOMMON + "calculateRouteSumLength", - "计算时间:${startTime-System.currentTimeMillis()}") + "计算时间:${System.currentTimeMillis()-startTime}") return Triple(currentIndex,key.isNext,key.distance) } key.distance.let { @@ -850,7 +850,7 @@ object CoordinateCalculateRouteUtil { } distanceMap.clear() Logger.d(SceneConstant.M_OCHCOMMON + "calculateRouteSumLength", - "计算时间:${startTime-System.currentTimeMillis()}") + "计算时间:${System.currentTimeMillis()-startTime}") return Triple(currentIndex,isNext,tempDistance) } } \ No newline at end of file diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/FrameAnimatorContainer.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/FrameAnimatorContainer.kt index fbeda056df..eed566129f 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/FrameAnimatorContainer.kt +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/FrameAnimatorContainer.kt @@ -10,7 +10,15 @@ import com.mogo.commons.AbsMogoApplication import java.lang.RuntimeException import java.lang.ref.SoftReference -class FrameAnimatorContainer (resId: Int, fps: Int, imageView: ImageView,initFirstFrame:Boolean = true,width:Int = -1,height:Int = -1){ +class FrameAnimatorContainer (resId: Int, + fps: Int, + imageView: ImageView, + sequence: Boolean = true,// 播放顺序 true 正序 false 倒序 + isOnce: Boolean = false,// 一次性的 true 值播放一次 false 重复播放 + initFirstFrame:Boolean = true, + width:Int = -1, + height:Int = -1){ + private val TAG = "FrameAnimatorContainer" private lateinit var mFrames: IntArray // 帧数组 private var mIndex = 0 // 当前帧 private var mShouldRun = false // 开始/停止播放用 @@ -21,9 +29,13 @@ class FrameAnimatorContainer (resId: Int, fps: Int, imageView: ImageView,initFir private var mOnAnimationStoppedListener: OnAnimationStoppedListener? = null//播放停止监听 private var mBitmap: Bitmap? = null private var mBitmapOptions: BitmapFactory.Options? = null //Bitmap管理类,可有效减少Bitmap的OOM问题 + var isOnce:Boolean = false + var sequence:Boolean = true init { createAnimation(imageView, getData(resId), fps,initFirstFrame,width,height) + this.isOnce = isOnce + this.sequence = sequence } private fun createAnimation( @@ -74,13 +86,22 @@ class FrameAnimatorContainer (resId: Int, fps: Int, imageView: ImageView,initFir private val next: Int get() { mIndex++ - if (mIndex >= mFrames.size) mIndex = 0 + if (mIndex >= mFrames.size){ + mIndex = 0 + if(isOnce){// 一次性动画 播放完毕后直接结束 + stop() + } + } + if(!sequence){// 倒叙 + return mFrames[mFrames.size-1-mIndex] + } return mFrames[mIndex] } @Synchronized fun reStart(){ - mIndex = 0 + mIndex = -1 + mIsRunning = false start() } @@ -91,6 +112,7 @@ class FrameAnimatorContainer (resId: Int, fps: Int, imageView: ImageView,initFir fun start() { mShouldRun = true if (mIsRunning) return + mHandler?.removeCallbacksAndMessages(null) val runnable: Runnable = object : Runnable { override fun run() { val imageView = mSoftReferenceImageView!!.get() @@ -103,9 +125,16 @@ class FrameAnimatorContainer (resId: Int, fps: Int, imageView: ImageView,initFir } mIsRunning = true //新开线程去读下一帧 - mHandler!!.postDelayed(this, mDelayMillis.toLong()) if (imageView.isShown) { val imageRes: Int = next + if (!mShouldRun || imageView == null) { + mIsRunning = false + if (mOnAnimationStoppedListener != null) { + mOnAnimationStoppedListener!!.AnimationStopped() + } + return + } + mHandler?.postDelayed(this, mDelayMillis.toLong()) if (mBitmap != null) { // so Build.VERSION.SDK_INT >= 11 var bitmap: Bitmap? = null try { @@ -158,7 +187,7 @@ class FrameAnimatorContainer (resId: Int, fps: Int, imageView: ImageView,initFir * @param resId * @return */ - private fun getData(resId: Int): IntArray { + fun getData(resId: Int): IntArray { val array = AbsMogoApplication.getApp().resources.obtainTypedArray(resId) val len = array.length() val intArray = IntArray(array.length()) @@ -169,6 +198,10 @@ class FrameAnimatorContainer (resId: Int, fps: Int, imageView: ImageView,initFir return intArray } + fun setData(mFrames: IntArray){ + this.mFrames = mFrames + } + /** * 停止播放监听 */ diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/NumberFormatUtil.java b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/NumberFormatUtil.java index 2a88ec1dd2..4f8e8db05e 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/NumberFormatUtil.java +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/NumberFormatUtil.java @@ -14,7 +14,7 @@ public class NumberFormatUtil { * @return */ public static String formatLong(double d) { - BigDecimal bg = new BigDecimal(d).setScale(1, RoundingMode.HALF_UP); + BigDecimal bg = BigDecimal.valueOf(d).setScale(1, RoundingMode.HALF_UP); double num = bg.doubleValue(); if (Math.ceil(num) - num == 0) { return String.valueOf((long) num); diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/OCHThreadPoolManager.java b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/OCHThreadPoolManager.java index 02a08f49b2..8eb92a1132 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/OCHThreadPoolManager.java +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/OCHThreadPoolManager.java @@ -7,11 +7,6 @@ import java.util.concurrent.Future; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; -/** - * @author: wangmingjun - * @date: 2022/7/19 - */ - public class OCHThreadPoolManager { /** @@ -42,10 +37,11 @@ public class OCHThreadPoolManager { } private volatile static OCHThreadPoolManager INSTANCE; + private static final byte[] obj = new byte[0]; public static OCHThreadPoolManager getsInstance() { if (INSTANCE == null) { - synchronized (OCHThreadPoolManager.class) { + synchronized (obj) { if (INSTANCE == null) { INSTANCE = new OCHThreadPoolManager(); } @@ -57,12 +53,10 @@ public class OCHThreadPoolManager { /** * 开启一个无返回结果的线程 - * - * @param r */ public void execute(Runnable r) { if (executor == null) { - /** + /* * corePoolSize:核心线程数 * maximumPoolSize:线程池所容纳最大线程数(workQueue队列满了之后才开启) * keepAliveTime:非核心线程闲置时间超时时长 @@ -73,7 +67,7 @@ public class OCHThreadPoolManager { * */ executor = new ThreadPoolExecutor(CORE_POOL_SIZE, MAXIMUM_POOL_SIZE, - KEEP_ALIVE, TimeUnit.SECONDS, new ArrayBlockingQueue(200), + KEEP_ALIVE, TimeUnit.SECONDS, new ArrayBlockingQueue<>(200), Executors.defaultThreadFactory(), new ThreadPoolExecutor.AbortPolicy()); } // 把一个任务丢到了线程池中 @@ -87,13 +81,10 @@ public class OCHThreadPoolManager { /** * 开启一个有返回结果的线程 - * - * @param r - * @return */ public Future submit(Callable r) { if (executor == null) { - /** + /* * corePoolSize:核心线程数 * maximumPoolSize:线程池所容纳最大线程数(workQueue队列满了之后才开启) * keepAliveTime:非核心线程闲置时间超时时长 @@ -104,7 +95,7 @@ public class OCHThreadPoolManager { * */ executor = new ThreadPoolExecutor(CORE_POOL_SIZE, MAXIMUM_POOL_SIZE, - KEEP_ALIVE, TimeUnit.SECONDS, new ArrayBlockingQueue(20), + KEEP_ALIVE, TimeUnit.SECONDS, new ArrayBlockingQueue<>(20), Executors.defaultThreadFactory(), new ThreadPoolExecutor.AbortPolicy()); } // 把一个任务丢到了线程池中 @@ -113,12 +104,10 @@ public class OCHThreadPoolManager { /** * 开启一个无返回结果的线程 - * - * @param r */ public Future submit(Runnable r) { if (executor == null) { - /** + /* * corePoolSize:核心线程数 * maximumPoolSize:线程池所容纳最大线程数(workQueue队列满了之后才开启) * keepAliveTime:非核心线程闲置时间超时时长 @@ -129,7 +118,7 @@ public class OCHThreadPoolManager { * */ executor = new ThreadPoolExecutor(CORE_POOL_SIZE, MAXIMUM_POOL_SIZE, - KEEP_ALIVE, TimeUnit.SECONDS, new ArrayBlockingQueue(200), + KEEP_ALIVE, TimeUnit.SECONDS, new ArrayBlockingQueue<>(200), Executors.defaultThreadFactory(), new ThreadPoolExecutor.AbortPolicy()); } return executor.submit(r); @@ -138,8 +127,6 @@ public class OCHThreadPoolManager { /** * 把任务移除等待队列 - * - * @param r */ public void cancel(Runnable r) { if (r != null) { diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/SoundPoolHelper.java b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/SoundPoolHelper.java index 74c80b8abd..3d785f53dc 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/SoundPoolHelper.java +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/SoundPoolHelper.java @@ -1,15 +1,10 @@ package com.mogo.och.common.module.utils; +import android.annotation.SuppressLint; import android.media.*; import android.content.*; -import android.os.*; import android.app.*; -/** - * @author: wangmingjun - * @date: 2022/9/23 - * - */ public class SoundPoolHelper { private SoundPool mSoundPool; private AudioManager mAudioManager; @@ -22,20 +17,16 @@ public class SoundPoolHelper { private int resId; private Context mContext; - private volatile static SoundPoolHelper INSTANCE; + private SoundPoolHelper(){} public static SoundPoolHelper getSoundPoolHelper(){ - if (INSTANCE == null){ - synchronized (SoundPoolHelper.class){ - if (INSTANCE == null){ - INSTANCE = new SoundPoolHelper(); - } - } - } - return INSTANCE; + return Holder.INSTANCE; } - public SoundPoolHelper(){} + private static final class Holder{ + @SuppressLint("StaticFieldLeak") + private static final SoundPoolHelper INSTANCE = new SoundPoolHelper(); + } //播放资源文件 public void playSoundWithRedId(Context context,int resId){ @@ -64,30 +55,19 @@ public class SoundPoolHelper { if (mSoundPool == null){ // For Android SDK >= 21 - if (Build.VERSION.SDK_INT >= 21 ) { + AudioAttributes audioAttrib = new AudioAttributes.Builder() + .setUsage(AudioAttributes.USAGE_GAME) + .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION) + .build(); - AudioAttributes audioAttrib = new AudioAttributes.Builder() - .setUsage(AudioAttributes.USAGE_GAME) - .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION) - .build(); + SoundPool.Builder builder= new SoundPool.Builder(); + builder.setAudioAttributes(audioAttrib).setMaxStreams(MAX_STREAMS); - SoundPool.Builder builder= new SoundPool.Builder(); - builder.setAudioAttributes(audioAttrib).setMaxStreams(MAX_STREAMS); - - this.mSoundPool = builder.build(); - } else {// for Android SDK < 21 - // SoundPool(int maxStreams, int streamType, int srcQuality) - this.mSoundPool = new SoundPool(MAX_STREAMS, AudioManager.STREAM_MUSIC, 0); - } + this.mSoundPool = builder.build(); } // When Sound Pool load complete. - this.mSoundPool.setOnLoadCompleteListener(new SoundPool.OnLoadCompleteListener() { - @Override - public void onLoadComplete(SoundPool soundPool, int sampleId, int status) { - playSound(); - } - }); + this.mSoundPool.setOnLoadCompleteListener((soundPool, sampleId, status) -> playSound()); //load res this.mSoundId =this.mSoundPool.load(this.mContext,this.resId,1); @@ -105,14 +85,12 @@ public class SoundPoolHelper { } } - - //play the sound res private void playSound(){ - float leftVolumn = volume; - float rightVolumn = volume; + float leftVolume = volume; + float rightVolume = volume; // Play sound of gunfire. Returns the ID of the new stream. - int streamId = this.mSoundPool.play(this.mSoundId,leftVolumn, rightVolumn, 1, 0, 1f); + int streamId = this.mSoundPool.play(this.mSoundId,leftVolume, rightVolume, 1, 0, 1f); } } diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/MarqueeTextView.java b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/MarqueeTextView.java index bd549f2888..5a03ce7e90 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/MarqueeTextView.java +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/MarqueeTextView.java @@ -26,7 +26,7 @@ public class MarqueeTextView extends androidx.appcompat.widget.AppCompatTextView /** * 是否使用自定义 gap */ - private boolean mUseCustomGap; + private final boolean mUseCustomGap; public MarqueeTextView(Context context) { this(context, null); @@ -60,7 +60,6 @@ public class MarqueeTextView extends androidx.appcompat.widget.AppCompatTextView @Override public void onWindowFocusChanged(boolean hasWindowFocus) { - if (hasWindowFocus){} super.onWindowFocusChanged(true); } diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/OCHGradientTextView.java b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/OCHGradientTextView.java index 41fe2c2e02..914736a270 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/OCHGradientTextView.java +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/OCHGradientTextView.java @@ -21,7 +21,7 @@ public class OCHGradientTextView extends AppCompatTextView { private Paint mPaint; private int mViewWidth = 0;//文字的宽度 private int mViewHeight = 0;//文字的高度 - private Rect mTextBound = new Rect(); + private final Rect mTextBound = new Rect(); private int[] mColorList;//存放颜色的数组 private boolean isVertrial;//默认是横向 @@ -60,7 +60,7 @@ public class OCHGradientTextView extends AppCompatTextView { mPaint.setShadowLayer(mRadius, mdx, mdy, mColor); //画出文字 - canvas.drawText(mTipText, getMeasuredWidth() / 2 - mTextBound.width() / 2, getMeasuredHeight() / 2 + mTextBound.height() / 2, mPaint); + canvas.drawText(mTipText, getMeasuredWidth() / 2.0f - mTextBound.width() / 2.0f, getMeasuredHeight() / 2.0f + mTextBound.height() / 2.0f, mPaint); } /** diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/OCHShapeBlurView.java b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/OCHShapeBlurView.java index b9170190c3..c86ec1b646 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/OCHShapeBlurView.java +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/OCHShapeBlurView.java @@ -22,18 +22,18 @@ import com.mogo.och.common.module.R; public class OCHShapeBlurView extends OCHStockBlurView { Paint mPaint; RectF mRectF; - private float mRadius; - private int mTopColor; // default #aaffffff - private int mBottomColor; // default #aaffffff + private final float mRadius; + private final int mTopColor; // default #aaffffff + private final int mBottomColor; // default #aaffffff public OCHShapeBlurView(Context context, AttributeSet attrs) { super(context, attrs); - TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.OCHRShapeBlurView); - mRadius = a.getDimension(R.styleable.OCHRShapeBlurView_och_realtime_radius, + TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.OCHShapeBlurView); + mRadius = a.getDimension(R.styleable.OCHShapeBlurView_och_realtime_radius, TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 0, context.getResources().getDisplayMetrics())); - mTopColor = a.getColor(R.styleable.OCHRShapeBlurView_och_realtime_start_color, 0xAAFFFFFF); - mBottomColor = a.getColor(R.styleable.OCHRShapeBlurView_och_realtime_end_color, 0xAAFFFFFF); + mTopColor = a.getColor(R.styleable.OCHShapeBlurView_och_realtime_start_color, 0xAAFFFFFF); + mBottomColor = a.getColor(R.styleable.OCHShapeBlurView_och_realtime_end_color, 0xAAFFFFFF); a.recycle(); mPaint = new Paint(); mRectF = new RectF(); @@ -60,7 +60,7 @@ public class OCHShapeBlurView extends OCHStockBlurView { mPaint.reset(); mPaint.setAntiAlias(true); /* 设置渐变色 这个正方形的颜色是改变的 */ - Shader mShader = new LinearGradient(getWidth()/2, 0, getWidth()/2, getHeight(), + Shader mShader = new LinearGradient(getWidth()/2.0f, 0, getWidth()/2.0f, getHeight(), new int[] {mTopColor,mBottomColor}, null, Shader.TileMode.CLAMP); // 一个材质,打造出一个线性梯度沿著一条线。 mPaint.setShader(mShader);//0xBFE0E8FF,0xBF6AA2D7 canvas.drawRoundRect(mRectF, mRadius,mRadius,mPaint); diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/OCHStockBlurView.java b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/OCHStockBlurView.java index f88571b949..ea20446982 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/OCHStockBlurView.java +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/OCHStockBlurView.java @@ -24,13 +24,13 @@ public class OCHStockBlurView extends View { private float mDownsampleFactor; // default 4 private int mOverlayColor; // default #aaffffff private float mBlurRadius; // default 10dp (0 < r <= 25) - private boolean onece; + private final boolean onece; private boolean mDirty; private Bitmap mBitmapToBlur, mBlurredBitmap; private Canvas mBlurringCanvas; private boolean mIsRendering; - private Paint mPaint; + private final Paint mPaint; private final Rect mRectSrc = new Rect(), mRectDst = new Rect(); // mDecorView should be the root view of the activity (even if you are on a different window like a dialog) private View mDecorView; @@ -149,9 +149,11 @@ public class OCHStockBlurView extends View { } finally { if (!r) { release(); - return false; } } + if (!r) { + return false; + } } if (dirty) { @@ -216,7 +218,9 @@ public class OCHStockBlurView extends View { } } if(onece) { - mDecorView.getViewTreeObserver().removeOnPreDrawListener(this); + if(mDecorView!=null) { + mDecorView.getViewTreeObserver().removeOnPreDrawListener(this); + } } return true; } diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/ZhiView.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/ZhiView.kt new file mode 100644 index 0000000000..e3c3144fc9 --- /dev/null +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/ZhiView.kt @@ -0,0 +1,262 @@ +package com.mogo.och.common.module.wigets + +import android.Manifest +import android.content.Context +import android.util.AttributeSet +import androidx.appcompat.widget.AppCompatImageView +import androidx.core.app.ActivityCompat +import com.mogo.eagle.core.data.msgbox.MsgBoxBean +import com.mogo.eagle.core.data.msgbox.MsgBoxType +import com.mogo.eagle.core.data.msgbox.VoiceMsg +import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager +import com.mogo.eagle.core.function.main.MainPresenter +import com.mogo.eagle.core.utilcode.kotlin.onClick +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant +import com.mogo.eagle.core.utilcode.mogo.permissions.PermissionsDialogUtils +import com.mogo.eagle.core.utilcode.util.ActivityUtils +import com.mogo.eagle.core.utilcode.util.ClickUtils +import com.mogo.och.common.module.R +import com.mogo.och.common.module.utils.FrameAnimatorContainer +import com.mogo.och.common.module.utils.PermissionUtil +import com.mogo.och.common.module.wigets.toast.ToastCharterUtils +import com.mogo.tts.base.zhi.AsrTextBean +import com.mogo.tts.base.zhi.AvatarManager +import com.mogo.tts.base.zhi.CallbackWidget +import com.mogo.tts.base.zhi.ZhiRecordWinUi + +class ZhiView @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0 +) : AppCompatImageView(context, attrs, defStyleAttr), + ZhiRecordWinUi { + companion object { + const val TAG = "ZhiView" + } + + private var currentAnim = FrameAnimatorContainer(R.array.xiaozhi_normal, 12,this) + + @Volatile + private var status = ZhiRecordWinUi.RecordStatus.STATUS_SILENCE + private var animalState = AnimalState.Normal + init { + val xiaozhiNormal = currentAnim.getData(R.array.xiaozhi_normal) + val xiaozhiThink = currentAnim.getData(R.array.xiaozhi_think) + val xiaozhiThinkNormal = currentAnim.getData(R.array.xiaozhi_think_normal) + currentAnim.setOnAnimStopListener(object : FrameAnimatorContainer.OnAnimationStoppedListener{ + override fun AnimationStopped() { + when (status) { + ZhiRecordWinUi.RecordStatus.STATUS_SILENCE -> { + if(animalState==AnimalState.SPEAK){ + currentAnim.setData(xiaozhiThinkNormal) + currentAnim.isOnce = true + currentAnim.sequence = false + currentAnim.reStart() + animalState = AnimalState.NORMAL_SPEAK + CallerLogger.d(SceneConstant.M_OCHCOMMON + TAG, "动画$status speak to normal") + }else{ + currentAnim.setData(xiaozhiNormal) + currentAnim.isOnce = false + currentAnim.sequence = true + currentAnim.reStart() + animalState = AnimalState.Normal + CallerLogger.d(SceneConstant.M_OCHCOMMON + TAG, "动画$status normal") + } + } + ZhiRecordWinUi.RecordStatus.STATUS_LISTENING -> { + if(animalState==AnimalState.Normal){ + currentAnim.setData(xiaozhiThinkNormal) + currentAnim.isOnce = true + currentAnim.sequence = true + currentAnim.reStart() + animalState = AnimalState.NORMAL_SPEAK + CallerLogger.d(SceneConstant.M_OCHCOMMON + TAG, "动画$status normal to speak") + }else{ + currentAnim.setData(xiaozhiThink) + currentAnim.isOnce = false + currentAnim.sequence = true + currentAnim.reStart() + animalState = AnimalState.SPEAK + CallerLogger.d(SceneConstant.M_OCHCOMMON + TAG, "动画$status speak") + } + } + ZhiRecordWinUi.RecordStatus.STATUS_UNDERSTANDING -> {} + ZhiRecordWinUi.RecordStatus.STATUS_UNDERSTAND_END -> {} + ZhiRecordWinUi.RecordStatus.STATUS_SPEAKING -> { + if(animalState==AnimalState.SPEAK){ + currentAnim.setData(xiaozhiThinkNormal) + currentAnim.isOnce = true + currentAnim.sequence = false + currentAnim.reStart() + animalState = AnimalState.NORMAL_SPEAK + CallerLogger.d(SceneConstant.M_OCHCOMMON + TAG, "动画$status speak to normal") + }else{ + currentAnim.setData(xiaozhiNormal) + currentAnim.isOnce = false + currentAnim.sequence = true + currentAnim.reStart() + animalState = AnimalState.Normal + CallerLogger.d(SceneConstant.M_OCHCOMMON + TAG, "动画$status normal") + } + + } + } + } + }) + + setOnClickListener { + if (ClickUtils.isClickTooFrequent(this,3000)) { + ToastCharterUtils.showToastShort("请稍后唤醒") + return@setOnClickListener + } + if (PermissionUtil.checkPermission(context,Manifest.permission.RECORD_AUDIO)) { + AvatarManager.wakeupXiaoZhi() + }else{ + //申请悬浮窗权限 + val shouldShowRequestPermissionRationale = ActivityUtils.getTopActivity() + .shouldShowRequestPermissionRationale(Manifest.permission.RECORD_AUDIO) + if(shouldShowRequestPermissionRationale){// 可以弹窗系统权限框 + ActivityCompat.requestPermissions(ActivityUtils.getTopActivity(), + arrayOf( + Manifest.permission.RECORD_AUDIO, + ), MainPresenter.MOGO_PERMISSION_REQUEST_CODE + ) + }else{// 不会弹系统弹窗 + PermissionsDialogUtils.openAppDetails(ActivityUtils.getTopActivity(), "录音机", 100) + } + + } + } + } + + override fun onWindowFocusChanged(hasWindowFocus: Boolean) { + super.onWindowFocusChanged(hasWindowFocus) + CallerLogger.d(SceneConstant.M_OCHCOMMON + TAG, "焦点与否:${hasWindowFocus}") + AvatarManager.enableXiaoZhi(!hasWindowFocus) + if(hasWindowFocus){ + currentAnim.reStart() + }else{ + currentAnim.stop() + } + } + + override fun onAttachedToWindow() { + super.onAttachedToWindow() + AvatarManager.addDistanceListener(TAG,this) + currentAnim.reStart() + } + + override fun onDetachedFromWindow() { + super.onDetachedFromWindow() + AvatarManager.removeListener(TAG) + } + + override fun start(reason: String?) { + CallerLogger.d(TAG,"-----start $reason") + } + + override fun onStatusChange(status: ZhiRecordWinUi.RecordStatus?) { + CallerLogger.d(TAG,"-----onStatusChange $status") + this.status = status?:ZhiRecordWinUi.RecordStatus.STATUS_SILENCE + when (status) { + ZhiRecordWinUi.RecordStatus.STATUS_SILENCE -> { + currentAnim.stop() + } + ZhiRecordWinUi.RecordStatus.STATUS_LISTENING -> {// 监听中 + currentAnim.stop() + } + ZhiRecordWinUi.RecordStatus.STATUS_UNDERSTANDING -> { + // 正在理解 + CallerLogger.d(TAG,"正在理解") + } + ZhiRecordWinUi.RecordStatus.STATUS_UNDERSTAND_END -> { + CallerLogger.d(TAG,"理解结束") + } + ZhiRecordWinUi.RecordStatus.STATUS_SPEAKING -> { + // 正在说话 + currentAnim.stop() + } + else -> { + + } + } + + + + + } + + override fun close(trigger: Boolean) { + CallerLogger.d(TAG,"-----close $trigger") + onStatusChange(ZhiRecordWinUi.RecordStatus.STATUS_SILENCE) + val msg = VoiceMsg( + isWakeUp = false, + isWakeUpEnd = true, + msg = null, + isLastMsg = true, + isResp = true + ) + pushMsgBox(msg) + } + + + override fun onVolumeChange(volume: Int) { + CallerLogger.d(TAG,"-----onVolumeChange $volume") + } + + /** + * 用户输入的 + */ + override fun showInputText(asrTextBean: AsrTextBean?) { + CallerLogger.d(TAG,"-----showInputText $asrTextBean") + asrTextBean.let { + val msg = VoiceMsg( + isWakeUp = false, + isWakeUpEnd = false, + msg = it?.text, + isLastMsg = it?.isLast == true, + isResp = false + ) + pushMsgBox(msg) + } + } + + /** + * 特定View + */ + override fun showOutPutWidget(callbackWidget: CallbackWidget?) { + // todo 咱不支持定制显示 包括天气 + CallerLogger.d(TAG,"-----showOutPutWidget $callbackWidget") + } + + /** + * 小智说的 + */ + override fun showOutputText(outPutText: String?) { + CallerLogger.d(TAG,"-----showOutputText $outPutText") + outPutText?.let { + val msg = VoiceMsg( + isWakeUp = false, + isWakeUpEnd = false, + msg = it, + isLastMsg = false, + isResp = true + ) + pushMsgBox(msg) + } + } + + private fun pushMsgBox(msg:VoiceMsg){ + CallerMsgBoxManager.saveMsgBox(MsgBoxBean(MsgBoxType.VOICE, msg)) + } + + enum class AnimalState { + Normal, + NORMAL_SPEAK, + SPEAK_NORMAL, + SPEAK, + } + + +} diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/sfv/FrameSurfaceView.java b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/sfv/FrameSurfaceView.java index 08b77de55c..7b3ddd377a 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/sfv/FrameSurfaceView.java +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/sfv/FrameSurfaceView.java @@ -22,7 +22,7 @@ import java.util.concurrent.atomic.AtomicInteger; */ public class FrameSurfaceView extends BaseSurfaceView { public static final int INVALID_INDEX = Integer.MAX_VALUE; - private int bufferSize = 3; + private final int bufferSize = 3; public static final String DECODE_THREAD_NAME = "DecodingThread"; public static final int INFINITE = -1; //-1 means repeat infinitely @@ -45,12 +45,12 @@ public class FrameSurfaceView extends BaseSurfaceView { * decoded bitmaps stores in this queue * consumer is drawing thread, producer is decoding thread. */ - private LinkedBlockingQueue decodedBitmaps = new LinkedBlockingQueue(bufferSize); + private final LinkedBlockingQueue decodedBitmaps = new LinkedBlockingQueue(bufferSize); /** * bitmaps already drawn by canvas stores in this queue * consumer is decoding thread, producer is drawing thread. */ - private LinkedBlockingQueue drawnBitmaps = new LinkedBlockingQueue(bufferSize); + private final LinkedBlockingQueue drawnBitmaps = new LinkedBlockingQueue(bufferSize); /** * the thread for decoding bitmaps */ @@ -64,9 +64,9 @@ public class FrameSurfaceView extends BaseSurfaceView { */ private Handler handler; private BitmapFactory.Options options; - private Paint paint = new Paint(); + private final Paint paint = new Paint(); private Rect srcRect; - private Rect dstRect = new Rect(); + private final Rect dstRect = new Rect(); private int defaultWidth; private int defaultHeight; @@ -138,7 +138,7 @@ public class FrameSurfaceView extends BaseSurfaceView { return; } this.bitmapIds = bitmapIds; - //by default, take the first bitmap's dimension into consideration + //by default, take the first bitMap's dimension into consideration getBitmapDimension(bitmapIds.get(bitmapIdIndex)); preloadFrames(); decodeRunnable = new DecodeRunnable(bitmapIdIndex, bitmapIds, options); @@ -203,8 +203,6 @@ public class FrameSurfaceView extends BaseSurfaceView { /** * draw a single frame which is a bitmap - * - * @param canvas */ private void drawOneFrame(Canvas canvas) { LinkedBitmap linkedBitmap = getDecodedBitmap(); @@ -214,12 +212,7 @@ public class FrameSurfaceView extends BaseSurfaceView { putDrawnBitmap(linkedBitmap); frameIndex.incrementAndGet(); if(isFinish()&&frameFinishCallback!=null){ - runOnUIThread(new Runnable() { - @Override - public void run() { - frameFinishCallback.onFinishCallback(); - } - }); + runOnUIThread(() -> frameFinishCallback.onFinishCallback()); } } @@ -271,8 +264,8 @@ public class FrameSurfaceView extends BaseSurfaceView { } if (decodeRunnable != null) { decodeRunnable.setIndex(0); + handler.post(decodeRunnable); } - handler.post(decodeRunnable); } @@ -290,8 +283,8 @@ public class FrameSurfaceView extends BaseSurfaceView { * decode bitmap by BitmapFactory.decodeStream(), it is about twice faster than BitmapFactory.decodeResource() * * @param resId the bitmap resource - * @param options - * @return + * @param options options + * @return Bitmap */ private Bitmap decodeBitmap(int resId, BitmapFactory.Options options) { options.inScaled = false; @@ -322,8 +315,7 @@ public class FrameSurfaceView extends BaseSurfaceView { * @param linkedBitmap */ private void decodeAndPutBitmap(int resId, BitmapFactory.Options options, LinkedBitmap linkedBitmap) { - Bitmap bitmap = decodeBitmap(resId, options); - linkedBitmap.bitmap = bitmap; + linkedBitmap.bitmap = decodeBitmap(resId, options); try { decodedBitmaps.put(linkedBitmap); } catch (InterruptedException e) { @@ -377,8 +369,8 @@ public class FrameSurfaceView extends BaseSurfaceView { private class DecodeRunnable implements Runnable { private int index; - private List bitmapIds; - private BitmapFactory.Options options; + private final List bitmapIds; + private final BitmapFactory.Options options; public DecodeRunnable(int index, List bitmapIds, BitmapFactory.Options options) { this.index = index; diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_debug_view_password.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_debug_view_password.png index 7196f29d40..3d61b03d2c 100644 Binary files a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_debug_view_password.png and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_debug_view_password.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_00.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_00.webp new file mode 100644 index 0000000000..5e558d8232 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_00.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_01.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_01.webp new file mode 100644 index 0000000000..f2abeb61b7 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_01.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_02.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_02.webp new file mode 100644 index 0000000000..b39161537f Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_02.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_03.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_03.webp new file mode 100644 index 0000000000..975654edad Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_03.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_04.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_04.webp new file mode 100644 index 0000000000..db33a3ccd5 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_04.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_05.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_05.webp new file mode 100644 index 0000000000..ec02c81a71 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_05.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_06.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_06.webp new file mode 100644 index 0000000000..c752eb0675 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_06.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_07.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_07.webp new file mode 100644 index 0000000000..f7db9473ed Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_07.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_08.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_08.webp new file mode 100644 index 0000000000..98bfe10bee Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_08.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_09.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_09.webp new file mode 100644 index 0000000000..325272f005 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_09.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_10.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_10.webp new file mode 100644 index 0000000000..e3eb26ddf9 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_10.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_11.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_11.webp new file mode 100644 index 0000000000..ffacd8f5c0 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_11.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_12.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_12.webp new file mode 100644 index 0000000000..d5fc80d1c5 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_12.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_13.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_13.webp new file mode 100644 index 0000000000..92e270daeb Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_13.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_14.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_14.webp new file mode 100644 index 0000000000..fcaf46e732 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_14.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_15.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_15.webp new file mode 100644 index 0000000000..8574b3ae59 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_15.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_16.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_16.webp new file mode 100644 index 0000000000..a8577021b5 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_16.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_17.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_17.webp new file mode 100644 index 0000000000..cae4c97c28 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_17.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_18.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_18.webp new file mode 100644 index 0000000000..468401a66a Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_18.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_19.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_19.webp new file mode 100644 index 0000000000..9149bbdec6 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_19.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_20.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_20.webp new file mode 100644 index 0000000000..1d9fcf2b4e Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_20.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_21.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_21.webp new file mode 100644 index 0000000000..c326180645 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_21.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_22.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_22.webp new file mode 100644 index 0000000000..6b66b9251e Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_22.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_23.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_23.webp new file mode 100644 index 0000000000..0ef3d30f89 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_23.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_24.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_24.webp new file mode 100644 index 0000000000..c07ff7cd39 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_24.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_25.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_25.webp new file mode 100644 index 0000000000..c9f9194584 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_25.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_26.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_26.webp new file mode 100644 index 0000000000..6fe414d630 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_26.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_27.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_27.webp new file mode 100644 index 0000000000..fc363c9779 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_27.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_28.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_28.webp new file mode 100644 index 0000000000..be8f12586a Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_28.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_29.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_29.webp new file mode 100644 index 0000000000..085ec90f96 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_29.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_30.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_30.webp new file mode 100644 index 0000000000..ef561b438f Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_30.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_31.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_31.webp new file mode 100644 index 0000000000..f10f12d146 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_31.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_34.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_34.webp new file mode 100644 index 0000000000..7061484156 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_34.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_35.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_35.webp new file mode 100644 index 0000000000..057abd38c3 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_35.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_36.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_36.webp new file mode 100644 index 0000000000..b2b4616777 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_36.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_37.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_37.webp new file mode 100644 index 0000000000..9f6b6b3123 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_37.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_38.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_38.webp new file mode 100644 index 0000000000..5f67830704 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_38.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_39.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_39.webp new file mode 100644 index 0000000000..e7c578ace8 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_39.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_40.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_40.webp new file mode 100644 index 0000000000..8509aca455 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_40.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_41.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_41.webp new file mode 100644 index 0000000000..e8d0361b84 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_41.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_42.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_42.webp new file mode 100644 index 0000000000..5f50b556d2 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_42.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_43.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_43.webp new file mode 100644 index 0000000000..6e864a6e78 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_43.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_44.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_44.webp new file mode 100644 index 0000000000..21106fdae9 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_44.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_45.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_45.webp new file mode 100644 index 0000000000..ceb61fcecd Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_45.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_46.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_46.webp new file mode 100644 index 0000000000..d8441e5f12 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_46.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_47.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_47.webp new file mode 100644 index 0000000000..4e29d48fde Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_47.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_48.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_48.webp new file mode 100644 index 0000000000..a3bf00c4d3 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_48.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_49.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_49.webp new file mode 100644 index 0000000000..5c9e5359d3 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_49.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_50.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_50.webp new file mode 100644 index 0000000000..34f2ffdf43 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_50.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_51.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_51.webp new file mode 100644 index 0000000000..db4a3ccb8f Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_51.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_52.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_52.webp new file mode 100644 index 0000000000..4b05d6399b Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_52.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_53.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_53.webp new file mode 100644 index 0000000000..5cb8ebd127 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_53.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_54.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_54.webp new file mode 100644 index 0000000000..805ba97cbf Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_54.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_55.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_55.webp new file mode 100644 index 0000000000..2681570b04 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_55.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_56.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_56.webp new file mode 100644 index 0000000000..e1fc2655a5 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_56.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_57.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_57.webp new file mode 100644 index 0000000000..df647e51d4 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_57.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_58.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_58.webp new file mode 100644 index 0000000000..92c9746b8d Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_58.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_59.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_59.webp new file mode 100644 index 0000000000..f10d24a9f6 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_59.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_60.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_60.webp new file mode 100644 index 0000000000..decae50dfa Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_60.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_61.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_61.webp new file mode 100644 index 0000000000..88e750c3e4 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_61.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_62.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_62.webp new file mode 100644 index 0000000000..b37763d66c Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_62.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_63.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_63.webp new file mode 100644 index 0000000000..202353ceba Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_63.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_64.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_64.webp new file mode 100644 index 0000000000..5cc2346cac Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_64.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_65.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_65.webp new file mode 100644 index 0000000000..a0b32f4060 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_65.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_66.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_66.webp new file mode 100644 index 0000000000..cacd650063 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_66.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_67.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_67.webp new file mode 100644 index 0000000000..822c7e5d57 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_67.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_68.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_68.webp new file mode 100644 index 0000000000..350d3bb472 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_68.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_69.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_69.webp new file mode 100644 index 0000000000..d8c1ff2c76 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_69.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_70.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_70.webp new file mode 100644 index 0000000000..b2162d7d3f Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_70.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_71.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_71.webp new file mode 100644 index 0000000000..7b5118c1ee Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_71.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_01.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_01.webp new file mode 100644 index 0000000000..b59c7e188a Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_01.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_02.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_02.webp new file mode 100644 index 0000000000..265f51c588 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_02.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_03.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_03.webp new file mode 100644 index 0000000000..095c7a2daa Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_03.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_04.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_04.webp new file mode 100644 index 0000000000..bead7fdc0d Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_04.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_05.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_05.webp new file mode 100644 index 0000000000..c8ff93097b Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_05.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_06.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_06.webp new file mode 100644 index 0000000000..450522df3e Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_06.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_07.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_07.webp new file mode 100644 index 0000000000..198cebc492 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_07.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_08.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_08.webp new file mode 100644 index 0000000000..ea80800e8f Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_08.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_09.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_09.webp new file mode 100644 index 0000000000..ab374fb4c8 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_09.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_10.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_10.webp new file mode 100644 index 0000000000..dcf56ef6a4 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_10.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_11.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_11.webp new file mode 100644 index 0000000000..1e2ea0f6ab Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_11.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_12.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_12.webp new file mode 100644 index 0000000000..1b926a3b9f Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_12.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_13.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_13.webp new file mode 100644 index 0000000000..405097f7f2 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_13.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_14.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_14.webp new file mode 100644 index 0000000000..399fbd5b66 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_14.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_15.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_15.webp new file mode 100644 index 0000000000..9f817d1391 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_15.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_16.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_16.webp new file mode 100644 index 0000000000..a05e0384a0 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_16.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_17.webp b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_17.webp new file mode 100644 index 0000000000..22a4aa012e Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/charter_p_xiaozhi_think_normal_17.webp differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0000.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0000.png new file mode 100755 index 0000000000..9b650832f5 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0000.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0001.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0001.png new file mode 100755 index 0000000000..b0ee512905 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0001.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0002.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0002.png new file mode 100755 index 0000000000..1a9eb17d7b Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0002.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0003.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0003.png new file mode 100755 index 0000000000..fff8ab5426 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0003.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0004.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0004.png new file mode 100755 index 0000000000..abcbefb4b8 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0004.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0005.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0005.png new file mode 100755 index 0000000000..71df42d412 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0005.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0006.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0006.png new file mode 100755 index 0000000000..343b71eec6 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0006.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0007.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0007.png new file mode 100755 index 0000000000..29176c77df Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0007.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0008.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0008.png new file mode 100755 index 0000000000..3514be34ca Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0008.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0009.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0009.png new file mode 100755 index 0000000000..682106744b Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0009.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0010.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0010.png new file mode 100755 index 0000000000..f7b1e97c68 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0010.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0011.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0011.png new file mode 100755 index 0000000000..b600b5cb22 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0011.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0012.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0012.png new file mode 100755 index 0000000000..d0aaf2c048 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0012.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0013.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0013.png new file mode 100755 index 0000000000..9deb781f58 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0013.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0014.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0014.png new file mode 100755 index 0000000000..5462f1f23b Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0014.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0015.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0015.png new file mode 100755 index 0000000000..7d5ffaabe6 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0015.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0016.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0016.png new file mode 100755 index 0000000000..fb6223e409 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0016.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0017.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0017.png new file mode 100755 index 0000000000..f792bf1c8a Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0017.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0018.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0018.png new file mode 100755 index 0000000000..40d56375b0 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0018.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0019.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0019.png new file mode 100755 index 0000000000..e8bb611925 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0019.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0020.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0020.png new file mode 100755 index 0000000000..e156eba37b Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0020.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0021.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0021.png new file mode 100755 index 0000000000..22c35f5ef1 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0021.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0022.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0022.png new file mode 100755 index 0000000000..900175fabe Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0022.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0023.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0023.png new file mode 100755 index 0000000000..5d4fd47206 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0023.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0024.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0024.png new file mode 100755 index 0000000000..1df483903e Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0024.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0025.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0025.png new file mode 100755 index 0000000000..d7f7cd582e Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0025.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0026.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0026.png new file mode 100755 index 0000000000..a03d3394e8 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0026.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0027.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0027.png new file mode 100755 index 0000000000..89951cede7 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0027.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0028.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0028.png new file mode 100755 index 0000000000..81f57d6e8f Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0028.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0029.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0029.png new file mode 100755 index 0000000000..f3d65a3200 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0029.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0030.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0030.png new file mode 100755 index 0000000000..460282761d Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0030.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0031.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0031.png new file mode 100755 index 0000000000..e904ca5758 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0031.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0032.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0032.png new file mode 100755 index 0000000000..32137993a4 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0032.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0033.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0033.png new file mode 100755 index 0000000000..8c86c2a258 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0033.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0034.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0034.png new file mode 100755 index 0000000000..f0d3f7a397 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0034.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0035.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0035.png new file mode 100755 index 0000000000..9790e6f5d3 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0035.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0036.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0036.png new file mode 100755 index 0000000000..c92762de1c Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0036.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0037.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0037.png new file mode 100755 index 0000000000..af636e8370 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0037.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0038.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0038.png new file mode 100755 index 0000000000..aa16a04e0f Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0038.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0039.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0039.png new file mode 100755 index 0000000000..016e72d885 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0039.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0040.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0040.png new file mode 100755 index 0000000000..9a91fd152f Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0040.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0041.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0041.png new file mode 100755 index 0000000000..1d763f2794 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0041.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0042.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0042.png new file mode 100755 index 0000000000..c1627112c3 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0042.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0043.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0043.png new file mode 100755 index 0000000000..dc0db5e9b2 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0043.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0044.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0044.png new file mode 100755 index 0000000000..68b2f80893 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0044.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0045.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0045.png new file mode 100755 index 0000000000..a623e4c7aa Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0045.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0046.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0046.png new file mode 100755 index 0000000000..1ba58a00de Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0046.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0047.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0047.png new file mode 100755 index 0000000000..af0d9e1a50 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0047.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0048.png b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0048.png new file mode 100755 index 0000000000..9b650832f5 Binary files /dev/null and b/OCH/mogo-och-common-module/src/main/res/drawable-nodpi/xiaozhi_normal_0048.png differ diff --git a/OCH/mogo-och-common-module/src/main/res/layout/activity_video_player.xml b/OCH/mogo-och-common-module/src/main/res/layout/activity_video_player.xml index 4af9cb07d9..6a04f38ead 100644 --- a/OCH/mogo-och-common-module/src/main/res/layout/activity_video_player.xml +++ b/OCH/mogo-och-common-module/src/main/res/layout/activity_video_player.xml @@ -4,8 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@drawable/road_video_bg" - tools:context="com.mogo.eagle.core.function.main.VideoAdAtc"> + android:background="@drawable/road_video_bg"> + + + @drawable/xiaozhi_normal_0000 + @drawable/xiaozhi_normal_0001 + @drawable/xiaozhi_normal_0002 + @drawable/xiaozhi_normal_0003 + @drawable/xiaozhi_normal_0004 + @drawable/xiaozhi_normal_0005 + @drawable/xiaozhi_normal_0006 + @drawable/xiaozhi_normal_0007 + @drawable/xiaozhi_normal_0008 + @drawable/xiaozhi_normal_0009 + @drawable/xiaozhi_normal_0010 + @drawable/xiaozhi_normal_0011 + @drawable/xiaozhi_normal_0012 + @drawable/xiaozhi_normal_0013 + @drawable/xiaozhi_normal_0014 + @drawable/xiaozhi_normal_0015 + @drawable/xiaozhi_normal_0016 + @drawable/xiaozhi_normal_0017 + @drawable/xiaozhi_normal_0018 + @drawable/xiaozhi_normal_0019 + @drawable/xiaozhi_normal_0020 + @drawable/xiaozhi_normal_0021 + @drawable/xiaozhi_normal_0022 + @drawable/xiaozhi_normal_0023 + @drawable/xiaozhi_normal_0024 + @drawable/xiaozhi_normal_0025 + @drawable/xiaozhi_normal_0026 + @drawable/xiaozhi_normal_0027 + @drawable/xiaozhi_normal_0028 + @drawable/xiaozhi_normal_0029 + @drawable/xiaozhi_normal_0030 + @drawable/xiaozhi_normal_0031 + @drawable/xiaozhi_normal_0032 + @drawable/xiaozhi_normal_0033 + @drawable/xiaozhi_normal_0034 + @drawable/xiaozhi_normal_0035 + @drawable/xiaozhi_normal_0036 + @drawable/xiaozhi_normal_0037 + @drawable/xiaozhi_normal_0038 + @drawable/xiaozhi_normal_0039 + @drawable/xiaozhi_normal_0040 + @drawable/xiaozhi_normal_0041 + @drawable/xiaozhi_normal_0042 + @drawable/xiaozhi_normal_0043 + @drawable/xiaozhi_normal_0044 + @drawable/xiaozhi_normal_0045 + @drawable/xiaozhi_normal_0046 + @drawable/xiaozhi_normal_0047 + @drawable/xiaozhi_normal_0048 + + + + @drawable/charter_p_xiaozhi_think_00 + @drawable/charter_p_xiaozhi_think_01 + @drawable/charter_p_xiaozhi_think_02 + @drawable/charter_p_xiaozhi_think_03 + @drawable/charter_p_xiaozhi_think_04 + @drawable/charter_p_xiaozhi_think_05 + @drawable/charter_p_xiaozhi_think_06 + @drawable/charter_p_xiaozhi_think_07 + @drawable/charter_p_xiaozhi_think_08 + @drawable/charter_p_xiaozhi_think_09 + @drawable/charter_p_xiaozhi_think_10 + @drawable/charter_p_xiaozhi_think_11 + @drawable/charter_p_xiaozhi_think_12 + @drawable/charter_p_xiaozhi_think_13 + @drawable/charter_p_xiaozhi_think_14 + @drawable/charter_p_xiaozhi_think_15 + @drawable/charter_p_xiaozhi_think_16 + @drawable/charter_p_xiaozhi_think_17 + @drawable/charter_p_xiaozhi_think_18 + @drawable/charter_p_xiaozhi_think_19 + @drawable/charter_p_xiaozhi_think_20 + @drawable/charter_p_xiaozhi_think_21 + @drawable/charter_p_xiaozhi_think_22 + @drawable/charter_p_xiaozhi_think_23 + @drawable/charter_p_xiaozhi_think_24 + @drawable/charter_p_xiaozhi_think_25 + @drawable/charter_p_xiaozhi_think_26 + @drawable/charter_p_xiaozhi_think_27 + @drawable/charter_p_xiaozhi_think_28 + @drawable/charter_p_xiaozhi_think_29 + @drawable/charter_p_xiaozhi_think_30 + @drawable/charter_p_xiaozhi_think_31 + + + @drawable/charter_p_xiaozhi_think_34 + @drawable/charter_p_xiaozhi_think_35 + @drawable/charter_p_xiaozhi_think_36 + @drawable/charter_p_xiaozhi_think_37 + @drawable/charter_p_xiaozhi_think_38 + @drawable/charter_p_xiaozhi_think_39 + @drawable/charter_p_xiaozhi_think_40 + @drawable/charter_p_xiaozhi_think_41 + @drawable/charter_p_xiaozhi_think_42 + @drawable/charter_p_xiaozhi_think_43 + @drawable/charter_p_xiaozhi_think_44 + @drawable/charter_p_xiaozhi_think_45 + @drawable/charter_p_xiaozhi_think_46 + @drawable/charter_p_xiaozhi_think_47 + @drawable/charter_p_xiaozhi_think_48 + @drawable/charter_p_xiaozhi_think_49 + @drawable/charter_p_xiaozhi_think_50 + @drawable/charter_p_xiaozhi_think_51 + @drawable/charter_p_xiaozhi_think_52 + @drawable/charter_p_xiaozhi_think_53 + @drawable/charter_p_xiaozhi_think_54 + @drawable/charter_p_xiaozhi_think_55 + @drawable/charter_p_xiaozhi_think_56 + @drawable/charter_p_xiaozhi_think_57 + @drawable/charter_p_xiaozhi_think_58 + @drawable/charter_p_xiaozhi_think_59 + @drawable/charter_p_xiaozhi_think_60 + @drawable/charter_p_xiaozhi_think_61 + @drawable/charter_p_xiaozhi_think_62 + @drawable/charter_p_xiaozhi_think_63 + @drawable/charter_p_xiaozhi_think_64 + @drawable/charter_p_xiaozhi_think_65 + @drawable/charter_p_xiaozhi_think_66 + @drawable/charter_p_xiaozhi_think_67 + @drawable/charter_p_xiaozhi_think_68 + @drawable/charter_p_xiaozhi_think_69 + @drawable/charter_p_xiaozhi_think_70 + @drawable/charter_p_xiaozhi_think_71 + + + + @drawable/charter_p_xiaozhi_think_normal_01 + @drawable/charter_p_xiaozhi_think_normal_02 + @drawable/charter_p_xiaozhi_think_normal_03 + @drawable/charter_p_xiaozhi_think_normal_04 + @drawable/charter_p_xiaozhi_think_normal_05 + @drawable/charter_p_xiaozhi_think_normal_06 + @drawable/charter_p_xiaozhi_think_normal_07 + @drawable/charter_p_xiaozhi_think_normal_08 + @drawable/charter_p_xiaozhi_think_normal_09 + @drawable/charter_p_xiaozhi_think_normal_10 + @drawable/charter_p_xiaozhi_think_normal_11 + @drawable/charter_p_xiaozhi_think_normal_12 + @drawable/charter_p_xiaozhi_think_normal_13 + @drawable/charter_p_xiaozhi_think_normal_14 + @drawable/charter_p_xiaozhi_think_normal_15 + @drawable/charter_p_xiaozhi_think_normal_16 + @drawable/charter_p_xiaozhi_think_normal_17 + + + \ No newline at end of file diff --git a/OCH/mogo-och-common-module/src/main/res/values/attrs.xml b/OCH/mogo-och-common-module/src/main/res/values/attrs.xml index 9043a1d2ad..596cd32cc6 100644 --- a/OCH/mogo-och-common-module/src/main/res/values/attrs.xml +++ b/OCH/mogo-och-common-module/src/main/res/values/attrs.xml @@ -47,7 +47,7 @@ - + diff --git a/OCH/mogo-och-common-module/src/test/java/com/mogo/och/common/module/ExampleUnitTest.kt b/OCH/mogo-och-common-module/src/test/java/com/mogo/och/common/module/ExampleUnitTest.kt index b7c293b91d..d914d4a1b7 100644 --- a/OCH/mogo-och-common-module/src/test/java/com/mogo/och/common/module/ExampleUnitTest.kt +++ b/OCH/mogo-och-common-module/src/test/java/com/mogo/och/common/module/ExampleUnitTest.kt @@ -1,6 +1,13 @@ package com.mogo.och.common.module +import com.amap.api.maps.model.LatLng +import com.google.gson.reflect.TypeToken +import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.utilcode.util.CoordinateTransform +import com.mogo.eagle.core.utilcode.util.CoordinateUtils +import com.mogo.eagle.core.utilcode.util.GsonUtils +import com.mogo.och.common.module.manager.distancemamager.TrajectoryAndDistanceManager +import com.mogo.och.common.module.utils.DateTimeUtil import com.zhidao.thirdlogin.utils.Aes import org.junit.Assert.* import org.junit.Test @@ -21,8 +28,59 @@ class ExampleUnitTest { val encrypt: String = Aes.encrypt(json, KEY, IVS, "UTF-8") println(encrypt) } + @Test + fun testData() { + for(time in 0 until 7200){ + val second2Time = DateTimeUtil.second2Time(time.toLong()) + + val listSplit = second2Time.split(":") + + println("${listSplit[0]}时:${listSplit[1]}分") + } + } @Test + fun resetDataOnlyOne(){ + val wgS84ToGCJ021 = CoordinateTransform.WGS84ToGCJ02(112.57734109982152,26.819824546720504) + val wgS84ToGCJ022 = CoordinateTransform.WGS84ToGCJ02(112.57299,26.90656) + println("${wgS84ToGCJ021[1]},${wgS84ToGCJ021[0]}----1") + println("${wgS84ToGCJ022[1]},${wgS84ToGCJ022[0]}----2") + } + @Test + fun distance(){ + var calculateLineDistance = CoordinateUtils.calculateLineDistance( + 112.58247531316542, + 26.816166375096863, + 112.57772263629191, + 26.820325512385274, + ) + + println("两点间的距离----${calculateLineDistance}") + } + + @Test + fun distanceWithLine(){ + val trajectory = "[{\"longitude\": 112.57772263629191,\"latitude\": 26.820325512385274},{\"longitude\": 112.57733952292816,\"latitude\": 26.820086860498055},{\"longitude\": 112.57713187192141,\"latitude\": 26.819922535836973},{\"longitude\": 112.57687967215642,\"latitude\": 26.819757579900877},{\"longitude\": 112.57667290445619,\"latitude\": 26.819600692538735},{\"longitude\": 112.57600316737123,\"latitude\": 26.819207067510625},{\"longitude\": 112.57561035288818,\"latitude\": 26.81900279871554},{\"longitude\": 112.57558037336332,\"latitude\": 26.818966108431482},{\"longitude\": 112.57559098043983,\"latitude\": 26.81892857807131},{\"longitude\": 112.57563832555716,\"latitude\": 26.818914326240712},{\"longitude\": 112.5757263009867,\"latitude\": 26.818938218858673},{\"longitude\": 112.5760904817954,\"latitude\": 26.819123661927083},{\"longitude\": 112.57710749410802,\"latitude\": 26.819729688873934},{\"longitude\": 112.5781189448959,\"latitude\": 26.820349534555618},{\"longitude\": 112.57880950115879,\"latitude\": 26.82077191558511},{\"longitude\": 112.57891627406968,\"latitude\": 26.820859317924043},{\"longitude\": 112.57899124671509,\"latitude\": 26.820952771743375},{\"longitude\": 112.57902679239179,\"latitude\": 26.82105955898617},{\"longitude\": 112.5789976321119,\"latitude\": 26.821174514978136},{\"longitude\": 112.578555064057,\"latitude\": 26.821797859429427},{\"longitude\": 112.57795642245695,\"latitude\": 26.822651023971133},{\"longitude\": 112.57733398244369,\"latitude\": 26.823600617560405},{\"longitude\": 112.57677698354983,\"latitude\": 26.824516415313433},{\"longitude\": 112.57624233641295,\"latitude\": 26.825455697778107},{\"longitude\": 112.57572875484072,\"latitude\": 26.826426121249938},{\"longitude\": 112.57529684590179,\"latitude\": 26.82731548434467},{\"longitude\": 112.57487816185596,\"latitude\": 26.82823230612025},{\"longitude\": 112.57463521393927,\"latitude\": 26.828711441576548},{\"longitude\": 112.57445099019914,\"latitude\": 26.829153818846464},{\"longitude\": 112.57406353796681,\"latitude\": 26.830165910173097},{\"longitude\": 112.57371302449874,\"latitude\": 26.83118853798091},{\"longitude\": 112.57338387275718,\"latitude\": 26.832247994256267},{\"longitude\": 112.57307958518875,\"latitude\": 26.833370768025308},{\"longitude\": 112.572834054213,\"latitude\": 26.83439802847452},{\"longitude\": 112.5726240938361,\"latitude\": 26.835436070947082},{\"longitude\": 112.57244067196883,\"latitude\": 26.83653646301533},{\"longitude\": 112.57229840576085,\"latitude\": 26.837591814988336},{\"longitude\": 112.57219224700401,\"latitude\": 26.83866241432575},{\"longitude\": 112.57208269994098,\"latitude\": 26.839687671321613},{\"longitude\": 112.57196832043626,\"latitude\": 26.840657505753878},{\"longitude\": 112.57183107427981,\"latitude\": 26.84163940384966},{\"longitude\": 112.57167950832878,\"latitude\": 26.842619338785447},{\"longitude\": 112.57151899030735,\"latitude\": 26.84355752405859},{\"longitude\": 112.57133064671739,\"latitude\": 26.84458007352469},{\"longitude\": 112.57110517173845,\"latitude\": 26.84569641611358},{\"longitude\": 112.57087545672542,\"latitude\": 26.846714804989112},{\"longitude\": 112.57063274366729,\"latitude\": 26.847725291109366},{\"longitude\": 112.57035230745373,\"latitude\": 26.848831468150028},{\"longitude\": 112.57005107335495,\"latitude\": 26.850008806882695},{\"longitude\": 112.5697934329309,\"latitude\": 26.851078499034774},{\"longitude\": 112.56952126531716,\"latitude\": 26.852085033298675},{\"longitude\": 112.56925385510193,\"latitude\": 26.853129564440273},{\"longitude\": 112.56899055077214,\"latitude\": 26.854169635736156},{\"longitude\": 112.56873836559927,\"latitude\": 26.855166275733453},{\"longitude\": 112.5684541330425,\"latitude\": 26.856277134305266},{\"longitude\": 112.56820124728208,\"latitude\": 26.857425874261235},{\"longitude\": 112.5680109279962,\"latitude\": 26.858409844914863},{\"longitude\": 112.5678627931869,\"latitude\": 26.859355934968004},{\"longitude\": 112.56773433742133,\"latitude\": 26.860385951422927},{\"longitude\": 112.56762980043118,\"latitude\": 26.861493391573035},{\"longitude\": 112.56756490747725,\"latitude\": 26.86257607810979},{\"longitude\": 112.56753533982277,\"latitude\": 26.86373469925572},{\"longitude\": 112.56754895675328,\"latitude\": 26.864817185301575},{\"longitude\": 112.56758307888657,\"latitude\": 26.865847160718477},{\"longitude\": 112.56762731433868,\"latitude\": 26.86711946545191},{\"longitude\": 112.56766684892891,\"latitude\": 26.868319641814267},{\"longitude\": 112.56769897930359,\"latitude\": 26.86936239451234},{\"longitude\": 112.56773981647314,\"latitude\": 26.870450862240844},{\"longitude\": 112.56778419400631,\"latitude\": 26.871696138656716},{\"longitude\": 112.56782685460598,\"latitude\": 26.872276153580753},{\"longitude\": 112.56789777230162,\"latitude\": 26.87281429005142},{\"longitude\": 112.56800242632866,\"latitude\": 26.87337009061124},{\"longitude\": 112.56811271678804,\"latitude\": 26.873808867065463},{\"longitude\": 112.568291993152,\"latitude\": 26.874421884078924},{\"longitude\": 112.56846704929232,\"latitude\": 26.87488405491067},{\"longitude\": 112.56869634262367,\"latitude\": 26.87542008503841},{\"longitude\": 112.56896049990331,\"latitude\": 26.875948819391375},{\"longitude\": 112.56925249751414,\"latitude\": 26.87646116970037},{\"longitude\": 112.56956700289011,\"latitude\": 26.8769447572142},{\"longitude\": 112.56989914660946,\"latitude\": 26.877395979702843},{\"longitude\": 112.57027260460708,\"latitude\": 26.877859648801568},{\"longitude\": 112.57098894427915,\"latitude\": 26.878664247706066},{\"longitude\": 112.57126442805652,\"latitude\": 26.87899598188578},{\"longitude\": 112.57160829718538,\"latitude\": 26.87945564329532},{\"longitude\": 112.57216252059992,\"latitude\": 26.88038117364182},{\"longitude\": 112.57241764199154,\"latitude\": 26.880900596583857},{\"longitude\": 112.57259927098444,\"latitude\": 26.881330561822715},{\"longitude\": 112.57280424282287,\"latitude\": 26.881922521716476},{\"longitude\": 112.57294742360097,\"latitude\": 26.8824512874619},{\"longitude\": 112.57305757966559,\"latitude\": 26.8830138917276},{\"longitude\": 112.57313388300817,\"latitude\": 26.88360739818577},{\"longitude\": 112.57317430439731,\"latitude\": 26.884731612696353},{\"longitude\": 112.57319235439246,\"latitude\": 26.885953683698922},{\"longitude\": 112.57320731756178,\"latitude\": 26.887107100581485},{\"longitude\": 112.57322224838643,\"latitude\": 26.88819625521858},{\"longitude\": 112.57323291894362,\"latitude\": 26.88917081837399},{\"longitude\": 112.57324729869111,\"latitude\": 26.890161389324707},{\"longitude\": 112.57326116800273,\"latitude\": 26.89123952388697},{\"longitude\": 112.57327433068929,\"latitude\": 26.89225244212013},{\"longitude\": 112.5732909635451,\"latitude\": 26.893386941944204},{\"longitude\": 112.57330605502305,\"latitude\": 26.894564402445766},{\"longitude\": 112.57331916719527,\"latitude\": 26.895756960489745},{\"longitude\": 112.57329858435462,\"latitude\": 26.89693388431065},{\"longitude\": 112.57324698305418,\"latitude\": 26.898028857659792},{\"longitude\": 112.57319171668158,\"latitude\": 26.8990588250119},{\"longitude\": 112.57314083346539,\"latitude\": 26.90003216219406},{\"longitude\": 112.57308903159071,\"latitude\": 26.900982522153537},{\"longitude\": 112.57306533719523,\"latitude\": 26.901433105371172},{\"longitude\": 112.57308213757469,\"latitude\": 26.90196652783364},{\"longitude\": 112.5730349779171,\"latitude\": 26.902991601760412},{\"longitude\": 112.57298079301792,\"latitude\": 26.9040641167899},{\"longitude\": 112.57292622754801,\"latitude\": 26.905121206439922},{\"longitude\": 112.57290202419351,\"latitude\": 26.90567325452591},{\"longitude\": 112.57292602660397,\"latitude\": 26.906095263476384},{\"longitude\": 112.57299859001606,\"latitude\": 26.906568446270473}]" + val list = GsonUtils.fromJson>( + trajectory, + object : TypeToken?>() {}.type + ) + val mutableListOf = mutableListOf() + list.forEach { + val mogoLocation = MogoLocation() + + val wgS84ToGCJ02 = CoordinateTransform.WGS84ToGCJ02(it.longitude, it.latitude) + mogoLocation.longitude = wgS84ToGCJ02[0] + mogoLocation.latitude = wgS84ToGCJ02[1] + mutableListOf.add(mogoLocation) + } + val mogoLocation = MogoLocation() + mogoLocation.latitude = 26.81621974773846 + mogoLocation.longitude = 112.58256523642582 + mogoLocation.heading = 54.70416759597498 + TrajectoryAndDistanceManager.distanceWithTrajectory(mutableListOf,mogoLocation) + } + fun resetData(){ val mutableListOf = mutableListOf() mutableListOf.add(Data(26.81618164239085,112.58250175297606,55.55709771386404 ,0.046407543)) diff --git a/OCH/mogo-och-data/src/androidTest/java/com/mogo/och/data/ExampleInstrumentedTest.kt b/OCH/mogo-och-data/src/androidTest/java/com/mogo/och/data/ExampleInstrumentedTest.kt deleted file mode 100644 index 673a5dcfd3..0000000000 --- a/OCH/mogo-och-data/src/androidTest/java/com/mogo/och/data/ExampleInstrumentedTest.kt +++ /dev/null @@ -1,24 +0,0 @@ -package com.mogo.och.data - -import androidx.test.platform.app.InstrumentationRegistry -import androidx.test.ext.junit.runners.AndroidJUnit4 - -import org.junit.Test -import org.junit.runner.RunWith - -import org.junit.Assert.* - -/** - * Instrumented test, which will execute on an Android device. - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -@RunWith(AndroidJUnit4::class) -class ExampleInstrumentedTest { - @Test - fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("com.mogo.och.data.test", appContext.packageName) - } -} \ No newline at end of file diff --git a/OCH/mogo-och-data/src/test/java/com/mogo/och/data/ExampleUnitTest.kt b/OCH/mogo-och-data/src/test/java/com/mogo/och/data/ExampleUnitTest.kt deleted file mode 100644 index 294d55ae21..0000000000 --- a/OCH/mogo-och-data/src/test/java/com/mogo/och/data/ExampleUnitTest.kt +++ /dev/null @@ -1,17 +0,0 @@ -package com.mogo.och.data - -import org.junit.Test - -import org.junit.Assert.* - -/** - * Example local unit test, which will execute on the development machine (host). - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -class ExampleUnitTest { - @Test - fun addition_isCorrect() { - assertEquals(4, 2 + 2) - } -} \ No newline at end of file diff --git a/OCH/mogo-och-noop/.gitignore b/OCH/mogo-och-noop/.gitignore deleted file mode 100644 index 42afabfd2a..0000000000 --- a/OCH/mogo-och-noop/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build \ No newline at end of file diff --git a/OCH/mogo-och-noop/build.gradle b/OCH/mogo-och-noop/build.gradle deleted file mode 100644 index b387a1dd5b..0000000000 --- a/OCH/mogo-och-noop/build.gradle +++ /dev/null @@ -1,71 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-android-extensions' - id 'kotlin-kapt' -} - -android { - compileSdkVersion rootProject.ext.android.compileSdkVersion - // buildToolsVersion rootProject.ext.android.buildToolsVersion - defaultConfig { - minSdkVersion rootProject.ext.android.minSdkVersion - targetSdkVersion rootProject.ext.android.targetSdkVersion - versionCode Integer.valueOf(VERSION_CODE) - versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION") - - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles "consumer-rules.pro" - //ARouter apt 参数 - kapt { - useBuildCache = false - arguments { - arg("AROUTER_MODULE_NAME", project.getName()) - } - } - } - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - lintOptions { - abortOnError false - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } -} - -dependencies { - implementation fileTree(dir: "libs", include: ["*.jar"]) - implementation rootProject.ext.dependencies.androidxappcompat - implementation rootProject.ext.dependencies.androidxconstraintlayout - implementation rootProject.ext.dependencies.rxjava - implementation rootProject.ext.dependencies.rxandroid - - implementation rootProject.ext.dependencies.arouter - annotationProcessor rootProject.ext.dependencies.aroutercompiler - kapt rootProject.ext.dependencies.aroutercompiler - - if (Boolean.valueOf(USE_MAVEN_PACKAGE)) { - implementation rootProject.ext.dependencies.mogoutils - implementation rootProject.ext.dependencies.mogocommons - implementation rootProject.ext.dependencies.mogo_core_data - implementation rootProject.ext.dependencies.mogo_core_function_call - implementation rootProject.ext.dependencies.mogo_core_function_hmi - }else { - implementation project(":core:mogo-core-utils") - implementation project(":foudations:mogo-commons") - implementation project(':core:mogo-core-function-call') - implementation project(':core:function-impl:mogo-core-function-hmi') - } -} - -apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString() \ No newline at end of file diff --git a/OCH/mogo-och-noop/consumer-rules.pro b/OCH/mogo-och-noop/consumer-rules.pro deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/OCH/mogo-och-noop/gradle.properties b/OCH/mogo-och-noop/gradle.properties deleted file mode 100644 index a3c4fc4290..0000000000 --- a/OCH/mogo-och-noop/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -GROUP=com.mogo.och -POM_ARTIFACT_ID=och-noop -VERSION_CODE=1 diff --git a/OCH/mogo-och-noop/proguard-rules.pro b/OCH/mogo-och-noop/proguard-rules.pro deleted file mode 100644 index 481bb43481..0000000000 --- a/OCH/mogo-och-noop/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/OCH/mogo-och-noop/src/main/AndroidManifest.xml b/OCH/mogo-och-noop/src/main/AndroidManifest.xml deleted file mode 100644 index a76961473f..0000000000 --- a/OCH/mogo-och-noop/src/main/AndroidManifest.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - \ No newline at end of file diff --git a/OCH/mogo-och-noop/src/main/java/com/mogo/och/noop/IMogoOCH.java b/OCH/mogo-och-noop/src/main/java/com/mogo/och/noop/IMogoOCH.java deleted file mode 100644 index 2dc04ff268..0000000000 --- a/OCH/mogo-och-noop/src/main/java/com/mogo/och/noop/IMogoOCH.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.mogo.och.noop; - -import androidx.annotation.IdRes; -import androidx.fragment.app.FragmentActivity; - -import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider; - -public -/** - * @author congtaowang - * @since 2021/1/15 - * - * 网约车抽象接口 - */ -interface IMogoOCH extends IMoGoFunctionProvider { - - /** - * 初始化网约车容器 - * - * @param activity - * @param containerId 容器ID - */ - default void createCoverage(FragmentActivity activity, @IdRes int containerId){ - - }; -} diff --git a/OCH/mogo-och-noop/src/main/java/com/mogo/och/noop/MoGoOCHNoopProvider.kt b/OCH/mogo-och-noop/src/main/java/com/mogo/och/noop/MoGoOCHNoopProvider.kt deleted file mode 100644 index 9ea1d1dfd3..0000000000 --- a/OCH/mogo-och-noop/src/main/java/com/mogo/och/noop/MoGoOCHNoopProvider.kt +++ /dev/null @@ -1,60 +0,0 @@ -package com.mogo.och.noop - -import android.content.Context -import androidx.fragment.app.Fragment -import androidx.fragment.app.FragmentActivity -import com.alibaba.android.arouter.facade.annotation.Route -import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d - -@Route(path = OCHConstants.PATH) -class MoGoOCHNoopProvider : IMogoOCH { - - companion object { - private const val TAG = "MogoOCHNoopProvider" - } - - override val functionName: String - get() = TAG - - private var fragment: OchNoopFragment? = null - private var containerId = 0 - private var activity: FragmentActivity? = null - - override fun init(context: Context) { - } - - private fun showFragment() { - activity?.let { - if (fragment == null) { - d(TAG, "准备add fragment======") - val fragmentByTag = it.supportFragmentManager.findFragmentByTag(TAG) - fragment = if (fragmentByTag is OchNoopFragment) { - fragmentByTag - } else { - OchNoopFragment() - } - if (!fragment!!.isAdded) { - it.supportFragmentManager.beginTransaction() - .add(containerId, fragment!!, TAG).commitAllowingStateLoss() - } - return - } - d(TAG, "准备show fragment") - fragment?.let { noopFragment -> - it.supportFragmentManager.beginTransaction().show(noopFragment) - .commitAllowingStateLoss() - } - } - } - - override fun createCoverage(activity: FragmentActivity?, containerId: Int?): Fragment? { - this.containerId = containerId!! - this.activity = activity - showFragment() - return null - } - - override fun onDestroy() { - - } -} \ No newline at end of file diff --git a/OCH/mogo-och-noop/src/main/java/com/mogo/och/noop/OCHConstants.java b/OCH/mogo-och-noop/src/main/java/com/mogo/och/noop/OCHConstants.java deleted file mode 100644 index 8a5d17c35a..0000000000 --- a/OCH/mogo-och-noop/src/main/java/com/mogo/och/noop/OCHConstants.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.mogo.och.noop; - -public -/** - * @author congtaowang - * @since 2021/1/15 - * - * 网约车部分常量字段 - */ -class OCHConstants { - - /** - * arouter 路由地址 - */ - public static final String PATH = "/noop/api"; -} diff --git a/OCH/mogo-och-noop/src/main/java/com/mogo/och/noop/OchNoopContract.kt b/OCH/mogo-och-noop/src/main/java/com/mogo/och/noop/OchNoopContract.kt deleted file mode 100644 index 855b980820..0000000000 --- a/OCH/mogo-och-noop/src/main/java/com/mogo/och/noop/OchNoopContract.kt +++ /dev/null @@ -1,15 +0,0 @@ -package com.mogo.och.noop - -import com.mogo.commons.mvp.IView - - -/** - *@author xiaoyuzhou - *@date 2021/8/4 3:38 下午 - */ -interface OchNoopContract { - - interface View : IView { - - } -} \ No newline at end of file diff --git a/OCH/mogo-och-noop/src/main/java/com/mogo/och/noop/OchNoopFragment.kt b/OCH/mogo-och-noop/src/main/java/com/mogo/och/noop/OchNoopFragment.kt deleted file mode 100644 index 31b9425b91..0000000000 --- a/OCH/mogo-och-noop/src/main/java/com/mogo/och/noop/OchNoopFragment.kt +++ /dev/null @@ -1,31 +0,0 @@ -package com.mogo.och.noop - -import com.mogo.commons.mvp.MvpFragment -import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView -import kotlinx.android.synthetic.main.och_noop_fragment_hmi.* - -class OchNoopFragment : MvpFragment(), - OchNoopContract.View { - - companion object { - private const val TAG = "OchNoopFragment" - } - - override fun getLayoutId(): Int { - return R.layout.och_noop_fragment_hmi - } - - override fun getTagName(): String { - return TAG - } - - override fun createPresenter(): OchNoopPresenter { - return OchNoopPresenter(this) - } - - override fun initViews() { - - } - - -} \ No newline at end of file diff --git a/OCH/mogo-och-noop/src/main/java/com/mogo/och/noop/OchNoopPresenter.kt b/OCH/mogo-och-noop/src/main/java/com/mogo/och/noop/OchNoopPresenter.kt deleted file mode 100644 index 0d690328cf..0000000000 --- a/OCH/mogo-och-noop/src/main/java/com/mogo/och/noop/OchNoopPresenter.kt +++ /dev/null @@ -1,8 +0,0 @@ -package com.mogo.och.noop - -import com.mogo.commons.mvp.Presenter - -class OchNoopPresenter(view: OchNoopContract.View?) : - Presenter(view) { - -} \ No newline at end of file diff --git a/OCH/mogo-och-noop/src/main/res/layout/och_noop_fragment_hmi.xml b/OCH/mogo-och-noop/src/main/res/layout/och_noop_fragment_hmi.xml deleted file mode 100644 index 41e0f55c3c..0000000000 --- a/OCH/mogo-och-noop/src/main/res/layout/och_noop_fragment_hmi.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java b/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java index d864c3f82e..b6d22ccdf0 100644 --- a/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java +++ b/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java @@ -22,39 +22,34 @@ import com.mogo.commons.mvp.IView; import com.mogo.commons.mvp.MvpFragment; import com.mogo.commons.mvp.Presenter; import com.mogo.eagle.core.data.config.FunctionBuildConfig; -import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener; +import com.mogo.eagle.core.data.config.HdMapBuildConfig; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager; import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager; import com.mogo.eagle.core.function.call.hmi.CallerHmiManager; +import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager; import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView; import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView; import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView; import com.mogo.eagle.core.function.hmi.ui.widget.TrafficDataView; import com.mogo.eagle.core.function.smp.view.SmallMapView; -import com.mogo.eagle.core.function.view.MapBizView; +import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils; import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener; import com.mogo.eagle.core.utilcode.util.UiThreadHandler; +import com.mogo.map.MogoMap; import com.mogo.map.listener.IMogoMapListener; import com.mogo.map.listener.MogoMapListenerHandler; import com.mogo.map.uicontroller.IMogoMapUIController; import com.mogo.map.uicontroller.VisualAngleMode; import com.mogo.och.bus.R; +import com.mogo.och.bus.view.BizMapView; import com.mogo.och.data.bean.BusRoutesResult; import com.mogo.och.bus.model.OrderModel; -import com.mogo.och.bus.util.BDRouteDataTestUtils; import com.mogo.och.bus.view.SlidePanelView; import com.mogo.och.common.module.utils.SoundPoolHelper; import org.greenrobot.eventbus.EventBus; - -import java.util.Objects; - -import bag_manager.BagManagerOuterClass; -import mogo.telematics.pad.MessagePad; -import record_cache.RecordPanelOuterClass; - /** * 网约车基础Fragment,主要负责布局通用界面,处理站点面板和通话面板互斥情况 *

@@ -62,7 +57,7 @@ import record_cache.RecordPanelOuterClass; * * @author tongchenfei */ -public abstract class BaseBusTabFragment> extends MvpFragment implements IMogoMapListener, IMoGoAutopilotRecordListener { +public abstract class BaseBusTabFragment> extends MvpFragment implements IMogoMapListener { private static final String TAG = "BaseBusTabFragment"; @@ -75,7 +70,7 @@ public abstract class BaseBusTabFragment protected RelativeLayout mBadcaseBtn; protected RelativeLayout mAICollectBtn; private FrameLayout flStationPanelContainer; - private MapBizView mapBizView; + private BizMapView mapBizView; private Group groupTestPanel; private TrafficDataView mTrafficDataView; // private BusTrafficLightView mTrafficLightView; @@ -192,8 +187,6 @@ public abstract class BaseBusTabFragment debugArrivedStation() ); - findViewById(R.id.btnAutopilotRoute).setOnClickListener(view -> debugArrivedRoute()); - tvArrived.setOnClickListener(view -> { onArriveStation(); }); @@ -209,7 +202,6 @@ public abstract class BaseBusTabFragment if (mBadcaseBtn != null) { CallerDevaToolsManager.INSTANCE.initBadCase(mBadcaseBtn); - CallerAutopilotRecordListenerManager.INSTANCE.addListener(TAG, this); } mAICollectBtn = findViewById(R.id.module_mogo_och_ai_collet_rl); @@ -261,6 +253,17 @@ public abstract class BaseBusTabFragment protected abstract void onArriveStation(); private void updateSwitchMapIcon() { + + IMogoMapUIController mapUIController = CallerMapUIServiceManager.INSTANCE.getMapUIController(MogoMap.DEFAULT); + if(mapUIController!=null){ + if (AppIdentityModeUtils.isM2(FunctionBuildConfig.appIdentityMode)) { + mapUIController.changeCurrentIcon(R.raw.m2); + HdMapBuildConfig.currentCarVrIconRes = R.raw.m2; + }else if (AppIdentityModeUtils.isJL(FunctionBuildConfig.appIdentityMode)) { + mapUIController.changeCurrentIcon(R.raw.xiaoba); + HdMapBuildConfig.currentCarVrIconRes = R.raw.xiaoba; + } + } if(mapBizView != null){ IMogoMapUIController uiController = mapBizView.getUI(); if(uiController != null){ @@ -275,10 +278,6 @@ public abstract class BaseBusTabFragment } } - private void debugArrivedRoute() { - BDRouteDataTestUtils.converToRouteData(); - } - @Override public void onSaveInstanceState(@NonNull Bundle outState) { super.onSaveInstanceState(outState); @@ -306,18 +305,6 @@ public abstract class BaseBusTabFragment EventBus.getDefault().unregister(this); } - @Override - public void onAutopilotRecordResult(@Nullable RecordPanelOuterClass.RecordPanel recordPanel) { - } - - @Override - public void onAutopilotRecordConfig(@NonNull MessagePad.RecordDataConfig config) { - } - - @Override - public void onBagManagerResult(@NonNull BagManagerOuterClass.BagManager bagManager) { - } - /** * 测试到站 */ diff --git a/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/model/BusLineModel.java b/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/model/BusLineModel.java index fe5138ed11..244ef9526d 100644 --- a/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/model/BusLineModel.java +++ b/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/model/BusLineModel.java @@ -3,8 +3,8 @@ package com.mogo.och.bus.model; import android.content.Context; import com.mogo.commons.AbsMogoApplication; +import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr; import com.mogo.eagle.core.utilcode.util.NetworkUtils; -import com.mogo.eagle.core.utilcode.util.SharedPrefs; import com.mogo.eagle.core.utilcode.util.ToastUtils; import com.mogo.och.bus.R; import com.mogo.och.bus.bean.BusQueryLineTaskResponse; @@ -78,7 +78,7 @@ public class BusLineModel { /** * 通过线路id 查询线路排班表 - * @param lineId + * @param lineId 线路ID * @param position 位置 */ public void queryBusLineTasksById(int lineId, int position,boolean autoRefresh){ @@ -119,7 +119,7 @@ public class BusLineModel { OrderServiceManager.switchLine(mContext,taskId, new OchCommonServiceCallback() { @Override public void onSuccess(BusRoutesResponse o) { - SharedPrefs.getInstance(mContext).putInt(BusSwitchLineActivity.LASTCOMMITLINEID,lineId); + SharedPrefsMgr.getInstance(mContext).putInt(BusSwitchLineActivity.LASTCOMMITLINEID,lineId); if (mBusLinesCallback != null){ mBusLinesCallback.onChangeLineIdSuccess(); } diff --git a/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/model/OrderModel.java b/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/model/OrderModel.java index cdf4cd28d6..e6a847f71b 100644 --- a/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/model/OrderModel.java +++ b/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/model/OrderModel.java @@ -226,6 +226,11 @@ public class OrderModel { private final IReceivedMsgListener mReceivedMsgListener = new IReceivedMsgListener() { + @Override + public void onDemoMode(boolean isDemoMode) { + + } + @Override public void onReceivedServerSn(@Nullable String sn) { diff --git a/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/ui/BusSwitchLineActivity.kt b/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/ui/BusSwitchLineActivity.kt index 57d37c2805..eff63dd20b 100644 --- a/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/ui/BusSwitchLineActivity.kt +++ b/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/ui/BusSwitchLineActivity.kt @@ -12,7 +12,7 @@ import androidx.constraintlayout.widget.ConstraintLayout import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import com.mogo.commons.mvp.MvpActivity -import com.mogo.eagle.core.utilcode.util.SharedPrefs +import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr import com.mogo.och.bus.presenter.BusLinePresenter import com.mogo.och.bus.ui.adapter.SwitchLineAdapter import com.mogo.och.bus.bean.BusQueryLinesResponse @@ -118,7 +118,7 @@ class BusSwitchLineActivity : MvpActivity showNoData(true) return } - var lastCommitLineid = SharedPrefs.getInstance(this).getInt(LASTCOMMITLINEID, -1) + val lastCommitLineid = SharedPrefsMgr.getInstance(this).getInt(LASTCOMMITLINEID, -1) if (data.data != null && data.data.size > 0) { showNoData(false) mData.clear() diff --git a/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/ui/adapter/OpenItemAnimator.java b/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/ui/adapter/OpenItemAnimator.java index 1571739e3b..71e18d6523 100644 --- a/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/ui/adapter/OpenItemAnimator.java +++ b/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/ui/adapter/OpenItemAnimator.java @@ -28,10 +28,10 @@ public class OpenItemAnimator extends DefaultItemAnimator { private static TimeInterpolator sDefaultInterpolator; - private ArrayList mPendingRemovals = new ArrayList<>(); - private ArrayList mPendingAdditions = new ArrayList<>(); - private ArrayList mPendingMoves = new ArrayList<>(); - private ArrayList mPendingChanges = new ArrayList<>(); + private final ArrayList mPendingRemovals = new ArrayList<>(); + private final ArrayList mPendingAdditions = new ArrayList<>(); + private final ArrayList mPendingMoves = new ArrayList<>(); + private final ArrayList mPendingChanges = new ArrayList<>(); ArrayList> mAdditionsList = new ArrayList<>(); ArrayList> mMovesList = new ArrayList<>(); @@ -102,20 +102,16 @@ public class OpenItemAnimator extends DefaultItemAnimator { mPendingRemovals.clear(); // Next, move stuff if (movesPending) { - final ArrayList moves = new ArrayList<>(); - moves.addAll(mPendingMoves); + final ArrayList moves = new ArrayList<>(mPendingMoves); mMovesList.add(moves); mPendingMoves.clear(); - Runnable mover = new Runnable() { - @Override - public void run() { - for (MoveInfo moveInfo : moves) { - animateMoveImpl(moveInfo.holder, moveInfo.fromX, moveInfo.fromY, - moveInfo.toX, moveInfo.toY); - } - moves.clear(); - mMovesList.remove(moves); + Runnable mover = () -> { + for (MoveInfo moveInfo : moves) { + animateMoveImpl(moveInfo.holder, moveInfo.fromX, moveInfo.fromY, + moveInfo.toX, moveInfo.toY); } + moves.clear(); + mMovesList.remove(moves); }; if (removalsPending) { View view = moves.get(0).holder.itemView; @@ -126,19 +122,15 @@ public class OpenItemAnimator extends DefaultItemAnimator { } // Next, change stuff, to run in parallel with move animations if (changesPending) { - final ArrayList changes = new ArrayList<>(); - changes.addAll(mPendingChanges); + final ArrayList changes = new ArrayList<>(mPendingChanges); mChangesList.add(changes); mPendingChanges.clear(); - Runnable changer = new Runnable() { - @Override - public void run() { - for (ChangeInfo change : changes) { - animateChangeImpl(change); - } - changes.clear(); - mChangesList.remove(changes); + Runnable changer = () -> { + for (ChangeInfo change : changes) { + animateChangeImpl(change); } + changes.clear(); + mChangesList.remove(changes); }; if (removalsPending) { RecyclerView.ViewHolder holder = changes.get(0).oldHolder; @@ -149,19 +141,15 @@ public class OpenItemAnimator extends DefaultItemAnimator { } // Next, add stuff if (additionsPending) { - final ArrayList additions = new ArrayList<>(); - additions.addAll(mPendingAdditions); + final ArrayList additions = new ArrayList<>(mPendingAdditions); mAdditionsList.add(additions); mPendingAdditions.clear(); - Runnable adder = new Runnable() { - @Override - public void run() { - for (RecyclerView.ViewHolder holder : additions) { - animateAddImpl(holder); - } - additions.clear(); - mAdditionsList.remove(additions); + Runnable adder = () -> { + for (RecyclerView.ViewHolder holder : additions) { + animateAddImpl(holder); } + additions.clear(); + mAdditionsList.remove(additions); }; if (removalsPending || movesPending || changesPending) { long removeDuration = removalsPending ? getRemoveDuration() : 0; @@ -341,8 +329,8 @@ public class OpenItemAnimator extends DefaultItemAnimator { final ViewPropertyAnimator oldViewAnim = view.animate().setDuration( getChangeDuration()); mChangeAnimations.add(changeInfo.oldHolder); - oldViewAnim.translationX(changeInfo.toX - changeInfo.fromX); - oldViewAnim.translationY(changeInfo.toY - changeInfo.fromY); + oldViewAnim.translationX((float)(changeInfo.toX - changeInfo.fromX)); + oldViewAnim.translationY((float)(changeInfo.toY - changeInfo.fromY)); oldViewAnim.alpha(0).setListener(new AnimatorListenerAdapter() { @Override public void onAnimationStart(Animator animator) { diff --git a/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/util/BDRouteDataTestUtils.java b/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/util/BDRouteDataTestUtils.java deleted file mode 100644 index a9ff4aad99..0000000000 --- a/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/util/BDRouteDataTestUtils.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.mogo.och.bus.util; - -import com.mogo.och.bus.model.OrderModel; - -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; - -import java.util.ArrayList; -import java.util.List; - -import mogo.telematics.pad.MessagePad; - -/** - * @author: wangmingjun - * @date: 2022/4/13 - */ -public class BDRouteDataTestUtils { - - static String jsonStr ="{\n" + - " \"models\": [\n" + - " {\n" + - " \"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19927760268911,\"lon\":116.73512607061035,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19927736555187,\"lon\":116.73498243020299,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19927135941599,\"lon\":116.73482951462647,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.199260672670036,\"lon\":116.73468429259535,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.199251260349946,\"lon\":116.73453933465,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19924691997577,\"lon\":116.7343756435551,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.199247953493625,\"lon\":116.73421240809087,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19924986849947,\"lon\":116.73400425509712,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.199249431152175,\"lon\":116.73378579041055,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.199248921305724,\"lon\":116.73357811807278,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19925012387371,\"lon\":116.73337650020184,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.199252270195075,\"lon\":116.73318223781153,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.1992521615169,\"lon\":116.73298632625203,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19925202633083,\"lon\":116.73279582043983,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.199261230205735,\"lon\":116.73263403473568,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.199327991681926,\"lon\":116.73251962434813,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19944850496711,\"lon\":116.73249661840195,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.199582026896415,\"lon\":116.73251038561487,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.199743326352014,\"lon\":116.73253087453938,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.199908347167394,\"lon\":116.73255070500186,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.200065950595445,\"lon\":116.7325720694418,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20022747460407,\"lon\":116.73259461416663,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.200384057310536,\"lon\":116.73261575018056,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20053849777916,\"lon\":116.73263451936387,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.200696919444624,\"lon\":116.7326540541723,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.2008524952796,\"lon\":116.7326743511824,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20101429705625,\"lon\":116.73269393580199,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20118279997041,\"lon\":116.73271564378308,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.201342388452076,\"lon\":116.73273653366076,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.201476063822355,\"lon\":116.73275292393079,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20163479199852,\"lon\":116.73277440686762,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20181243476041,\"lon\":116.7328052766508,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.201991767093304,\"lon\":116.7328453845644,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20215573733484,\"lon\":116.73287624009339,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.202313648759784,\"lon\":116.73289887933315,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.202434745374454,\"lon\":116.7329182210956,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20253164952098,\"lon\":116.73297539811277,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20258043275509,\"lon\":116.73312335324984,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20258233576585,\"lon\":116.73331077089557,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20257107560234,\"lon\":116.73351244039137,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.202561578580514,\"lon\":116.73370176209845,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20256256788661,\"lon\":116.73391325024126,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20255633158834,\"lon\":116.73413195000244,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.202543311179575,\"lon\":116.73436614303907,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20253067346457,\"lon\":116.73458032609663,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20251776111356,\"lon\":116.73477082198242,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.202503997557805,\"lon\":116.73498624001282,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20249129260376,\"lon\":116.73518976336872,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20247877796589,\"lon\":116.73537786253135,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20246651610268,\"lon\":116.73559239130266,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20245754388014,\"lon\":116.73574239922202,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20244749208,\"lon\":116.73589674090469,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20243806550113,\"lon\":116.73607057284322,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20243550556816,\"lon\":116.73628106525871,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20243654127756,\"lon\":116.7364949950665,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20243738221016,\"lon\":116.7367061649993,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20243672476754,\"lon\":116.73691115930336,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20243590788176,\"lon\":116.73710722104272,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.202436434375336,\"lon\":116.73730688607075,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20243749821501,\"lon\":116.73750140347998,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20243625962803,\"lon\":116.73771330926793,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.202434515480725,\"lon\":116.73791895606205,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.2024326561388,\"lon\":116.73815206945737,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20243092086137,\"lon\":116.73838655528765,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.202430876006126,\"lon\":116.73861890759498,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20242914053177,\"lon\":116.73882029918758,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20242843336561,\"lon\":116.73904465495175,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20242661219026,\"lon\":116.73922453252953,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.202426462811076,\"lon\":116.7393708046956,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20242687134937,\"lon\":116.73954685547025,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20242694967377,\"lon\":116.73975021183773,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.202424630601236,\"lon\":116.73999740812975,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.202422502184625,\"lon\":116.74028266774337,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.202419634158936,\"lon\":116.7405942561498,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20241975959762,\"lon\":116.7409069557092,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20241920524113,\"lon\":116.74120156191647,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20241765540262,\"lon\":116.74149288504978,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20241569149764,\"lon\":116.7418080096762,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.202414529497084,\"lon\":116.74210262897205,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20241419532155,\"lon\":116.74241767661879,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.202413879360954,\"lon\":116.7427571218185,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20241287045245,\"lon\":116.7431284691325,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20241214965105,\"lon\":116.74343354359334,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20241141271715,\"lon\":116.7437220210538,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.2024080520075,\"lon\":116.74399113498052,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.202391714280026,\"lon\":116.74427625698272,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20238163805639,\"lon\":116.74452083315958,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.202379293010274,\"lon\":116.74475703837204,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.202379007817086,\"lon\":116.7449961645494,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20237814181231,\"lon\":116.7452036063558,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.202375477619896,\"lon\":116.74539567654291,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.2023632396621,\"lon\":116.74555457589031,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20229396554444,\"lon\":116.7456716047369,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20217800547467,\"lon\":116.74574081942625,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.202047498095304,\"lon\":116.74573659255675,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20188573786706,\"lon\":116.74571018281719,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.201738240263026,\"lon\":116.74568463148606,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20157507049073,\"lon\":116.74565525041498,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20137985142042,\"lon\":116.745619970576,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.201187335613575,\"lon\":116.74558631350607,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20098251429043,\"lon\":116.74555055587679,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.2007748533628,\"lon\":116.74551426934663,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20057082986032,\"lon\":116.74547749663195,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20036944224329,\"lon\":116.74544156175533,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20016365229035,\"lon\":116.74540577510051,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.1999958572445,\"lon\":116.74537505807076,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19984100521566,\"lon\":116.7453433678602,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.1996863960282,\"lon\":116.74529675648621,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19953919567943,\"lon\":116.74525916493474,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19940587189373,\"lon\":116.74523402869453,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19929047792381,\"lon\":116.74518617038383,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19922141745155,\"lon\":116.74506912884067,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19920798885308,\"lon\":116.744896716334,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19920912644279,\"lon\":116.74467216715483,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.199209186509314,\"lon\":116.74448257515108,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19920910709997,\"lon\":116.74430613406223,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.1992100786082,\"lon\":116.74410888316238,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19921081961254,\"lon\":116.74391968819582,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19921040855518,\"lon\":116.7437082083402,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19921085053439,\"lon\":116.74346931155634,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19921197237373,\"lon\":116.74325149697013,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19921248248983,\"lon\":116.74301103786591,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.1992139724646,\"lon\":116.74277237066539,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.199215818352386,\"lon\":116.74253219408898,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.199216175018876,\"lon\":116.74228853120842,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.199215970354246,\"lon\":116.74204663206451,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.199216627492966,\"lon\":116.74183871233049,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19921789170398,\"lon\":116.74165788334192,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19922000138535,\"lon\":116.74144512197054,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.199221559127494,\"lon\":116.741249370491,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19922287231889,\"lon\":116.7410525810756,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19922229019589,\"lon\":116.74085266662037,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.1992216995901,\"lon\":116.74061957723823,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19922263073874,\"lon\":116.74041638149129,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19922478093337,\"lon\":116.7402123910757,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.199227066091595,\"lon\":116.74003419421553,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.199228634241756,\"lon\":116.73985841944678,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19922951636012,\"lon\":116.7397079274105,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.199252095329484,\"lon\":116.73956265582487,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.199346162997905,\"lon\":116.73944690416265,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.199470799628024,\"lon\":116.73941941053417,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19962513314346,\"lon\":116.7394280706812,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.199780626058924,\"lon\":116.73944255215424,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.199961525343376,\"lon\":116.73945856750177,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20016196947193,\"lon\":116.73947572081121,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.200384479551936,\"lon\":116.7394949225795,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.200595083817475,\"lon\":116.73951027963179,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.200792203321086,\"lon\":116.73952526850614,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.200985930701684,\"lon\":116.73954125209579,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20115978977055,\"lon\":116.73955610094161,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.201321019536124,\"lon\":116.7395695239138,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20147117943043,\"lon\":116.7395823299481,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20163699848565,\"lon\":116.73959633422596,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20178484338371,\"lon\":116.7396085776486,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.201962185646316,\"lon\":116.73962351991214,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.2021018923927,\"lon\":116.7396354059821,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.2022137620686,\"lon\":116.73964348380458,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20232600820075,\"lon\":116.73961190446633,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20241090270993,\"lon\":116.73951649703137,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20245777783807,\"lon\":116.73937664238166,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20246906634823,\"lon\":116.73920146119093,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.202470916682884,\"lon\":116.73898763065634,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20247034830421,\"lon\":116.73878158418357,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20246978204673,\"lon\":116.73857680142473,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20247082638905,\"lon\":116.73834517890637,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.202471943178196,\"lon\":116.7381047689514,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20247131648035,\"lon\":116.73787761484981,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.202470799473765,\"lon\":116.73766230702478,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20247013054322,\"lon\":116.73743619407796,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20246999515433,\"lon\":116.73724916823292,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20247199652478,\"lon\":116.73704888970806,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.202473960263525,\"lon\":116.73684083235807,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.202474504753205,\"lon\":116.73665462440796,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20247501354581,\"lon\":116.73650710371837,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20246541231906,\"lon\":116.73635807696789,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.202426768984274,\"lon\":116.73622283382787,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20236638788854,\"lon\":116.73610589402243,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20227106919894,\"lon\":116.73600895001849,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.2021428343084,\"lon\":116.73596816020945,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20197815580698,\"lon\":116.73594623645097,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20181789535303,\"lon\":116.73593148707488,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.201667906886954,\"lon\":116.73591743008926,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.201505897730755,\"lon\":116.7359002912543,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20135083580946,\"lon\":116.73588579696379,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20118617904595,\"lon\":116.73586970398149,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20102374028594,\"lon\":116.73585314703226,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20085554043743,\"lon\":116.73583763953049,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20069451888229,\"lon\":116.73582073901778,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.200530837344964,\"lon\":116.73580314359012,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.2003608457064,\"lon\":116.73578183888779,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20021770046798,\"lon\":116.73575292592922,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.20003454701824,\"lon\":116.7357174959358,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19986125116602,\"lon\":116.73569499961796,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19969408518737,\"lon\":116.73567725223492,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19955533048882,\"lon\":116.73566375985422,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19943174810538,\"lon\":116.73564927714162,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19933167546824,\"lon\":116.735595995086,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.199280357603875,\"lon\":116.73546293260645,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19927848361656,\"lon\":116.73531579486274,\"speed\":0.0},{\"altitude\":0.0,\"angle\":0.0,\"duration\":0,\"lat\":40.19928127892504,\"lon\":116.73505848474375,\"speed\": 0.0\n" + - " }\n" + - " ]\n" + - "}"; - public static void converToRouteData(){ - List list = new ArrayList<>(); - - try { - JSONObject jsonObject = new JSONObject(jsonStr); - JSONArray jsonElements = jsonObject.getJSONArray("models"); - for (int i = 0; i < jsonElements.length(); i++) { - JSONObject s = jsonElements.getJSONObject(i); - MessagePad.Location.Builder builder = MessagePad.Location.newBuilder(); - builder.setLatitude(s.getDouble("lat")); - builder.setLongitude(s.getDouble("lon")); - list.add(builder.build()); - } - OrderModel.getInstance().debugUpdateOrderRoute(list); - } catch (JSONException e) { - e.printStackTrace(); - } - } -} diff --git a/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/util/BusTrajectoryManager.java b/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/util/BusTrajectoryManager.java index 13bf62b158..19e5310c91 100644 --- a/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/util/BusTrajectoryManager.java +++ b/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/util/BusTrajectoryManager.java @@ -6,6 +6,7 @@ import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.util.GsonUtils; +import com.mogo.och.common.module.manager.orderlogmanager.OchChainLogManager; import com.mogo.och.data.bean.BusRoutesResult; import com.mogo.och.bus.constant.BusConst; import com.mogo.och.bus.model.OrderModel; @@ -71,30 +72,36 @@ public class BusTrajectoryManager { if ("ISYS_INIT_TRAJECTORY_START".equals(guardianInfo.getCode())) { // 1. 轨迹管理_轨迹开始下载(本地已有对应轨迹也触发) CallerLogger.d(M_BUS + TAG, "onAutopilotGuardian() 轨迹开始下载"); + OchChainLogManager.writeChainLog("轨迹监控","onAutopilotGuardian() 轨迹开始下载", true, OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY); // ToastUtils.showShort("轨迹开始下载"); stopTrajReqLoop(); } else if ("ISYS_INIT_TRAJECTORY_SUCCESS".equals(guardianInfo.getCode())) { // 2. 轨迹管理_轨迹下载成功(本地已有对应轨迹也触发) CallerLogger.d(M_BUS + TAG, "onAutopilotGuardian() 轨迹下载成功"); + OchChainLogManager.writeChainLog("轨迹监控","onAutopilotGuardian() 轨迹下载成功", true, OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY); // ToastUtils.showShort("轨迹下载成功"); stopTrajReqLoop(); } else if ("ISYS_INIT_TRAJECTORY_FAILURE".equals(guardianInfo.getCode())) { // 3. 轨迹管理_轨迹下载失败,本地无对应轨迹 CallerLogger.d(M_BUS + TAG, "onAutopilotGuardian() " + "轨迹下载失败,本地无对应轨迹"); + OchChainLogManager.writeChainLog("轨迹监控","onAutopilotGuardian() 轨迹下载失败,本地无对应轨迹", true, OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY); // ToastUtils.showShort("轨迹下载失败,本地无对应轨迹"); } else if ("ISYS_INIT_TRAJECTORY_WARNING".equals(guardianInfo.getCode())) { // 4. 轨迹管理_轨迹下载失败,本地有对应轨迹,认为成功 CallerLogger.d(M_BUS + TAG, "onAutopilotGuardian() " + "轨迹下载失败,本地有对应轨迹,认为成功"); + OchChainLogManager.writeChainLog("轨迹监控","onAutopilotGuardian() 轨迹下载失败,本地有对应轨迹,认为成功", true, OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY); // ToastUtils.showShort("轨迹下载失败,本地有对应轨迹,认为成功"); } else if ("ISYS_INIT_TRAJECTORY_TIMEOUT".equals(guardianInfo.getCode())) { // 5. 轨迹管理_轨迹下载超时 CallerLogger.d(M_BUS + TAG, "onAutopilotGuardian() 轨迹下载超时"); + OchChainLogManager.writeChainLog("轨迹监控","onAutopilotGuardian() 轨迹下载超时", true, OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY); // ToastUtils.showShort("轨迹下载超时"); } else if ("ISSM_FUNC_AUTO_PILOT_READY".equals(guardianInfo.getCode())) { // 收到ssm的自动驾驶变为ready,再次下发轨迹下载.解决:域控重启,或者102域控启动太早,107节点初始化未完成导致的轨迹未进行下载。 CallerLogger.d(M_BUS + TAG, "onAutopilotGuardian() ssm ready,再次发起下载"); + OchChainLogManager.writeChainLog("轨迹监控","onAutopilotGuardian() 再次发起下载", true, OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY); syncTrajectoryInfo(); } } @@ -185,7 +192,7 @@ public class BusTrajectoryManager { CallerLogger.e(M_BUS + TAG, "sendTrajectoryReq(): mAutoPilotLine is null!!!"); return; } - + OchChainLogManager.writeChainLog("轨迹监控","sendTrajectoryReq() 下发轨迹 轨迹id"+mAutoPilotLine.getLineId(), true, OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY); CallerAutoPilotControlManager.INSTANCE.sendTrajectoryDownloadReq(mAutoPilotLine); CallerLogger.d(M_BUS + TAG, "sendTrajectoryReq(): " + GsonUtils.toJson(mAutoPilotLine)); diff --git a/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/view/BizMapView.kt b/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/view/BizMapView.kt new file mode 100644 index 0000000000..0f31f1a06f --- /dev/null +++ b/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/view/BizMapView.kt @@ -0,0 +1,63 @@ +package com.mogo.och.bus.view + +import android.content.Context +import android.os.Bundle +import android.util.AttributeSet +import android.view.LayoutInflater +import android.widget.FrameLayout +import com.mogo.eagle.core.data.config.FunctionBuildConfig +import com.mogo.eagle.core.function.view.MapBizView +import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils +import com.mogo.map.uicontroller.IMogoMapUIController +import com.mogo.och.bus.R + +/** + * 魔戒蓝牙控件 + * 放置于StatusBar右侧位置 + */ +class BizMapView @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0 +) : FrameLayout(context, attrs, defStyleAttr) { + + private lateinit var mapBizView: MapBizView + + init { + if (AppIdentityModeUtils.isM2(FunctionBuildConfig.appIdentityMode)) { + LayoutInflater.from(context).inflate(R.layout.shuttle_m2_bizmap_map, this, true) + }else if(AppIdentityModeUtils.isJL(FunctionBuildConfig.appIdentityMode)){ + LayoutInflater.from(context).inflate(R.layout.shuttle_jl_bizmap_map, this, true) + }else{ + LayoutInflater.from(context).inflate(R.layout.shuttle_jl_bizmap_map, this, true) + } + mapBizView = findViewById(R.id.bizMapView) + } + + fun getUI(): IMogoMapUIController? { + return mapBizView.getUI() + } + + fun onCreate(bundle: Bundle?) { + mapBizView.onCreate(bundle) + } + fun onResume() { + mapBizView.onResume() + } + + fun onSaveInstanceState(outState: Bundle){ + mapBizView.onSaveInstanceState(outState) + } + + fun onLowMemory() { + mapBizView.onLowMemory() + } + + fun onPause() { + mapBizView.onPause() + } + + fun onDestroy() { + mapBizView.onDestroy() + } +} \ No newline at end of file diff --git a/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/view/BusArcView.java b/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/view/BusArcView.java index a9e7bdff5d..5be7429728 100644 --- a/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/view/BusArcView.java +++ b/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/view/BusArcView.java @@ -75,13 +75,13 @@ public class BusArcView extends View { mTextPaint.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); //绘制中心的数值 mTextPaint.getTextBounds(mValue, 0, mValue.length(), mRect); - canvas.drawText(mValue, getWidth() / 2, getHeight() / 2 + mRect.height() / 2 - 10, mTextPaint); + canvas.drawText(mValue, getWidth() / 2.0f, getHeight() / 2.0f + mRect.height() / 2.0f - 10, mTextPaint); mTextPaint.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL)); //绘制中心文字描述 mTextPaint.setTextSize(getResources().getDimension(R.dimen.bus_ext_arcView_des_text_size)); mTextPaint.getTextBounds(mDes, 0, mDes.length(), mRect); - canvas.drawText(mDes, getWidth() / 2, getHeight() * 17 / 20 + mRect.height() / 2, mTextPaint); + canvas.drawText(mDes, getWidth() / 2.0f, getHeight() * 17.0f / 20.0f + mRect.height() / 2.0f, mTextPaint); } private void drawArc(Canvas canvas) { @@ -135,13 +135,10 @@ public class BusArcView extends View { ValueAnimator progressAnimator = ValueAnimator.ofFloat(startAngle, currentAngle); progressAnimator.setDuration(time); progressAnimator.setTarget(mIncludedAngle); - progressAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { - @Override - public void onAnimationUpdate(ValueAnimator animation) { - mIncludedAngle = (float) animation.getAnimatedValue(); - //重新绘制,不然不会出现效果 - postInvalidate(); - } + progressAnimator.addUpdateListener(animation -> { + mIncludedAngle = (float) animation.getAnimatedValue(); + //重新绘制,不然不会出现效果 + postInvalidate(); }); //开始执行动画 progressAnimator.start(); diff --git a/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/view/SlidePanelView.java b/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/view/SlidePanelView.java index f04edddbdb..bcb895c955 100644 --- a/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/view/SlidePanelView.java +++ b/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/view/SlidePanelView.java @@ -22,7 +22,6 @@ import android.view.animation.DecelerateInterpolator; import androidx.annotation.Nullable; import com.mogo.commons.AbsMogoApplication; -import com.mogo.eagle.core.utilcode.util.BitmapHelper; import com.mogo.och.bus.R; import me.jessyan.autosize.AutoSizeConfig; @@ -92,7 +91,7 @@ public class SlidePanelView extends View { private ObjectAnimator matrixAnim; private String blockText = STRING_SLIDE_TO_RIGHT; - private Paint.FontMetrics blockTextMetrics = new Paint.FontMetrics(); + private final Paint.FontMetrics blockTextMetrics = new Paint.FontMetrics(); private static final int GRADIENT_OFFSET = 200; @@ -263,10 +262,10 @@ public class SlidePanelView extends View { gradientMatrix.setTranslate(matrixTranslate, 0); textGradient.setLocalMatrix(gradientMatrix); canvas.save(); - canvas.drawText(blockText, blockWidth + BLOCK_START_X + textMarginLeft, textOffset, textPaint); + canvas.drawText(blockText, (float) (blockWidth + BLOCK_START_X + textMarginLeft), (float) textOffset, textPaint); canvas.restore(); // 画滑块 - canvas.drawBitmap(bmBlock, BLOCK_START_X + blockOffset, BLOCK_START_Y, blockPaint); + canvas.drawBitmap(bmBlock, (float) (BLOCK_START_X + blockOffset), (float) BLOCK_START_Y, blockPaint); } public interface OnSlidePanelMoveToEndListener { diff --git a/OCH/shuttle/driver/src/main/res/layout/bus_base_fragment.xml b/OCH/shuttle/driver/src/main/res/layout/bus_base_fragment.xml index e89b252b9f..4ec7f643b1 100644 --- a/OCH/shuttle/driver/src/main/res/layout/bus_base_fragment.xml +++ b/OCH/shuttle/driver/src/main/res/layout/bus_base_fragment.xml @@ -6,10 +6,8 @@ android:layout_height="match_parent" android:layout_marginTop="@dimen/dp_72"> - @@ -370,24 +368,13 @@ app:layout_constraintRight_toRightOf="@id/btnAutopilotDisable" app:layout_constraintTop_toBottomOf="@id/btnAutopilotPingxing" /> -