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

This commit is contained in:
tongchenfei
2020-07-22 17:55:28 +08:00
314 changed files with 1125 additions and 1109 deletions

View File

@@ -24,9 +24,7 @@ android {
buildTypes {
release {
minifyEnabled true
zipAlignEnabled true
consumerProguardFiles 'consumer-rules.pro'
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

View File

@@ -1 +1,4 @@
#-----AppModule-----
-keep class com.mogo.module.apps.model.AppEnum
-keep class com.mogo.module.apps.view.**{*;}
-keep class com.mogo.module.apps.AppFilter

View File

@@ -19,3 +19,8 @@
# If you keep the line number information, uncomment this to
# hide the original source file mName.
#-renamesourcefileattribute SourceFile
#-----AppModule-----
-keep class com.mogo.module.apps.model.AppEnum
-keep class com.mogo.module.apps.view.** {*;}
-keep class com.mogo.module.apps.AppFilter

View File

@@ -47,6 +47,24 @@ public class AppsListActivity extends MvpActivity< AppsListView, AppsListPresent
AppServiceHandler.getApis().getStatusManagerApi().setAppListUIShow( TAG, true );
}
@Override
protected void onStart() {
super.onStart();
try {
AppServiceHandler.getApis().getAdasControllerApi().closeADAS();
} catch ( Exception e ) {
}
}
@Override
protected void onRestart() {
super.onRestart();
try {
AppServiceHandler.getApis().getAdasControllerApi().closeADAS();
} catch ( Exception e ) {
}
}
@Override
protected int getLayoutId() {
return R.layout.module_apps_activity_list;

View File

@@ -28,9 +28,7 @@ android {
buildTypes {
release {
minifyEnabled true
zipAlignEnabled true
consumerProguardFiles 'consumer-rules.pro'
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

View File

@@ -1,2 +1,2 @@
#-----AuthorizeModule-----
-keep class com.mogo.module.authorize.module.bean.*{*;}
-keep class com.mogo.module.authorize.module.bean.**{*;}

View File

@@ -21,4 +21,4 @@
#-renamesourcefileattribute SourceFile
#-----AuthorizeModule-----
-keep class com.mogo.module.authorize.module.bean.*{*;}
-keep class com.mogo.module.authorize.module.bean.**{*;}

View File

@@ -6,8 +6,6 @@ import com.mogo.module.authorize.authprovider.module.IMogoAcquireAuthorizeListen
import com.mogo.module.authorize.model.proxy.AuthorizeProxy
import com.mogo.module.authorize.model.proxy.toAuthorizeType
import com.mogo.module.authorize.util.SharedPreferenceUtil.needAuthorization
import com.mogo.module.authorize.util.SharedPreferenceUtil.setAuthorizeStatus
import com.mogo.module.authorize.util.isDeviceOfD
import com.mogo.utils.logger.Logger
open abstract class MogoAuthorizeManagerImpl : IMogoAuthorizeInvoke {
@@ -19,13 +17,9 @@ open abstract class MogoAuthorizeManagerImpl : IMogoAuthorizeInvoke {
private val baseController: IMogoAuthorizeController by lazy { IMogoAuthorizeController() }
override fun needAuthorize(tag: String): Boolean {
return if (isDeviceOfD()) {
Logger.d(TAG, "===== needAuthorize update agreement in background")
baseController.checkIfNeedAuthorize(tag.toAuthorizeType())
needAuthorization(tag.toAuthorizeType())
} else {
false
}
Logger.d(TAG, "===== needAuthorize update agreement in background")
baseController.checkIfNeedAuthorize(tag.toAuthorizeType())
return needAuthorization(tag.toAuthorizeType())
}
override fun updateAuthorizeStatus(tag: String) {

View File

@@ -13,8 +13,6 @@ import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant.Companion
import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant.Companion.PATH_AGREEMENT_MODULE_NAME
import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.Companion.AUTHORIZE_TYPE_LAUNCHER_MAIN
import com.mogo.module.authorize.authprovider.launcher.MogoMainAuthorize.Companion.mogoAuthShow
import com.mogo.module.authorize.util.SharedPreferenceUtil.hasGuide
import com.mogo.module.authorize.util.isDeviceOfD
import com.mogo.service.module.IMogoModuleLifecycle
import com.mogo.service.module.IMogoModuleProvider
import com.mogo.service.module.ModuleType
@@ -66,7 +64,8 @@ class MogoAuthorizeProvider : IMogoModuleProvider {
override fun init(context: Context) {
//todo 引导判断暂时去掉 后续引导流程更改完再放开
// todo if (isDeviceOfD() && hasGuide() && mogoAuthShow.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_MAIN)) {
if (isDeviceOfD() && mogoAuthShow.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_MAIN)) {
// todo F系列暂时没有授权功能 1.1需求中添加 全量上
if (mogoAuthShow.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_MAIN)) {
mogoAuthShow.invokeAuthorizeForShow(context)
} else {
//首次进入Launcher同步一下授权状态防止由于用户清除数据造成首次加载还会出现授权状态不同步问题

View File

@@ -1,10 +0,0 @@
package com.mogo.module.authorize.util
import com.mogo.module.common.utils.CarSeries.*
fun isDeviceOfD(): Boolean {
return when (getSeries()) {
CAR_SERIES_D80X, CAR_SERIES_D81X, CAR_SERIES_D82X, CAR_SERIES_D84X -> true
else -> false
}
}

View File

@@ -0,0 +1,2 @@
#-----ModuleBack-----
-keep class com.mogo.module.back.BackToLauncherConst.*{*;}

View File

@@ -19,3 +19,6 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-----ModuleBack-----
-keep class com.mogo.module.back.BackToLauncherConst.*{*;}

View File

@@ -15,9 +15,7 @@ android {
buildTypes {
release {
minifyEnabled true
zipAlignEnabled true
consumerProguardFiles 'consumer-rules.pro'
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

View File

@@ -1,4 +1,8 @@
#-----CommonModule-----
-keep class com.mogo.module.common.entity.*
-keep class com.mogo.module.common.entity.*{*;}
-keep class com.mogo.module.common.entity.MarkerResponse.*{*;}
-keep class com.mogo.module.common.entity.** {*;}
-keep class com.mogo.module.common.map.Interrupter
-keep class com.mogo.module.common.map.Scene
-keep class com.mogo.module.common.wm.** {*;}
-keep class com.mogo.module.common.ModuleNames
-keep class com.mogo.module.common.ModuleType
-keep class com.mogo.module.common.MogoModulePaths

View File

@@ -21,6 +21,8 @@
#-renamesourcefileattribute SourceFile
#-----CommonModule-----
-keep class com.mogo.module.common.entity.*
-keep class com.mogo.module.common.entity.*{*;}
-keep class com.mogo.module.common.entity.MarkerResponse.*{*;}
-keep class com.mogo.module.common.entity.** {*;}
-keep class com.mogo.module.common.map.Interrupter
-keep class com.mogo.module.common.map.Scene
-keep class com.mogo.module.common.wm.** {*;}
-keep class com.mogo.module.common.MogoModulePaths

View File

@@ -0,0 +1 @@
-keep class com.zhidao.mogo.module.event.panel.EventPanelConstants

View File

@@ -18,4 +18,6 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile
-keep class com.zhidao.mogo.module.event.panel.EventPanelConstants

View File

@@ -25,9 +25,7 @@ android {
buildTypes {
release {
minifyEnabled true
zipAlignEnabled true
consumerProguardFiles 'consumer-rules.pro'
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

View File

@@ -1,3 +1,5 @@
#-----EventPanel------
-keep class com.zhidao.mogo.module.event.panel.bean.*{*;}
-keep class com.zhidao.mogo.module.event.panel.dao.*{*;}
-keep class com.zhidao.mogo.module.event.panel.bean.** {*;}
-keep class com.zhidao.mogo.module.event.panel.dao.** {*;}
-keep class com.zhidao.mogo.module.event.panel.listener.** {*;}
-keep class com.zhidao.mogo.module.event.panel.EventPanelConstants

View File

@@ -21,5 +21,7 @@
#-renamesourcefileattribute SourceFile
#-----EventPanel------
-keep class com.zhidao.mogo.module.event.panel.bean.*{*;}
-keep class com.zhidao.mogo.module.event.panel.dao.*{*;}
-keep class com.zhidao.mogo.module.event.panel.bean.** {*;}
-keep class com.zhidao.mogo.module.event.panel.dao.** {*;}
-keep class com.zhidao.mogo.module.event.panel.listener.** {*;}
-keep class com.zhidao.mogo.module.event.panel.EventPanelConstants

View File

@@ -22,9 +22,7 @@ android {
buildTypes {
release {
minifyEnabled true
zipAlignEnabled true
consumerProguardFiles 'consumer-rules.pro'
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

View File

@@ -1,2 +1,8 @@
#-----ExtensionModule-----
-keep class com.mogo.module.extensions.userinfo.UserInfoResponse.*{*;}
-keep class com.mogo.module.extensions.userinfo.**{*;}
-keep class com.mogo.module.extensions.weather.Phenomena
-keep class com.mogo.module.extensions.weather.WeatherCallback
-keep interface com.mogo.module.extensions.net.UserInfoNetApiServices
-keep class com.mogo.module.extensions.utils.TopViewAnimHelper
-keep class com.mogo.module.extensions.ExtensionsView
-keep class com.mogo.module.extensions.ExtensionsModuleConst

View File

@@ -21,4 +21,10 @@
#-renamesourcefileattribute SourceFile
#-----ExtensionModule-----
-keep class com.mogo.module.extensions.userinfo.UserInfoResponse.*{*;}
-keep class com.mogo.module.extensions.userinfo.**{*;}
-keep class com.mogo.module.extensions.weather.Phenomena
-keep class com.mogo.module.extensions.weather.WeatherCallback
-keep interface com.mogo.module.extensions.net.UserInfoNetApiServices
-keep class com.mogo.module.extensions.utils.TopViewAnimHelper
-keep class com.mogo.module.extensions.ExtensionsView
-keep class com.mogo.module.extensions.ExtensionsModuleConst

View File

@@ -1,9 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" >
<shape>
<corners android:radius="@dimen/module_ext_common_corner" />
<gradient android:angle="135" android:endColor="#1C1E28" android:startColor="#242737" />
</shape>
</item>
<item>
<shape>
<corners android:radius="@dimen/module_ext_common_corner" />
<gradient android:angle="135" android:endColor="#3F435F" android:startColor="#2E3141" />
<gradient android:angle="135" android:endColor="#48495E" android:startColor="#616381" />
</shape>
</item>
</selector>

View File

@@ -1,5 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<gradient android:angle="135" android:endColor="#ff113361" android:startColor="#ff124B98" android:type="linear" />
<corners android:radius="@dimen/module_ext_common_corner" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<gradient android:angle="135" android:endColor="#ff1e57a4" android:startColor="#ff1f7eff" android:type="linear" />

View File

@@ -21,9 +21,7 @@ android {
buildTypes {
release {
minifyEnabled true
zipAlignEnabled true
consumerProguardFiles 'consumer-rules.pro'
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

View File

@@ -0,0 +1,2 @@
#-----MogoGSPSimulator-----
-keep class com.mogo.module.gps.simulator.GpsSimulatorConstants

View File

@@ -19,3 +19,6 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-----MogoGSPSimulator-----
-keep class com.mogo.module.gps.simulator.GpsSimulatorConstants

View File

@@ -28,9 +28,7 @@ android {
buildTypes {
release {
minifyEnabled true
zipAlignEnabled true
consumerProguardFiles 'consumer-rules.pro'
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

View File

@@ -0,0 +1,2 @@
#-----ModuleLeftPanel-----
-keep class com.zhidao.mogo.module.left.panel.LeftPanelConst

View File

@@ -18,4 +18,7 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile
#-----ModuleLeftPanel-----
-keep class com.zhidao.mogo.module.left.panel.LeftPanelConst

View File

@@ -0,0 +1,2 @@
#-----ModuleLeftPanel-----
-keep class com.zhidao.mogo.module.left.panel.LeftPanelConst

View File

@@ -18,4 +18,7 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile
#-----ModuleLeftPanel-----
-keep class com.zhidao.mogo.module.left.panel.LeftPanelConst

View File

@@ -21,9 +21,7 @@ android {
buildTypes {
release {
minifyEnabled true
zipAlignEnabled true
consumerProguardFiles 'consumer-rules.pro'
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

View File

@@ -1,2 +1,9 @@
#-----MainModule-----
-keep class com.mogo.module.main.cards.CardIntroduceConfig.*{*;}
-keep class com.mogo.module.main.cards.CardIntroduceConfig.*{*;}
-keep class com.mogo.module.main.cards.MogoModulesHandler
-keep class com.mogo.module.main.cards.HorizentalBaseTransformer
-keep class com.mogo.module.main.cards.VerticalBaseTransformer
-keep class com.mogo.module.main.constants.**{*;}
-keep class com.mogo.module.main.livedata.**{*;}
-keep class com.mogo.module.main.service.MogoMainService
-keep class com.mogo.module.main.windowview.IWindowViewHandler

View File

@@ -21,4 +21,11 @@
#-renamesourcefileattribute SourceFile
#-----MainModule-----
-keep class com.mogo.module.main.cards.CardIntroduceConfig.*{*;}
-keep class com.mogo.module.main.cards.CardIntroduceConfig.*{*;}
-keep class com.mogo.module.main.cards.MogoModulesHandler
-keep class com.mogo.module.main.cards.HorizentalBaseTransformer
-keep class com.mogo.module.main.cards.VerticalBaseTransformer
-keep class com.mogo.module.main.constants.**{*;}
-keep class com.mogo.module.main.livedata.**{*;}
-keep class com.mogo.module.main.service.MogoMainService
-keep class com.mogo.module.main.windowview.IWindowViewHandler

View File

@@ -21,6 +21,7 @@ import com.mogo.map.marker.IMogoMarkerClickListener;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.module.common.map.MapCenterPointStrategy;
import com.mogo.module.common.map.Scene;
import com.mogo.module.common.utils.CarSeries;
import com.mogo.module.main.cards.MogoModulesManager;
import com.mogo.module.main.service.MogoMainService;
import com.mogo.module.main.windowview.FloatingViewHandler;
@@ -30,7 +31,6 @@ import com.mogo.service.fragmentmanager.IMogoFragmentManager;
import com.mogo.service.intent.IMogoIntentListener;
import com.mogo.service.map.IMogoMapService;
import com.mogo.service.module.IMogoModuleProvider;
import com.mogo.service.obu.IMogoObuManager;
import com.mogo.service.statusmanager.IMogoStatusManager;
import com.mogo.utils.logger.Logger;
import com.zhidao.autopilot.support.api.AutopilotServiceManage;
@@ -244,12 +244,21 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
super.onPause();
mMogoStatusManager.setMainPageResumeStatus( TAG, false );
mMogoStatusManager.setMainPageLaunchedStatus( TAG, false );
if ( !mIsHomeKeyDown || !DebugConfig.isLauncher() ) {
if ( shouldCloseADASPanel() ) {
mServiceApis.getAdasControllerApi().closeADAS();
}
mIsHomeKeyDown = false;
}
private boolean shouldCloseADASPanel(){
// m4 系列因为按home键会造成页面pause后resume造成adas panel 闪烁
// f 系列加上上滑返回桌面后会走 mIsHomeKeyDown = true但是不会造成页面pause
// 独立 app 任何情况下都需要隐藏 adas
return !mIsHomeKeyDown
|| CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X
|| !DebugConfig.isLauncher();
}
@Override
protected void onStop() {
super.onStop();

View File

@@ -0,0 +1,2 @@
#-----ModuleMap-----
-keep class com.mogo.module.map.NavConstants

View File

@@ -19,3 +19,6 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-----ModuleMap-----
-keep class com.mogo.module.map.NavConstants

View File

@@ -22,9 +22,7 @@ android {
buildTypes {
release {
minifyEnabled true
zipAlignEnabled true
consumerProguardFiles 'consumer-rules.pro'
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

View File

@@ -1,10 +1,13 @@
#-----MediaModule-----
-dontwarn com.mogo.module.media.**
-keep class com.mogo.module.media.listener.* { *; }
-keep class com.mogo.module.media.model.* { *; }
-keep class com.mogo.module.media.view.* { *; }
-keep class com.mogo.module.media.widget.* { *; }
-keep class com.mogo.module.media.api.* { *; }
-keep class com.mogo.module.media.constants.* { *; }
-keep class com.mogo.module.media.presenter.* { *; }
-keep class com.mogo.module.media.receiver.* { *; }
-keep class com.mogo.module.media.listener.** { *; }
-keep class com.mogo.module.media.model.** { *; }
-keep class com.mogo.module.media.view.** { *; }
-keep class com.mogo.module.media.widget.** { *; }
-keep class com.mogo.module.media.api.** { *; }
-keep class com.mogo.module.media.constants.** { *; }
-keep class com.mogo.module.media.presenter.** { *; }
-keep class com.mogo.module.media.receiver.** { *; }
-keep class com.mogo.module.media.utils.OnBitmapToLocalListener
-keep class com.mogo.module.media.utils.OnCompressListener
-keep class com.mogo.module.media.MediaConstants

View File

@@ -22,11 +22,14 @@
#-----MediaModule-----
-dontwarn com.mogo.module.media.**
-keep class com.mogo.module.media.listener.* { *; }
-keep class com.mogo.module.media.model.* { *; }
-keep class com.mogo.module.media.view.* { *; }
-keep class com.mogo.module.media.widget.* { *; }
-keep class com.mogo.module.media.api.* { *; }
-keep class com.mogo.module.media.constants.* { *; }
-keep class com.mogo.module.media.presenter.* { *; }
-keep class com.mogo.module.media.receiver.* { *; }
-keep class com.mogo.module.media.listener.** { *; }
-keep class com.mogo.module.media.model.** { *; }
-keep class com.mogo.module.media.view.** { *; }
-keep class com.mogo.module.media.widget.** { *; }
-keep class com.mogo.module.media.api.** { *; }
-keep class com.mogo.module.media.constants.** { *; }
-keep class com.mogo.module.media.presenter.** { *; }
-keep class com.mogo.module.media.receiver.** { *; }
-keep class com.mogo.module.media.utils.OnBitmapToLocalListener
-keep class com.mogo.module.media.utils.OnCompressListener
-keep class com.mogo.module.media.MediaConstants

View File

@@ -14,7 +14,6 @@ import com.mogo.service.IMogoServiceApis;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
import com.mogo.service.statusmanager.StatusDescriptor;
import com.mogo.utils.logger.Logger;
import cn.kuwo.autosdk.api.KWAPI;
import cn.kuwo.autosdk.api.OnGetSongImgUrlListener;
@@ -43,14 +42,14 @@ public class KwPresenter extends BaseMediaPresenter<IMusicView> {
kwapi = KWAPI.createKWAPI(context, "auto");
kwapi.registerConnectedListener(b -> {
Logger.d(TAG, "onConnected: " + b);
Log.d(TAG, "onConnected: " + b);
Log.d(TAG, "onConnected: " + b);
isBind = b;
if (!isBind) {
mView.onMusicStopped();
}else{
PlayerStatus currentState = kwapi.getPlayerStatus();
Logger.d(TAG, "check current status: " + currentState);
Log.d(TAG, "check current status: " + currentState);
Log.d(TAG, "check current status: " + currentState);
if(currentState == PlayerStatus.BUFFERING||currentState == PlayerStatus.PLAYING){
currentMedia.setPlayState(MusicConstant.PLAY_STATE_PLAYING);
@@ -62,13 +61,13 @@ public class KwPresenter extends BaseMediaPresenter<IMusicView> {
});
kwapi.registerExitListener(() -> {
Logger.d(TAG, "onExit===");
Log.d(TAG, "onExit===");
Log.d(TAG, "onExit===");
mView.onAppExit();
});
kwapi.registerPlayerStatusListener((playerStatus, music) -> {
Logger.d(TAG, "onPlayerStatusListener: " + playerStatus + " music: " + music.name);
Log.d(TAG, "onPlayerStatusListener: " + playerStatus + " music: " + music.name);
switch (playerStatus) {
case BUFFERING:
if (currentMedia.getMediaName() == null || !currentMedia.getMediaName().equals(music.name)) {
@@ -113,7 +112,7 @@ public class KwPresenter extends BaseMediaPresenter<IMusicView> {
@Override
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
if (isTrue) {
Logger.d(TAG, "onResume, isBind: " + isBind);
Log.d(TAG, "onResume, isBind: " + isBind);
Log.d(TAG, "onResume, isBind: " + isBind);
// 需要在resume时候判断绑定关系是否正常
if (!isBind) {
@@ -125,14 +124,14 @@ public class KwPresenter extends BaseMediaPresenter<IMusicView> {
// 当前处于绑定状态,且有音乐信息,需判断是否正在播放,进行界面刷新
Log.d(TAG, "step1==" + currentMusic.name);
if (kwapi.getPlayerStatus() == PlayerStatus.BUFFERING || kwapi.getPlayerStatus() == PlayerStatus.PLAYING) {
Logger.d(TAG, "当前可能正在播放音乐,需要更新=1=" + currentMusic.name);
Log.d(TAG, "当前可能正在播放音乐,需要更新=1=" + currentMusic.name);
currentMedia.setMediaName(currentMusic.name);
currentMedia.setPlayState(MusicConstant.PLAY_STATE_PLAYING);
mView.onMediaInfoChanged(currentMedia);
mView.onMusicPlaying();
kwapi.getSongPicUrl(currentMusic, onGetSongImgUrlListener);
} else if (kwapi.getPlayerStatus() == PlayerStatus.INIT) {
Logger.d(TAG, "当前可能正在播放音乐,需要更新=3=" + currentMusic.name);
Log.d(TAG, "当前可能正在播放音乐,需要更新=3=" + currentMusic.name);
currentMedia.setMediaName(currentMusic.name);
currentMedia.setPlayState(MusicConstant.PLAY_STATE_PAUSE_OR_STOP);
mView.onMediaInfoChanged(currentMedia);
@@ -142,14 +141,14 @@ public class KwPresenter extends BaseMediaPresenter<IMusicView> {
Log.d(TAG, "step2==media: " + currentMedia.getMediaName() + " " +
"musicName: " + currentMusic.name + " status: " + kwapi.getPlayerStatus());
if (kwapi.getPlayerStatus() == PlayerStatus.BUFFERING || kwapi.getPlayerStatus() == PlayerStatus.PLAYING) {
Logger.d(TAG, "当前可能正在播放音乐,需要更新=2=" + currentMusic.name);
Log.d(TAG, "当前可能正在播放音乐,需要更新=2=" + currentMusic.name);
currentMedia.setMediaName(currentMusic.name);
currentMedia.setPlayState(MusicConstant.PLAY_STATE_PLAYING);
mView.onMediaInfoChanged(currentMedia);
mView.onMusicPlaying();
kwapi.getSongPicUrl(currentMusic, onGetSongImgUrlListener);
}else if (kwapi.getPlayerStatus() == PlayerStatus.INIT) {
Logger.d(TAG, "当前可能正在播放音乐,需要更新=4=" + currentMusic.name);
Log.d(TAG, "当前可能正在播放音乐,需要更新=4=" + currentMusic.name);
currentMedia.setMediaName(currentMusic.name);
currentMedia.setPlayState(MusicConstant.PLAY_STATE_PAUSE_OR_STOP);
mView.onMediaInfoChanged(currentMedia);
@@ -237,16 +236,18 @@ public class KwPresenter extends BaseMediaPresenter<IMusicView> {
private OnGetSongImgUrlListener onGetSongImgUrlListener = new OnGetSongImgUrlListener() {
@Override
public void onGetSongImgUrlSucessed(Music music, String s) {
currentMedia.setMediaName(music.name);
currentMedia.setMediaImg(s);
Logger.d(TAG,
"onGetSongImgUrlSucessed: " + currentMedia);
handler.post(() -> mView.onMediaInfoChanged(currentMedia));
if(currentMedia.getPlayState() == MusicConstant.PLAY_STATE_PLAYING) {
currentMedia.setMediaName(music.name);
currentMedia.setMediaImg(s);
Log.d(TAG,
"onGetSongImgUrlSucessed: " + currentMedia);
handler.post(() -> mView.onMediaInfoChanged(currentMedia));
}
}
@Override
public void onGetSongImgUrlFailed(Music music, int i) {
Logger.e(TAG, "onGetSongImgUrlFailed: " + i);
Log.e(TAG, "onGetSongImgUrlFailed: " + i);
}
};

View File

@@ -1,6 +1,7 @@
package com.mogo.module.media.window;
import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
@@ -101,6 +102,7 @@ public class MediaWindow2 implements IMusicView {
int statusBarHeight = WindowUtils.getStatusBarHeight(mContext);
Logger.d(TAG,
"yPos: " + yPos + " xPos: " + xPos + " statusBarHeight: " + statusBarHeight);
Log.d(TAG, "addMediaWindoView");
FrameLayout.LayoutParams params =
new FrameLayout.LayoutParams((int) mContext.getResources().getDimension(R.dimen.module_media_pop_window_width), (int) mContext.getResources().getDimension(R.dimen.module_media_pop_window_height));
params.leftMargin = xPos;
@@ -204,6 +206,7 @@ public class MediaWindow2 implements IMusicView {
@Override
public void onMusicPlaying() {
Logger.d(TAG, "onMusicPlaying===" + mMediaInfoData);
Log.d(TAG, "onMusicPlaying===" + mMediaInfoData);
isFirstPlay = false;
updateWindowUI(false);
if (mWindowPlayPause != null) {
@@ -218,6 +221,7 @@ public class MediaWindow2 implements IMusicView {
@Override
public void onMusicPause() {
Logger.d(TAG, "onMusicPause: ===" + mMediaInfoData);
Log.d(TAG, "onMusicPause: ===" + mMediaInfoData);
if (mWindowPlayPause != null) {
mWindowPlayPause.setImageResource(R.drawable.module_media_window_pop_pause);
}
@@ -230,6 +234,7 @@ public class MediaWindow2 implements IMusicView {
@Override
public void onMusicStopped() {
Logger.d(TAG, "onMusicStopped===" + mMediaInfoData);
Log.d(TAG, "onMusicStopped===" + mMediaInfoData);
if (mWindowPlayPause != null) {
mWindowPlayPause.setImageResource(R.drawable.module_media_window_pop_pause);
}
@@ -244,6 +249,7 @@ public class MediaWindow2 implements IMusicView {
@Override
public void onMediaInfoChanged(MediaInfoData mediaInfoData) {
Logger.d(TAG, "onMediaInfoChanged: " + mediaInfoData);
Log.d(TAG, "onMediaInfoChanged:" + mediaInfoData);
mMediaInfoData = mediaInfoData;
addWindowView();
updateWindowUI();
@@ -273,6 +279,8 @@ public class MediaWindow2 implements IMusicView {
@Override
public void onAppExit() {
mWindowView.setVisibility(View.GONE);
if ( mWindowView != null ) {
mWindowView.setVisibility(View.GONE);
}
}
}

View File

@@ -29,9 +29,7 @@ android {
buildTypes {
release {
minifyEnabled true
zipAlignEnabled true
consumerProguardFiles 'consumer-rules.pro'
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

View File

@@ -1,4 +1,8 @@
#-----SearchModule-----
-keep class com.mogo.module.navi.bean.*{*;}
-keep class com.mogo.module.navi.dao.*{*;}
-keep class com.mogo.module.navi.database.*{*;}
-keep class com.mogo.module.navi.bean.**{*;}
-keep class com.mogo.module.navi.constants.**{*;}
-keep class com.mogo.module.navi.dao.**{*;}
-keep class com.mogo.module.navi.database.**{*;}
-keep class * extends com.mogo.module.navi.cp.PersonalInfoManager{
public static final <fields>;
}

View File

@@ -21,6 +21,10 @@
#-renamesourcefileattribute SourceFile
#-----SearchModule-----
-keep class com.mogo.module.navi.bean.*{*;}
-keep class com.mogo.module.navi.dao.*{*;}
-keep class com.mogo.module.navi.database.*{*;}
-keep class com.mogo.module.navi.bean.**{*;}
-keep class com.mogo.module.navi.constants.**{*;}
-keep class com.mogo.module.navi.dao.**{*;}
-keep class com.mogo.module.navi.database.**{*;}
-keep class * extends com.mogo.module.navi.cp.PersonalInfoManager{
public static final <fields>;
}

View File

@@ -25,9 +25,7 @@ android {
buildTypes {
release {
minifyEnabled true
zipAlignEnabled true
consumerProguardFiles 'consumer-rules.pro'
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

View File

@@ -1,4 +1,13 @@
#-----ServiceModule-----
-keep class com.mogo.module.service.carinfo.CarStateInfo.*{*;}
-keep class com.mogo.module.service.network.RefreshBody.*{*;}
-keep class com.mogo.module.service.network.bean.DemoUserInfoEntity.*{*;}
-keep class com.mogo.module.service.network.bean.DemoUserInfoEntity.*{*;}
-keep interface com.mogo.module.service.intent.IntentHandler
-keep interface com.mogo.module.service.marker.IMarkerView
-keep interface com.mogo.module.service.network.RefreshApiService
-keep interface com.mogo.module.service.network.RefreshCallback
-keep interface com.mogo.module.service.network.bean.DemoUserInfoEntity
-keep class com.mogo.module.service.strategy.CarIconDisplayStrategy{
public static final <fields>;
}
-keep class com.mogo.module.service.ServiceConst

View File

@@ -23,4 +23,13 @@
#-----ServiceModule-----
-keep class com.mogo.module.service.carinfo.CarStateInfo.*{*;}
-keep class com.mogo.module.service.network.RefreshBody.*{*;}
-keep class com.mogo.module.service.network.bean.DemoUserInfoEntity.*{*;}
-keep class com.mogo.module.service.network.bean.DemoUserInfoEntity.*{*;}
-keep interface com.mogo.module.service.intent.IntentHandler
-keep interface com.mogo.module.service.marker.IMarkerView
-keep interface com.mogo.module.service.network.RefreshApiService
-keep interface com.mogo.module.service.network.RefreshCallback
-keep interface com.mogo.module.service.network.bean.DemoUserInfoEntity
-keep class com.mogo.module.service.strategy.CarIconDisplayStrategy{
public static final <fields>;
}
-keep class com.mogo.module.service.ServiceConst

View File

@@ -715,6 +715,7 @@ public class MogoServices implements IMogoMapListener,
break;
case ACC_STATUS:
if ( isTrue ) {
initLocationServiceProcess( mContext );
mADASController.showADAS();
refreshStrategy();
MarkerServiceHandler.getApis().getMapServiceApi().getSingletonLocationClient( mContext ).stop();

View File

@@ -3,6 +3,8 @@ package com.mogo.module.service.marker;
import android.content.Context;
import android.graphics.Rect;
import android.text.TextUtils;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.LinearInterpolator;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.debug.DebugConfig;
@@ -11,6 +13,7 @@ import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.IMogoMarkerClickListener;
import com.mogo.map.marker.IMogoMarkerManager;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.map.marker.anim.OnMarkerAnimationListener;
import com.mogo.module.common.ModuleNames;
import com.mogo.module.common.entity.MarkerCarPois;
import com.mogo.module.common.entity.MarkerCardResult;
@@ -34,6 +37,7 @@ import com.mogo.service.module.IMogoBizActionDoneListener;
import com.mogo.utils.ResourcesHelper;
import com.mogo.utils.ThreadPoolService;
import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.WorkThreadHandler;
import com.mogo.utils.logger.Logger;
import org.json.JSONArray;
@@ -368,15 +372,42 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
IMogoMarker mogoMarker = existCarMap.get( sn );
if ( mogoMarker == null || mogoMarker.isDestroyed() ) {
Logger.d( TAG, "draw road condition, sn = %s", sn );
mogoMarker = drawMapMarker( markerShowEntity, ServiceConst.MARKER_Z_INDEX_HIGH );
}
if ( mogoMarker != null ) {
mogoMarker.setVisible( true );
try {
post2AddAndStartAnimation( markerShowEntity, i * 100L );
} catch ( Exception e ) {
e.printStackTrace();
}
}
}
}
}
private void post2AddAndStartAnimation( MarkerShowEntity entity, long delay ) {
if ( entity == null ) {
return;
}
WorkThreadHandler.getInstance().postDelayed( () -> {
if ( entity == null ) {
return;
}
IMogoMarker marker = drawMapMarker( entity, ServiceConst.MARKER_Z_INDEX_HIGH );
marker.startScaleAnimationWithAlpha( 0, 1.2f, 0, 1.2f, 0f, 1f,300, new LinearInterpolator(), new OnMarkerAnimationListener() {
@Override
public void onAnimStart() {
Logger.d( TAG, " onAnimStart ---1----> " );
}
@Override
public void onAnimEnd() {
if ( marker.isDestroyed() ) {
return;
}
marker.startScaleAnimation( 1.2f, 1, 1.2f, 1, 100, new LinearInterpolator(), null );
}
} );
}, delay );
}
/**
* S = (A ∩ B) B
* A ∩ B)作为旧列表需要保留的部分

View File

@@ -54,6 +54,7 @@ public class UserDataMarkerInfoWindowAdapter implements IMogoInfoWindowAdapter {
private View mInfoWindowView = null;
private View mContentContainer;
private MogoImageView mUserHeader;
private TextView mContent;
private TextView mTag;
@@ -92,12 +93,21 @@ public class UserDataMarkerInfoWindowAdapter implements IMogoInfoWindowAdapter {
if ( mInfoWindowView == null ) {
mInfoWindowView = LayoutInflater.from( mContext ).inflate( R.layout.view_map_data_user_info_window, null );
mContentContainer = mInfoWindowView.findViewById( R.id.module_service_id_marker_content );
mUserHeader = mInfoWindowView.findViewById( R.id.module_service_id_user_header );
mContent = mInfoWindowView.findViewById( R.id.module_service_id_content );
mTag = mInfoWindowView.findViewById( R.id.module_service_id_tag );
mCall = mInfoWindowView.findViewById( R.id.module_service_id_call );
}
mCall.setVisibility( DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_BYD ? View.GONE : View.VISIBLE );
if ( DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_BYD ) {
mContentContainer.setPadding(
mContentContainer.getPaddingLeft(),
mContentContainer.getPaddingTop(),
mContentContainer.getResources().getDimensionPixelSize( R.dimen.module_service_id_marker_content_paddingRight_widthoutCall ),
mContentContainer.getPaddingBottom()
);
mCall.setVisibility( View.GONE );
}
try {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 941 B

After

Width:  |  Height:  |  Size: 950 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 941 B

After

Width:  |  Height:  |  Size: 950 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -13,6 +13,7 @@
android:id="@+id/module_service_id_marker_content"
android:layout_width="wrap_content"
android:layout_height="@dimen/module_services_info_window_height"
android:paddingRight="@dimen/module_service_id_marker_content_paddingRight"
android:background="@drawable/module_services_driver_blue_info"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -44,7 +45,7 @@
app:layout_constraintStart_toEndOf="@+id/module_service_id_user_header"
app:layout_constraintTop_toTopOf="@+id/module_service_id_user_header"
app:layout_goneMarginRight="@dimen/dp_30"
tools:text="诗" />
tools:text="诗一样的远方的远方" />
<TextView
android:id="@+id/module_service_id_tag"
@@ -64,7 +65,6 @@
android:layout_height="@dimen/module_service_user_header_height"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="2.5px"
android:scaleType="fitXY"
android:src="@drawable/module_service_ic_call"
app:layout_constraintBottom_toBottomOf="parent"

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_service_marker_anchor_size">20dp</dimen>
<dimen name="module_service_marker_dot_marginTop">8dp</dimen>
<dimen name="module_service_marker_dot_marginTop">4dp</dimen>
<dimen name="module_service_marker_bubble_width">100px</dimen>
<dimen name="module_service_marker_bubble_height">117px</dimen>
<dimen name="module_service_marker_bubble_icon_width">60px</dimen>
@@ -21,4 +21,5 @@
<dimen name="module_service_content_textSize">24px</dimen>
<dimen name="module_service_tag_textSize">20px</dimen>
<dimen name="module_service_content_minWidth">120px</dimen>
<dimen name="module_service_id_marker_content_paddingRight_widthoutCall">20px</dimen>
</resources>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_service_marker_anchor_size">16dp</dimen>
<dimen name="module_service_marker_dot_marginTop">4dp</dimen>
<dimen name="module_service_marker_dot_marginTop">2dp</dimen>
<dimen name="module_service_marker_bubble_width">56px</dimen>
<dimen name="module_service_marker_bubble_height">65px</dimen>
<dimen name="module_service_marker_bubble_icon_width">35px</dimen>
@@ -20,4 +20,6 @@
<dimen name="module_service_content_textSize">14px</dimen>
<dimen name="module_service_tag_textSize">12px</dimen>
<dimen name="module_service_content_minWidth">64px</dimen>
<dimen name="module_service_id_marker_content_paddingRight">6.5px</dimen>
<dimen name="module_service_id_marker_content_paddingRight_widthoutCall">10px</dimen>
</resources>

View File

@@ -24,9 +24,7 @@ android {
buildTypes {
release {
minifyEnabled true
zipAlignEnabled true
consumerProguardFiles 'consumer-rules.pro'
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

View File

@@ -1,2 +1,5 @@
#-----ShareModule-----
-keep class com.mogo.module.share.bean.*{*;}
-keep class com.mogo.module.share.bean.**{*;}
-keep class com.mogo.module.share.constant.**{*;}
-keep class com.mogo.module.share.manager.ISeekHelpListener
-keep class com.mogo.module.share.net.ShareApiService

View File

@@ -21,4 +21,7 @@
#-renamesourcefileattribute SourceFile
#-----ShareModule-----
-keep class com.mogo.module.share.bean.*{*;}
-keep class com.mogo.module.share.bean.**{*;}
-keep class com.mogo.module.share.constant.**{*;}
-keep class com.mogo.module.share.manager.ISeekHelpListener
-keep class com.mogo.module.share.net.ShareApiService

View File

@@ -64,6 +64,8 @@ public class LaucherShareDialog extends BaseFloatDialog implements View.OnClickL
public LaucherShareDialog(Context context) {
super(context);
// getWindow().setWindowAnimations(R.style.ShareDialogAnim);
this.mContext = context;
mApis = (IMogoServiceApis) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation(context);
mAnalytics = mApis.getAnalyticsApi();

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<scale
android:interpolator="@android:anim/overshoot_interpolator"
android:fromXScale="0.0"
android:toXScale="1.0"
android:fromYScale="0.0"
android:toYScale="1.0"
android:pivotX="50%"
android:pivotY="50%"
android:fillAfter="true"
android:duration="400"/>
</set>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<scale
android:interpolator="@android:anim/anticipate_overshoot_interpolator"
android:fromXScale="1.0"
android:toXScale="0.0"
android:fromYScale="1.0"
android:toYScale="0.0"
android:pivotX="50%"
android:pivotY="50%"
android:fillAfter="true"
android:duration="400"/>
</set>

View File

@@ -13,4 +13,9 @@
<item name="android:topDark">@color/all_transparent_white</item>
<item name="android:borderlessButtonStyle">@color/all_transparent_white</item>
</style>
<style name="ShareDialogAnim" parent="android:Animation" mce_bogus="1" >
<item name="android:windowEnterAnimation">@anim/module_share_dialog_enter_anim</item>
<item name="android:windowExitAnimation">@anim/module_share_dialog_exit_anim</item>
</style>
</resources>

View File

@@ -0,0 +1 @@
-keep class com.zhidao.mogo.module.splash.BydConst

View File

@@ -18,4 +18,6 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile
-keep class com.zhidao.mogo.module.splash.BydConst

View File

@@ -0,0 +1,2 @@
#-----ModuleSplash-----
-keep class com.zhidao.mogo.module.splash.SplashConst.*{*;}

View File

@@ -18,4 +18,7 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile
#-----ModuleSplash-----
-keep class com.zhidao.mogo.module.splash.SplashConst.*{*;}

View File

@@ -27,9 +27,7 @@ android {
buildTypes {
release {
minifyEnabled true
zipAlignEnabled true
consumerProguardFiles 'consumer-rules.pro'
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

View File

@@ -1,3 +1,17 @@
#-----V2XModule-----
-keep class com.tencent.* { *; }
-keep class com.mogo.module.v2x.entity.* { *; }
-keep class com.tencent.** { *; }
-keep class com.mogo.module.v2x.entity.net.** { *; }
-keep class com.mogo.module.v2x.manager.V2XStatusDescriptor
-keep class com.mogo.module.v2x.utils.SpanUtils.Align
-keep class com.mogo.module.v2x.utils.TimeConstants.Unit
-keep interface * implements com.mogo.module.v2x.alarm.V2XAlarmServer.OnFatigueDrivingListener
-keep interface * implements com.mogo.module.v2x.listener.CarStatusListener
-keep interface * implements com.mogo.module.v2x.listener.V2XWindowStatusListener
-keep interface * implements com.mogo.module.v2x.network.V2XApiService
-keep interface * implements com.mogo.module.v2x.network.V2XRefreshCallback
-keep interface * implements com.mogo.module.v2x.scenario.view.**{*;}
-keep interface * implements com.mogo.module.v2x.scenario.impl.**{*;}
-keep interface * implements com.mogo.module.v2x.scenario.IV2XScenario
-keep interface * implements com.mogo.module.v2x.scenario.IV2XScenarioManager
-keep class com.mogo.module.v2x.voice.**{*;}
-keep class com.mogo.module.v2x.V2XConst

View File

@@ -21,5 +21,19 @@
#-renamesourcefileattribute SourceFile
#-----V2XModule-----
-keep class com.tencent.* { *; }
-keep class com.mogo.module.v2x.entity.* { *; }
-keep class com.tencent.** { *; }
-keep class com.mogo.module.v2x.entity.net.** { *; }
-keep class com.mogo.module.v2x.manager.V2XStatusDescriptor
-keep class com.mogo.module.v2x.utils.SpanUtils.Align
-keep class com.mogo.module.v2x.utils.TimeConstants.Unit
-keep interface * implements com.mogo.module.v2x.alarm.V2XAlarmServer.OnFatigueDrivingListener
-keep interface * implements com.mogo.module.v2x.listener.CarStatusListener
-keep interface * implements com.mogo.module.v2x.listener.V2XWindowStatusListener
-keep interface * implements com.mogo.module.v2x.network.V2XApiService
-keep interface * implements com.mogo.module.v2x.network.V2XRefreshCallback
-keep interface * implements com.mogo.module.v2x.scenario.view.**{*;}
-keep interface * implements com.mogo.module.v2x.scenario.impl.**{*;}
-keep interface * implements com.mogo.module.v2x.scenario.IV2XScenario
-keep interface * implements com.mogo.module.v2x.scenario.IV2XScenarioManager
-keep class com.mogo.module.v2x.voice.**{*;}
-keep class com.mogo.module.v2x.V2XConst

View File

@@ -18,10 +18,10 @@ import com.mogo.map.marker.IMogoMarkerClickListener;
import com.mogo.map.navi.IMogoNaviListener;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.service.ServiceConst;
import com.mogo.module.v2x.entity.net.V2XSeekHelpRes;
import com.mogo.module.v2x.entity.net.V2XStrategyPushRes;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.v2x.network.V2XRefreshCallback;
import com.mogo.module.v2x.receiver.SceneBroadcastReceiver;
import com.mogo.module.v2x.scenario.impl.V2XScenarioManager;
@@ -132,10 +132,12 @@ public class V2XModuleProvider implements
intentFilter.addAction(V2XConst.BROADCAST_SCENE_HANDLER_ACTION);
localBroadcastManager.registerReceiver(localReceiver, intentFilter);
// TODO 这是测试页面
V2XServiceManager
.getIMogoWindowManager()
.addView(new V2XTestConsoleWindow(context), 0, 0, false);
if (BuildConfig.DEBUG) {
// TODO 这是测试页面
V2XServiceManager
.getIMogoWindowManager()
.addView(new V2XTestConsoleWindow(context), 0, 0, false);
}
}
private void initVoice(Context context) {

View File

@@ -0,0 +1,210 @@
package com.mogo.module.v2x.adapter.holder;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.mogo.commons.voice.AIAssist;
import com.mogo.map.MogoLatLng;
import com.mogo.map.navi.IMogoNaviListener;
import com.mogo.map.navi.MogoNaviInfo;
import com.mogo.map.navi.MogoTraffic;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerLocation;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.utils.ChartingUtil;
import com.mogo.module.v2x.utils.RoadConditionUtils;
import com.mogo.module.v2x.utils.ToastUtils;
import com.mogo.module.v2x.utils.TrackUtils;
import com.mogo.module.v2x.utils.V2XUtils;
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
/**
* V2X展示视图公用的实现
*
* @author donghongyu
*/
public abstract class V2XBaseViewHolder
extends RecyclerView.ViewHolder
implements IMogoNaviListener {
public V2XBaseViewHolder(@NonNull View itemView) {
super(itemView);
}
/**
* 延迟关闭窗体视图
*/
public abstract void delayedCloseWindow();
/**
* 点赞
*/
public void triggerZan(MarkerExploreWay noveltyInfo) {
try {
AIAssist.getInstance(V2XUtils.getApp()).speakTTSVoice("已点赞", null);
showTip("已点赞");
if (noveltyInfo != null) {
V2XServiceManager.getV2XMarkerService()
.getV2XRefreshModel()
.giveLikeLiveVideo(null, noveltyInfo.getSn());
TrackUtils.trackV2xRoadEvent(
noveltyInfo.getInfoId(),
noveltyInfo.getSn(),
V2XConst.V2X_ROAD_ZAN);
}
} catch (Exception e) {
e.printStackTrace();
}
delayedCloseWindow();
}
/**
* 打电话
*/
public void triggerCallChart(MarkerExploreWay noveltyInfo) {
try {
MarkerLocation location = new MarkerLocation();
location.setLat(noveltyInfo.getLocation().getLat());
location.setLon(noveltyInfo.getLocation().getLon());
ChartingUtil.callChatting(noveltyInfo.getUserInfo(), location);
TrackUtils.trackV2xRoadEvent(
noveltyInfo.getInfoId(),
noveltyInfo.getSn(),
V2XConst.V2X_ROAD_CHAT);
} catch (Exception e) {
e.printStackTrace();
ToastUtils.showShort("用户信息异常");
}
delayedCloseWindow();
}
/**
* 反馈路况错误
*/
public void triggerReportErr(MarkerExploreWay noveltyInfo) {
try {
RoadConditionUtils.sendDataErrorReceiverInfo(
noveltyInfo.getPoiType(),
noveltyInfo.getInfoId(),
"1");
TrackUtils.trackV2xRoadEvent(
noveltyInfo.getInfoId(),
noveltyInfo.getSn(),
V2XConst.V2X_ROAD_REPORT_ERROR);
} catch (Exception e) {
e.printStackTrace();
ToastUtils.showShort("路况信息异常");
}
delayedCloseWindow();
}
/**
* 反馈路况正确
*/
public void triggerReportTrue(MarkerExploreWay noveltyInfo) {
try {
RoadConditionUtils.sendDataErrorReceiverInfo(
noveltyInfo.getPoiType(),
noveltyInfo.getInfoId(),
"2");
TrackUtils.trackV2xRoadEvent(
noveltyInfo.getInfoId(),
noveltyInfo.getSn(),
V2XConst.V2X_ROAD_REPORT_RIGHT);
} catch (Exception e) {
e.printStackTrace();
ToastUtils.showShort("路况信息异常");
}
delayedCloseWindow();
}
/**
* 导航规划路线
*/
public void triggerStartNavi(MarkerExploreWay noveltyInfo) {
try {
MogoLatLng endPoint = new MogoLatLng(
noveltyInfo.getLocation().getLat(),
noveltyInfo.getLocation().getLon());
V2XServiceManager.getNavi().naviTo(endPoint);
V2XServiceManager.getMogoRegisterCenter().unregisterMogoNaviListener(MODULE_NAME);
V2XServiceManager.getMogoRegisterCenter().registerMogoNaviListener(MODULE_NAME, this);
TrackUtils.trackV2xRoadEvent(
noveltyInfo.getInfoId(),
noveltyInfo.getSn(),
V2XConst.V2X_ROAD_NAVI);
} catch (Exception e) {
e.printStackTrace();
ToastUtils.showShort("路况信息异常");
}
delayedCloseWindow();
}
/**
* 显示自定义 Toast
*
* @param msg
*/
public void showTip(String msg) {
ToastUtils.setGravity(Gravity.CENTER, 0, 0);
View toastView = LayoutInflater.from(V2XServiceManager.getContext()).inflate(R.layout.toast_view, null);
TextView msgView = toastView.findViewById(R.id.tvFeedbackContent);
msgView.setText(msg);
ToastUtils.showCustomShort(toastView);
}
@Override
public void onInitNaviFailure() {
}
@Override
public void onInitNaviSuccess() {
}
@Override
public void onNaviInfoUpdate(MogoNaviInfo naviinfo) {
}
@Override
public void onStartNavi() {
}
@Override
public void onStopNavi() {
}
@Override
public void onCalculateSuccess() {
V2XServiceManager.getNavi().startNavi(true);
}
@Override
public void onoCalculateFailed() {
}
@Override
public void onUpdateTraffic(MogoTraffic traffic) {
}
}

View File

@@ -1,44 +1,19 @@
package com.mogo.module.v2x.adapter.holder;
import android.content.Intent;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.voice.AIAssist;
import com.mogo.module.common.entity.MarkerCarInfo;
import com.mogo.module.common.entity.MarkerLocation;
import com.mogo.module.common.entity.MarkerUserInfo;
import com.mogo.module.common.entity.V2XEventShowEntity;
import com.mogo.module.common.entity.V2XLiveCarInfoEntity;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.common.entity.V2XLiveCarInfoEntity;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.entity.net.V2XUserInfoRes;
import com.mogo.module.v2x.network.V2XRefreshCallback;
import com.mogo.module.v2x.scenario.scene.road.V2XRoadEventScenario;
import com.mogo.module.v2x.utils.ChartingUtil;
import com.mogo.module.v2x.utils.ToastUtils;
import com.mogo.module.v2x.utils.TrackUtils;
import com.mogo.module.v2x.utils.V2XUtils;
import com.mogo.module.v2x.view.V2XLiveGSYVideoView;
import com.mogo.module.v2x.voice.V2XVoiceCallbackListener;
import com.mogo.module.v2x.voice.V2XVoiceConstants;
import com.mogo.module.v2x.voice.V2XVoiceManager;
import com.mogo.service.imageloader.MogoImageView;
import com.mogo.utils.logger.Logger;
import static android.view.View.GONE;
import static android.view.View.VISIBLE;
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
/**
* author : donghongyu
@@ -47,15 +22,11 @@ import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
* desc : 直播类型的卡片
* version: 1.0
*/
public class V2XLiveVideoVH extends RecyclerView.ViewHolder {
public class V2XLiveVideoVH extends V2XBaseViewHolder {
private V2XLiveGSYVideoView videoPlayer;
private MogoImageView ivReportHead;
// 控制按钮
private ImageView ivRoadCallChart;
private ImageView ivRoadEventLike;
// 上传事件的用户信息
private MarkerUserInfo mUserInfo = new MarkerUserInfo();
// 直播车机数据
@@ -63,55 +34,10 @@ public class V2XLiveVideoVH extends RecyclerView.ViewHolder {
// 预警的道路事件数据
private V2XRoadEventEntity mV2XRoadEventEntity;
// 拨打车聊聊语音回调
private V2XVoiceCallbackListener v2XVoiceCallbackCallListener = new V2XVoiceCallbackListener() {
@Override
public void onCallback(String command, Intent intent) {
if (mUserInfo != null && !TextUtils.isEmpty(mUserInfo.getSn())) {
roadCallChart();
}
}
};
// 点赞语音回调
private V2XVoiceCallbackListener v2XVoiceCallbackLickListener = new V2XVoiceCallbackListener() {
@Override
public void onCallback(String command, Intent intent) {
if (mV2XLiveCarEntity != null) {
handlerZan(mV2XLiveCarEntity.getSn());
}
}
};
public V2XLiveVideoVH(ViewGroup viewGroup) {
super(LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_v2x_live_video, viewGroup, false));
videoPlayer = itemView.findViewById(R.id.videoPlayer);
ivReportHead = itemView.findViewById(R.id.ivReportHead);
ivRoadCallChart = itemView.findViewById(R.id.ivRoadCallChart);
ivRoadEventLike = itemView.findViewById(R.id.ivRoadEventLike);
// 设置视图状态监听
itemView.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
@Override
public void onViewAttachedToWindow(View v) {
//Logger.w(MODULE_NAME, "列表View V2XLiveVideoVH 触发 onViewAttachedToWindow");
// 注册语音交互
V2XVoiceManager.INSTANCE
.registerWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_CALL_CHATTING,
v2XVoiceCallbackCallListener)
.registerWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_ZAN,
v2XVoiceCallbackLickListener)
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_CHAT_MORE_UN_WAKEUP,
v2XVoiceCallbackCallListener)
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_ZAN_UN_WAKEUP,
v2XVoiceCallbackLickListener);
}
@Override
public void onViewDetachedFromWindow(View v) {
//Logger.w(MODULE_NAME, "列表View V2XLiveVideoVH 触发 onViewDetachedFromWindow");
}
});
}
public void initView(V2XEventShowEntity v2XLiveCarEntity) {
@@ -126,119 +52,12 @@ public class V2XLiveVideoVH extends RecyclerView.ViewHolder {
MarkerCarInfo.CarLiveInfo carLiveInfo = new MarkerCarInfo.CarLiveInfo();
carLiveInfo.setVideoSn(v2XLiveCarEntity.getSn());
videoPlayer.setCarLiveInfo(carLiveInfo);
ivRoadEventLike.setVisibility(VISIBLE);
ivRoadCallChart.setOnClickListener(v -> {
ivRoadCallChart.setVisibility(GONE);
roadCallChart();
});
ivRoadEventLike.setOnClickListener(v -> {
handlerZan(v2XLiveCarEntity.getSn());
});
requestUserInfo(v2XLiveCarEntity);
}
private void roadCallChart() {
MarkerLocation location = new MarkerLocation();
ChartingUtil.callChatting(mUserInfo, location);
}
/**
* 请求用户信息
*
* @param v2XLiveCarEntity 直播信息
*/
private void requestUserInfo(V2XLiveCarInfoEntity v2XLiveCarEntity) {
Logger.d(MODULE_NAME, "上报事件的用户SN" + v2XLiveCarEntity.getSn());
TrackUtils.trackV2xRoadEvent(mV2XRoadEventEntity.getNoveltyInfo().getInfoId(), v2XLiveCarEntity.getSn(), V2XConst.V2X_ROAD_VIDEO);
// 获取道路事件周边的直播车机
if (!TextUtils.isEmpty(v2XLiveCarEntity.getSn())) {
V2XServiceManager
.getV2XRefreshModel()
.queryUserInfoBySn(
v2XLiveCarEntity.getSn(),
new V2XRefreshCallback<V2XUserInfoRes>() {
@Override
public void onSuccess(V2XUserInfoRes result) {
//Logger.d(MODULE_NAME, "上报事件的用户:" + result);
if (result != null &&
result.getResult() != null &&
result.getResult().getInfo() != null) {
V2XUserInfoRes.Result.Info infoBean = result.getResult().getInfo();
if (mUserInfo == null) {
mUserInfo = new MarkerUserInfo();
}
mUserInfo.setSn(infoBean.getSn());
try {
if (!TextUtils.isEmpty(infoBean.getCardIdAge())) {
mUserInfo.setAge(Integer.parseInt(infoBean.getCardIdAge()));
}
} catch (NumberFormatException e) {
e.printStackTrace();
}
mUserInfo.setUserName(infoBean.getUserNickName());
mUserInfo.setUserHead(infoBean.getHeadImgUrl());
mUserInfo.setGender(infoBean.getCardIdSex());
if (DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE) {
// 判断是否可以打电话
ChartingUtil.isCanCall(b -> {
if (b) {
// 判断是否可以打电话
ChartingUtil.isOnLine(mUserInfo.getSn(), b1 -> {
if (b1) {
ivRoadCallChart.setVisibility(VISIBLE);
} else {
ivRoadCallChart.setVisibility(GONE);
}
});
} else {
ivRoadCallChart.setVisibility(GONE);
}
});
}
if (!TextUtils.isEmpty(mUserInfo.getUserHead())) {
V2XServiceManager.getImageLoader()
.displayImage(mUserInfo.getUserHead(), ivReportHead);
}
}
}
@Override
public void onFail(String msg) {
ivRoadCallChart.setVisibility(GONE);
}
});
}
}
private void handlerZan(String sn) {
try {
AIAssist.getInstance(V2XUtils.getApp()).speakTTSVoice("已点赞", null);
showTip("已点赞");
V2XServiceManager.getV2XMarkerService()
.getV2XRefreshModel()
.giveLikeLiveVideo(null, sn);
ivReportHead.postDelayed(new Runnable() {
@Override
public void run() {
V2XRoadEventScenario.getInstance().close();
}
}, 2000);
} catch (Exception e) {
e.printStackTrace();
}
}
private void showTip(String msg) {
ToastUtils.setGravity(Gravity.CENTER, 0, 0);
View toastView = LayoutInflater.from(V2XServiceManager.getContext()).inflate(R.layout.toast_view, null);
TextView msgView = toastView.findViewById(R.id.tvFeedbackContent);
msgView.setText(msg);
ToastUtils.showCustomShort(toastView);
@Override
public void delayedCloseWindow() {
ivReportHead.postDelayed(() -> V2XRoadEventScenario.getInstance().close(), 2000);
}
}

View File

@@ -1,30 +1,19 @@
package com.mogo.module.v2x.adapter.holder;
import android.content.Intent;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.mogo.commons.voice.AIAssist;
import com.mogo.map.MogoLatLng;
import com.mogo.map.navi.IMogoNaviListener;
import com.mogo.map.navi.MogoNaviInfo;
import com.mogo.map.navi.MogoTraffic;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerLocation;
import com.mogo.module.common.entity.MarkerUserInfo;
import com.mogo.module.common.entity.V2XPushMessageEntity;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.common.entity.V2XPushMessageEntity;
import com.mogo.module.v2x.scenario.scene.push.V2XPushEventScenario;
import com.mogo.module.v2x.utils.ChartingUtil;
import com.mogo.module.v2x.utils.ToastUtils;
import com.mogo.module.v2x.utils.V2XUtils;
import com.mogo.module.v2x.voice.V2XVoiceCallbackListener;
import com.mogo.module.v2x.voice.V2XVoiceConstants;
import com.mogo.module.v2x.voice.V2XVoiceManager;
@@ -40,7 +29,7 @@ import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
* desc : TODO 这里是前瞻演示需求,推送的消息,
* version: 1.0
*/
public class V2XPushEventDetailVH extends RecyclerView.ViewHolder implements IMogoNaviListener {
public class V2XPushEventDetailVH extends V2XBaseViewHolder {
private MogoImageView ivImg;
private MogoImageView ivReportHead;
@@ -55,28 +44,25 @@ public class V2XPushEventDetailVH extends RecyclerView.ViewHolder implements IMo
private MarkerUserInfo mUserInfo = new MarkerUserInfo();
private V2XPushMessageEntity mV2XRoadEventEntity;
private MarkerExploreWay mNoveltyInfo;
// 语音控制导航
private V2XVoiceCallbackListener mNaviCb = new V2XVoiceCallbackListener() {
@Override
public void onCallback(String command, Intent intent) {
startNavi();
}
};
private V2XVoiceCallbackListener mNaviCb = (command, intent) -> triggerStartNavi(mNoveltyInfo);
// 语音控制拨打电话
private V2XVoiceCallbackListener mCallChartingCb = new V2XVoiceCallbackListener() {
@Override
public void onCallback(String command, Intent intent) {
roadCallChart();
private V2XVoiceCallbackListener mCallChartingCb = (command, intent) -> {
try {
mUserInfo.setSn(mV2XRoadEventEntity.getSn());
mUserInfo.setUserHead(mV2XRoadEventEntity.getHeadImgUrl());
mUserInfo.setUserName("蘑菇用户");
mUserInfo.setGender("");
mUserInfo.setAge(30);
triggerCallChart(mNoveltyInfo);
} catch (Exception e) {
e.printStackTrace();
}
};
// 点赞语音回调
private V2XVoiceCallbackListener v2XVoiceCallbackLickListener = new V2XVoiceCallbackListener() {
@Override
public void onCallback(String command, Intent intent) {
handlerZan();
}
};
private V2XVoiceCallbackListener v2XVoiceCallbackLickListener = (command, intent) -> triggerZan(mNoveltyInfo);
public V2XPushEventDetailVH(ViewGroup viewGroup) {
super(LayoutInflater.from(viewGroup.getContext())
@@ -91,24 +77,20 @@ public class V2XPushEventDetailVH extends RecyclerView.ViewHolder implements IMo
ivRoadEventLike = itemView.findViewById(R.id.ivRoadEventLike);
ivRoadEventNav.getParent().getParent().requestDisallowInterceptTouchEvent(true);
ivRoadEventNav.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startNavi();
}
});
ivRoadCallChart.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
roadCallChart();
}
});
ivRoadEventLike.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
handlerZan();
ivRoadEventNav.setOnClickListener(v -> triggerStartNavi(mNoveltyInfo));
ivRoadCallChart.setOnClickListener(v -> {
try {
mUserInfo.setSn(mV2XRoadEventEntity.getSn());
mUserInfo.setUserHead(mV2XRoadEventEntity.getHeadImgUrl());
mUserInfo.setUserName("蘑菇用户");
mUserInfo.setGender("");
mUserInfo.setAge(30);
triggerCallChart(mNoveltyInfo);
} catch (Exception e) {
e.printStackTrace();
}
});
ivRoadEventLike.setOnClickListener(v -> triggerZan(mNoveltyInfo));
// 设置视图状态监听
itemView.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
@@ -153,6 +135,14 @@ public class V2XPushEventDetailVH extends RecyclerView.ViewHolder implements IMo
public void initView(V2XPushMessageEntity v2XRoadEventEntity) {
mV2XRoadEventEntity = v2XRoadEventEntity;
mNoveltyInfo = new MarkerExploreWay();
mNoveltyInfo.setSn(mV2XRoadEventEntity.getSn());
mNoveltyInfo.setInfoId(mV2XRoadEventEntity.getSceneId());
MarkerLocation location = new MarkerLocation();
location.setLat(mV2XRoadEventEntity.getLat());
location.setLon(mV2XRoadEventEntity.getLon());
mNoveltyInfo.setLocation(location);
if (!TextUtils.isEmpty(v2XRoadEventEntity.getMsgImgUrl())) {
V2XServiceManager.getImageLoader()
.displayImage(v2XRoadEventEntity.getMsgImgUrl(), ivImg);
@@ -170,7 +160,6 @@ public class V2XPushEventDetailVH extends RecyclerView.ViewHolder implements IMo
ivRoadReportTrue.setVisibility(View.GONE);
ivRoadReportErr.setVisibility(View.GONE);
ivRoadEventLike.setVisibility(View.GONE);
break;
case "100017"://政府公告
@@ -179,119 +168,16 @@ public class V2XPushEventDetailVH extends RecyclerView.ViewHolder implements IMo
ivRoadEventNav.setVisibility(View.GONE);
ivRoadReportTrue.setVisibility(View.GONE);
ivRoadReportErr.setVisibility(View.GONE);
break;
}
}
/**
* 打电话
*/
private void roadCallChart() {
Logger.w(MODULE_NAME, "正在拨打电话。。。。");
if (mV2XRoadEventEntity != null) {
MarkerLocation location = new MarkerLocation();
location.setLon(mV2XRoadEventEntity.getLon());
location.setLat(mV2XRoadEventEntity.getLat());
mUserInfo.setSn(mV2XRoadEventEntity.getSn());
mUserInfo.setUserHead(mV2XRoadEventEntity.getHeadImgUrl());
mUserInfo.setUserName("蘑菇用户");
mUserInfo.setGender("");
mUserInfo.setAge(30);
ChartingUtil.callChatting(mUserInfo, location);
delayedCloseWindow();
}
}
/**
* 点赞
*/
private void handlerZan() {
try {
AIAssist.getInstance(V2XUtils.getApp()).speakTTSVoice("已点赞", null);
showTip("已点赞");
if (mV2XRoadEventEntity != null) {
V2XServiceManager.getV2XMarkerService()
.getV2XRefreshModel()
.giveLikeLiveVideo(null, mV2XRoadEventEntity.getSn());
}
delayedCloseWindow();
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 延迟关闭窗体
*/
private void delayedCloseWindow() {
itemView.postDelayed(new Runnable() {
@Override
public void run() {
V2XPushEventScenario.getInstance().close();
}
}, 1000);
}
/**
* 导航规划路线
*/
private void startNavi() {
if (mV2XRoadEventEntity != null) {
MogoLatLng endPoint = new MogoLatLng(mV2XRoadEventEntity.getLat(), mV2XRoadEventEntity.getLon());
V2XServiceManager.getNavi().naviTo(endPoint);
V2XServiceManager.getMogoRegisterCenter().unregisterMogoNaviListener(MODULE_NAME);
V2XServiceManager.getMogoRegisterCenter().registerMogoNaviListener(MODULE_NAME, this);
delayedCloseWindow();
}
}
private void showTip(String msg) {
ToastUtils.setGravity(Gravity.CENTER, 0, 0);
View toastView = LayoutInflater.from(V2XServiceManager.getContext()).inflate(R.layout.toast_view, null);
TextView msgView = toastView.findViewById(R.id.tvFeedbackContent);
msgView.setText(msg);
ToastUtils.showCustomShort(toastView);
}
@Override
public void onCalculateSuccess() {
V2XServiceManager.getNavi().startNavi(true);
public void delayedCloseWindow() {
itemView.postDelayed(() -> V2XPushEventScenario.getInstance().close(), 1000);
}
@Override
public void onInitNaviFailure() {
}
@Override
public void onInitNaviSuccess() {
}
@Override
public void onNaviInfoUpdate(MogoNaviInfo naviinfo) {
}
@Override
public void onStartNavi() {
}
@Override
public void onStopNavi() {
}
@Override
public void onoCalculateFailed() {
}
@Override
public void onUpdateTraffic(MogoTraffic traffic) {
}
}

View File

@@ -2,39 +2,29 @@ package com.mogo.module.v2x.adapter.holder;
import android.content.Intent;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.voice.AIAssist;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerLocation;
import com.mogo.module.common.entity.MarkerUserInfo;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.entity.net.V2XUserInfoRes;
import com.mogo.module.common.entity.V2XEventShowEntity;
import com.mogo.module.common.entity.V2XLiveCarInfoEntity;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.common.entity.V2XWindowTypeEnum;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.entity.net.V2XUserInfoRes;
import com.mogo.module.v2x.network.V2XRefreshCallback;
import com.mogo.module.v2x.scenario.scene.livecar.V2XRoadLiveCarScenario;
import com.mogo.module.v2x.scenario.scene.road.V2XRoadEventScenario;
import com.mogo.module.v2x.scenario.scene.road.V2XRoadEventWindow;
import com.mogo.module.v2x.utils.ChartingUtil;
import com.mogo.module.v2x.utils.EventTypeUtils;
import com.mogo.module.v2x.utils.RoadConditionUtils;
import com.mogo.module.v2x.utils.ToastUtils;
import com.mogo.module.v2x.utils.TrackUtils;
import com.mogo.module.v2x.utils.V2XUtils;
import com.mogo.module.v2x.voice.V2XVoiceCallbackListener;
import com.mogo.module.v2x.voice.V2XVoiceConstants;
import com.mogo.module.v2x.voice.V2XVoiceManager;
@@ -46,9 +36,7 @@ import com.mogo.utils.network.utils.GsonUtil;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static android.view.View.GONE;
import static android.view.View.VISIBLE;
@@ -61,7 +49,7 @@ import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
* desc : 道路事件详情
* version: 1.0
*/
public class V2XRoadEventDetailVH extends RecyclerView.ViewHolder {
public class V2XRoadEventDetailVH extends V2XBaseViewHolder {
private MogoImageView ivEventImg;
private MogoImageView ivReportHead;
private ImageView ivEventPlay;
@@ -79,7 +67,7 @@ public class V2XRoadEventDetailVH extends RecyclerView.ViewHolder {
// 上传事件的用户信息
private MarkerUserInfo mUserInfo = new MarkerUserInfo();
private MarkerUserInfo mUserInfo;
// 当前的新鲜事儿信息
private MarkerExploreWay mNoveltyInfo;
private V2XRoadEventEntity mV2XRoadEventEntity;
@@ -89,28 +77,28 @@ public class V2XRoadEventDetailVH extends RecyclerView.ViewHolder {
private V2XVoiceCallbackListener v2XVoiceCallbackCallListener = new V2XVoiceCallbackListener() {
@Override
public void onCallback(String command, Intent intent) {
roadCallChart(mNoveltyInfo);
triggerCallChart(mNoveltyInfo);
}
};
// 点赞语音回调
private V2XVoiceCallbackListener v2XVoiceCallbackLickListener = new V2XVoiceCallbackListener() {
@Override
public void onCallback(String command, Intent intent) {
handlerZan(mNoveltyInfo);
triggerZan(mNoveltyInfo);
}
};
// 反馈"正确"语音回调
private V2XVoiceCallbackListener v2XVoiceCallbackReportTrueListener = new V2XVoiceCallbackListener() {
@Override
public void onCallback(String command, Intent intent) {
roadReportTrue(mNoveltyInfo);
triggerReportTrue(mNoveltyInfo);
}
};
// 反馈"错误"语音回调
private V2XVoiceCallbackListener v2XVoiceCallbackReportErrorListener = new V2XVoiceCallbackListener() {
@Override
public void onCallback(String command, Intent intent) {
roadReportErr(mNoveltyInfo);
triggerReportErr(mNoveltyInfo);
}
};
// 反馈"错误"语音回调
@@ -174,12 +162,13 @@ public class V2XRoadEventDetailVH extends RecyclerView.ViewHolder {
}
mV2XEventShowEntity = v2XEventShowEntity;
mV2XRoadEventEntity = v2XEventShowEntity.getV2XRoadEventEntity();
if (mV2XRoadEventEntity == null) {
return;
}
mNoveltyInfo = mV2XRoadEventEntity.getNoveltyInfo();
if (mNoveltyInfo != null) {
//Logger.d(MODULE_NAME, "mContentData" + mContentData);
mUserInfo = mNoveltyInfo.getUserInfo();
if (!ArrayUtils.isEmpty(mNoveltyInfo.getItems())) {
String imgUrl = mNoveltyInfo.getItems().get(0).getThumbnail();
if (TextUtils.isEmpty(imgUrl)) {
@@ -245,19 +234,18 @@ public class V2XRoadEventDetailVH extends RecyclerView.ViewHolder {
}
ivEventReportTrue.setOnClickListener(v -> {
roadReportTrue(mNoveltyInfo);
triggerReportTrue(mNoveltyInfo);
});
ivEventReportErr.setOnClickListener(v -> {
roadReportErr(mNoveltyInfo);
triggerReportErr(mNoveltyInfo);
});
ivEventCallChart.setOnClickListener(v -> {
ivEventCallChart.setVisibility(GONE);
roadCallChart(mNoveltyInfo);
triggerCallChart(mNoveltyInfo);
});
ivEventZan.setOnClickListener(v -> {
handlerZan(mNoveltyInfo);
triggerZan(mNoveltyInfo);
});
}
} catch (Exception e) {
e.printStackTrace();
@@ -294,6 +282,11 @@ public class V2XRoadEventDetailVH extends RecyclerView.ViewHolder {
}
}
/**
* 为了给车聊聊更多的信息需要重新查询一次
*
* @param noveltyInfo
*/
private void requestUserInfo(MarkerExploreWay noveltyInfo) {
Logger.d(MODULE_NAME, "上报事件的用户SN" + noveltyInfo.getSn());
// 获取道路事件周边的直播车机
@@ -322,6 +315,9 @@ public class V2XRoadEventDetailVH extends RecyclerView.ViewHolder {
mUserInfo.setUserHead(infoBean.getHeadImgUrl());
mUserInfo.setGender(infoBean.getCardIdSex());
// 重新设置用户信息
mNoveltyInfo.setUserInfo(mUserInfo);
if (DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE) {
// 判断是否可以打电话
ChartingUtil.isCanCall(b -> {
@@ -350,86 +346,17 @@ public class V2XRoadEventDetailVH extends RecyclerView.ViewHolder {
}
}
/**
* 打电话
*/
private void roadCallChart(MarkerExploreWay noveltyInfo) {
MarkerLocation location = new MarkerLocation();
mUserInfo.setSn(noveltyInfo.getSn());
ChartingUtil.callChatting(mUserInfo, location);
TrackUtils.trackV2xRoadEvent(noveltyInfo.getInfoId(), noveltyInfo.getUserInfo().getSn(), V2XConst.V2X_ROAD_CHAT);
}
/**
* 反馈路况错误
*/
private void roadReportErr(MarkerExploreWay noveltyInfo) {
if (noveltyInfo != null) {
RoadConditionUtils.sendDataErrorReceiverInfo(
noveltyInfo.getPoiType(),
noveltyInfo.getInfoId(),
"1");
TrackUtils.trackV2xRoadEvent(noveltyInfo.getInfoId(), noveltyInfo.getUserInfo().getSn(), V2XConst.V2X_ROAD_REPORT_ERROR);
}
delayedCloseWindow();
}
/**
* 反馈路况正确
*/
private void roadReportTrue(MarkerExploreWay noveltyInfo) {
if (noveltyInfo != null) {
RoadConditionUtils.sendDataErrorReceiverInfo(
noveltyInfo.getPoiType(),
noveltyInfo.getInfoId(),
"2");
TrackUtils.trackV2xRoadEvent(noveltyInfo.getInfoId(), noveltyInfo.getUserInfo().getSn(), V2XConst.V2X_ROAD_REPORT_RIGHT);
}
delayedCloseWindow();
}
/**
* 点赞
*/
private void handlerZan(MarkerExploreWay noveltyInfo) {
try {
AIAssist.getInstance(V2XUtils.getApp()).speakTTSVoice("已点赞", null);
showTip("已点赞");
if (noveltyInfo != null) {
V2XServiceManager.getV2XMarkerService()
.getV2XRefreshModel()
.giveLikeLiveVideo(null, noveltyInfo.getSn());
}
delayedCloseWindow();
} catch (Exception e) {
e.printStackTrace();
}
TrackUtils.trackV2xRoadEvent(noveltyInfo.getInfoId(), noveltyInfo.getUserInfo().getSn(), V2XConst.V2X_ROAD_ZAN);
}
/**
* 延迟关闭窗体
*/
private void delayedCloseWindow() {
itemView.postDelayed(new Runnable() {
@Override
public void run() {
// 移除窗体
V2XServiceManager
.getIMogoWindowManager()
.removeView(V2XRoadEventScenario.getInstance().getV2XWindow().getView());
V2XRoadEventScenario.getInstance().close();
}
@Override
public void delayedCloseWindow() {
itemView.postDelayed(() -> {
// 移除窗体
V2XServiceManager
.getIMogoWindowManager()
.removeView(V2XRoadEventScenario.getInstance().getV2XWindow().getView());
V2XRoadEventScenario.getInstance().close();
}, 1000);
}
private void showTip(String msg) {
ToastUtils.setGravity(Gravity.CENTER, 0, 0);
View toastView = LayoutInflater.from(V2XServiceManager.getContext()).inflate(R.layout.toast_view, null);
TextView msgView = toastView.findViewById(R.id.tvFeedbackContent);
msgView.setText(msg);
ToastUtils.showCustomShort(toastView);
}
}

View File

@@ -93,12 +93,12 @@ public class V2XScenarioManager implements IV2XScenarioManager {
mV2XScenario = V2XIllegalParkScenario.getInstance();
break;
default:
Logger.e(MODULE_NAME, "当前V2X消息类型未定义。");
ToastUtils.showLong("当前V2X消息类型未定义。");
return;
}
}
// 展示最新的消息
if (mV2XScenario != null) {
mV2XScenario.init(v2XMessageEntity);

View File

@@ -8,9 +8,9 @@ import android.view.View;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.mogo.module.common.entity.V2XPushMessageEntity;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.common.entity.V2XPushMessageEntity;
import com.mogo.module.v2x.listener.V2XWindowStatusListener;
import com.mogo.module.v2x.scenario.view.IV2XWindow;
import com.mogo.module.v2x.view.TextureVideoView;
@@ -58,36 +58,38 @@ public class V2XAnimationWindow extends ConstraintLayout implements IV2XWindow<V
*/
@Override
public void show(V2XPushMessageEntity entity) {
Uri videoURI = null;
Uri videoUri = null;
switch (entity.getSceneId()) {
// 前车紧急制动告警
case "100005":
videoURI = Uri.parse("android.resource://" + getContext().getPackageName() + "/raw/" + R.raw.video_emergency_braking);
videoUri = Uri.parse("android.resource://" + getContext().getPackageName() + "/raw/" + R.raw.video_emergency_braking);
break;
// 十字路口碰撞预警
case "100006":
videoURI = Uri.parse("android.resource://" + getContext().getPackageName() + "/raw/" + R.raw.video_left_right_car);
videoUri = Uri.parse("android.resource://" + getContext().getPackageName() + "/raw/" + R.raw.video_left_right_car);
break;
// 岔路口碰撞预警
case "100007":
videoURI = Uri.parse("android.resource://" + getContext().getPackageName() + "/raw/" + R.raw.video_cut_in_line);
videoUri = Uri.parse("android.resource://" + getContext().getPackageName() + "/raw/" + R.raw.video_cut_in_line);
break;
// 禁行车道预警
case "100008":
videoURI = Uri.parse("android.resource://" + getContext().getPackageName() + "/raw/" + R.raw.video_current_row_closed);
videoUri = Uri.parse("android.resource://" + getContext().getPackageName() + "/raw/" + R.raw.video_current_row_closed);
break;
// 应急车辆优先通行
case "100012":
videoURI = Uri.parse("android.resource://" + getContext().getPackageName() + "/raw/" + R.raw.video_emergency_lane);
videoUri = Uri.parse("android.resource://" + getContext().getPackageName() + "/raw/" + R.raw.video_emergency_lane);
break;
// 闯红灯预警
case "100013":
videoURI = Uri.parse("android.resource://" + getContext().getPackageName() + "/raw/" + R.raw.video_traffic_light_speed_cut);
videoUri = Uri.parse("android.resource://" + getContext().getPackageName() + "/raw/" + R.raw.video_traffic_light_speed_cut);
break;
default:
Logger.e(MODULE_NAME, "未定义的类型:" + entity.getSceneId());
}
if (videoURI != null) {
vvCarAnimation.setVideoURI(videoURI);
if (videoUri != null) {
vvCarAnimation.setVideoURI(videoUri);
vvCarAnimation.setOnPreparedListener(mediaPlayer -> {
Logger.w(MODULE_NAME, "场景动画准备。。。。。");
});

View File

@@ -213,5 +213,8 @@ public class V2XSeekHelpScenario extends AbsV2XScenario<List<V2XMarkerEntity>> i
@Override
public void beforeViewRemoveAnim(View view) {
Logger.d(MODULE_NAME, "关闭 Window 开始");
// 重置场景提示的消息
setV2XMessageEntity(null);
clearPOI();
}
}

View File

@@ -61,19 +61,23 @@ public class ChartingUtil {
* @param chartStatusListener 车聊聊状态监听
*/
public static void isOnLine(String sn, ChartStatusListener chartStatusListener) {
V2XServiceManager.getCarsChattingProvider().isOnLine(
"CAR_CALL_TO_" + V2XConst.MODULE_NAME,
V2XUtils.getApp(),
sn,
new ICallChatResponse() {
@Override
public void isOnLine(boolean onLine, @Nullable String errorMsg) {
Logger.e(V2XConst.MODULE_NAME, "isOnLine" + onLine + " errorMsg" + errorMsg);
if (chartStatusListener != null) {
chartStatusListener.canCall(onLine);
try {
V2XServiceManager.getCarsChattingProvider().isOnLine(
"CAR_CALL_TO_" + V2XConst.MODULE_NAME,
V2XUtils.getApp(),
sn,
new ICallChatResponse() {
@Override
public void isOnLine(boolean onLine, @Nullable String errorMsg) {
Logger.e(V2XConst.MODULE_NAME, "isOnLine" + onLine + " errorMsg" + errorMsg);
if (chartStatusListener != null) {
chartStatusListener.canCall(onLine);
}
}
}
});
});
} catch (Exception e) {
e.printStackTrace();
}
}
@@ -83,19 +87,23 @@ public class ChartingUtil {
* @param chartStatusListener 车聊聊状态监听
*/
public static void isCanCall(ChartStatusListener chartStatusListener) {
V2XServiceManager.getCarsChattingProvider().canCall(
"CAR_CALL_TO_" + V2XConst.MODULE_NAME,
V2XUtils.getApp(),
new ICallChatResponse() {
@Override
public void canCall(boolean onLine) {
Logger.e(V2XConst.MODULE_NAME, "isOnLine" + onLine);
try {
V2XServiceManager.getCarsChattingProvider().canCall(
"CAR_CALL_TO_" + V2XConst.MODULE_NAME,
V2XUtils.getApp(),
new ICallChatResponse() {
@Override
public void canCall(boolean onLine) {
Logger.e(V2XConst.MODULE_NAME, "isOnLine" + onLine);
if (chartStatusListener != null) {
chartStatusListener.canCall(onLine);
if (chartStatusListener != null) {
chartStatusListener.canCall(onLine);
}
}
}
});
});
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@@ -13,21 +13,30 @@ import java.util.Map;
public class TrackUtils {
//埋点
public static void trackV2xRoadShow(String dbid,String type, String style) {
Map<String, Object> properties = new HashMap<>();
properties.put("dbid", dbid);
properties.put("type", type);
properties.put("lng", V2XStatusManager.getInstance().getLocation().getLongitude());
properties.put("lat", V2XStatusManager.getInstance().getLocation().getLatitude());
properties.put("style", style);
V2XServiceManager.getMogoAnalytics().track(V2XConst.V2X_ROAD_SHOW, properties);
public static void trackV2xRoadShow(String dbid, String type, String style) {
try {
Map<String, Object> properties = new HashMap<>();
properties.put("dbid", dbid);
properties.put("type", type);
properties.put("lng", V2XStatusManager.getInstance().getLocation().getLongitude());
properties.put("lat", V2XStatusManager.getInstance().getLocation().getLatitude());
properties.put("style", style);
V2XServiceManager.getMogoAnalytics().track(V2XConst.V2X_ROAD_SHOW, properties);
} catch (Exception e) {
e.printStackTrace();
}
}
//道路事件操作埋点 v2x_road_event
public static void trackV2xRoadEvent(String dbid, String sn ,String type) {
Map<String, Object> properties = new HashMap<>();
properties.put("dbid", dbid);
properties.put("sn", sn);
properties.put("type", type);
V2XServiceManager.getMogoAnalytics().track(V2XConst.V2X_ROAD_EVET, properties);
public static void trackV2xRoadEvent(String dbid, String sn, String type) {
try {
Map<String, Object> properties = new HashMap<>();
properties.put("dbid", dbid);
properties.put("sn", sn);
properties.put("type", type);
V2XServiceManager.getMogoAnalytics().track(V2XConst.V2X_ROAD_EVET, properties);
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Some files were not shown because too many files have changed in this diff Show More