Merge remote-tracking branch 'origin/dev_1.1.2' into dev_1.1.2
This commit is contained in:
3
.idea/dictionaries/admin.xml
generated
Normal file
3
.idea/dictionaries/admin.xml
generated
Normal file
@@ -0,0 +1,3 @@
|
||||
<component name="ProjectDictionaryState">
|
||||
<dictionary name="admin" />
|
||||
</component>
|
||||
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -4,7 +4,7 @@
|
||||
<asm skipDebug="false" skipFrames="false" skipCode="false" expandFrames="false" />
|
||||
<groovy codeStyle="LEGACY" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -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"
|
||||
|
||||
6
app/src/f8xxLauncherOnlineRelease/AndroidManifest.xml
Normal file
6
app/src/f8xxLauncherOnlineRelease/AndroidManifest.xml
Normal 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>
|
||||
@@ -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" />
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 = [
|
||||
|
||||
@@ -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() );
|
||||
}
|
||||
}
|
||||
@@ -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 );
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
@@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
}
|
||||
@@ -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为0:0 实时路况开;1实时路况关 type为1:0 放大地图; 1缩小地图 type为2:0切换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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,9 +31,6 @@ public interface OnMapControlCallback {
|
||||
// 重新规划路线
|
||||
void onReCalculatePath( MogoNaviConfig config );
|
||||
|
||||
// 结束
|
||||
void onEnd( Intent intent );
|
||||
|
||||
// 查看全程
|
||||
void onDisplayOverview();
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ import com.mogo.module.common.MogoModule;
|
||||
import com.mogo.module.common.MogoModulePaths;
|
||||
import com.mogo.module.common.map.MapCenterPointStrategy;
|
||||
import com.mogo.module.common.map.Scene;
|
||||
import com.mogo.module.service.intent.AutoNaviIntentHandler;
|
||||
import com.mogo.module.service.intent.IntentHandlerFactory;
|
||||
import com.mogo.module.service.marker.MapMarkerManager;
|
||||
import com.mogo.module.service.network.RefreshCallback;
|
||||
@@ -274,7 +275,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 ) {
|
||||
@@ -303,9 +304,11 @@ public class MogoServices implements IMogoMapListener,
|
||||
restartAutoRefreshAtTime( 2_000L );
|
||||
}
|
||||
mIsMainPageFirstResume = false;
|
||||
AutoNaviIntentHandler.getInstance().closeEntrance();
|
||||
} else {
|
||||
unregisterInternalUnWakeupWords();
|
||||
stopAutoRefreshStrategy();
|
||||
AutoNaviIntentHandler.getInstance().syncAutoNaviForgroundStatus( mContext );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -382,6 +385,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 +400,9 @@ public class MogoServices implements IMogoMapListener,
|
||||
if ( DebugConfig.isLaunchLocationService() ) {
|
||||
initLocationServiceProcess( context );
|
||||
}
|
||||
|
||||
AutoNaviIntentHandler.getInstance().syncAutoNaviForgroundStatus( mContext );
|
||||
|
||||
}
|
||||
|
||||
private void initLocationServiceProcess( Context context ) {
|
||||
@@ -473,6 +481,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." );
|
||||
@@ -914,4 +924,14 @@ public class MogoServices implements IMogoMapListener,
|
||||
AIAssist.getInstance( mContext ).registerUnWakeupCommand( ServiceConst.CMD_BACK, ServiceConst.CMD_BACK_WORDS, this );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartNavi() {
|
||||
AutoNaviIntentHandler.getInstance().preShowEntrance( mContext );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStopNavi() {
|
||||
AutoNaviIntentHandler.getInstance().closeEntrance();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,144 @@
|
||||
package com.mogo.module.service.intent;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.view.Gravity;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.module.common.wm.WindowManagerView;
|
||||
import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.service.R;
|
||||
import com.mogo.utils.LaunchUtils;
|
||||
import com.mogo.utils.ResourcesHelper;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/6/5
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
class AutoNaviIntentHandler implements IntentHandler {
|
||||
|
||||
private static final String TAG = "AutoNaviIntentHandler";
|
||||
|
||||
private static volatile AutoNaviIntentHandler sInstance;
|
||||
|
||||
private AutoNaviIntentHandler() {
|
||||
}
|
||||
|
||||
public static AutoNaviIntentHandler getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( AutoNaviIntentHandler.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new AutoNaviIntentHandler();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
private WindowManagerView mWindowManagerView;
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handle( Context context, Intent intent ) {
|
||||
int keyType = intent.getIntExtra( "KEY_TYPE", 0 );
|
||||
switch ( keyType ) {
|
||||
case 10021:
|
||||
closeEntrance();
|
||||
MarkerServiceHandler.getADASController().showADAS();
|
||||
break;
|
||||
case 20009:
|
||||
MarkerServiceHandler.getADASController().closeADAS();
|
||||
break;
|
||||
case 10019:
|
||||
int extraState = intent.getIntExtra( "EXTRA_STATE", -1 );
|
||||
switch ( extraState ) {
|
||||
case 3:
|
||||
syncAutoNaviNavingStatus( context );
|
||||
break;
|
||||
case 4:
|
||||
closeEntrance();
|
||||
break;
|
||||
case 8:
|
||||
showEntrance( context );
|
||||
break;
|
||||
case 9:
|
||||
closeEntrance();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过查询高德地图状态后再显示
|
||||
*
|
||||
* @param context
|
||||
*/
|
||||
public void preShowEntrance( Context context ) {
|
||||
syncAutoNaviForgroundStatus( context );
|
||||
}
|
||||
|
||||
private void showEntrance( Context context ) {
|
||||
if ( mWindowManagerView == null ) {
|
||||
mWindowManagerView = new WindowManagerView.Builder( AbsMogoApplication.getApp() )
|
||||
.contentView( R.layout.module_service_app_entrance )
|
||||
.size( WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.WRAP_CONTENT )
|
||||
.gravity( Gravity.LEFT | Gravity.TOP )
|
||||
.position( ResourcesHelper.getDimensionPixelSize( context, R.dimen.module_services_app_entrance_x ), ResourcesHelper.getDimensionPixelSize( AbsMogoApplication.getApp(), R.dimen.module_services_app_entrance_y ) )
|
||||
.showInWindowManager();
|
||||
mWindowManagerView.attachTouchEvent( view -> {
|
||||
try {
|
||||
if ( DebugConfig.isLauncher() ) {
|
||||
MarkerServiceHandler.getLauncher().backToLauncher( context );
|
||||
} else {
|
||||
LaunchUtils.launchByPkg( context, "com.mogo.launcher.app" );
|
||||
}
|
||||
} catch ( Exception e ) {
|
||||
Logger.e( TAG, e, "error." );
|
||||
}
|
||||
} );
|
||||
}
|
||||
try {
|
||||
mWindowManagerView.show();
|
||||
} catch ( Exception e ) {
|
||||
Logger.e( TAG, e, "error." );
|
||||
}
|
||||
}
|
||||
|
||||
public void closeEntrance() {
|
||||
if ( mWindowManagerView == null ) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
mWindowManagerView.dismiss();
|
||||
} catch ( Exception e ) {
|
||||
Logger.e( TAG, e, "error." );
|
||||
}
|
||||
}
|
||||
|
||||
public void syncAutoNaviForgroundStatus( Context context ) {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction( "AUTONAVI_STANDARD_BROADCAST_RECV" );
|
||||
intent.putExtra( "KEY_TYPE", 12404 );
|
||||
intent.putExtra( "EXTRA_REQUEST_AUTO_STATE", 0 );
|
||||
context.sendBroadcast( intent );
|
||||
}
|
||||
|
||||
public void syncAutoNaviNavingStatus( Context context ) {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction( "AUTONAVI_STANDARD_BROADCAST_RECV" );
|
||||
intent.putExtra( "KEY_TYPE", 12404 );
|
||||
intent.putExtra( "EXTRA_REQUEST_AUTO_STATE", 1 );
|
||||
context.sendBroadcast( intent );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,8 @@ public class IntentHandlerFactory {
|
||||
mHandlers.put( MogoReceiver.ACTIION_ADAS, ADASStatusIntentHandler.getInstance() );
|
||||
mHandlers.put( MogoReceiver.ACTION_VOICE_READY, new AIAssistIntentHandler() );
|
||||
mHandlers.put( ServiceConst.COMMAND_BACK, WholeVoiceCommandIntentHandler.getInstance() );
|
||||
mHandlers.put( MogoReceiver.ACTION_AUTO_NAVI_RECEIVER, AutoNaviIntentHandler.getInstance() );
|
||||
mHandlers.put( MogoReceiver.ACTION_AUTO_NAVI_SEND, AutoNaviIntentHandler.getInstance() );
|
||||
}
|
||||
|
||||
private static final class InstanceHolder {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape>
|
||||
<gradient android:angle="180" android:endColor="#5CC1FF" android:startColor="#256BFF" />
|
||||
<corners android:radius="@dimen/module_services_app_entrance_corner_size" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/module_service_app_entrance_root"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/module_services_app_entrance_bkg"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="@dimen/module_service_app_entrance_size"
|
||||
android:layout_height="@dimen/module_service_app_entrance_size"
|
||||
android:gravity="center"
|
||||
android:text="@string/module_service_app_entrance_text"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/module_service_app_entrance_textSize" />
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,33 @@
|
||||
<?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>
|
||||
<dimen name="module_service_app_entrance_textSize">20px</dimen>
|
||||
<dimen name="module_service_app_entrance_padding">15px</dimen>
|
||||
<dimen name="module_services_app_entrance_corner_size">2px</dimen>
|
||||
<dimen name="module_services_app_entrance_y">112px</dimen>
|
||||
<dimen name="module_services_app_entrance_x">929px</dimen>
|
||||
<dimen name="module_service_app_entrance_paddingTop">10px</dimen>
|
||||
<dimen name="module_service_app_entrance_paddingLeft">15px</dimen>
|
||||
<dimen name="module_service_app_entrance_size">71px</dimen>
|
||||
</resources>
|
||||
@@ -0,0 +1,33 @@
|
||||
<?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>
|
||||
<dimen name="module_service_app_entrance_textSize">20px</dimen>
|
||||
<dimen name="module_service_app_entrance_padding">15px</dimen>
|
||||
<dimen name="module_services_app_entrance_corner_size">2px</dimen>
|
||||
<dimen name="module_services_app_entrance_y">112px</dimen>
|
||||
<dimen name="module_services_app_entrance_x">929px</dimen>
|
||||
<dimen name="module_service_app_entrance_paddingTop">10px</dimen>
|
||||
<dimen name="module_service_app_entrance_paddingLeft">15px</dimen>
|
||||
<dimen name="module_service_app_entrance_size">71px</dimen>
|
||||
</resources>
|
||||
@@ -0,0 +1,33 @@
|
||||
<?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>
|
||||
<dimen name="module_service_app_entrance_textSize">40px</dimen>
|
||||
<dimen name="module_service_app_entrance_padding">30px</dimen>
|
||||
<dimen name="module_services_app_entrance_corner_size">4px</dimen>
|
||||
<dimen name="module_services_app_entrance_y">48px</dimen>
|
||||
<dimen name="module_services_app_entrance_x">1000px</dimen>
|
||||
<dimen name="module_service_app_entrance_paddingTop">10px</dimen>
|
||||
<dimen name="module_service_app_entrance_paddingLeft">15px</dimen>
|
||||
<dimen name="module_service_app_entrance_size">71px</dimen>
|
||||
</resources>
|
||||
@@ -22,4 +22,12 @@
|
||||
<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>
|
||||
<dimen name="module_service_app_entrance_textSize">40px</dimen>
|
||||
<dimen name="module_service_app_entrance_padding">30px</dimen>
|
||||
<dimen name="module_services_app_entrance_corner_size">4px</dimen>
|
||||
<dimen name="module_services_app_entrance_y">48px</dimen>
|
||||
<dimen name="module_services_app_entrance_x">1000px</dimen>
|
||||
<dimen name="module_service_app_entrance_paddingTop">10px</dimen>
|
||||
<dimen name="module_service_app_entrance_paddingLeft">15px</dimen>
|
||||
<dimen name="module_service_app_entrance_size">71px</dimen>
|
||||
</resources>
|
||||
@@ -1,25 +1,33 @@
|
||||
<?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>
|
||||
<dimen name="module_service_app_entrance_textSize">40px</dimen>
|
||||
<dimen name="module_service_app_entrance_padding">30px</dimen>
|
||||
<dimen name="module_services_app_entrance_corner_size">4px</dimen>
|
||||
<dimen name="module_services_app_entrance_y">48px</dimen>
|
||||
<dimen name="module_services_app_entrance_x">1000px</dimen>
|
||||
<dimen name="module_service_app_entrance_paddingTop">10px</dimen>
|
||||
<dimen name="module_service_app_entrance_paddingLeft">15px</dimen>
|
||||
<dimen name="module_service_app_entrance_size">71px</dimen>
|
||||
</resources>
|
||||
@@ -1,3 +1,4 @@
|
||||
<resources>
|
||||
<string name="app_name">mogo-module-service</string>
|
||||
<string name="module_service_app_entrance_text">辅助\n驾驶</string>
|
||||
</resources>
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 686 B After Width: | Height: | Size: 701 B |
Reference in New Issue
Block a user