[2.13.2]merge

This commit is contained in:
zhongchao
2022-12-23 17:56:46 +08:00
2038 changed files with 19032 additions and 44413 deletions

View File

@@ -6,15 +6,14 @@ import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentActivity;
import com.alibaba.android.arouter.facade.annotation.Route; import com.alibaba.android.arouter.facade.annotation.Route;
import com.elegant.utils.UiThreadHandler; import com.mogo.commons.module.status.IMogoStatusChangedListener;
import com.mogo.commons.module.status.MogoStatusManager;
import com.mogo.commons.module.status.StatusDescriptor;
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager; import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.map.MogoMapUIController; import com.mogo.map.MogoMapUIController;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.och.bus.passenger.constant.BusPassengerConst; import com.mogo.och.bus.passenger.constant.BusPassengerConst;
import com.mogo.och.bus.passenger.ui.BusPassengerRouteFragment; import com.mogo.och.bus.passenger.ui.BusPassengerRouteFragment;
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
import com.mogo.service.statusmanager.StatusDescriptor;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@@ -64,8 +63,7 @@ public class MogoOCHBusPassenger implements IMogoOCH, IMogoStatusChangedListener
@Override @Override
public void init(Context context) { public void init(Context context) {
MogoApisHandler.getInstance().getApis().getStatusManagerApi().registerStatusChangedListener("OchBus" MogoStatusManager.getInstance().registerStatusChangedListener("OchBus",StatusDescriptor.VR_MODE, this);
, StatusDescriptor.VR_MODE, this);
} }
@Override @Override
@@ -106,4 +104,5 @@ public class MogoOCHBusPassenger implements IMogoOCH, IMogoStatusChangedListener
mActivity.getSupportFragmentManager().beginTransaction().hide(mPassengerFragment).commitAllowingStateLoss(); mActivity.getSupportFragmentManager().beginTransaction().hide(mPassengerFragment).commitAllowingStateLoss();
} }
} }
} }

View File

