Merge branch 'dev' into dev_custom_map
# Conflicts: # libraries/mogo-map/src/main/java/com/mogo/map/MogoNavi.java # modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XModuleProvider.java
This commit is contained in:
@@ -32,6 +32,7 @@ import com.mogo.service.fragmentmanager.IMogoFragmentManager;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.mogo.service.map.IMogoMapService;
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
import com.mogo.service.monitor.IMogoMonitorProvider;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.utils.TipToast;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -47,8 +48,7 @@ import java.util.List;
|
||||
*/
|
||||
public class MainActivity extends MvpActivity< MainView, MainPresenter > implements MainView,
|
||||
IMogoLocationListener,
|
||||
IMogoMarkerClickListener,
|
||||
IMogoIntentListener {
|
||||
IMogoMarkerClickListener {
|
||||
|
||||
protected static final String TAG = MainActivity.class.getSimpleName();
|
||||
|
||||
@@ -58,14 +58,14 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
protected IMogoFragmentManager mMogoFragmentManager;
|
||||
protected IMogoStatusManager mMogoStatusManager;
|
||||
|
||||
// protected View mHeader;
|
||||
// protected View mHeader;
|
||||
protected View mApps;
|
||||
protected View mEntrance;
|
||||
protected View mEventPanel;
|
||||
protected FrameLayout mFloatingLayout;
|
||||
protected FrameLayout mCoverUpLayout;
|
||||
protected View mCoverUpLayout;
|
||||
protected FrameLayout mLeftPanelLayout;
|
||||
protected View mLeftShadowFrame;
|
||||
private boolean mIsHomeKeyDown = false;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
@@ -80,10 +80,11 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
// mHeader = findViewById( R.id.module_main_id_header_fragment_container );
|
||||
mApps = findViewById( R.id.module_main_id_apps_fragment_container );
|
||||
mEntrance = findViewById( R.id.module_main_id_entrance_fragment_container );
|
||||
mEventPanel = findViewById( R.id.module_main_id_event_panel_fragment_container );
|
||||
mFloatingLayout = findViewById( R.id.module_main_id_floating_view );
|
||||
mLeftShadowFrame = findViewById( R.id.module_main_id_map_left_shadow_frame );
|
||||
mCoverUpLayout = findViewById( R.id.module_main_id_cover_up );
|
||||
mLeftPanelLayout = findViewById(R.id.module_main_id_left_panel_fragment_container);
|
||||
mLeftPanelLayout = findViewById( R.id.module_main_id_left_panel_fragment_container );
|
||||
|
||||
// 避免事件穿透导致地图被滑动
|
||||
mLeftShadowFrame.setOnClickListener( view -> {
|
||||
@@ -95,6 +96,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
protected void hideLayout() {
|
||||
// mHeader.setVisibility( View.GONE );
|
||||
mEntrance.setVisibility( View.GONE );
|
||||
mEventPanel.setVisibility( View.GONE );
|
||||
mFloatingLayout.setVisibility( View.GONE );
|
||||
}
|
||||
|
||||
@@ -102,6 +104,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
protected void showLayout() {
|
||||
// mHeader.setVisibility( View.VISIBLE );
|
||||
mEntrance.setVisibility( View.VISIBLE );
|
||||
mEventPanel.setVisibility( View.VISIBLE );
|
||||
mFloatingLayout.setVisibility( View.VISIBLE );
|
||||
}
|
||||
|
||||
@@ -116,8 +119,8 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
if ( mServiceApis == null ) {
|
||||
mServiceApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation();
|
||||
}
|
||||
mServiceApis.getShareManager().resetContext(this);
|
||||
mServiceApis.getAuthManagerApi().showAuth(this);
|
||||
mServiceApis.getShareManager().resetContext( this );
|
||||
mServiceApis.getAuthManagerApi().showAuth( this );
|
||||
mMogoStatusManager = mServiceApis.getStatusManagerApi();
|
||||
mMogoStatusManager.setMainPageLaunchedStatus( TAG, true );
|
||||
AutopilotServiceManage.getInstance().init( getContext() );
|
||||
@@ -150,7 +153,6 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
MapCenterPointStrategy.setMapCenterPointByScene( mMogoMapUIController, Scene.AIMLESS );
|
||||
|
||||
// 加载地图,触发地图加载完毕回调,在初始化其他卡片模块,保证卡片模块可以正确获取地图相关服务。
|
||||
addModule();
|
||||
loadContainerModules();
|
||||
MogoModulesManager.getInstance().loadModules();
|
||||
mPresenter.delayOperations();
|
||||
@@ -171,6 +173,11 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
hideLayout();
|
||||
}
|
||||
} );
|
||||
|
||||
// 初始化MonitorModule
|
||||
IMogoMonitorProvider monitorProvider = (IMogoMonitorProvider) ARouter.getInstance().build(MogoServicePaths.PATH_MOGO_MONITOR).navigation(this);
|
||||
monitorProvider.resetActivityContext(this);
|
||||
|
||||
}
|
||||
|
||||
private void startBaseService() {
|
||||
@@ -178,18 +185,11 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
startService( intent );
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加模块
|
||||
*/
|
||||
protected void addModule() {
|
||||
|
||||
}
|
||||
|
||||
protected void loadContainerModules() {
|
||||
// MogoModulesManager.getInstance().loadExtensionsModule( R.id.module_main_id_header_fragment_container );
|
||||
MogoModulesManager.getInstance().loadEntrancesModule( R.id.module_main_id_entrance_fragment_container );
|
||||
MogoModulesManager.getInstance().loadEventPanelModule(R.id.module_main_id_event_panel_fragment_container);
|
||||
MogoModulesManager.getInstance().loadLeftPanelModule(R.id.module_main_id_left_panel_fragment_container);
|
||||
MogoModulesManager.getInstance().loadEventPanelModule( R.id.module_main_id_event_panel_fragment_container );
|
||||
MogoModulesManager.getInstance().loadLeftPanelModule( R.id.module_main_id_left_panel_fragment_container );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -210,7 +210,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
|
||||
@Override
|
||||
public void loadSplash() {
|
||||
MogoModulesManager.getInstance().loadSplashModule(R.id.module_main_id_splash_container);
|
||||
MogoModulesManager.getInstance().loadSplashModule( R.id.module_main_id_splash_container );
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@@ -238,7 +238,6 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
if ( mCoverUpLayout.getVisibility() != View.VISIBLE ) {
|
||||
mServiceApis.getAdasControllerApi().showADAS();
|
||||
}
|
||||
getApis().getIntentManagerApi().registerIntentListener( Intent.ACTION_CLOSE_SYSTEM_DIALOGS, this );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -247,42 +246,45 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
mMogoStatusManager.setMainPageResumeStatus( TAG, false );
|
||||
mMogoStatusManager.setMainPageLaunchedStatus( TAG, false );
|
||||
mServiceApis.getAuthManagerApi().dismiss();
|
||||
if ( shouldCloseADASPanel() ) {
|
||||
if ( shouldCloseADASPanelWhenPause() ) {
|
||||
mServiceApis.getAdasControllerApi().closeADAS();
|
||||
}
|
||||
mIsHomeKeyDown = false;
|
||||
}
|
||||
|
||||
private boolean shouldCloseADASPanel(){
|
||||
protected boolean shouldCloseADASPanelWhenPause(){
|
||||
// m4 系列因为按home键会造成页面pause后resume,造成adas panel 闪烁
|
||||
// f 系列加上上滑返回桌面后会走 mIsHomeKeyDown = true,但是不会造成页面pause
|
||||
// 独立 app 任何情况下都需要隐藏 adas
|
||||
return !mIsHomeKeyDown
|
||||
|| CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X
|
||||
|| !DebugConfig.isLauncher();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
getApis().getIntentManagerApi().unregisterIntentListener( Intent.ACTION_CLOSE_SYSTEM_DIALOGS, this );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if ( mMogoFragmentManager.getStackSize() == 0 ) {
|
||||
if ( mMogoFragmentManager == null
|
||||
|| mMogoFragmentManager.getStackSize() <= 0 ) {
|
||||
if ( DebugConfig.isLauncher() ) {
|
||||
doWhenBackPressed();
|
||||
return;
|
||||
} else {
|
||||
if ( doWhenBackPressed() ) {
|
||||
return;
|
||||
}
|
||||
super.onBackPressed();
|
||||
}
|
||||
}
|
||||
if ( mMogoFragmentManager != null
|
||||
&& mMogoFragmentManager.getStackSize() > 0 ) {
|
||||
} else {
|
||||
mMogoFragmentManager.pop();
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean doWhenBackPressed() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onNewIntent( Intent intent ) {
|
||||
super.onNewIntent( intent );
|
||||
@@ -297,13 +299,6 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
return mServiceApis;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onIntentReceived( String intentStr, Intent intent ) {
|
||||
if ( TextUtils.equals( Intent.ACTION_CLOSE_SYSTEM_DIALOGS, intentStr ) ) {
|
||||
mIsHomeKeyDown = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
@@ -4,22 +4,12 @@ import android.content.Intent;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.module.main.constants.MainConstants;
|
||||
import com.mogo.module.main.livedata.CardSwitchLiveData;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
import com.zhidao.roadcondition.service.MainService;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
|
||||
@@ -14,6 +14,8 @@ import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.mogo.service.intent.IMogoIntentManager;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.utils.AppUtils;
|
||||
import com.mogo.utils.CommonUtils;
|
||||
import com.mogo.utils.TipToast;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -35,6 +37,8 @@ public class SchemeIntent implements IMogoStatusChangedListener {
|
||||
|
||||
public static final String TYPE_NAVI = "navi";
|
||||
|
||||
public static final String TYPE_LAUNCH = "launch";
|
||||
|
||||
private IMogoServiceApis mApis;
|
||||
private Context mContext;
|
||||
|
||||
@@ -84,10 +88,10 @@ public class SchemeIntent implements IMogoStatusChangedListener {
|
||||
handleSwitch2Action( target );
|
||||
break;
|
||||
case "/main/share":
|
||||
Logger.d(TAG,"收到打开分享框的scheme,准备打开分享框");
|
||||
Logger.d( TAG, "收到打开分享框的scheme,准备打开分享框" );
|
||||
Map< String, Object > properties = new HashMap<>();
|
||||
properties.put( "from", "1" );
|
||||
mApis.getAnalyticsApi().track("v2x_share_click", properties);
|
||||
mApis.getAnalyticsApi().track( "v2x_share_click", properties );
|
||||
mApis.getShareManager().showShareDialog();
|
||||
break;
|
||||
default:
|
||||
@@ -115,6 +119,10 @@ public class SchemeIntent implements IMogoStatusChangedListener {
|
||||
case TYPE_NAVI:
|
||||
handleNaviIntent( target );
|
||||
break;
|
||||
case TYPE_LAUNCH:
|
||||
handleLaunchIntent( target );
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,6 +153,15 @@ public class SchemeIntent implements IMogoStatusChangedListener {
|
||||
}
|
||||
}
|
||||
|
||||
private void handleLaunchIntent( Uri uri ) {
|
||||
String type = uri.getQueryParameter( "channelType" );
|
||||
Map< String, Object > properties = new HashMap<>();
|
||||
properties.put( "appname", CommonUtils.getAppName( mContext ) );
|
||||
properties.put( "appversion", CommonUtils.getVersionName( mContext ) );
|
||||
properties.put( "from", type );
|
||||
mApis.getAnalyticsApi().track( "appenterfront", properties );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStatusChanged( StatusDescriptor descriptor, boolean isTrue ) {
|
||||
if ( descriptor == StatusDescriptor.MAIN_PAGE_RESUME ) {
|
||||
|
||||
@@ -18,7 +18,6 @@ import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidao.roadcondition.service.MainService;
|
||||
|
||||
public
|
||||
/**
|
||||
@@ -82,7 +81,7 @@ class MogoMainService extends Service implements IMogoLocationListener {
|
||||
private void startTanluService() {
|
||||
UiThreadHandler.postDelayed(() -> {
|
||||
Logger.d(TAG, "startTanluService ---------- ");
|
||||
MainService.Companion.launchService(getApplicationContext(), "0");
|
||||
mServiceApis.getTanluApi().startTanluService();
|
||||
}, 58_000L
|
||||
);
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!--黑色矩形 作为背景色-->
|
||||
<item>
|
||||
<shape>
|
||||
<gradient
|
||||
android:angle="270"
|
||||
android:centerX="0.6"
|
||||
android:endColor="#0B0F17"
|
||||
android:startColor="#171D2B"
|
||||
android:type="linear" />
|
||||
</shape>
|
||||
</item>
|
||||
<!--单独的slogan图片 并且设置下间距-->
|
||||
<!--如果使用svg可以直接 drawable-->
|
||||
<item>
|
||||
<bitmap
|
||||
android:gravity="center"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/mogo_slogan"
|
||||
android:tileMode="disabled" />
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -66,13 +66,14 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<FrameLayout
|
||||
<ImageView
|
||||
android:id="@+id/module_main_id_cover_up"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/module_main_launcher_bg"
|
||||
android:scaleType="centerCrop"
|
||||
android:background="@drawable/main_bitmap_splash_bg"
|
||||
android:visibility="visible"
|
||||
tools:visibility="gone" />
|
||||
/>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/module_main_id_splash_container"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<item name="android:windowEnterAnimation">@null</item>
|
||||
<item name="android:windowExitAnimation">@null</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:windowBackground">@drawable/module_main_launcher_bg</item>
|
||||
<item name="android:windowBackground">@drawable/main_bitmap_splash_bg</item>
|
||||
<item name="android:windowTranslucentNavigation">false</item>
|
||||
<item name="android:windowAnimationStyle">@style/MainAnimation</item>
|
||||
<item name="checkboxStyle">@style/noCheckboxStyle</item>
|
||||
|
||||
Reference in New Issue
Block a user