opt
This commit is contained in:
BIN
20200610172423.png
Normal file
BIN
20200610172423.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 375 KiB |
@@ -237,6 +237,7 @@ android.applicationVariants.all { variant ->
|
||||
|
||||
|
||||
def getMonthAndDay() {
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("MMddHH")
|
||||
return sdf.format(new Date())
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
ext {
|
||||
time = ""
|
||||
|
||||
android = [
|
||||
// applicationId : "com.mogo.launcher",
|
||||
// zhidadoApplicationId: "com.zhidao.launcher",
|
||||
|
||||
@@ -119,7 +119,7 @@ public class AbsMogoApplication extends Application {
|
||||
mode = DebugConfig.NET_MODE_QA;
|
||||
}
|
||||
AccountClientManager.init( sApp, mode, NetEnvironManager.OS_2C, "os2.0-launcher" );
|
||||
AccountClientManager.getTicket( new TicketInfoCallback() {
|
||||
getTicket( new TicketInfoCallback() {
|
||||
@Override
|
||||
public void onSuccess( String ticket ) {
|
||||
SpStorage.setTicket( ticket );
|
||||
@@ -133,6 +133,14 @@ public class AbsMogoApplication extends Application {
|
||||
} );
|
||||
}
|
||||
|
||||
private static void getTicket(TicketInfoCallback callback){
|
||||
if ( DebugConfig.isLauncher() ) {
|
||||
AccountClientManager.getTicket(callback);
|
||||
} else {
|
||||
AccountClientManager.getAppTicket( callback );
|
||||
}
|
||||
}
|
||||
|
||||
private static void initNetConfig() {
|
||||
|
||||
try {
|
||||
|
||||
@@ -361,6 +361,7 @@ public class AIAssist implements VoiceClient.VoiceCmdCallBack, OnTtsListener {
|
||||
intent.setAction( "pvetec.intent.action.txz.switch" );
|
||||
intent.putExtra( "window_start_cancel", status );
|
||||
intent.putExtra( "extra_switch_type", "window_start_cancel" );
|
||||
Logger.d( TAG, "status = %d", status );
|
||||
context.sendBroadcast( intent );
|
||||
}
|
||||
|
||||
|
||||
@@ -342,6 +342,9 @@ public class NaviClient implements IMogoNavi {
|
||||
public void setUseExtraGPSData( boolean use ) {
|
||||
Logger.d( TAG, "设置外部gps源状态 %s", use );
|
||||
mAMapNavi.setIsUseExtraGPSData( use );
|
||||
if ( AMapWrapper.getAMap() == null ) {
|
||||
return;
|
||||
}
|
||||
if ( use ) {
|
||||
AMapWrapper.getAMap().setLocationSource( new LocationSource() {
|
||||
@Override
|
||||
|
||||
@@ -117,6 +117,9 @@ public class ExtensionsFragment extends MvpFragment< ExtensionsView, ExtensionsP
|
||||
@Override
|
||||
public void renderUserInfo(UserInfo userInfo) {
|
||||
Logger.d(TAG, "renderUserInfo: " + userInfo);
|
||||
if ( userInfo == null ) {
|
||||
return;
|
||||
}
|
||||
GlideApp.with(getContext()).load(userInfo.getHeadImgurl()).circleCrop().into(mUserHeadImg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -391,10 +391,6 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
if (naviinfo == null) {
|
||||
return;
|
||||
}
|
||||
if (mExitNavi.getVisibility() == View.GONE) {
|
||||
// 避免先导航,后启动app导致无法显示控件
|
||||
onStartNavi();
|
||||
}
|
||||
mNaviInfo.notifyChanged(naviinfo);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.module.gps.simulator;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
@@ -17,6 +18,7 @@ import org.java_websocket.handshake.ServerHandshake;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.Iterator;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
@@ -101,6 +103,18 @@ public class WebSocketManager {
|
||||
realTimeLocationVo.getDirection(),
|
||||
realTimeLocationVo.getLocationTime()
|
||||
);
|
||||
Iterator< IMogoLocationListener > listeners = mServiceApis.getRegisterCenterApi().getLocationListeners();
|
||||
MogoLocation location = new MogoLocation();
|
||||
location.setLatitude( realTimeLocationVo.getLat() );
|
||||
location.setLongitude( realTimeLocationVo.getLon() );
|
||||
location.setSpeed( realTimeLocationVo.getVehicleSpeed() );
|
||||
location.setAccuracy( 1 );
|
||||
location.setTime( realTimeLocationVo.getLocationTime() );
|
||||
if ( listeners != null ) {
|
||||
while ( listeners.hasNext() ) {
|
||||
listeners.next().onLocationChanged( location );
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,6 +157,7 @@ public class EventDispatchCenter implements
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged2( Location latLng ) {
|
||||
|
||||
Iterator< IMogoCarLocationChangedListener > iterator = MogoRegisterCenterHandler.getInstance().getCarLocationChangedListener();
|
||||
if ( iterator == null ) {
|
||||
return;
|
||||
@@ -370,7 +371,6 @@ public class EventDispatchCenter implements
|
||||
public void onStartNavi() {
|
||||
Iterator< IMogoNaviListener > iterator = MogoRegisterCenterHandler.getInstance().getNaviListeners();
|
||||
|
||||
|
||||
if ( iterator == null ) {
|
||||
return;
|
||||
}
|
||||
@@ -447,6 +447,7 @@ public class EventDispatchCenter implements
|
||||
|
||||
@Override
|
||||
public void onLocationChanged( MogoLocation location ) {
|
||||
|
||||
final long start = System.currentTimeMillis();
|
||||
Iterator< IMogoLocationListener > iterator = MogoRegisterCenterHandler.getInstance().getLocationListeners();
|
||||
if ( iterator == null ) {
|
||||
|
||||
@@ -13,6 +13,9 @@ import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.module.IMogoModuleLifecycle;
|
||||
import com.mogo.service.module.IMogoRegisterCenter;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-01-09
|
||||
@@ -57,6 +60,11 @@ public class MogoRegisterCenter implements IMogoRegisterCenter {
|
||||
MogoRegisterCenterHandler.getInstance().registerMogoLocationListener( moduleName, listener );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator< IMogoLocationListener > getLocationListeners() {
|
||||
return MogoRegisterCenterHandler.getInstance().getLocationListeners();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterMogoLocationListener( String moduleName ) {
|
||||
MogoRegisterCenterHandler.getInstance().unregisterMogoLocationListener( moduleName );
|
||||
|
||||
@@ -158,6 +158,7 @@ public class MogoRegisterCenterHandler implements IMogoRegisterCenter {
|
||||
return mNavi.values().iterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator< IMogoLocationListener > getLocationListeners() {
|
||||
return mLocation.values().iterator();
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@ class MogoMainService extends Service implements IMogoLocationListener {
|
||||
Logger.d( TAG, "基本服务启动" );
|
||||
mServiceApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation();
|
||||
initAndStartLocation();
|
||||
initGpsSimulatorListener();
|
||||
loadBaseModules();
|
||||
startTanluService();
|
||||
initADAS();
|
||||
@@ -60,7 +61,9 @@ class MogoMainService extends Service implements IMogoLocationListener {
|
||||
mLocationClient = mServiceApis.getMapServiceApi().getSingletonLocationClient( AbsMogoApplication.getApp() );
|
||||
mLocationClient.addLocationListener( this );
|
||||
mLocationClient.start( 2_000L );
|
||||
}
|
||||
|
||||
private void initGpsSimulatorListener() {
|
||||
mServiceApis.getMapServiceApi().getNavi( this ).registerCarLocationChangedListener( EventDispatchCenter.getInstance() );
|
||||
}
|
||||
|
||||
@@ -69,11 +72,11 @@ class MogoMainService extends Service implements IMogoLocationListener {
|
||||
MogoModulesManager.getInstance().loadBaseModule();
|
||||
}
|
||||
|
||||
private void startTanluService(){
|
||||
private void startTanluService() {
|
||||
MainService.Companion.launchService( getApplicationContext(), "0" );
|
||||
}
|
||||
|
||||
private void initADAS(){
|
||||
private void initADAS() {
|
||||
mServiceApis.getAdasControllerApi().init( AbsMogoApplication.getApp() );
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ dependencies {
|
||||
api rootProject.ext.dependencies.mogocommons
|
||||
api rootProject.ext.dependencies.mogoserviceapi
|
||||
implementation rootProject.ext.dependencies.modulecommon
|
||||
implementation rootProject.ext.dependencies.gpssimulator
|
||||
} else {
|
||||
api project(":libraries:mogo-map")
|
||||
api project(":libraries:mogo-map-api")
|
||||
@@ -61,6 +62,7 @@ dependencies {
|
||||
api project(":foudations:mogo-commons")
|
||||
api project(':services:mogo-service-api')
|
||||
implementation project(':modules:mogo-module-common')
|
||||
implementation project(':modules:mogo-module-gps-simulator')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.module.carchattingprovider.ICarsChattingProvider;
|
||||
import com.mogo.module.common.entity.MarkerResponse;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.gps.simulator.IMogoGpsSimulatorManager;
|
||||
import com.mogo.module.service.marker.MapMarkerManager;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
@@ -60,6 +61,7 @@ public class MarkerServiceHandler {
|
||||
private static IMogoLauncher sLauncher;
|
||||
private static IMogoFragmentManager sFragmentManager;
|
||||
private static ICarsChattingProvider sCarChatting;
|
||||
private static IMogoGpsSimulatorManager sGpsSimulatorManager;
|
||||
|
||||
private static MapMarkerManager sMapMarkerManager;
|
||||
|
||||
@@ -87,6 +89,8 @@ public class MarkerServiceHandler {
|
||||
|
||||
sMapMarkerManager = MapMarkerManager.getInstance();
|
||||
sMapMarkerManager.init( context );
|
||||
|
||||
sGpsSimulatorManager = ARouter.getInstance().navigation( IMogoGpsSimulatorManager.class );
|
||||
}
|
||||
|
||||
public static IMogoServiceApis getApis(){
|
||||
@@ -169,6 +173,9 @@ public class MarkerServiceHandler {
|
||||
return sCarChatting;
|
||||
}
|
||||
|
||||
public static IMogoGpsSimulatorManager getGpsSimulatorManager() {
|
||||
return sGpsSimulatorManager;
|
||||
}
|
||||
|
||||
//TODO -------------以下方法是临时过度使用的,后面统一使用,getMapMarkerManager进行调用
|
||||
|
||||
|
||||
@@ -70,7 +70,6 @@ public class MockIntentHandler implements IntentHandler {
|
||||
button1.setVisibility( View.VISIBLE );
|
||||
button1.setBackgroundColor( Color.RED );
|
||||
button1.setOnClickListener( view -> {
|
||||
TipToast.shortTip( "测试" );
|
||||
} );
|
||||
}
|
||||
break;
|
||||
@@ -276,11 +275,17 @@ public class MockIntentHandler implements IntentHandler {
|
||||
IMogoMarker marker = MarkerServiceHandler.getMarkerManager().addMarker( TAG, options );
|
||||
MarkerServiceHandler.getMogoStatusManager().setUserInteractionStatus( TAG, true, false );
|
||||
MarkerServiceHandler.getMapUIController().moveToCenter( mogoLatLngs.get( 0 ) );
|
||||
WorkThreadHandler.getInstance().post( ()->{
|
||||
WorkThreadHandler.getInstance().post( () -> {
|
||||
marker.startSmooth( mogoLatLngs, duration );
|
||||
} );
|
||||
}
|
||||
break;
|
||||
case 15:
|
||||
MarkerServiceHandler.getGpsSimulatorManager().open();
|
||||
break;
|
||||
case 16:
|
||||
MarkerServiceHandler.getGpsSimulatorManager().close();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ import com.mogo.map.navi.IMogoAimlessModeListener;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener;
|
||||
import com.mogo.map.navi.IMogoNaviListener;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-01-09
|
||||
@@ -72,6 +74,13 @@ public interface IMogoRegisterCenter extends IProvider {
|
||||
*/
|
||||
void registerMogoLocationListener( String tag, IMogoLocationListener listener );
|
||||
|
||||
/**
|
||||
* 返回点位监听
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Iterator< IMogoLocationListener > getLocationListeners();
|
||||
|
||||
/**
|
||||
* 注销定位监听函数
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user