Merge remote-tracking branch 'origin/dev_1.1.2' into dev_1.1.2

This commit is contained in:
tongchenfei
2020-08-12 15:52:29 +08:00
147 changed files with 1383 additions and 411 deletions

3
.idea/dictionaries/admin.xml generated Normal file
View File

@@ -0,0 +1,3 @@
<component name="ProjectDictionaryState">
<dictionary name="admin" />
</component>

1
.idea/gradle.xml generated
View File

@@ -52,6 +52,7 @@
<option value="$PROJECT_DIR$/modules/mogo-module-splash-noop" />
<option value="$PROJECT_DIR$/modules/mogo-module-tanlu" />
<option value="$PROJECT_DIR$/modules/mogo-module-v2x" />
<option value="$PROJECT_DIR$/modules/mogo-module-widgets" />
<option value="$PROJECT_DIR$/services" />
<option value="$PROJECT_DIR$/services/mogo-service" />
<option value="$PROJECT_DIR$/services/mogo-service-api" />

View File

@@ -72,6 +72,9 @@ android {
em4 {
manifest.srcFile 'src/em4/AndroidManifest.xml'
}
f8xxLauncherOnlineRelease{
manifest.srcFile 'src/f8xxLauncherOnlineRelease/AndroidManifest.xml'
}
}
flavorDimensions "product", "basic", "env"
@@ -80,7 +83,6 @@ android {
//独立app
independent{
dimension "basic"
applicationId rootProject.ext.android.independentApplicationId
// 是否启动位置服务
buildConfigField 'boolean', 'LAUNCH_LOCATION_SERVICE', 'false'
// 是否使用高德sdk自定义导航
@@ -92,7 +94,6 @@ android {
// launcher app
launcher{
dimension "basic"
applicationId rootProject.ext.android.launcherApplicationId
// 是否启动位置服务
buildConfigField 'boolean', 'LAUNCH_LOCATION_SERVICE', 'true'
// 是否使用高德sdk自定义导航
@@ -103,6 +104,7 @@ android {
}
// f系列-分体机全系列,未细分
f8xx{
applicationId rootProject.ext.android.fLauncherApplicationId
dimension "product"
// 使用思必驰语音
buildConfigField 'int', 'AIType','2'
@@ -110,9 +112,11 @@ android {
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
buildConfigField 'boolean', 'ROAD_EVENT_ANIMATED', 'true'
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.fLauncherAmapApiValue]
}
// e系列采用Launcher方案
e8xx {
applicationId rootProject.ext.android.launcherApplicationId
dimension "product"
// 使用思必驰语音
buildConfigField 'int', 'AIType','2'
@@ -120,9 +124,11 @@ android {
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
buildConfigField 'boolean', 'ROAD_EVENT_ANIMATED', 'true'
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonLauncherAmapApiValue]
}
// 同上
em4 {
applicationId rootProject.ext.android.launcherApplicationId
dimension "product"
// 使用思必驰语音
buildConfigField 'int', 'AIType','2'
@@ -130,9 +136,11 @@ android {
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
buildConfigField 'boolean', 'ROAD_EVENT_ANIMATED', 'true'
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonLauncherAmapApiValue]
}
// e系列-2+32对标D系列2+32采用独立app的形式
em3 {
applicationId rootProject.ext.android.independentApplicationId
dimension "product"
// 使用思必驰语音
buildConfigField 'int', 'AIType', '2'
@@ -140,9 +148,11 @@ android {
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
buildConfigField 'boolean', 'ROAD_EVENT_ANIMATED', 'false'
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonIndependentAmapApiValue]
}
// e系列-1+16对标D系列1+16采用独立app形式
em1 {
applicationId rootProject.ext.android.independentApplicationId
dimension "product"
// 使用思必驰语音
buildConfigField 'int', 'AIType', '2'
@@ -150,9 +160,11 @@ android {
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
buildConfigField 'boolean', 'ROAD_EVENT_ANIMATED', 'false'
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonIndependentAmapApiValue]
}
// d系列
d8xx {
applicationId rootProject.ext.android.independentApplicationId
dimension "product"
// 使用同行者语音
buildConfigField 'int', 'AIType','1'
@@ -160,9 +172,11 @@ android {
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
buildConfigField 'boolean', 'ROAD_EVENT_ANIMATED', 'false'
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonIndependentAmapApiValue]
}
// d系列 1+16 版本
d82x{
applicationId rootProject.ext.android.independentApplicationId
dimension "product"
// 使用同行者语音
buildConfigField 'int', 'AIType','1'
@@ -170,9 +184,11 @@ android {
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
buildConfigField 'boolean', 'ROAD_EVENT_ANIMATED', 'false'
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.commonIndependentAmapApiValue]
}
// 比亚迪
bydauto{
applicationId rootProject.ext.android.bydautoIndependentApplicationId
dimension "product"
// 不使用语音
buildConfigField 'int', 'AIType','0'
@@ -180,6 +196,7 @@ android {
// 车机类型主要用于区分自研车机还是别人家的车机其他车机比亚迪定为1
buildConfigField 'int', 'CAR_MACHINE_TYPE', '1'
buildConfigField 'boolean', 'ROAD_EVENT_ANIMATED', 'true'
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.bydautoIndependentApiValue]
}
qa {
dimension "env"
@@ -277,6 +294,7 @@ dependencies {
implementation rootProject.ext.dependencies.moduletanluapi
implementation rootProject.ext.dependencies.mogomonitor
implementation rootProject.ext.dependencies.mogomodulewidgets
} else {
launcherImplementation project(':main-extensions:mogo-module-main-launcher')
independentImplementation project(':main-extensions:mogo-module-main-independent')
@@ -293,6 +311,7 @@ dependencies {
}
implementation project(':libraries:mogo-tanlu-api')
implementation project(':modules:mogo-module-monitor')
implementation project(':modules:mogo-module-widgets')
}
apply from: "./functions/baseservices.gradle"

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:sharedUserId="android.uid.system"
package="com.mogo.launcher">
</manifest>

View File

@@ -12,10 +12,10 @@
android:theme="@style/AppTheme.App"
tools:replace="android:label">
<!-- 高德地图 -->
<meta-data
tools:replace="android:value"
android:name="com.amap.api.v2.apikey"
android:value="1c3fbc5f5e183619ffb1e7bc01e6751f" />
<!-- <meta-data-->
<!-- tools:replace="android:value"-->
<!-- android:name="com.amap.api.v2.apikey"-->
<!-- android:value="1c3fbc5f5e183619ffb1e7bc01e6751f" />-->
</application>
<uses-permission android:name="android.permission.WAKE_LOCK" />

View File

@@ -18,10 +18,10 @@
<!-- android:authorities="com.zhidao.auto.personal.provider"-->
<!-- android:enabled="true"-->
<!-- android:exported="true" />-->
<meta-data
android:name="com.amap.api.v2.apikey"
android:value="a36b9f7b086fa3951bb35338a5a06dd3"
tools:replace="android:value" />
<!-- <meta-data-->
<!-- android:name="com.amap.api.v2.apikey"-->
<!-- android:value="a36b9f7b086fa3951bb35338a5a06dd3"-->
<!-- tools:replace="android:value" />-->
<!-- 高德地图 -->
</application>

View File

@@ -13,6 +13,9 @@
android:supportsRtl="true"
android:theme="@style/AppTheme.App"
tools:replace="android:label">
<meta-data
android:name="com.amap.api.v2.apikey"
android:value="${AMAP_API_VALUE}" />
<!--保活用-->
<service
android:name="com.zhidao.boot.persistent.lib.PersistentAliveService"

View File

@@ -11,7 +11,6 @@ import com.bytedance.boost_multidex.BoostMultiDex;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.network.Utils;
import com.mogo.commons.storage.SpStorage;
import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant;
import com.mogo.module.carchatting.card.CallChatConstant;
import com.mogo.module.common.MogoModule;
@@ -22,6 +21,7 @@ import com.mogo.module.push.base.PushUIConstants;
import com.mogo.module.service.ServiceConst;
import com.mogo.module.tanlu.constant.TanluConstants;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.widgets.MogoWidgetsProvider;
import com.mogo.service.IMogoServiceApis;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.passport.IMogoTicketCallback;
@@ -58,14 +58,15 @@ public class MogoApplication extends AbsMogoApplication {
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_AGREEMENT, AuthorizeConstant.PATH_AGREEMENT_MODULE_NAME ) );
//运营位卡片,需要默认显示,放在第一个加载
if (DebugConfig.isLauncher() ) {
if ( DebugConfig.isLauncher() ) {
MogoModulePaths.addModule( new MogoModule( MediaConstants.TAG, MediaConstants.MODULE_TYPE ) );
} else {
MogoModulePaths.addBaseModule( new MogoModule( MogoWidgetsProvider.PATH, MogoWidgetsProvider.NAME ) );
}
if(DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_BYD){
if ( DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_BYD ) {
MogoModulePaths.addModule( new MogoModule( CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME ) );
}
MogoModulePaths.addModule(new MogoModule(TanluApiConst.MODULE_PATH,
TanluApiConst.MODULE_NAME));
MogoModulePaths.addModule( new MogoModule( TanluApiConst.MODULE_PATH, TanluApiConst.MODULE_NAME ) );
MogoModulePaths.addModule( new MogoModule( TanluConstants.TAG, TanluConstants.MODEL_NAME ) );
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_SHARE, "ShareControl" ) );
@@ -101,13 +102,13 @@ public class MogoApplication extends AbsMogoApplication {
@Override
protected void init() {
super.init();
prepareBaseService(2_000L);
prepareBaseService( 2_000L );
}
/**
* 基础服务passport、location、socket
*/
private void prepareBaseService(long delay) {
private void prepareBaseService( long delay ) {
UiThreadHandler.postDelayed( () -> {
final IMogoServiceApis apis = ARouter.getInstance().navigation( IMogoServiceApis.class );
// 第三方平台的sn是服务端生成的所以必须在返回后才能开启

View File

@@ -4,12 +4,18 @@ ext {
android = [
// applicationId : "com.mogo.launcher",
// zhidadoApplicationId: "com.zhidao.launcher",
launcherApplicationId : "com.mogo.launcher",
independentApplicationId: "com.mogo.launcher.app",
compileSdkVersion : 28,
buildToolsVersion : "29.0.2",
minSdkVersion : 19,
targetSdkVersion : 22,
launcherApplicationId : "com.mogo.launcher",
independentApplicationId : "com.mogo.launcher.app",
fLauncherApplicationId : "com.mogo.launcher.f",
bydautoIndependentApplicationId: "com.mogo.launcher.app.bydauto",
fLauncherAmapApiValue : "aa2c8a0547378ead2f9a37762d9dd179",
bydautoIndependentApiValue : "b1e1d527b02a493913c50985827c943a",
commonLauncherAmapApiValue : "a36b9f7b086fa3951bb35338a5a06dd3",
commonIndependentAmapApiValue : "1c3fbc5f5e183619ffb1e7bc01e6751f",
compileSdkVersion : 28,
buildToolsVersion : "29.0.2",
minSdkVersion : 19,
targetSdkVersion : 22,
]
dependencies = [
@@ -188,5 +194,8 @@ targetSdkVersion : 22,
androidxroomruntime : "androidx.room:room-runtime:2.2.3",
androidxroomcompiler : "androidx.room:room-compiler:2.2.3",
androidxroomktx : "androidx.room:room-ktx:2.2.3",
//
mogomodulewidgets : "com.mogo.module:module-widgets:${MOGO_MODULE_WIDGETS_VERSION}",
]
}

View File

@@ -1,26 +0,0 @@
package com.mogo.base.services.apk;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith( AndroidJUnit4.class )
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals( "com.mogo.base.services.apk.test", appContext.getPackageName() );
}
}

View File

@@ -1,17 +0,0 @@
package com.mogo.base.services.apk;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals( 4, 2 + 2 );
}
}

View File

@@ -57,4 +57,34 @@ public class AppUtils {
return null;
}
}
public static boolean isAppForeground( Context context ) {
if ( context != null ) {
ActivityManager activityManager = ( ActivityManager ) context.getSystemService( Context.ACTIVITY_SERVICE );
List< ActivityManager.RunningAppProcessInfo > processes = activityManager.getRunningAppProcesses();
for ( ActivityManager.RunningAppProcessInfo processInfo : processes ) {
if ( processInfo.processName.equals( context.getPackageName() ) ) {
if ( processInfo.importance == ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND ) {
return true;
}
}
}
}
return false;
}
public static boolean isAppForeground( Context context, String pkg ) {
if ( context != null ) {
ActivityManager activityManager = ( ActivityManager ) context.getSystemService( Context.ACTIVITY_SERVICE );
List< ActivityManager.RunningAppProcessInfo > processes = activityManager.getRunningAppProcesses();
for ( ActivityManager.RunningAppProcessInfo processInfo : processes ) {
if ( processInfo.processName.equals( pkg ) ) {
if ( processInfo.importance == ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND ) {
return true;
}
}
}
}
return false;
}
}

View File

@@ -65,7 +65,7 @@ MOGO_BASE_SERVICES_SDK_VERSION = 1.2.1.22
# 探路
MOGO_MODULE_TANLU_VERSION=1.3.1.24
# 车聊聊
CARCHATTING_VERSION=1.4.8
CARCHATTING_VERSION=1.4.9
# 车聊聊接口
CARCHATTINGPROVIDER_VERSION=1.3.4
# 视频引导
@@ -89,6 +89,8 @@ MOGO_MODULE_EVENT_PANEL_NOOP_VERSION = 1.0.0-SNAPSHOT
#左侧面板模块
MOGO_MODULE_LEFT_PANEL_VERSION = 1.2.1.10-SNAPSHOT
MOGO_MODULE_LEFT_PANEL_NOOP_VERSION = 1.2.1.10-SNAPSHOT
# 小控件
MOGO_MODULE_WIDGETS_VERSION = 1.2.1.10-SNAPSHOT
# Boost分包
BOOST_MULTIDEX_VERSION=1.0.0

View File

@@ -1,17 +0,0 @@
package com.zhidao.roadcondition
import org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}

View File

@@ -5,6 +5,7 @@
<string name="module_apps_str_guide_warning">为了您的安全,导航中不可播放视频</string>
<string-array name="module_apps_array_filter_packages_f">
<item>com.mogo.launcher</item>
<item>com.mogo.launcher.f</item>
<item>com.mogo.launcher.app</item>
<item>com.zhidao.launcher</item>
<item>com.nwd.android.toolsmanager</item>
@@ -28,6 +29,7 @@
</string-array>
<string-array name="module_apps_array_filter_packages">
<item>com.mogo.launcher</item>
<item>com.mogo.launcher.f</item>
<item>com.mogo.launcher.app</item>
<item>com.zhidao.launcher</item>
<item>com.nwd.android.toolsmanager</item>

View File

@@ -1,24 +0,0 @@
package com.mogo.module.authorize
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.mogo.module.authorize.test", appContext.packageName)
}
}

