stash
This commit is contained in:
@@ -19,6 +19,7 @@ import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.map.MapCenterPointStrategy;
|
||||
import com.mogo.module.common.map.Scene;
|
||||
import com.mogo.module.main.cards.MogoModulesManager;
|
||||
@@ -135,7 +136,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
|
||||
private void init() {
|
||||
if ( mServiceApis == null ) {
|
||||
mServiceApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation();
|
||||
mServiceApis = MogoApisHandler.getInstance().getApis();
|
||||
}
|
||||
mServiceApis.getShareManager().resetContext( this );
|
||||
mServiceApis.getAuthManagerApi().showAuth( this );
|
||||
@@ -189,6 +190,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
mMogoFragmentManager = mServiceApis.getFragmentManagerApi();
|
||||
mMogoFragmentManager.init( this, R.id.module_main_id_search_fragment );
|
||||
mMogoFragmentManager.initMessageHistoryContainerId( R.id.module_main_id_message_history_fragment_container );
|
||||
mServiceApis.getOnlineCarPanelApi().initContainer( R.id.module_main_id_message_history_fragment_container, this );
|
||||
mMogoFragmentManager.registerMainFragmentStackTransactionListener( ( size ) -> {
|
||||
if ( size == 0 ) {
|
||||
showLayout();
|
||||
@@ -332,7 +334,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
@Override
|
||||
public IMogoServiceApis getApis() {
|
||||
if ( mServiceApis == null ) {
|
||||
mServiceApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation();
|
||||
mServiceApis = MogoApisHandler.getInstance().getApis();
|
||||
}
|
||||
return mServiceApis;
|
||||
}
|
||||
@@ -350,5 +352,6 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
Logger.d( TAG, "destroy." );
|
||||
mServiceApis.getRefreshStrategyControllerApi().clearAllData();
|
||||
AIAssist.getInstance( this ).release();
|
||||
mServiceApis.getOnlineCarPanelApi().clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,8 @@ public class SchemeIntent implements IMogoStatusChangedListener {
|
||||
|
||||
public static final String TYPE_LAUNCH = "launch";
|
||||
|
||||
public static final String TYPE_SHOW_ONLINE_CAR_PANEL = "showOnlineCarPanel";
|
||||
|
||||
private IMogoServiceApis mApis;
|
||||
private Context mContext;
|
||||
|
||||
@@ -125,21 +127,23 @@ public class SchemeIntent implements IMogoStatusChangedListener {
|
||||
handleLaunchIntent( target );
|
||||
break;
|
||||
case TYPE_SEARCH_ROAD_CONDITION:
|
||||
handleSearchRoadCondition(target);
|
||||
handleSearchRoadCondition( target );
|
||||
break;
|
||||
case TYPE_SHOW_ONLINE_CAR_PANEL:
|
||||
handleShowOnlineCarPanel( target );
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void handleSearchRoadCondition(Uri target) {
|
||||
if (mApis == null) {
|
||||
private void handleSearchRoadCondition( Uri target ) {
|
||||
if ( mApis == null ) {
|
||||
return;
|
||||
}
|
||||
mApis.getTanluUiApi().searchRoadCondition(target.getQueryParameter("intentStr"),
|
||||
target.getQueryParameter("data"), target.getQueryParameter("city"),
|
||||
target.getQueryParameter("keywords"));
|
||||
mApis.getTanluUiApi().searchRoadCondition( target.getQueryParameter( "intentStr" ),
|
||||
target.getQueryParameter( "data" ), target.getQueryParameter( "city" ),
|
||||
target.getQueryParameter( "keywords" ) );
|
||||
}
|
||||
|
||||
private void handleSwitchCardIntent( String type ) {
|
||||
@@ -153,8 +157,6 @@ public class SchemeIntent implements IMogoStatusChangedListener {
|
||||
String lon = naviUri.getQueryParameter( "lon" );
|
||||
String lat = naviUri.getQueryParameter( "lat" );
|
||||
|
||||
// TODO: 2020-04-20 补充场景
|
||||
|
||||
try {
|
||||
double dlon = Double.valueOf( lon );
|
||||
double dlat = Double.valueOf( lat );
|
||||
@@ -178,6 +180,10 @@ public class SchemeIntent implements IMogoStatusChangedListener {
|
||||
mApis.getAnalyticsApi().track( "appenterfront", properties );
|
||||
}
|
||||
|
||||
private void handleShowOnlineCarPanel( Uri uri ) {
|
||||
mApis.getOnlineCarPanelApi().showPanel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStatusChanged( StatusDescriptor descriptor, boolean isTrue ) {
|
||||
if ( descriptor == StatusDescriptor.MAIN_PAGE_RESUME ) {
|
||||
|
||||
@@ -7,15 +7,14 @@ import android.os.IBinder;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.main.EventDispatchCenter;
|
||||
import com.mogo.module.main.cards.MogoModulesManager;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
@@ -26,7 +25,7 @@ public
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
@Route(path = "/service/base/info")
|
||||
@Route( path = "/service/base/info" )
|
||||
class MogoMainService extends Service implements IMogoLocationListener {
|
||||
|
||||
private static final String TAG = "MogoMainService";
|
||||
@@ -39,10 +38,10 @@ class MogoMainService extends Service implements IMogoLocationListener {
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
Logger.d(TAG, "基本服务启动");
|
||||
mServiceApis = (IMogoServiceApis) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation();
|
||||
Logger.d( TAG, "基本服务启动" );
|
||||
mServiceApis = MogoApisHandler.getInstance().getApis();
|
||||
initAndStartLocation();
|
||||
UiThreadHandler.postDelayed(() -> {
|
||||
UiThreadHandler.postDelayed( () -> {
|
||||
loadBaseModules();
|
||||
startTanluService();
|
||||
initADAS();
|
||||
@@ -53,53 +52,53 @@ class MogoMainService extends Service implements IMogoLocationListener {
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
public IBinder onBind( Intent intent ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
public int onStartCommand( Intent intent, int flags, int startId ) {
|
||||
return START_STICKY;
|
||||
}
|
||||
|
||||
private void initAndStartLocation() {
|
||||
Logger.d(TAG, "开始定位");
|
||||
mLocationClient = mServiceApis.getMapServiceApi().getSingletonLocationClient(AbsMogoApplication.getApp());
|
||||
mLocationClient.addLocationListener(this);
|
||||
mLocationClient.start(2_000L);
|
||||
Logger.d( TAG, "开始定位" );
|
||||
mLocationClient = mServiceApis.getMapServiceApi().getSingletonLocationClient( AbsMogoApplication.getApp() );
|
||||
mLocationClient.addLocationListener( this );
|
||||
mLocationClient.start( 2_000L );
|
||||
}
|
||||
|
||||
private void initGpsSimulatorListener() {
|
||||
mServiceApis.getMapServiceApi().getNavi(this).registerCarLocationChangedListener(EventDispatchCenter.getInstance());
|
||||
mServiceApis.getMapServiceApi().getNavi( this ).registerCarLocationChangedListener( EventDispatchCenter.getInstance() );
|
||||
}
|
||||
|
||||
private void loadBaseModules() {
|
||||
Logger.d(TAG, "加载基本模块");
|
||||
Logger.d( TAG, "加载基本模块" );
|
||||
MogoModulesManager.getInstance().loadBaseModule();
|
||||
}
|
||||
|
||||
private void startTanluService() {
|
||||
UiThreadHandler.postDelayed(() -> {
|
||||
Logger.d(TAG, "startTanluService ---------- ");
|
||||
UiThreadHandler.postDelayed( () -> {
|
||||
Logger.d( TAG, "startTanluService ---------- " );
|
||||
mServiceApis.getTanluApi().startTanluService();
|
||||
}, 2_000L
|
||||
);
|
||||
}
|
||||
|
||||
private void initADAS() {
|
||||
mServiceApis.getAdasControllerApi().init(AbsMogoApplication.getApp());
|
||||
mServiceApis.getAdasControllerApi().init( AbsMogoApplication.getApp() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocationChanged(MogoLocation location) {
|
||||
EventDispatchCenter.getInstance().onLocationChanged(location);
|
||||
public void onLocationChanged( MogoLocation location ) {
|
||||
EventDispatchCenter.getInstance().onLocationChanged( location );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (mLocationClient != null) {
|
||||
mLocationClient.removeLocationListener(this);
|
||||
if ( mLocationClient != null ) {
|
||||
mLocationClient.removeLocationListener( this );
|
||||
mLocationClient.stop();
|
||||
mLocationClient.destroy();
|
||||
mLocationClient = null;
|
||||
|
||||
@@ -26,6 +26,6 @@
|
||||
<dimen name="module_main_entrance_fragment_container_padding_top">16px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_width">658px</dimen>
|
||||
<dimen name="module_event_fragment_container_padding">8px</dimen>
|
||||
<dimen name="module_main_apps_fragment_container_paddingTop">10px</dimen>
|
||||
<dimen name="module_main_apps_fragment_container_paddingTop">2px</dimen>
|
||||
|
||||
</resources>
|
||||
Reference in New Issue
Block a user