merge
@@ -340,10 +340,11 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.moduleservice
|
||||
implementation rootProject.ext.dependencies.modulesplash
|
||||
implementation rootProject.ext.dependencies.moduleV2x
|
||||
implementation rootProject.ext.dependencies.moduletanlu, {
|
||||
exclude group: 'com.mogo.module', module: 'module-share'
|
||||
}
|
||||
implementation rootProject.ext.dependencies.tanluupload
|
||||
implementation rootProject.ext.dependencies.moduleshare
|
||||
// implementation rootProject.ext.dependencies.moduletanlu, {
|
||||
// exclude group: 'com.mogo.module', module: 'module-share'
|
||||
// }
|
||||
implementation rootProject.ext.dependencies.moduletanluapi
|
||||
implementation rootProject.ext.dependencies.mogomonitor
|
||||
implementation rootProject.ext.dependencies.mogomoduleback
|
||||
implementation rootProject.ext.dependencies.guideshow
|
||||
@@ -356,10 +357,11 @@ dependencies {
|
||||
implementation project(':modules:mogo-module-service')
|
||||
implementation project(':modules:mogo-module-splash')
|
||||
implementation project(':modules:mogo-module-v2x')
|
||||
implementation project(':modules:mogo-module-tanlu'), {
|
||||
exclude group: 'com.mogo.module', module: 'module-share'
|
||||
}
|
||||
implementation project(':libraries:tanlulib')
|
||||
implementation project(':modules:mogo-module-share')
|
||||
// implementation project(':modules:mogo-module-tanlu'), {
|
||||
// exclude group: 'com.mogo.module', module: 'module-share'
|
||||
// }
|
||||
implementation project(':libraries:mogo-tanlu-api')
|
||||
implementation project(':modules:mogo-module-monitor')
|
||||
implementation project(':modules:mogo-module-back')
|
||||
implementation project(':modules:mogo-module-guide')
|
||||
|
||||
@@ -21,7 +21,6 @@ import com.mogo.module.main.service.MogoMainService;
|
||||
import com.mogo.module.media.MediaConstants;
|
||||
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.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
@@ -75,8 +74,8 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
MogoModulePaths.addModule( new MogoModule( CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME ) );
|
||||
}
|
||||
|
||||
// MogoModulePaths.addBaseModule( new MogoModule( TanluConstants.TAG, TanluConstants.MODEL_NAME ) );
|
||||
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_TANLU_API, "TanluApi" ) );
|
||||
MogoModulePaths.addBaseModule( new MogoModule( TanluConstants.TAG, TanluConstants.MODEL_NAME ) );
|
||||
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_SHARE, "ShareControl" ) );
|
||||
|
||||
MogoModulePaths.addModule( new MogoModule( LeftPanelConst.PATH_NAME, LeftPanelConst.MODULE_NAME ) );
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.alibaba.android.arouter.routes;
|
||||
|
||||
import com.alibaba.android.arouter.facade.enums.RouteType;
|
||||
import com.alibaba.android.arouter.facade.model.RouteMeta;
|
||||
import com.alibaba.android.arouter.facade.template.IRouteGroup;
|
||||
import com.zhidao.mogo.tanlu.api.MogoTanluApiProvider;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* DO NOT EDIT THIS FILE!!! IT WAS GENERATED BY AROUTER. */
|
||||
public class ARouter$$Group$$tanlulib implements IRouteGroup {
|
||||
@Override
|
||||
public void loadInto(Map<String, RouteMeta> atlas) {
|
||||
atlas.put("/tanlulib/api", RouteMeta.build(RouteType.PROVIDER, MogoTanluApiProvider.class, "/tanlulib/api", "tanlulib", null, -1, -2147483648));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.alibaba.android.arouter.routes;
|
||||
|
||||
import com.alibaba.android.arouter.facade.enums.RouteType;
|
||||
import com.alibaba.android.arouter.facade.model.RouteMeta;
|
||||
import com.alibaba.android.arouter.facade.template.IProviderGroup;
|
||||
import com.zhidao.mogo.tanlu.api.MogoTanluApiProvider;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* DO NOT EDIT THIS FILE!!! IT WAS GENERATED BY AROUTER. */
|
||||
public class ARouter$$Providers$$mogotanluapi implements IProviderGroup {
|
||||
@Override
|
||||
public void loadInto(Map<String, RouteMeta> providers) {
|
||||
providers.put("com.mogo.service.share.IMogoTanluProvider", RouteMeta.build(RouteType.PROVIDER, MogoTanluApiProvider.class, "/tanlulib/api", "tanlulib", null, -1, -2147483648));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.alibaba.android.arouter.routes;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IRouteGroup;
|
||||
import com.alibaba.android.arouter.facade.template.IRouteRoot;
|
||||
import java.lang.Class;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* DO NOT EDIT THIS FILE!!! IT WAS GENERATED BY AROUTER. */
|
||||
public class ARouter$$Root$$mogotanluapi implements IRouteRoot {
|
||||
@Override
|
||||
public void loadInto(Map<String, Class<? extends IRouteGroup>> routes) {
|
||||
routes.put("tanlulib", ARouter$$Group$$tanlulib.class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Automatically generated file. DO NOT MODIFY
|
||||
*/
|
||||
package com.zhidao.mogo.tanlu.api;
|
||||
|
||||
public final class BuildConfig {
|
||||
public static final boolean DEBUG = Boolean.parseBoolean("true");
|
||||
public static final String LIBRARY_PACKAGE_NAME = "com.zhidao.mogo.tanlu.api";
|
||||
/**
|
||||
* @deprecated APPLICATION_ID is misleading in libraries. For the library package name use LIBRARY_PACKAGE_NAME
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String APPLICATION_ID = "com.zhidao.mogo.tanlu.api";
|
||||
public static final String BUILD_TYPE = "debug";
|
||||
public static final String FLAVOR = "";
|
||||
public static final int VERSION_CODE = 1;
|
||||
public static final String VERSION_NAME = "2.0.0";
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.zhidao.mogo.tanlu.api"
|
||||
android:versionCode="1"
|
||||
android:versionName="2.0.0" >
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="19"
|
||||
android:targetSdkVersion="22" />
|
||||
/
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1 @@
|
||||
[{"outputType":{"type":"AAPT_FRIENDLY_MERGED_MANIFESTS"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"2.0.0","enabled":true,"outputFile":"mogo-tanlu-api-debug.aar","fullName":"debug","baseName":"debug"},"path":"AndroidManifest.xml","properties":{"packageId":"com.zhidao.mogo.tanlu.api","split":""}}]
|
||||
@@ -0,0 +1 @@
|
||||
{"jetified-arouter-compiler-1.2.2.jar (com.alibaba:arouter-compiler:1.2.2)":false,"auto-service-1.0-rc2.jar (com.google.auto.service:auto-service:1.0-rc2)":false}
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/jniLibs"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/debug/jniLibs"/></dataSet></merger>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/shaders"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/debug/shaders"/></dataSet></merger>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/assets"/><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/build/intermediates/shader_assets/debug/compileDebugShaders/out"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/debug/assets"/></dataSet></merger>
|
||||
@@ -0,0 +1 @@
|
||||
#Mon Nov 02 20:31:43 CST 2020
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merger version="3"><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/res"/><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/build/generated/res/rs/debug"/><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/build/generated/res/resValues/debug"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main" generated-set="main$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/res"/><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/build/generated/res/rs/debug"/><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/build/generated/res/resValues/debug"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/debug/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug" generated-set="debug$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/debug/res"/></dataSet><mergedItems/></merger>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.zhidao.mogo.tanlu.api"
|
||||
android:versionCode="1"
|
||||
android:versionName="2.0.0" >
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="19"
|
||||
android:targetSdkVersion="22" />
|
||||
/
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,2 @@
|
||||
R_DEF: Internal format may change without notice
|
||||
local
|
||||
@@ -0,0 +1,14 @@
|
||||
1<?xml version="1.0" encoding="utf-8"?>
|
||||
2<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
3 package="com.zhidao.mogo.tanlu.api"
|
||||
4 android:versionCode="1"
|
||||
5 android:versionName="2.0.0" >
|
||||
6
|
||||
7 <uses-sdk
|
||||
8 android:minSdkVersion="19"
|
||||
8-->/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
9 android:targetSdkVersion="22" />
|
||||
9-->/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
10 /
|
||||
11
|
||||
12</manifest>
|
||||
@@ -0,0 +1 @@
|
||||
[{"outputType":{"type":"MERGED_MANIFESTS"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"2.0.0","enabled":true,"outputFile":"mogo-tanlu-api-debug.aar","fullName":"debug","baseName":"debug"},"path":"../../library_manifest/debug/AndroidManifest.xml","properties":{"packageId":"com.zhidao.mogo.tanlu.api","split":""}}]
|
||||
3441
libraries/mogo-tanlu-api/build/intermediates/symbols/debug/R.txt
Normal file
@@ -0,0 +1,37 @@
|
||||
-- Merging decision tree log ---
|
||||
manifest
|
||||
ADDED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:1:1-5:12
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:1:1-5:12
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:1:1-5:12
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:1:1-5:12
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:1:1-5:12
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:1:1-5:12
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:1:1-5:12
|
||||
package
|
||||
ADDED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:2:5-40
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
android:versionName
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
ADDED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:1:1-5:12
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
android:versionCode
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
ADDED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:1:1-5:12
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
xmlns:android
|
||||
ADDED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:1:11-69
|
||||
uses-sdk
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml reason: use-sdk injection requested
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
android:targetSdkVersion
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
ADDED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
android:minSdkVersion
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
ADDED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
@@ -29,6 +29,10 @@ android {
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
package="com.mogo.module.share" >
|
||||
<application>
|
||||
<service android:name=".VoiceCmdService" />
|
||||
|
||||
</application>
|
||||
</manifest>
|
||||
|
||||
@@ -1,21 +1,28 @@
|
||||
package com.mogo.module.share
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.alibaba.android.arouter.facade.template.IProvider
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.map.MogoLatLng
|
||||
import com.mogo.module.share.adas.AdasFrontCarDistanceY
|
||||
import com.mogo.module.share.bean.event.MarkerInfo
|
||||
import com.mogo.module.share.constant.ACCIDENT_STRATEGY_SHARE_PUSH_TYPE
|
||||
import com.mogo.module.share.constant.S_TAG
|
||||
import com.mogo.module.share.strategyreceiver.AccidentStrategyReceiver
|
||||
import com.mogo.module.share.strategyreceiver.BlockStrategy
|
||||
import com.mogo.service.IMogoServiceApis
|
||||
import com.mogo.service.MogoServicePaths
|
||||
import com.mogo.service.share.IMogoTanluUiProvider
|
||||
import com.mogo.utils.logger.Logger
|
||||
import com.mogo.utils.network.utils.GsonUtil
|
||||
import io.reactivex.Single
|
||||
import io.reactivex.SingleEmitter
|
||||
import io.reactivex.SingleOnSubscribe
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import org.json.JSONObject
|
||||
import java.lang.Exception
|
||||
|
||||
/**
|
||||
* 策略上报入口,服务端策略上报Push的接收地,接收后再调用tanlu相关接口进行视频抓取
|
||||
@@ -23,9 +30,14 @@ import java.lang.Exception
|
||||
* @author tongchenfei
|
||||
*/
|
||||
@Route(path = MogoServicePaths.PATH_STRATEGY_SHARE)
|
||||
class StrategyShareProvider : IProvider {
|
||||
class StrategyShareProvider : IMogoTanluUiProvider {
|
||||
private lateinit var blockStrategy: BlockStrategy
|
||||
private lateinit var mContext: Context;
|
||||
|
||||
override fun init(context: Context) {
|
||||
TanluServiceManager.init(context)
|
||||
TanluManager.getInstance(context).init()
|
||||
mContext = context
|
||||
Logger.d(S_TAG, "策略上报Provider初始化====")
|
||||
val apis = ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(context) as IMogoServiceApis
|
||||
blockStrategy = BlockStrategy(context, apis)
|
||||
@@ -57,4 +69,27 @@ class StrategyShareProvider : IProvider {
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
override fun searchRoadCondition(intentStr: String, data: String, city: String, keywords: String) {
|
||||
val disposable = Single.create(SingleOnSubscribe { emitter: SingleEmitter<Intent?> ->
|
||||
Logger.d(S_TAG, "searchRoadCondition---> intentStr: " + intentStr + " data: " + data + " " +
|
||||
"city: " + city + " keywords: " + keywords)
|
||||
val intent = Intent(intentStr)
|
||||
intent.putExtra("data", data)
|
||||
intent.putExtra("city", city)
|
||||
intent.putExtra("keywords", keywords)
|
||||
Thread.sleep(3000)
|
||||
emitter.onSuccess(intent)
|
||||
}).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe { intent: Intent? ->
|
||||
Logger.d(S_TAG, "searchRoadCondition---go real share")
|
||||
TanluManager.getInstance(mContext).realShare(intentStr, intent)
|
||||
}
|
||||
}
|
||||
|
||||
override fun shareSuccess(poiType: String?, location: MogoLatLng) {
|
||||
val markerInfo = MarkerInfo(poiType, "", location.lon, location.lat, true, "1")
|
||||
EventBus.getDefault().post(markerInfo)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,775 @@
|
||||
package com.mogo.module.share;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Rect;
|
||||
import android.net.Uri;
|
||||
import android.util.Log;
|
||||
import android.view.animation.AccelerateInterpolator;
|
||||
import android.view.animation.Interpolator;
|
||||
import android.view.animation.LinearInterpolator;
|
||||
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.marker.IMogoMarkerManager;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.marker.anim.OnMarkerAnimationListener;
|
||||
import com.mogo.map.search.geo.IMogoGeoSearch;
|
||||
import com.mogo.map.search.geo.IMogoGeoSearchListener;
|
||||
import com.mogo.map.search.geo.MogoGeocodeAddress;
|
||||
import com.mogo.map.search.geo.MogoGeocodeResult;
|
||||
import com.mogo.map.search.geo.MogoPoiItem;
|
||||
import com.mogo.map.search.geo.MogoRegeocodeResult;
|
||||
import com.mogo.map.search.poisearch.IMogoPoiSearch;
|
||||
import com.mogo.map.search.poisearch.IMogoPoiSearchListener;
|
||||
import com.mogo.map.search.poisearch.MogoPoiResult;
|
||||
import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.MarkerLocation;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.share.bean.VoiceCmdData;
|
||||
import com.mogo.module.share.bean.event.MarkerInfo;
|
||||
import com.mogo.module.share.callback.RoadInfoCallback;
|
||||
import com.mogo.module.share.constant.ShareConstants;
|
||||
import com.mogo.module.share.net.TanluModelData;
|
||||
import com.mogo.module.share.utils.Utils;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.mogo.service.intent.IMogoIntentManager;
|
||||
import com.mogo.service.module.IMogoRegisterCenter;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.utils.NetworkUtils;
|
||||
import com.mogo.utils.TipDrawable;
|
||||
import com.mogo.utils.TipToast;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import static com.mogo.module.share.constant.ShareConstants.SPECIFIEDROAD_SEARCH;
|
||||
import static com.mogo.module.share.constant.ShareConstants.TXZ_SPECIFIEDROAD_SEARCH;
|
||||
import static com.mogo.module.share.constant.ShareConstants.TYPE_NAME_BLOCK;
|
||||
import static com.mogo.module.share.constant.ShareConstants.TYPE_NAME_CLOSURE;
|
||||
import static com.mogo.module.share.constant.ShareConstants.TYPE_NAME_TRAFFIC_CHECK;
|
||||
import static com.mogo.module.share.constant.ShareConstants.VOICE_COMMAND_NOVELTY_QUERY;
|
||||
import static com.mogo.module.share.constant.ShareConstants.VOICE_COMMAND_QUERY_ROAD_CLOSED;
|
||||
import static com.mogo.module.share.constant.ShareConstants.VOICE_COMMAND_QUERY_TRAFFIC_CHECK;
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description 探路和新鲜事的view
|
||||
* @since 2020/5/19
|
||||
*/
|
||||
public class TanluManager implements IMogoMarkerClickListener,
|
||||
IMogoPoiSearchListener,
|
||||
IMogoGeoSearchListener {
|
||||
|
||||
private static final String TAG = "TanluManager";
|
||||
private Context mContext;
|
||||
//map
|
||||
private IMogoMarkerManager mMarkerManager;
|
||||
private IMogoStatusManager mMogoStatusManager;
|
||||
private IMogoIntentManager mogoIntentManager;
|
||||
private IMogoMapUIController mMApUIController;
|
||||
private IMogoAnalytics mAnalytics;
|
||||
private IMogoGeoSearch mIMogoGeoSearch;
|
||||
|
||||
Random random = new Random();
|
||||
|
||||
//声音控制文字
|
||||
private String voiceGetInfoMationTts;
|
||||
private String[] searchingVoiceStrings;
|
||||
private String[] searchfaileVoiceStrings;
|
||||
private String voiceShareSuccessTts;
|
||||
|
||||
private List<MarkerExploreWay> markerExploreWayList = new ArrayList<>();
|
||||
private Bitmap multiMarkerIcon;
|
||||
private TanluModelData mTanluModelData;
|
||||
private IMogoRegisterCenter mMogoRegisterCenter;
|
||||
private String mKeywords;
|
||||
private String mCity;
|
||||
Random mRandom = new Random();
|
||||
|
||||
private static volatile TanluManager sInstance;
|
||||
|
||||
|
||||
public TanluManager(Context context) {
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
public static TanluManager getInstance(Context context) {
|
||||
if (sInstance == null) {
|
||||
synchronized (TanluManager.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new TanluManager(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
|
||||
public void init() {
|
||||
EventBus.getDefault().register(this);
|
||||
initInterface();
|
||||
initModelData();
|
||||
initStrings();
|
||||
initListener();
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造经纬度列表
|
||||
*
|
||||
* @param markerExploreWay
|
||||
* @return
|
||||
*/
|
||||
private List<MogoLatLng> getList(MarkerExploreWay markerExploreWay) {
|
||||
List<MogoLatLng> list = new ArrayList<>();
|
||||
if (markerExploreWay != null) {
|
||||
MarkerLocation location = markerExploreWay.getLocation();
|
||||
if (location != null) {
|
||||
Logger.d(TAG, "getList location.getLon() =" + location.getLon() + " >>>location.getLat()=" + location.getLat());
|
||||
MogoLatLng mogoLatLng = new MogoLatLng(location.getLat(), location.getLon());
|
||||
//经度
|
||||
Double longit = TanluServiceManager.getLocationClient().getLastKnowLocation().getLongitude();
|
||||
//维度
|
||||
Double lat = TanluServiceManager.getLocationClient().getLastKnowLocation().getLatitude();
|
||||
|
||||
list.add(mogoLatLng);
|
||||
} else {
|
||||
Logger.e(TAG, "getList() location == null");
|
||||
}
|
||||
} else {
|
||||
Logger.e(TAG, "getList() markerExploreWay == null");
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private void initInterface() {
|
||||
//地图marker,地图操作
|
||||
mMarkerManager = TanluServiceManager.getMapService().getMarkerManager(mContext);
|
||||
mMApUIController = TanluServiceManager.getMapService().getMapUIController();
|
||||
//地图逆序
|
||||
mIMogoGeoSearch = TanluServiceManager.getMapService().getGeoSearch(mContext);
|
||||
//唤醒
|
||||
mogoIntentManager = TanluServiceManager.getMogoIntentManager();
|
||||
mMogoStatusManager = TanluServiceManager.getMogoStatusManager();
|
||||
mAnalytics = TanluServiceManager.getAnalytics();
|
||||
mMogoRegisterCenter = TanluServiceManager.getIMogoRegisterCenter();
|
||||
mIMogoGeoSearch.setGeoSearchListener(this);
|
||||
}
|
||||
|
||||
private void initModelData() {
|
||||
if (mTanluModelData == null) {
|
||||
mTanluModelData = new TanluModelData(mContext);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRegeocodeSearched(MogoRegeocodeResult regeocodeResult) {
|
||||
Logger.d(TAG, "onRegeocodeSearched -----> ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGeocodeSearched(MogoGeocodeResult geocodeResult) {
|
||||
Logger.d(TAG, "onGeocodeSearched ------mKeywords =" + mKeywords);
|
||||
if (geocodeResult != null) {
|
||||
if (geocodeResult.getAddresses() != null && geocodeResult.getAddresses().size() > 0) {
|
||||
Logger.d(TAG, "geocodeResult.getAddresses().size() = " + geocodeResult.getAddresses().size());
|
||||
MogoGeocodeAddress geocodeAddress = geocodeResult.getAddresses().get(0);
|
||||
MogoLatLng latLon = geocodeAddress.getLatlng();
|
||||
Double longit; //经度
|
||||
Double lat; //维度
|
||||
if (mKeywords.equals("附近")) {
|
||||
Logger.d(TAG, "附近 ----1---");
|
||||
longit = TanluServiceManager.getLocationClient().getLastKnowLocation().getLongitude();
|
||||
lat = TanluServiceManager.getLocationClient().getLastKnowLocation().getLatitude();
|
||||
} else {
|
||||
Logger.d(TAG, "其他 ---1----");
|
||||
longit = latLon.lng;
|
||||
lat = latLon.lat;
|
||||
}
|
||||
Logger.d(TAG, "geoSearch keywords =" + mKeywords + ">>longitude= " + longit + "--latitude= " + lat);
|
||||
// getVoiceControlRoadData(mKeywords, lat, longit);
|
||||
} else {
|
||||
Logger.d(TAG, "onGeocodeSearched ------mKeywords =" + mKeywords);
|
||||
handlePoi(mKeywords);
|
||||
}
|
||||
} else {
|
||||
Logger.e(TAG, "geocodeResult.getAddresses() == null");
|
||||
speakFailVoice(searchfaileVoiceStrings[1]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* poi 搜索
|
||||
*
|
||||
* @param keywords
|
||||
*/
|
||||
private void handlePoi(String keywords) {
|
||||
String cityCode = TanluServiceManager.getLocationClient().getLastKnowLocation().getCityCode();
|
||||
MogoPoiSearchQuery poiSearchQuery = new MogoPoiSearchQuery(keywords, "", cityCode);
|
||||
IMogoPoiSearch poiSearch = TanluServiceManager.getMapService().getPoiSearch(mContext, poiSearchQuery);
|
||||
poiSearch.setPoiSearchListener(this);
|
||||
poiSearch.searchPOIAsyn();
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册listener监听
|
||||
*/
|
||||
private void initListener() {
|
||||
if (mogoIntentManager != null) {
|
||||
// 同行者 xxx堵不堵唤醒词语音注册
|
||||
Logger.d(TAG, "initListener====");
|
||||
mogoIntentManager.registerIntentListener(TXZ_SPECIFIEDROAD_SEARCH, mogoIntentListener);
|
||||
// 通用唤醒词语音注册
|
||||
mogoIntentManager.registerIntentListener(SPECIFIEDROAD_SEARCH, mogoIntentListener);
|
||||
mogoIntentManager.registerIntentListener(VOICE_COMMAND_QUERY_TRAFFIC_CHECK, mogoIntentListener);
|
||||
mogoIntentManager.registerIntentListener(VOICE_COMMAND_QUERY_ROAD_CLOSED, mogoIntentListener);
|
||||
mogoIntentManager.registerIntentListener(VOICE_COMMAND_NOVELTY_QUERY, mogoIntentListener);
|
||||
}
|
||||
}
|
||||
|
||||
Double currentLat = 0.0; //维度
|
||||
Double currentLon = 0.0;//经度
|
||||
|
||||
/**
|
||||
* 唤醒语音
|
||||
*/
|
||||
private IMogoIntentListener mogoIntentListener = (intentStr, intent) -> {
|
||||
AIAssist.getInstance(mContext).speakTTSVoice(searchingVoiceStrings[mRandom.nextInt(3)], null);
|
||||
if (TanluServiceManager.getMogoStatusManager().isMainPageOnResume()) {
|
||||
// 直接执行相关查询操作
|
||||
Logger.d(TAG, "智慧出行在前台,可直接分享--->");
|
||||
realShare(intentStr, intent);
|
||||
} else {
|
||||
// 需要打开智慧驾驶,然后执行操作
|
||||
Logger.d(TAG, "智慧出行没在前台,需要打开 --->");
|
||||
intent.setAction(Intent.ACTION_VIEW);
|
||||
String data = intent.getStringExtra("data") == null ? "" : intent.getStringExtra("data");
|
||||
String city = intent.getStringExtra("city") == null ? "" : intent.getStringExtra("city");
|
||||
String keywords = intent.getStringExtra("keywords") == null ? "" : intent.getStringExtra("keywords");
|
||||
intent.setData(Uri.parse("mogo://launcher/main/switch2?type=search-road-condition" +
|
||||
"&intentStr=" + intentStr + "&data=" + data + "&city=" + city + "&keywords=" + keywords));
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
mContext.startActivity(intent);
|
||||
}
|
||||
};
|
||||
|
||||
public void realShare(String intentStr, Intent intent) {
|
||||
String data = intent.getStringExtra("data");
|
||||
Logger.d(TAG, "唤醒 mogoIntentListener intentStr =" + intentStr + ">>data =" + data);
|
||||
VoiceCmdData voiceData = null;
|
||||
switch (intentStr) {
|
||||
case VOICE_COMMAND_QUERY_TRAFFIC_CHECK:
|
||||
// 搜索交通检查
|
||||
Logger.d(TAG, "搜索交通检查");
|
||||
voiceData = Utils.parseTOVoiceCmdData(data);
|
||||
voiceData.setObj(TYPE_NAME_TRAFFIC_CHECK);
|
||||
break;
|
||||
case VOICE_COMMAND_QUERY_ROAD_CLOSED:
|
||||
// 搜索封路
|
||||
Logger.d(TAG, "搜索封路");
|
||||
voiceData = Utils.parseTOVoiceCmdData(data);
|
||||
voiceData.setLocation(voiceData.getObj());
|
||||
voiceData.setObj(TYPE_NAME_CLOSURE);
|
||||
break;
|
||||
case SPECIFIEDROAD_SEARCH:
|
||||
// 拥堵和路况
|
||||
Logger.d(TAG, "拥堵和路况");
|
||||
voiceData = Utils.parseTOVoiceCmdData(data);
|
||||
voiceData.setObj(TYPE_NAME_BLOCK);
|
||||
mKeywords = voiceData.getLocation();
|
||||
break;
|
||||
case VOICE_COMMAND_NOVELTY_QUERY:
|
||||
Logger.d(TAG, "其他");
|
||||
voiceData = Utils.parseTOVoiceCmdData(data);
|
||||
break;
|
||||
case TXZ_SPECIFIEDROAD_SEARCH:
|
||||
Logger.d(TAG, "同行者--xx堵不堵--唤醒--->");
|
||||
String keyWords = intent.getStringExtra("keywords");
|
||||
mKeywords = keyWords;
|
||||
String city = intent.getStringExtra("city");
|
||||
voiceData = new VoiceCmdData("", city + keyWords, TYPE_NAME_BLOCK);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (voiceData != null) {
|
||||
mTanluModelData.queryRodeInfo(voiceData, new RoadInfoCallback() {
|
||||
@Override
|
||||
public void onQueryRoadInfoSuccess(@NotNull List<? extends MarkerExploreWay> roadInfoList) {
|
||||
if (roadInfoList == null || (roadInfoList != null && roadInfoList.size() <= 0)) {
|
||||
speakFailVoice("未发现" + mKeywords + "附近的特殊路况");
|
||||
moveToMarcker(currentLat, currentLon);
|
||||
return;
|
||||
}
|
||||
Logger.d(TAG, "onQueryRoadInfoSuccess roadInfoList.size() = " + roadInfoList.size()
|
||||
+ " >>currentLat = " + currentLat + " -->currentLon = " + currentLon);
|
||||
MogoLocation location = TanluServiceManager.getLocationClient().getLastKnowLocation();
|
||||
if (location != null) {
|
||||
mCity = location.getCityName();
|
||||
}
|
||||
addMarkersAction((List<MarkerExploreWay>) roadInfoList, currentLat, currentLon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onQueryRoadInfoFail(@NotNull String msg, int code) {
|
||||
Logger.e(TAG, "onQueryRoadInfoFail ----- msg = " + msg);
|
||||
// speakFailVoice(searchfaileVoiceStrings[1]);
|
||||
speakFailVoice("未发现" + mKeywords + "附近的特殊路况");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocatSuccess(double lat, double lon) {
|
||||
currentLat = lat;
|
||||
currentLon = lon;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加marker
|
||||
*/
|
||||
private void addMarkersAction(List<MarkerExploreWay> list, final double lat, final double lon) {
|
||||
//播报搜索结果
|
||||
speakSuccessVoice(list, "");
|
||||
|
||||
//移动到具体位置
|
||||
if (mMogoStatusManager != null) {
|
||||
mMogoStatusManager.setUserInteractionStatus(ShareConstants.MODEL_NAME, true, true);
|
||||
}
|
||||
moveToMarcker(lat, lon);
|
||||
inputlon = lon;
|
||||
inputlat = lat;
|
||||
|
||||
Logger.d(TAG, "addMarker lat =" + lat + ">>>lon =" + lon);
|
||||
if (markerExploreWayList != null && markerExploreWayList.size() > 0) {
|
||||
markerExploreWayList.clear(); //刷新之前先删除之前的,然后再添加成请求的
|
||||
}
|
||||
markerExploreWayList.addAll(list);
|
||||
|
||||
//清除探路之前的数据
|
||||
if (mMarkerManager != null) {
|
||||
mMarkerManager.removeMarkers(ShareConstants.MODEL_NAME);
|
||||
}
|
||||
//添加埋点数据
|
||||
datalon = list.get(0).getLocation().getLon();
|
||||
datalat = list.get(0).getLocation().getLat();
|
||||
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
MarkerShowEntity markerShowEntity = new MarkerShowEntity();
|
||||
markerShowEntity.setBindObj(markerExploreWayList.get(i));
|
||||
markerShowEntity.setTextContent(list.get(i).getAddr());
|
||||
markerShowEntity.setMarkerLocation(markerExploreWayList.get(i).getLocation());
|
||||
markerShowEntity.setMarkerType(ShareConstants.MODEL_NAME);
|
||||
|
||||
TanluServiceManager.getServiceApis().getMarkerService().drawMarker(markerShowEntity);
|
||||
|
||||
try {
|
||||
post2AddAndStartAnimation(markerShowEntity, i * 100L);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
//防止刷新策略改变
|
||||
mMogoStatusManager.setUserInteractionStatus(ShareConstants.MODEL_NAME, true, true);
|
||||
//展示6个在区域内显示
|
||||
showBonndsRoadtion();
|
||||
//直接使用当前数据list,作为切换的数据源,切换左侧列表到最新的数据
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* marker动画
|
||||
*
|
||||
* @param entity
|
||||
* @param delay
|
||||
*/
|
||||
private void post2AddAndStartAnimation(MarkerShowEntity entity, long delay) {
|
||||
if (entity == null) {
|
||||
return;
|
||||
}
|
||||
WorkThreadHandler.getInstance().postDelayed(() -> {
|
||||
if (entity == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
IMogoMarker marker = TanluServiceManager.getServiceApis().getMarkerService().drawMarker(entity);
|
||||
marker.startScaleAnimation(0, 1.2f, 0, 1.2f, 300, new AccelerateInterpolator(), new OnMarkerAnimationListener() {
|
||||
@Override
|
||||
public void onAnimStart() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimEnd() {
|
||||
if (marker.isDestroyed()) {
|
||||
return;
|
||||
}
|
||||
marker.startScaleAnimation(1.2f, 1, 1.2f, 1, 100, new LinearInterpolator(), null);
|
||||
}
|
||||
});
|
||||
}, delay);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 发送广播
|
||||
*/
|
||||
private void sendShareReceiver(String type) {
|
||||
if (!type.equals("0") && mMogoStatusManager != null) {
|
||||
mMogoStatusManager.setUploadingStatus("CARD_TYPE_ROAD_CONDITION", true);
|
||||
}
|
||||
|
||||
Logger.d(TAG, "TanluListWindow sendShareReceiver type = " + type);
|
||||
Intent intent = new Intent();
|
||||
intent.setAction("com.zhidao.share.roadcondition.action"); //com.zhidao.roadcondition.share
|
||||
intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
|
||||
intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
|
||||
intent.putExtra("type", type);
|
||||
mContext.sendBroadcast(intent);
|
||||
}
|
||||
|
||||
private void moveToMarcker(double lat, double lon) {
|
||||
Logger.d(TAG, "moveToMarcker lat = " + lat + " >>>>lon = " + lon);
|
||||
MogoLatLng latLng = new MogoLatLng(lat, lon);
|
||||
mMogoStatusManager.setUserInteractionStatus(TAG, true, false);
|
||||
mMApUIController.moveToCenter(latLng);
|
||||
}
|
||||
|
||||
/**
|
||||
* marker点击事件
|
||||
*
|
||||
* @param marker
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean onMarkerClicked(IMogoMarker marker) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 释放资源
|
||||
*/
|
||||
public void releaseAction() {
|
||||
// EventBus.getDefault().unregister(this);
|
||||
mMogoRegisterCenter.unregisterMogoNaviListener(ShareConstants.MODEL_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* poi
|
||||
*
|
||||
* @param p0
|
||||
* @param p1
|
||||
*/
|
||||
@Override
|
||||
public void onPoiSearched(MogoPoiResult p0, int p1) {
|
||||
if (p1 == 1000) {
|
||||
if (p0.getPois() != null && p0.getPois().size() > 0) {
|
||||
MogoPoiItem poi = p0.getPois().get(0);
|
||||
MogoLatLng latLon = poi.getPoint();
|
||||
Double longit; //经度
|
||||
Double lat; //维度
|
||||
if (mKeywords.equals("附近")) {
|
||||
Logger.d(TAG, "附近 -onPoiSearched---1---");
|
||||
longit = TanluServiceManager.getLocationClient().getLastKnowLocation().getLongitude();
|
||||
lat = TanluServiceManager.getLocationClient().getLastKnowLocation().getLatitude();
|
||||
} else {
|
||||
Logger.d(TAG, "其他 -onPoiSearched---1----");
|
||||
longit = latLon.lng;
|
||||
lat = latLon.lat;
|
||||
}
|
||||
// getVoiceControlRoadData(mKeywords, lat, longit);
|
||||
Logger.d(TAG, "setOnPoiSearchListener keywords =" + mKeywords + ">>longitude= " + longit + "--latitude" + lat);
|
||||
} else {
|
||||
Logger.e(TAG, "poi == null");
|
||||
Double longit; //经度
|
||||
Double lat; //维度
|
||||
if (mKeywords.equals("附近")) {
|
||||
Logger.d(TAG, "附近 -onPoiSearched---2---");
|
||||
longit = TanluServiceManager.getLocationClient().getLastKnowLocation().getLongitude();
|
||||
lat = TanluServiceManager.getLocationClient().getLastKnowLocation().getLatitude();
|
||||
// getVoiceControlRoadData(mKeywords, lat, longit);
|
||||
} else {
|
||||
Logger.d(TAG, "其他 -onPoiSearched---2----");
|
||||
speakFailVoice(searchfaileVoiceStrings[1]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Logger.e(TAG, "poi search result p1 = " + p1);
|
||||
speakFailVoice(searchfaileVoiceStrings[1]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPoiItemSearched(MogoPoiItem item, int errorCode) {
|
||||
if (item == null) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 接收到分享对应数据打点
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onMarkerInfo(final MarkerInfo event) {
|
||||
if (event == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!NetworkUtils.isConnected(mContext)) { //没有网络
|
||||
TipToast.shortTip("分享失败,请检查网络", new TipDrawable(mContext.getResources().getDrawable(R.drawable.module_tanlu_upload_fail)));
|
||||
} else {
|
||||
float bearing = TanluServiceManager.getLocationClient().getLastKnowLocation().getBearing(); //角度
|
||||
Logger.d(TAG, "onMarkerInfo event.type = " + event.type + " >>event.lat = " + event.lat + " >>event.lon = " + event.lon + " >>event.imageUrl =" + event.imageUrl);
|
||||
String poiType = event.type;
|
||||
String fromType = event.fromType;
|
||||
boolean isCumtom = event.isCumtom;
|
||||
Logger.d(TAG, "onMarkerInfo share poiType = " + poiType + " --isCumtom = " + isCumtom + " >> getMathRandom = " + getMathRandom() + " >>> bearing = " + bearing + ">>>fromType = " + fromType);
|
||||
if (!fromType.equals("5")) {
|
||||
if (isCumtom && !poiType.equals("0")) {
|
||||
// 不管在不在前台,都要提示分享成功
|
||||
AIAssist.getInstance(mContext).speakTTSVoice((
|
||||
String.format(voiceShareSuccessTts, getMathRandom())), null);
|
||||
TipToast.shortTip("分享成功", new TipDrawable(mContext.getResources().getDrawable(R.drawable.module_tanlu_upload_success)));
|
||||
|
||||
if (TanluServiceManager.getMogoStatusManager().isMainPageOnResume()) {
|
||||
double lat = TanluServiceManager.getLocationClient().getLastKnowLocation().getLatitude();
|
||||
double lon = TanluServiceManager.getLocationClient().getLastKnowLocation().getLongitude();
|
||||
Log.d(TAG, "onMarkerInfo lat = " + lat + " >>>> lon = " + lon);
|
||||
String cityName = TanluServiceManager.getLocationClient().getLastKnowLocation().getCityName();
|
||||
String address = TanluServiceManager.getLocationClient().getLastKnowLocation().getAddress();
|
||||
MarkerExploreWay markerExploreWay = new MarkerExploreWay();
|
||||
markerExploreWay.setCityName(cityName);
|
||||
markerExploreWay.setPoiType(poiType);
|
||||
|
||||
MarkerLocation markerLocation = new MarkerLocation();
|
||||
markerLocation.setLat(lat);
|
||||
markerLocation.setLon(lon);
|
||||
markerLocation.setAddress(address);
|
||||
|
||||
MarkerShowEntity markerShowEntity = new MarkerShowEntity();
|
||||
markerShowEntity.setBindObj(markerExploreWay);
|
||||
markerShowEntity.setTextContent(address);
|
||||
markerShowEntity.setMarkerType(ShareConstants.MODEL_NAME);
|
||||
markerShowEntity.setMarkerLocation(markerLocation);
|
||||
|
||||
IMogoMarker mogoMarker = TanluServiceManager.getServiceApis().getMarkerService().drawMarker(markerShowEntity);
|
||||
mogoMarker.setClickable(false);
|
||||
|
||||
//添加图片动画
|
||||
Bitmap bitmap = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.tanlu_circle_image, null);
|
||||
MarkerShowEntity markerShowEntityAnimation = new MarkerShowEntity();
|
||||
markerShowEntityAnimation.setTextContent(address);
|
||||
markerShowEntityAnimation.setMarkerType(ShareConstants.MODEL_NAME);
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.object(markerShowEntityAnimation)
|
||||
.icon(bitmap)
|
||||
.anchor(0.5f, 0.5f)
|
||||
.latitude(lat)
|
||||
.owner(ShareConstants.MODEL_NAME)
|
||||
.longitude(lon);
|
||||
|
||||
final IMogoMarker mogoAnimationMarker = mMarkerManager.addMarker(ShareConstants.MODEL_NAME, options);
|
||||
mogoAnimationMarker.startScaleAnimation(0, 4f, 0, 4f, 500, new LinearInterpolator(), new OnMarkerAnimationListener() {
|
||||
@Override
|
||||
public void onAnimStart() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimEnd() {
|
||||
mogoAnimationMarker.destroy();
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
Logger.e(TAG, "onMarkerInfo share onCompleted poiType = -1 --- else ---->");
|
||||
}
|
||||
}
|
||||
}
|
||||
mMogoStatusManager.setUploadingStatus(ShareConstants.MODEL_NAME, false);
|
||||
}
|
||||
|
||||
private void showJumpAnimation(final IMogoMarker mogoMarker) {
|
||||
if (mogoMarker == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
mogoMarker.startJumpAnimation(80, 300, new Interpolator() {
|
||||
@Override
|
||||
public float getInterpolation(float input) {
|
||||
if (input <= 0.5) {
|
||||
return (float) (0.5f - 2.0 * (0.5 - input) * (0.5 - input));
|
||||
} else {
|
||||
return (float) (0.5f - Math.sqrt(input - 0.5f) * (1.5f - input));
|
||||
}
|
||||
}
|
||||
}, new OnMarkerAnimationListener() {
|
||||
@Override
|
||||
public void onAnimStart() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimEnd() {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void moveNotFresh() {
|
||||
mMogoStatusManager.setUserInteractionStatus(TAG, true, false);
|
||||
}
|
||||
|
||||
private void showBonndsRoadtion() {
|
||||
Logger.e(TAG, "showBonndsRoadtion markerExploreWayList.size() = " + markerExploreWayList.size());
|
||||
Logger.d(TAG, "showBonndsRoadtion getMogoList().size() = " + getMogoList().size());
|
||||
//经度
|
||||
Double longit = TanluServiceManager.getLocationClient().getLastKnowLocation().getLongitude();
|
||||
//纬度
|
||||
Double lat = TanluServiceManager.getLocationClient().getLastKnowLocation().getLatitude();
|
||||
Rect rect = new Rect(
|
||||
(int) mContext.getResources().getDimension(R.dimen.tanlu_module_map_left),
|
||||
(int) mContext.getResources().getDimension(R.dimen.tanlu_module_map_top),
|
||||
(int) mContext.getResources().getDimension(R.dimen.tanlu_module_map_right),
|
||||
(int) mContext.getResources().getDimension(R.dimen.tanlu_module_map_bottom));
|
||||
|
||||
moveNotFresh();
|
||||
//第一个参数:调用者,第二个参数:当前自车的位置,第三个参数:需要显示在范围内的点(不包含自车的位置)
|
||||
//第四个参数:显示范围的UI边界,第五个参数:是否锁定自车位置(看业务需要)
|
||||
mMApUIController.showBounds(ShareConstants.MODEL_NAME, null,
|
||||
getMogoList(), rect, false);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 构造经纬度列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private List<MogoLatLng> getMogoList() {
|
||||
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;
|
||||
}
|
||||
|
||||
private void speakSuccessVoice(List<MarkerExploreWay> informations, String
|
||||
trafficStatus) {
|
||||
Logger.d(TAG, "speakSuccessVoice informations.size() = " + informations.size());
|
||||
switch (informations.size()) {
|
||||
case 0:
|
||||
speakFailVoice(searchfaileVoiceStrings[random.nextInt(1)]);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
trackVoiceSearch(1);
|
||||
AIAssist.getInstance(mContext).speakTTSVoice((
|
||||
String.format(voiceGetInfoMationTts, "1") + trafficStatus), null);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
trackVoiceSearch(1);
|
||||
AIAssist.getInstance(mContext).speakTTSVoice((
|
||||
String.format(
|
||||
voiceGetInfoMationTts,
|
||||
"2"
|
||||
) + trafficStatus), null);
|
||||
break;
|
||||
case 3:
|
||||
trackVoiceSearch(1);
|
||||
AIAssist.getInstance(mContext).speakTTSVoice((
|
||||
String.format(
|
||||
voiceGetInfoMationTts,
|
||||
"3"
|
||||
) + trafficStatus), null);
|
||||
break;
|
||||
|
||||
default:
|
||||
trackVoiceSearch(1);
|
||||
AIAssist.getInstance(mContext).speakTTSVoice((
|
||||
String.format(
|
||||
voiceGetInfoMationTts,
|
||||
"多"
|
||||
) + trafficStatus), null);
|
||||
}
|
||||
}
|
||||
|
||||
private void initStrings() {
|
||||
voiceGetInfoMationTts =
|
||||
mContext.getResources().getString(R.string.voice_get_informations_tts);
|
||||
searchingVoiceStrings =
|
||||
mContext.getResources().getStringArray(R.array.searching_voice_string_array);
|
||||
searchfaileVoiceStrings =
|
||||
mContext.getResources().getStringArray(R.array.search_fail_voice_array);
|
||||
voiceShareSuccessTts = mContext.getResources().getString(R.string.tanlu_share_success);
|
||||
}
|
||||
|
||||
private void speakFailVoice(String string) {
|
||||
AIAssist.getInstance(mContext).speakTTSVoice(string, null);
|
||||
}
|
||||
|
||||
|
||||
Double inputlon = 0.0;//经度
|
||||
Double inputlat = 0.0; //维度
|
||||
Double datalon = 0.0; //经度
|
||||
Double datalat = 0.0; //维度
|
||||
|
||||
//上报语音搜索
|
||||
private void trackVoiceSearch(int type) {
|
||||
Log.e(TAG, "type = " + type + "-- mCity =" + mCity + "-- mKeywords =" + mKeywords);
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("searcharea", mKeywords);
|
||||
properties.put("city", mCity);
|
||||
mAnalytics.track(ShareConstants.CARNET_VOICE_SEARCH, properties);
|
||||
}
|
||||
|
||||
private String getMathRandom() {
|
||||
Random random = new Random();
|
||||
int temp = random.nextInt(50) + 10;
|
||||
|
||||
return String.valueOf(temp);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.mogo.module.share;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.search.poisearch.IMogoPoiSearch;
|
||||
import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
import com.mogo.service.intent.IMogoIntentManager;
|
||||
import com.mogo.service.map.IMogoMapService;
|
||||
import com.mogo.service.module.IMogoRegisterCenter;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.service.windowview.IMogoTopViewManager;
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @since 2020-5-19
|
||||
* <p>
|
||||
* 持有服务接口实例
|
||||
*/
|
||||
public class TanluServiceManager {
|
||||
private static IMogoMapService mMapService;
|
||||
private static IMogoPoiSearch mPoiSearch;
|
||||
private static IMogoLocationClient mLocationClient;
|
||||
private static IMogoServiceApis mServiceApis;
|
||||
private static IMogoStatusManager mIMogoStatusManager;
|
||||
private static IMogoAnalytics mAnalytics;
|
||||
private static IMogoIntentManager mogoIntentManager;
|
||||
private static IMogoRegisterCenter mogoRegisterCenter;
|
||||
private static IMogoTopViewManager mIMogoTopViewManager;
|
||||
|
||||
public static void init(Context context) {
|
||||
mServiceApis = (IMogoServiceApis) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(context);
|
||||
mMapService = mServiceApis.getMapServiceApi();
|
||||
mIMogoStatusManager = mServiceApis.getStatusManagerApi();
|
||||
mAnalytics = mServiceApis.getAnalyticsApi();
|
||||
mogoIntentManager = mServiceApis.getIntentManagerApi();
|
||||
mogoRegisterCenter = mServiceApis.getRegisterCenterApi();
|
||||
|
||||
mIMogoTopViewManager = mServiceApis.getTopViewManager();
|
||||
mPoiSearch = mMapService.getPoiSearch(context, new MogoPoiSearchQuery());
|
||||
mLocationClient = mMapService.getSingletonLocationClient(context);
|
||||
}
|
||||
|
||||
public static IMogoTopViewManager getIMogoTopViewManager() {
|
||||
return mIMogoTopViewManager;
|
||||
}
|
||||
|
||||
public static IMogoRegisterCenter getIMogoRegisterCenter() {
|
||||
return mogoRegisterCenter;
|
||||
}
|
||||
|
||||
public static IMogoMapService getMapService() {
|
||||
return mMapService;
|
||||
}
|
||||
|
||||
public static IMogoPoiSearch getPoiSearch() {
|
||||
return mPoiSearch;
|
||||
}
|
||||
|
||||
public static IMogoLocationClient getLocationClient() {
|
||||
return mLocationClient;
|
||||
}
|
||||
|
||||
public static IMogoAnalytics getAnalytics() {
|
||||
return mAnalytics;
|
||||
}
|
||||
|
||||
public static IMogoIntentManager getMogoIntentManager() {
|
||||
return mogoIntentManager;
|
||||
}
|
||||
|
||||
public static IMogoStatusManager getMogoStatusManager() {
|
||||
return mIMogoStatusManager;
|
||||
}
|
||||
|
||||
public static IMogoServiceApis getServiceApis() {
|
||||
return mServiceApis;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.mogo.module.share.bean
|
||||
|
||||
import com.mogo.commons.data.BaseData
|
||||
|
||||
data class BaseDataCompat<T>(var result:T?):BaseData()
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.mogo.module.share.bean
|
||||
|
||||
data class RoadInfoRequest(var location:Location,var poiTypes:Array<String>,var onlyFocus:Boolean = false,var onlySameCity:Boolean = false)
|
||||
|
||||
data class Location(var lat:Double,var lon:Double)
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.mogo.module.share.bean
|
||||
|
||||
import com.mogo.commons.data.BaseData
|
||||
import com.mogo.module.common.entity.MarkerExploreWay
|
||||
|
||||
data class RoadInfos(var data:List<MarkerExploreWay>) : BaseData()
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.mogo.module.share.bean
|
||||
|
||||
import com.mogo.module.share.constant.*
|
||||
import com.mogo.module.share.constant.ShareConstants.*
|
||||
|
||||
|
||||
/**
|
||||
* 语音指令附带数据,目前只针对道路事件查询 */
|
||||
class VoiceCmdData(var op: String, var location: String, var obj: String) {
|
||||
|
||||
/**
|
||||
* 将obj转成服务端可识别的道路事件类型
|
||||
*/
|
||||
val type: String
|
||||
get() {
|
||||
return when (obj) {
|
||||
TYPE_NAME_BLOCK -> TANLU_ROAD_CONGESTION_COMPAT
|
||||
TYPE_NAME_TRAFFIC_CHECK -> TANLU_TRAFFIC_CHECK_COMPAT
|
||||
TYPE_NAME_CLOSURE -> TANLU_ROAD_CLOSURE_COMPAT
|
||||
TYPE_NAME_ACCIDENT -> TANLU_ROAD_ACCIDENT
|
||||
TYPE_NAME_REAL_TIME_TRAFFIC -> TANLU_ROAD_CURRENT
|
||||
TYPE_NAME_STAGNANT_WATER -> TANLU_ROAD_PONDING
|
||||
TYPE_NAME_ROAD_ICY -> TANLU_ROAD_ICING
|
||||
TYPE_NAME_DENSE_FOG -> TANLU_ROAD_HEAVY_FOG
|
||||
TYPE_NAME_ROAD_CONSTRUCTION -> TANLU_ROAD_CONSTRUCTION
|
||||
else -> ""
|
||||
}
|
||||
}
|
||||
|
||||
fun isHere(): Boolean {
|
||||
return "附近" == location
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "VoiceCmdData(op='$op', location='$location', obj='$obj', type='$type')"
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.mogo.module.share.bean.event;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description marker数据
|
||||
* @since 2020-01-08
|
||||
*/
|
||||
public class MarkerInfo implements Serializable {
|
||||
public String type; //封路,还是上报
|
||||
public String fromType; //来源 主动,被动,策略。
|
||||
public String imageUrl; //上传完cos图片
|
||||
public double lon; //经度
|
||||
public double lat; //纬度
|
||||
public boolean isCumtom; //是否主动上报
|
||||
|
||||
public MarkerInfo(String type, String imageUrl, double lon, double lat, boolean isCumtom, String fromType) {
|
||||
this.type = type;
|
||||
this.imageUrl = imageUrl;
|
||||
this.lon = lon;
|
||||
this.lat = lat;
|
||||
this.isCumtom = isCumtom;
|
||||
this.fromType = fromType;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.mogo.module.share.callback
|
||||
|
||||
import com.mogo.module.common.entity.MarkerExploreWay
|
||||
|
||||
interface RoadInfoCallback {
|
||||
fun onLocatSuccess(lat: Double, lon: Double)
|
||||
fun onQueryRoadInfoSuccess(roadInfoList:List<MarkerExploreWay>)
|
||||
fun onQueryRoadInfoFail(msg: String, code: Int)
|
||||
|
||||
}
|
||||
@@ -7,7 +7,6 @@ package com.mogo.module.share.constant;
|
||||
* 描述
|
||||
*/
|
||||
public class ShareConstants {
|
||||
|
||||
/**
|
||||
* 分享分类
|
||||
*/
|
||||
@@ -27,6 +26,10 @@ public class ShareConstants {
|
||||
".pubTroubleHelp";
|
||||
public static final String VOICE_CMD_GO_TO_SHARE = "com.zhidao.share";
|
||||
|
||||
public static final String TAG = "/tanlu/ui";
|
||||
public static final String NAVI_INFO = "navi_info";
|
||||
public static final String MODEL_NAME = "CARD_TYPE_ROAD_CONDITION";
|
||||
|
||||
/**
|
||||
* 免唤醒词上报拥堵
|
||||
*/
|
||||
@@ -68,9 +71,9 @@ public class ShareConstants {
|
||||
public static final String[] CMD_ROAD_CLOSURE = {"上报封路"};
|
||||
public static final String[] CMD_UPLOAD_ACCIDENT = {"上报事故", "上报交通事故"};
|
||||
public static final String[] UPLOAD_REAL_TIME_TRAFFIC = {"上报实时路况", "上报路况"};
|
||||
public static final String[] UPLOAD_SEEK_HELP = {"故障求助","发起故障求助"};
|
||||
public static final String[] UPLOAD_SEEK_HELP = {"故障求助", "发起故障求助"};
|
||||
public static final String[] UPLOAD_STAGNANT_WATER = {"上报积水"};
|
||||
public static final String[] UPLOAD_ROAD_ICY = {"上报积冰","上报道路积冰","上报结冰","上报道路结冰"};
|
||||
public static final String[] UPLOAD_ROAD_ICY = {"上报积冰", "上报道路积冰", "上报结冰", "上报道路结冰"};
|
||||
public static final String[] UPLOAD_DENSE_FOG = {"上报大雾", "上报浓雾"};
|
||||
public static final String[] UPLOAD_ROAD_CONSTRUCTION = {"上报施工", "上报道路施工"};
|
||||
|
||||
@@ -114,12 +117,75 @@ public class ShareConstants {
|
||||
|
||||
public static final int VOICE_ALERT_COUNT = 3;
|
||||
|
||||
//1天的毫秒 TODO
|
||||
//1天的毫秒
|
||||
public static final long ONE_DAY_TIME = 86400000;
|
||||
// public static final long ONE_DAY_TIME = 60000;
|
||||
|
||||
//7天的毫秒
|
||||
public static final long SEVEN_DAY_TIME = 604800000;
|
||||
// public static final long SEVEN_DAY_TIME = 60000;
|
||||
|
||||
/**
|
||||
* 加油 10001
|
||||
* 交通检查 10002
|
||||
* 封路 10003
|
||||
* 商场打折 10004
|
||||
* 4S店 10005
|
||||
* 施工 10006
|
||||
* 拥堵 10007
|
||||
* 积水 10008
|
||||
* 超市折扣 10009
|
||||
* 浓雾 10010
|
||||
* 结冰 10011
|
||||
* 停车场 10012
|
||||
* 交通事故 10013
|
||||
* 社保 10014
|
||||
* 实时路况 10015
|
||||
*/
|
||||
public static final String TANLU_ROAD_PONDING = "10008"; //积水
|
||||
public static final String TANLU_ROAD_ICING = "10011"; //积冰
|
||||
public static final String TANLU_ROAD_HEAVY_FOG = "10010"; //大雾
|
||||
public static final String TANLU_ROAD_ACCIDENT = "10013"; //事故
|
||||
public static final String TANLU_ROAD_CONSTRUCTION = "10006"; //道路施工
|
||||
public static final String TANLU_ROAD_CONGESTION_COMPAT = "10007"; //拥堵,适配语音不做数值转换
|
||||
public static final String TANLU_TRAFFIC_CHECK_COMPAT = "10002"; //交通检查,适配语音不做数值转换
|
||||
public static final String TANLU_ROAD_CLOSURE_COMPAT = "10003"; //封路,适配语音不做数值转换
|
||||
public static final String TANLU_ROAD_CURRENT = "10015"; //实时路况
|
||||
|
||||
|
||||
// 道路事件名称,用于语音识别区分道路事件
|
||||
public static final String TYPE_NAME_BLOCK = "拥堵";
|
||||
public static final String TYPE_NAME_TRAFFIC_CHECK = "交通检查";
|
||||
public static final String TYPE_NAME_CLOSURE = "封路";
|
||||
public static final String TYPE_NAME_ACCIDENT = "交通事故";
|
||||
public static final String TYPE_NAME_REAL_TIME_TRAFFIC = "实时路况";
|
||||
public static final String TYPE_NAME_STAGNANT_WATER = "积水";
|
||||
public static final String TYPE_NAME_ROAD_ICY = "积冰";
|
||||
public static final String TYPE_NAME_DENSE_FOG = "雾";
|
||||
public static final String TYPE_NAME_ROAD_CONSTRUCTION = "施工";
|
||||
|
||||
|
||||
// 同行者 xx堵不堵 唤醒
|
||||
public static final String TXZ_SPECIFIEDROAD_SEARCH = "com.zhidao.roadcondition.roadinfo";
|
||||
|
||||
//思必驰 xx堵不堵 唤醒
|
||||
public static final String SPECIFIEDROAD_SEARCH = "com.zhidao.pathfinder.specifiedroad.search";
|
||||
|
||||
/**
|
||||
* 搜索交通检查
|
||||
*/
|
||||
public static final String VOICE_COMMAND_QUERY_TRAFFIC_CHECK = "com.zhidao.share.traffic.police";
|
||||
|
||||
/**
|
||||
* 搜索封路信息
|
||||
*/
|
||||
public static final String VOICE_COMMAND_QUERY_ROAD_CLOSED = "com.zhidao.share.road.closure.query";
|
||||
|
||||
/**
|
||||
* 其他道路事件,包括事故,实时路况,道路积水,道路积冰,浓雾
|
||||
*/
|
||||
public static final String VOICE_COMMAND_NOVELTY_QUERY = "com.zhidao.novelty.query";
|
||||
|
||||
//语音搜索
|
||||
public static final String CARNET_VOICE_SEARCH = "CarNet_Voice_Search";
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.mogo.module.share.net
|
||||
|
||||
import com.mogo.commons.data.BaseData
|
||||
import com.mogo.module.share.bean.AverateSpeedResponse
|
||||
import com.mogo.module.share.bean.BaseDataCompat
|
||||
import com.mogo.module.share.bean.RoadInfos
|
||||
import com.mogo.module.share.bean.ShareButtonConfigResponse
|
||||
import io.reactivex.Observable
|
||||
import okhttp3.RequestBody
|
||||
@@ -23,13 +25,23 @@ interface ShareApiService {
|
||||
*/
|
||||
@Headers("Content-type:application/json;charset=UTF-8")
|
||||
@POST("/deva/car/path/no/poiStrategyCheck/v1")
|
||||
fun sendAverageSpeedForBlockStrategy(@Body request:RequestBody,@Query("sn") sn:String):Observable<AverateSpeedResponse>
|
||||
fun sendAverageSpeedForBlockStrategy(@Body request: RequestBody, @Query("sn") sn: String): Observable<AverateSpeedResponse>
|
||||
|
||||
/**
|
||||
* 获取分享框服务端配置
|
||||
*/
|
||||
@FormUrlEncoded
|
||||
@POST("/deva/car/poiType/no/poiTypeList")
|
||||
fun queryShareButtonConfig(@FieldMap param: Map<String, String>):Observable<ShareButtonConfigResponse>
|
||||
fun queryShareButtonConfig(@FieldMap param: Map<String, String>): Observable<ShareButtonConfigResponse>
|
||||
|
||||
/**
|
||||
* 查询(搜索)道路事件信息
|
||||
* 接口文档:http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=42305842
|
||||
* 文档中有些参数暂时没有用到,包括radius,limit
|
||||
* @return
|
||||
*/
|
||||
@FormUrlEncoded
|
||||
@POST("/yycp-launcherSnapshot/launcherSnapshot/searchRoadEventsSync")
|
||||
fun queryRoadInfos(@FieldMap params: Map<String?, Any?>?): Observable<BaseDataCompat<RoadInfos?>?>?
|
||||
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
package com.mogo.module.share.net;
|
||||
|
||||
import android.content.Context;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.network.ParamsProvider;
|
||||
import com.mogo.commons.network.SubscribeImpl;
|
||||
import com.mogo.commons.network.Utils;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.map.search.geo.MogoPoiItem;
|
||||
import com.mogo.map.search.poisearch.IMogoPoiSearch;
|
||||
import com.mogo.map.search.poisearch.MogoPoiResult;
|
||||
import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery;
|
||||
import com.mogo.module.share.TanluServiceManager;
|
||||
import com.mogo.module.share.bean.BaseDataCompat;
|
||||
import com.mogo.module.share.bean.Location;
|
||||
import com.mogo.module.share.bean.RoadInfoRequest;
|
||||
import com.mogo.module.share.bean.RoadInfos;
|
||||
import com.mogo.module.share.bean.VoiceCmdData;
|
||||
import com.mogo.module.share.callback.RoadInfoCallback;
|
||||
import com.mogo.module.share.constant.HttpConstant;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.map.IMogoMapService;
|
||||
import com.mogo.service.network.IMogoNetwork;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.RequestOptions;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.ObservableEmitter;
|
||||
import io.reactivex.ObservableOnSubscribe;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.functions.Function;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
import static com.mogo.module.share.constant.ShareConstants.TANLU_ROAD_CONGESTION_COMPAT;
|
||||
import static com.mogo.module.share.constant.ShareConstants.TANLU_ROAD_CURRENT;
|
||||
import static com.mogo.module.share.constant.ShareConstants.TYPE_NAME_BLOCK;
|
||||
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description 探路接口数据处理
|
||||
* @since 2020-01-09
|
||||
*/
|
||||
public class TanluModelData {
|
||||
|
||||
private final Context mContext;
|
||||
private ShareApiService mShareApiService;
|
||||
private static final String TAG = "TanluModelData";
|
||||
|
||||
public TanluModelData(Context context) {
|
||||
this.mContext = context;
|
||||
IMogoNetwork network = (IMogoNetwork) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICES_NETWORK).navigation(context);
|
||||
mShareApiService = network.create(ShareApiService.class, getBaseUrl());
|
||||
}
|
||||
|
||||
private String getBaseUrl() {
|
||||
if (DebugConfig.getNetMode() == DebugConfig.NET_MODE_RELEASE) {
|
||||
return HttpConstant.HOST_PRODUCT;
|
||||
} else if (DebugConfig.getNetMode() == DebugConfig.NET_MODE_DEMO) {
|
||||
return HttpConstant.HOST_DEMO;
|
||||
} else {
|
||||
return HttpConstant.HOST_TEST;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询周边道路事件,是通过语音搜索,然后根据语音提供的语义,从服务端查询道路事件
|
||||
*
|
||||
* @param voiceCmdData 语音提供的语义封装
|
||||
*/
|
||||
public void queryRodeInfo(final VoiceCmdData voiceCmdData, final RoadInfoCallback callback) {
|
||||
Logger.d(TAG, "queryRodeInfo: " + voiceCmdData);
|
||||
if (voiceCmdData.isHere()) {
|
||||
// 搜索附近路况,只需要拿到当前位置信息,就可以请求服务端
|
||||
MogoLocation l = TanluServiceManager.getServiceApis().getMapServiceApi().getSingletonLocationClient(mContext).getLastKnowLocation();
|
||||
Location location = new Location(l.getLatitude(), l.getLongitude());
|
||||
callback.onLocatSuccess(l.getLatitude(), l.getLongitude());
|
||||
RoadInfoRequest request;
|
||||
if (voiceCmdData.getObj().equals(TYPE_NAME_BLOCK)) {
|
||||
// 拥堵和路况同时查
|
||||
request = new RoadInfoRequest(location, new String[]{TANLU_ROAD_CONGESTION_COMPAT, TANLU_ROAD_CURRENT}, false, false);
|
||||
}else{
|
||||
request = new RoadInfoRequest(location, new String[]{voiceCmdData.getType()}, false, false);
|
||||
}
|
||||
|
||||
Map<String, Object> params = new ParamsProvider.Builder(mContext)
|
||||
.append("sn", Utils.getSn())
|
||||
.append("data", GsonUtil.jsonFromObject(request))
|
||||
.build();
|
||||
|
||||
mShareApiService.queryRoadInfos(params)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new SubscribeImpl<BaseDataCompat<RoadInfos>>(RequestOptions.create(mContext)) {
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
super.onError(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(BaseDataCompat<RoadInfos> o) {
|
||||
super.onSuccess(o);
|
||||
Logger.d(TAG, "搜索附近路况信息成功: " + o);
|
||||
callback.onQueryRoadInfoSuccess(o.getResult().getData());
|
||||
Logger.d(TAG, "搜索附近路况信息成功2: " + o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String message, int code) {
|
||||
super.onError(message, code);
|
||||
callback.onQueryRoadInfoFail(message, code);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 查询的不是附近的信息,所以需要查询一下目标地址的经纬度,然后再请求服务端
|
||||
Observable.create(new ObservableOnSubscribe<MogoPoiResult>() {
|
||||
@Override
|
||||
public void subscribe(ObservableEmitter<MogoPoiResult> emitter) throws Exception {
|
||||
// 根据传入的地址,转成经纬度
|
||||
IMogoMapService mapService = TanluServiceManager.getServiceApis().getMapServiceApi();
|
||||
String cityCode = mapService.getSingletonLocationClient(mContext).getLastKnowLocation().getCityCode();
|
||||
MogoPoiSearchQuery poiSearchQuery = new MogoPoiSearchQuery(voiceCmdData.getLocation(), "", cityCode);
|
||||
IMogoPoiSearch poiSearch = mapService.getPoiSearch(mContext, poiSearchQuery);
|
||||
MogoPoiResult result = poiSearch.searchPOI();
|
||||
if (result != null && result.getPois() != null && result.getPois().size() > 0) {
|
||||
emitter.onNext(result);
|
||||
} else {
|
||||
emitter.onError(new IllegalArgumentException("没有根据地址查询到对应的经纬度"));
|
||||
}
|
||||
}
|
||||
}).subscribeOn(Schedulers.io()).observeOn(Schedulers.io())
|
||||
.flatMap(new Function<MogoPoiResult, Observable<BaseDataCompat<RoadInfos>>>() {
|
||||
@Override
|
||||
public Observable<BaseDataCompat<RoadInfos>> apply(MogoPoiResult mogoPoiResult) throws Exception {
|
||||
// 转成经纬度后,整理参数,进行接口请求
|
||||
Logger.d(TAG, "查询目标地址经纬度成功===" + Thread.currentThread().getName());
|
||||
MogoPoiItem poiItem = mogoPoiResult.getPois().get(0);
|
||||
Location location = new Location(poiItem.getPoint().lat, poiItem.getPoint().lon);
|
||||
callback.onLocatSuccess(location.getLat(), location.getLon());
|
||||
RoadInfoRequest request;
|
||||
if (voiceCmdData.getObj().equals(TYPE_NAME_BLOCK)) {
|
||||
// 拥堵和路况同时查
|
||||
request = new RoadInfoRequest(location, new String[]{TANLU_ROAD_CONGESTION_COMPAT, TANLU_ROAD_CURRENT}, false, false);
|
||||
}else{
|
||||
request = new RoadInfoRequest(location, new String[]{voiceCmdData.getType()}, false, false);
|
||||
}
|
||||
|
||||
Map<String, Object> params = new ParamsProvider.Builder(mContext)
|
||||
.append("sn", Utils.getSn())
|
||||
.append("data", GsonUtil.jsonFromObject(request))
|
||||
.build();
|
||||
return mShareApiService.queryRoadInfos(params);
|
||||
}
|
||||
}).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new SubscribeImpl<BaseDataCompat<RoadInfos>>(RequestOptions.create(mContext)) {
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
super.onError(e);
|
||||
callback.onQueryRoadInfoFail(e.getMessage(), -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(BaseDataCompat<RoadInfos> o) {
|
||||
super.onSuccess(o);
|
||||
Logger.d(TAG, "当前线程为"+Thread.currentThread().getName()+" 搜索目标地址路况信息成功: " + o);
|
||||
callback.onQueryRoadInfoSuccess(o.getResult().getData());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String message, int code) {
|
||||
super.onError(message, code);
|
||||
callback.onQueryRoadInfoFail(message, code);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.mogo.module.share.receiver
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.mogo.module.share.bean.VoiceCmdData
|
||||
import com.mogo.module.share.constant.ShareConstants.*
|
||||
import com.mogo.module.share.utils.Utils
|
||||
import com.mogo.utils.logger.Logger
|
||||
|
||||
class SearchTrafficInfoReceiver : BroadcastReceiver() {
|
||||
private val TAG = "SearchTrafficInfoReceiver"
|
||||
override fun onReceive(context: Context?, intent: Intent?) {
|
||||
// 目前只接com.zhidao.speech.awake.notify这一个广播,所以暂不区分action
|
||||
Logger.d(TAG,"收到搜索事件广播====")
|
||||
val data = intent?.getStringExtra("data") ?: ""
|
||||
var voiceData: VoiceCmdData? = null
|
||||
when (intent?.getStringExtra("command") ?: "") {
|
||||
VOICE_COMMAND_QUERY_TRAFFIC_CHECK -> {
|
||||
// 搜索交通检查
|
||||
voiceData = Utils.parseTOVoiceCmdData(data)
|
||||
voiceData.obj = TYPE_NAME_TRAFFIC_CHECK
|
||||
}
|
||||
VOICE_COMMAND_QUERY_ROAD_CLOSED -> {
|
||||
// 搜索封路
|
||||
Logger.d(TAG, "封路: $data")
|
||||
voiceData = Utils.parseTOVoiceCmdData(data)
|
||||
voiceData.location = voiceData.obj
|
||||
voiceData.obj = TYPE_NAME_CLOSURE
|
||||
}
|
||||
SPECIFIEDROAD_SEARCH->{
|
||||
// 拥堵和路况
|
||||
Logger.d(TAG,"拥堵和路况:$data")
|
||||
voiceData = Utils.parseTOVoiceCmdData(data)
|
||||
voiceData.obj = TYPE_NAME_BLOCK
|
||||
}
|
||||
// 其他道路事件
|
||||
VOICE_COMMAND_NOVELTY_QUERY -> voiceData = Utils.parseTOVoiceCmdData(data)
|
||||
else->{
|
||||
Logger.d(TAG, "未收录广播===${intent?.getStringExtra("command")}")
|
||||
}
|
||||
}
|
||||
|
||||
voiceData?.let {
|
||||
Logger.d(TAG, "准备开始网络请求,搜索附近道路事件: $it")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.mogo.module.share.utils;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.mogo.module.share.bean.VoiceCmdData;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description
|
||||
* @since 2020-01-08
|
||||
*/
|
||||
public class Utils {
|
||||
|
||||
//处理距离,大于1000时,四舍五入保留一位小数
|
||||
public static String handleDistance(double distance) {
|
||||
if (distance < 1000) {
|
||||
return distance + "M";
|
||||
} else {
|
||||
DecimalFormat df = new DecimalFormat("0.0");
|
||||
double transformDistance = distance / 1000;
|
||||
return (df.format(transformDistance)) + "KM";
|
||||
}
|
||||
}
|
||||
|
||||
//保留整数,四舍五入
|
||||
public static int getIntervalValue(int listSize){
|
||||
// var floatSize = listSize.toFloat();
|
||||
int transformSize = listSize / 15;
|
||||
DecimalFormat df = new DecimalFormat("0");
|
||||
return Integer.parseInt((df.format(transformSize)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析json串为 VoiceCmdData 对象
|
||||
*
|
||||
* @param dataJsonStr
|
||||
* @return
|
||||
*/
|
||||
public static VoiceCmdData parseTOVoiceCmdData(String dataJsonStr) {
|
||||
Gson gson = new Gson();
|
||||
return gson.fromJson(dataJsonStr, VoiceCmdData.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<dimen name="tanlu_module_map_left">400px</dimen>
|
||||
<dimen name="tanlu_module_map_top">150px</dimen>
|
||||
<dimen name="tanlu_module_map_right">80px</dimen>
|
||||
<dimen name="tanlu_module_map_bottom">32px</dimen>
|
||||
|
||||
|
||||
|
||||
</resources>
|
||||
@@ -21,6 +21,11 @@
|
||||
<dimen name="share_module_bottom_size">28px</dimen>
|
||||
<dimen name="share_module_btn_text_size">28px</dimen>
|
||||
|
||||
<dimen name="tanlu_module_map_left">750px</dimen>
|
||||
<dimen name="tanlu_module_map_top">270px</dimen>
|
||||
<dimen name="tanlu_module_map_right">120px</dimen>
|
||||
<dimen name="tanlu_module_map_bottom">60px</dimen>
|
||||
|
||||
</resources>
|
||||
|
||||
|
||||
|
||||
@@ -15,6 +15,11 @@
|
||||
<dimen name="share_module_drawable_padding">30px</dimen>
|
||||
<dimen name="share_module_btn_margin_left_right">116px</dimen>
|
||||
|
||||
<dimen name="tanlu_module_map_left">750px</dimen>
|
||||
<dimen name="tanlu_module_map_top">270px</dimen>
|
||||
<dimen name="tanlu_module_map_right">120px</dimen>
|
||||
<dimen name="tanlu_module_map_bottom">60px</dimen>
|
||||
|
||||
<!--字体-->
|
||||
<dimen name="share_module_title_content">40px</dimen>
|
||||
<dimen name="share_module_item">32px</dimen>
|
||||
|
||||
@@ -3,4 +3,5 @@
|
||||
<color name="module_share_dialog_icon_text_color">#fff</color>
|
||||
<color name="module_share_dialog_title_text_color">#fff</color>
|
||||
<color name="module_share_dialog_notice_text_color">#99FFFFFF</color>
|
||||
<color name="all_transparent_white">#00FFFFFF</color>
|
||||
</resources>
|
||||
|
||||
@@ -16,6 +16,11 @@
|
||||
<dimen name="share_module_drawable_padding">16.4px</dimen>
|
||||
<dimen name="share_module_btn_margin_left_right">63.4px</dimen>
|
||||
|
||||
<dimen name="tanlu_module_map_left">400px</dimen>
|
||||
<dimen name="tanlu_module_map_top">150px</dimen>
|
||||
<dimen name="tanlu_module_map_right">80px</dimen>
|
||||
<dimen name="tanlu_module_map_bottom">32px</dimen>
|
||||
|
||||
<!--字体-->
|
||||
<dimen name="share_module_title_content">22px</dimen>
|
||||
<dimen name="share_module_item">18px</dimen>
|
||||
|
||||
@@ -1,4 +1,24 @@
|
||||
<resources>
|
||||
<string name="app_name">share</string>
|
||||
<string name="text_searching_information">正在更新情报数据</string>
|
||||
<string name="first_week_tts_content">欢迎使用探路,您可以在探路内查看到周边的实时路况,也可以通过关键词“上报路况”来分享一段视频给其他车主</string>
|
||||
<string name="first_custom_send_content">您还可以试试语音上报</string>
|
||||
<string name="voice_get_informations_tts">为您找到%s条路况信息</string>
|
||||
<string name="tanlu_share_success">已分享成功,你分享的内容将帮助%s位车友</string>
|
||||
<string name="tanlu_share_failed">上传失败</string>
|
||||
<string name="tanlu_upload_roadcondition">上报路况</string>
|
||||
|
||||
<string name="tanlu_cancle_time">取消(%s)</string>
|
||||
<string name="tanlu_neterror_cancle_time">好的(%s)</string>
|
||||
|
||||
<array name="searching_voice_string_array">
|
||||
<item >正在为您搜索路况</item>
|
||||
<item >系统正在为您搜索</item>
|
||||
<item >小智这就去查</item>
|
||||
</array>
|
||||
<array name="search_fail_voice_array">
|
||||
<item>找不到相关地址,试试换个说法</item>
|
||||
<item>找不到地址,换个地址试试</item>
|
||||
</array>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -33,7 +33,6 @@ public class TanluConstants {
|
||||
public static final String TANLU_ROAD_CONGESTION_COMPAT = "10007"; //拥堵,适配语音不做数值转换
|
||||
public static final String TANLU_TRAFFIC_CHECK_COMPAT = "10002"; //交通检查,适配语音不做数值转换
|
||||
public static final String TANLU_ROAD_CLOSURE_COMPAT = "10003"; //封路,适配语音不做数值转换
|
||||
|
||||
public static final String TANLU_ROAD_CURRENT = "10015"; //实时路况
|
||||
|
||||
|
||||
|
||||
@@ -34,34 +34,34 @@ public class TanluCardViewProvider implements IMogoTanluUiProvider {
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
Logger.d(TAG, "init --------------> 1");
|
||||
TanluServiceManager.init( context );
|
||||
TanluServiceManager.getDataManager().registerDataListener( TanluConstants.MODEL_NAME, DataSetChangedAdapter.getInstance() );
|
||||
|
||||
tanluListWindow = new TanluListWindow(context);
|
||||
tanluListWindow.initWindow();
|
||||
// TanluServiceManager.init( context );
|
||||
// TanluServiceManager.getDataManager().registerDataListener( TanluConstants.MODEL_NAME, DataSetChangedAdapter.getInstance() );
|
||||
//
|
||||
// tanluListWindow = new TanluListWindow(context);
|
||||
// tanluListWindow.initWindow();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void searchRoadCondition(String intentStr, String data, String city, String keywords) {
|
||||
Disposable disposable = Single.create((SingleOnSubscribe<Intent>) emitter -> {
|
||||
Logger.d(TAG, "searchRoadCondition---> intentStr: " + intentStr + " data: " + data + " " +
|
||||
"city: " + city + " keywords: " + keywords);
|
||||
Intent intent = new Intent(intentStr);
|
||||
intent.putExtra("data", data);
|
||||
intent.putExtra("city", city);
|
||||
intent.putExtra("keywords", keywords);
|
||||
Thread.sleep(3000);
|
||||
emitter.onSuccess(intent);
|
||||
}).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(intent -> {
|
||||
Logger.d(TAG, "searchRoadCondition---go real share");
|
||||
tanluListWindow.realShare(intentStr, intent);
|
||||
});
|
||||
// Disposable disposable = Single.create((SingleOnSubscribe<Intent>) emitter -> {
|
||||
// Logger.d(TAG, "searchRoadCondition---> intentStr: " + intentStr + " data: " + data + " " +
|
||||
// "city: " + city + " keywords: " + keywords);
|
||||
// Intent intent = new Intent(intentStr);
|
||||
// intent.putExtra("data", data);
|
||||
// intent.putExtra("city", city);
|
||||
// intent.putExtra("keywords", keywords);
|
||||
// Thread.sleep(3000);
|
||||
// emitter.onSuccess(intent);
|
||||
// }).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(intent -> {
|
||||
// Logger.d(TAG, "searchRoadCondition---go real share");
|
||||
// tanluListWindow.realShare(intentStr, intent);
|
||||
// });
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shareSuccess(String poiType, MogoLatLng location) {
|
||||
MarkerInfo markerInfo = new MarkerInfo(poiType, "", location.lon, location.lat, true, "1");
|
||||
EventBus.getDefault().post(markerInfo);
|
||||
// MarkerInfo markerInfo = new MarkerInfo(poiType, "", location.lon, location.lat, true, "1");
|
||||
// EventBus.getDefault().post(markerInfo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.mogo.module.tanlu.constant.*
|
||||
import com.mogo.module.tanlu.constant.TanluConstants.SPECIFIEDROAD_SEARCH
|
||||
import com.mogo.module.tanlu.model.TanluModelData
|
||||
import com.mogo.module.tanlu.model.VoiceCmdData
|
||||
import com.mogo.module.tanlu.util.Utils
|
||||
import com.mogo.utils.logger.Logger
|
||||
|
||||