diff --git a/app/build.gradle b/app/build.gradle
index ebc29b2bc6..374e60534d 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -214,9 +214,9 @@ android {
// 是否支持换肤
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'true'
// 是否支持查询导航目的地车友
- buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'true'
+ buildConfigField 'boolean', 'IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST', 'false'
// 是否支持桌面卡片刷新
- buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'true'
+ buildConfigField 'boolean', 'IS_SUPPORT_LAUNCHER_CARD_REFRESH_STRATEGY', 'false'
// 是否基于地图
buildConfigField 'boolean', 'IS_MAP_BASED', 'false'
}
@@ -363,7 +363,6 @@ dependencies {
implementation rootProject.ext.dependencies.moduleshare
implementation rootProject.ext.dependencies.tanluupload
implementation rootProject.ext.dependencies.mogomonitor
- implementation rootProject.ext.dependencies.mogomoduleback
implementation rootProject.ext.dependencies.guideshow
implementation rootProject.ext.dependencies.moduleextensions
implementation rootProject.ext.dependencies.modulemap
@@ -380,7 +379,6 @@ dependencies {
implementation project(':modules:mogo-module-share')
implementation project(':libraries:tanlulib')
implementation project(':modules:mogo-module-monitor')
- implementation project(':modules:mogo-module-back')
implementation project(':modules:mogo-module-guide')
implementation project(':modules:mogo-module-extensions')
implementation project(':modules:mogo-module-map')
@@ -395,6 +393,7 @@ dependencies {
apply from: "./functions/crashreport.gradle"
apply from: "./functions/widgets.gradle"
apply from: "./functions/tts.gradle"
+ apply from: "./functions/backwidget.gradle"
// implementation group: "com.tencent.matrix", name: "matrix-android-lib", version: '0.6.6', changing: true
// implementation group: "com.tencent.matrix", name: "matrix-android-commons", version: '0.6.6', changing: true
diff --git a/app/functions/backwidget.gradle b/app/functions/backwidget.gradle
new file mode 100644
index 0000000000..7329178c45
--- /dev/null
+++ b/app/functions/backwidget.gradle
@@ -0,0 +1,9 @@
+// 辅助驾驶占位模块,目前部分车机不上辅助驾驶功能,使用该模块能力代替
+
+project.dependencies {
+ if (Boolean.valueOf(RELEASE)) {
+ launcherImplementation rootProject.ext.dependencies.mogomoduleback
+ } else {
+ launcherImplementation project(':modules:mogo-module-back')
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/mogo/launcher/MogoApplication.java b/app/src/main/java/com/mogo/launcher/MogoApplication.java
index a0bde360cb..4f479ae1cb 100644
--- a/app/src/main/java/com/mogo/launcher/MogoApplication.java
+++ b/app/src/main/java/com/mogo/launcher/MogoApplication.java
@@ -13,7 +13,6 @@ import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.network.Utils;
import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant;
-import com.mogo.module.back.BackToLauncherConst;
import com.mogo.module.carchatting.card.CallChatConstant;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.MogoModule;
@@ -68,11 +67,9 @@ public class MogoApplication extends AbsMogoApplication {
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_AGREEMENT, AuthorizeConstant.PATH_AGREEMENT_MODULE_NAME ) );
if ( DebugConfig.isLauncher() ) {
- MogoModulePaths.addModule( new MogoModule( BackToLauncherConst.MODULE_PATH, BackToLauncherConst.MODULE_NAME ) );
+ MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_BACK, MogoServicePaths.PATH_BACK ) );
MogoModulePaths.addModule( new MogoModule( MediaConstants.TAG, MediaConstants.MODULE_TYPE ) );
- } else {
}
- // TODO
MogoModulePaths.addModule( new MogoModule( ServiceConst.PATH_TTS_CONFIG, ServiceConst.PATH_TTS_CONFIG ) );
MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_WIDGETS, MogoServicePaths.PATH_WIDGETS ) );
diff --git a/foudations/mogo-base-services-sdk/build.gradle b/foudations/mogo-base-services-sdk/build.gradle
index 6a9ad088e4..cc2a2bf725 100644
--- a/foudations/mogo-base-services-sdk/build.gradle
+++ b/foudations/mogo-base-services-sdk/build.gradle
@@ -30,7 +30,7 @@ dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation rootProject.ext.dependencies.arouter
// 上报位置
- implementation 'com.zhidao.locupload:loc-upload-sdk:1.1.3'
+ implementation 'com.zhidao.locupload:loc-upload-sdk:1.1.7'
// 长链
implementation 'com.zhidao.socket:built-in-socket:1.0.15'
// passport
diff --git a/libraries/map-amap/src/main/res/values/dimens.xml b/libraries/map-amap/src/main/res/values/dimens.xml
index 21d58bd9ed..d8d50de3af 100644
--- a/libraries/map-amap/src/main/res/values/dimens.xml
+++ b/libraries/map-amap/src/main/res/values/dimens.xml
@@ -1,7 +1,7 @@
60px
- 44px
- 66px
+ 33px
+ 50px
146px
\ No newline at end of file
diff --git a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppNavigatorFragment.java b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppNavigatorFragment.java
index 1a18f4acc9..dea7792240 100644
--- a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppNavigatorFragment.java
+++ b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppNavigatorFragment.java
@@ -13,6 +13,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.module.apps.adapter.AppIndicatorAdapter;
+import com.mogo.module.apps.anim.AnimRes;
import com.mogo.module.apps.anim.AnimWrapper;
import com.mogo.module.apps.applaunch.AppLauncher;
import com.mogo.module.apps.applaunch.BaseAppLauncher;
@@ -45,7 +46,7 @@ public class AppNavigatorFragment extends MvpFragment< AppNavigatorView, AppNavi
private ImageView mAIAssist;
private View mAIAssistContainer;
- private AnimWrapper mAnim = new AnimWrapper();
+ private AnimWrapper mAnim;
private BaseAppLauncher mLauncher;
@@ -71,7 +72,13 @@ public class AppNavigatorFragment extends MvpFragment< AppNavigatorView, AppNavi
mAIAssistContainer = findViewById( R.id.module_apps_id_ai_assist_container );
mAIAssist = findViewById( R.id.module_apps_id_ai_assist );
- mAnim.initAnim( mAIAssist );
+
+ mAnim = new AnimWrapper( mAIAssist );
+ boolean naviStatus = AppServiceHandler.getApis().getMapServiceApi().getNavi( getContext() ).isNaviing();
+ if ( naviStatus ) {
+ setCurrentXiaoZhiEmoji( AnimRes.EmojiType.Navigation );
+ }
+
mAIAssist.setOnClickListener( new OnAiAssistClickListener() );
mAIAssistContainer.setOnClickListener( view -> {
mAIAssist.performClick();
@@ -100,6 +107,16 @@ public class AppNavigatorFragment extends MvpFragment< AppNavigatorView, AppNavi
mAppIndicatorAdapter.setDatas( NavigatorApps.getApps() );
}
+ @Override
+ public void setCurrentXiaoZhiEmoji( AnimRes.EmojiType type ) {
+ boolean started = mAnim.isStarted();
+ mAnim.stop();
+ mAnim.setCurrentAnim( type );
+ if ( started ) {
+ mAnim.start();
+ }
+ }
+
@Override
public void onResume() {
super.onResume();
@@ -157,6 +174,9 @@ public class AppNavigatorFragment extends MvpFragment< AppNavigatorView, AppNavi
if ( mPresenter != null ) {
mPresenter.onDestroy( getViewLifecycleOwner() );
}
+ if ( mAnim != null ) {
+ mAnim.release();
+ }
AppServiceHandler.getApis().getFragmentManagerApi().removeMainFragmentStackTransactionListener( this );
}
}
diff --git a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppNavigatorPresenter.java b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppNavigatorPresenter.java
index 5aaf7a9c38..39d5d63f83 100644
--- a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppNavigatorPresenter.java
+++ b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppNavigatorPresenter.java
@@ -10,8 +10,11 @@ import com.mogo.commons.mvp.Presenter;
import com.mogo.commons.voice.AIAssist;
import com.mogo.commons.voice.IMogoVoiceCmdCallBack;
import com.mogo.map.navi.IMogoNaviListener2;
+import com.mogo.module.apps.anim.AnimRes;
import com.mogo.module.apps.model.AppsModel;
import com.mogo.service.intent.IMogoIntentListener;
+import com.mogo.service.statusmanager.IMogoStatusChangedListener;
+import com.mogo.service.statusmanager.StatusDescriptor;
import com.mogo.utils.LaunchUtils;
import com.mogo.utils.TipToast;
@@ -26,7 +29,8 @@ import org.json.JSONObject;
*/
public class AppNavigatorPresenter extends Presenter< AppNavigatorView > implements IMogoIntentListener,
IMogoVoiceCmdCallBack,
- IMogoNaviListener2 {
+ IMogoNaviListener2,
+ IMogoStatusChangedListener {
private static final String TAG = "AppNavigatorPresenter";
@@ -42,6 +46,7 @@ public class AppNavigatorPresenter extends Presenter< AppNavigatorView > impleme
// 预加载应用列表,空间换时间
AppsModel.getInstance( getContext() ).load( null );
}
+ AppServiceHandler.getApis().getStatusManagerApi().registerStatusChangedListener( TAG, StatusDescriptor.MEDIA_PLAYER_STATUS, this );
}
@Override
@@ -117,15 +122,38 @@ public class AppNavigatorPresenter extends Presenter< AppNavigatorView > impleme
super.onDestroy( owner );
AppServiceHandler.getApis().getRegisterCenterApi().unregisterMogoNaviListener( TAG );
AppServiceHandler.getApis().getIntentManagerApi().unregisterIntentListener( AppsConst.COMMAND_OPERATION, this );
+ AppServiceHandler.getApis().getStatusManagerApi().unregisterStatusChangedListener( TAG, StatusDescriptor.MEDIA_PLAYER_STATUS, this );
}
@Override
public void onStartNavi() {
mView.hideNavigationEntrance();
+ mView.setCurrentXiaoZhiEmoji( AnimRes.EmojiType.Navigation );
}
@Override
public void onStopNavi() {
mView.showNavigationEntrance();
+ if ( AppServiceHandler.getApis().getStatusManagerApi().isMediaPlaying() ) {
+ mView.setCurrentXiaoZhiEmoji( AnimRes.EmojiType.Music );
+ } else {
+ mView.setCurrentXiaoZhiEmoji( AnimRes.EmojiType.Others );
+ }
+ }
+
+ @Override
+ public void onStatusChanged( StatusDescriptor descriptor, boolean isTrue ) {
+ if ( descriptor != StatusDescriptor.MEDIA_PLAYER_STATUS ) {
+ return;
+ }
+ if ( AppServiceHandler.getApis().getMapServiceApi().getNavi( getContext() ).isNaviing() ) {
+ // 导航优先级更高
+ return;
+ }
+ if ( isTrue ) {
+ mView.setCurrentXiaoZhiEmoji( AnimRes.EmojiType.Music );
+ } else {
+ mView.setCurrentXiaoZhiEmoji( AnimRes.EmojiType.Others );
+ }
}
}
diff --git a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppNavigatorView.java b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppNavigatorView.java
index f67673cb2c..4a66217251 100644
--- a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppNavigatorView.java
+++ b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppNavigatorView.java
@@ -2,6 +2,7 @@ package com.mogo.module.apps;
import com.mogo.commons.mvp.IView;
+import com.mogo.module.apps.anim.AnimRes;
/**
* @author congtaowang
@@ -19,4 +20,11 @@ public interface AppNavigatorView extends IView {
void hideNavigationEntrance();
void showNavigationEntrance();
+
+ /**
+ * 设置当前小智形象表情
+ *
+ * @param type
+ */
+ void setCurrentXiaoZhiEmoji( AnimRes.EmojiType type );
}
diff --git a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/anim/Anim.java b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/anim/Anim.java
index e98e07ee8a..281a1d6e5b 100644
--- a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/anim/Anim.java
+++ b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/anim/Anim.java
@@ -11,4 +11,8 @@ public interface Anim {
void start();
void stop();
+
+ void setCurrentAnim( AnimRes.EmojiType type );
+
+ void release();
}
diff --git a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/anim/AnimRes.java b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/anim/AnimRes.java
index e579d0658a..d5b53da892 100644
--- a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/anim/AnimRes.java
+++ b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/anim/AnimRes.java
@@ -11,7 +11,21 @@ import com.mogo.module.apps.R;
*/
public class AnimRes {
- public static final int sRes[] = {
+ public enum EmojiType {
+ Navigation,
+ Music,
+ Others
+ }
+
+ public static final int sNavigation[] = {
+
+ };
+
+ public static final int sMusic[] = {
+
+ };
+
+ public static final int sAll[][] = new int[][]{{
R.drawable.mogo_tts_icon_00000,
R.drawable.mogo_tts_icon_00001,
R.drawable.mogo_tts_icon_00002,
@@ -23,7 +37,8 @@ public class AnimRes {
R.drawable.mogo_tts_icon_00008,
R.drawable.mogo_tts_icon_00009,
R.drawable.mogo_tts_icon_00010,
- R.drawable.mogo_tts_icon_00011,
+ R.drawable.mogo_tts_icon_00011
+ }, {
R.drawable.mogo_tts_icon_00012,
R.drawable.mogo_tts_icon_00013,
R.drawable.mogo_tts_icon_00014,
@@ -35,7 +50,8 @@ public class AnimRes {
R.drawable.mogo_tts_icon_00020,
R.drawable.mogo_tts_icon_00021,
R.drawable.mogo_tts_icon_00022,
- R.drawable.mogo_tts_icon_00023,
+ R.drawable.mogo_tts_icon_00023
+ }, {
R.drawable.mogo_tts_icon_00024,
R.drawable.mogo_tts_icon_00025,
R.drawable.mogo_tts_icon_00026,
@@ -47,7 +63,8 @@ public class AnimRes {
R.drawable.mogo_tts_icon_00032,
R.drawable.mogo_tts_icon_00033,
R.drawable.mogo_tts_icon_00034,
- R.drawable.mogo_tts_icon_00035,
+ R.drawable.mogo_tts_icon_00035
+ }, {
R.drawable.mogo_tts_icon_00036,
R.drawable.mogo_tts_icon_00037,
R.drawable.mogo_tts_icon_00038,
@@ -59,7 +76,8 @@ public class AnimRes {
R.drawable.mogo_tts_icon_00044,
R.drawable.mogo_tts_icon_00045,
R.drawable.mogo_tts_icon_00046,
- R.drawable.mogo_tts_icon_00047,
+ R.drawable.mogo_tts_icon_00047
+ }, {
R.drawable.mogo_tts_icon_00048,
R.drawable.mogo_tts_icon_00049,
R.drawable.mogo_tts_icon_00050,
@@ -71,7 +89,8 @@ public class AnimRes {
R.drawable.mogo_tts_icon_00056,
R.drawable.mogo_tts_icon_00057,
R.drawable.mogo_tts_icon_00058,
- R.drawable.mogo_tts_icon_00059,
+ R.drawable.mogo_tts_icon_00059
+ }, {
R.drawable.mogo_tts_icon_00060,
R.drawable.mogo_tts_icon_00061,
R.drawable.mogo_tts_icon_00062,
@@ -80,5 +99,7 @@ public class AnimRes {
R.drawable.mogo_tts_icon_00065,
R.drawable.mogo_tts_icon_00066,
R.drawable.mogo_tts_icon_00067
- };
+ }};
+
+ public static int sRes[] = sAll[0];
}
diff --git a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/anim/AnimWrapper.java b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/anim/AnimWrapper.java
index 058ac981ef..97356c4102 100644
--- a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/anim/AnimWrapper.java
+++ b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/anim/AnimWrapper.java
@@ -1,12 +1,8 @@
package com.mogo.module.apps.anim;
-import android.graphics.drawable.AnimationDrawable;
import android.widget.ImageView;
-import com.mogo.module.apps.R;
import com.mogo.module.common.utils.CarSeries;
-import com.mogo.utils.ThreadPoolService;
-import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.logger.Logger;
/**
@@ -18,20 +14,14 @@ import com.mogo.utils.logger.Logger;
public class AnimWrapper implements Anim {
private static final String TAG = "AnimWrapper";
- private ImageView mTarget;
private Anim mDelegate;
private boolean mIsStarted = false;
- public AnimWrapper() {
- }
-
- public void initAnim( ImageView target ) {
- mTarget = target;
+ public AnimWrapper( ImageView target ) {
if ( CarSeries.isF8xxSeries() ) {
mDelegate = new OthersAnim( target );
- start();
} else {
- mTarget.setImageResource( R.drawable.mogo_tts_icon_00000 );
+ mDelegate = new KitkatAnim( target );
}
}
@@ -53,7 +43,22 @@ public class AnimWrapper implements Anim {
}
}
+ @Override
+ public void setCurrentAnim( AnimRes.EmojiType type ) {
+ if ( mDelegate != null ) {
+ mDelegate.setCurrentAnim( type );
+ }
+ }
+
+ public boolean isStarted() {
+ return mIsStarted;
+ }
+
+ @Override
public void release() {
+ if ( mDelegate != null ) {
+ mDelegate.release();
+ }
mDelegate = null;
}
}
diff --git a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/anim/KitkatAnim.java b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/anim/KitkatAnim.java
index 2f3f864367..889aff3bfe 100644
--- a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/anim/KitkatAnim.java
+++ b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/anim/KitkatAnim.java
@@ -1,20 +1,40 @@
package com.mogo.module.apps.anim;
+import android.widget.ImageView;
+
+import com.mogo.module.apps.R;
+
/**
* @author congtaowang
* @since 2020-02-26
*
* 描述
*/
-public class KitkatAnim implements Anim{
+public class KitkatAnim implements Anim {
+
+ private ImageView mTarget;
+
+ public KitkatAnim( ImageView target ) {
+ this.mTarget = target;
+ }
@Override
public void start() {
-
+ mTarget.setImageResource( R.drawable.mogo_tts_icon_00000 );
}
@Override
public void stop() {
}
+
+ @Override
+ public void setCurrentAnim( AnimRes.EmojiType type ) {
+
+ }
+
+ @Override
+ public void release() {
+ mTarget = null;
+ }
}
diff --git a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/anim/OthersAnim.java b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/anim/OthersAnim.java
index aa7259c6ae..dddde7fd71 100644
--- a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/anim/OthersAnim.java
+++ b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/anim/OthersAnim.java
@@ -9,17 +9,20 @@ import android.widget.ImageView;
* @author congtaowang
* @since 2020-02-26
*
- * 描述
+ * 导航>音乐>其他(自己轮询)
*/
public class OthersAnim implements Anim {
private int mStartIndex = 0;
private final static int MSG_LOOP = 3003;
+ public static final int MSG_CHANGE = 3004;
public static final long INTERVAL = 100L;
private boolean mStarted = false;
- private final ImageView mImageView;
+ private ImageView mImageView;
+
+ private int mEmojiIndex = 0;
private Handler mHandler = new Handler( Looper.getMainLooper() ) {
@Override
@@ -28,27 +31,80 @@ public class OthersAnim implements Anim {
switch ( msg.what ) {
case MSG_LOOP:
if ( mStarted ) {
+ if ( AnimRes.sRes.length == 0 ) {
+ return;
+ }
mImageView.setImageResource( AnimRes.sRes[mStartIndex++ % AnimRes.sRes.length] );
mHandler.sendEmptyMessageDelayed( MSG_LOOP, INTERVAL );
}
break;
+ case MSG_CHANGE:
+ if ( mLastType == AnimRes.EmojiType.Others ) {
+ boolean start = mStarted;
+ stop();
+ mEmojiIndex++;
+ AnimRes.sRes = AnimRes.sAll[mEmojiIndex % AnimRes.sAll.length];
+ mStartIndex = 0;
+ if ( start ) {
+ start();
+ }
+ mHandler.sendEmptyMessageDelayed( MSG_CHANGE, 60 * 1_000L );
+ }
+ break;
}
}
};
+ private AnimRes.EmojiType mLastType;
+
public OthersAnim( ImageView imageView ) {
this.mImageView = imageView;
+ mLastType = AnimRes.EmojiType.Others;
+ AnimRes.sRes = AnimRes.sAll[mEmojiIndex];
}
@Override
public void start() {
+ if ( mStarted ) {
+ return;
+ }
mStarted = true;
mHandler.sendEmptyMessage( MSG_LOOP );
+ mHandler.sendEmptyMessageDelayed( MSG_CHANGE, 60 * 1_000L );
}
@Override
public void stop() {
mStarted = false;
mHandler.removeMessages( MSG_LOOP );
+ mHandler.removeMessages( MSG_CHANGE );
+ }
+
+ @Override
+ public void setCurrentAnim( AnimRes.EmojiType type ) {
+ if ( mLastType == type ) {
+ return;
+ }
+ mLastType = type;
+ switch ( type ) {
+ case Navigation:
+ mStartIndex = 0;
+ AnimRes.sRes = AnimRes.sNavigation;
+ break;
+ case Music:
+ mStartIndex = 0;
+ AnimRes.sRes = AnimRes.sMusic;
+ break;
+ case Others:
+ mHandler.sendEmptyMessageDelayed( MSG_CHANGE, 0 * 1_000L );
+ break;
+ }
+ }
+
+ @Override
+ public void release() {
+ stop();
+ mHandler = null;
+ mImageView = null;
}
}
diff --git a/modules/mogo-module-back/src/main/java/com/mogo/module/back/BackToLauncherConst.java b/modules/mogo-module-back/src/main/java/com/mogo/module/back/BackToLauncherConst.java
deleted file mode 100644
index e4a5e8e0f9..0000000000
--- a/modules/mogo-module-back/src/main/java/com/mogo/module/back/BackToLauncherConst.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.mogo.module.back;
-
-/**
- * @author congtaowang
- * @since 2020-02-26
- *
- * 描述
- */
-public class BackToLauncherConst {
-
- public static final String MODULE_NAME ="MOGO_BACK_2_LAUNCHER";
-
- public static final String MODULE_PATH = "/back2launcher/ui";
-}
diff --git a/modules/mogo-module-back/src/main/java/com/mogo/module/back/BackToLauncherModuleProvider.java b/modules/mogo-module-back/src/main/java/com/mogo/module/back/BackToLauncherModuleProvider.java
index fc323c8ae3..952ece3f5c 100644
--- a/modules/mogo-module-back/src/main/java/com/mogo/module/back/BackToLauncherModuleProvider.java
+++ b/modules/mogo-module-back/src/main/java/com/mogo/module/back/BackToLauncherModuleProvider.java
@@ -9,6 +9,8 @@ import androidx.fragment.app.Fragment;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.commons.debug.DebugConfig;
+import com.mogo.module.common.MogoModulePaths;
+import com.mogo.service.MogoServicePaths;
import com.mogo.service.module.IMogoModuleProvider;
import com.mogo.service.module.ModuleType;
@@ -18,7 +20,7 @@ import com.mogo.service.module.ModuleType;
*
* 描述
*/
-@Route( path = BackToLauncherConst.MODULE_PATH )
+@Route( path = MogoServicePaths.PATH_BACK )
public class BackToLauncherModuleProvider implements IMogoModuleProvider {
private static final String TAG = "BackToLauncherModuleProvider";
@@ -36,7 +38,7 @@ public class BackToLauncherModuleProvider implements IMogoModuleProvider {
@NonNull
@Override
public String getModuleName() {
- return BackToLauncherConst.MODULE_NAME;
+ return TAG;
}
@Override
diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java
index 9fceff9c20..968689a9d4 100644
--- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java
+++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java
@@ -15,6 +15,7 @@ import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
+import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
@@ -118,7 +119,7 @@ public class EntranceFragment extends MvpFragment implements Weathe
// 相当于每次onResume都会请求一下个人信息,目的是能够相对及时的同步手机端的个人信息修改
requestUserInfo();
}
- requestCarModelList();
+ if(DebugConfig.isMapBased()) {
+ requestCarModelList();
+ }
getCommonConfig();
}
diff --git a/modules/mogo-module-main/src/main/java/com/mogo/module/main/MainActivity.java b/modules/mogo-module-main/src/main/java/com/mogo/module/main/MainActivity.java
index 22692aeddb..eb3be1a916 100644
--- a/modules/mogo-module-main/src/main/java/com/mogo/module/main/MainActivity.java
+++ b/modules/mogo-module-main/src/main/java/com/mogo/module/main/MainActivity.java
@@ -278,7 +278,9 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
if ( mCoverUpLayout.getVisibility() != View.VISIBLE ) {
mServiceApis.getAdasControllerApi().showADAS();
}
- mServiceApis.getLauncherApi().setFloatButtonVisible( false );
+ if ( mServiceApis.getLauncherApi() != null ) {
+ mServiceApis.getLauncherApi().setFloatButtonVisible( false );
+ }
}
@Override
@@ -290,7 +292,9 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
if ( shouldCloseADASPanelWhenPause() ) {
mServiceApis.getAdasControllerApi().closeADAS();
}
- mServiceApis.getLauncherApi().setFloatButtonVisible( true );
+ if ( mServiceApis.getLauncherApi() != null ) {
+ mServiceApis.getLauncherApi().setFloatButtonVisible( true );
+ }
}
protected boolean shouldCloseADASPanelWhenPause() {
diff --git a/modules/mogo-module-main/src/main/java/com/mogo/module/main/SchemeIntent.java b/modules/mogo-module-main/src/main/java/com/mogo/module/main/SchemeIntent.java
index bda89f02ad..08b519fed8 100644
--- a/modules/mogo-module-main/src/main/java/com/mogo/module/main/SchemeIntent.java
+++ b/modules/mogo-module-main/src/main/java/com/mogo/module/main/SchemeIntent.java
@@ -112,7 +112,9 @@ public class SchemeIntent implements IMogoStatusChangedListener {
delay = 5_000L;
}
mNextIntent = new IntentWrapper(intent, delay);
- mApis.getLauncherApi().backToLauncher(mContext);
+ if ( mApis.getLauncherApi() != null ) {
+ mApis.getLauncherApi().backToLauncher(mContext);
+ }
return;
}
diff --git a/modules/mogo-module-map/src/main/java/com/mogo/module/map/MapPresenter.java b/modules/mogo-module-map/src/main/java/com/mogo/module/map/MapPresenter.java
index 0c0f8722a6..cf2e41b2a7 100644
--- a/modules/mogo-module-map/src/main/java/com/mogo/module/map/MapPresenter.java
+++ b/modules/mogo-module-map/src/main/java/com/mogo/module/map/MapPresenter.java
@@ -117,7 +117,9 @@ public class MapPresenter extends Presenter< MapView > implements
AIAssist.getInstance( getContext() ).speakTTSVoice( "已为您继续导航" );
UiThreadHandler.removeCallbacks( mLockCarRunnable );
} else {
- mLauncher.backToLauncher( getContext() );
+ if ( mLauncher != null ) {
+ mLauncher.backToLauncher( getContext() );
+ }
UiThreadHandler.postDelayed( () -> {
try {
mStatusManager.setDisplayOverview( TAG, false );
@@ -136,7 +138,9 @@ public class MapPresenter extends Presenter< MapView > implements
if ( CustomNaviInterrupter.getInstance().interrupt() ) {
return;
}
- mLauncher.backToLauncher( getContext() );
+ if ( mLauncher != null ) {
+ mLauncher.backToLauncher( getContext() );
+ }
if ( !mMogoMapService.getNavi( getContext() ).isNaviing() && !mStatusManager.isSearchUIShow() ) {
mSearchManager.showSearch();
}
@@ -148,7 +152,9 @@ public class MapPresenter extends Presenter< MapView > implements
if ( CustomNaviInterrupter.getInstance().interrupt() ) {
return;
}
- mLauncher.backToLauncher( getContext() );
+ if ( mLauncher != null ) {
+ mLauncher.backToLauncher( getContext() );
+ }
mMogoSearchManager.calculatePath( new MogoLatLng( lat, lon ) );
}
@@ -158,7 +164,9 @@ public class MapPresenter extends Presenter< MapView > implements
// 导航过程中语音指令退出导航,会出现 activity 不走 onResume 的情况
UiThreadHandler.postDelayed( () -> {
if ( AppUtils.isAppForeground( getContext() ) && !hasOthersActivity() && !mStatusManager.isMainPageOnResume() ) {
- mLauncher.backToLauncher( getContext() );
+ if ( mLauncher != null ) {
+ mLauncher.backToLauncher( getContext() );
+ }
}
}, 500L );
return;
@@ -203,7 +211,9 @@ public class MapPresenter extends Presenter< MapView > implements
mView.getUIController().displayOverview( mDisplayOverviewBounds );
AIAssist.getInstance( getContext() ).speakTTSVoice( "展示全程路线" );
} else {
- mLauncher.backToLauncher( getContext() );
+ if ( mLauncher != null ) {
+ mLauncher.backToLauncher( getContext() );
+ }
UiThreadHandler.postDelayed( () -> {
mStatusManager.setUserInteractionStatus( TAG, true, false );
mStatusManager.setDisplayOverview( TAG, true );
diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java
index e78d6601cc..a27ce3c033 100644
--- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java
+++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java
@@ -171,7 +171,6 @@ public class MogoServices implements IMogoMapListener,
private IMogoIntentManager mIntentManager;
private IMogoActionManager mActionManager;
private IMogoADASController mADASController;
- private IMogoLauncher mLauncher;
private IMogoFragmentManager mFragmentManager;
private IMogoNavi mNavi;
private IMogoRegisterCenter mRegisterCenter;
@@ -557,7 +556,6 @@ public class MogoServices implements IMogoMapListener,
mIntentManager.registerIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, this);
mADASController = MarkerServiceHandler.getADASController();
- mLauncher = MarkerServiceHandler.getLauncher();
mFragmentManager = MarkerServiceHandler.getFragmentManager();
mFragmentManager.addMainFragmentStackTransactionListener(this);
diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/MyLocationHandler.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/MyLocationHandler.java
index 4504dd7e01..95f1d1e6c6 100644
--- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/MyLocationHandler.java
+++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/MyLocationHandler.java
@@ -22,7 +22,9 @@ public class MyLocationHandler implements IntentHandler {
if ( MarkerServiceHandler.getMogoStatusManager().isMainPageOnResume() ) {
MarkerServiceHandler.getMapUIController().recoverLockMode();
} else {
- MarkerServiceHandler.getLauncher().backToLauncher( context );
+ if ( MarkerServiceHandler.getLauncher() != null ) {
+ MarkerServiceHandler.getLauncher().backToLauncher( context );
+ }
UiThreadHandler.postDelayed( () -> {
MarkerServiceHandler.getMapUIController().recoverLockMode();
}, 2_000L );
diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/WholeVoiceCommandIntentHandler.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/WholeVoiceCommandIntentHandler.java
index e7f77292d1..757877f314 100644
--- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/WholeVoiceCommandIntentHandler.java
+++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/intent/WholeVoiceCommandIntentHandler.java
@@ -50,7 +50,9 @@ class WholeVoiceCommandIntentHandler implements IntentHandler {
}
switch ( command ) {
case ServiceConst.COMMAND_BACK:
- MarkerServiceHandler.getLauncher().backToLauncher( context );
+ if ( MarkerServiceHandler.getLauncher() != null ) {
+ MarkerServiceHandler.getLauncher().backToLauncher( context );
+ }
break;
}
}
diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/launchercard/LauncherCardRefresher.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/launchercard/LauncherCardRefresher.java
index 6aae344515..184b2578e9 100644
--- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/launchercard/LauncherCardRefresher.java
+++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/launchercard/LauncherCardRefresher.java
@@ -25,7 +25,6 @@ import com.mogo.module.service.network.bean.TtsConfigData;
import com.mogo.service.passport.IMogoTicketCallback;
import com.mogo.utils.AppUtils;
import com.mogo.utils.NetworkUtils;
-import com.mogo.utils.glide.GlideApp;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.RequestOptions;
import com.mogo.utils.network.utils.GsonUtil;
@@ -33,6 +32,7 @@ import com.mogo.utils.storage.SharedPrefsMgr;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -54,6 +54,8 @@ class LauncherCardRefresher {
public static final String KEY_LauncherCardTipLastTipTime = "LauncherCardTipLastTipTime";
public static final String KEY_LAST_LOAD_TTS_TYPE = "keyLastLoadTtsType";
+ public static final String KEY_LAST_LOAD_TTS_DATE = "keyLastLoadTtsDate";
+
private static volatile LauncherCardRefresher sInstance;
@@ -374,9 +376,20 @@ class LauncherCardRefresher {
*/
private void requestTtsStrategyConfig() {
+ long lastPlayDateTime = SharedPrefsMgr.getInstance( mContext ).getLong( KEY_LAST_LOAD_TTS_DATE, 0L );
+ if ( lastPlayDateTime != 0 ) {
+ Date lastPlayDate = new Date( lastPlayDateTime );
+ if ( lastPlayDate.getDate() == new Date( System.currentTimeMillis() ).getDate() ) {
+ Logger.d( TAG, "一天只播报一次" );
+ return;
+ }
+ }
+
String name = SharedPrefsMgr.getInstance( mContext ).getString( KEY_LAST_LOAD_TTS_TYPE, LauncherCardRefreshType.Weather.name() );
LauncherCardRefreshType type = LauncherCardRefreshType.valueOf( name );
+ Logger.d( TAG, "本次播报:%s", name );
+
MogoLocation location = MogoApisHandler.getInstance().getApis().getMapServiceApi().getSingletonLocationClient( mContext ).getLastKnowLocation();
TtsConfigBody body = new TtsConfigBody()
.addType( LauncherCardRefreshType.NearRoads.getVal() )
@@ -395,6 +408,7 @@ class LauncherCardRefresher {
@Override
public void onError( Throwable e ) {
super.onError( e );
+ Logger.e( TAG, e, "queryBroadCastInfo" );
}
@Override
@@ -469,6 +483,7 @@ class LauncherCardRefresher {
break;
}
+ Logger.d( TAG, "header = %s", header.type.getVal() );
TtsConfigNode pointer = header;
do {
@@ -561,13 +576,13 @@ class LauncherCardRefresher {
* @return
*/
private boolean handleExplorerWayTtsConfig( TtsConfigData.OnlineCarVsExplorerWay explorerWay ) {
- if ( explorerWay == null || explorerWay.pois == 0 ) {
+ if ( explorerWay == null || explorerWay.poiTotal == 0 ) {
return false;
}
String tts = mContext.getString( R.string.module_service_launcher_card_tips );
String info = mContext.getString( R.string.module_service_launcher_card_info );
- speakTTS( String.format( tts, explorerWay.pois, LauncherCardRefreshType.ExplorerWay.getDesc() ), false );
- notifyRefreshChanged( String.format( info, explorerWay.pois, LauncherCardRefreshType.ExplorerWay ), explorerWay.pois, tts );
+ speakTTS( String.format( tts, explorerWay.poiTotal, LauncherCardRefreshType.ExplorerWay.getDesc() ), false );
+ notifyRefreshChanged( String.format( info, explorerWay.poiTotal, LauncherCardRefreshType.ExplorerWay ), explorerWay.poiTotal, tts );
return true;
}
@@ -578,13 +593,13 @@ class LauncherCardRefresher {
* @return
*/
private boolean handleOnlineCarTtsConfig( TtsConfigData.OnlineCarVsExplorerWay onlineCar ) {
- if ( onlineCar == null || onlineCar.friends == 0 ) {
+ if ( onlineCar == null || onlineCar.carTotal == 0 ) {
return false;
}
String tts = mContext.getString( R.string.module_service_launcher_card_tips );
String info = mContext.getString( R.string.module_service_launcher_card_info );
- speakTTS( String.format( tts, onlineCar.friends, LauncherCardRefreshType.OnlineCar.getDesc() ), false );
- notifyRefreshChanged( String.format( info, onlineCar.friends, LauncherCardRefreshType.OnlineCar ), onlineCar.friends, tts );
+ speakTTS( String.format( tts, onlineCar.carTotal, LauncherCardRefreshType.OnlineCar.getDesc() ), false );
+ notifyRefreshChanged( String.format( info, onlineCar.carTotal, LauncherCardRefreshType.OnlineCar ), onlineCar.carTotal, tts );
return true;
}
@@ -595,7 +610,8 @@ class LauncherCardRefresher {
*/
private void writeNextLoadType( LauncherCardRefreshType type ) {
SharedPrefsMgr.getInstance( mContext ).putString( KEY_LAST_LOAD_TTS_TYPE, type.getNext() );
- Logger.d( TAG, "本次播报:%s,下次播报:%s", type.getVal(), LauncherCardRefreshType.valueOf( type.getNext() ).getVal() );
+ Logger.d( TAG, "本次播报:%s,下次播报:%s", type.name(), LauncherCardRefreshType.valueOf( type.getNext() ).name() );
+ SharedPrefsMgr.getInstance( mContext ).putLong( KEY_LAST_LOAD_TTS_DATE, System.currentTimeMillis() );
}
diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/RefreshApiService.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/RefreshApiService.java
index 9827e26941..8ba5edf003 100644
--- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/RefreshApiService.java
+++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/RefreshApiService.java
@@ -45,6 +45,6 @@ public interface RefreshApiService {
Observable< HomeCompanyDistanceForPushResponse > calculationNotHomeCompanyDistanceForPush( @FieldMap Map< String, Object > parameters );
@FormUrlEncoded
- @POST( "/yycp-launcherSnapshot/appCard/queryBroadCastInfo" )
+ @POST( "/yycp-launcherSnapshot/appCard/queryAppCardData" )
Observable< TtsConfigData > queryBroadCastInfo( @FieldMap Map< String, Object > parameters );
}
diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/bean/TtsConfigData.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/bean/TtsConfigData.java
index 43cac9bf43..2c055df068 100644
--- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/bean/TtsConfigData.java
+++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/bean/TtsConfigData.java
@@ -31,20 +31,14 @@ class TtsConfigData extends BaseData {
}
public static class Weather extends BaseConfig {
-
- public String time;
- public String date;
- public String ymd;
- public String week;
- public String sunrise;
- public String high;
- public String low;
- public String sunset;
- public int aqi;
- public String fx;
- public String fl;
- public String type;
- public String notice;
+ public String cityName;
+ public String cityId;
+ public String weather;
+ public int hour;
+ public int weatherCode;
+ public double weatherTime;
+ public int alarmLevel;
+ public int alarmType;
}
public static class News extends BaseConfig {
@@ -78,12 +72,12 @@ class TtsConfigData extends BaseData {
/**
* 车友数量
*/
- public int friends;
+ public int carTotal;
/**
* 道路事件数量
*/
- public int pois;
+ public int poiTotal;
}
}
diff --git a/modules/mogo-module-service/src/main/res/values/strings.xml b/modules/mogo-module-service/src/main/res/values/strings.xml
index cea05ad3d2..46bb81ce90 100644
--- a/modules/mogo-module-service/src/main/res/values/strings.xml
+++ b/modules/mogo-module-service/src/main/res/values/strings.xml
@@ -9,7 +9,7 @@
距离导航目的地
查看车友信息
电话
- 很抱歉,目的地%dKM内未找到车友
+ 很抱歉,目的地%d公里内未找到车友
目的地车友
加载失败,请点击重试
diff --git a/modules/mogo-module-share/src/main/java/com/mogo/module/share/StrategyShareProvider.kt b/modules/mogo-module-share/src/main/java/com/mogo/module/share/StrategyShareProvider.kt
index f0ab2cfd02..13782a98fe 100644
--- a/modules/mogo-module-share/src/main/java/com/mogo/module/share/StrategyShareProvider.kt
+++ b/modules/mogo-module-share/src/main/java/com/mogo/module/share/StrategyShareProvider.kt
@@ -52,7 +52,6 @@ class StrategyShareProvider : IProvider {
}
} catch (e: Exception) {
Logger.e(S_TAG, e, "解析adas数据异常")
- e.printStackTrace()
}
}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XSurroundingAdapter.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XSurroundingAdapter.java
index 2fefe935c1..fa111adadc 100644
--- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XSurroundingAdapter.java
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XSurroundingAdapter.java
@@ -74,16 +74,11 @@ public class V2XSurroundingAdapter extends RecyclerView.Adapter {
mAddressTv = itemView.findViewById(R.id.tvAddress);
mIllegalNumTv = itemView.findViewById(R.id.tvIllegalNum);
mIlIllegalParkingLike = itemView.findViewById(R.id.llIllegalParkingLike);
- Drawable drawable = ContextCompat.getDrawable(viewGroup.getContext(), R.drawable.icon_heart_like_bg);
- mIlIllegalParkingLike.setBackground(drawable);
mIIllegalParkingUnLike = itemView.findViewById(R.id.llIllegalParkingUnLike);
// 设置视图状态监听
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XRoadEventVH.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XRoadEventVH.java
index ba73a92fc6..85c7effcc5 100644
--- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XRoadEventVH.java
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XRoadEventVH.java
@@ -1,7 +1,6 @@
package com.mogo.module.v2x.adapter.holder;
import android.content.Intent;
-import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
@@ -10,8 +9,6 @@ import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
-import androidx.core.content.ContextCompat;
-
import com.mogo.commons.debug.DebugConfig;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerUserInfo;
@@ -136,8 +133,6 @@ public class V2XRoadEventVH extends V2XBaseViewHolder {
ivEventLive = itemView.findViewById(R.id.ivEventLive);
ivEventCallChart = itemView.findViewById(R.id.ivEventCallChart);
ivEventZan = itemView.findViewById(R.id.ivEventZan);
- Drawable drawable = ContextCompat.getDrawable(itemView.getContext(), R.drawable.icon_heart_like_bg);
- ivEventZan.setBackground(drawable);
ivEventReportTrue = itemView.findViewById(R.id.ivEventReportTrue);
ivEventReportErr = itemView.findViewById(R.id.ivEventReportErr);
}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XScenarioHistoryIllegalParkVH.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XScenarioHistoryIllegalParkVH.java
index 3998c9a69a..e32d6aef52 100644
--- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XScenarioHistoryIllegalParkVH.java
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XScenarioHistoryIllegalParkVH.java
@@ -1,14 +1,11 @@
package com.mogo.module.v2x.adapter.holder;
-import android.content.res.TypedArray;
-import android.graphics.drawable.Drawable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
-import androidx.core.content.ContextCompat;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.V2XHistoryScenarioData;
@@ -50,8 +47,6 @@ public class V2XScenarioHistoryIllegalParkVH extends V2XBaseViewHolder()
+
private val mV2XScenarioHistoryFragment = V2XScenarioHistoryFragment()
private val mV2XShareEventsFragment = V2XShareEventsFragment()
private val mV2XSurroundingFragment = V2XSurroundingFragment()
@@ -77,6 +101,11 @@ class V2XEventPanelFragment : MvpFragment
try {
@@ -120,6 +149,12 @@ class V2XEventPanelFragment : MvpFragment "封路"
+ MarkerPoiTypeEnum.FOURS_ICE -> "道路结冰"
+ MarkerPoiTypeEnum.FOURS_FOG -> "浓雾"
+ MarkerPoiTypeEnum.TRAFFIC_CHECK -> "交通检查"
+ MarkerPoiTypeEnum.FOURS_ACCIDENT -> "交通事故"
+ MarkerPoiTypeEnum.FOURS_BLOCK_UP -> "拥堵"
+ MarkerPoiTypeEnum.FOURS_ROAD_WORK -> "施工"
+ MarkerPoiTypeEnum.FOURS_PONDING -> "道路积水"
+ MarkerPoiTypeEnum.FOURS_LIVING -> "实时路况"
+ else -> "实时路况"
+ }
+ return typeName
+ }
+
private fun selectWithItem(item: Int) {
when (item) {
0 -> {
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XSurroundingFragment.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XSurroundingFragment.java
index a9d2cfd849..92ebcde361 100644
--- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XSurroundingFragment.java
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XSurroundingFragment.java
@@ -26,6 +26,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.android.arouter.launcher.ARouter;
+import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.commons.voice.AIAssist;
import com.mogo.map.MogoLatLng;
@@ -53,6 +54,8 @@ import com.mogo.service.MogoServicePaths;
import com.mogo.utils.WorkThreadHandler;
import com.mogo.utils.logger.Logger;
+import org.greenrobot.eventbus.EventBus;
+
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
@@ -82,14 +85,6 @@ public class V2XSurroundingFragment extends MvpFragment markerExploreWays = new ArrayList<>();
-
-
@Override
protected int getLayoutId() {
@@ -118,13 +113,6 @@ public class V2XSurroundingFragment extends MvpFragment 0) {
AIAssist.getInstance(V2XUtils.getApp()).
speakTTSVoice("为您找到周边以下事件请查看", null);
@@ -323,99 +300,76 @@ public class V2XSurroundingFragment extends MvpFragment exploreWayList = construction.getConstrutList();
+ Logger.d(TAG, "onItemClickListener exploreWayList.size() = " + exploreWayList.size());
+ if (exploreWayList != null && exploreWayList.size() > 0) {
+ for (int i = 0; i < exploreWayList.size(); i++) {
+ MarkerExploreWay exploreWay = exploreWayList.get(i);
+ MarkerShowEntity markerShowEntity = new MarkerShowEntity();
+ markerShowEntity.setBindObj(exploreWay);
+ markerShowEntity.setChecked(false);
+ markerShowEntity.setTextContent(exploreWay.getAddr());
+ markerShowEntity.setMarkerLocation(exploreWay.getLocation());
+ markerShowEntity.setMarkerType(ServiceConst.CARD_TYPE_ROAD_CONDITION);
+
+ WorkThreadHandler.getInstance().postDelayed(() -> {
+ IMogoMarker mogoMarker = V2XServiceManager.getIMogoMarkerService().drawMarker(markerShowEntity);
+ // 点击监听,天际弹窗展示详情
+ if (mogoMarker != null) {
+ mogoMarker.startScaleAnimation(0, 1.2f, 0, 1.2f, 300, new AccelerateInterpolator(), new OnMarkerAnimationListener() {
+ @Override
+ public void onAnimStart() {
+ Logger.d(TAG, " onItemClickListener onAnimStart -----> ");
+ }
+
+ @Override
+ public void onAnimEnd() {
+ if (mogoMarker.isDestroyed()) {
+ return;
+ }
+ Logger.d(TAG, " onItemClickListener onAnimEnd ------> ");
+ mogoMarker.startScaleAnimation(1.2f, 1, 1.2f, 1, 100, new LinearInterpolator(), null);
+ }
+ });
+ mogoMarker.setOwner(markerShowEntity.getMarkerType());
+ mogoMarker.setObject(markerShowEntity);
+ }
+ }, i * 100L);
+ }
+
+ //自适应显示
+ showBonndsRoadtion(exploreWayList);
+ } else {
+ Logger.e(TAG, "onItemClickListener exploreWayList == null");
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
}
}
-// @Override
-// public void onItemClickListener(View v, int position, SurroundingConstruction construction) {
-// if (construction != null) {
-// //卡片消失
-// V2XEventPanelFragment.Companion.getInstance().hidePanel();
-// //清除道路事件
-// V2XServiceManager.getMarkerManager().removeMarkers(ServiceConst.CARD_TYPE_ROAD_CONDITION);
-//
-// try {
-// //处理 marker的显示
-// List exploreWayList = construction.getConstrutList();
-// Logger.d(TAG, "onItemClickListener exploreWayList.size() = " + exploreWayList.size());
-// if (exploreWayList != null && exploreWayList.size() > 0) {
-// for (int i = 0; i < exploreWayList.size(); i++) {
-// MarkerExploreWay exploreWay = exploreWayList.get(i);
-// MarkerShowEntity markerShowEntity = new MarkerShowEntity();
-// markerShowEntity.setBindObj(exploreWay);
-// markerShowEntity.setChecked(false);
-// markerShowEntity.setTextContent(exploreWay.getAddr());
-// markerShowEntity.setMarkerLocation(exploreWay.getLocation());
-// markerShowEntity.setMarkerType(ServiceConst.CARD_TYPE_ROAD_CONDITION);
-//
-// WorkThreadHandler.getInstance().postDelayed(() -> {
-// IMogoMarker mogoMarker = V2XServiceManager.getIMogoMarkerService().drawMarker(markerShowEntity);
-// // 点击监听,天际弹窗展示详情
-// if (mogoMarker != null) {
-// mogoMarker.startScaleAnimation(0, 1.2f, 0, 1.2f, 300, new AccelerateInterpolator(), new OnMarkerAnimationListener() {
-// @Override
-// public void onAnimStart() {
-// Logger.d(TAG, " onItemClickListener onAnimStart -----> ");
-// }
-//
-// @Override
-// public void onAnimEnd() {
-// if (mogoMarker.isDestroyed()) {
-// return;
-// }
-// Logger.d(TAG, " onItemClickListener onAnimEnd ------> ");
-// mogoMarker.startScaleAnimation(1.2f, 1, 1.2f, 1, 100, new LinearInterpolator(), null);
-// }
-// });
-// mogoMarker.setOwner(markerShowEntity.getMarkerType());
-// mogoMarker.setObject(markerShowEntity);
-// }
-// }, i * 100L);
-// }
-//
-// //自适应显示
-// showBonndsRoadtion(exploreWayList);
-// } else {
-// Logger.e(TAG, "onItemClickListener exploreWayList == null");
-// }
-// } catch (Exception e) {
-// e.printStackTrace();
-// }
-// }
-// }
-
-
/**
* 自适应显示
*
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/SurroundingItemClickListener.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/SurroundingItemClickListener.java
index 83eef72f09..3ebf7bccf3 100644
--- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/SurroundingItemClickListener.java
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/SurroundingItemClickListener.java
@@ -10,5 +10,5 @@ import com.mogo.module.v2x.entity.panel.SurroundingConstruction;
* @since 2020/8/10
*/
public interface SurroundingItemClickListener {
- void onItemClickListener(View v, int position, SurroundingConstruction construction, String poiType);
+ void onItemClickListener(View v, int position, SurroundingConstruction construction);
}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/HeartLikeView.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/HeartLikeView.java
index 71f3f204c2..817d7c67f6 100644
--- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/HeartLikeView.java
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/HeartLikeView.java
@@ -4,8 +4,6 @@ import android.animation.Animator;
import android.animation.AnimatorInflater;
import android.animation.AnimatorSet;
import android.content.Context;
-import android.content.res.TypedArray;
-import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;
@@ -25,6 +23,7 @@ public class HeartLikeView extends LinearLayout implements Animator.AnimatorList
private ImageView mIllegalParkingLike;
private AnimatorSet mAnimatorSet;
private OnClickCallListener mOnClickCallListener;
+
private boolean isAnimator = false;
public HeartLikeView(Context context) {
diff --git a/modules/mogo-module-v2x/src/main/res/drawable-mdpi/icon_history_heart_back.png b/modules/mogo-module-v2x/src/main/res/drawable-mdpi/icon_history_heart_back.png
new file mode 100644
index 0000000000..119a39baa7
Binary files /dev/null and b/modules/mogo-module-v2x/src/main/res/drawable-mdpi/icon_history_heart_back.png differ
diff --git a/modules/mogo-module-v2x/src/main/res/drawable-xhdpi/icon_history_heart_back.png b/modules/mogo-module-v2x/src/main/res/drawable-xhdpi/icon_history_heart_back.png
deleted file mode 100644
index e8c003d0ea..0000000000
Binary files a/modules/mogo-module-v2x/src/main/res/drawable-xhdpi/icon_history_heart_back.png and /dev/null differ
diff --git a/modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_surrounding_event_list_item.xml b/modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_surrounding_event_list_item.xml
new file mode 100644
index 0000000000..d1f0a2354f
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_surrounding_event_list_item.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_surrounding_road_type.xml b/modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_surrounding_road_type.xml
new file mode 100644
index 0000000000..e789d681a3
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_surrounding_road_type.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-v2x/src/main/res/layout/item_v2x_event_detail.xml b/modules/mogo-module-v2x/src/main/res/layout/item_v2x_event_detail.xml
index 451abab86d..bc25522ee9 100644
--- a/modules/mogo-module-v2x/src/main/res/layout/item_v2x_event_detail.xml
+++ b/modules/mogo-module-v2x/src/main/res/layout/item_v2x_event_detail.xml
@@ -194,10 +194,10 @@
diff --git a/modules/mogo-module-v2x/src/main/res/layout/module_event_panel_fragment_surrounding.xml b/modules/mogo-module-v2x/src/main/res/layout/module_event_panel_fragment_surrounding.xml
index dca25c89b9..d335682a1c 100644
--- a/modules/mogo-module-v2x/src/main/res/layout/module_event_panel_fragment_surrounding.xml
+++ b/modules/mogo-module-v2x/src/main/res/layout/module_event_panel_fragment_surrounding.xml
@@ -5,201 +5,148 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
-
+
-
-
+
-
+ android:layout_height="@dimen/module_v2x_surrounding_top_height"
+ android:visibility="visible">
+
+
+
+
+ android:layout_width="@dimen/module_v2x_surrounding_top_bt_width"
+ android:layout_height="@dimen/module_v2x_surrounding_top_bt_height"
+ android:layout_alignParentRight="true"
+ android:layout_centerVertical="true"
+ android:layout_marginEnd="@dimen/module_v2x_surrounding_margin_left"
+ android:background="@drawable/bg_v2x_refresh"
+ android:gravity="center">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_below="@+id/tv_main_empty_2"
+ android:layout_marginTop="@dimen/module_v2x_surrounding_empty_bt_margin_top">
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/modules/mogo-module-v2x/src/main/res/layout/module_v2x_event_surrounding_detail_item.xml b/modules/mogo-module-v2x/src/main/res/layout/module_v2x_event_surrounding_detail_item.xml
index 3753401c25..cf502b43fc 100644
--- a/modules/mogo-module-v2x/src/main/res/layout/module_v2x_event_surrounding_detail_item.xml
+++ b/modules/mogo-module-v2x/src/main/res/layout/module_v2x_event_surrounding_detail_item.xml
@@ -5,7 +5,7 @@
android:id="@+id/surrounding_root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:background="@drawable/bg_v2x_event_list_item">
+ android:background="@drawable/bg_v2x_surrounding_event_list_item">
+ tools:text="小黄庄北街与北三环辅路交叉口" />
+ tools:text="小蘑菇" />
@@ -51,14 +53,14 @@
android:id="@+id/surrounding_road_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginStart="@dimen/dp_36"
- android:layout_marginTop="@dimen/dp_12"
+ android:layout_marginStart="20px"
+ android:layout_marginTop="6px"
android:layout_marginBottom="@dimen/dp_36"
android:background="@drawable/bg_v2x_event_type_read"
android:gravity="center"
- android:paddingLeft="5px"
+ android:paddingLeft="6px"
android:paddingTop="3px"
- android:paddingRight="5px"
+ android:paddingRight="6px"
android:paddingBottom="3px"
android:text="违章停车"
android:textColor="#ffffff"
diff --git a/modules/mogo-module-v2x/src/main/res/layout/view_heart_like.xml b/modules/mogo-module-v2x/src/main/res/layout/view_heart_like.xml
index 9abaf966f6..8080b8a457 100644
--- a/modules/mogo-module-v2x/src/main/res/layout/view_heart_like.xml
+++ b/modules/mogo-module-v2x/src/main/res/layout/view_heart_like.xml
@@ -3,6 +3,7 @@
android:id="@+id/llIllegalParkingLike"
android:layout_width="@dimen/module_v2x_event_button_size"
android:layout_height="@dimen/module_v2x_event_button_size"
+ android:background="@drawable/icon_heart_like_bg"
android:gravity="center">
- @dimen/dp_40
-
-
-
-
-
\ No newline at end of file
diff --git a/modules/mogo-module-widgets/src/main/java/com/mogo/module/widgets/AutoNaviIntentHandler.java b/modules/mogo-module-widgets/src/main/java/com/mogo/module/widgets/AutoNaviIntentHandler.java
index 66d798f936..940e957a6a 100644
--- a/modules/mogo-module-widgets/src/main/java/com/mogo/module/widgets/AutoNaviIntentHandler.java
+++ b/modules/mogo-module-widgets/src/main/java/com/mogo/module/widgets/AutoNaviIntentHandler.java
@@ -227,7 +227,9 @@ class AutoNaviIntentHandler implements IMogoVoiceCmdCallBack {
private void enterApp( Context context ) {
try {
if ( DebugConfig.isLauncher() ) {
- MogoWidgetManger.getInstance().getApis().getLauncherApi().backToLauncher( context );
+ if ( MogoWidgetManger.getInstance().getApis().getLauncherApi() != null ) {
+ MogoWidgetManger.getInstance().getApis().getLauncherApi().backToLauncher( context );
+ }
} else {
LaunchUtils.launchByPkg( context, "com.mogo.launcher.app" );
}
diff --git a/services/mogo-service-api/src/main/java/com/mogo/service/MogoServicePaths.java b/services/mogo-service-api/src/main/java/com/mogo/service/MogoServicePaths.java
index 5cc6cba1d2..8d5f687c8e 100644
--- a/services/mogo-service-api/src/main/java/com/mogo/service/MogoServicePaths.java
+++ b/services/mogo-service-api/src/main/java/com/mogo/service/MogoServicePaths.java
@@ -279,4 +279,9 @@ public class MogoServicePaths {
* 全局免唤醒
*/
public static final String PATH_GLOBAL_UNWAKE = "/global/unwake";
+
+ /**
+ * 返回悬浮按钮
+ */
+ public static final String PATH_BACK = "/back2launcher/ui";
}
diff --git a/services/mogo-service/src/main/java/com/mogo/service/impl/adas/MogoADASController.java b/services/mogo-service/src/main/java/com/mogo/service/impl/adas/MogoADASController.java
index 4da127db85..141b24d974 100644
--- a/services/mogo-service/src/main/java/com/mogo/service/impl/adas/MogoADASController.java
+++ b/services/mogo-service/src/main/java/com/mogo/service/impl/adas/MogoADASController.java
@@ -101,7 +101,11 @@ public class MogoADASController implements IMogoADASController {
public void sendMsg(String msg) {
Logger.d(TAG, "收到adas数据回调: " + msg);
for (IMogoAdasDataCallback callback : adasDataCallbackList) {
- callback.onAdasDataCallback(msg);
+ try {
+ callback.onAdasDataCallback(msg);
+ } catch ( Exception e ) {
+ Logger.e( TAG, e, "sendMsg" );
+ }
}
}
diff --git a/skin/mogo-skin-light/src/main/module-v2x-res/drawable-ldpi/v2x_back_image_light.png b/skin/mogo-skin-light/src/main/module-v2x-res/drawable-ldpi/v2x_back_image_light.png
new file mode 100644
index 0000000000..532c21499d
Binary files /dev/null and b/skin/mogo-skin-light/src/main/module-v2x-res/drawable-ldpi/v2x_back_image_light.png differ
diff --git a/skin/mogo-skin-light/src/main/module-v2x-res/drawable-mdpi/icon_history_heart_back_light.png b/skin/mogo-skin-light/src/main/module-v2x-res/drawable-mdpi/icon_history_heart_back_light.png
new file mode 100644
index 0000000000..20b806a8cb
Binary files /dev/null and b/skin/mogo-skin-light/src/main/module-v2x-res/drawable-mdpi/icon_history_heart_back_light.png differ
diff --git a/skin/mogo-skin-light/src/main/module-v2x-res/drawable-mdpi/v2x_back_image_light.png b/skin/mogo-skin-light/src/main/module-v2x-res/drawable-mdpi/v2x_back_image_light.png
new file mode 100644
index 0000000000..532c21499d
Binary files /dev/null and b/skin/mogo-skin-light/src/main/module-v2x-res/drawable-mdpi/v2x_back_image_light.png differ
diff --git a/skin/mogo-skin-light/src/main/module-v2x-res/drawable-xhdpi/icon_history_heart_back_light.png b/skin/mogo-skin-light/src/main/module-v2x-res/drawable-xhdpi/icon_history_heart_back_light.png
new file mode 100644
index 0000000000..63d3c57392
Binary files /dev/null and b/skin/mogo-skin-light/src/main/module-v2x-res/drawable-xhdpi/icon_history_heart_back_light.png differ
diff --git a/skin/mogo-skin-light/src/main/module-v2x-res/drawable/bg_v2x_surrounding_event_list_item_light.xml b/skin/mogo-skin-light/src/main/module-v2x-res/drawable/bg_v2x_surrounding_event_list_item_light.xml
new file mode 100644
index 0000000000..05f8c02d99
--- /dev/null
+++ b/skin/mogo-skin-light/src/main/module-v2x-res/drawable/bg_v2x_surrounding_event_list_item_light.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
\ No newline at end of file