View File

@@ -1,17 +0,0 @@
package com.mogo.module.authorize
import org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}

View File

@@ -45,8 +45,10 @@ public class BackToMainHomeManager {
return;
}
mApis.getIntentManagerApi().invoke( Intent.ACTION_CLOSE_SYSTEM_DIALOGS, new Intent() );
Intent intent2 = new Intent( );
// 是否发自系统消息
intent2.putExtra( "isHomeKeyDown", false );
mApis.getIntentManagerApi().invoke( Intent.ACTION_CLOSE_SYSTEM_DIALOGS, intent2 );
Logger.d( TAG, "返回桌面" );
Intent intent = new Intent();

View File

@@ -32,7 +32,7 @@ public class MarkerExploreWay implements Serializable {
public String getAddr() {
if (TextUtils.isEmpty(addr)) {
return "";
return "未知道路";
}
return addr;
}

View File

@@ -1,5 +1,6 @@
package com.mogo.module.common.entity;
import com.mogo.map.location.MogoLocation;
import com.mogo.utils.sqlite.annotation.DbDatabase;
import com.mogo.utils.sqlite.annotation.DbField;
import com.mogo.utils.sqlite.annotation.DbTable;
@@ -68,4 +69,14 @@ public class V2XHistoryScenarioData {
public void setDispose(Boolean dispose) {
isDispose = dispose;
}
@Override
public V2XHistoryScenarioData clone() throws CloneNotSupportedException {
try {
return (V2XHistoryScenarioData) super.clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return this;
}
}

View File

@@ -29,6 +29,11 @@ class DialogImpl implements IWindowManagerView {
return dialog.isShowing();
}
@Override
public void handleTouchEvent(OnViewClickListener listener) {
// do nothings.
}
@Override
public void show() {
dialog.show();

View File

@@ -1,18 +1,27 @@
package com.mogo.module.common.wm;
import android.view.View;
interface IWindowManagerView {
/**
* 初始化
*
* @param params contentView包装类
*/
void init(WindowManagerView.WMViewParams params);
void init( WindowManagerView.WMViewParams params );
/**
* 是否显示
*
* @return true - 显示中
*/
boolean isShowing();
/**
* 支持手势拖动,该操作只支持触发点击操作
*/
void handleTouchEvent(OnViewClickListener listener);
/**
* 显示
*/
@@ -22,4 +31,8 @@ interface IWindowManagerView {
* 隐藏
*/
void hide();
interface OnViewClickListener {
void onClick( View view );
}
}

View File

@@ -3,12 +3,9 @@ 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.MotionEvent;
import android.view.WindowManager;
import com.mogo.module.common.utils.CarSeries;
import com.mogo.utils.WindowUtils;
/**
* 采用windowManager实现接口
*/
@@ -19,10 +16,13 @@ class WindowManagerImpl implements IWindowManagerView {
private WindowManagerView.WMViewParams mParams;
private boolean isShowing;
private float mLastX, mLastY;
private int mOldOffsetX, mOldOffsetY;
@Override
public void init(WindowManagerView.WMViewParams params) {
public void init( WindowManagerView.WMViewParams params ) {
mParams = params;
mWindowManager = (WindowManager) mParams.mContext.getApplicationContext().getSystemService( Context.WINDOW_SERVICE );
mWindowManager = ( WindowManager ) mParams.mContext.getApplicationContext().getSystemService( Context.WINDOW_SERVICE );
mLayoutParams = new WindowManager.LayoutParams();
if ( Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ) {
mLayoutParams.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
@@ -30,13 +30,13 @@ class WindowManagerImpl implements IWindowManagerView {
mLayoutParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
}
mLayoutParams.format = PixelFormat.TRANSLUCENT;
mLayoutParams.gravity = Gravity.CENTER;
mLayoutParams.gravity = mParams.mGravity;
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;
mLayoutParams.width = mParams.mWidth;
mLayoutParams.height = mParams.mHeight;
mLayoutParams.x = mParams.mX;
mLayoutParams.y = mParams.mY;
mOldOffsetX = mLayoutParams.x = mParams.mX;
mOldOffsetY = mLayoutParams.y = mParams.mY;
mLayoutParams.dimAmount = 0.5f;
}
@@ -45,20 +45,47 @@ class WindowManagerImpl implements IWindowManagerView {
return isShowing;
}
@Override
public void handleTouchEvent(OnViewClickListener listener) {
mParams.mContentView.setOnTouchListener( ( v, event ) -> {
final int action = event.getAction();
float x = event.getX();
float y = event.getY();
if ( action == MotionEvent.ACTION_DOWN ) {
mLastX = x;
mLastY = y;
} else if ( action == MotionEvent.ACTION_MOVE ) {
mLayoutParams.x += ( int ) ( x - mLastX ) / 3; // 减小偏移量,防止过度抖动
mLayoutParams.y += ( int ) ( y - mLastY ) / 3; // 减小偏移量,防止过度抖动
mWindowManager.updateViewLayout( mParams.mContentView, mLayoutParams );
} else if ( action == MotionEvent.ACTION_UP ) {
int newOffsetX = mLayoutParams.x;
int newOffsetY = mLayoutParams.y;
// 只要按钮一动位置不是很大,就认为是点击事件
if ( Math.abs( mOldOffsetX - newOffsetX ) <= 20
&& Math.abs( mOldOffsetY - newOffsetY ) <= 20 ) {
listener.onClick( mParams.mContentView );
}
mOldOffsetX = newOffsetX;
mOldOffsetY = newOffsetY;
}
return true;
} );
}
@Override
public void show() {
if(!isShowing){
if ( !isShowing ) {
isShowing = true;
mWindowManager.addView(mParams.mContentView,mLayoutParams);
mWindowManager.addView( mParams.mContentView, mLayoutParams );
}
}
@Override
public void hide() {
if (isShowing && mParams != null) {
mWindowManager.removeView(mParams.mContentView);
if ( isShowing && mParams != null ) {
mWindowManager.removeView( mParams.mContentView );
isShowing = false;
}
}
}

View File

@@ -33,6 +33,10 @@ public class WindowManagerView {
return mParams.mContentView.findViewById( id );
}
public void attachTouchEvent( IWindowManagerView.OnViewClickListener listener ) {
mManagerView.handleTouchEvent(listener);
}
public void show() {
mManagerView.show();
}
@@ -72,6 +76,11 @@ public class WindowManagerView {
return this;
}
public Builder gravity( int gravity ) {
mParams.mGravity = gravity;
return this;
}
/**
* 默认dialog实现
*
@@ -105,5 +114,6 @@ public class WindowManagerView {
public int mHeight;
public int mX;
public int mY;
public int mGravity;
}
}

View File

@@ -1,24 +0,0 @@
package com.zhidao.mogo.module.left.panel
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.zhidao.mogo.module.left.panel.test", appContext.packageName)
}
}

View File

@@ -1,17 +0,0 @@
package com.zhidao.mogo.module.left.panel
import org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}

View File

@@ -308,7 +308,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
@Override
public void onIntentReceived( String intentStr, Intent intent ) {
if ( TextUtils.equals( Intent.ACTION_CLOSE_SYSTEM_DIALOGS, intentStr ) ) {
mIsHomeKeyDown = true;
mIsHomeKeyDown = intent.getBooleanExtra( "isHomeKeyDown", true );
}
}

View File

@@ -1,14 +1,12 @@
package com.mogo.module.map;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.text.TextUtils;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.map.navi.MogoNaviConfig;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.service.intent.IMogoIntentListener;
import com.mogo.service.intent.IMogoIntentManager;
import com.mogo.utils.logger.Logger;
public
@@ -18,21 +16,19 @@ public
*
* 接收高德地图车机版广播
*/
class AutoNaviBroadcastReceiver extends BroadcastReceiver {
class AutoNaviBroadcastIntentHandler implements IMogoIntentListener {
public static final String TAG = "AutoNaviBroadcastReceiver";
public static final String AUTONAVI_STANDARD_BROADCAST_RECV = "AUTONAVI_STANDARD_BROADCAST_RECV";
public void register() {
IntentFilter inputFilter = new IntentFilter();
inputFilter.addAction( AUTONAVI_STANDARD_BROADCAST_RECV );
AbsMogoApplication.getApp().registerReceiver( this, inputFilter );
public void register( IMogoIntentManager manager ) {
manager.registerIntentListener( AUTONAVI_STANDARD_BROADCAST_RECV, this );
}
public void unregister() {
public void unregister(IMogoIntentManager manager ) {
mCallback = null;
AbsMogoApplication.getApp().unregisterReceiver( this );
manager.unregisterIntentListener( AUTONAVI_STANDARD_BROADCAST_RECV, this );
}
private OnMapControlCallback mCallback;
@@ -42,7 +38,7 @@ class AutoNaviBroadcastReceiver extends BroadcastReceiver {
}
@Override
public void onReceive( Context context, Intent intent ) {
public void onIntentReceived( String intentStr, Intent intent ) {
String action = intent.getAction();
int keyType = intent.getIntExtra( "KEY_TYPE", 0 );
@@ -122,6 +118,5 @@ class AutoNaviBroadcastReceiver extends BroadcastReceiver {
.avoidSpeed( prefer == 3 );
mCallback.onReCalculatePath( config );
}
mCallback.onEnd( intent );
}
}

View File

@@ -32,6 +32,7 @@ import com.mogo.service.module.IMogoRegisterCenter;
import com.mogo.service.module.IMogoSearchManager;
import com.mogo.service.statusmanager.IMogoStatusManager;
import com.mogo.service.strategy.IMogoRefreshStrategyController;
import com.mogo.utils.AppUtils;
import com.mogo.utils.ResourcesHelper;
import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.logger.Logger;
@@ -73,23 +74,11 @@ public class MapPresenter extends Presenter< MapView > implements
mView.getUIController().recoverLockMode();
}
};
private AutoNaviBroadcastReceiver mAutoNaviReceiver;
private AutoNaviBroadcastIntentHandler mAutoNaviReceiver;
private MapControlCommandHandler mCustomVoiceCommandHandler;
public MapPresenter( MapView view ) {
super( view );
initBroadcast();
mCustomVoiceCommandHandler = new MapControlCommandHandler();
mCustomVoiceCommandHandler.setCallback( this );
}
/**
* opera type为00 实时路况开1实时路况关 type为10 放大地图; 1缩小地图 type为20切换2d车上 1切换2d北上2切换3d车上支持
*/
private void initBroadcast() {
mAutoNaviReceiver = new AutoNaviBroadcastReceiver();
mAutoNaviReceiver.setCallback( this );
mAutoNaviReceiver.register();
}
@Override
@@ -158,11 +147,10 @@ public class MapPresenter extends Presenter< MapView > implements
if ( CustomNaviInterrupter.getInstance().interrupt() ) {
// 导航过程中语音指令退出导航,会出现 activity 不走 onResume 的情况
UiThreadHandler.postDelayed( () -> {
if ( isForeground( getContext() ) && !hasOthersActivity() && !mStatusManager.isMainPageOnResume() ) {
if ( AppUtils.isAppForeground( getContext() ) && !hasOthersActivity() && !mStatusManager.isMainPageOnResume() ) {
mLauncher.backToLauncher( getContext() );
}
}, 500L );
onEnd( intent );
return;
}
mMogoMapService.getNavi( getContext() ).stopNavi();
@@ -176,26 +164,6 @@ public class MapPresenter extends Presenter< MapView > implements
mMogoMapService.getNavi( getContext() ).reCalculateRoute( config );
}
@Override
public void onEnd( Intent intent ) {
mMogoIntentManager.invoke( AutoNaviBroadcastReceiver.AUTONAVI_STANDARD_BROADCAST_RECV, intent );
}
private boolean isForeground( Context context ) {
if ( context != null ) {
ActivityManager activityManager = ( ActivityManager ) context.getSystemService( Context.ACTIVITY_SERVICE );
List< ActivityManager.RunningAppProcessInfo > processes = activityManager.getRunningAppProcesses();
for ( ActivityManager.RunningAppProcessInfo processInfo : processes ) {
if ( processInfo.processName.equals( context.getPackageName() ) ) {
if ( processInfo.importance == ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND ) {
return true;
}
}
}
}
return false;
}
private boolean hasOthersActivity() {
ActivityManager am = ( ActivityManager ) getContext().getSystemService( Context.ACTIVITY_SERVICE );
List< ActivityManager.RunningTaskInfo > list = am.getRunningTasks( 1 );
@@ -298,6 +266,16 @@ public class MapPresenter extends Presenter< MapView > implements
for ( String cmd : VoiceConstants.sUnUnRegisterCmds ) {
mMogoIntentManager.registerIntentListener( cmd, this );
}
initBroadcast();
mCustomVoiceCommandHandler = new MapControlCommandHandler();
mCustomVoiceCommandHandler.setCallback( this );
}
private void initBroadcast() {
mAutoNaviReceiver = new AutoNaviBroadcastIntentHandler();
mAutoNaviReceiver.setCallback( this );
mAutoNaviReceiver.register( mMogoIntentManager );
}
@Override
@@ -309,7 +287,6 @@ public class MapPresenter extends Presenter< MapView > implements
@Override
public void onPause( @NonNull LifecycleOwner owner ) {
super.onPause( owner );
unregisterVoiceCmd();
}
@@ -317,7 +294,7 @@ public class MapPresenter extends Presenter< MapView > implements
public void onDestroy( @NonNull LifecycleOwner owner ) {
super.onDestroy( owner );
if ( mAutoNaviReceiver != null ) {
mAutoNaviReceiver.unregister();
mAutoNaviReceiver.unregister( mMogoIntentManager );
}
}

View File

@@ -31,9 +31,6 @@ public interface OnMapControlCallback {
// 重新规划路线
void onReCalculatePath( MogoNaviConfig config );
// 结束
void onEnd( Intent intent );
// 查看全程
void onDisplayOverview();

View File

@@ -274,7 +274,7 @@ public class MogoServices implements IMogoMapListener,
private boolean mIsFirstAccOn = true;
private IMogoStatusChangedListener statusChangedListener = new StatusChangedAdapter(){
private IMogoStatusChangedListener statusChangedListener = new StatusChangedAdapter() {
@Override
public void onUserInteracted( boolean userInteracted ) {
if ( userInteracted ) {
@@ -382,6 +382,8 @@ public class MogoServices implements IMogoMapListener,
mIntentManager.registerIntentListener( ServiceConst.COMMAND_ZHIDAO_NEARBY_USER_ONLINE, this );
mIntentManager.registerIntentListener( ServiceConst.COMMAND_ZHIDAO_NEARBY_FRIEND_BYLOCATION, this );
mIntentManager.registerIntentListener( ServiceConst.COMMAND_BACK, this );
mIntentManager.registerIntentListener( MogoReceiver.ACTION_AUTO_NAVI_RECEIVER, this );
mIntentManager.registerIntentListener( MogoReceiver.ACTION_AUTO_NAVI_SEND, this );
mADASController = MarkerServiceHandler.getADASController();
mLauncher = MarkerServiceHandler.getLauncher();
@@ -395,6 +397,7 @@ public class MogoServices implements IMogoMapListener,
if ( DebugConfig.isLaunchLocationService() ) {
initLocationServiceProcess( context );
}
}
private void initLocationServiceProcess( Context context ) {
@@ -473,6 +476,8 @@ public class MogoServices implements IMogoMapListener,
filter.addAction( MogoReceiver.ACTION_VOICE_READY );
filter.addAction( MogoReceiver.ACTION_MOCK );
filter.addAction( Intent.ACTION_CLOSE_SYSTEM_DIALOGS );
filter.addAction( MogoReceiver.ACTION_AUTO_NAVI_RECEIVER );
filter.addAction( MogoReceiver.ACTION_AUTO_NAVI_SEND );
try {
context.getApplicationContext().registerReceiver( mAIAssistReceiver, filter );
Logger.i( TAG, "register voice receiver." );

View File

@@ -53,6 +53,11 @@ public class MogoReceiver extends BroadcastReceiver {
public static final String ACTION_MOCK = "com.mogo.mock";
// 接受其他app发给高德的广播
public static final String ACTION_AUTO_NAVI_RECEIVER = "AUTONAVI_STANDARD_BROADCAST_RECV";
// 接受高德发过来的广播
public static final String ACTION_AUTO_NAVI_SEND = "AUTONAVI_STANDARD_BROADCAST_SEND";
private IMogoIntentManager mMogoIntentManager;
public MogoReceiver(Context context) {

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_service_marker_anchor_size">16dp</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>
<dimen name="module_service_marker_bubble_icon_height">35px</dimen>
<dimen name="module_service_marker_bubble_icon_marginBottom">4px</dimen>
<dimen name="module_service_marker_bounds_leftMargin">550px</dimen>
<dimen name="module_service_marker_bounds_topMargin">208px</dimen>
<dimen name="module_service_marker_bounds_bottomMargin">100px</dimen>
<dimen name="module_service_marker_bounds_rightMargin">100px</dimen>
<dimen name="module_services_info_window_paddingStart">100px</dimen>
<dimen name="module_services_info_window_paddingEnd">10px</dimen>
<dimen name="module_services_info_window_height">54px</dimen>
<dimen name="module_service_user_header_width">44px</dimen>
<dimen name="module_service_user_header_height">44px</dimen>
<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

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_service_marker_anchor_size">16dp</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>
<dimen name="module_service_marker_bubble_icon_height">35px</dimen>
<dimen name="module_service_marker_bubble_icon_marginBottom">4px</dimen>
<dimen name="module_service_marker_bounds_leftMargin">550px</dimen>
<dimen name="module_service_marker_bounds_topMargin">208px</dimen>
<dimen name="module_service_marker_bounds_bottomMargin">100px</dimen>
<dimen name="module_service_marker_bounds_rightMargin">100px</dimen>
<dimen name="module_services_info_window_paddingStart">100px</dimen>
<dimen name="module_services_info_window_paddingEnd">10px</dimen>
<dimen name="module_services_info_window_height">54px</dimen>
<dimen name="module_service_user_header_width">44px</dimen>
<dimen name="module_service_user_header_height">44px</dimen>
<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

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_service_marker_anchor_size">20dp</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>
<dimen name="module_service_marker_bubble_icon_height">60px</dimen>
<dimen name="module_service_marker_bubble_icon_marginBottom">8px</dimen>
<!-- 导航查看全程显示范围-->
<dimen name="module_service_marker_bounds_leftMargin">1000px</dimen>
<dimen name="module_service_marker_bounds_topMargin">390px</dimen>
<dimen name="module_service_marker_bounds_bottomMargin">200px</dimen>
<dimen name="module_service_marker_bounds_rightMargin">200px</dimen>
<dimen name="module_services_info_window_paddingStart">10px</dimen>
<dimen name="module_services_info_window_paddingEnd">10px</dimen>
<dimen name="module_services_info_window_height">100px</dimen>
<dimen name="module_service_user_header_width">80px</dimen>
<dimen name="module_service_user_header_height">80px</dimen>
<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,25 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_service_marker_anchor_size">16dp</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>
<dimen name="module_service_marker_bubble_icon_height">35px</dimen>
<dimen name="module_service_marker_bubble_icon_marginBottom">4px</dimen>
<dimen name="module_service_marker_anchor_size">20dp</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>
<dimen name="module_service_marker_bubble_icon_height">60px</dimen>
<dimen name="module_service_marker_bubble_icon_marginBottom">8px</dimen>
<dimen name="module_service_marker_bounds_leftMargin">550px</dimen>
<dimen name="module_service_marker_bounds_topMargin">208px</dimen>
<dimen name="module_service_marker_bounds_bottomMargin">100px</dimen>
<dimen name="module_service_marker_bounds_rightMargin">100px</dimen>
<dimen name="module_services_info_window_paddingStart">100px</dimen>
<!-- 导航查看全程显示范围-->
<dimen name="module_service_marker_bounds_leftMargin">1000px</dimen>
<dimen name="module_service_marker_bounds_topMargin">390px</dimen>
<dimen name="module_service_marker_bounds_bottomMargin">200px</dimen>
<dimen name="module_service_marker_bounds_rightMargin">200px</dimen>
<dimen name="module_services_info_window_paddingStart">10px</dimen>
<dimen name="module_services_info_window_paddingEnd">10px</dimen>
<dimen name="module_services_info_window_height">54px</dimen>
<dimen name="module_service_user_header_width">44px</dimen>
<dimen name="module_service_user_header_height">44px</dimen>
<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>
<dimen name="module_services_info_window_height">100px</dimen>
<dimen name="module_service_user_header_width">80px</dimen>
<dimen name="module_service_user_header_height">80px</dimen>
<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,3 +1,4 @@
<resources>
<string name="app_name">mogo-module-service</string>
<string name="module_service_app_entrance_text">辅助\n驾驶</string>
</resources>

View File

@@ -1,24 +0,0 @@
package com.zhidao.mogo.module.splash
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.zhidao.mogo.module.byd.test", appContext.packageName)
}
}

View File

@@ -1,17 +0,0 @@
package com.zhidao.mogo.module.splash
import org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}

View File

@@ -67,6 +67,7 @@ import com.mogo.module.tanlu.model.NaviResult;
import com.mogo.module.tanlu.model.PathLineResult;
import com.mogo.module.tanlu.model.TanluModelData;
import com.mogo.module.tanlu.model.VoiceCmdData;
import com.mogo.module.tanlu.model.event.CloseWindowInfo;
import com.mogo.module.tanlu.model.event.ControlClickUpInfo;
import com.mogo.module.tanlu.model.event.DataErrorInfo;
import com.mogo.module.tanlu.model.event.GetInfoError;
@@ -448,6 +449,16 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onCloseWindow(final CloseWindowInfo event) {
if (event == null) {
return;
}
releaseTimer();
TanluServiceManager.getIMogoTopViewManager().removeView(TanluListWindow.this);
}
/**
* poi 搜索
*

View File

@@ -23,7 +23,9 @@ import com.mogo.module.tanlu.R;
import com.mogo.module.tanlu.callback.IThumbsUpCallback;
import com.mogo.module.tanlu.constant.TanluConstants;
import com.mogo.module.tanlu.model.TanluModelData;
import com.mogo.module.tanlu.model.event.CloseWindowInfo;
import com.mogo.module.tanlu.model.event.ControlClickUpInfo;
import com.mogo.module.tanlu.model.event.DataErrorInfo;
import com.mogo.module.tanlu.model.event.StartPlayInfo;
import com.mogo.module.tanlu.model.event.VoiceControlUpInfo;
import com.mogo.module.tanlu.util.ChartUtil;
@@ -71,6 +73,7 @@ public class TanluSlideAdapterNew extends RecyclerView.Adapter<TanluSlideViewHol
private LinearLayout mLikeLayout;
private TextView mTypeTv;
private IMogoImageloader mogoImageloader;
private ImageView mCloseImage;
//media
private GSYVideoOptionBuilder gsyVideoOptionBuilder = new GSYVideoOptionBuilder();
@@ -117,6 +120,14 @@ public class TanluSlideAdapterNew extends RecyclerView.Adapter<TanluSlideViewHol
mLikeImage = holder.itemView.findViewById(R.id.tanlu_like_imageView);
mLikeLayout = holder.itemView.findViewById(R.id.tanlu_like_layout);
mTypeTv = holder.itemView.findViewById(R.id.tv_information_type);
mCloseImage = holder.itemView.findViewById(R.id.tanlu_close_imageView);
mCloseImage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
EventBus.getDefault().post(new CloseWindowInfo());
}
});
//有可能不是一个对象
simpleCoverVideoPlayer.setVisibility(View.VISIBLE);

View File

@@ -0,0 +1,15 @@
package com.mogo.module.tanlu.model.event;
import java.io.Serializable;
/**
* @author lixiaopeng
* @description push区分类别
* @since 2020-01-08
*/
public class CloseWindowInfo implements Serializable {
public CloseWindowInfo() {
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/icon_window_close_press" android:state_pressed="true" />
<item android:drawable="@drawable/icon_window_close_normal" android:state_pressed="false" />
<item android:drawable="@drawable/icon_window_close_normal" />
</selector>

View File

@@ -159,6 +159,15 @@
android:src="@drawable/icon_heart_like" />
</LinearLayout>
<ImageView
android:id="@+id/tanlu_close_imageView"
android:layout_width="@dimen/tanlu_module_close_height"
android:layout_height="@dimen/tanlu_module_close_height"
android:layout_centerInParent="true"
android:layout_alignParentRight="true"
android:layout_marginRight="@dimen/tanlu_module_margin_right"
android:src="@drawable/selector_btn_close" />
</RelativeLayout>
</RelativeLayout>

View File

@@ -80,6 +80,7 @@
<dimen name="tanlu_module_card_height">350px</dimen>
<dimen name="tanlu_module_card_video_width">480px</dimen>
<dimen name="tanlu_module_card_video_height">320px</dimen>
<dimen name="tanlu_module_close_height">45px</dimen>
<dimen name="tanlu_module_card_margin_top">23px</dimen>
<dimen name="tanlu_module_card_margin_left">15px</dimen>

View File

@@ -80,6 +80,7 @@
<dimen name="tanlu_module_card_height">194px</dimen>
<dimen name="tanlu_module_card_video_width">266px</dimen>
<dimen name="tanlu_module_card_video_height">194px</dimen>
<dimen name="tanlu_module_close_height">45px</dimen>
<dimen name="tanlu_module_card_margin_top">16px</dimen>
<dimen name="tanlu_module_card_margin_left">8px</dimen>

View File

@@ -59,6 +59,7 @@ public class V2XConst {
*/
public static final String V2X_ROAD_SHOW = "v2x_road_show";
public static final String V2X_ROAD_EVET = "v2x_road_event";
public static final String V2X_ROAD_EVET_HISTORY_BUTTON = "V2X_button_click";
/**
* V2X 道路事件操作类型
*/

View File

@@ -31,6 +31,7 @@ import com.mogo.service.module.IMogoSearchManager;
import com.mogo.service.share.IMogoShareManager;
import com.mogo.service.statusmanager.IMogoStatusManager;
import com.mogo.service.strategy.IMogoRefreshStrategyController;
import com.mogo.service.tanlu.IMogoTanluProvider;
import com.mogo.service.windowview.IMogoTopViewManager;
import com.mogo.service.windowview.IMogoWindowManager;
import com.zhidao.carchattingprovider.CallChattingProviderConstant;
@@ -54,7 +55,6 @@ public class V2XServiceManager {
private static IMogoLocationClient mMogoLocationClient;
private static IMogoGeoSearch mIMogoGeoSearch;
private static IMogoSearchManager mIMogoSearchManager;
private static IMogoTopViewManager mMogoTopViewManager;
private static IMogoStatusManager mMogoStatusManager;
private static IMogoWindowManager mIMogoWindowManager;
@@ -66,6 +66,7 @@ public class V2XServiceManager {
private static IMogoRefreshStrategyController mIMogoRefreshStrategyController;
private static IMogoMarkerService mIMogoMarkerService;
private static IMogoShareManager mIMogoShareManager;
private static IMogoTanluProvider mIMogoTanluProvider;
private static IMogoActionManager mMogoActionManager;
private static ICarsChattingProvider mCarsChattingProvider;
@@ -105,6 +106,7 @@ public class V2XServiceManager {
mIMogoSearchManager = mMogoServiceApis.getSearchManagerApi();
mIMogoMarkerService = mMogoServiceApis.getMarkerService();
mIMogoShareManager = mMogoServiceApis.getShareManager();
mIMogoTanluProvider = mMogoServiceApis.getTanluApi();
mMarkerManager = mMapService.getMarkerManager(context);
mNavi = mMapService.getNavi(context);
@@ -250,4 +252,11 @@ public class V2XServiceManager {
public static IMogoShareManager getMogoShareManager() {
return mIMogoShareManager;
}
public static IMogoTanluProvider getTanluManager() {
return mIMogoTanluProvider;
}
}

View File

@@ -79,11 +79,14 @@ public class SurroundingEventAdapter extends RecyclerView.Adapter<SurroundingEve
}
});
//数据绑定 TODO
// Glide.with(mContext)
// .load(R.drawable.icon_car_red)
// .into(mBgImageView);
//数据绑定
Glide.with(mContext)
.load(getTypeRes(surroundingConstruction.getPoiType()))
.into(mBgImageView);
Glide.with(mContext)
.load(getTypeSmallRes(surroundingConstruction.getPoiType()))
.into(mTypeImageView);
}
@Override
@@ -91,34 +94,107 @@ public class SurroundingEventAdapter extends RecyclerView.Adapter<SurroundingEve
return mPoiInfosList == null ? 0 : mPoiInfosList.size();
}
private int getTypeSmallRes(String type) {
int resId = 0;
switch (type) {
case MarkerPoiTypeEnum.TRAFFIC_CHECK:
resId = R.drawable.mogo_image_jiaotongjiancha_small;
break;
case MarkerPoiTypeEnum.ROAD_CLOSED:
resId = R.drawable.mogo_image_fenglu_small;
break;
case MarkerPoiTypeEnum.FOURS_ROAD_WORK:
resId = R.drawable.mogo_image_daolushigong_small;
break;
case MarkerPoiTypeEnum.FOURS_BLOCK_UP:
resId = R.drawable.mogo_image_yongdu_small;
break;
case MarkerPoiTypeEnum.FOURS_PONDING:
resId = R.drawable.mogo_image_jishui_small;
break;
case MarkerPoiTypeEnum.FOURS_ICE:
resId = R.drawable.mogo_image_jiebing_small;
break;
case MarkerPoiTypeEnum.FOURS_FOG:
resId = R.drawable.mogo_image_nongwu_small;
break;
case MarkerPoiTypeEnum.FOURS_ACCIDENT:
resId = R.drawable.mogo_image_accident_small;
break;
case MarkerPoiTypeEnum.FOURS_LIVING:
resId = R.drawable.mogo_image_shishilukuang_small;
break;
default:
resId = R.drawable.mogo_image_shishilukuang_small;
break;
}
return resId;
}
private int getTypeRes(String type) {
int resId = 0;
switch (type) {
case MarkerPoiTypeEnum.TRAFFIC_CHECK:
resId = R.drawable.mogo_image_jiaotongjiancha_nor;
break;
case MarkerPoiTypeEnum.ROAD_CLOSED:
resId = R.drawable.mogo_image_fenglu_nor;
break;
case MarkerPoiTypeEnum.FOURS_ROAD_WORK:
resId = R.drawable.mogo_image_daolushigong_nor;
break;
case MarkerPoiTypeEnum.FOURS_BLOCK_UP:
resId = R.drawable.mogo_image_yongdu_nor;
break;
case MarkerPoiTypeEnum.FOURS_PONDING:
resId = R.drawable.mogo_image_jishui_nor;
break;
case MarkerPoiTypeEnum.FOURS_ICE:
resId = R.drawable.mogo_image_jiebing_nor;
break;
case MarkerPoiTypeEnum.FOURS_FOG:
resId = R.drawable.mogo_image_nongwu_nor;
break;
case MarkerPoiTypeEnum.FOURS_ACCIDENT:
resId = R.drawable.mogo_image_jiaotongshigu_nor;
break;
case MarkerPoiTypeEnum.FOURS_LIVING:
resId = R.drawable.mogo_image_shishlukuang_nor;
break;
default:
resId = R.drawable.mogo_image_shishlukuang_nor;
break;
}
return resId;
}
private String getTypeName(String type) {
String typeName = "";
switch (type) {
case MarkerPoiTypeEnum.TRAFFIC_CHECK:
typeName = "交通检查";
break;
case MarkerPoiTypeEnum.ROAD_CLOSED:
typeName = "封路";
break;
case MarkerPoiTypeEnum.FOURS_ROAD_WORK:
typeName = "道路施工";
break;
case MarkerPoiTypeEnum.FOURS_BLOCK_UP:
typeName = "道路拥堵";
break;
case MarkerPoiTypeEnum.FOURS_PONDING:
typeName = "道路积水";
break;
case MarkerPoiTypeEnum.FOURS_ICE:
typeName = "路面结冰";
break;
case MarkerPoiTypeEnum.FOURS_FOG:
typeName = "出现浓雾";
break;
case MarkerPoiTypeEnum.TRAFFIC_CHECK:
typeName = "交通检查";
break;
case MarkerPoiTypeEnum.FOURS_ACCIDENT:
typeName = "交通事故";
break;
case MarkerPoiTypeEnum.FOURS_BLOCK_UP:
typeName = "道路拥堵";
break;
case MarkerPoiTypeEnum.FOURS_ROAD_WORK:
typeName = "道路施工";
break;
case MarkerPoiTypeEnum.FOURS_PONDING:
typeName = "道路积水";
break;
case MarkerPoiTypeEnum.FOURS_LIVING:
typeName = "实时路况";
break;
@@ -130,5 +206,4 @@ public class SurroundingEventAdapter extends RecyclerView.Adapter<SurroundingEve
}
}

View File

@@ -125,7 +125,7 @@ public class V2XShareEventAdapter extends RecyclerView.Adapter<RecyclerView.View
if (data != null) {
String poitype = data.getPoiType();
String address = data.getUploadAddress();
String time = DateTimeUtils.getTimeText(data.getUploadTimestamp(),DateTimeUtils.M_Yue_d_Ri);
String time = DateTimeUtils.getTimeText(data.getUploadTimestamp(),DateTimeUtils.MM_Yue_dd_Ri_HH_mm);
String likeNum = String.valueOf(data.getLikeNum());
String notLikeNum = String.valueOf(data.getNotLikeNum());

View File

@@ -7,17 +7,21 @@ import android.widget.TextView;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.V2XEventShowEntity;
import com.mogo.module.common.entity.V2XHistoryScenarioData;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.scenario.scene.park.V2XIllegalParkScenario;
import com.mogo.module.v2x.utils.RoadConditionUtils;
import com.mogo.module.v2x.utils.V2XSQLiteUtils;
import com.mogo.module.v2x.view.HeartLikeView;
import com.mogo.module.v2x.view.HeartUnLikeView;
import com.mogo.module.v2x.voice.V2XVoiceCallbackListener;
import com.mogo.module.v2x.voice.V2XVoiceConstants;
import com.mogo.module.v2x.voice.V2XVoiceManager;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.utils.GsonUtil;
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
@@ -101,6 +105,10 @@ public class V2XIllegalParkVH extends V2XBaseViewHolder<V2XEventShowEntity> {
*/
@Override
public void delayedCloseWindow() {
V2XHistoryScenarioData v2XHistoryScenarioData =new V2XHistoryScenarioData();
v2XHistoryScenarioData.setScenarioType(V2XMessageEntity.V2XTypeEnum.ALERT_ILLEGAL_PARK_WARNING);
v2XHistoryScenarioData.setEventJsonData(GsonUtil.jsonFromObject(mExploreWay));
V2XSQLiteUtils.updateScenarioHistoryDataIsDispose(v2XHistoryScenarioData);
itemView.postDelayed(() -> V2XIllegalParkScenario.getInstance().close(), 1000);
}

View File

@@ -83,6 +83,7 @@ public class V2XOtherSeekHelpVH extends V2XBaseViewHolder<V2XEventShowEntity> {
ivNavi = itemView.findViewById(R.id.ivFaultHelpEventNavi);
ivNavi.setOnClickListener(v -> {
triggerStartNavi(mNoveltyInfo);
V2XServiceManager.getV2XRefreshModel().respondingToHelp(mUserInfo.getSn());
});
// 设置视图状态监听
@@ -147,6 +148,7 @@ public class V2XOtherSeekHelpVH extends V2XBaseViewHolder<V2XEventShowEntity> {
});
ivCall.setOnClickListener(v -> {
V2XServiceManager.getV2XRefreshModel().respondingToHelp(mUserInfo.getSn());
if (!V2XUtils.isFastClick()) {
try {
mUserInfo.setSn(mV2XPushMessageEntity.getSn());

View File

@@ -73,12 +73,6 @@ public class V2XScenarioHistoryOtherSeekHelpVH extends V2XBaseViewHolder<V2XHist
mOldScenarioData = viewData;
V2XPushMessageEntity xPushMessageEntity = GsonUtil.objectFromJson(viewData.getEventJsonData(), V2XPushMessageEntity.class);
if (!viewData.isDispose()) {
hideControlButton(View.VISIBLE);
} else {
hideControlButton(View.GONE);
}
mTvFaultHelpName.setText(xPushMessageEntity.getDisplayName());
if (!TextUtils.isEmpty(xPushMessageEntity.getHeadImgUrl())) {

View File

@@ -11,7 +11,9 @@ import com.mogo.module.v2x.V2XConst.MODULE_NAME
import com.mogo.module.v2x.V2XServiceManager
import com.mogo.module.v2x.adapter.V2XEventPagerAdapter
import com.mogo.module.v2x.presenter.EventPanelPresenter
import com.mogo.module.v2x.utils.TrackUtils
import com.mogo.module.v2x.utils.V2XSQLiteUtils
import com.mogo.module.v2x.view.V2XEventPanelHistoryCountView
import com.mogo.utils.logger.Logger
import kotlinx.android.synthetic.main.module_v2x_event_panel_fragment_event_panel.*
@@ -29,6 +31,8 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
private var mediator: TabLayoutMediator? = null
private var mV2XEventPanelHistoryCountView: V2XEventPanelHistoryCountView? = null
companion object {
private val fragment = V2XEventPanelFragment()
fun getInstance(): V2XEventPanelFragment {
@@ -44,7 +48,7 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
Logger.d(MODULE_NAME, "事件面板初始化……")
fragments = arrayOf(
V2XScenarioHistoryFragment(),
SurroundingEventFragment(),
V2XSurroundingFragment(),
V2XShareEventsFragment()
)
//禁用预加载
@@ -56,36 +60,37 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
radioGroup!!.setOnCheckedChangeListener { group, checkedId ->
when (checkedId) {
R.id.rbScenarioHistory -> {
TrackUtils.trackV2xHistoryEvent(2)
vpEventPanel.setCurrentItem(0, false)
}
R.id.rbSurroundingEvent -> {
TrackUtils.trackV2xHistoryEvent(3)
vpEventPanel.setCurrentItem(1, false)
}
R.id.rbShareEvents -> {
TrackUtils.trackV2xHistoryEvent(4)
vpEventPanel.setCurrentItem(2, false)
}
}
}
btnHidePanels.setOnClickListener {
TrackUtils.trackV2xHistoryEvent(5)
hidePanel()
}
llEventMore.setOnClickListener {
mV2XEventPanelHistoryCountView = V2XEventPanelHistoryCountView(context)
mV2XEventPanelHistoryCountView!!.setOnClickListener {
TrackUtils.trackV2xHistoryEvent(1)
if (!isPanelShow()) {
showPanel()
} else {
hidePanel()
}
}
V2XServiceManager.getMogoEntranceButtonController().addBottomLayerView(mV2XEventPanelHistoryCountView)
val historyMessage = V2XSQLiteUtils.getScenarioHistoryUnDisposeData()
if (historyMessage != null && historyMessage.size > 0) {
tvEventCount.visibility = View.VISIBLE
tvEventCount.text = "${historyMessage.size}"
} else {
tvEventCount.visibility = View.GONE
}
changeEventCount()
}
override fun onDestroyView() {
@@ -112,4 +117,14 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
fun isPanelShow(): Boolean {
return clPanelContainer.visibility == View.VISIBLE
}
// 修改未处理消息
fun changeEventCount() {
// val historyMessage = V2XSQLiteUtils.getScenarioHistoryUnDisposeData()
// if (historyMessage != null) {
// mV2XEventPanelHistoryCountView?.changeMsgCount(historyMessage.size)
// } else {
// mV2XEventPanelHistoryCountView?.changeMsgCount(0)
// }
}
}

View File

@@ -1,6 +1,7 @@
package com.mogo.module.v2x.fragment;
import android.graphics.Color;
import android.graphics.Rect;
import android.os.Bundle;
import android.text.SpannableString;
import android.text.Spanned;
@@ -22,9 +23,12 @@ import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.commons.voice.AIAssist;
import com.mogo.map.MogoLatLng;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.anim.OnMarkerAnimationListener;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerLocation;
import com.mogo.module.common.entity.MarkerPoiTypeEnum;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.service.ServiceConst;
import com.mogo.module.v2x.R;
@@ -34,6 +38,7 @@ import com.mogo.module.v2x.entity.panel.SurroundingConstruction;
import com.mogo.module.v2x.listener.SurroundingItemClickListener;
import com.mogo.module.v2x.presenter.SurroundingEventPresenter;
import com.mogo.module.v2x.view.SurroundingEventView;
import com.mogo.module.v2x.view.SurroundingMarginDecoration;
import com.mogo.service.IMogoServiceApis;
import com.mogo.service.MogoServicePaths;
import com.mogo.utils.TipToast;
@@ -52,7 +57,7 @@ import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
/**
* 周边事件
*/
public class SurroundingEventFragment extends MvpFragment<SurroundingEventView, SurroundingEventPresenter> implements SurroundingEventView,
public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, SurroundingEventPresenter> implements SurroundingEventView,
View.OnClickListener, SurroundingItemClickListener {
private static final String TAG = "SurroundingFragment";
private RecyclerView mRecyclerView;
@@ -88,6 +93,8 @@ public class SurroundingEventFragment extends MvpFragment<SurroundingEventView,
mRecyclerView.setHasFixedSize(true);
mRecyclerView.setOverScrollMode(OVER_SCROLL_NEVER);
GridLayoutManager layoutManage = new GridLayoutManager(getContext(), 2);
int spacingInPixels = getResources().getDimensionPixelSize(R.dimen.module_v2x_surrounding_item_size);
mRecyclerView.addItemDecoration(new SurroundingMarginDecoration(spacingInPixels));
mRecyclerView.setLayoutManager(layoutManage);
mAdapter = new SurroundingEventAdapter(getActivity(), poiInfosList, this);
@@ -149,7 +156,7 @@ public class SurroundingEventFragment extends MvpFragment<SurroundingEventView,
poiInfosList.addAll(handleMapToList(getPoiTypeMap(exploreWayList)));
mAdapter.notifyDataSetChanged();
//总条数 TODO
//总条数
String originStr = String.format(getContext().getResources().getString(R.string.v2x_surrounding_top_brief), exploreWayList.size());
SpannableString spannableString = new SpannableString(originStr);
spannableString.setSpan(new ForegroundColorSpan(Color.parseColor("#256BFF")), 7, originStr.length() - 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
@@ -166,7 +173,6 @@ public class SurroundingEventFragment extends MvpFragment<SurroundingEventView,
private Map<String, SurroundingConstruction> getPoiTypeMap(List<MarkerExploreWay> list) {
Map<String, SurroundingConstruction> mPoiTypeMarkers = new HashMap<>();
Log.d(TAG, "getPoiTypeMap list.size() = " + list.size());
for (int i = 0; i < list.size(); i++) {
MarkerExploreWay exploreWay = list.get(i);
if (!mPoiTypeMarkers.containsKey(exploreWay.getPoiType())) {
@@ -187,11 +193,9 @@ public class SurroundingEventFragment extends MvpFragment<SurroundingEventView,
List<SurroundingConstruction> valueList = new ArrayList<>(valueCollection);
Log.d(TAG, "handleMapToList valueList.size() = " + valueList.size());
return valueList;
}
/**
* 处理marker的显示
*
@@ -208,7 +212,7 @@ public class SurroundingEventFragment extends MvpFragment<SurroundingEventView,
V2XServiceManager.getMarkerManager().removeMarkers(ServiceConst.CARD_TYPE_ROAD_CONDITION);
try {
//处理 marker的显示
//处理 marker的显示 TODO 是否需要showbound
List<MarkerExploreWay> exploreWayList = construction.getConstrutList();
Logger.d(TAG, "onItemClickListener exploreWayList.size() = " + exploreWayList.size());
if (exploreWayList != null && exploreWayList.size() > 0) {
@@ -245,6 +249,9 @@ public class SurroundingEventFragment extends MvpFragment<SurroundingEventView,
}
}, i * 100L);
}
//自适应显示
showBonndsRoadtion(exploreWayList);
} else {
Logger.e(TAG, "onItemClickListener exploreWayList == null");
}
@@ -254,6 +261,66 @@ public class SurroundingEventFragment extends MvpFragment<SurroundingEventView,
}
}
/**
* 自适应显示
*
* @param exploreWayList
*/
private void showBonndsRoadtion(List<MarkerExploreWay> exploreWayList) {
Logger.e(TAG, "showBonndsRoadtion exploreWayList.size() = " + exploreWayList.size());
Rect rect = new Rect(
(int) getContext().getResources().getDimension(R.dimen.tanlu_module_map_left),
(int) getContext().getResources().getDimension(R.dimen.tanlu_module_map_top),
(int) getContext().getResources().getDimension(R.dimen.tanlu_module_map_right),
(int) getContext().getResources().getDimension(R.dimen.tanlu_module_map_bottom));
moveNotFresh();
//第一个参数调用者,第二个参数当前自车的位置,第三个参数需要显示在范围内的点不包含自车的位置
//第四个参数显示范围的UI边界,第五个参数是否锁定自车位置看业务需要
V2XServiceManager.getMapUIController().showBounds(ServiceConst.CARD_TYPE_ROAD_CONDITION, null, getMogoList(exploreWayList), rect, false);
}
private void moveNotFresh() {
V2XServiceManager.getMoGoStatusManager().setUserInteractionStatus(TAG, true, false);
}
/**
* 构造经纬度列表
*
* @return
*/
private List<MogoLatLng> getMogoList(List<MarkerExploreWay> markerExploreWayList) {
List<MogoLatLng> list = new ArrayList<>();
if (markerExploreWayList != null && markerExploreWayList.size() > 0) {
if (markerExploreWayList.size() < 6) {
for (int i = 0; i < markerExploreWayList.size(); i++) {
MarkerLocation location = markerExploreWayList.get(i).getLocation();
if (location != null) {
MogoLatLng mogoLatLng = new MogoLatLng(location.getLat(), location.getLon());
list.add(mogoLatLng);
} else {
Logger.e(TAG, "getMogoList() < 6 location == null");
}
}
} else {
for (int i = 0; i < 6; i++) {
MarkerLocation location = markerExploreWayList.get(i).getLocation();
if (location != null) {
MogoLatLng mogoLatLng = new MogoLatLng(location.getLat(), location.getLon());
list.add(mogoLatLng);
} else {
Logger.e(TAG, "getMogoList() location == null");
}
}
}
} else {
Logger.e(TAG, "getMogoList() markerExploreWay == null");
}
return list;
}
@Override
public void onDestroy() {
super.onDestroy();

View File

@@ -78,7 +78,7 @@ public class SurroundingEventPresenter extends Presenter<SurroundingEventView> {
@Override
public void onSuccess(SurroundingResponse data) {
super.onSuccess(data);
Log.e("SurroundingFragment", "onSuccess ------ ");
Logger.d("SurroundingFragment", "onSuccess ------> ");
if (data != null && data.getResult() != null) {
mView.showSurroudingData(data.getResult().getExploreWay());
}
@@ -87,7 +87,7 @@ public class SurroundingEventPresenter extends Presenter<SurroundingEventView> {
@Override
public void onError(String message, int code) {
super.onError(message, code);
Log.e("SurroundingFragment", "onError message = " + message + " >>> code = " + code);
Logger.e("SurroundingFragment", "onError message = " + message + " >>> code = " + code);
}
});

View File

@@ -106,13 +106,7 @@ public abstract class AbsV2XScenario<T> implements IV2XScenario {
*/
public void saveLocalStory(int scenarioType, Object markerExploreWay) {
try {
// 进行数据库存储
V2XHistoryScenarioData v2XHistoryScenarioData = new V2XHistoryScenarioData();
v2XHistoryScenarioData.setScenarioType(scenarioType);
v2XHistoryScenarioData.setTriggerTime(TimeUtils.getNowMills());
v2XHistoryScenarioData.setEventJsonData(GsonUtil.jsonFromObject(markerExploreWay));
v2XHistoryScenarioData.setDispose(false);
V2XSQLiteUtils.getScenarioHistoryDao().insert(v2XHistoryScenarioData);
V2XSQLiteUtils.saveLocalStory(scenarioType,markerExploreWay);
} catch (Exception e) {
e.printStackTrace();
}

View File

@@ -5,7 +5,10 @@ import android.content.Intent;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.service.carinfo.CarStateInfo;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.scenario.IV2XScenarioManager;
import com.mogo.module.v2x.scenario.scene.animation.V2XAnimationScenario;
import com.mogo.module.v2x.scenario.scene.fatigue.V2XFatigueDrivingScenario;
@@ -66,7 +69,6 @@ public class V2XScenarioManager implements IV2XScenarioManager {
LocalBroadcastManager.getInstance(V2XUtils.getApp()).sendBroadcast(intent);
mV2XScenario = mV2XScenarioSet.get(v2XMessageEntity.getType());
// 如果没有拿到之前的,根据类型分发
if (mV2XScenario == null) {
switch (v2XMessageEntity.getType()) {

View File

@@ -5,6 +5,7 @@ import android.view.ViewGroup;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.service.ServiceConst;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.V2XServiceManager;
@@ -57,6 +58,10 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
V2XRoadEventEntity v2XRoadEventEntity = v2XMessageEntity.getContent();
if (v2XRoadEventEntity != null) {
//上报路况
V2XServiceManager.getMoGoStatusManager().setUploadingStatus(ServiceConst.CARD_TYPE_ROAD_CONDITION, true);
V2XServiceManager.getTanluManager().uploadRoadCondition(v2XRoadEventEntity.getPoiType());
if (v2XMessageEntity.isShowState()) {
if (!isSameScenario(v2XMessageEntity)) {
// 更新要提醒的数据

View File

@@ -16,6 +16,7 @@ import com.mogo.module.common.entity.V2XPushMessageEntity;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.alarm.V2XAlarmServer;
import com.mogo.module.v2x.entity.net.V2XSpecialCarRes;
import com.mogo.module.v2x.utils.TestOnLineCarUtils;
@@ -83,7 +84,11 @@ public class V2XTestConsoleWindow extends ConstraintLayout {
mBtnTriggerSeekHelpEvent = findViewById(R.id.btnTriggerSeekHelpEvent);
mBtnTriggerParkEvent = findViewById(R.id.btnTriggerParkEvent);
mBtnTriggerOpen.setOnClickListener(v -> mFlTestPanel.setVisibility(GONE));
mBtnTriggerOpen.setOnClickListener(v ->
V2XServiceManager
.getIMogoWindowManager()
.removeView(V2XTestConsoleWindow.getInstance(context))
);
mBtnClearRoadEvent.setOnClickListener(v -> {
V2XAlarmServer.mAlertRoadEventList.clear();

View File

@@ -39,4 +39,27 @@ public class TrackUtils {
e.printStackTrace();
}
}
//道路事件操作埋点 V2X_button
/**
* @param type type=1 桌面按钮
* <p>
* type=2 tab1按钮-出行动态
* <p>
* type=3 tab2按钮-周边事件
* <p>
* type=4 tab3按钮-我的分享
* <p>
* type=5 tab4按钮-关闭按钮
*/
public static void trackV2xHistoryEvent(int type) {
try {
Map<String, Object> properties = new HashMap<>();
properties.put("type", type);
V2XServiceManager.getMogoAnalytics().track(V2XConst.V2X_ROAD_EVET_HISTORY_BUTTON, properties);
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@@ -2,7 +2,9 @@ package com.mogo.module.v2x.utils;
import com.mogo.module.common.entity.V2XHistoryScenarioData;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.fragment.V2XEventPanelFragment;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.utils.GsonUtil;
import com.mogo.utils.sqlite.SQLDaoFactory;
import com.mogo.utils.sqlite.SQLIDao;
@@ -61,6 +63,7 @@ public class V2XSQLiteUtils {
try {
int result = getScenarioHistoryDao().delete(new V2XHistoryScenarioData());
Logger.d(V2XConst.MODULE_NAME, "删除数据成功:" + result);
V2XEventPanelFragment.Companion.getInstance().changeEventCount();
} catch (Exception e) {
e.printStackTrace();
}
@@ -73,6 +76,13 @@ public class V2XSQLiteUtils {
return getScenarioHistoryDao().query(new V2XHistoryScenarioData(), "triggerTime", true);
}
/**
* 查询当天的指定的V2X数据
*/
public static List<V2XHistoryScenarioData> getTargetScenarioHistoryData(V2XHistoryScenarioData scenarioData) {
return getScenarioHistoryDao().query(scenarioData, "triggerTime", true);
}
/**
* 查询当天的未评价V2X数据
*/
@@ -89,6 +99,56 @@ public class V2XSQLiteUtils {
try {
int result = getScenarioHistoryDao().update(oldScenarioData, newScenarioData);
Logger.d(V2XConst.MODULE_NAME, "修改数据成功:" + result);
V2XEventPanelFragment.Companion.getInstance().changeEventCount();
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 修改指定的数据为已经操作的数据
*/
public static void updateScenarioHistoryDataIsDispose(V2XHistoryScenarioData oldScenarioData) {
try {
V2XHistoryScenarioData newScenarioData = new V2XHistoryScenarioData();
newScenarioData.setDispose(true);
newScenarioData.setTriggerTime(TimeUtils.getNowMills());
newScenarioData.setEventJsonData(oldScenarioData.getEventJsonData());
newScenarioData.setScenarioType(oldScenarioData.getScenarioType());
int result = getScenarioHistoryDao().update(oldScenarioData, newScenarioData);
Logger.d(V2XConst.MODULE_NAME, "修改数据成功:" + result);
V2XEventPanelFragment.Companion.getInstance().changeEventCount();
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 存储本地数据,每个数据只能存在一次,所以存储之前先查询数据库如果已经存在则修改触碰时间
*
* @param markerExploreWay 要存储的场景
*/
public static void saveLocalStory(int scenarioType, Object markerExploreWay) {
try {
// 进行数据库存储
V2XHistoryScenarioData v2XHistoryScenarioData = new V2XHistoryScenarioData();
v2XHistoryScenarioData.setScenarioType(scenarioType);
v2XHistoryScenarioData.setEventJsonData(GsonUtil.jsonFromObject(markerExploreWay));
List<V2XHistoryScenarioData> historyScenarioData = getTargetScenarioHistoryData(v2XHistoryScenarioData);
v2XHistoryScenarioData.setTriggerTime(TimeUtils.getNowMills());
v2XHistoryScenarioData.setDispose(false);
if (historyScenarioData != null && historyScenarioData.size() > 0) {
// 更新数据
V2XSQLiteUtils.getScenarioHistoryDao().update(historyScenarioData.get(0), v2XHistoryScenarioData);
} else {
// 存储新数据
V2XSQLiteUtils.getScenarioHistoryDao().insert(v2XHistoryScenarioData);
}
V2XEventPanelFragment.Companion.getInstance().changeEventCount();
} catch (Exception e) {
e.printStackTrace();
}

View File

@@ -0,0 +1,33 @@
package com.mogo.module.v2x.view;
import android.graphics.Rect;
import android.view.View;
import androidx.recyclerview.widget.RecyclerView;
/**
* @author lixiaopeng
* @description
* @since 2020/8/11
*/
public class SurroundingMarginDecoration extends RecyclerView.ItemDecoration {
private int margin ;
public SurroundingMarginDecoration(int space) {
margin = space;
}
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
outRect.bottom = margin;
//由于每行都只有2个所以第一个都是2的倍数把左边距设为0
if (parent.getChildLayoutPosition(view) % 2 == 0) {
outRect.left = 0;
outRect.right = margin;
} else {
outRect.left = margin;
outRect.right = 0;
}
}
}

View File

@@ -0,0 +1,53 @@
package com.mogo.module.v2x.view;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.Nullable;
import com.mogo.module.v2x.R;
/**
* 事件面板的提示按钮
*
* @author donghongyu
*/
public class V2XEventPanelHistoryCountView extends LinearLayout {
private RelativeLayout mLlEventMore;
private ImageView mBtnShowOrHidePanels;
private TextView mTvEventCount;
public V2XEventPanelHistoryCountView(Context context) {
this(context, null);
}
public V2XEventPanelHistoryCountView(Context context, @Nullable AttributeSet attrs) {
this(context, attrs, 0);
}
public V2XEventPanelHistoryCountView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
LayoutInflater.from(context).inflate(R.layout.view_event_panel_history_count, this);
mLlEventMore = (RelativeLayout) findViewById(R.id.llEventMore);
mBtnShowOrHidePanels = (ImageView) findViewById(R.id.btnShowOrHidePanels);
mTvEventCount = (TextView) findViewById(R.id.tvEventCount);
}
public void changeMsgCount(int count) {
if (mTvEventCount != null) {
if (count > 0) {
mTvEventCount.setVisibility(View.VISIBLE);
} else {
mTvEventCount.setVisibility(View.GONE);
}
mTvEventCount.setText("" + count);
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 686 B

After

Width:  |  Height:  |  Size: 701 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 787 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 859 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 818 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 977 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 908 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 790 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 749 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 787 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 859 B

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