@@ -1,6 +1,6 @@
package com.mogo.och.bus.passenger.callback; package com.mogo.och.bus.passenger.callback;
import android.location.Location; import com.mogo.eagle.core.data.map.MogoLocation;
/** /**
* Created on 2022/3/31 * Created on 2022/3/31
@@ -11,5 +11,5 @@ public interface IBusPassengerControllerStatusCallback {
// 是否vr map模式 // 是否vr map模式
void onVRModeChanged(boolean isVRMode); void onVRModeChanged(boolean isVRMode);
// 自车定位 // 自车定位
void onCarLocationChanged(Location location); void onCarLocationChanged(MogoLocation location);
} }

View File

@@ -39,7 +39,7 @@ class BusPassengerConst {
// 未到站(未到站) // 未到站(未到站)
const val STATION_STATUS_ARRIVING = 3 const val STATION_STATUS_ARRIVING = 3
//bus平均速度 //bus平均速度 bus的平均里程25km/h
const val BUS_AVERAGE_SPEED = 25 const val BUS_AVERAGE_SPEED = 25
// 订单总里程 // 订单总里程

View File

@@ -2,7 +2,6 @@ package com.mogo.och.bus.passenger.model;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.location.Location;
import android.net.ConnectivityManager; import android.net.ConnectivityManager;
import android.os.Handler; import android.os.Handler;
import android.os.Message; import android.os.Message;
@@ -11,23 +10,30 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.amap.api.maps.model.LatLng; import com.amap.api.maps.model.LatLng;
import com.mogo.aicloud.services.socket.IMogoLifecycleListener;
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager; import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager;
import com.mogo.cloud.commons.utils.CoordinateUtils; import com.mogo.cloud.commons.utils.CoordinateUtils;
import com.mogo.commons.debug.DebugConfig; import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.module.intent.IMogoIntentListener;
import com.mogo.commons.module.intent.IntentManager;
import com.mogo.commons.module.status.IMogoStatusChangedListener;
import com.mogo.commons.module.status.MogoStatusManager;
import com.mogo.commons.module.status.StatusDescriptor;
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo; import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
import com.mogo.eagle.core.data.config.FunctionBuildConfig; import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager;
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
import com.mogo.eagle.core.network.utils.GsonUtil; import com.mogo.eagle.core.network.utils.GsonUtil;
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils; import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr; import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
import com.mogo.eagle.core.utilcode.util.NetworkUtils; import com.mogo.eagle.core.utilcode.util.NetworkUtils;
import com.mogo.map.navi.IMogoCarLocationChangedListener2; import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.module.common.MogoApisHandler; import com.mogo.och.bus.passenger.R;
import com.mogo.och.bus.passenger.bean.BusPassengerOperationStatusResponse; import com.mogo.och.bus.passenger.bean.BusPassengerOperationStatusResponse;
import com.mogo.och.bus.passenger.bean.BusPassengerRoutesResponse; import com.mogo.och.bus.passenger.bean.BusPassengerRoutesResponse;
import com.mogo.och.bus.passenger.bean.BusPassengerRoutesResult; import com.mogo.och.bus.passenger.bean.BusPassengerRoutesResult;
@@ -41,11 +47,9 @@ import com.mogo.och.bus.passenger.constant.BusPassengerConst;
import com.mogo.och.bus.passenger.network.BusPassengerModelLoopManager; import com.mogo.och.bus.passenger.network.BusPassengerModelLoopManager;
import com.mogo.och.bus.passenger.network.BusPassengerServiceManager; import com.mogo.och.bus.passenger.network.BusPassengerServiceManager;
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback; import com.mogo.och.common.module.biz.network.OchCommonServiceCallback;
import com.mogo.och.common.module.manager.AbnormalFactorsLoopManager;
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil; import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
import com.mogo.service.intent.IMogoIntentListener; import com.mogo.och.common.module.utils.ToastUtilsOch;
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
import com.mogo.service.statusmanager.StatusDescriptor;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.util.ArrayList; import java.util.ArrayList;
@@ -67,7 +71,7 @@ import static com.mogo.och.bus.passenger.constant.BusPassengerConst.STATION_STAT
public class BusPassengerModel { public class BusPassengerModel {
private static final String TAG = BusPassengerModel.class.getSimpleName(); private static final String TAG = BusPassengerModel.class.getSimpleName();
private List<LatLng> mRoutePoints = new ArrayList<>(); private List<MogoLocation> mRoutePoints = new ArrayList<>();
private static final class SingletonHolder { private static final class SingletonHolder {
private static final BusPassengerModel INSTANCE = new BusPassengerModel(); private static final BusPassengerModel INSTANCE = new BusPassengerModel();
@@ -85,13 +89,15 @@ public class BusPassengerModel {
private IBusPassegerDriverStatusCallback mDriverStatusCallback; //出车收车状态 private IBusPassegerDriverStatusCallback mDriverStatusCallback; //出车收车状态
private IBusPassengerRouteLineInfoCallback mRouteLineInfoCallback; // bus路线信息更新 private IBusPassengerRouteLineInfoCallback mRouteLineInfoCallback; // bus路线信息更新
private double mLongitude, mLatitude; private MogoLocation mLocation = null;
private BusPassengerRoutesResult routesResult = null; private BusPassengerRoutesResult routesResult = null;
List<BusPassengerStation> mStations = new ArrayList<>(); List<BusPassengerStation> mStations = new ArrayList<>();
private int mNextStationIndex = 0;// 要到达站的index private int mNextStationIndex = 0;// 要到达站的index
private List<LatLng> mTwoStationsRouts = new ArrayList<>(); private List<MogoLocation> mTwoStationsRouts = new ArrayList<>();
private int mPreRouteIndex = 0;
private int mWipePreIndex = 0;
private static final int MSG_QUERY_BUS_P_STATION = 1001; private static final int MSG_QUERY_BUS_P_STATION = 1001;
private final Handler handler = new Handler(new Handler.Callback() { private final Handler handler = new Handler(new Handler.Callback() {
@@ -131,21 +137,31 @@ public class BusPassengerModel {
private void queryDriverOperationStatus() { private void queryDriverOperationStatus() {
BusPassengerServiceManager.queryDriverOperationStatus(mContext BusPassengerServiceManager.queryDriverOperationStatus(mContext
, new OchCommonServiceCallback<BusPassengerOperationStatusResponse>() { , new OchCommonServiceCallback<BusPassengerOperationStatusResponse>() {
@Override @Override
public void onSuccess(BusPassengerOperationStatusResponse data) { public void onSuccess(BusPassengerOperationStatusResponse data) {
if (data == null || data.data == null) return; if (data == null || data.data == null) return;
if(mDriverStatusCallback != null){ if (mDriverStatusCallback != null) {
mDriverStatusCallback.changeOperationStatus(data.data.driverStatus == 1); mDriverStatusCallback.changeOperationStatus(data.data.driverStatus == 1);
mDriverStatusCallback.updatePlateNumber(data.data.plateNumber); mDriverStatusCallback.updatePlateNumber(data.data.plateNumber);
} }
} }
@Override @Override
public void onFail(int code, String msg) { public void onError() {
//延迟3s再次查询 if (!NetworkUtils.isConnected(mContext)) {
queryDriverOperationDelay(); ToastUtils.showShort(mContext.getString(R.string.network_error_tip));
} } else {
}); ToastUtils.showShort(mContext.getString(R.string.request_error_tip));
}
queryDriverOperationDelay();
}
@Override
public void onFail(int code, String msg) {
//延迟3s再次查询
queryDriverOperationDelay();
}
});
} }
public void queryDriverSiteByCoordinate(){ public void queryDriverSiteByCoordinate(){
@@ -157,6 +173,7 @@ public class BusPassengerModel {
|| data.getResult() == null || data.getResult() == null
|| data.getResult().getSites() == null) { || data.getResult().getSites() == null) {
routesResult = null; routesResult = null;
mNextStationIndex = 0;
startOrStopCalculateRouteInfo(false); startOrStopCalculateRouteInfo(false);
if (mRouteLineInfoCallback != null){ if (mRouteLineInfoCallback != null){
mRouteLineInfoCallback.showNoTaskView(); mRouteLineInfoCallback.showNoTaskView();
@@ -170,14 +187,20 @@ public class BusPassengerModel {
updatePassengerRouteInfo(data.getResult()); updatePassengerRouteInfo(data.getResult());
} }
@Override
public void onError() {
}
@Override @Override
public void onFail(int code, String msg) { public void onFail(int code, String msg) {
//code = 1003; message = bus车辆已收车或未出车;bus driver shadow,not exists
if (code == 1003){ if (code == 1003){
routesResult = null; routesResult = null;
startOrStopCalculateRouteInfo(false); startOrStopCalculateRouteInfo(false);
queryDriverOperationDelay(); queryDriverOperationDelay();
return;
} }
CallerLogger.INSTANCE.d( M_BUS_P + TAG, "queryDriverSiteByCoordinate = %s", msg );
} }
}); });
} }
@@ -204,6 +227,7 @@ public class BusPassengerModel {
if (i == 0){ if (i == 0){
startOrStopRouteAndWipe(false); startOrStopRouteAndWipe(false);
} }
mPreRouteIndex = 0;
startOrStopCalculateRouteInfo(false); startOrStopCalculateRouteInfo(false);
mRouteLineInfoCallback.updateStationsInfo(stations,i,true); mRouteLineInfoCallback.updateStationsInfo(stations,i,true);
return; return;
@@ -242,46 +266,33 @@ public class BusPassengerModel {
} }
private void initListeners() { private void initListeners() {
MogoAiCloudSocketManager.getInstance(mContext)
.registerLifecycleListener(10010, mSocketLifeCycleLisnter);
// 2021.11.1重构自动驾驶 实现接口 IMoGoAutopilotStatusListener 注册监听 替换IMogoAdasOCHCallback接口 // 2021.11.1重构自动驾驶 实现接口 IMoGoAutopilotStatusListener 注册监听 替换IMogoAdasOCHCallback接口
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, mGoAutopilotStatusListener); CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, mGoAutopilotStatusListener);
MogoApisHandler.getInstance() IntentManager.getInstance().registerIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener );
.getApis() MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener );
.getIntentManagerApi() // 定位监听
.registerIntentListener( ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener ); CallerMapLocationListenerManager.INSTANCE.addListener(TAG, mMapLocationListener,false);
MogoApisHandler.getInstance()
.getApis()
.getStatusManagerApi()
.registerStatusChangedListener( TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener );
// 达到起始站围栏监听
MogoApisHandler.getInstance()
.getApis()
.getRegisterCenterApi()
.registerCarLocationChangedListener( TAG, mCarLocationChangedListener2);
//2021.11.1 自动驾驶路线规划接口 //2021.11.1 自动驾驶路线规划接口
CallerAutopilotPlanningListenerManager.INSTANCE.addListener(TAG,moGoAutopilotPlanningListener); CallerAutopilotPlanningListenerManager.INSTANCE.addListener(TAG,moGoAutopilotPlanningListener);
AbnormalFactorsLoopManager.INSTANCE.startLoopAbnormalFactors(mContext);
} }
private void releaseListeners() { private void releaseListeners() {
MogoApisHandler.getInstance() MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
.getApis()
.getStatusManagerApi()
.unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
// 注销到达起始站围栏监听 // 注销定位监听
MogoApisHandler.getInstance() CallerMapLocationListenerManager.INSTANCE.removeListener(TAG,false);
.getApis()
.getRegisterCenterApi()
.unregisterCarLocationChangedListener(TAG, mCarLocationChangedListener2);
MogoAiCloudSocketManager.getInstance(mContext) MogoAiCloudSocketManager.getInstance(mContext)
.unregisterLifecycleListener(10010); .unregisterLifecycleListener(10010);
CallerAutoPilotStatusListenerManager.INSTANCE.removeListener(mGoAutopilotStatusListener); CallerAutoPilotStatusListenerManager.INSTANCE.removeListener(mGoAutopilotStatusListener);
CallerAutopilotPlanningListenerManager.INSTANCE.removeListener(moGoAutopilotPlanningListener); CallerAutopilotPlanningListenerManager.INSTANCE.removeListener(moGoAutopilotPlanningListener);
AbnormalFactorsLoopManager.INSTANCE.stopLoopAbnormalFactors();
} }
//监听网络变化,避免启动机器时无网导致无法更新订单信息 //监听网络变化,避免启动机器时无网导致无法更新订单信息
@@ -297,40 +308,22 @@ public class BusPassengerModel {
} }
}; };
private final IMogoStatusChangedListener mMogoStatusChangedListener = new IMogoStatusChangedListener() { // VR mode变更回调
// VR mode变更回调 private final IMogoStatusChangedListener mMogoStatusChangedListener = (descriptor, isTrue) -> {
@Override if (StatusDescriptor.VR_MODE == descriptor) {
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) { if (mControllerStatusCallbackMap.size() > 0) {
if (StatusDescriptor.VR_MODE == descriptor) { for (IBusPassengerControllerStatusCallback callback :mControllerStatusCallbackMap.values()){
if (mControllerStatusCallbackMap.size() > 0) { callback.onVRModeChanged(isTrue);
for (IBusPassengerControllerStatusCallback callback :mControllerStatusCallbackMap.values()){
callback.onVRModeChanged(isTrue);
}
} }
} }
} }
}; };
private final IMogoLifecycleListener mSocketLifeCycleLisnter = new IMogoLifecycleListener() { private final IMoGoMapLocationListener mMapLocationListener = new IMoGoMapLocationListener() {
@Override @Override
public void onConnectFailure() { CallerLogger.INSTANCE.e(M_BUS_P + TAG,"socket onConnectFailure"); } public void onLocationChanged(@Nullable MogoLocation location, int from, boolean isGps) {
if (null == location) return;
@Override mLocation = location;
public void onConnectSuccess() { CallerLogger.INSTANCE.e(M_BUS_P + TAG,"socket onConnectSuccess"); }
@Override
public void onConnectLost() { CallerLogger.INSTANCE.e(M_BUS_P + TAG,"socket onConnectLost"); }
};
// 自车定位
private final IMogoCarLocationChangedListener2 mCarLocationChangedListener2 = new IMogoCarLocationChangedListener2() {
@Override
public void onCarLocationChanged2( Location location ) {
//位置变化时通过围栏判断是否到达x点
// TODO: 2022/3/31
mLongitude = location.getLongitude();
mLatitude = location.getLatitude();
for (IBusPassengerControllerStatusCallback callback :mControllerStatusCallbackMap.values()){ for (IBusPassengerControllerStatusCallback callback :mControllerStatusCallbackMap.values()){
callback.onCarLocationChanged(location); callback.onCarLocationChanged(location);
} }
@@ -425,8 +418,8 @@ public class BusPassengerModel {
public void updateRoutePoints(List<MessagePad.Location> routePoints){ public void updateRoutePoints(List<MessagePad.Location> routePoints){
mRoutePoints.clear(); mRoutePoints.clear();
List<LatLng> latLngModels = CoordinateCalculateRouteUtil List<MogoLocation> latLngModels = CoordinateCalculateRouteUtil
.coordinateConverterWgsToGcjListCommon(mContext,routePoints); .coordinateConverterWgsToGcjLocations(mContext,routePoints);
mRoutePoints.addAll(latLngModels); mRoutePoints.addAll(latLngModels);
calculateTwoStationsRoute(); calculateTwoStationsRoute();
} }
@@ -441,11 +434,15 @@ public class BusPassengerModel {
BusPassengerStation stationNext = mStations.get(mNextStationIndex); BusPassengerStation stationNext = mStations.get(mNextStationIndex);
BusPassengerStation stationCur = mStations.get(mNextStationIndex - 1); BusPassengerStation stationCur = mStations.get(mNextStationIndex - 1);
//当前站在轨迹中对应的点 //当前站在轨迹中对应的点
int currentRouteIndex = CoordinateCalculateRouteUtil.getArrivedPointIndex(mRoutePoints int currentRouteIndex = CoordinateCalculateRouteUtil.getArrivedPointIndexNew(0
,mRoutePoints
,stationCur.getGcjLon(),stationCur.getGcjLat()); ,stationCur.getGcjLon(),stationCur.getGcjLat());
//要前往的站在轨迹中对应的点 //要前往的站在轨迹中对应的点
int nextRouteIndex = CoordinateCalculateRouteUtil.getArrivedPointIndex(mRoutePoints int nextRouteIndex = CoordinateCalculateRouteUtil.getArrivedPointIndexNew(currentRouteIndex
,mRoutePoints
,stationNext.getGcjLon(),stationNext.getGcjLat()); ,stationNext.getGcjLon(),stationNext.getGcjLat());
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "currentRouteIndex = " + currentRouteIndex
+ " nextRouteIndex = " + nextRouteIndex);
if (currentRouteIndex < nextRouteIndex){ //如果找到的next在起点的轨迹前面直接舍弃这个轨迹不显示 if (currentRouteIndex < nextRouteIndex){ //如果找到的next在起点的轨迹前面直接舍弃这个轨迹不显示
mTwoStationsRouts.addAll(mRoutePoints.subList(currentRouteIndex,nextRouteIndex)); mTwoStationsRouts.addAll(mRoutePoints.subList(currentRouteIndex,nextRouteIndex));
} }
@@ -470,22 +467,28 @@ public class BusPassengerModel {
if (mTwoStationsRouts.size() == 0){ if (mTwoStationsRouts.size() == 0){
calculateTwoStationsRoute(); calculateTwoStationsRoute();
} }
if (mTwoStationsRouts.size() > 0){ if (mTwoStationsRouts.size() > 0 && mLocation != null){
List<LatLng> lastPoints = CoordinateCalculateRouteUtil Map<Integer,List<MogoLocation>> lastPointsMap = CoordinateCalculateRouteUtil
.getRemainPointListByCompare(mTwoStationsRouts,mLongitude,mLatitude); .getRemainPointListByCompareNew(mPreRouteIndex,mTwoStationsRouts,mLocation);
for (int index: lastPointsMap.keySet()) {
float lastSumLength = 0; mPreRouteIndex = index;
if (lastPoints.size() == 1){ //只是最后一个点,计算当前位置和最后一个点的距离 break;
lastSumLength = CoordinateUtils.calculateLineDistance(
lastPoints.get(0).longitude, lastPoints.get(0).latitude,
mLongitude, mLatitude);
}else {
lastSumLength = CoordinateCalculateRouteUtil.calculateRouteSumLength(lastPoints);
} }
double lastTime = lastSumLength / BusPassengerConst.BUS_AVERAGE_SPEED * 3.6 ; //秒
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "lastSumLength = " + lastSumLength); for (List<MogoLocation> lastPoints: lastPointsMap.values()){
if (mAutopilotPlanningCallback != null){ float lastSumLength = 0;
mAutopilotPlanningCallback.routePlanningToNextStationChanged((long)lastSumLength,(long) lastTime); if (lastPoints.size() == 1){ //只是最后一个点,计算当前位置和最后一个点的距离
lastSumLength = CoordinateUtils.calculateLineDistance(
lastPoints.get(0).getLongitude(), lastPoints.get(0).getLatitude(),
mLocation.getLongitude(), mLocation.getLatitude());
}else {
lastSumLength = CoordinateCalculateRouteUtil.calculateRouteSumLength(lastPoints);
}
double lastTime = lastSumLength / BusPassengerConst.BUS_AVERAGE_SPEED * 3.6 ; //秒
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "lastSumLength = " + lastSumLength);
if (mAutopilotPlanningCallback != null){
mAutopilotPlanningCallback.routePlanningToNextStationChanged((long)lastSumLength,(long) lastTime);
}
} }
} }
} }
@@ -507,18 +510,25 @@ public class BusPassengerModel {
if (isStart){ if (isStart){
BusPassengerModelLoopManager.getInstance().startOrStopRouteAndWipe(); BusPassengerModelLoopManager.getInstance().startOrStopRouteAndWipe();
}else { }else {
mWipePreIndex = 0;
BusPassengerModelLoopManager.getInstance().stopOrStopRouteAndWipe(); BusPassengerModelLoopManager.getInstance().stopOrStopRouteAndWipe();
} }
} }
public void loopRouteAndWipe() { public void loopRouteAndWipe() {
if (mRoutePoints != null && mRoutePoints.size() > 0){ if (mRoutePoints != null && mRoutePoints.size() > 0 && mLocation != null){
int haveArrivedIndex = CoordinateCalculateRouteUtil int haveArrivedIndex = CoordinateCalculateRouteUtil
.getArrivedPointIndex(mRoutePoints,mLongitude,mLatitude); .getArrivedPointIndexNew(mWipePreIndex,
mRoutePoints,
mLocation);
mWipePreIndex = haveArrivedIndex;
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "thread = "+ Thread.currentThread().getName()+" haveArrivedIndex== " + haveArrivedIndex); CallerLogger.INSTANCE.d(M_BUS_P + TAG, "thread = "+ Thread.currentThread().getName()+" haveArrivedIndex== " + haveArrivedIndex);
if (mAutopilotPlanningCallback != null){ if (mAutopilotPlanningCallback != null){
mAutopilotPlanningCallback.routeResult(mRoutePoints,haveArrivedIndex); List<LatLng> routePoints = CoordinateCalculateRouteUtil
.coordinateConverterLocationToLatLng(mContext,mRoutePoints);
mAutopilotPlanningCallback.routeResult(routePoints,haveArrivedIndex);
} }
} }
} }
@@ -527,8 +537,10 @@ public class BusPassengerModel {
* 设置小地图路径的起终点marker * 设置小地图路径的起终点marker
*/ */
public void setRouteLineMarker(){ public void setRouteLineMarker(){
if (mAutopilotPlanningCallback != null){ if (mAutopilotPlanningCallback != null && mRoutePoints != null){
mAutopilotPlanningCallback.setLineMarker(mRoutePoints); List<LatLng> routePoints = CoordinateCalculateRouteUtil
.coordinateConverterLocationToLatLng(mContext,mRoutePoints);
mAutopilotPlanningCallback.setLineMarker(routePoints);
} }
} }

