This commit is contained in:
unknown
2020-11-24 10:38:05 +08:00
15 changed files with 57 additions and 52 deletions

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

@@ -277,7 +277,6 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
protected void onResume() {
super.onResume();
mMogoStatusManager.setMainPageResumeStatus( TAG, true );
mMogoStatusManager.setMainPageLaunchedStatus( TAG, true );
mMogoStatusManager.setMainPageIsBackgroundStatus( TAG, false );
if ( mCoverUpLayout.getVisibility() != View.VISIBLE ) {
mServiceApis.getAdasControllerApi().showADAS();
@@ -291,8 +290,10 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
protected void onPause() {
super.onPause();
mMogoStatusManager.setMainPageResumeStatus( TAG, false );
mMogoStatusManager.setMainPageLaunchedStatus( TAG, false );
mServiceApis.getAuthManagerApi().dismiss();
if ( shouldCloseADASPanelWhenPause() ) {
mServiceApis.getAdasControllerApi().closeADAS();
}
if ( mServiceApis.getLauncherApi() != null ) {
mServiceApis.getLauncherApi().setFloatButtonVisible( true );
}
@@ -309,9 +310,6 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
protected void onStop() {
super.onStop();
mMogoStatusManager.setMainPageIsBackgroundStatus( TAG, true );
if ( shouldCloseADASPanelWhenPause() ) {
mServiceApis.getAdasControllerApi().closeADAS();
}
}
@Override

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();
}
}