Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	modules/mogo-module-main/src/main/java/com/mogo/module/main/MainActivity.java
This commit is contained in:
wujifei
2020-11-24 13:16:51 +08:00
17 changed files with 162 additions and 163 deletions

View File

@@ -62,7 +62,9 @@ public class MogoApplication extends AbsMogoApplication {
crashSystem.setDebug( BuildConfig.DEBUG );
Logger.init( BuildConfig.DEBUG ? LogLevel.VERBOSE : LogLevel.VERBOSE );
MogoModulePaths.addModule( new MogoModule( PATH_GUIDE_FRAGMENT, PATH_GUIDE_MODULE_NAME ) );
if( DebugConfig.isMapBased() ){
MogoModulePaths.addModule( new MogoModule( PATH_GUIDE_FRAGMENT, PATH_GUIDE_MODULE_NAME ) );
}
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_AGREEMENT, AuthorizeConstant.PATH_AGREEMENT_MODULE_NAME ) );
if ( DebugConfig.isLauncher() ) {
@@ -72,7 +74,7 @@ public class MogoApplication extends AbsMogoApplication {
MogoModulePaths.addModule( new MogoModule( ServiceConst.PATH_TTS_CONFIG, ServiceConst.PATH_TTS_CONFIG ) );
MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_WIDGETS, MogoServicePaths.PATH_WIDGETS ) );
if ( DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_BYD ) {
if ( DebugConfig.isMapBased() ) {
MogoModulePaths.addModule( new MogoModule( CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME ) );
}

View File

@@ -75,9 +75,9 @@ public class AppNavigatorFragment extends MvpFragment< AppNavigatorView, AppNavi
mAnim = new AnimWrapper( mAIAssist );
boolean naviStatus = AppServiceHandler.getApis().getMapServiceApi().getNavi( getContext() ).isNaviing();
if ( naviStatus ) {
setCurrentXiaoZhiEmoji( AnimRes.EmojiType.Navigation );
}
// if ( naviStatus ) {
// setCurrentXiaoZhiEmoji( AnimRes.EmojiType.Navigation );
// }
mAIAssist.setOnClickListener( new OnAiAssistClickListener() );
mAIAssistContainer.setOnClickListener( view -> {
@@ -109,12 +109,12 @@ public class AppNavigatorFragment extends MvpFragment< AppNavigatorView, AppNavi
@Override
public void setCurrentXiaoZhiEmoji( AnimRes.EmojiType type ) {
boolean started = mAnim.isStarted();
mAnim.stop();
mAnim.setCurrentAnim( type );
if ( started ) {
mAnim.start();
}
// boolean started = mAnim.isStarted();
// mAnim.stop();
// mAnim.setCurrentAnim( type );
// if ( started ) {
// mAnim.start();
// }
}
@Override

View File

@@ -4,9 +4,6 @@ import com.alibaba.android.arouter.launcher.ARouter
import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant
import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.Companion.AUTHORIZE_TYPE_LAUNCHER_MAIN
import com.mogo.module.authorize.authprovider.module.IMogoAuthorizeModuleManager
import com.mogo.module.common.utils.CarSeries
import com.mogo.module.common.utils.CarSeries.CAR_SERIES_C80X
import com.mogo.module.common.utils.CarSeries.CAR_SERIES_F80X
import com.mogo.module.guide.GuideConstant.Companion.PATH_GUIDE_MODULE_NAME
import com.mogo.module.guide.fragment.GuideFragment
import com.mogo.module.guide.util.SharedPreferenceUtil.hasGuide
@@ -50,9 +47,7 @@ object GuideBizManager {
Logger.d("GuideBizManager", "removeGuideFragmentToStack")
setGuideFinish()
setGuideRecord()
serviceApi?.let {
it.fragmentManagerApi.pop()
}
serviceApi?.fragmentManagerApi?.pop()
serviceApi?.adasControllerApi?.showADAS()
}

View File

@@ -21,7 +21,6 @@ import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.IMogoMarkerClickListener;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.api.CallChatApi;
import com.mogo.module.common.map.MapCenterPointStrategy;
import com.mogo.module.common.map.Scene;
import com.mogo.module.main.cards.MogoModulesManager;
@@ -47,7 +46,7 @@ import java.util.List;
* <p>
* 描述:加载各个模块
*/
public class MainActivity extends MvpActivity<MainView, MainPresenter> implements MainView,
public class MainActivity extends MvpActivity< MainView, MainPresenter > implements MainView,
IMogoLocationListener,
IMogoMarkerClickListener,
IMogoADASControlStatusChangedListener {
@@ -69,16 +68,16 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
@Override
protected int getLayoutId() {
if (!DebugConfig.isMapBased()) {
if ( !DebugConfig.isMapBased() ) {
return R.layout.module_main_activity_main_no_map;
}
return R.layout.module_main_activity_main;
}
@Override
protected void beforeSetContentView(Bundle savedInstanceState) {
protected void beforeSetContentView( Bundle savedInstanceState ) {
init();
installSkinManager(savedInstanceState);
installSkinManager( savedInstanceState );
}
/**
@@ -86,118 +85,117 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
*
* @param savedInstanceState
*/
private void installSkinManager(Bundle savedInstanceState) {
mServiceApis.getMapServiceApi().getMapViewInstanceHandler().createMapViewInstance(this);
mServiceApis.getSkinSupportInstallerApi().install(getApplication());
mServiceApis.getSkinSupportInstallerApi().onCompensateActivityCreated(this, savedInstanceState);
private void installSkinManager( Bundle savedInstanceState ) {
mServiceApis.getMapServiceApi().getMapViewInstanceHandler().createMapViewInstance( this );
mServiceApis.getSkinSupportInstallerApi().install( getApplication() );
mServiceApis.getSkinSupportInstallerApi().onCompensateActivityCreated( this, savedInstanceState );
}
@Override
protected void initViews() {
getWindow().setBackgroundDrawable(null);
getWindow().setBackgroundDrawable( null );
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);
mHistoryMessagePanel = findViewById(R.id.module_main_id_message_history_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 );
mHistoryMessagePanel = findViewById( R.id.module_main_id_message_history_fragment_container );
// 避免事件穿透导致地图被滑动
mLeftShadowFrame.setOnClickListener(view -> {
});
FloatingViewHandler.init(mFloatingLayout);
mLeftShadowFrame.setOnClickListener( view -> {
} );
FloatingViewHandler.init( mFloatingLayout );
mServiceApis.getOnlineCarPanelApi().initContainer(R.id.module_main_id_message_history_fragment_container, this);
CallChatApi.getInstance().getApiProvider().initVehicleTeamContainer("init", R.id.module_main_id_message_history_fragment_container, this);
mServiceApis.getOnlineCarPanelApi().initContainer( R.id.module_main_id_message_history_fragment_container, this );
}
// 隐藏布局
protected void hideLayout() {
mEntrance.setVisibility(View.GONE);
mEventPanel.setVisibility(View.GONE);
mFloatingLayout.setVisibility(View.GONE);
mEntrance.setVisibility( View.GONE );
mEventPanel.setVisibility( View.GONE );
mFloatingLayout.setVisibility( View.GONE );
}
// 显示布局
protected void showLayout() {
mEntrance.setVisibility(View.VISIBLE);
mEventPanel.setVisibility(View.VISIBLE);
mFloatingLayout.setVisibility(View.VISIBLE);
mEntrance.setVisibility( View.VISIBLE );
mEventPanel.setVisibility( View.VISIBLE );
mFloatingLayout.setVisibility( View.VISIBLE );
}
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ContextHolderUtil.holdContext(this);
protected void onCreate( @Nullable Bundle savedInstanceState ) {
super.onCreate( savedInstanceState );
ContextHolderUtil.holdContext( this );
mPresenter.postLoadModuleMsg();
}
private void init() {
if (mServiceApis == null) {
if ( mServiceApis == null ) {
mServiceApis = MogoApisHandler.getInstance().getApis();
}
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());
mMogoStatusManager.setMainPageLaunchedStatus( TAG, true );
AutopilotServiceManage.getInstance().init( getContext() );
}
@Override
public void loadModules() {
final long start = System.currentTimeMillis();
MogoModulesManager.getInstance().init(this);
MogoModulesManager.getInstance().init( this );
loadSplash();
if (DebugConfig.isMapBased()) {
if (mServiceApis.getMapServiceApi() != null) {
mServiceApis.getMapServiceApi().getHostListenerRegister().registerHostMapListener(EventDispatchCenter.getInstance());
mServiceApis.getMapServiceApi().getHostListenerRegister().registerHostNaviListener(EventDispatchCenter.getInstance());
mServiceApis.getMapServiceApi().getHostListenerRegister().registerHostAimlessModeListener(EventDispatchCenter.getInstance());
mServiceApis.getMapServiceApi().getHostListenerRegister().registerMarkerClickListener(this);
if ( DebugConfig.isMapBased() ) {
if ( mServiceApis.getMapServiceApi() != null ) {
mServiceApis.getMapServiceApi().getHostListenerRegister().registerHostMapListener( EventDispatchCenter.getInstance() );
mServiceApis.getMapServiceApi().getHostListenerRegister().registerHostNaviListener( EventDispatchCenter.getInstance() );
mServiceApis.getMapServiceApi().getHostListenerRegister().registerHostAimlessModeListener( EventDispatchCenter.getInstance() );
mServiceApis.getMapServiceApi().getHostListenerRegister().registerMarkerClickListener( this );
}
}
if (DebugConfig.isSkinSupported()) {
if ( DebugConfig.isSkinSupported() ) {
initAdasControlStatusListener();
}
if (DebugConfig.isMapBased()) {
EventDispatchCenter.getInstance().setMapLoadedCallback(() -> {
Logger.d(TAG, "map loaded." + Thread.currentThread().getName());
if ( DebugConfig.isMapBased() ) {
EventDispatchCenter.getInstance().setMapLoadedCallback( () -> {
Logger.d( TAG, "map loaded." + Thread.currentThread().getName() );
resetMapCenterPoint();
loadOthersModules();
Log.i("timer", "cost " + (System.currentTimeMillis() - start) + "ms");
});
MogoModulesManager.getInstance().loadMapModule(R.id.module_main_id_map_fragment_container);
Log.i( "timer", "cost " + ( System.currentTimeMillis() - start ) + "ms" );
} );
MogoModulesManager.getInstance().loadMapModule( R.id.module_main_id_map_fragment_container );
} else {
loadOthersModules();
}
mMogoFragmentManager = mServiceApis.getFragmentManagerApi();
mMogoFragmentManager.init(this, R.id.module_main_id_search_fragment);
mMogoFragmentManager.initMessageHistoryContainerId(R.id.module_main_id_message_history_fragment_container);
mMogoFragmentManager.registerMainFragmentStackTransactionListener((size) -> {
if (size == 0) {
mMogoFragmentManager.init( this, R.id.module_main_id_search_fragment );
mMogoFragmentManager.initMessageHistoryContainerId( R.id.module_main_id_message_history_fragment_container );
mMogoFragmentManager.registerMainFragmentStackTransactionListener( ( size ) -> {
if ( size == 0 ) {
showLayout();
} else if (size == 1) {
} else if ( size == 1 ) {
hideLayout();
}
});
} );
}
private void resetMapCenterPoint() {
// 右移地图中心点
MapCenterPointStrategy.init();
MapCenterPointStrategy.setMapCenterPointByScene(mServiceApis.getMapServiceApi().getMapUIController(), Scene.AIMLESS);
MapCenterPointStrategy.setMapCenterPointByScene( mServiceApis.getMapServiceApi().getMapUIController(), Scene.AIMLESS );
}
private void loadOthersModules() {
@@ -211,66 +209,66 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
}
private void initAdasControlStatusListener() {
mServiceApis.getRegisterCenterApi().registerADASControlStatusChangedListener(TAG, this);
AdasConfigApiController.getInstance().registerAdasSettingUiListener(EventDispatchCenter.getInstance());
AdasConfigApiController.getInstance().registerAdasSettingSkinModelListener(EventDispatchCenter.getInstance());
AdasConfigApiController.getInstance().init(getApplicationContext());
LoggerController.setPrinterLog(DebugConfig.isDebug());
mServiceApis.getRegisterCenterApi().registerADASControlStatusChangedListener( TAG, this );
AdasConfigApiController.getInstance().registerAdasSettingUiListener( EventDispatchCenter.getInstance() );
AdasConfigApiController.getInstance().registerAdasSettingSkinModelListener( EventDispatchCenter.getInstance() );
AdasConfigApiController.getInstance().init( getApplicationContext() );
LoggerController.setPrinterLog( DebugConfig.isDebug() );
}
private void startBaseService() {
Intent intent = new Intent(this, MogoMainService.class);
startService(intent);
Intent intent = new Intent( this, MogoMainService.class );
startService( intent );
}
protected void loadContainerModules() {
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().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 );
}
@Override
public void hideCoverUpLayout() {
Logger.d(TAG, "隐藏遮罩");
mCoverUpLayout.setVisibility(View.GONE);
Logger.d( TAG, "隐藏遮罩" );
mCoverUpLayout.setVisibility( View.GONE );
mServiceApis.getAdasControllerApi().showADAS();
}
@Override
public void loadCardModules() {
List<IMogoModuleProvider> providers = MogoModulesManager.getInstance().loadCardsModule();
List< IMogoModuleProvider > providers = MogoModulesManager.getInstance().loadCardsModule();
}
@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
@Override
protected MainPresenter createPresenter() {
return new MainPresenter(this);
return new MainPresenter( this );
}
@Override
public void onLocationChanged(MogoLocation location) {
EventDispatchCenter.getInstance().onLocationChanged(location);
public void onLocationChanged( MogoLocation location ) {
EventDispatchCenter.getInstance().onLocationChanged( location );
}
@Override
public boolean onMarkerClicked(IMogoMarker marker) {
EventDispatchCenter.getInstance().onMarkerClicked(marker);
public boolean onMarkerClicked( IMogoMarker marker ) {
EventDispatchCenter.getInstance().onMarkerClicked( marker );
return false;
}
@Override
public void onMapUiModeChanged(EnumMapUI mapUI) {
switch (mapUI) {
public void onMapUiModeChanged( EnumMapUI mapUI ) {
switch ( mapUI ) {
case Type_Night:
mServiceApis.getSkinSupportInstallerApi().loadSkin(SkinMode.Night);
mServiceApis.getSkinSupportInstallerApi().loadSkin( SkinMode.Night );
break;
case Type_Light:
mServiceApis.getSkinSupportInstallerApi().loadSkin(SkinMode.Light);
mServiceApis.getSkinSupportInstallerApi().loadSkin( SkinMode.Light );
break;
}
}
@@ -278,25 +276,26 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
@Override
protected void onResume() {
super.onResume();
mMogoStatusManager.setMainPageResumeStatus(TAG, true);
mMogoStatusManager.setMainPageLaunchedStatus(TAG, true);
mMogoStatusManager.setMainPageIsBackgroundStatus(TAG, false);
if (mCoverUpLayout.getVisibility() != View.VISIBLE) {
mMogoStatusManager.setMainPageResumeStatus( TAG, true );
mMogoStatusManager.setMainPageIsBackgroundStatus( TAG, false );
if ( mCoverUpLayout.getVisibility() != View.VISIBLE ) {
mServiceApis.getAdasControllerApi().showADAS();
}
if (mServiceApis.getLauncherApi() != null) {
mServiceApis.getLauncherApi().setFloatButtonVisible(false);
if ( mServiceApis.getLauncherApi() != null ) {
mServiceApis.getLauncherApi().setFloatButtonVisible( false );
}
}
@Override
protected void onPause() {
super.onPause();
mMogoStatusManager.setMainPageResumeStatus(TAG, false);
mMogoStatusManager.setMainPageLaunchedStatus(TAG, false);
mMogoStatusManager.setMainPageResumeStatus( TAG, false );
mServiceApis.getAuthManagerApi().dismiss();
if (mServiceApis.getLauncherApi() != null) {
mServiceApis.getLauncherApi().setFloatButtonVisible(true);
if ( shouldCloseADASPanelWhenPause() ) {
mServiceApis.getAdasControllerApi().closeADAS();
}
if ( mServiceApis.getLauncherApi() != null ) {
mServiceApis.getLauncherApi().setFloatButtonVisible( true );
}
}
@@ -310,21 +309,18 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
@Override
protected void onStop() {
super.onStop();
mMogoStatusManager.setMainPageIsBackgroundStatus(TAG, true);
if (shouldCloseADASPanelWhenPause()) {
mServiceApis.getAdasControllerApi().closeADAS();
}
mMogoStatusManager.setMainPageIsBackgroundStatus( TAG, true );
}
@Override
public void onBackPressed() {
if (mMogoFragmentManager == null
|| mMogoFragmentManager.getStackSize() <= 0) {
if (DebugConfig.isLauncher()) {
if ( mMogoFragmentManager == null
|| mMogoFragmentManager.getStackSize() <= 0 ) {
if ( DebugConfig.isLauncher() ) {
doWhenBackPressed();
return;
} else {
if (doWhenBackPressed()) {
if ( doWhenBackPressed() ) {
return;
}
super.onBackPressed();
@@ -339,14 +335,14 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
mPresenter.handleSchemeIntent(intent, true);
protected void onNewIntent( Intent intent ) {
super.onNewIntent( intent );
mPresenter.handleSchemeIntent( intent, true );
}
@Override
public IMogoServiceApis getApis() {
if (mServiceApis == null) {
if ( mServiceApis == null ) {
mServiceApis = MogoApisHandler.getInstance().getApis();
}
return mServiceApis;
@@ -359,18 +355,17 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
mServiceApis.getMapServiceApi().getHostListenerRegister().unregisterHostAimlessModeListener();
mServiceApis.getMapServiceApi().getHostListenerRegister().unregisterHostNaviListener();
mServiceApis.getMapServiceApi().getHostListenerRegister().unregisterHostMapListener();
mMogoStatusManager.setMainPageLaunchedStatus(TAG, false);
mMogoStatusManager.setMainPageIsBackgroundStatus(TAG, false);
mMogoStatusManager.setMainPageLaunchedStatus( TAG, false );
mMogoStatusManager.setMainPageIsBackgroundStatus( TAG, false );
mMogoFragmentManager.unregisterMainFragmentStackTransactionListener();
mMogoFragmentManager = null;
mServiceApis.getMapServiceApi().getMapViewInstanceHandler().destroy();
AdasConfigApiController.getInstance().release();
mServiceApis.getAdasControllerApi().release();
Logger.d(TAG, "destroy.");
Logger.d( TAG, "destroy." );
mServiceApis.getRefreshStrategyControllerApi().clearAllData();
AIAssist.getInstance(this).release();
AIAssist.getInstance( this ).release();
mServiceApis.getOnlineCarPanelApi().clear();
CallChatApi.getInstance().getApiProvider().initVehicleTeamContainer("uninit",0, null);
ContextHolderUtil.releaseContext();
MogoModulesManager.getInstance().onDestroy();
SchemeIntent.getInstance().clear();

View File

@@ -755,6 +755,10 @@ public class MogoServices implements IMogoMapListener,
return;
}
if (!mStatusManager.isMainPageOnResume()) {
return;
}
if (mStatusManager.isV2XShow()) {
return;
}

View File

@@ -6,7 +6,7 @@ public enum LauncherCardRefreshType {
Weather( "News", "weather", "天气" ),
News( "NearRoads", "news", "新闻" ),
NearRoads( "ExplorerWay", "nearRoads", "近路" ),
// TrafficRestriction( "NearRoads", "trafficRestriction" ),
TrafficRestriction( "NearRoads", "trafficRestriction", "限行" ),
ExplorerWay( "OnlineCar", "friendAndPois", "道路事件" ),
OnlineCar( "Weather", "friendAndPois", "车友" );

View File

@@ -33,6 +33,7 @@ import com.mogo.utils.storage.SharedPrefsMgr;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -455,6 +456,9 @@ class LauncherCardRefresher {
if ( trafficRestriction == null || TextUtils.isEmpty( trafficRestriction.tts ) ) {
continue;
}
final Map< String, Object > properties = new HashMap<>();
properties.put( "type", LauncherCardRefreshType.TrafficRestriction.name() );
MogoApisHandler.getInstance().getApis().getAnalyticsApi().track( "v2x_play", properties );
speakTTS( trafficRestriction.tts, false );
return;
}
@@ -618,6 +622,10 @@ class LauncherCardRefresher {
*/
private void writeNextLoadType( LauncherCardRefreshType type ) {
SharedPrefsMgr.getInstance( mContext ).putString( KEY_LAST_LOAD_TTS_TYPE, type.getNext() );
final Map< String, Object > properties = new HashMap<>();
properties.put( "type", type.name() );
MogoApisHandler.getInstance().getApis().getAnalyticsApi().track( "v2x_play", properties );
Logger.d( TAG, "本次播报:%s下次播报%s", type.name(), LauncherCardRefreshType.valueOf( type.getNext() ).name() );
SharedPrefsMgr.getInstance( mContext ).putLong( KEY_LAST_LOAD_TTS_DATE, System.currentTimeMillis() );
}

View File

@@ -75,30 +75,37 @@ public class GlobalUnwakeManager implements IProvider, IMogoIntentListener, IMog
break;
case VOICE_QUERY_HISTORY_INDEX:
Log.d("语音指令","VOICE_QUERY_HISTORY_INDEX");
Intent startForHis = new Intent( Intent.ACTION_VIEW );
startForHis.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK );
startForHis.setData( Uri.parse( "mogo://launcher/main/switch2?type=showHistoryPanel" ) );
context.startActivity( startForHis );
showPanelByStatus("showHistoryPanel", 0);
break;
case VOICE_QUERY_SURROUNDING_INDEX:
Log.d("语音指令","VOICE_QUERY_SURROUNDING_INDEX");
Intent startForSurrounding = new Intent( Intent.ACTION_VIEW );
startForSurrounding.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK );
startForSurrounding.setData( Uri.parse( "mogo://launcher/main/switch2?type=showSurroundingPanel" ) );
context.startActivity( startForSurrounding );
showPanelByStatus("showSurroundingPanel", 1);
break;
case VOICE_QUERY_HEART_INDEX:
Log.d("语音指令","VOICE_QUERY_HEART_INDEX");
Intent start = new Intent( Intent.ACTION_VIEW );
start.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK );
start.setData( Uri.parse( "mogo://launcher/main/switch2?type=showSharePanel" ) );
context.startActivity( start );
showPanelByStatus("showSharePanel", 2);
break;
default:
break;
}
}
/**
* 根据主页状态调用不同打开方式
* @param target 面板类型
* @param type 面板位置索引
*/
private void showPanelByStatus(String target, int type){
if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isMainPageOnResume() ) {
MogoApisHandler.getInstance().getApis().getEventPanelManager().showPanelWithSelectedItem(type);
} else {
Intent start = new Intent( Intent.ACTION_VIEW );
start.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK );
start.setData( Uri.parse( "mogo://launcher/main/switch2?type="+target ) );
context.startActivity( start );
}
}
@Override
public void onCmdSelected(String cmd) {
Logger.d(TAG, "收到免唤醒词指令: " + cmd);

View File

@@ -257,23 +257,11 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
* 语音查询热心指数需求
* */
fun showPanelWithSelectedItem(item: Int) {
if (isPanelShow()) {
try {
when (item) {
0 -> mV2XScenarioHistoryFragment.ttsForVoiceCheckout()
1 -> mV2XSurroundingFragment.ttsForVoiceCheckout()
else -> mV2XShareEventsFragment.ttsForVoiceCheckout()
}
} catch (e: java.lang.Exception) {
}
} else {
showPanel()
selectWithItem(item)
}
showPanel()
selectWithItem(item)
}
private fun initDetail() {
mDetailRecyclerView!!.addItemDecoration(SpacesItemDecoration(resources.getDimension(R.dimen.share_item_padding).toInt()))
mSurroundingDetailAdapter = V2XSurroundingDetailAdapter(activity, markerExploreWays)

View File

@@ -41,7 +41,7 @@ public class V2XAnimationScenario extends AbsV2XScenario<V2XPushMessageEntity> {
@Override
public void init(@Nullable V2XMessageEntity<V2XPushMessageEntity> v2XMessageEntity) {
if (!isSameScenario(v2XMessageEntity)
&& V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
&& V2XServiceManager.getMoGoStatusManager().isMainPageOnResume()) {
boolean isV2XAnimationShow = V2XServiceManager.getMoGoV2XStatusManager().isV2XAnimationShow();
if (isV2XAnimationShow) {
close();

View File

@@ -59,7 +59,7 @@ public class V2XFatigueDrivingScenario extends AbsV2XScenario<V2XPushMessageEnti
.registerWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_NAVI, mNaviCb)
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_NAVI_UN_WAKEUP, mNaviCb);
if (v2XMessageEntity.isShowState()
&& V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
&& V2XServiceManager.getMoGoStatusManager().isMainPageOnResume()) {
show();
}
}

View File

@@ -49,7 +49,7 @@ public class V2XPushLiveCarScenario extends AbsV2XScenario<V2XPushMessageEntity>
@Override
public void init(@Nullable V2XMessageEntity<V2XPushMessageEntity> v2XMessageEntity) {
if (!isSameScenario(v2XMessageEntity)
&& V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
&& V2XServiceManager.getMoGoStatusManager().isMainPageOnResume()) {
boolean isWindowShow = V2XServiceManager.getMoGoV2XStatusManager().isLeftLiveVideoShow();
if (isWindowShow) {
close();

View File

@@ -51,7 +51,7 @@ public class V2XIllegalParkScenario extends AbsV2XScenario<List<MarkerExploreWay
@Override
public void show() {
if (V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
if (V2XServiceManager.getMoGoStatusManager().isMainPageOnResume()) {
drawPOI();
}
showWindow();
@@ -75,7 +75,7 @@ public class V2XIllegalParkScenario extends AbsV2XScenario<List<MarkerExploreWay
v2XRoadEventEntity.setAlarmContent("违章停车");
v2XRoadEventEntity.setExpireTime(20000);
v2XRoadEventEntity.setPoiType(V2XPoiTypeEnum.ALERT_ILLEGAL_PARK);
if (V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
if (V2XServiceManager.getMoGoStatusManager().isMainPageOnResume()) {
v2XRoadEventEntity.setTts(markerExploreWay.getAddr() + "可能被罚违章停车,您可以说,有用或没用来帮助其它车友。");
((V2XIllegalParkWindow) getV2XWindow()).show(markerExploreWay, true);
TrackUtils.trackV2xRoadShow(markerExploreWay.getInfoId(), V2XPoiTypeEnum.ALERT_ILLEGAL_PARK, "1");

View File

@@ -51,7 +51,7 @@ public class V2XPushEventScenario extends AbsV2XScenario<V2XPushMessageEntity> i
Logger.w(MODULE_NAME, "处理推送场景:" + GsonUtil.jsonFromObject(v2XMessageEntity));
if (!isSameScenario(v2XMessageEntity)
&& V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
&& V2XServiceManager.getMoGoStatusManager().isMainPageOnResume()) {
setV2XMessageEntity(v2XMessageEntity);
show();
} else {

View File

@@ -96,7 +96,7 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
saveLocalStory(V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING,
getV2XMessageEntity().getContent().getNoveltyInfo());
if (V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
if (V2XServiceManager.getMoGoStatusManager().isMainPageOnResume()) {
showWindow();
}
@@ -197,7 +197,7 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
@Override
public void onViewAdded(View view) {
Logger.d(MODULE_NAME, "展示 Window 动画结束");
if (V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
if (V2XServiceManager.getMoGoStatusManager().isMainPageOnResume()) {
if (getV2XMessageEntity() != null && getV2XMessageEntity().isNeedAddLine() == true) {
drawPOI();
}

View File

@@ -81,7 +81,7 @@ public class V2XSeekHelpScenario extends AbsV2XScenario<List<V2XMarkerEntity>> i
saveLocalStory(V2XMessageEntity.V2XTypeEnum.ALERT_SEEK_WARNING, mV2XPushMessageEntity);
if (V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
if (V2XServiceManager.getMoGoStatusManager().isMainPageOnResume()) {
if (getV2XMessageEntity() != null &&
!V2XServiceManager.getMoGoV2XStatusManager().isOtherSeekHelpWindowShow()) {
show();

View File

@@ -51,7 +51,7 @@ public class V2XEventUgcScenario extends AbsV2XScenario<V2XRoadEventEntity> impl
setV2XMessageEntity(v2XMessageEntity);
if (v2XMessageEntity != null) {
if (v2XMessageEntity.isShowState()
&& V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
&& V2XServiceManager.getMoGoStatusManager().isMainPageOnResume()) {
show();
}
}