View File

@@ -9,6 +9,7 @@ import androidx.lifecycle.LifecycleOwner;
import com.amap.api.maps.model.LatLng; import com.amap.api.maps.model.LatLng;
import com.mogo.commons.AbsMogoApplication; import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.mvp.Presenter; import com.mogo.commons.mvp.Presenter;
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.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler; import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
@@ -109,7 +110,7 @@ public class BaseBusPassengerPresenter extends Presenter<BusPassengerRouteFragme
} }
@Override @Override
public void onCarLocationChanged(Location location) { public void onCarLocationChanged(MogoLocation location) {
if (location != null){ if (location != null){
runOnUIThread(() -> mView.onCarLocationChanged(location)); runOnUIThread(() -> mView.onCarLocationChanged(location));
} }

View File

@@ -56,9 +56,8 @@ public class BusPassengerMapDirectionView
private int mCurrentIndex = -1; private int mCurrentIndex = -1;
private int zoomLevel = 13; private List<LatLng> mCoordinatesLatLng = new ArrayList<>(); //轨迹坐标数据
private List<LatLng> mCoordinatesLatLng = new ArrayList<>(); //站点坐标数据 private List<LatLng> mLineStationLatLng = new ArrayList<>();//站点坐标数据
private List<LatLng> mLinePointsLatLng = new ArrayList<>(); //轨迹坐标数据
private Polyline mPolyline; private Polyline mPolyline;
private CameraUpdate mCameraUpdate; private CameraUpdate mCameraUpdate;
private Context mContext; private Context mContext;
@@ -197,24 +196,27 @@ public class BusPassengerMapDirectionView
mCarMarker.setToTop(); mCarMarker.setToTop();
} }
if (mLinePointsLatLng.size() > 0){ //圈定地图显示范围
//圈定地图显示范围 LatLngBounds.Builder boundsBuilder = new LatLngBounds.Builder();
//存放经纬度
LatLngBounds.Builder boundsBuilder = new LatLngBounds.Builder();
for (int i = 0; i < mLinePointsLatLng.size(); i++) {
boundsBuilder.include(mLinePointsLatLng.get(i));
}
boundsBuilder.include(currentLatLng);
//第二个参数为四周留空宽度
mAMap.moveCamera(CameraUpdateFactory.newLatLngBoundsRect(boundsBuilder.build(),100,100,100,100));
} // if (mLineStationLatLng.size() > 0){
// else { // //存放经纬度
// //设置希望展示的地图缩放级别 // for (int i = 0; i < mLineStationLatLng.size(); i++) {
// CameraPosition cameraPosition = new CameraPosition.Builder() // boundsBuilder.include(mLineStationLatLng.get(i));
// .target(mCarMarker.getPosition()).tilt(0).bearing(location.getBearing()).zoom(zoomLevel).build(); // }
// mAMap.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition)); // //第二个参数为四周留空宽度
// } // }
if (mCoordinatesLatLng.size() > 0){
//存放经纬度
for (int i = 0; i < mCoordinatesLatLng.size(); i++) {
boundsBuilder.include(mCoordinatesLatLng.get(i));
}
//第二个参数为四周留空宽度
}
boundsBuilder.include(currentLatLng);
mAMap.moveCamera(CameraUpdateFactory.newLatLngBoundsRect(boundsBuilder.build(),100,100,100,100));
} }
@@ -227,9 +229,9 @@ public class BusPassengerMapDirectionView
if (mAMap != null) { if (mAMap != null) {
addRouteColorList(); addRouteColorList();
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "mLinePointsLatLng.size() = " +mLinePointsLatLng.size()); CallerLogger.INSTANCE.d(M_BUS_P + TAG, "mLinePointsLatLng.size() = " +mLineStationLatLng.size()
if (mLinePointsLatLng.size() >= 2 && mCoordinatesLatLng.size() > 2) { +" mCoordinatesLatLng.size()= " + mCoordinatesLatLng.size());
if (mLineStationLatLng.size() >= 2 && mCoordinatesLatLng.size() > 2) {
//设置线段纹理 //设置线段纹理
PolylineOptions polylineOptions = new PolylineOptions(); PolylineOptions polylineOptions = new PolylineOptions();
polylineOptions.addAll(mCoordinatesLatLng); polylineOptions.addAll(mCoordinatesLatLng);
@@ -302,7 +304,7 @@ public class BusPassengerMapDirectionView
textureList.clear(); textureList.clear();
texIndexList.clear(); texIndexList.clear();
mCoordinatesLatLng.clear(); mCoordinatesLatLng.clear();
mLinePointsLatLng.clear(); mLineStationLatLng.clear();
CallerLogger.INSTANCE.d(M_BUS_P + TAG, " mCoordinatesLatLng.clear " ); CallerLogger.INSTANCE.d(M_BUS_P + TAG, " mCoordinatesLatLng.clear " );
} }
@@ -350,16 +352,16 @@ public class BusPassengerMapDirectionView
mLineMarkers.clear(); mLineMarkers.clear();
} }
public void setLineMarkersAndDraw(List<LatLng> lineineLatLngs){ public void setLineMarkersAndDraw(List<LatLng> stationLatLngs){
clearLineMarkers(); clearLineMarkers();
for (int i = 0; i < lineineLatLngs.size(); i++) { for (int i = 0; i < stationLatLngs.size(); i++) {
Marker mWayPointMarker = mAMap.addMarker(new MarkerOptions() Marker mWayPointMarker = mAMap.addMarker(new MarkerOptions()
.icon(BitmapDescriptorFactory.fromResource(R.drawable.bus_p_map_view_dir_way_point))); .icon(BitmapDescriptorFactory.fromResource(R.drawable.bus_p_map_view_dir_way_point)));
mLineMarkers.add(mWayPointMarker); mLineMarkers.add(mWayPointMarker);
} }
if (mCoordinatesLatLng.size() == 0) { if (mCoordinatesLatLng.size() == 0) {
for (int i = 0; i < mLineMarkers.size(); i++) { for (int i = 0; i < mLineMarkers.size(); i++) {
mLineMarkers.get(i).setPosition(lineineLatLngs.get(i)); mLineMarkers.get(i).setPosition(stationLatLngs.get(i));
mLineMarkers.get(i).setVisible(true); mLineMarkers.get(i).setVisible(true);
} }
mCurrentIndex = -1; mCurrentIndex = -1;
@@ -367,15 +369,15 @@ public class BusPassengerMapDirectionView
} }
public void setLinePointMarkerAndDraw(List<LatLng> routeLineLatLngs, int currentIndex) { public void setLinePointMarkerAndDraw(List<LatLng> routeLineLatLngs, int currentIndex) {
mLinePointsLatLng.clear(); mLineStationLatLng.clear();
mLinePointsLatLng.addAll(routeLineLatLngs); mLineStationLatLng.addAll(routeLineLatLngs);
if (mLinePointsLatLng.size() > 0 && mCurrentIndex != currentIndex) { if (mLineStationLatLng.size() > 0 && mCurrentIndex != currentIndex) {
if (mAMap != null && mLineMarkers.size() > 0) { if (mAMap != null && mLineMarkers.size() > 0) {
mCurrentIndex = currentIndex; mCurrentIndex = currentIndex;
for (int i = 0; i < mLineMarkers.size(); i++) { for (int i = 0; i < mLineMarkers.size(); i++) {
if (i != currentIndex && i + 1 != currentIndex) { if (i != currentIndex && i + 1 != currentIndex) {
mLineMarkers.get(i).setPosition(mLinePointsLatLng.get(i)); mLineMarkers.get(i).setPosition(mLineStationLatLng.get(i));
mLineMarkers.get(i).setVisible(true); mLineMarkers.get(i).setVisible(true);
} else { } else {
mLineMarkers.get(i).setVisible(false); mLineMarkers.get(i).setVisible(false);

View File

@@ -1,6 +1,5 @@
package com.mogo.och.bus.passenger.ui; package com.mogo.och.bus.passenger.ui;
import android.location.Location;
import android.os.Bundle; import android.os.Bundle;
import android.view.View; import android.view.View;
import android.view.animation.Animation; import android.view.animation.Animation;
@@ -15,6 +14,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.amap.api.maps.model.LatLng; import com.amap.api.maps.model.LatLng;
import com.elegant.utils.UiThreadHandler; import com.elegant.utils.UiThreadHandler;
import com.mogo.commons.debug.DebugConfig; import com.mogo.commons.debug.DebugConfig;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager; import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr; import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
@@ -46,7 +46,7 @@ public class BusPassengerRouteFragment extends
private BusPassengerTrafficLightView mTrafficLightView; private BusPassengerTrafficLightView mTrafficLightView;
private List<BusPassengerStation> mStationsList = new ArrayList<>(); private List<BusPassengerStation> mStationsList = new ArrayList<>();
private List<LatLng> mLinePointsList = new ArrayList<>(); private List<LatLng> mLineStationsList = new ArrayList<>();
private TextView mSpeedTv; private TextView mSpeedTv;
private ConstraintLayout mNoLineInfoView; private ConstraintLayout mNoLineInfoView;
@@ -298,19 +298,19 @@ public class BusPassengerRouteFragment extends
} }
private void updateWayPointList(List<BusPassengerStation> stations,int currentStationIndex) { private void updateWayPointList(List<BusPassengerStation> stations,int currentStationIndex) {
mLinePointsList.clear(); mLineStationsList.clear();
for (int i = 0; i< stations.size(); i++) {//站点集合 for (int i = 0; i< stations.size(); i++) {//站点集合
LatLng latLng = CoordinateCalculateRouteUtil.coordinateConverterWgsToGcj(getContext() LatLng latLng = CoordinateCalculateRouteUtil.coordinateConverterWgsToGcj(getContext()
,stations.get(i).getLon(),stations.get(i).getLat());// lat,lon ,stations.get(i).getLon(),stations.get(i).getLat());// lat,lon
mLinePointsList.add(latLng); mLineStationsList.add(latLng);
} }
setLineMarkers(mLinePointsList); setLineMarkers(mLineStationsList);
if (mMapDirectionView != null) { if (mMapDirectionView != null) {
UiThreadHandler.post(new Runnable() { UiThreadHandler.post(new Runnable() {
@Override @Override
public void run() { public void run() {
mMapDirectionView.setLinePointMarkerAndDraw(mLinePointsList,currentStationIndex); mMapDirectionView.setLinePointMarkerAndDraw(mLineStationsList,currentStationIndex);
} }
}); });
} }
@@ -337,7 +337,7 @@ public class BusPassengerRouteFragment extends
lastBearing = bearing; lastBearing = bearing;
} }
public void onCarLocationChanged(Location location) { public void onCarLocationChanged(MogoLocation location) {
updateSpeedView(location.getSpeed()); updateSpeedView(location.getSpeed());
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 494 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 505 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 765 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 879 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 842 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 996 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 632 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 594 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 475 B

After

Width:  |  Height:  |  Size: 765 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 494 B

After

Width:  |  Height:  |  Size: 797 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 505 B

After

Width:  |  Height:  |  Size: 795 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 996 B

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 632 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -38,8 +38,8 @@
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:shadowColor="@color/bus_p_panel_edge_shadow" app:shadowColor="@color/bus_p_panel_edge_shadow"
app:shadowRadius="@dimen/dp_30" app:shadowRadius="@dimen/dp_30"
app:xOffset="0px" app:xOffset="0dp"
app:yOffset="0px"> app:yOffset="0dp">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="@dimen/bus_p_curent_station_panel_width" android:layout_width="@dimen/bus_p_curent_station_panel_width"
@@ -76,8 +76,8 @@
app:layout_constraintLeft_toLeftOf="@+id/bus_p_cur_station_title" app:layout_constraintLeft_toLeftOf="@+id/bus_p_cur_station_title"
app:layout_constraintTop_toBottomOf="@+id/bus_p_cur_station_title" /> app:layout_constraintTop_toBottomOf="@+id/bus_p_cur_station_title" />
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:layout_width="wrap_content" android:layout_width="@dimen/dp_20"
android:layout_height="wrap_content" android:layout_height="@dimen/dp_27"
app:layout_constraintTop_toTopOf="@+id/bus_p_cur_station_name" app:layout_constraintTop_toTopOf="@+id/bus_p_cur_station_name"
app:layout_constraintBottom_toBottomOf="@+id/bus_p_cur_station_name" app:layout_constraintBottom_toBottomOf="@+id/bus_p_cur_station_name"
app:layout_constraintRight_toLeftOf="@+id/bus_p_cur_station_name" app:layout_constraintRight_toLeftOf="@+id/bus_p_cur_station_name"
@@ -123,8 +123,8 @@
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<ImageView <ImageView
android:layout_width="wrap_content" android:layout_width="@dimen/dp_299"
android:layout_height="wrap_content" android:layout_height="@dimen/dp_75"
android:layout_marginRight="@dimen/dp_40" android:layout_marginRight="@dimen/dp_40"
android:layout_marginBottom="@dimen/dp_48" android:layout_marginBottom="@dimen/dp_48"
android:src="@drawable/bus_p_mogo_nor" android:src="@drawable/bus_p_mogo_nor"

View File

@@ -8,8 +8,8 @@
<ImageView <ImageView
android:id="@+id/no_order_data_iv" android:id="@+id/no_order_data_iv"
android:layout_width="wrap_content" android:layout_width="@dimen/dp_386"
android:layout_height="wrap_content" android:layout_height="@dimen/dp_350"
android:src="@drawable/bus_p_no_order_data" android:src="@drawable/bus_p_no_order_data"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
@@ -20,7 +20,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/bus_p_no_data_color" android:textColor="@color/bus_p_no_data_color"
android:textSize="@dimen/bus_p_no_data_size" android:textSize="@dimen/bus_p_no_data_size"
android:layout_marginTop="50px" android:layout_marginTop="50dp"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/no_order_data_iv" app:layout_constraintTop_toBottomOf="@+id/no_order_data_iv"

View File

@@ -7,11 +7,11 @@
<com.mogo.och.common.module.wigets.OCHBorderShadowLayout <com.mogo.och.common.module.wigets.OCHBorderShadowLayout
android:id="@+id/edge_view" android:id="@+id/edge_view"
android:layout_width="725px" android:layout_width="725dp"
android:layout_height="match_parent" android:layout_height="match_parent"
app:shadowColor="@color/bus_p_route_view_left_edge_shadow" app:shadowColor="@color/bus_p_route_view_left_edge_shadow"
app:xOffset="0px" app:xOffset="0dp"
app:yOffset="0px" app:yOffset="0dp"
app:bgColor="@android:color/transparent" app:bgColor="@android:color/transparent"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent">
@@ -107,7 +107,7 @@
<com.mogo.och.common.module.wigets.MarqueeTextView <com.mogo.och.common.module.wigets.MarqueeTextView
android:id="@+id/bus_p_line_name_tv" android:id="@+id/bus_p_line_name_tv"
android:layout_width="0px" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20" android:layout_marginLeft="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20" android:layout_marginRight="@dimen/dp_20"
@@ -124,7 +124,7 @@
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@+id/bus_p_driver_num_plate_tv" app:layout_constraintTop_toTopOf="@+id/bus_p_driver_num_plate_tv"
app:layout_constraintBottom_toBottomOf="@+id/bus_p_driver_num_plate_tv" app:layout_constraintBottom_toBottomOf="@+id/bus_p_driver_num_plate_tv"
app:layout_goneMarginLeft="0px" /> app:layout_goneMarginLeft="0dp" />
<TextView <TextView
android:id="@+id/line_operation_time_tv" android:id="@+id/line_operation_time_tv"
@@ -169,8 +169,8 @@
<ImageView <ImageView
android:id="@+id/bus_p_arrow_nor" android:id="@+id/bus_p_arrow_nor"
android:layout_width="wrap_content" android:layout_width="@dimen/dp_108"
android:layout_height="wrap_content" android:layout_height="@dimen/dp_107"
android:layout_marginRight="@dimen/dp_20" android:layout_marginRight="@dimen/dp_20"
android:layout_marginBottom="@dimen/dp_370" android:layout_marginBottom="@dimen/dp_370"
android:src="@drawable/bus_p_arrow_nor" android:src="@drawable/bus_p_arrow_nor"

View File

@@ -25,8 +25,8 @@
app:layout_constraintTop_toBottomOf="@+id/bus_p_cur_arrow_bg"/> app:layout_constraintTop_toBottomOf="@+id/bus_p_cur_arrow_bg"/>
<ImageView <ImageView
android:layout_width="62px" android:layout_width="62dp"
android:layout_height="62px" android:layout_height="62dp"
android:src="@drawable/bus_p_point_gray" android:src="@drawable/bus_p_point_gray"
app:layout_constraintTop_toTopOf="@+id/bus_p_circle" app:layout_constraintTop_toTopOf="@+id/bus_p_circle"
app:layout_constraintBottom_toBottomOf="@+id/bus_p_circle" app:layout_constraintBottom_toBottomOf="@+id/bus_p_circle"
@@ -35,18 +35,18 @@
<ImageView <ImageView
android:id="@+id/bus_p_circle" android:id="@+id/bus_p_circle"
android:layout_width="wrap_content" android:layout_width="62dp"
android:layout_height="wrap_content" android:layout_height="62dp"
android:src="@drawable/bus_p_point_blue" android:src="@drawable/bus_p_point_blue"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="@+id/bus_p_station" app:layout_constraintTop_toTopOf="@+id/bus_p_station"
app:layout_constraintBottom_toBottomOf="@+id/bus_p_station"/> app:layout_constraintBottom_toBottomOf="@+id/bus_p_station"/>
<ImageView <ImageView
android:id="@+id/bus_p_cur_arrow_bg" android:id="@+id/bus_p_cur_arrow_bg"
android:layout_width="wrap_content" android:layout_width="@dimen/dp_12"
android:layout_height="wrap_content" android:layout_height="@dimen/dp_61"
android:scaleType="fitXY" android:scaleType="fitXY"
android:layout_marginLeft="8px" android:layout_marginLeft="8dp"
android:src="@drawable/bus_p_line_blue" android:src="@drawable/bus_p_line_blue"
app:layout_constraintLeft_toLeftOf="@+id/bus_p_circle" app:layout_constraintLeft_toLeftOf="@+id/bus_p_circle"
app:layout_constraintRight_toRightOf="@+id/bus_p_circle" app:layout_constraintRight_toRightOf="@+id/bus_p_circle"

View File

@@ -1,60 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="bus_p_route_info_panel_width">700px</dimen>
<dimen name="bus_p_route_info_margin_right">40px</dimen>
<dimen name="bus_p_route_info_margin_left">40px</dimen>
<dimen name="bus_p_route_info_margin_bottom">40px</dimen>
<dimen name="bus_p_route_info_margin_top">110px</dimen>
<dimen name="bus_p_route_line_info_height">224px</dimen>
<dimen name="bus_p_route_line_map_view_height">510px</dimen>
<dimen name="bus_p_route_line_dividing_view_height">3px</dimen>
<dimen name="bus_p_route_traffic_light_view_width">158px</dimen>
<dimen name="bus_p_route_traffic_light_view_height">90px</dimen>
<dimen name="bus_p_route_traffic_light_view_corner">45px</dimen>
<dimen name="bus_p_traffic_light_bg_width">158px</dimen>
<dimen name="bus_p_traffic_light_bg_height">90px</dimen>
<dimen name="bus_p_traffic_light_time_size">45px</dimen>
<dimen name="bus_p_traffic_light_time_view_width">90px</dimen>
<dimen name="bus_p_traffic_light_icon_size">90px</dimen>
<dimen name="bus_p_traffic_light_bg_stroke_width">3px</dimen>
<dimen name="bus_p_route_dividing_line2_margin_top">224px</dimen>
<dimen name="bus_p_driver_number_plate_margin_top">50px</dimen>
<dimen name="bus_p_driver_number_plate_margin_bottom">50px</dimen>
<dimen name="bus_p_driver_number_plate_size">44px</dimen>
<dimen name="bus_p_line_operation_time_margin_top">130px</dimen>
<dimen name="bus_p_line_operation_time_size">38px</dimen>
<dimen name="bus_p_no_data_size">36px</dimen>
<dimen name="bus_p_speed_txt_size">110px</dimen>
<dimen name="bus_p_speed_unit_txt_size">42px</dimen>
<dimen name="bus_p_station_circle_borner_size">4px</dimen>
<dimen name="bus_p_station_circle_radius_size">10px</dimen>
<dimen name="bus_p_station_circle_width_height">20px</dimen>
<dimen name="bus_p_station_tag_width_height">60px</dimen>
<dimen name="bus_p_station_tag_radius_size">30px</dimen>
<dimen name="bus_p_cur_station_circle_width">20px</dimen>
<dimen name="bus_p_cur_station_circle_height">50px</dimen>
<dimen name="bus_p_mid_station_circle_cor">6px</dimen>
<dimen name="bus_p_station_txt_size">50px</dimen>
<dimen name="bus_p_station_tag_txt_size">36px</dimen>
<dimen name="bus_p_station_item_height">80px</dimen>
<dimen name="bus_p_station_item_middle_height">100px</dimen>
<dimen name="bus_p_station_tag_line_height">80px</dimen>
<dimen name="bus_p_station_tag_line_height1">60px</dimen>
<dimen name="bus_p_station_tag_line_width">6px</dimen>
<dimen name="bus_p_curent_station_panel_width">685px</dimen>
<dimen name="bus_p_curent_station_panel_height">309px</dimen>
<dimen name="bus_p_curent_station_panel_margin">50px</dimen>
<dimen name="bus_p_curent_station_panel_margin_left">10px</dimen>
<dimen name="bus_p_curent_station_txt_size">44px</dimen>
<dimen name="bus_p_curent_station_txt_size1">55px</dimen>
<dimen name="bus_p_curent_station_tip_size1">40px</dimen>
<dimen name="bus_p_curent_station_txt_width">584px</dimen>
<dimen name="bus_p_station_txt_width">550px</dimen>
</resources>

View File

@@ -1,61 +1,61 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<dimen name="bus_p_route_info_panel_width">700px</dimen> <dimen name="bus_p_route_info_panel_width">700dp</dimen>
<dimen name="bus_p_auto_icon_margin_top">40px</dimen> <dimen name="bus_p_auto_icon_margin_top">40dp</dimen>
<dimen name="bus_p_route_info_margin_right">40px</dimen> <dimen name="bus_p_route_info_margin_right">40dp</dimen>
<dimen name="bus_p_route_info_margin_left">40px</dimen> <dimen name="bus_p_route_info_margin_left">40dp</dimen>
<dimen name="bus_p_route_info_margin_bottom">40px</dimen> <dimen name="bus_p_route_info_margin_bottom">40dp</dimen>
<dimen name="bus_p_route_info_margin_top">110px</dimen> <dimen name="bus_p_route_info_margin_top">110dp</dimen>
<dimen name="bus_p_route_line_info_height">224px</dimen> <dimen name="bus_p_route_line_info_height">224dp</dimen>
<dimen name="bus_p_route_line_map_view_height">510px</dimen> <dimen name="bus_p_route_line_map_view_height">510dp</dimen>
<dimen name="bus_p_route_line_dividing_view_height">3px</dimen> <dimen name="bus_p_route_line_dividing_view_height">3dp</dimen>
<dimen name="bus_p_route_traffic_light_view_width">158px</dimen> <dimen name="bus_p_route_traffic_light_view_width">158dp</dimen>
<dimen name="bus_p_route_traffic_light_view_height">90px</dimen> <dimen name="bus_p_route_traffic_light_view_height">90dp</dimen>
<dimen name="bus_p_route_traffic_light_view_corner">45px</dimen> <dimen name="bus_p_route_traffic_light_view_corner">45dp</dimen>
<dimen name="bus_p_traffic_light_bg_width">158px</dimen> <dimen name="bus_p_traffic_light_bg_width">158dp</dimen>
<dimen name="bus_p_traffic_light_bg_height">90px</dimen> <dimen name="bus_p_traffic_light_bg_height">90dp</dimen>
<dimen name="bus_p_traffic_light_time_size">45px</dimen> <dimen name="bus_p_traffic_light_time_size">45dp</dimen>
<dimen name="bus_p_traffic_light_time_view_width">90px</dimen> <dimen name="bus_p_traffic_light_time_view_width">90dp</dimen>
<dimen name="bus_p_traffic_light_icon_size">90px</dimen> <dimen name="bus_p_traffic_light_icon_size">90dp</dimen>
<dimen name="bus_p_traffic_light_bg_stroke_width">3px</dimen> <dimen name="bus_p_traffic_light_bg_stroke_width">3dp</dimen>
<dimen name="bus_p_route_dividing_line2_margin_top">224px</dimen> <dimen name="bus_p_route_dividing_line2_margin_top">224dp</dimen>
<dimen name="bus_p_driver_number_plate_margin_top">50px</dimen> <dimen name="bus_p_driver_number_plate_margin_top">50dp</dimen>
<dimen name="bus_p_driver_number_plate_margin_bottom">50px</dimen> <dimen name="bus_p_driver_number_plate_margin_bottom">50dp</dimen>
<dimen name="bus_p_driver_number_plate_size">44px</dimen> <dimen name="bus_p_driver_number_plate_size">44dp</dimen>
<dimen name="bus_p_line_operation_time_margin_top">130px</dimen> <dimen name="bus_p_line_operation_time_margin_top">130dp</dimen>
<dimen name="bus_p_line_operation_time_size">38px</dimen> <dimen name="bus_p_line_operation_time_size">38dp</dimen>
<dimen name="bus_p_no_data_size">36px</dimen> <dimen name="bus_p_no_data_size">36dp</dimen>
<dimen name="bus_p_speed_txt_size">110px</dimen> <dimen name="bus_p_speed_txt_size">110dp</dimen>
<dimen name="bus_p_speed_unit_txt_size">42px</dimen> <dimen name="bus_p_speed_unit_txt_size">42dp</dimen>
<dimen name="bus_p_station_circle_borner_size">4px</dimen> <dimen name="bus_p_station_circle_borner_size">4dp</dimen>
<dimen name="bus_p_station_circle_radius_size">10px</dimen> <dimen name="bus_p_station_circle_radius_size">10dp</dimen>
<dimen name="bus_p_station_circle_width_height">20px</dimen> <dimen name="bus_p_station_circle_width_height">20dp</dimen>
<dimen name="bus_p_station_tag_width_height">60px</dimen> <dimen name="bus_p_station_tag_width_height">60dp</dimen>
<dimen name="bus_p_station_tag_radius_size">30px</dimen> <dimen name="bus_p_station_tag_radius_size">30dp</dimen>
<dimen name="bus_p_cur_station_circle_width">20px</dimen> <dimen name="bus_p_cur_station_circle_width">20dp</dimen>
<dimen name="bus_p_cur_station_circle_height">50px</dimen> <dimen name="bus_p_cur_station_circle_height">50dp</dimen>
<dimen name="bus_p_mid_station_circle_cor">6px</dimen> <dimen name="bus_p_mid_station_circle_cor">6dp</dimen>
<dimen name="bus_p_station_txt_size">50px</dimen> <dimen name="bus_p_station_txt_size">50dp</dimen>
<dimen name="bus_p_station_tag_txt_size">36px</dimen> <dimen name="bus_p_station_tag_txt_size">36dp</dimen>
<dimen name="bus_p_station_item_height">80px</dimen> <dimen name="bus_p_station_item_height">80dp</dimen>
<dimen name="bus_p_station_item_middle_height">100px</dimen> <dimen name="bus_p_station_item_middle_height">100dp</dimen>
<dimen name="bus_p_station_tag_line_height">80px</dimen> <dimen name="bus_p_station_tag_line_height">80dp</dimen>
<dimen name="bus_p_station_tag_line_height1">60px</dimen> <dimen name="bus_p_station_tag_line_height1">60dp</dimen>
<dimen name="bus_p_station_tag_line_width">6px</dimen> <dimen name="bus_p_station_tag_line_width">6dp</dimen>
<dimen name="bus_p_curent_station_panel_width">638px</dimen> <dimen name="bus_p_curent_station_panel_width">685dp</dimen>
<dimen name="bus_p_curent_station_panel_height">316px</dimen> <dimen name="bus_p_curent_station_panel_height">309dp</dimen>
<dimen name="bus_p_curent_station_panel_margin">38px</dimen> <dimen name="bus_p_curent_station_panel_margin">50dp</dimen>
<dimen name="bus_p_curent_station_panel_margin_left">10px</dimen> <dimen name="bus_p_curent_station_panel_margin_left">10dp</dimen>
<dimen name="bus_p_curent_station_txt_size">44px</dimen> <dimen name="bus_p_curent_station_txt_size">44dp</dimen>
<dimen name="bus_p_curent_station_txt_size1">55px</dimen> <dimen name="bus_p_curent_station_txt_size1">55dp</dimen>
<dimen name="bus_p_curent_station_tip_size1">40px</dimen> <dimen name="bus_p_curent_station_tip_size1">40dp</dimen>
<dimen name="bus_p_curent_station_txt_width">584px</dimen> <dimen name="bus_p_curent_station_txt_width">584dp</dimen>
<dimen name="bus_p_station_txt_width">550px</dimen> <dimen name="bus_p_station_txt_width">550dp</dimen>
</resources> </resources>

View File

@@ -10,13 +10,13 @@ import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentManager;
import com.alibaba.android.arouter.facade.annotation.Route; import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.commons.module.status.IMogoStatusChangedListener;
import com.mogo.commons.module.status.MogoStatusManager;
import com.mogo.commons.module.status.StatusDescriptor;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.map.MogoMapUIController; import com.mogo.map.MogoMapUIController;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.och.bus.constant.BusConst; import com.mogo.och.bus.constant.BusConst;
import com.mogo.och.bus.fragment.BusFragment; import com.mogo.och.bus.fragment.BusFragment;
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
import com.mogo.service.statusmanager.StatusDescriptor;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@@ -38,15 +38,15 @@ public class BusProvider implements IMogoOCH {
/** /**
* 进入鹰眼模式,设置手势缩放地图失效 * 进入鹰眼模式,设置手势缩放地图失效
*/ */
private void stepIntoVrMode(){ private void stepIntoVrMode() {
CallerLogger.INSTANCE.d( M_BUS + TAG, "进入vr模式" ); CallerLogger.INSTANCE.d(M_BUS + TAG, "进入vr模式");
MogoMapUIController.getInstance() MogoMapUIController.getInstance()
.stepInVrMode(false); .stepInVrMode(false);
} }
@Override @Override
public void init(Context context) { public void init(Context context) {
MogoApisHandler.getInstance().getApis().getStatusManagerApi().registerStatusChangedListener("OchBus" MogoStatusManager.getInstance().registerStatusChangedListener("OchBus"
, StatusDescriptor.VR_MODE, statusChangedListener); , StatusDescriptor.VR_MODE, statusChangedListener);
} }
@@ -55,12 +55,14 @@ public class BusProvider implements IMogoOCH {
if (busFragment == null) { if (busFragment == null) {
CallerLogger.INSTANCE.d(TAG, "准备add fragment======"); CallerLogger.INSTANCE.d(TAG, "准备add fragment======");
Fragment fragmentByTag = supportFragmentManager.findFragmentByTag(BusFragment.TAG); Fragment fragmentByTag = supportFragmentManager.findFragmentByTag(BusFragment.TAG);
if(fragmentByTag instanceof BusFragment){ if (fragmentByTag instanceof BusFragment) {
busFragment = (BusFragment)fragmentByTag; busFragment = (BusFragment) fragmentByTag;
}else { } else {
busFragment = new BusFragment(); busFragment = new BusFragment();
} }
supportFragmentManager.beginTransaction().add(containerId, busFragment,BusFragment.TAG).commitAllowingStateLoss(); if(!busFragment.isAdded()) {
supportFragmentManager.beginTransaction().add(containerId, busFragment, BusFragment.TAG).commitAllowingStateLoss();
}
return; return;
} }
CallerLogger.INSTANCE.d(TAG, "准备show fragment"); CallerLogger.INSTANCE.d(TAG, "准备show fragment");
@@ -83,7 +85,7 @@ public class BusProvider implements IMogoOCH {
} else { } else {
hideFragment(); hideFragment();
} }
} else if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) { } else if (MogoStatusManager.getInstance().isVrMode()) {
// topView进行展示时推出网约车界面但是不隐藏整个fragment // topView进行展示时推出网约车界面但是不隐藏整个fragment
if (busFragment != null && isTrue) { if (busFragment != null && isTrue) {
busFragment.hideOchBus(); busFragment.hideOchBus();
@@ -115,7 +117,9 @@ public class BusProvider implements IMogoOCH {
@Override @Override
public void onDestroy() { public void onDestroy() {
//若不调用finish, 设置中打开关闭UITouch,会造成och fragment 重叠 //若不调用finish, 设置中打开关闭UITouch,会造成och fragment 重叠
MogoStatusManager.getInstance().unregisterStatusChangedListener("OchBus"
, StatusDescriptor.VR_MODE, statusChangedListener);
if (activity == null) return; if (activity == null) return;
activity.finish(); activity.finish();
} }

View File

@@ -1,10 +1,12 @@
package com.mogo.och.bus.bean; package com.mogo.och.bus.bean;
import java.io.Serializable;
/** /**
* @author: wangmingjun * @author: wangmingjun
* @date: 2022/9/23 * @date: 2022/9/23
*/ */
public class WriteOffPassenger { public class WriteOffPassenger implements Serializable {
public String phone; public String phone;
public String orderNo; public String orderNo;
public int passengerSize; public int passengerSize;

View File

@@ -1,6 +1,6 @@
package com.mogo.och.bus.callback; package com.mogo.och.bus.callback;
import android.location.Location; import com.mogo.eagle.core.data.map.MogoLocation;
/** /**
* Created on 2021/9/10 * Created on 2021/9/10
@@ -11,7 +11,7 @@ public interface IBusControllerStatusCallback {
// 是否vr map模式 // 是否vr map模式
void onVRModeChanged(boolean isVRMode); void onVRModeChanged(boolean isVRMode);
// 自车定位 // 自车定位
void onCarLocationChanged(Location location); void onCarLocationChanged(MogoLocation location);
//开始开启自动驾驶 //开始开启自动驾驶
void startOpenAutopilot(); void startOpenAutopilot();
} }

View File

@@ -63,6 +63,7 @@ class BusConst {
const val EVENT_PARAM_END_NAME = "end_name" const val EVENT_PARAM_END_NAME = "end_name"
const val EVENT_PARAM_LINE_ID = "line_id" const val EVENT_PARAM_LINE_ID = "line_id"
const val EVENT_PARAM_START_RESULT = "start_autopilot" // true/false const val EVENT_PARAM_START_RESULT = "start_autopilot" // true/false
const val EVENT_PARAM_START_FAILURE_CODE = "start_autopilot_failure_code" // 启动自驾失败code
const val EVENT_PARAM_START_FAILURE_MSG = "start_autopilot_failure_msg" // 启动自驾失败原因 const val EVENT_PARAM_START_FAILURE_MSG = "start_autopilot_failure_msg" // 启动自驾失败原因
const val EVENT_PARAM_PLATE_NUM = "plate_number" // 车牌号 const val EVENT_PARAM_PLATE_NUM = "plate_number" // 车牌号
const val EVENT_PARAM_ENV_ONLINE = "env_online" // 是否线上环境true/false const val EVENT_PARAM_ENV_ONLINE = "env_online" // 是否线上环境true/false

View File

@@ -6,6 +6,7 @@ import static com.mogo.och.bus.constant.BusConst.TIMER_START_AUTOPILOT_INTERVAL;
import android.animation.ObjectAnimator; import android.animation.ObjectAnimator;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@@ -43,8 +44,7 @@ import com.mogo.map.MogoMarkerManager;
import com.mogo.map.listener.IMogoMapListener; import com.mogo.map.listener.IMogoMapListener;
import com.mogo.map.uicontroller.VisualAngleMode; import com.mogo.map.uicontroller.VisualAngleMode;
import com.mogo.module.common.MogoApisHandler; import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.constants.DataTypes; import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
import com.mogo.module.common.view.OnPreventFastClickListener;
import com.mogo.och.bus.R; import com.mogo.och.bus.R;
import com.mogo.och.bus.bean.BusRoutesResult; import com.mogo.och.bus.bean.BusRoutesResult;
import com.mogo.och.bus.constant.BusConst; import com.mogo.och.bus.constant.BusConst;
@@ -66,7 +66,7 @@ import record_cache.RecordPanelOuterClass;
* *
* @author tongchenfei * @author tongchenfei
*/ */
public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>> extends MvpFragment<V, P> implements IMogoMapListener, IMoGoAutopilotRecordListener { public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>> extends MvpFragment<V, P> implements IMogoMapListener, IMoGoAutopilotRecordListener {
private static final String TAG = "BaseOchFragment"; private static final String TAG = "BaseOchFragment";
@@ -157,19 +157,9 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
} }
}); });
if (DebugConfig.isDebug()) {
mTrafficDataView.setLongClickable(true);
mTrafficDataView.setOnLongClickListener(v -> {
CallerLogger.INSTANCE.d(M_BUS + TAG, "长按显示状态工具栏");
Intent intent = new Intent();
intent.putExtra("oper", 52);
MogoApisHandler.getInstance().getApis().getIntentManagerApi().invoke("com.mogo.mock", intent);
return true;
});
}
initListener(); initListener();
setAutopilotBtnStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState()); setAutopilotBtnStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState());
ctvAutopilotStatus.setOnClickListener(new OnPreventFastClickListener(){ ctvAutopilotStatus.setOnClickListener(new OnPreventFastClickListener() {
@Override @Override
public void onClickImpl(View v) { public void onClickImpl(View v) {
@@ -220,7 +210,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
} }
mAICollectBtn = findViewById(R.id.module_mogo_och_ai_collet_rl); mAICollectBtn = findViewById(R.id.module_mogo_och_ai_collet_rl);
if (mAICollectBtn != null){ if (mAICollectBtn != null) {
CallerDevaToolsManager.INSTANCE.initAiCollect(mAICollectBtn); CallerDevaToolsManager.INSTANCE.initAiCollect(mAICollectBtn);
} }
} }
@@ -235,7 +225,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
protected abstract void onArriveStation(); protected abstract void onArriveStation();
private void updateSwitchMapIcon(){ private void updateSwitchMapIcon() {
if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isLongSight()) { if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isLongSight()) {
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long); mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long);
} else if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isMediumSight()) { } else if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isMediumSight()) {
@@ -295,14 +285,15 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
/** /**
* 设置进站按钮状态 * 设置进站按钮状态
*
* @param isClickable * @param isClickable
*/ */
public void setArrivedClikable(boolean isClickable){ public void setArrivedClikable(boolean isClickable) {
getActivity().runOnUiThread(() -> { getActivity().runOnUiThread(() -> {
tvArrived.setEnabled(isClickable); tvArrived.setEnabled(isClickable);
if (isClickable){ if (isClickable) {
tvArrived.setTextColor(getResources().getColor(R.color.bus_white)); tvArrived.setTextColor(getResources().getColor(R.color.bus_white));
}else { } else {
tvArrived.setTextColor(getResources().getColor(R.color.bus_arrived_btn_un_clickable_color)); tvArrived.setTextColor(getResources().getColor(R.color.bus_arrived_btn_un_clickable_color));
} }
}); });
@@ -317,9 +308,10 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
}); });
} }
public void playDI(){ public void playDI() {
SoundPoolHelper.getSoundPoolHelper().playSoundWithRedId(getContext(), R.raw.bus_di); SoundPoolHelper.getSoundPoolHelper().playSoundWithRedId(getContext(), R.raw.bus_di);
} }
/** /**
* 改变自动驾驶状态 * 改变自动驾驶状态
* *
@@ -347,13 +339,13 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
ctvAutopilotStatus.setClickable(true); ctvAutopilotStatus.setClickable(true);
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE == autopilotStatus) {//1可用 if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE == autopilotStatus) {//1可用
ctvAutopilotStatus.setSelected(false); ctvAutopilotStatus.setSelected(false);
}else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == autopilotStatus){ } else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == autopilotStatus) {
ctvAutopilotStatus.setSelected(true); ctvAutopilotStatus.setSelected(true);
} }
} }
} }
public void updateAutopilotStatus(int autopilotStatus){ public void updateAutopilotStatus(int autopilotStatus) {
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
== autopilotStatus) {//2 running == autopilotStatus) {//2 running
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_right_autopilot_icon); ctvAutopilotStatusIv.setImageResource(R.drawable.bus_right_autopilot_icon);
@@ -361,7 +353,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_success_tv)); ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_success_tv));
ctvAutopilotStatus.setSelected(false); ctvAutopilotStatus.setSelected(false);
ctvAutopilotStatus.setClickable(false); ctvAutopilotStatus.setClickable(false);
}else { } else {
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_wrong_autopilot_icon); ctvAutopilotStatusIv.setImageResource(R.drawable.bus_wrong_autopilot_icon);
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_normal)); ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_normal));
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_failure_tv)); ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_failure_tv));
@@ -373,7 +365,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
public void run() { public void run() {
setAutopilotBtnStatus(autopilotStatus); setAutopilotBtnStatus(autopilotStatus);
} }
},1000); }, 1000);
} }
private void changeAutopilotBtnView(int autopilotStatus, boolean isAnimateRunning) { private void changeAutopilotBtnView(int autopilotStatus, boolean isAnimateRunning) {
@@ -461,19 +453,20 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
} }
private void startingAutoApilotCountDown(){ private void startingAutoApilotCountDown() {
//10s 若自动驾驶没有开启,则结束动画 //10s 若自动驾驶没有开启,则结束动画
UiThreadHandler.postDelayed(new Runnable() { UiThreadHandler.postDelayed(new Runnable() {
@Override @Override
public void run() { //未启动成功做处理 public void run() { //未启动成功做处理
if (isAnimateRunning){// 只判断动画是否在进行,根据自动驾驶当前状态去设置自动驾驶状态 if (isAnimateRunning) {// 只判断动画是否在进行,根据自动驾驶当前状态去设置自动驾驶状态
stopAutopilotAnimation(); stopAutopilotAnimation();
updateAutopilotStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState()); updateAutopilotStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState());
} }
} }
},TIMER_START_AUTOPILOT_INTERVAL); }, TIMER_START_AUTOPILOT_INTERVAL);
} }
/** /**
* 停止自动驾驶中间动画 * 停止自动驾驶中间动画
*/ */
@@ -493,7 +486,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
*/ */
public void updateSpeedView(float newSpeed) { public void updateSpeedView(float newSpeed) {
int speed = (int) (Math.abs(newSpeed) * 3.6F); // 倒车时工控机反馈定位信息中speed为负值 int speed = (int) (Math.abs(newSpeed) * 3.6F); // 倒车时工控机反馈定位信息中speed为负值
if (mTrafficDataView != null){ if (mTrafficDataView != null) {
mTrafficDataView.updateSpeedWithValue(speed); mTrafficDataView.updateSpeedWithValue(speed);
} }
} }
@@ -528,7 +521,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
/** /**
* Bus调试信息线路、轨迹等信息 * Bus调试信息线路、轨迹等信息
* * <p>
* START * START
*/ */
private View busTestBar; private View busTestBar;

View File

@@ -120,8 +120,10 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)
public void changeOverview(EventLogout eventLogout){ public void changeOverview(EventLogout eventLogout){
CallerLogger.INSTANCE.d(M_BUS + TAG,"changeOverview Event消息去登出"); if (eventLogout.getMessgae() == EventLogout.LOGOUT_TYPE){
mPresenter.logout(); CallerLogger.INSTANCE.d(M_BUS + TAG,"changeOverview Event消息去登出");
mPresenter.logout();
}
} }
@Override @Override

View File

@@ -6,6 +6,7 @@ import com.mogo.commons.AbsMogoApplication;
import com.mogo.eagle.core.utilcode.util.NetworkUtils; import com.mogo.eagle.core.utilcode.util.NetworkUtils;
import com.mogo.eagle.core.utilcode.util.SharedPrefs; import com.mogo.eagle.core.utilcode.util.SharedPrefs;
import com.mogo.eagle.core.utilcode.util.ToastUtils; import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.och.bus.R;
import com.mogo.och.bus.bean.BusQueryLineTaskResponse; import com.mogo.och.bus.bean.BusQueryLineTaskResponse;
import com.mogo.och.bus.bean.BusQueryLinesResponse; import com.mogo.och.bus.bean.BusQueryLinesResponse;
import com.mogo.och.bus.bean.BusRoutesResponse; import com.mogo.och.bus.bean.BusRoutesResponse;
@@ -56,6 +57,15 @@ public class BusLineModel {
} }
} }
@Override
public void onError() {
if (!NetworkUtils.isConnected(mContext)) {
ToastUtils.showShort(mContext.getString(R.string.network_error_tip));
} else {
ToastUtils.showShort(mContext.getString(R.string.request_error_tip));
}
}
@Override @Override
public void onFail(int code, String failMsg) { public void onFail(int code, String failMsg) {
if (!NetworkUtils.isConnected(mContext)) { if (!NetworkUtils.isConnected(mContext)) {
@@ -86,6 +96,15 @@ public class BusLineModel {
} }
} }
@Override
public void onError() {
if (!NetworkUtils.isConnected(mContext)) {
ToastUtils.showShort(mContext.getString(R.string.network_error_tip));
} else {
ToastUtils.showShort(mContext.getString(R.string.request_error_tip));
}
}
@Override @Override
public void onFail(int code, String failMsg) { public void onFail(int code, String failMsg) {
if (!NetworkUtils.isConnected(mContext)) { if (!NetworkUtils.isConnected(mContext)) {
@@ -107,6 +126,15 @@ public class BusLineModel {
} }
} }
@Override
public void onError() {
if (!NetworkUtils.isConnected(mContext)) {
ToastUtils.showShort(mContext.getString(R.string.network_error_tip));
} else {
ToastUtils.showShort(mContext.getString(R.string.request_error_tip));
}
}
@Override @Override
public void onFail(int code, String failMsg) { public void onFail(int code, String failMsg) {
if (!NetworkUtils.isConnected(mContext)) { if (!NetworkUtils.isConnected(mContext)) {

View File

@@ -33,28 +33,28 @@ public class BusModelLoopManager {
} }
private Disposable mHeartbeatDisposable; //心跳轮询 private Disposable mHeartbeatDisposable; //心跳轮询
private Disposable mQueryPassengerDisposable; //查询核销乘客 // private Disposable mQueryPassengerDisposable; //查询核销乘客
public void startQueryPassengerWriteOffLoop() { // public void startQueryPassengerWriteOffLoop() {
if (mQueryPassengerDisposable != null && !mQueryPassengerDisposable.isDisposed()) { // if (mQueryPassengerDisposable != null && !mQueryPassengerDisposable.isDisposed()) {
return; // return;
} // }
CallerLogger.INSTANCE.i(M_BUS + TAG, "startQueryPassengerWriteOffLoop()"); // CallerLogger.INSTANCE.i(M_BUS + TAG, "startQueryPassengerWriteOffLoop()");
mQueryPassengerDisposable = Observable.interval(LOOP_DELAY_500, // mQueryPassengerDisposable = Observable.interval(LOOP_DELAY_500,
LOOP_PASSENGER_5S, TimeUnit.MILLISECONDS) // LOOP_PASSENGER_5S, TimeUnit.MILLISECONDS)
.map((aLong -> aLong + 1)) // .map((aLong -> aLong + 1))
.subscribeOn(Schedulers.io()) // .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) // .observeOn(AndroidSchedulers.mainThread())
.subscribe(aLong -> BusOrderModel.getInstance().queryPassengerWriteOff()); // .subscribe(aLong -> BusOrderModel.getInstance().queryPassengerWriteOff());
} // }
public void stopQueryPassengerWriteOffLoop() { // public void stopQueryPassengerWriteOffLoop() {
if (mQueryPassengerDisposable != null) { // if (mQueryPassengerDisposable != null) {
CallerLogger.INSTANCE.i(M_BUS + TAG, "stopQueryPassengerWriteOffLoop()"); // CallerLogger.INSTANCE.i(M_BUS + TAG, "stopQueryPassengerWriteOffLoop()");
mQueryPassengerDisposable.dispose(); // mQueryPassengerDisposable.dispose();
mQueryPassengerDisposable = null; // mQueryPassengerDisposable = null;
} // }
} // }
public void startHeartbeatLoop() { public void startHeartbeatLoop() {
if (mHeartbeatDisposable != null && !mHeartbeatDisposable.isDisposed()) { if (mHeartbeatDisposable != null && !mHeartbeatDisposable.isDisposed()) {

View File

@@ -14,6 +14,7 @@ import com.mogo.commons.mvp.Presenter;
import com.mogo.commons.voice.AIAssist; import com.mogo.commons.voice.AIAssist;
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo; import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
import com.mogo.eagle.core.data.config.FunctionBuildConfig; import com.mogo.eagle.core.data.config.FunctionBuildConfig;
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.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; 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.CallerLogger;
@@ -236,7 +237,7 @@ public class BusPresenter extends Presenter<BusFragment>
} }
@Override @Override
public void onCarLocationChanged(Location location) { public void onCarLocationChanged(MogoLocation location) {
if (null != location) { if (null != location) {
runOnUIThread(() -> mView.updateSpeedView(location.getSpeed())); runOnUIThread(() -> mView.updateSpeedView(location.getSpeed()));
} }

View File

@@ -10,7 +10,6 @@ import android.widget.ImageView
import android.widget.TextView import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintLayout
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.PagerSnapHelper
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.mogo.commons.mvp.MvpActivity import com.mogo.commons.mvp.MvpActivity
import com.mogo.eagle.core.utilcode.util.SharedPrefs import com.mogo.eagle.core.utilcode.util.SharedPrefs
@@ -18,7 +17,7 @@ import com.mogo.och.bus.presenter.BusLinePresenter
import com.mogo.och.bus.ui.adapter.SwitchLineAdapter import com.mogo.och.bus.ui.adapter.SwitchLineAdapter
import com.mogo.och.bus.bean.BusQueryLinesResponse import com.mogo.och.bus.bean.BusQueryLinesResponse
import com.mogo.och.bus.ui.adapter.OpenItemAnimator import com.mogo.och.bus.ui.adapter.OpenItemAnimator
import com.mogo.module.common.view.SpacesItemDecoration import com.mogo.eagle.core.utilcode.mogo.view.SpacesItemDecoration
import com.mogo.eagle.core.utilcode.util.ToastUtils import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.bus.R import com.mogo.och.bus.R
import com.mogo.och.bus.bean.BusQueryLineTaskResponse import com.mogo.och.bus.bean.BusQueryLineTaskResponse
@@ -74,7 +73,11 @@ class BusSwitchLineActivity : MvpActivity<BusSwitchLineView?, BusLinePresenter?>
mLinesListView.setLayoutManager(linearLayoutManager) mLinesListView.setLayoutManager(linearLayoutManager)
mLinesListView.setItemAnimator(OpenItemAnimator()) mLinesListView.setItemAnimator(OpenItemAnimator())
mAdapter = SwitchLineAdapter(applicationContext, mData) mAdapter = SwitchLineAdapter(applicationContext, mData)
mLinesListView.addItemDecoration(SpacesItemDecoration(4)) mLinesListView.addItemDecoration(
SpacesItemDecoration(
4
)
)
mLinesListView.setAdapter(mAdapter) mLinesListView.setAdapter(mAdapter)
//设置item 点击事件 //设置item 点击事件
mAdapter.setOnLineItemClickListener(object :SwitchLineAdapter.LineItemClickListener{ mAdapter.setOnLineItemClickListener(object :SwitchLineAdapter.LineItemClickListener{

View File

@@ -1,6 +1,8 @@
package com.mogo.och.bus.util; package com.mogo.och.bus.util;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS; import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS;
import android.annotation.SuppressLint;
import android.text.TextUtils; import android.text.TextUtils;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig; import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
@@ -36,22 +38,31 @@ public class BusAnalyticsManager {
private Runnable startAutopilotRunnable = () -> { private Runnable startAutopilotRunnable = () -> {
// 15s内未开启上报失败埋点 // 15s内未开启上报失败埋点
triggerStartAutopilotFailureEvent("15s后app等待超时"); triggerStartAutopilotFailureEvent("", "15s后app等待超时");
}; };
public void triggerStartAutopilotFailureEventByAdas(String failMsg){ public void triggerStartAutopilotFailureEventByAdas(String failCode, String failMsg){
removeWaitingCallback(); removeWaitingCallback();
triggerStartAutopilotFailureEvent(failMsg); triggerStartAutopilotFailureEvent(failCode, failMsg);
} }
private void triggerStartAutopilotFailureEvent(String failMsg){ private void triggerStartAutopilotFailureEvent(String failCode, String failMsg){
if (mStartAutopilotParams.isEmpty()) return;
CallerLogger.INSTANCE.e( M_BUS + "triggerStartAutopilotFailureEvent", failMsg ); CallerLogger.INSTANCE.e( M_BUS + "triggerStartAutopilotFailureEvent", failMsg );
if (CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState() !=
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING){
mStartAutopilotParams.put(BusConst.EVENT_PARAM_START_FAILURE_CODE, failCode);
mStartAutopilotParams.put(BusConst.EVENT_PARAM_START_FAILURE_MSG, failMsg);
}
mStartAutopilotParams.put(BusConst.EVENT_PARAM_START_RESULT mStartAutopilotParams.put(BusConst.EVENT_PARAM_START_RESULT
, CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState() == , CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState() ==
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING); IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING);
mStartAutopilotParams.put(BusConst.EVENT_PARAM_START_FAILURE_MSG,
failMsg);
AnalyticsManager.INSTANCE.track(mStartAutopilotKey, mStartAutopilotParams); AnalyticsManager.INSTANCE.track(mStartAutopilotKey, mStartAutopilotParams);
clearStartAutopilotParams();//清空参数数据,防止误传
} }
private void removeWaitingCallback() { private void removeWaitingCallback() {
@@ -61,6 +72,15 @@ public class BusAnalyticsManager {
} }
} }
public void clearStartAutopilotFailureMSG(){
mStartAutopilotParams.put(BusConst.EVENT_PARAM_START_FAILURE_CODE, "");
mStartAutopilotParams.put(BusConst.EVENT_PARAM_START_FAILURE_MSG, "");
}
private void clearStartAutopilotParams(){
mStartAutopilotParams.clear();
}
/** /**
* 触发'开启自动驾驶'埋点流程 * 触发'开启自动驾驶'埋点流程
* 开启自动驾驶15s内成功则发送成功埋点否则发送失败埋点 * 开启自动驾驶15s内成功则发送成功埋点否则发送失败埋点
@@ -86,10 +106,14 @@ public class BusAnalyticsManager {
mStartAutopilotParams.put(BusConst.EVENT_PARAM_LINE_ID, lineId); mStartAutopilotParams.put(BusConst.EVENT_PARAM_LINE_ID, lineId);
if (send) { if (send) {
if (mStartAutopilotParams.isEmpty()) return;
// 开启成功,上报埋点 // 开启成功,上报埋点
clearStartAutopilotFailureMSG();
removeWaitingCallback(); removeWaitingCallback();
mStartAutopilotParams.put(BusConst.EVENT_PARAM_START_RESULT, true); mStartAutopilotParams.put(BusConst.EVENT_PARAM_START_RESULT, true);
AnalyticsManager.INSTANCE.track(mStartAutopilotKey, mStartAutopilotParams); AnalyticsManager.INSTANCE.track(mStartAutopilotKey, mStartAutopilotParams);
clearStartAutopilotParams();//清空参数数据,防止误传
} else { } else {
UiThreadHandler.postDelayed(startAutopilotRunnable, BusConst.LOOP_PERIOD_15S); UiThreadHandler.postDelayed(startAutopilotRunnable, BusConst.LOOP_PERIOD_15S);
} }

View File

@@ -21,8 +21,13 @@ import android.view.animation.DecelerateInterpolator;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.eagle.core.utilcode.util.BitmapHelper;
import com.mogo.och.bus.R; import com.mogo.och.bus.R;
import me.jessyan.autosize.AutoSizeConfig;
import me.jessyan.autosize.utils.AutoSizeUtils;
/** /**
* 滑块滑动面板 * 滑块滑动面板
* *
@@ -57,12 +62,12 @@ public class SlidePanelView extends View {
private final Paint textPaint = new Paint(Paint.ANTI_ALIAS_FLAG); private final Paint textPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
private static int textSize = 40; private static int textSize = 40;
private static int BLOCK_START_X = 15; private static int BLOCK_START_X = AutoSizeUtils.dp2px(AbsMogoApplication.getApp(),15);
private static int BLOCK_START_Y = 15; private static int BLOCK_START_Y = AutoSizeUtils.dp2px(AbsMogoApplication.getApp(),15);
private static int NORMAL_TEXT_MARGIN_LEFT = 40; private static int NORMAL_TEXT_MARGIN_LEFT = AutoSizeUtils.dp2px(AbsMogoApplication.getApp(),40);
private static int NORMAL_TEXT_MARGIN_RIGHT = 60; private static int NORMAL_TEXT_MARGIN_RIGHT = AutoSizeUtils.dp2px(AbsMogoApplication.getApp(),60);
private static int SHORT_TEXT_MARGIN_LEFT = 60; private static int SHORT_TEXT_MARGIN_LEFT = AutoSizeUtils.dp2px(AbsMogoApplication.getApp(),60);;
private static int SHORT_TEXT_MARGIN_RIGHT = 70; private static int SHORT_TEXT_MARGIN_RIGHT = AutoSizeUtils.dp2px(AbsMogoApplication.getApp(),70);;
private int textMarginLeft = NORMAL_TEXT_MARGIN_LEFT; private int textMarginLeft = NORMAL_TEXT_MARGIN_LEFT;
private int textMarginRight = NORMAL_TEXT_MARGIN_RIGHT; private int textMarginRight = NORMAL_TEXT_MARGIN_RIGHT;
@@ -123,8 +128,11 @@ public class SlidePanelView extends View {
textGradient.setLocalMatrix(gradientMatrix); textGradient.setLocalMatrix(gradientMatrix);
textPaint.setShader(textGradient); textPaint.setShader(textGradient);
textPaint.getFontMetrics(blockTextMetrics); textPaint.getFontMetrics(blockTextMetrics);
int size = AutoSizeUtils.dp2px(getContext(), 120);
bmBlock = BitmapFactory.decodeResource(getResources(), R.drawable.bus_base_slide_block); BitmapFactory.Options opts = new BitmapFactory.Options();
opts.inDensity = (int) AutoSizeConfig.getInstance().getInitDensity();
bmBlock = BitmapFactory.decodeResource(getResources(), R.drawable.bus_base_slide_block,opts);
bmBlock = Bitmap.createScaledBitmap(bmBlock, size, size, true);
blockWidth = bmBlock.getWidth(); blockWidth = bmBlock.getWidth();
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1004 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 377 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 400 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 402 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Some files were not shown because too many files have changed in this diff Show More