Merge branch 'qa_1.1.6' of http://gitlab.zhidaoauto.com/ecos/yycp-service/Launcher into qa_1.1.6
This commit is contained in:
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -4,7 +4,7 @@
|
||||
<asm skipDebug="false" skipFrames="false" skipCode="false" expandFrames="false" />
|
||||
<groovy codeStyle="LEGACY" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -86,6 +86,7 @@ public abstract class MogoBaseMapView extends FrameLayout implements ILifeCycle
|
||||
if ( mMapView != null ) {
|
||||
mMapView.onDestroy();
|
||||
}
|
||||
MogoMap.getInstance().clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -46,4 +46,9 @@ public class MogoMap {
|
||||
public IMogoMap getMogoMap() {
|
||||
return mMap;
|
||||
}
|
||||
|
||||
public void clear(){
|
||||
mContext = null;
|
||||
mMap = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,6 +147,8 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
|
||||
private String[] mOuterGuideVoiceStrings;
|
||||
|
||||
private boolean isShowGuide;
|
||||
|
||||
/**
|
||||
* 搜索莫模块
|
||||
*/
|
||||
@@ -382,7 +384,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
|
||||
debugTopView();
|
||||
|
||||
boolean isShowGuide = SharedPrefsMgr.getInstance(AbsMogoApplication.getApp()).getBoolean(getSpGuide(), false);
|
||||
isShowGuide = SharedPrefsMgr.getInstance(AbsMogoApplication.getApp()).getBoolean(getSpGuide(), false);
|
||||
Logger.d(TAG, " isShowGuide = " + isShowGuide + " --isGreaterThanOneDay = " + isGreaterThanOneDay());
|
||||
if (isShowGuide && isGreaterThanOneDay()) {
|
||||
UiThreadHandler.postDelayed(() -> {
|
||||
@@ -396,10 +398,12 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
private boolean isGreaterThanOneDay() {
|
||||
boolean isGreaterThanOneDay;
|
||||
long guideRecordTime = SharedPrefsMgr.getInstance(AbsMogoApplication.getApp()).getLong(getSPGuideRecord(), 0);
|
||||
Logger.d(TAG, " isGreaterThanOneDay interval = " + (System.currentTimeMillis() - guideRecordTime));
|
||||
Logger.d(TAG, " isGreaterThanOneDay interval = " + (System.currentTimeMillis() - guideRecordTime) + "---currentTime = " + System.currentTimeMillis() + "---guideRecordTime =" + guideRecordTime);
|
||||
if ((System.currentTimeMillis() - guideRecordTime) > ONE_DAY_TIME) {
|
||||
Logger.d(TAG, "--------1------");
|
||||
isGreaterThanOneDay = true;
|
||||
} else {
|
||||
Logger.d(TAG, "--------2------");
|
||||
isGreaterThanOneDay = false;
|
||||
}
|
||||
|
||||
@@ -422,13 +426,24 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
if (intervalTime == 0) {
|
||||
SharedPrefsMgr.getInstance(getContext()).putLong(KEY_SHARE_OUTER_GUIDE_TIME, time);
|
||||
SharedPrefsMgr.getInstance(getContext()).putInt(KEY_SHARE_OUTER_GUIDE, ++shareItemSum);
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice(mOuterGuideVoiceStrings[random.nextInt(3)]);
|
||||
// AIAssist.getInstance(getContext()).speakTTSVoice(mOuterGuideVoiceStrings[random.nextInt(3)]);
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice(mOuterGuideVoiceStrings[0]);
|
||||
} else {
|
||||
Logger.d(TAG, " playShareOuterGuideVoice else interval = " + (time - intervalTime));
|
||||
if ((time - intervalTime) > SEVEN_DAY_TIME) {
|
||||
if (shareItemSum == 1) {
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice(mOuterGuideVoiceStrings[1]);
|
||||
} else if (shareItemSum == 2) {
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice(mOuterGuideVoiceStrings[2]);
|
||||
} else if (shareItemSum == 3) {
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice(mOuterGuideVoiceStrings[0]);
|
||||
} else if (shareItemSum == 4) {
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice(mOuterGuideVoiceStrings[1]);
|
||||
} else if (shareItemSum == 5) {
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice(mOuterGuideVoiceStrings[2]);
|
||||
}
|
||||
SharedPrefsMgr.getInstance(getContext()).putLong(KEY_SHARE_OUTER_GUIDE_TIME, time);
|
||||
SharedPrefsMgr.getInstance(getContext()).putInt(KEY_SHARE_OUTER_GUIDE, ++shareItemSum);
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice(mOuterGuideVoiceStrings[random.nextInt(3)]);
|
||||
} else {
|
||||
Logger.e(TAG, " playShareOuterGuideVoice else < ONE_DAY_TIME ");
|
||||
}
|
||||
@@ -450,9 +465,14 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
} else {
|
||||
Logger.d(TAG, " playShareGuideVoice else interval = " + (time - intervalTime));
|
||||
if ((time - intervalTime) > ONE_DAY_TIME) {
|
||||
if (shareItemSum == 1) {
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice(mClickShareVoiceStrings[1]);
|
||||
} else {
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice(mClickShareVoiceStrings[0]);
|
||||
}
|
||||
|
||||
SharedPrefsMgr.getInstance(getContext()).putLong(KEY_CLICK_SHARE_TIME, time);
|
||||
SharedPrefsMgr.getInstance(getContext()).putInt(KEY_CLICK_SHARE_BUTTON, ++shareItemSum);
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice(mClickShareVoiceStrings[1]);
|
||||
} else {
|
||||
Logger.e(TAG, " playShareGuideVoice else < ONE_DAY_TIME ");
|
||||
}
|
||||
@@ -485,13 +505,14 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
} else {
|
||||
Logger.d(TAG, " showSlideMapVoiceGuide else interval = " + (time - intervalTime));
|
||||
if ((time - intervalTime) > ONE_DAY_TIME) {
|
||||
SharedPrefsMgr.getInstance(getContext()).putLong(KEY_SHARE_INNER_GUIDE_TIME, time);
|
||||
SharedPrefsMgr.getInstance(getContext()).putInt(KEY_SHARE_INNER_GUIDE, ++shareItemSum);
|
||||
if (shareItemSum == 1) {
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice(mInnerGuideVoiceStrings[1]);
|
||||
} else {
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice(mInnerGuideVoiceStrings[2]);
|
||||
}
|
||||
SharedPrefsMgr.getInstance(getContext()).putLong(KEY_SHARE_INNER_GUIDE_TIME, time);
|
||||
SharedPrefsMgr.getInstance(getContext()).putInt(KEY_SHARE_INNER_GUIDE, ++shareItemSum);
|
||||
|
||||
} else {
|
||||
Logger.e(TAG, " showSlideMapVoiceGuide else < ONE_DAY_TIME ");
|
||||
}
|
||||
@@ -507,9 +528,12 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
break;
|
||||
|
||||
case MotionEvent.ACTION_UP:
|
||||
if (motionEvent.getX() > 200) {
|
||||
showSlideMapVoiceGuide();
|
||||
if (isShowGuide && isGreaterThanOneDay()) {
|
||||
if (motionEvent.getX() > 200) {
|
||||
showSlideMapVoiceGuide();
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
@@ -582,6 +606,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
super.onDestroyView();
|
||||
isClickShare = false;
|
||||
TopViewAnimHelper.getInstance().removeAllView();
|
||||
TopViewAnimHelper.getInstance().clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -39,7 +39,6 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
import static com.mogo.module.share.constant.ShareConstants.KEY_CLICK_SHARE_BUTTON;
|
||||
import static com.mogo.module.share.constant.ShareConstants.KEY_SERVER_SHOW_DAY_COUNT;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
package com.mogo.module.extensions.net;
|
||||
|
||||
import com.mogo.module.extensions.bean.CommonConfig;
|
||||
import com.mogo.module.extensions.bean.CommonConfigResponse;
|
||||
import com.mogo.module.extensions.userinfo.UserInfoResponse;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.Single;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
@@ -680,4 +680,20 @@ public class TopViewAnimHelper {
|
||||
hideNaviView();
|
||||
MapCenterPointStrategy.setMapCenterPointByScene(mogoMapUIController, Scene.AIMLESS);
|
||||
}
|
||||
|
||||
public void clear(){
|
||||
topMotionLayout = null;
|
||||
remainTimeGroup = null;
|
||||
remainDistanceGroup = null;
|
||||
arriveTimeGroup = null;
|
||||
naviBg = null;
|
||||
ivTurnIcon = null;
|
||||
tvNextDistance = null;
|
||||
tvNextRoad = null;
|
||||
tvNextDistanceUnit = null;
|
||||
tvTurnInfo = null;
|
||||
topContainer = null;
|
||||
cameraMode = null;
|
||||
transition = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -346,6 +346,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
mMogoMapService.getHostListenerRegister().unregisterMarkerClickListener();
|
||||
mMogoStatusManager.setMainPageLaunchedStatus( TAG, false );
|
||||
mMogoMapService = null;
|
||||
mMogoMapUIController = null;
|
||||
@@ -359,5 +360,8 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
mServiceApis.getOnlineCarPanelApi().clear();
|
||||
ContextHolderUtil.releaseContext();
|
||||
MogoModulesManager.getInstance().onDestroy();
|
||||
SchemeIntent.getInstance().clear();
|
||||
FloatingViewHandler.clear();
|
||||
mServiceApis.getShareManager().releaseContext();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,16 +55,23 @@ public class SchemeIntent implements IMogoStatusChangedListener {
|
||||
}
|
||||
}
|
||||
|
||||
private SchemeIntent() {
|
||||
// private constructor
|
||||
private static volatile SchemeIntent sInstance;
|
||||
|
||||
private SchemeIntent(){}
|
||||
|
||||
public static SchemeIntent getInstance(){
|
||||
if( sInstance == null ){
|
||||
synchronized( SchemeIntent.class ) {
|
||||
if( sInstance == null ){
|
||||
sInstance = new SchemeIntent();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
private static final class InstanceHolder {
|
||||
private static final SchemeIntent INSTANCE = new SchemeIntent();
|
||||
}
|
||||
|
||||
public static SchemeIntent getInstance() {
|
||||
return InstanceHolder.INSTANCE;
|
||||
public synchronized void release(){
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
public void init( Context context, IMogoServiceApis apis ) {
|
||||
@@ -73,9 +80,11 @@ public class SchemeIntent implements IMogoStatusChangedListener {
|
||||
mApis.getStatusManagerApi().registerStatusChangedListener( TAG, StatusDescriptor.MAIN_PAGE_RESUME, this );
|
||||
}
|
||||
|
||||
private Object readResolve() {
|
||||
// 阻止反序列化,必须实现 Serializable 接口
|
||||
return InstanceHolder.INSTANCE;
|
||||
public void clear(){
|
||||
mApis.getStatusManagerApi().unregisterStatusChangedListener( TAG, StatusDescriptor.MAIN_PAGE_RESUME, this );
|
||||
mContext = null;
|
||||
mApis = null;
|
||||
|
||||
}
|
||||
|
||||
public void handle( Intent intent ) {
|
||||
|
||||
@@ -41,6 +41,10 @@ public class FloatingViewHandler {
|
||||
sFloatingLayout = frameLayout;
|
||||
}
|
||||
|
||||
public static void clear(){
|
||||
sFloatingLayout = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加任意view到布局,不考虑优先级
|
||||
*
|
||||
|
||||
@@ -338,6 +338,13 @@ public class MockIntentHandler implements IntentHandler {
|
||||
case 30:
|
||||
MarkerServiceHandler.getMapService().getMapUIController().forceRender();
|
||||
break;
|
||||
case 31:
|
||||
Intent intent3 = new Intent();
|
||||
intent3.setAction( "AUTONAVI_STANDARD_BROADCAST_RECV" );
|
||||
intent3.putExtra( "KEY_TYPE", 12404 );
|
||||
intent3.putExtra( "EXTRA_REQUEST_AUTO_STATE", 0 );
|
||||
context.sendBroadcast( intent3 );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ class LauncherCardRefresher {
|
||||
public static final long ONE_MINUTE = 60 * 1000L;
|
||||
public static final long ONE_DAY = 24 * 60 * ONE_MINUTE;
|
||||
private String mLaunchTTSText;
|
||||
private long mDefaultTTSPlayInterval = 2 * ONE_MINUTE;
|
||||
private long mDefaultTTSPlayInterval = 60 * ONE_MINUTE;
|
||||
private LauncherCardAdvertisementData.LauncherCardAdvertisement mDefaultLauncherCardConfig;
|
||||
private List< LauncherCardAdvertisementData.LauncherCardAdvertisement > mAdvertisements;
|
||||
|
||||
@@ -156,7 +156,7 @@ class LauncherCardRefresher {
|
||||
private ZhidaoRefreshModel mZhidaoRefreshModel;
|
||||
|
||||
private LauncherCardRefreshStrategy mExplorerWayOrOnlineCarDataStrategy = new LauncherCardRefreshStrategy(
|
||||
1 * ONE_MINUTE, null, MSG_EXPLORER_WAY_OR_ONLINE_CAR_DATA
|
||||
40 * ONE_MINUTE, null, MSG_EXPLORER_WAY_OR_ONLINE_CAR_DATA
|
||||
);
|
||||
private LauncherCardRefreshStrategy mInduceStrategy = new LauncherCardRefreshStrategy(
|
||||
3 * ONE_MINUTE, mExplorerWayOrOnlineCarDataStrategy, MSG_INDUCE
|
||||
|
||||
@@ -131,6 +131,11 @@ public class ShareControl implements IMogoShareManager, IMogoIntentListener,
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void releaseContext() {
|
||||
mContext = mContext.getApplicationContext();
|
||||
}
|
||||
|
||||
private void realShowDialog() {
|
||||
if (mShareDialog == null) {
|
||||
Logger.d(TAG, "realShowDialog context : " + mContext);
|
||||
|
||||
@@ -82,7 +82,7 @@ object SeekHelpManager {
|
||||
if(!isSeeking) {
|
||||
isSeeking = true
|
||||
if (this.context == null) {
|
||||
this.context = context
|
||||
this.context = context.applicationContext
|
||||
}
|
||||
aiAssist = AIAssist.getInstance(context)
|
||||
|
||||
|
||||
@@ -53,9 +53,16 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
|
||||
private val mV2XShareEventsFragment = V2XShareEventsFragment()
|
||||
|
||||
companion object {
|
||||
private val fragment = V2XEventPanelFragment()
|
||||
private var fragment: V2XEventPanelFragment? = null
|
||||
fun getInstance(): V2XEventPanelFragment {
|
||||
return fragment
|
||||
if (fragment == null) {
|
||||
synchronized(this) {
|
||||
if (fragment == null) {
|
||||
fragment = V2XEventPanelFragment()
|
||||
}
|
||||
}
|
||||
}
|
||||
return fragment as V2XEventPanelFragment
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/module_v2x_fatigue_driving_window_height_ground"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/v2x_alert_window_bg"
|
||||
android:padding="@dimen/dp_25">
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
android:layout_height="@dimen/module_v2x_fatigue_driving_window_height_ground"
|
||||
android:orientation="vertical"
|
||||
android:overScrollMode="never"
|
||||
android:padding="@dimen/module_v2x_widow_top_gaps"
|
||||
tools:itemCount="1"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:listitem="@layout/item_v2x_fault_help" />
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
android:minHeight="@dimen/module_v2x_event_window_height"
|
||||
android:orientation="horizontal"
|
||||
android:overScrollMode="never"
|
||||
android:padding="@dimen/module_v2x_widow_top_gaps"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
@@ -79,4 +79,5 @@
|
||||
|
||||
<dimen name="share_item_text_size">16px</dimen>
|
||||
<dimen name="share_item_padding">20px</dimen>
|
||||
<dimen name="module_v2x_widow_top_gaps">6px</dimen>
|
||||
</resources>
|
||||
|
||||
@@ -79,4 +79,5 @@
|
||||
|
||||
<dimen name="share_item_text_size">16px</dimen>
|
||||
<dimen name="share_item_padding">20px</dimen>
|
||||
<dimen name="module_v2x_widow_top_gaps">3px</dimen>
|
||||
</resources>
|
||||
|
||||
@@ -77,6 +77,6 @@
|
||||
<dimen name="module_v2x_panel_tab_height">158px</dimen>
|
||||
<dimen name="share_item_text_size">26px</dimen>
|
||||
<dimen name="share_item_padding">25px</dimen>
|
||||
|
||||
<dimen name="module_v2x_widow_top_gaps">2px</dimen>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.mogo.utils.CommonUtils;
|
||||
import com.mogo.utils.LaunchUtils;
|
||||
import com.mogo.utils.ResourcesHelper;
|
||||
import com.mogo.utils.TipToast;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -40,6 +41,9 @@ class AutoNaviIntentHandler implements IMogoVoiceCmdCallBack {
|
||||
private static final String TAG = "AutoNaviIntentHandler";
|
||||
public static final String OPEN = "OPEN_APP";
|
||||
|
||||
// 显示浮窗时,同步状态时间间隔
|
||||
public static final long SYNC_INTERVAL = 60_000L;
|
||||
|
||||
private static volatile AutoNaviIntentHandler sInstance;
|
||||
|
||||
private AutoNaviIntentHandler() {
|
||||
@@ -70,27 +74,33 @@ class AutoNaviIntentHandler implements IMogoVoiceCmdCallBack {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
private Runnable mAutoNaviSyncRunnable = () -> {
|
||||
if ( mWindowManagerView != null && mWindowManagerView.isShowing() ) {
|
||||
syncAutoNaviForgroundStatus( AbsMogoApplication.getApp() );
|
||||
}
|
||||
};
|
||||
|
||||
public void handle( Context context, Intent intent ) {
|
||||
int keyType = intent.getIntExtra( "KEY_TYPE", 0 );
|
||||
Logger.d( TAG, "KEY_TYPE = " + keyType );
|
||||
switch ( keyType ) {
|
||||
case 10021:
|
||||
closeEntrance();
|
||||
break;
|
||||
case 10019:
|
||||
int extraState = intent.getIntExtra( "EXTRA_STATE", -1 );
|
||||
Logger.d( TAG, "EXTRA_STATE = " + extraState );
|
||||
switch ( extraState ) {
|
||||
case 3:
|
||||
case 3: // 前台
|
||||
syncAutoNaviNavingStatus( context );
|
||||
break;
|
||||
case 4:
|
||||
case 4: // 后台
|
||||
case 9: // 非导航
|
||||
closeEntrance();
|
||||
break;
|
||||
case 8:
|
||||
case 8: // 导航
|
||||
showEntrance( context );
|
||||
break;
|
||||
case 9:
|
||||
closeEntrance();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -106,6 +116,7 @@ class AutoNaviIntentHandler implements IMogoVoiceCmdCallBack {
|
||||
}
|
||||
|
||||
private void showEntrance( Context context ) {
|
||||
|
||||
if ( mWindowManagerView == null ) {
|
||||
mWindowManagerView = new WindowManagerView.Builder( AbsMogoApplication.getApp() )
|
||||
.contentView( R.layout.module_widgets_app_entrance )
|
||||
@@ -125,9 +136,16 @@ class AutoNaviIntentHandler implements IMogoVoiceCmdCallBack {
|
||||
if ( mWindowManagerView.isShowing() ) {
|
||||
return;
|
||||
}
|
||||
if ( MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getStatusManagerApi()
|
||||
.isMainPageOnResume() ) {
|
||||
return;
|
||||
}
|
||||
mWindowManagerView.show();
|
||||
MogoWidgetManger.getInstance().getApis().getAnalyticsApi().track( "NAVI_button_show", null );
|
||||
AIAssist.getInstance( context ).registerUnWakeupCommand( OPEN, new String[]{"切换到辅助驾驶模式"}, this );
|
||||
UiThreadHandler.postDelayed( mAutoNaviSyncRunnable, SYNC_INTERVAL );
|
||||
} catch ( Exception e ) {
|
||||
Logger.e( TAG, e, "error." );
|
||||
}
|
||||
@@ -221,6 +239,7 @@ class AutoNaviIntentHandler implements IMogoVoiceCmdCallBack {
|
||||
}
|
||||
|
||||
public void closeEntrance() {
|
||||
UiThreadHandler.removeCallbacks( mAutoNaviSyncRunnable );
|
||||
if ( mWindowManagerView == null ) {
|
||||
return;
|
||||
}
|
||||
@@ -233,6 +252,7 @@ class AutoNaviIntentHandler implements IMogoVoiceCmdCallBack {
|
||||
}
|
||||
|
||||
public void syncAutoNaviForgroundStatus( Context context ) {
|
||||
Logger.d( TAG, "查询高德前后台状态" );
|
||||
Intent intent = new Intent();
|
||||
intent.setAction( "AUTONAVI_STANDARD_BROADCAST_RECV" );
|
||||
intent.putExtra( "KEY_TYPE", 12404 );
|
||||
@@ -241,6 +261,7 @@ class AutoNaviIntentHandler implements IMogoVoiceCmdCallBack {
|
||||
}
|
||||
|
||||
public void syncAutoNaviNavingStatus( Context context ) {
|
||||
Logger.d( TAG, "查询高德导航状态" );
|
||||
Intent intent = new Intent();
|
||||
intent.setAction( "AUTONAVI_STANDARD_BROADCAST_RECV" );
|
||||
intent.putExtra( "KEY_TYPE", 12404 );
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
|
||||
public
|
||||
/**
|
||||
@@ -65,7 +66,9 @@ class MogoWidgetManger implements IMogoNaviListener2, IMogoIntentListener, IMogo
|
||||
initMapStatusListener();
|
||||
initStatusListener();
|
||||
initIntentListener();
|
||||
AutoNaviIntentHandler.getInstance().syncAutoNaviForgroundStatus( mContext );
|
||||
UiThreadHandler.postDelayed( ()->{
|
||||
AutoNaviIntentHandler.getInstance().syncAutoNaviForgroundStatus( mContext );
|
||||
}, 1_000L );
|
||||
}
|
||||
|
||||
private void initMapStatusListener() {
|
||||
|
||||
@@ -94,6 +94,6 @@ class MogoWidgetsProvider implements IMogoModuleProvider {
|
||||
Logger.d( TAG, "init." );
|
||||
UiThreadHandler.postDelayed( () -> {
|
||||
MogoWidgetManger.getInstance().init( context );
|
||||
}, 5500 );
|
||||
}, 6_000L );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,4 +25,6 @@ public interface IMogoShareManager extends IProvider {
|
||||
* @param context 待重置的上下文
|
||||
*/
|
||||
void resetContext(Context context);
|
||||
|
||||
void releaseContext();
|
||||
}
|
||||
|
||||
@@ -30,7 +30,6 @@ public class FragmentStack {
|
||||
private FragmentManager mFragmentManager;
|
||||
//private FragmentTransaction mFragmentTransaction;
|
||||
private int mContainerId;
|
||||
private Activity mActivity;
|
||||
private FragmentDescriptor mCurrentFragment;
|
||||
|
||||
private FragmentStackTransactionListener mFragmentStackTransactionListener;
|
||||
@@ -56,7 +55,6 @@ public class FragmentStack {
|
||||
}
|
||||
|
||||
public void init( AppCompatActivity activity, int containerId ) {
|
||||
mActivity = activity;
|
||||
mFragmentManager = activity.getSupportFragmentManager();
|
||||
mContainerId = containerId;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user