diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index bc64c45663..8978cebc20 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -40,6 +40,7 @@
+
diff --git a/app/build.gradle b/app/build.gradle
index 9159d3b55b..72ac88748b 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -276,6 +276,7 @@ dependencies {
}
implementation rootProject.ext.dependencies.moduletanluapi
+ implementation rootProject.ext.dependencies.mogomonitor
} else {
launcherImplementation project(':main-extensions:mogo-module-main-launcher')
independentImplementation project(':main-extensions:mogo-module-main-independent')
@@ -291,6 +292,7 @@ dependencies {
exclude group: 'com.mogo.module', module: 'module-share'
}
implementation project(':libraries:mogo-tanlu-api')
+ implementation project(':modules:mogo-module-monitor')
}
apply from: "./functions/baseservices.gradle"
diff --git a/config.gradle b/config.gradle
index ae89790599..36c39fb136 100644
--- a/config.gradle
+++ b/config.gradle
@@ -177,6 +177,8 @@ targetSdkVersion : 22,
mogobaseserviceapk : "com.mogo.base:services-apk:${MOGO_BASE_SERVICES_APK_VERSION}",
// loglib
mogologlib : "com.mogo.module:module-loglib:${LOGLIB_VERSION}",
+ // monitor
+ mogomonitor : "com.mogo.module:module-monitor:${MOGO_MODULE_MONITOR_VERSION}",
// google
googlezxing : "com.google.zxing:core:3.3.3",
diff --git a/foudations/mogo-utils/src/main/java/com/mogo/utils/DateTimeUtils.java b/foudations/mogo-utils/src/main/java/com/mogo/utils/DateTimeUtils.java
index ca9573894a..7867ff9766 100644
--- a/foudations/mogo-utils/src/main/java/com/mogo/utils/DateTimeUtils.java
+++ b/foudations/mogo-utils/src/main/java/com/mogo/utils/DateTimeUtils.java
@@ -443,8 +443,8 @@ public class DateTimeUtils {
* @param timestamp 时间戳
* @return
*/
- public static String getTimeText( long timestamp) {
- SimpleDateFormat format = new SimpleDateFormat(yyyy_Nian_MM_Yue_dd_Ri, Locale.US);
+ public static String getTimeText( long timestamp, String dateFormat) {
+ SimpleDateFormat format = new SimpleDateFormat(dateFormat, Locale.US);
String strStart = format.format(new Date(timestamp));
return strStart;
}
diff --git a/gradle.properties b/gradle.properties
index fa56746e46..f3910bfae4 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -103,10 +103,12 @@ MOGO_MODULE_SPLASH_VERSION = 1.0.0-SNAPSHOT
MOGO_MODULE_SPLASH_NOOP_VERSION = 1.0.0-SNAPSHOT
# loglib
-LOGLIB_VERSION = 1.0.0-SNAPSHOT
+LOGLIB_VERSION = 1.0.1-SNAPSHOT
+# monitor
+MOGO_MODULE_MONITOR_VERSION = 1.0.0-SNAPSHOT
## 产品库必备配置,产品库自动对versionCode和versionName版本进行升级
applicationId=com.mogo.launcer
applicationName=IntelligentPilot
-versionCode=80006
-versionName=8.0.6
\ No newline at end of file
+versionCode=80007
+versionName=8.0.7
\ No newline at end of file
diff --git a/main-extensions/mogo-module-main-independent/src/main/java/com/zhidao/mogo/module/main/independent/MainIndependentActivity.java b/main-extensions/mogo-module-main-independent/src/main/java/com/zhidao/mogo/module/main/independent/MainIndependentActivity.java
index f085d39fdb..616f51eadd 100644
--- a/main-extensions/mogo-module-main-independent/src/main/java/com/zhidao/mogo/module/main/independent/MainIndependentActivity.java
+++ b/main-extensions/mogo-module-main-independent/src/main/java/com/zhidao/mogo/module/main/independent/MainIndependentActivity.java
@@ -28,9 +28,16 @@ public class MainIndependentActivity extends MainActivity {
@Override
protected void initViews() {
super.initViews();
+ // 控制层
FrameLayout.LayoutParams entranceParams = ( ( FrameLayout.LayoutParams ) mEntrance.getLayoutParams() );
entranceParams.leftMargin = getResources().getDimensionPixelSize( R.dimen.module_main_entrance_fragment_container_marginLeft );
mEntrance.setLayoutParams( entranceParams );
+
+ // 事件面板
+ FrameLayout.LayoutParams eventPanelParams = ( ( FrameLayout.LayoutParams ) mEventPanel.getLayoutParams() );
+ eventPanelParams.leftMargin = getResources().getDimensionPixelSize( R.dimen.module_main_entrance_fragment_container_marginLeft );
+ mEntrance.setLayoutParams( eventPanelParams );
+
mLeftShadowFrame.setVisibility(View.VISIBLE);
mApps.setVisibility( View.GONE );
}
diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/WindowManagerImpl.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/WindowManagerImpl.java
index 4821f6b0a2..f9b34a59be 100644
--- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/WindowManagerImpl.java
+++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/WindowManagerImpl.java
@@ -13,10 +13,12 @@ import com.mogo.utils.WindowUtils;
* 采用windowManager实现接口
*/
class WindowManagerImpl implements IWindowManagerView {
+
private WindowManager mWindowManager;
private WindowManager.LayoutParams mLayoutParams;
private WindowManagerView.WMViewParams mParams;
private boolean isShowing;
+
@Override
public void init(WindowManagerView.WMViewParams params) {
mParams = params;
@@ -31,16 +33,11 @@ class WindowManagerImpl implements IWindowManagerView {
mLayoutParams.gravity = Gravity.CENTER;
mLayoutParams.flags = WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
- if ( CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X ) {
- mLayoutParams.width = 1920;
- mLayoutParams.height = 1080;
- } else {
- mLayoutParams.width = WindowUtils.getScreenWidth( mParams.mContext );
- mLayoutParams.height = WindowUtils.getScreenHeight( mParams.mContext );
- }
+ mLayoutParams.width = mParams.mWidth;
+ mLayoutParams.height = mParams.mHeight;
+ mLayoutParams.x = mParams.mX;
+ mLayoutParams.y = mParams.mY;
mLayoutParams.dimAmount = 0.5f;
- mLayoutParams.x = 0;
- mLayoutParams.y = 0;
}
@Override
diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/WindowManagerView.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/WindowManagerView.java
index d3c054a2ca..d0d2cfa4d4 100644
--- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/WindowManagerView.java
+++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/wm/WindowManagerView.java
@@ -1,20 +1,12 @@
package com.mogo.module.common.wm;
import android.content.Context;
-import android.graphics.PixelFormat;
-import android.os.Build;
-import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
-import android.view.WindowManager;
import androidx.annotation.IdRes;
import androidx.annotation.LayoutRes;
-import com.mogo.commons.debug.DebugConfig;
-import com.mogo.module.common.utils.CarSeries;
-import com.mogo.utils.WindowUtils;
-
/**
* @author congtaowang
* @since 2020-05-21
@@ -25,56 +17,82 @@ public class WindowManagerView {
private WMViewParams mParams;
- private IWindowManagerView managerView;
+ private IWindowManagerView mManagerView;
- private WindowManagerView(WMViewParams params) {
+ private WindowManagerView( WMViewParams params, IWindowManagerView view ) {
this.mParams = params;
- managerView = new DialogImpl();
- managerView.init(params);
-// init();
+ mManagerView = view;
+ view.init( params );
}
public boolean isShowing() {
- return managerView.isShowing();
+ return mManagerView.isShowing();
}
- public T findViewById(@IdRes int id) {
- return mParams.mContentView.findViewById(id);
+ public < T extends View > T findViewById( @IdRes int id ) {
+ return mParams.mContentView.findViewById( id );
}
public void show() {
- managerView.show();
+ mManagerView.show();
}
public void dismiss() {
- managerView.hide();
+ mManagerView.hide();
}
public static class Builder {
private WMViewParams mParams = null;
- public Builder(Context context) {
+ public Builder( Context context ) {
mParams = new WMViewParams();
mParams.mContext = context;
}
- public Builder contentView(View contentView) {
+ public Builder contentView( View contentView ) {
mParams.mContentView = contentView;
return this;
}
- public Builder contentView(@LayoutRes int contentViewId) {
- mParams.mContentView = LayoutInflater.from(mParams.mContext).inflate(contentViewId,
- null);
+ public Builder contentView( @LayoutRes int contentViewId ) {
+ mParams.mContentView = LayoutInflater.from( mParams.mContext ).inflate( contentViewId, null );
return this;
}
+ public Builder size( int width, int height ) {
+ mParams.mWidth = width;
+ mParams.mHeight = height;
+ return this;
+ }
+
+ public Builder position( int x, int y ) {
+ mParams.mX = x;
+ mParams.mY = y;
+ return this;
+ }
+
+ /**
+ * 默认dialog实现
+ *
+ * @return
+ */
public WindowManagerView build() {
- if (mParams.mContentView == null) {
- throw new NullPointerException("WMViewParams#mContentView must not be null.");
+ return showInDialog();
+ }
+
+ public WindowManagerView showInDialog() {
+ if ( mParams.mContentView == null ) {
+ throw new NullPointerException( "WMViewParams#mContentView must not be null." );
}
- return new WindowManagerView(mParams);
+ return new WindowManagerView( mParams, new DialogImpl() );
+ }
+
+ public WindowManagerView showInWindowManager() {
+ if ( mParams.mContentView == null ) {
+ throw new NullPointerException( "WMViewParams#mContentView must not be null." );
+ }
+ return new WindowManagerView( mParams, new WindowManagerImpl() );
}
}
@@ -83,5 +101,9 @@ public class WindowManagerView {
public View mContentView;
public Context mContext;
+ public int mWidth;
+ public int mHeight;
+ public int mX;
+ public int mY;
}
}
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 bfb66cffe1..768006b117 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
@@ -204,6 +204,11 @@ public class EntranceFragment extends MvpFragment{
+ mApis.getMogoMonitorApi().showLogDebugDialog();
+ return true;
+ });
}
ConstraintLayout rootView = findViewById(R.id.module_entrance_id_top_motion_layout);
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 1ee636cab7..a0952f38de 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
@@ -31,6 +31,7 @@ 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.monitor.IMogoMonitorProvider;
import com.mogo.service.statusmanager.IMogoStatusManager;
import com.mogo.utils.logger.Logger;
import com.zhidao.autopilot.support.api.AutopilotServiceManage;
@@ -59,8 +60,9 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
// protected View mHeader;
protected View mApps;
protected View mEntrance;
+ protected View mEventPanel;
protected FrameLayout mFloatingLayout;
- protected FrameLayout mCoverUpLayout;
+ protected View mCoverUpLayout;
protected FrameLayout mLeftPanelLayout;
protected View mLeftShadowFrame;
private boolean mIsHomeKeyDown = false;
@@ -78,6 +80,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
// mHeader = findViewById( R.id.module_main_id_header_fragment_container );
mApps = findViewById( R.id.module_main_id_apps_fragment_container );
mEntrance = findViewById( R.id.module_main_id_entrance_fragment_container );
+ mEventPanel = findViewById( R.id.module_main_id_event_panel_fragment_container );
mFloatingLayout = findViewById( R.id.module_main_id_floating_view );
mLeftShadowFrame = findViewById( R.id.module_main_id_map_left_shadow_frame );
mCoverUpLayout = findViewById( R.id.module_main_id_cover_up );
@@ -93,6 +96,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
protected void hideLayout() {
// mHeader.setVisibility( View.GONE );
mEntrance.setVisibility( View.GONE );
+ mEventPanel.setVisibility( View.GONE );
mFloatingLayout.setVisibility( View.GONE );
}
@@ -100,6 +104,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
protected void showLayout() {
// mHeader.setVisibility( View.VISIBLE );
mEntrance.setVisibility( View.VISIBLE );
+ mEventPanel.setVisibility( View.VISIBLE );
mFloatingLayout.setVisibility( View.VISIBLE );
}
@@ -170,6 +175,11 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
hideLayout();
}
} );
+
+ // 初始化MonitorModule
+ IMogoMonitorProvider monitorProvider = (IMogoMonitorProvider) ARouter.getInstance().build(MogoServicePaths.PATH_MOGO_MONITOR).navigation(this);
+ monitorProvider.resetActivityContext(this);
+
}
private void startBaseService() {
@@ -257,7 +267,6 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
// f 系列加上上滑返回桌面后会走 mIsHomeKeyDown = true,但是不会造成页面pause
// 独立 app 任何情况下都需要隐藏 adas
return !mIsHomeKeyDown
- || CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X
|| !DebugConfig.isLauncher();
}
diff --git a/modules/mogo-module-main/src/main/res/drawable-ldpi/mogo_slogan.png b/modules/mogo-module-main/src/main/res/drawable-ldpi/mogo_slogan.png
new file mode 100644
index 0000000000..d577900772
Binary files /dev/null and b/modules/mogo-module-main/src/main/res/drawable-ldpi/mogo_slogan.png differ
diff --git a/modules/mogo-module-main/src/main/res/drawable-mdpi/mogo_slogan.png b/modules/mogo-module-main/src/main/res/drawable-mdpi/mogo_slogan.png
new file mode 100644
index 0000000000..d577900772
Binary files /dev/null and b/modules/mogo-module-main/src/main/res/drawable-mdpi/mogo_slogan.png differ
diff --git a/modules/mogo-module-main/src/main/res/drawable-xhdpi/mogo_slogan.png b/modules/mogo-module-main/src/main/res/drawable-xhdpi/mogo_slogan.png
new file mode 100644
index 0000000000..00d5cd14a3
Binary files /dev/null and b/modules/mogo-module-main/src/main/res/drawable-xhdpi/mogo_slogan.png differ
diff --git a/modules/mogo-module-main/src/main/res/drawable/main_bitmap_splash_bg.xml b/modules/mogo-module-main/src/main/res/drawable/main_bitmap_splash_bg.xml
new file mode 100644
index 0000000000..d78157cb0e
--- /dev/null
+++ b/modules/mogo-module-main/src/main/res/drawable/main_bitmap_splash_bg.xml
@@ -0,0 +1,23 @@
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-main/src/main/res/layout/module_main_activity_main.xml b/modules/mogo-module-main/src/main/res/layout/module_main_activity_main.xml
index bcb2744c24..ce44459946 100644
--- a/modules/mogo-module-main/src/main/res/layout/module_main_activity_main.xml
+++ b/modules/mogo-module-main/src/main/res/layout/module_main_activity_main.xml
@@ -66,13 +66,14 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />
-
+ />
@null
- @null
- @null
- - @drawable/module_main_launcher_bg
+ - @drawable/main_bitmap_splash_bg
- false
- @style/MainAnimation
- @style/noCheckboxStyle
diff --git a/modules/mogo-module-map/src/main/java/com/mogo/module/map/VoiceConstants.java b/modules/mogo-module-map/src/main/java/com/mogo/module/map/VoiceConstants.java
index ccaf71fc65..aff22c0b1c 100644
--- a/modules/mogo-module-map/src/main/java/com/mogo/module/map/VoiceConstants.java
+++ b/modules/mogo-module-map/src/main/java/com/mogo/module/map/VoiceConstants.java
@@ -135,7 +135,7 @@ public class VoiceConstants {
*/
public static final String CMD_MAP_NORTH_UP_MODE = "com.ileja.traffic.north.up";
public static final String CMD_MAP_NORTH_UP_MODE_UN_WAKEUP = "CMD_MAP_NORTH_UP_MODE_UN_WAKEUP";
- public static final String[] CMD_MAP_NORTH_UP_MODE_TRIGGER_WORDS = {"北朝上"};
+ public static final String[] CMD_MAP_NORTH_UP_MODE_TRIGGER_WORDS = {"正北朝上","北朝上"};
/**
* 简洁模式
*/
@@ -168,15 +168,15 @@ public class VoiceConstants {
sVoiceCmds.put( VoiceConstants.CMD_MAP_ZOOM_OUT_UN_WAKEUP, VoiceConstants.CMD_MAP_ZOOM_OUT_TRIGGER_WORDS );
//sVoiceCmds.put( VoiceConstants.CMD_MAP_2D_UN_WAKEUP, VoiceConstants.CMD_MAP_2D_TRIGGER_WORDS );
//sVoiceCmds.put( VoiceConstants.CMD_MAP_3D_UN_WAKEUP, VoiceConstants.CMD_MAP_3D_TRIGGER_WORDS );
- //sVoiceCmds.put( VoiceConstants.CMD_MAP_DAY_TIME_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_DAY_TIME_MODE_TRIGGER_WORDS );
- //sVoiceCmds.put( VoiceConstants.CMD_MAP_NIGHT_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_NIGHT_MODE_TRIGGER_WORDS );
- //sVoiceCmds.put( VoiceConstants.CMD_MAP_TRAFFIC_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_TRAFFIC_MODE_TRIGGER_WORDS );
- //sVoiceCmds.put( VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE_TRIGGER_WORDS );
- //sVoiceCmds.put( VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE_TRIGGER_WORDS );
+ sVoiceCmds.put( VoiceConstants.CMD_MAP_DAY_TIME_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_DAY_TIME_MODE_TRIGGER_WORDS );
+ sVoiceCmds.put( VoiceConstants.CMD_MAP_NIGHT_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_NIGHT_MODE_TRIGGER_WORDS );
+ sVoiceCmds.put( VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE_TRIGGER_WORDS );
+ sVoiceCmds.put( VoiceConstants.CMD_MAP_TRAFFIC_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_TRAFFIC_MODE_TRIGGER_WORDS );
+ sVoiceCmds.put( VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE_TRIGGER_WORDS );
//sVoiceCmds.put( VoiceConstants.CMD_MAP_DISPLAY_OVERVIEW_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_DISPLAY_OVERVIEW_MODE_TRIGGER_WORDS );
//sVoiceCmds.put( VoiceConstants.CMD_MAP_CONTINUE_NAVI_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_CONTINUE_NAVI_MODE_MODE_TRIGGER_WORDS );
- //sVoiceCmds.put( VoiceConstants.CMD_MAP_CAR_UP_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_CAR_UP_MODE_TRIGGER_WORDS );
- //sVoiceCmds.put( VoiceConstants.CMD_MAP_NORTH_UP_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_NORTH_UP_MODE_TRIGGER_WORDS );
+ sVoiceCmds.put( VoiceConstants.CMD_MAP_CAR_UP_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_CAR_UP_MODE_TRIGGER_WORDS );
+ sVoiceCmds.put( VoiceConstants.CMD_MAP_NORTH_UP_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_NORTH_UP_MODE_TRIGGER_WORDS );
//sVoiceCmds.put( VoiceConstants.CMD_MAP_GO_HOME_UN_WAKEUP, VoiceConstants.CMD_MAP_ZOOM_IN_GO_HOME );
//sVoiceCmds.put( VoiceConstants.CMD_MAP_GO_COMPANY_UN_WAKEUP, VoiceConstants.CMD_MAP_ZOOM_IN_GO_COMPANY );
sVoiceCmds.put( VoiceConstants.CMD_MAP_HISTORY_UN_WAKEUP, VoiceConstants.CMD_MAP_HISTORY_TRIGGER_WORDS );
diff --git a/modules/mogo-module-monitor/.gitignore b/modules/mogo-module-monitor/.gitignore
new file mode 100644
index 0000000000..42afabfd2a
--- /dev/null
+++ b/modules/mogo-module-monitor/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/modules/mogo-module-monitor/build.gradle b/modules/mogo-module-monitor/build.gradle
new file mode 100644
index 0000000000..d91c74e164
--- /dev/null
+++ b/modules/mogo-module-monitor/build.gradle
@@ -0,0 +1,48 @@
+apply plugin: 'com.android.library'
+apply plugin: 'com.alibaba.arouter'
+
+android {
+ compileSdkVersion rootProject.ext.android.compileSdkVersion
+ // buildToolsVersion rootProject.ext.android.buildToolsVersion
+ defaultConfig {
+ minSdkVersion rootProject.ext.android.minSdkVersion
+ targetSdkVersion rootProject.ext.android.targetSdkVersion
+ versionCode Integer.valueOf(VERSION_CODE)
+ versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION")
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ consumerProguardFiles 'consumer-rules.pro'
+ javaCompileOptions {
+ annotationProcessorOptions {
+ arguments = [AROUTER_MODULE_NAME: project.getName()]
+ }
+ }
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+ implementation rootProject.ext.dependencies.mogologlib
+ implementation rootProject.ext.dependencies.arouter
+ annotationProcessor rootProject.ext.dependencies.aroutercompiler
+ if (Boolean.valueOf(RELEASE)) {
+ compileOnly rootProject.ext.dependencies.modulecommon
+ } else {
+ compileOnly project(':modules:mogo-module-common')
+ }
+}
+
+apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
diff --git a/modules/mogo-module-monitor/consumer-rules.pro b/modules/mogo-module-monitor/consumer-rules.pro
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/modules/mogo-module-monitor/gradle.properties b/modules/mogo-module-monitor/gradle.properties
new file mode 100644
index 0000000000..db3ee2befd
--- /dev/null
+++ b/modules/mogo-module-monitor/gradle.properties
@@ -0,0 +1,3 @@
+GROUP=com.mogo.module
+POM_ARTIFACT_ID=module-monitor
+VERSION_CODE=1
diff --git a/modules/mogo-module-monitor/proguard-rules.pro b/modules/mogo-module-monitor/proguard-rules.pro
new file mode 100644
index 0000000000..481bb43481
--- /dev/null
+++ b/modules/mogo-module-monitor/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/modules/mogo-module-monitor/src/main/AndroidManifest.xml b/modules/mogo-module-monitor/src/main/AndroidManifest.xml
new file mode 100644
index 0000000000..9fdb2a839e
--- /dev/null
+++ b/modules/mogo-module-monitor/src/main/AndroidManifest.xml
@@ -0,0 +1,5 @@
+
+
+ /
+
\ No newline at end of file
diff --git a/modules/mogo-module-monitor/src/main/java/com/zhidao/mogo/module/monitor/MogoMonitorConst.java b/modules/mogo-module-monitor/src/main/java/com/zhidao/mogo/module/monitor/MogoMonitorConst.java
new file mode 100644
index 0000000000..41e54354ae
--- /dev/null
+++ b/modules/mogo-module-monitor/src/main/java/com/zhidao/mogo/module/monitor/MogoMonitorConst.java
@@ -0,0 +1,11 @@
+package com.zhidao.mogo.module.monitor;
+
+class MogoMonitorConst {
+ public static final String MODULE_NAME = "MogoMonitor";
+ public static final String MODULE_PATH = "/monitor/api";
+
+ public static final int LOG_PUSH_TYPE = 500000;
+
+ public static final int START_CATCH_LOG = 1;
+ public static final int STOP_CATCH_LOG = 2;
+}
diff --git a/modules/mogo-module-monitor/src/main/java/com/zhidao/mogo/module/monitor/MogoMonitorProvider.java b/modules/mogo-module-monitor/src/main/java/com/zhidao/mogo/module/monitor/MogoMonitorProvider.java
new file mode 100644
index 0000000000..08bf4df033
--- /dev/null
+++ b/modules/mogo-module-monitor/src/main/java/com/zhidao/mogo/module/monitor/MogoMonitorProvider.java
@@ -0,0 +1,118 @@
+package com.zhidao.mogo.module.monitor;
+
+import android.content.Context;
+import android.util.ArrayMap;
+
+import com.alibaba.android.arouter.facade.annotation.Route;
+import com.alibaba.android.arouter.launcher.ARouter;
+import com.mogo.service.IMogoServiceApis;
+import com.mogo.service.MogoServicePaths;
+import com.mogo.service.connection.IMogoOnMessageListener;
+import com.mogo.service.monitor.IMogoMonitorProvider;
+import com.mogo.utils.logger.LogLevel;
+import com.mogo.utils.logger.Logger;
+import com.zhidao.loglib.LogInfoManager;
+import com.zhidao.loglib.bean.RemoteLogPushContent;
+import com.zhidao.loglib.dialog.ILogDialogListener;
+import com.zhidao.loglib.upload.UploadManager;
+import com.zhidao.loglib.util.LogInfoManagerFactory;
+import com.zhidao.loglib.util.LoggingNotice;
+
+import java.util.Map;
+
+/**
+ * 应用监控模块provider
+ * @author tongchenfei
+ */
+@Route(path = MogoMonitorConst.MODULE_PATH)
+public class MogoMonitorProvider implements IMogoMonitorProvider, IMogoOnMessageListener, ILogDialogListener {
+ private static final String TAG = MogoMonitorConst.MODULE_NAME;
+ private LogInfoManager manualCatchLog = null;
+ private Map managerCache = new ArrayMap<>();
+ private Context context;
+
+ @Override
+ public void showLogDebugDialog() {
+ if (manualCatchLog == null) {
+ manualCatchLog = LogInfoManagerFactory.createManualLogInfoManager(context);
+ }
+ manualCatchLog.showDebugWindow().setDialogListener(this);
+ }
+
+ @Override
+ public void init(Context context) {
+ IMogoServiceApis apis =
+ (IMogoServiceApis) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(context);
+ apis.getSocketManagerApi(context).registerOnMessageListener(MogoMonitorConst.LOG_PUSH_TYPE,this);
+ }
+
+ @Override
+ public void resetActivityContext(Context context) {
+ this.context = context;
+ UploadManager.getInstance().init(context);
+ LoggingNotice.getInstance().init(context);
+ }
+
+ @Override
+ public Class target() {
+ return RemoteLogPushContent.class;
+ }
+
+ @Override
+ public void onMsgReceived(RemoteLogPushContent obj) {
+ Logger.d(TAG, "收到push消息: " + obj);
+ switch (obj.getType()){
+ case MogoMonitorConst.START_CATCH_LOG:
+ if (managerCache.containsKey(obj.getPkgName())) {
+ Logger.d(TAG, "这个包名的日志正在抓了: " + obj);
+ return;
+ }
+ openLoggerLevel();
+ LogInfoManager infoManager =
+ LogInfoManagerFactory.createPushLogInfoManager(context, obj);
+ infoManager.start();
+ managerCache.put(obj.getPkgName(), infoManager);
+ break;
+ case MogoMonitorConst.STOP_CATCH_LOG:
+ LogInfoManager stopManager = managerCache.remove(obj.getPkgName());
+ if (stopManager != null) {
+ stopManager.stop();
+ }
+ closeLoggerLevel();
+ break;
+ default:
+ break;
+ }
+ }
+
+ @Override
+ public void onLogStart() {
+ // 这个是通过对话框点击开始的回调
+ isInManualCatchLog = true;
+ openLoggerLevel();
+ }
+
+ @Override
+ public void onLogStop() {
+ // 这个是通过对话框点击结束的回调
+ isInManualCatchLog = false;
+ closeLoggerLevel();
+ }
+ private boolean isInManualCatchLog = false;
+
+ /**
+ * 放开Logger的限制
+ */
+ private void openLoggerLevel(){
+ Logger.init(LogLevel.DEBUG);
+ }
+
+ /**
+ * 根据状态收紧Logger的限制
+ */
+ private void closeLoggerLevel(){
+ if (!isInManualCatchLog && managerCache.size() == 0) {
+ Logger.init( BuildConfig.DEBUG ? LogLevel.DEBUG : LogLevel.OFF );
+ }
+ }
+}
diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java
index 1d0189338f..12d74cddc5 100644
--- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java
+++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java
@@ -364,7 +364,8 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
}
int size = getAppropriateSize( maxAmount, exploreWayList );
Map< String, IMogoMarker > existCarMap = purgeMarkerData( exploreWayList, ModuleNames.CARD_TYPE_ROAD_CONDITION );
- Logger.i( TAG, "existCarMap: size = %d", existCarMap.size() );for ( int i = 0; i < size; i++ ) {
+ Logger.i( TAG, "existCarMap: size = %d", existCarMap.size() );
+ for ( int i = 0; i < size; i++ ) {
MarkerExploreWay markerExploreWay = exploreWayList.get( i );
if ( !markerExploreWay.getCanLive() ) {
MarkerLocation markerLocation = markerExploreWay.getLocation();
@@ -402,7 +403,10 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
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() {
+ if ( marker == null ) {
+ return;
+ }
+ marker.startScaleAnimationWithAlpha( 0, 1.2f, 0, 1.2f, 0f, 1f, 300, new LinearInterpolator(), new OnMarkerAnimationListener() {
@Override
public void onAnimStart() {
Logger.d( TAG, " onAnimStart ---1----> " );
@@ -410,7 +414,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
@Override
public void onAnimEnd() {
- if ( marker.isDestroyed() ) {
+ if ( marker == null || marker.isDestroyed() ) {
return;
}
marker.startScaleAnimation( 1.2f, 1, 1.2f, 1, 100, new LinearInterpolator(), null );
diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/RefreshModel.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/RefreshModel.java
index 33d1fd0cc1..d87bec74a3 100644
--- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/RefreshModel.java
+++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/network/RefreshModel.java
@@ -67,11 +67,7 @@ public class RefreshModel {
refreshBody.limit = limit;
refreshBody.location = new RefreshBody.LatLon( latLng.lat, latLng.lng );
refreshBody.radius = radius;
- refreshBody.dataType.add( ServiceConst.CARD_TYPE_CARS_CHATTING );
refreshBody.dataType.add( ServiceConst.CARD_TYPE_ROAD_CONDITION );
- refreshBody.dataType.add( ServiceConst.CARD_TYPE_SHARE_MUSIC );
-// refreshBody.dataType.add(ServiceConst.CARD_TYPE_USER_DATA);
- refreshBody.dataType.add( ServiceConst.CARD_TYPE_NOVELTY );
String data = GsonUtil.jsonFromObject( refreshBody );
query.put( "data", data );
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/SpacesItemDecoration.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/SpacesItemDecoration.java
new file mode 100644
index 0000000000..005984f991
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/SpacesItemDecoration.java
@@ -0,0 +1,32 @@
+package com.mogo.module.v2x;
+
+import android.graphics.Rect;
+import android.view.View;
+
+import androidx.recyclerview.widget.RecyclerView;
+
+/**
+ * 这是LinearLayoutManager设置Item间距的的一个辅助类
+ *
+ * @author donghongyu
+ */
+public class SpacesItemDecoration extends RecyclerView.ItemDecoration {
+ private int space;
+
+ public SpacesItemDecoration(int space) {
+ this.space = space;
+ }
+
+ @Override
+ public void getItemOffsets(Rect outRect, View view,
+ RecyclerView parent, RecyclerView.State state) {
+ outRect.left = space;
+ outRect.right = space;
+ outRect.bottom = space;
+
+ // Add top margin only for the first item to avoid double space between items
+ if (parent.getChildPosition(view) == 0) {
+ outRect.top = space;
+ }
+ }
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/SurroundingEventAdapter.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/SurroundingEventAdapter.java
index 3da4f2f19f..00634fca44 100644
--- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/SurroundingEventAdapter.java
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/SurroundingEventAdapter.java
@@ -4,14 +4,15 @@ import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
-import com.amap.api.maps.model.Text;
+import com.mogo.module.common.entity.MarkerExploreWay;
+import com.mogo.module.common.entity.MarkerPoiTypeEnum;
import com.mogo.module.v2x.R;
-import com.mogo.module.v2x.entity.panel.SurroundingResponse;
import java.util.List;
@@ -20,13 +21,16 @@ import java.util.List;
* @description 周边
* @since 2020/7/29
*/
-public class SurroundingEventAdapter extends RecyclerView.Adapter{
- private List mPoiInfosList;
+public class SurroundingEventAdapter extends RecyclerView.Adapter {
+ private List mPoiInfosList;
private Context mContext;
- private TextView mAddressTv;
+ private ImageView mBgImageView;
+ private ImageView mTypeImageView;
+ private TextView mTypeTv;
+ private TextView mTotalTv;
- public SurroundingEventAdapter(Context context, List poiInfosList) {
+ public SurroundingEventAdapter(Context context, List poiInfosList) {
mContext = context;
mPoiInfosList = poiInfosList;
}
@@ -46,12 +50,31 @@ public class SurroundingEventAdapter extends RecyclerView.Adapter construtList;
+
+ public String getPoiType() {
+ return poiType;
+ }
+
+ public void setPoiType(String poiType) {
+ this.poiType = poiType;
+ }
+
+ public List getConstrutList() {
+ return construtList;
+ }
+
+ public void setConstrutList(List construtList) {
+ this.construtList = construtList;
+ }
+}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/panel/SurroundingResponse.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/panel/SurroundingResponse.java
index 1b491e4845..17b38e95e8 100644
--- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/panel/SurroundingResponse.java
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/panel/SurroundingResponse.java
@@ -1,6 +1,8 @@
package com.mogo.module.v2x.entity.panel;
+import com.google.gson.annotations.SerializedName;
import com.mogo.commons.data.BaseData;
+import com.mogo.module.common.entity.MarkerExploreWay;
import java.util.List;
@@ -11,9 +13,8 @@ import java.util.List;
*/
public class SurroundingResponse extends BaseData {
/**
- * code : 0
- * msg : success
- * result : {"total":1,"poiInfos":[{"coordinates":[116.410712,39.96833],"uploadTimestamp":1596003623000,"timeout":1596090023000,"uploadAddress":"","distance":0,"dbId":"738038266231427072","poiType":"10002","sn":"VN000017","userId":0,"userName":"伤心狼","userHead":"https://yycp-static-1255510688.cos.ap-beijing.myqcloud.com/defaultUserHeadImg/VN000016.jpg","likeNum":1,"uploadType":2,"uploadUser":"","imgUrl":"","content":"封路了","gasStationId":"","gasStationName":"","gasImg":"","gasPrices":"","endDate":"2020-07-30 14:20:23","fabulous":false,"direction":90,"virtualLikeNum":"","status":1,"sourceType":"10002","hitId":"Odo6mXMBEXitzfRvznNL","userType":2,"data":""}]}
+ * msg : null
+ * result : {"exploreWay":[{"infoId":"740635251747942400","type":"CARD_TYPE_ROAD_CONDITION","location":{"lon":116.370207,"lat":39.968394,"angle":180,"address":"测试直播"},"canLive":false,"fileType":1,"addr":"测试直播","generateTime":1596622804859,"cityName":"","distance":717,"userInfo":{"sn":"E841CC2018PZD20408","userId":0,"userName":"零下的雨008","userHead":"http://yycp-static-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1592473692394.jpeg"},"items":[{"url":"http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1594952448035.mp4?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%26q-sign-time%3D1596701407%3B1596708607%26q-key-time%3D1596701407%3B1596708607%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3D465089a3c078ed60c395cb65d41f61b28e9a3397","thumbnail":"http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1594952453342.jpg?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%26q-sign-time%3D1596701407%3B1596708607%26q-key-time%3D1596701407%3B1596708607%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3D6f36b4c945197737f8576e42a5c599ed3d150a4a"}],"uploadType":"2","poiType":"10011"}]}
*/
private ResultBean result;
@@ -26,322 +27,14 @@ public class SurroundingResponse extends BaseData {
}
public static class ResultBean {
- /**
- * total : 1
- * poiInfos : [{"coordinates":[116.410712,39.96833],"uploadTimestamp":1596003623000,"timeout":1596090023000,"uploadAddress":"","distance":0,"dbId":"738038266231427072","poiType":"10002","sn":"VN000017","userId":0,"userName":"伤心狼","userHead":"https://yycp-static-1255510688.cos.ap-beijing.myqcloud.com/defaultUserHeadImg/VN000016.jpg","likeNum":1,"uploadType":2,"uploadUser":"","imgUrl":"","content":"封路了","gasStationId":"","gasStationName":"","gasImg":"","gasPrices":"","endDate":"2020-07-30 14:20:23","fabulous":false,"direction":90,"virtualLikeNum":"","status":1,"sourceType":"10002","hitId":"Odo6mXMBEXitzfRvznNL","userType":2,"data":""}]
- */
- private int total;
- private List poiInfos;
+ private List exploreWay;
- public int getTotal() {
- return total;
+ public List getExploreWay() {
+ return exploreWay;
}
- public void setTotal(int total) {
- this.total = total;
- }
-
- public List getPoiInfos() {
- return poiInfos;
- }
-
- public void setPoiInfos(List poiInfos) {
- this.poiInfos = poiInfos;
- }
-
- public static class PoiInfosBean {
- /**
- * coordinates : [116.410712,39.96833]
- * uploadTimestamp : 1596003623000
- * timeout : 1596090023000
- * uploadAddress :
- * distance : 0
- * dbId : 738038266231427072
- * poiType : 10002
- * sn : VN000017
- * userId : 0
- * userName : 伤心狼
- * userHead : https://yycp-static-1255510688.cos.ap-beijing.myqcloud.com/defaultUserHeadImg/VN000016.jpg
- * likeNum : 1
- * uploadType : 2
- * uploadUser :
- * imgUrl :
- * content : 封路了
- * gasStationId :
- * gasStationName :
- * gasImg :
- * gasPrices :
- * endDate : 2020-07-30 14:20:23
- * fabulous : false
- * direction : 90
- * virtualLikeNum :
- * status : 1
- * sourceType : 10002
- * hitId : Odo6mXMBEXitzfRvznNL
- * userType : 2
- * data :
- */
- private long uploadTimestamp;
- private long timeout;
- private String uploadAddress;
- private int distance;
- private String dbId;
- private String poiType;
- private String sn;
- private int userId;
- private String userName;
- private String userHead;
- private int likeNum;
- private int uploadType;
- private String uploadUser;
- private String imgUrl;
- private String content;
- private String gasStationId;
- private String gasStationName;
- private String gasImg;
- private String gasPrices;
- private String endDate;
- private boolean fabulous;
- private int direction;
- private String virtualLikeNum;
- private int status;
- private String sourceType;
- private String hitId;
- private int userType;
- private String data;
- private List coordinates;
-
- public long getUploadTimestamp() {
- return uploadTimestamp;
- }
-
- public void setUploadTimestamp(long uploadTimestamp) {
- this.uploadTimestamp = uploadTimestamp;
- }
-
- public long getTimeout() {
- return timeout;
- }
-
- public void setTimeout(long timeout) {
- this.timeout = timeout;
- }
-
- public String getUploadAddress() {
- return uploadAddress;
- }
-
- public void setUploadAddress(String uploadAddress) {
- this.uploadAddress = uploadAddress;
- }
-
- public int getDistance() {
- return distance;
- }
-
- public void setDistance(int distance) {
- this.distance = distance;
- }
-
- public String getDbId() {
- return dbId;
- }
-
- public void setDbId(String dbId) {
- this.dbId = dbId;
- }
-
- public String getPoiType() {
- return poiType;
- }
-
- public void setPoiType(String poiType) {
- this.poiType = poiType;
- }
-
- public String getSn() {
- return sn;
- }
-
- public void setSn(String sn) {
- this.sn = sn;
- }
-
- public int getUserId() {
- return userId;
- }
-
- public void setUserId(int userId) {
- this.userId = userId;
- }
-
- public String getUserName() {
- return userName;
- }
-
- public void setUserName(String userName) {
- this.userName = userName;
- }
-
- public String getUserHead() {
- return userHead;
- }
-
- public void setUserHead(String userHead) {
- this.userHead = userHead;
- }
-
- public int getLikeNum() {
- return likeNum;
- }
-
- public void setLikeNum(int likeNum) {
- this.likeNum = likeNum;
- }
-
- public int getUploadType() {
- return uploadType;
- }
-
- public void setUploadType(int uploadType) {
- this.uploadType = uploadType;
- }
-
- public String getUploadUser() {
- return uploadUser;
- }
-
- public void setUploadUser(String uploadUser) {
- this.uploadUser = uploadUser;
- }
-
- public String getImgUrl() {
- return imgUrl;
- }
-
- public void setImgUrl(String imgUrl) {
- this.imgUrl = imgUrl;
- }
-
- public String getContent() {
- return content;
- }
-
- public void setContent(String content) {
- this.content = content;
- }
-
- public String getGasStationId() {
- return gasStationId;
- }
-
- public void setGasStationId(String gasStationId) {
- this.gasStationId = gasStationId;
- }
-
- public String getGasStationName() {
- return gasStationName;
- }
-
- public void setGasStationName(String gasStationName) {
- this.gasStationName = gasStationName;
- }
-
- public String getGasImg() {
- return gasImg;
- }
-
- public void setGasImg(String gasImg) {
- this.gasImg = gasImg;
- }
-
- public String getGasPrices() {
- return gasPrices;
- }
-
- public void setGasPrices(String gasPrices) {
- this.gasPrices = gasPrices;
- }
-
- public String getEndDate() {
- return endDate;
- }
-
- public void setEndDate(String endDate) {
- this.endDate = endDate;
- }
-
- public boolean isFabulous() {
- return fabulous;
- }
-
- public void setFabulous(boolean fabulous) {
- this.fabulous = fabulous;
- }
-
- public int getDirection() {
- return direction;
- }
-
- public void setDirection(int direction) {
- this.direction = direction;
- }
-
- public String getVirtualLikeNum() {
- return virtualLikeNum;
- }
-
- public void setVirtualLikeNum(String virtualLikeNum) {
- this.virtualLikeNum = virtualLikeNum;
- }
-
- public int getStatus() {
- return status;
- }
-
- public void setStatus(int status) {
- this.status = status;
- }
-
- public String getSourceType() {
- return sourceType;
- }
-
- public void setSourceType(String sourceType) {
- this.sourceType = sourceType;
- }
-
- public String getHitId() {
- return hitId;
- }
-
- public void setHitId(String hitId) {
- this.hitId = hitId;
- }
-
- public int getUserType() {
- return userType;
- }
-
- public void setUserType(int userType) {
- this.userType = userType;
- }
-
- public String getData() {
- return data;
- }
-
- public void setData(String data) {
- this.data = data;
- }
-
- public List getCoordinates() {
- return coordinates;
- }
-
- public void setCoordinates(List coordinates) {
- this.coordinates = coordinates;
- }
+ public void setExploreWay(List exploreWay) {
+ this.exploreWay = exploreWay;
}
}
}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/SurroundingEventFragment.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/SurroundingEventFragment.java
index 26a26f6b98..1638696f8c 100644
--- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/SurroundingEventFragment.java
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/SurroundingEventFragment.java
@@ -11,31 +11,43 @@ import androidx.annotation.Nullable;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
+import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.commons.mvp.MvpFragment;
+import com.mogo.map.marker.IMogoMarker;
+import com.mogo.map.marker.MogoMarkersHandler;
+import com.mogo.module.common.entity.MarkerExploreWay;
+import com.mogo.module.common.entity.MarkerPoiTypeEnum;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.adapter.SurroundingEventAdapter;
+import com.mogo.module.v2x.entity.panel.SurroundingConstructionData;
import com.mogo.module.v2x.entity.panel.SurroundingResponse;
import com.mogo.module.v2x.presenter.SurroundingEventPresenter;
import com.mogo.module.v2x.view.SurroundingEventView;
+import com.mogo.service.IMogoServiceApis;
+import com.mogo.service.MogoServicePaths;
+import com.mogo.service.map.IMogoMapService;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import static android.view.View.OVER_SCROLL_NEVER;
/**
* 周边事件
*/
-public class SurroundingEventFragment extends MvpFragment implements SurroundingEventView {
+public class SurroundingEventFragment extends MvpFragment implements SurroundingEventView, View.OnClickListener {
private static final String TAG = "SurroundingFragment";
private RecyclerView mRecyclerView;
+ private TextView mTotalTv;
private RelativeLayout mEmptyLayout;
private TextView mShareTv;
private TextView mFreshTv;
private SurroundingEventAdapter mAdapter;
private SurroundingEventPresenter surroundingEventPresenter;
- private List poiInfosList = new ArrayList<>();
-
+ private List poiInfosList = new ArrayList<>();
+ private IMogoServiceApis mApis;
@Override
protected int getLayoutId() {
@@ -44,19 +56,21 @@ public class SurroundingEventFragment extends MvpFragment ");
+ Log.d(TAG, "initViews --------> ");
mRecyclerView = findViewById(R.id.surrounding_recycleview);
+ mTotalTv = findViewById(R.id.tv_brief);
mEmptyLayout = findViewById(R.id.layout_empty_data_show);
mShareTv = findViewById(R.id.tv_main_share);
mFreshTv = findViewById(R.id.tv_main_refresh);
-
+ mShareTv.setOnClickListener(this);
+ mFreshTv.setOnClickListener(this);
mRecyclerView.setHasFixedSize(true);
mRecyclerView.setOverScrollMode(OVER_SCROLL_NEVER);
- GridLayoutManager layoutManage = new GridLayoutManager(getContext(), 1);
+ GridLayoutManager layoutManage = new GridLayoutManager(getContext(), 2);
mRecyclerView.setLayoutManager(layoutManage);
- mAdapter = new SurroundingEventAdapter(getActivity(), poiInfosList); //TODO
+ mAdapter = new SurroundingEventAdapter(getActivity(), poiInfosList);
mRecyclerView.setAdapter(mAdapter);
initData();
@@ -73,8 +87,25 @@ public class SurroundingEventFragment extends MvpFragment 0) {
- mRecyclerView.setVisibility(View.VISIBLE);
- mEmptyLayout.setVisibility(View.GONE);
+ public void showSurroudingData(List exploreWayList) {
+ Log.d(TAG, "showSurroudingData -------1--");
+ if (exploreWayList != null && exploreWayList.size() > 0) {
+ Log.d(TAG, "showSurroudingData -----2----");
+ //对数据进行分类
+ handleCategoricalData(exploreWayList);
- poiInfosList.clear();
- poiInfosList.addAll(resultBean.getPoiInfos());
- mAdapter.notifyDataSetChanged();
- } else {
- mRecyclerView.setVisibility(View.GONE);
- mEmptyLayout.setVisibility(View.VISIBLE);
- }
+ //展示数据
+ mRecyclerView.setVisibility(View.VISIBLE);
+ mEmptyLayout.setVisibility(View.GONE);
+
+ poiInfosList.clear();
+ poiInfosList.addAll(exploreWayList);
+ mAdapter.notifyDataSetChanged();
+
+ //总条数
+ mTotalTv.setText(exploreWayList.size() + "");
} else {
+ Log.d(TAG, "showSurroudingData -------3---");
mRecyclerView.setVisibility(View.GONE);
mEmptyLayout.setVisibility(View.VISIBLE);
}
}
+
+ private List mConstructionList = new ArrayList<>();
+
+
+ //TODO
+ private List handleCategoricalData(List list) {
+ List tempExploreWayList = new ArrayList<>();
+ Log.d(TAG, "handleCategoricalData -------1---");
+ for (int i = 0; i < list.size(); i++) {
+ MarkerExploreWay exploreWay = list.get(i);
+ SurroundingConstructionData constructionData = new SurroundingConstructionData();
+ List tempConstrutList = new ArrayList<>();
+ if (exploreWay.getPoiType().equals(MarkerPoiTypeEnum.FOURS_LIVING)) { //实时路况
+ tempConstrutList.add(exploreWay);
+ constructionData.setPoiType(MarkerPoiTypeEnum.FOURS_LIVING);
+ constructionData.setConstrutList(tempConstrutList);
+
+ tempExploreWayList.add(constructionData);
+ } else if (exploreWay.getPoiType().equals(MarkerPoiTypeEnum.FOURS_ACCIDENT)) {
+ tempConstrutList.add(exploreWay);
+ constructionData.setPoiType(MarkerPoiTypeEnum.FOURS_ACCIDENT);
+ constructionData.setConstrutList(tempConstrutList);
+
+ tempExploreWayList.add(constructionData);
+ }
+ }
+
+ Log.d(TAG, "handleCategoricalData tempExploreWayList.size() = " + tempExploreWayList.size());
+ return tempExploreWayList;
+ }
+
+
+
+
@Override
public void onDestroy() {
super.onDestroy();
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XEventPanelFragment.kt b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XEventPanelFragment.kt
index 5654dd65f0..0c5dea786f 100644
--- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XEventPanelFragment.kt
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XEventPanelFragment.kt
@@ -4,7 +4,9 @@ import android.content.res.ColorStateList
import android.graphics.Typeface
import android.view.Gravity
import android.view.View
+import android.widget.LinearLayout
import android.widget.TextView
+import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import androidx.viewpager2.widget.ViewPager2
import androidx.viewpager2.widget.ViewPager2.OnPageChangeCallback
@@ -34,11 +36,11 @@ class V2XEventPanelFragment : MvpFragment
val tabView = TextView(context)
@@ -77,6 +85,7 @@ class V2XEventPanelFragment : MvpFragment {
ivCar.setImageResource(R.drawable.v_to_x_marker_7)
}
+ //事故
+ V2XPoiTypeEnum.FOURS_LIVING -> {
+ ivCar.setImageResource(R.drawable.v_to_x_marker_1)
+ }
//红绿灯数据
V2XPoiTypeEnum.ALERT_TRAFFIC_LIGHT_SUGGEST -> {
ivCar.setImageResource(R.drawable.v_to_x_marker_3)
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XApiService.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XApiService.java
index 78710b8999..053717d9f3 100644
--- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XApiService.java
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XApiService.java
@@ -131,7 +131,7 @@ public interface V2XApiService {
*
* */
@Headers({"Content-Type:application/json", "Accept:application/json"})
- @POST("/deva/car/poi/no/queryNovelty/v1")
+ @POST("/deva/car/path/no/getLauncherSnapshotDataResponse/v1")
Observable getSurroundingEventList(@Query("sn") String sn, @Body RequestBody jsonStr);
/**
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/presenter/SurroundingEventPresenter.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/presenter/SurroundingEventPresenter.java
index 014bb2a3b0..9f5c393869 100644
--- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/presenter/SurroundingEventPresenter.java
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/presenter/SurroundingEventPresenter.java
@@ -78,15 +78,16 @@ public class SurroundingEventPresenter extends Presenter {
@Override
public void onSuccess(SurroundingResponse data) {
super.onSuccess(data);
- if (data != null) {
- mView.showSurroudingData(data);
+ Log.e("SurroundingFragment", "onSuccess ------ ");
+ if (data != null && data.getResult() != null) {
+ mView.showSurroudingData(data.getResult().getExploreWay());
}
}
@Override
public void onError(String message, int code) {
super.onError(message, code);
- Log.e(TAG, "onError message = " + message + " >>> code = " + code);
+ Log.e("SurroundingFragment", "onError message = " + message + " >>> code = " + code);
}
});
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/park/V2XIllegalParkMarker.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/park/V2XIllegalParkMarker.java
index 801ee51a9f..f44fd5ff4b 100644
--- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/park/V2XIllegalParkMarker.java
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/park/V2XIllegalParkMarker.java
@@ -95,6 +95,8 @@ public class V2XIllegalParkMarker implements IV2XMarker>
V2XServiceManager.getMoGoV2XPolylineManager().clearLine();
// 移除事件POI
V2XServiceManager.getMoGoV2XMarkerManager().clearAlarmPOI();
+ // 绘制上次的数据
+ V2XServiceManager.getMoGoV2XMarkerManager().drawableLastAllPOI();
}
/**
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/EventTypeUtils.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/EventTypeUtils.java
index 9ba13d8dd1..a13c6142c3 100644
--- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/EventTypeUtils.java
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/EventTypeUtils.java
@@ -127,8 +127,6 @@ public class EventTypeUtils {
case V2XPoiTypeEnum.FOURS_FOG://浓雾
case V2XPoiTypeEnum.FOURS_ICE://结冰
case V2XPoiTypeEnum.FOURS_ACCIDENT://事故
- case V2XPoiTypeEnum.FOURS_NEALY://身边
- case V2XPoiTypeEnum.FOURS_LIVING://实时路况
isRoadEvent = true;
break;
}
diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/SurroundingEventView.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/SurroundingEventView.java
index 28cd2a0ba0..0f0b6f26c3 100644
--- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/SurroundingEventView.java
+++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/SurroundingEventView.java
@@ -1,8 +1,11 @@
package com.mogo.module.v2x.view;
import com.mogo.commons.mvp.IView;
+import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.v2x.entity.panel.SurroundingResponse;
+import java.util.List;
+
/**
* @author lixiaopeng
* @description
@@ -10,5 +13,5 @@ import com.mogo.module.v2x.entity.panel.SurroundingResponse;
*/
public interface SurroundingEventView extends IView {
- void showSurroudingData(SurroundingResponse data);
+ void showSurroudingData(List exploreWayList);
}
diff --git a/modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_event_description.xml b/modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_event_description.xml
new file mode 100644
index 0000000000..4e3af15104
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_event_description.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_event_list_item.xml b/modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_event_list_item.xml
new file mode 100644
index 0000000000..82b27ed3d0
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_event_list_item.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_go_to_share.xml b/modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_go_to_share.xml
new file mode 100644
index 0000000000..4ef10f4bc0
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_go_to_share.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_refresh.xml b/modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_refresh.xml
new file mode 100644
index 0000000000..7656a1a428
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_refresh.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-module-v2x/src/main/res/layout/head_v2x_scennario_history.xml b/modules/mogo-module-v2x/src/main/res/layout/head_v2x_scennario_history.xml
new file mode 100644
index 0000000000..549100d267
--- /dev/null
+++ b/modules/mogo-module-v2x/src/main/res/layout/head_v2x_scennario_history.xml
@@ -0,0 +1,13 @@
+
+
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 913477cb5a..3c0ebad79b 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
@@ -2,37 +2,39 @@
+ android:layout_width="642px"
+ android:layout_height="532px"
+ android:background="@color/surrounding_card_background">
+ android:layout_height="60dp"
+ android:visibility="visible">
+ android:textColor="@color/white" />
@@ -58,54 +60,68 @@
android:gravity="center_horizontal"
android:visibility="gone">
-
+
+
+ android:text="周边5公里,暂无交通事件"
+ android:textColor="@color/transparent_white_30"
+ android:textSize="18px"
+ android:textStyle="bold" />
+ android:text="你可以试着分享一个事件给其他车主"
+ android:textColor="@color/transparent_white_30"
+ android:textSize="18px"
+ android:textStyle="bold" />
-
diff --git a/modules/mogo-module-v2x/src/main/res/layout/module_fragment_surrounding_event_item.xml b/modules/mogo-module-v2x/src/main/res/layout/module_fragment_surrounding_event_item.xml
index 557a0f0c82..97d76c6af4 100644
--- a/modules/mogo-module-v2x/src/main/res/layout/module_fragment_surrounding_event_item.xml
+++ b/modules/mogo-module-v2x/src/main/res/layout/module_fragment_surrounding_event_item.xml
@@ -1,30 +1,57 @@
-
-
-
+ android:src="@drawable/icon_default_black_logo" />
+
+
+
+
+
+
+
+
+
+
diff --git a/modules/mogo-module-v2x/src/main/res/layout/module_v2x_event_panel_fragment_event_panel.xml b/modules/mogo-module-v2x/src/main/res/layout/module_v2x_event_panel_fragment_event_panel.xml
index ea56d33d13..ffea487a85 100644
--- a/modules/mogo-module-v2x/src/main/res/layout/module_v2x_event_panel_fragment_event_panel.xml
+++ b/modules/mogo-module-v2x/src/main/res/layout/module_v2x_event_panel_fragment_event_panel.xml
@@ -5,28 +5,28 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
-
-
+
+
+
+