Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
136
app/build.gradle
136
app/build.gradle
@@ -2,11 +2,9 @@ apply plugin: 'com.android.application'
|
||||
apply plugin: 'com.alibaba.arouter'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
import java.text.SimpleDateFormat
|
||||
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||
// buildToolsVersion rootProject.ext.android.buildToolsVersion
|
||||
defaultConfig {
|
||||
minSdkVersion rootProject.ext.android.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.android.targetSdkVersion
|
||||
@@ -66,13 +64,13 @@ android {
|
||||
independent {
|
||||
manifest.srcFile 'src/independent/AndroidManifest.xml'
|
||||
}
|
||||
e8xx{
|
||||
e8xx {
|
||||
manifest.srcFile 'src/e8xx/AndroidManifest.xml'
|
||||
}
|
||||
em4 {
|
||||
manifest.srcFile 'src/em4/AndroidManifest.xml'
|
||||
}
|
||||
f8xxLauncherOnlineRelease{
|
||||
f8xxLauncherOnlineRelease {
|
||||
manifest.srcFile 'src/f8xxLauncherOnlineRelease/AndroidManifest.xml'
|
||||
}
|
||||
}
|
||||
@@ -81,7 +79,7 @@ android {
|
||||
|
||||
productFlavors {
|
||||
//独立app
|
||||
independent{
|
||||
independent {
|
||||
dimension "basic"
|
||||
// 是否启动位置服务
|
||||
buildConfigField 'boolean', 'LAUNCH_LOCATION_SERVICE', 'false'
|
||||
@@ -90,7 +88,7 @@ android {
|
||||
buildConfigField 'String', 'SOCKET_APP_ID', '\"com.mogo.launcher\"'
|
||||
}
|
||||
// launcher app
|
||||
launcher{
|
||||
launcher {
|
||||
dimension "basic"
|
||||
// 是否启动位置服务
|
||||
buildConfigField 'boolean', 'LAUNCH_LOCATION_SERVICE', 'true'
|
||||
@@ -99,11 +97,11 @@ android {
|
||||
buildConfigField 'String', 'SOCKET_APP_ID', '\"com.mogo.launcher\"'
|
||||
}
|
||||
// f系列-分体机全系列,未细分
|
||||
f8xx{
|
||||
f8xx {
|
||||
applicationId rootProject.ext.android.fLauncherApplicationId
|
||||
dimension "product"
|
||||
// 使用思必驰语音
|
||||
buildConfigField 'int', 'AIType','2'
|
||||
buildConfigField 'int', 'AIType', '2'
|
||||
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
|
||||
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
||||
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
||||
@@ -117,7 +115,7 @@ android {
|
||||
applicationId rootProject.ext.android.launcherApplicationId
|
||||
dimension "product"
|
||||
// 使用思必驰语音
|
||||
buildConfigField 'int', 'AIType','2'
|
||||
buildConfigField 'int', 'AIType', '2'
|
||||
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'true'
|
||||
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
||||
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
||||
@@ -131,7 +129,7 @@ android {
|
||||
applicationId rootProject.ext.android.launcherApplicationId
|
||||
dimension "product"
|
||||
// 使用思必驰语音
|
||||
buildConfigField 'int', 'AIType','2'
|
||||
buildConfigField 'int', 'AIType', '2'
|
||||
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'true'
|
||||
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
||||
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
||||
@@ -173,7 +171,7 @@ android {
|
||||
applicationId rootProject.ext.android.independentApplicationId
|
||||
dimension "product"
|
||||
// 使用同行者语音
|
||||
buildConfigField 'int', 'AIType','1'
|
||||
buildConfigField 'int', 'AIType', '1'
|
||||
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'true'
|
||||
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
||||
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
||||
@@ -183,11 +181,11 @@ android {
|
||||
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
|
||||
}
|
||||
// d系列 1+16 版本
|
||||
d82x{
|
||||
d82x {
|
||||
applicationId rootProject.ext.android.independentApplicationId
|
||||
dimension "product"
|
||||
// 使用同行者语音
|
||||
buildConfigField 'int', 'AIType','1'
|
||||
buildConfigField 'int', 'AIType', '1'
|
||||
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'true'
|
||||
// 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0
|
||||
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
|
||||
@@ -197,11 +195,11 @@ android {
|
||||
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
|
||||
}
|
||||
// 比亚迪
|
||||
bydauto{
|
||||
bydauto {
|
||||
applicationId rootProject.ext.android.bydautoIndependentApplicationId
|
||||
dimension "product"
|
||||
// 不使用语音
|
||||
buildConfigField 'int', 'AIType','0'
|
||||
buildConfigField 'int', 'AIType', '0'
|
||||
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
|
||||
// 车机类型,主要用于区分自研车机还是别人家的车机,其他车机,比亚迪定为1
|
||||
buildConfigField 'int', 'CAR_MACHINE_TYPE', '1'
|
||||
@@ -229,42 +227,6 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
def generateVersionCode() {
|
||||
String vn = rootProject.ext.android.versionName
|
||||
String[] versions = vn.split("\\.")
|
||||
if (versions.length == 3) {
|
||||
int num1 = Integer.valueOf(versions[0])
|
||||
int num2 = Integer.valueOf(versions[1])
|
||||
int num3 = Integer.valueOf(versions[2])
|
||||
if (num1 < 1 || num1 > 99){
|
||||
throw new GradleException("版本号必须定义为 x.y.z,x[1,99], y[0, 99], z[0, 99])")
|
||||
}
|
||||
if (num2 < 0 || num2 > 99){
|
||||
throw new GradleException("版本号必须定义为 x.y.z,x[1,99], y[0, 99], z[0, 99])")
|
||||
}
|
||||
if (num3 < 0 || num3 > 99){
|
||||
throw new GradleException("版本号必须定义为 x.y.z,x[1,99], y[0, 99], z[0, 99])")
|
||||
}
|
||||
StringBuilder builder = new StringBuilder()
|
||||
builder.append(num1)
|
||||
if( num2 > 9 ){
|
||||
builder.append(num2)
|
||||
} else {
|
||||
builder.append("0").append(num2)
|
||||
}
|
||||
if( num3 > 9 ){
|
||||
builder.append(num3)
|
||||
} else {
|
||||
builder.append("0").append(num3)
|
||||
}
|
||||
println("last versionCode ${builder}")
|
||||
return Integer.valueOf(builder.toString())
|
||||
} else {
|
||||
throw new GradleException("版本号必须定义为 x.y.z,x[1,99], y[0, 99], z[0, 99])")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
repositories {
|
||||
flatDir {
|
||||
dirs 'libs'
|
||||
@@ -304,9 +266,9 @@ dependencies {
|
||||
exclude group: 'com.mogo.module', module: 'module-share'
|
||||
}
|
||||
implementation rootProject.ext.dependencies.moduletanluapi
|
||||
|
||||
implementation rootProject.ext.dependencies.mogomonitor
|
||||
implementation rootProject.ext.dependencies.mogomodulewidgets
|
||||
implementation rootProject.ext.dependencies.mogomoduleback
|
||||
} else {
|
||||
launcherImplementation project(':main-extensions:mogo-module-main-launcher')
|
||||
independentImplementation project(':main-extensions:mogo-module-main-independent')
|
||||
@@ -324,6 +286,7 @@ dependencies {
|
||||
implementation project(':libraries:mogo-tanlu-api')
|
||||
implementation project(':modules:mogo-module-monitor')
|
||||
implementation project(':modules:mogo-module-widgets')
|
||||
implementation project(':modules:mogo-module-back')
|
||||
}
|
||||
|
||||
apply from: "./functions/baseservices.gradle"
|
||||
@@ -332,13 +295,6 @@ dependencies {
|
||||
apply from: "./functions/leftpanel.gradle"
|
||||
}
|
||||
|
||||
//android.applicationVariants.all { variant ->
|
||||
// variant.outputs.all { //这里修改apk文件名
|
||||
// outputFileName = "Launcher2.0_V${android.defaultConfig.versionName}_${getCurrentDate()}_${variant.name}_${getGitCommit()}.apk"
|
||||
// println outputFileName
|
||||
// }
|
||||
//}
|
||||
|
||||
android.applicationVariants.all { variant ->
|
||||
def buildTime = new Date().format("yyyyMMdd", TimeZone.getTimeZone("GMT+08:00"))
|
||||
def flavor = variant.productFlavors.collect { it.name }.join('-')
|
||||
@@ -354,64 +310,4 @@ android.applicationVariants.all { variant ->
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
def getMonthAndDay() {
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("MMddHH")
|
||||
return sdf.format(new Date())
|
||||
}
|
||||
|
||||
def getCurrentDate() {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss")
|
||||
return sdf.format(new Date())
|
||||
}
|
||||
|
||||
def getGitCommit() {
|
||||
def gitDir = new File("${new File("${rootDir}")}/.git")
|
||||
if (!gitDir.isDirectory()) {
|
||||
return 'non_git_build'
|
||||
}
|
||||
|
||||
def cmd = 'git log --pretty=format:%h -1'
|
||||
def gitCommit = cmd.execute().text.trim()
|
||||
|
||||
print gitCommit
|
||||
|
||||
def cmd2 = 'git status -s'
|
||||
def gitStatus = cmd2.execute().text.trim()
|
||||
|
||||
println '---------'
|
||||
|
||||
print gitStatus
|
||||
if (gitStatus != null && !gitStatus.isEmpty()) {
|
||||
return 'local-build'
|
||||
}
|
||||
|
||||
assert !gitCommit.isEmpty()
|
||||
gitCommit
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
|
||||
it.getTasks().iterator().forEachRemaining {
|
||||
def nameLowCase = it.name
|
||||
|
||||
if (nameLowCase.startsWith("assemble")
|
||||
&& nameLowCase.contains("Independent")
|
||||
&& (nameLowCase.endsWith("Debug") || nameLowCase.endsWith("Release"))) {
|
||||
it.group = "assembleIndependent"
|
||||
} else if (nameLowCase.startsWith("assemble")
|
||||
&& nameLowCase.contains("Launcher")
|
||||
&& (nameLowCase.endsWith("Debug") || nameLowCase.endsWith("Release"))) {
|
||||
it.group = "assembleLauncher"
|
||||
} else if (nameLowCase.startsWith("install")
|
||||
&& nameLowCase.contains("Independent")
|
||||
&& (nameLowCase.endsWith("Debug") || nameLowCase.endsWith("Release"))) {
|
||||
it.group = "installIndependent"
|
||||
} else if (nameLowCase.startsWith("install")
|
||||
&& nameLowCase.contains("Launcher")
|
||||
&& (nameLowCase.endsWith("Debug") || nameLowCase.endsWith("Release"))) {
|
||||
it.group = "installLauncher"
|
||||
}
|
||||
}
|
||||
}
|
||||
apply from: "./regroup.gradle"
|
||||
|
||||
45
app/regroup.gradle
Normal file
45
app/regroup.gradle
Normal file
@@ -0,0 +1,45 @@
|
||||
// 将 install 和 assemble 任务按功能分组
|
||||
|
||||
afterEvaluate {
|
||||
|
||||
def independent = ["em3", "em1", "d8xx", "d82x", "bydauto"]
|
||||
def launcher = ["f8xx", "em4"]
|
||||
|
||||
it.getTasks().iterator().forEachRemaining {
|
||||
def task = it
|
||||
def taskName = task.name
|
||||
if (taskName.startsWith("assemble")
|
||||
&& taskName.contains("Independent")
|
||||
&& (taskName.endsWith("Debug") || taskName.endsWith("Release"))) {
|
||||
independent.forEach {
|
||||
if( taskName.toLowerCase().contains(it) ){
|
||||
task.group = "assembleIndependent"
|
||||
}
|
||||
}
|
||||
} else if (taskName.startsWith("assemble")
|
||||
&& taskName.contains("Launcher")
|
||||
&& (taskName.endsWith("Debug") || taskName.endsWith("Release"))) {
|
||||
launcher.forEach {
|
||||
if( taskName.toLowerCase().contains(it) ){
|
||||
task.group = "assembleLauncher"
|
||||
}
|
||||
}
|
||||
} else if (taskName.startsWith("install")
|
||||
&& taskName.contains("Independent")
|
||||
&& (taskName.endsWith("Debug") || taskName.endsWith("Release"))) {
|
||||
independent.forEach {
|
||||
if( taskName.toLowerCase().contains(it) ){
|
||||
task.group = "installIndependent"
|
||||
}
|
||||
}
|
||||
} else if (taskName.startsWith("install")
|
||||
&& taskName.contains("Launcher")
|
||||
&& (taskName.endsWith("Debug") || taskName.endsWith("Release"))) {
|
||||
launcher.forEach {
|
||||
if( taskName.toLowerCase().contains(it) ){
|
||||
task.group = "installLauncher"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.network.Utils;
|
||||
import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant;
|
||||
import com.mogo.module.back.BackToLauncherConst;
|
||||
import com.mogo.module.carchatting.card.CallChatConstant;
|
||||
import com.mogo.module.common.MogoModule;
|
||||
import com.mogo.module.common.MogoModulePaths;
|
||||
@@ -57,8 +58,8 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
// MogoModulePaths.addModule(new MogoModule(PATH_GUIDE_FRAGMENT, PATH_GUIDE_MODULE_NAME));
|
||||
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_AGREEMENT, AuthorizeConstant.PATH_AGREEMENT_MODULE_NAME ) );
|
||||
|
||||
//运营位卡片,需要默认显示,放在第一个加载
|
||||
if ( DebugConfig.isLauncher() ) {
|
||||
MogoModulePaths.addModule( new MogoModule( BackToLauncherConst.MODULE_PATH, BackToLauncherConst.MODULE_NAME ) );
|
||||
MogoModulePaths.addModule( new MogoModule( MediaConstants.TAG, MediaConstants.MODULE_TYPE ) );
|
||||
} else {
|
||||
MogoModulePaths.addBaseModule( new MogoModule( MogoWidgetsProvider.PATH, MogoWidgetsProvider.NAME ) );
|
||||
|
||||
@@ -83,6 +83,10 @@ public abstract class MvpFragment<V extends IView, P extends Presenter<V>> exten
|
||||
@NonNull
|
||||
protected abstract P createPresenter();
|
||||
|
||||
public P getPresenter() {
|
||||
return mPresenter;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected <T extends View> T findViewById(int id) {
|
||||
if (mRootView == null) {
|
||||
|
||||
@@ -65,12 +65,13 @@ MOGO_BASE_SERVICES_SDK_VERSION = 1.2.1.22
|
||||
# 探路
|
||||
MOGO_MODULE_TANLU_VERSION=1.3.1.24
|
||||
# 车聊聊
|
||||
CARCHATTING_VERSION=1.4.9
|
||||
CARCHATTING_VERSION=1.5.1
|
||||
# 车聊聊接口
|
||||
CARCHATTINGPROVIDER_VERSION=1.3.4
|
||||
# 视频引导
|
||||
MOGO_MODULE_GUIDESHOW_VERSION=1.0.2-SNAPSHOT
|
||||
# 视频引导接口
|
||||
|
||||
MOGO_MODULE_GUIDESHOW_PROVIDER_VERSION=1.0.2-SNAPSHOT
|
||||
# 在线车辆F
|
||||
MOGO_MODULE_ONLINECAR_VERSION=1.0.3.2
|
||||
|
||||
@@ -50,23 +50,23 @@ const val TANLU_ROAD_CURRENT = "10015" //实时路况
|
||||
/**
|
||||
* 用户手点上报
|
||||
*/
|
||||
const val UPLOAD_FROM_USER = 1
|
||||
const val UPLOAD_FROM_USER = "1"
|
||||
/**
|
||||
* 用户语音上报
|
||||
*/
|
||||
const val UPLOAD_FROM_VOICE = 2
|
||||
const val UPLOAD_FROM_VOICE = "2"
|
||||
/**
|
||||
* 数据策略:拥堵自动上报
|
||||
*/
|
||||
const val UPLOAD_FROM_STRATEGY_BLOCK_AUTO = 3
|
||||
const val UPLOAD_FROM_STRATEGY_BLOCK_AUTO = "3"
|
||||
/**
|
||||
* 数据策略:已有事件云端校验
|
||||
*/
|
||||
const val UPLOAD_FROM_STRATEGY_CLOUD_CHECK = 4
|
||||
const val UPLOAD_FROM_STRATEGY_CLOUD_CHECK = "4"
|
||||
/**
|
||||
* 数据策略:交通事故上报
|
||||
*/
|
||||
const val UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO = 5
|
||||
const val UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO = "5"
|
||||
|
||||
/**
|
||||
* 默认视频抓取时长,单位是秒
|
||||
|
||||
@@ -20,5 +20,6 @@ data class InformationBody(
|
||||
val trafficInfoType:String, // 上报情报类型
|
||||
val isShare: Boolean, // 是否分享给附近车机
|
||||
val direction: Float,
|
||||
val poiType: String //类型分类
|
||||
val poiType: String, //类型分类
|
||||
val mainInfoId: Long //事件id
|
||||
)
|
||||
@@ -1,13 +1,11 @@
|
||||
package com.zhidao.roadcondition.service
|
||||
|
||||
import android.content.Intent
|
||||
import android.text.TextUtils
|
||||
import android.util.Log
|
||||
import com.hw.videoprocessor.VideoProcessor
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.utils.NetworkUtils
|
||||
import com.mogo.utils.TipToast
|
||||
import com.zhidao.auto.carcorder.callback.TakePhotoCallback
|
||||
import com.zhidao.auto.carcorder.callback.TakeVideoCallback
|
||||
import com.zhidao.auto.carcorder.controller.ZdCarCoderController
|
||||
@@ -34,6 +32,10 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
||||
val TAG: String = this.javaClass.simpleName
|
||||
var outputVideoPath: String = ""
|
||||
var mType: String = "" //1 上报拥堵, 2 封路和查车
|
||||
var mainInfoId: Long = 0
|
||||
var mFromType: String = ""
|
||||
private var mLongitude: Double = 0.0
|
||||
private var mLatitude: Double = 0.0
|
||||
|
||||
private var getVideoFailed: (() -> Unit)? = null
|
||||
private var interceptors: ArrayList<TakePhotoInterceptor> = ArrayList(1)
|
||||
@@ -56,24 +58,32 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
||||
|
||||
fun initCarCorderController() {
|
||||
zdCarCoderController =
|
||||
ZdCarCoderController.getInstance(AbsMogoApplication.getApp().applicationContext)
|
||||
ZdCarCoderController.getInstance(AbsMogoApplication.getApp().applicationContext)
|
||||
zdCarCoderController.addCallback(this)
|
||||
zdCarCoderController.addVideoCallback(this)
|
||||
zdCarCoderController.init()
|
||||
}
|
||||
|
||||
fun takePhoto(
|
||||
photoType: Int,
|
||||
cameraId: Int,
|
||||
haveVoice: Boolean,
|
||||
isCustom: Boolean = false,
|
||||
type: String
|
||||
photoType: Int,
|
||||
cameraId: Int,
|
||||
haveVoice: Boolean,
|
||||
isCustom: Boolean = false,
|
||||
type: String,
|
||||
mainInfoId: Long,
|
||||
fromType: String,
|
||||
longitude: Double,
|
||||
latitude: Double
|
||||
) {
|
||||
Log.d(TAG, "takePhoto ---------- type = $type" + " >>>mType =" + mType)
|
||||
Log.d(TAG, "takePhoto ---------- type = $type --- mType = $mType ---fromType = $fromType")
|
||||
this.mType = type
|
||||
this.mainInfoId = mainInfoId
|
||||
this.mFromType = fromType
|
||||
this.mLongitude = longitude
|
||||
this.mLatitude = latitude
|
||||
CustomStatusHandler.offerPhotoStatus(isCustom)
|
||||
zdCarCoderController.takePhoto(photoType, cameraId, haveVoice)
|
||||
trackGetPhoto(1)
|
||||
this.mType = type
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -81,15 +91,22 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
||||
* @param id: 标志是哪一个上传
|
||||
*/
|
||||
fun takeVideo(
|
||||
cameraId: Int,
|
||||
duration: Int,
|
||||
isCustom: Boolean = false,
|
||||
id: Long = 0L,
|
||||
type: String
|
||||
cameraId: Int,
|
||||
duration: Int,
|
||||
isCustom: Boolean = false,
|
||||
id: Long = 0L,
|
||||
type: String,
|
||||
mainInfoId: Long,
|
||||
fromType: String,
|
||||
longitude: Double,
|
||||
latitude: Double
|
||||
) {
|
||||
Log.d(TAG, "takeVideo -------- type = $type")
|
||||
Log.d(TAG, "takeVideo -------- isCustom = $isCustom")
|
||||
Log.d(TAG, "takeVideo -------- isCustom = $isCustom ---mFromType = $mFromType ---type = $type" )
|
||||
this.mType = type
|
||||
this.mainInfoId = mainInfoId
|
||||
this.mFromType = fromType
|
||||
this.mLongitude = longitude
|
||||
this.mLatitude = latitude
|
||||
if (DebugConfig.getCarMachineType() == 0) { //自研车机
|
||||
outputVideoPath = getCompressVideoPath()
|
||||
CustomStatusHandler.offerVideoStatus(TakeEntity(isCustom, id))
|
||||
@@ -100,27 +117,30 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
||||
// if (!NetworkUtils.isConnected(AbsMogoApplication.getApp().applicationContext)) {
|
||||
// TipToast.shortTip("分享失败,请检查网络")
|
||||
// } else {
|
||||
//失败了,传空地址,发起请求
|
||||
val entity = TakeEntity(isCustom, id)
|
||||
videoAndThumbMap["video"] = ""
|
||||
videoAndThumbMap["thumb"] = ""
|
||||
//失败了,传空地址,发起请求
|
||||
val entity = TakeEntity(isCustom, id)
|
||||
videoAndThumbMap["video"] = ""
|
||||
videoAndThumbMap["thumb"] = ""
|
||||
|
||||
CosStatusController().sendInformationDirectly(
|
||||
CosStatusController().sendInformationDirectly(
|
||||
INFO_TYPE_VIDEO,
|
||||
videoAndThumbMap,
|
||||
mType,
|
||||
entity
|
||||
)
|
||||
entity,
|
||||
mainInfoId,
|
||||
mLongitude,
|
||||
mLatitude
|
||||
)
|
||||
|
||||
//地图上打点
|
||||
taskAsync(3_000) {
|
||||
try {
|
||||
LatLngStickyEventBus.getInstance()
|
||||
//地图上打点
|
||||
taskAsync(3_000) {
|
||||
try {
|
||||
LatLngStickyEventBus.getInstance()
|
||||
.postSticky(GetImageSuccessEvent("", mType))
|
||||
} catch (e: java.lang.Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
} catch (e: java.lang.Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
@@ -138,18 +158,17 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
||||
}
|
||||
val isCustom = CustomStatusHandler.pollPhotoStatus()
|
||||
val entity = TakeEntity(isCustom, 0L)
|
||||
Log.e(TAG, "onTakePhotoFail -----mType = $mType ")
|
||||
Log.e(TAG, "onTakePhotoFail -----isCustom = $isCustom ")
|
||||
Log.e(TAG, "onTakePhotoFail -----mType = $mType --- isCustom = $isCustom")
|
||||
//语音播报 1:上报路况,2:交通检查,3:封路 默认 mType 应该为null
|
||||
if (mType.equals(TANLU_ROAD_CONGESTION) || mType.equals(TANLU_TRAFFIC_CHECK) || mType.equals(
|
||||
TANLU_ROAD_CLOSURE
|
||||
)
|
||||
|| mType.equals(TANLU_ROAD_CURRENT) || mType.equals(TANLU_ROAD_PONDING) || mType.equals(
|
||||
TANLU_ROAD_ICING
|
||||
)
|
||||
|| mType.equals(TANLU_ROAD_HEAVY_FOG) || mType.equals(TANLU_ROAD_ACCIDENT) || mType.equals(
|
||||
TANLU_ROAD_WORK
|
||||
)
|
||||
TANLU_ROAD_CLOSURE
|
||||
)
|
||||
|| mType.equals(TANLU_ROAD_CURRENT) || mType.equals(TANLU_ROAD_PONDING) || mType.equals(
|
||||
TANLU_ROAD_ICING
|
||||
)
|
||||
|| mType.equals(TANLU_ROAD_HEAVY_FOG) || mType.equals(TANLU_ROAD_ACCIDENT) || mType.equals(
|
||||
TANLU_ROAD_WORK
|
||||
)
|
||||
) {
|
||||
taskAsync(1_500) {
|
||||
try {
|
||||
@@ -165,28 +184,22 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
||||
//获取图片失败也上报,图片不打点
|
||||
if (isCustom) {
|
||||
CosStatusController().sendInformationDirectly(
|
||||
INFO_TYPE_IMG,
|
||||
mutableMapOf("pic" to "" as String),
|
||||
mType,
|
||||
entity
|
||||
INFO_TYPE_IMG,
|
||||
mutableMapOf("pic" to "" as String),
|
||||
mType,
|
||||
entity,
|
||||
mainInfoId,
|
||||
mLongitude,
|
||||
mLatitude
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun sendGetInfoFailedReceiver(type: String) {
|
||||
Log.e(TAG, "sendGetInfoFailedReceiver ------>")
|
||||
var intent = Intent()
|
||||
intent.action = "com.zhidao.roadcondition.getinfo.failed"
|
||||
intent.putExtra("type", type)
|
||||
AbsMogoApplication.getApp().applicationContext.sendBroadcast(intent)
|
||||
}
|
||||
|
||||
|
||||
//拍照成功回调返回图片本地路径
|
||||
override fun onTakePhotoSuccess(photoType: Int, camera: Int, photoPath: String?) {
|
||||
trackGetPhoto(2)
|
||||
Log.d(TAG, "onTakePhotoSuccess -----mType = $mType")
|
||||
Log.d(TAG, "onTakePhotoSuccess -----mType = $mType --- mainInfoId = $mainInfoId")
|
||||
val isCustom = CustomStatusHandler.pollPhotoStatus()
|
||||
val entity = TakeEntity(isCustom, 0L)
|
||||
|
||||
@@ -204,35 +217,40 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
||||
}
|
||||
|
||||
var minSpeedPic =
|
||||
getStrategyMinSpeed(
|
||||
AbsMogoApplication.getApp().applicationContext,
|
||||
"pic",
|
||||
getStrategyType("pic")
|
||||
)
|
||||
getStrategyMinSpeed(
|
||||
AbsMogoApplication.getApp().applicationContext,
|
||||
"pic",
|
||||
getStrategyType("pic")
|
||||
)
|
||||
var maxSpeedPic =
|
||||
getStrategyMaxSpeed(
|
||||
AbsMogoApplication.getApp().applicationContext,
|
||||
"pic",
|
||||
getStrategyType("pic")
|
||||
)
|
||||
getStrategyMaxSpeed(
|
||||
AbsMogoApplication.getApp().applicationContext,
|
||||
"pic",
|
||||
getStrategyType("pic")
|
||||
)
|
||||
var speed = LocationUtil.getInstance().getSpeed()
|
||||
|
||||
if (!TextUtils.isEmpty(mType)) {
|
||||
Log.d(TAG, "onTakePhotoSuccess mType != null")
|
||||
CosStatusController().uploadFile(mutableListOf(photoPath as String), entity, mType)
|
||||
CosStatusController().uploadFile(mutableListOf(photoPath as String), entity, mType, mainInfoId, mFromType, mLongitude,
|
||||
mLatitude)
|
||||
} else {
|
||||
Log.d(TAG, "onTakePhotoSuccess mType == null")
|
||||
Log.d(
|
||||
TAG,
|
||||
"onTakePhotoSuccess maxSpeedPic = $maxSpeedPic ---> speed = $speed ---->minSpeedPic= $minSpeedPic"
|
||||
TAG,
|
||||
"onTakePhotoSuccess maxSpeedPic = $maxSpeedPic ---> speed = $speed ---->minSpeedPic= $minSpeedPic"
|
||||
)
|
||||
if (maxSpeedPic == -1) {
|
||||
if (speed >= (Math.abs(minSpeedPic) / 3.6f)) {
|
||||
Log.d(TAG, "onTakePhotoSuccess abs =" + (Math.abs(minSpeedPic) / 3.6f))
|
||||
CosStatusController().uploadFile(
|
||||
mutableListOf(photoPath as String),
|
||||
entity,
|
||||
mType
|
||||
mutableListOf(photoPath as String),
|
||||
entity,
|
||||
mType,
|
||||
mainInfoId,
|
||||
mFromType,
|
||||
mLongitude,
|
||||
mLatitude
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -241,9 +259,13 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
||||
Log.d(TAG, "onTakePhotoSuccess minSpeedPic > 0 -- speed = $speed")
|
||||
if ((speed >= (minSpeedPic / 3.6f)) && speed <= (maxSpeedPic / 3.6f)) {
|
||||
CosStatusController().uploadFile(
|
||||
mutableListOf(photoPath as String),
|
||||
entity,
|
||||
mType
|
||||
mutableListOf(photoPath as String),
|
||||
entity,
|
||||
mType,
|
||||
mainInfoId,
|
||||
mFromType,
|
||||
mLongitude,
|
||||
mLatitude
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -253,11 +275,11 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
||||
//获取视频成功
|
||||
override fun onTakeVideoSuccess(camera: Int, videoPath: String?) {
|
||||
var thumbnailPath =
|
||||
AbsMogoApplication.getApp().applicationContext.filesDir.parent + File.separator + "Thumbnail${System.currentTimeMillis()}.jpg"
|
||||
AbsMogoApplication.getApp().applicationContext.filesDir.parent + File.separator + "Thumbnail${System.currentTimeMillis()}.jpg"
|
||||
var isSuccess = getVideoThumbnail(videoPath!!, thumbnailPath)
|
||||
Log.d(
|
||||
TAG,
|
||||
"getVideo onTakeVideoSuccess===$videoPath -----> isSuccess= $isSuccess ----> mType = $mType "
|
||||
TAG,
|
||||
"getVideo onTakeVideoSuccess===$videoPath -----> isSuccess= $isSuccess ----> mType = $mType --- mainInfoId = $mainInfoId"
|
||||
)
|
||||
|
||||
val entity = CustomStatusHandler.pollVideoStatus()
|
||||
@@ -267,12 +289,12 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
||||
|
||||
if (isSuccess) {
|
||||
var minSpeedVideo = getStrategyMinSpeed(
|
||||
AbsMogoApplication.getApp().applicationContext, "video",
|
||||
getStrategyType("video")
|
||||
AbsMogoApplication.getApp().applicationContext, "video",
|
||||
getStrategyType("video")
|
||||
)
|
||||
var maxSpeedVideo = getStrategyMaxSpeed(
|
||||
AbsMogoApplication.getApp().applicationContext, "video",
|
||||
getStrategyType("video")
|
||||
AbsMogoApplication.getApp().applicationContext, "video",
|
||||
getStrategyType("video")
|
||||
)
|
||||
var speed = LocationUtil.getInstance().getSpeed()
|
||||
//TODO
|
||||
@@ -286,8 +308,8 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
||||
compressVideo(videoPath, thumbnailPath, entity)
|
||||
} else {
|
||||
Log.d(
|
||||
TAG,
|
||||
"onTakeVideoSuccess maxSpeedVideo = $maxSpeedVideo --->speed= $speed + minSpeedVideo = $minSpeedVideo"
|
||||
TAG,
|
||||
"onTakeVideoSuccess maxSpeedVideo = $maxSpeedVideo --->speed= $speed + minSpeedVideo = $minSpeedVideo"
|
||||
)
|
||||
if (maxSpeedVideo == -1) {
|
||||
Log.d(TAG, "onTakeVideoSuccess 111 abs =" + (Math.abs(minSpeedVideo) / 3.6f))
|
||||
@@ -328,10 +350,13 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
||||
videoAndThumbMap["thumb"] = ""
|
||||
|
||||
CosStatusController().sendInformationDirectly(
|
||||
INFO_TYPE_VIDEO,
|
||||
videoAndThumbMap,
|
||||
mType,
|
||||
entity
|
||||
INFO_TYPE_VIDEO,
|
||||
videoAndThumbMap,
|
||||
mType,
|
||||
entity,
|
||||
mainInfoId,
|
||||
mLongitude,
|
||||
mLatitude
|
||||
)
|
||||
|
||||
//地图上打点
|
||||
@@ -349,26 +374,30 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
||||
*/
|
||||
fun compressVideo(videoPath: String, thumbnailPath: String, entity: TakeEntity) {
|
||||
Log.d(
|
||||
TAG,
|
||||
"outputVideoPath = " + outputVideoPath + ">> videoPath=" + videoPath + " isCustom = ${entity?.isCustom}"
|
||||
TAG,
|
||||
"outputVideoPath = " + outputVideoPath + ">> videoPath=" + videoPath + " isCustom = ${entity?.isCustom}"
|
||||
)
|
||||
var startTime = System.currentTimeMillis()
|
||||
Thread(Runnable {
|
||||
try {
|
||||
VideoProcessor.processor(AbsMogoApplication.getApp().applicationContext)
|
||||
.input(videoPath)
|
||||
.output(outputVideoPath)
|
||||
.removeAudio(true)
|
||||
.outWidth(1920)
|
||||
.outHeight(1080)
|
||||
.bitrate(2000 * 1024)
|
||||
.frameRate(25)
|
||||
.process()
|
||||
.input(videoPath)
|
||||
.output(outputVideoPath)
|
||||
.removeAudio(true)
|
||||
.outWidth(1920)
|
||||
.outHeight(1080)
|
||||
.bitrate(2000 * 1024)
|
||||
.frameRate(25)
|
||||
.process()
|
||||
Log.d(TAG, "compress cost time =" + (System.currentTimeMillis() - startTime))
|
||||
CosStatusController().uploadFile(
|
||||
mutableListOf(outputVideoPath, thumbnailPath),
|
||||
entity,
|
||||
mType
|
||||
mutableListOf(outputVideoPath, thumbnailPath),
|
||||
entity,
|
||||
mType,
|
||||
mainInfoId,
|
||||
mFromType,
|
||||
mLongitude,
|
||||
mLatitude
|
||||
)
|
||||
//删除压缩前的视频
|
||||
deletePicFile(videoPath)
|
||||
@@ -392,16 +421,16 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
||||
//获取图片
|
||||
private fun trackGetPhoto(type: Int) {
|
||||
trackNormalEvent(
|
||||
CarNet_Get_Picture, mutableMapOf("type" to type),
|
||||
AbsMogoApplication.getApp().applicationContext
|
||||
CarNet_Get_Picture, mutableMapOf("type" to type),
|
||||
AbsMogoApplication.getApp().applicationContext
|
||||
)
|
||||
}
|
||||
|
||||
//获取视频
|
||||
private fun trackGetVideo(type: Int) {
|
||||
trackNormalEvent(
|
||||
CarNet_Get_Video, mutableMapOf("type" to type),
|
||||
AbsMogoApplication.getApp().applicationContext
|
||||
CarNet_Get_Video, mutableMapOf("type" to type),
|
||||
AbsMogoApplication.getApp().applicationContext
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,6 @@ object CosCallbackMapController : CosStatusCallback {
|
||||
path?.let {
|
||||
map.remove(path)
|
||||
}
|
||||
Log.d(TAG, "size: ${map.size}")
|
||||
}
|
||||
|
||||
fun unregisterCallbacks(paths: Map<String, String>?) {
|
||||
|
||||
@@ -36,22 +36,31 @@ class CosStatusController : CosStatusCallback {
|
||||
private lateinit var entity: TakeEntity
|
||||
|
||||
private var mType: String = ""
|
||||
private var mainInfoId: Long = 0
|
||||
private var mFromType: String = ""
|
||||
private var mLongitude: Double = 0.0
|
||||
private var mLatitude: Double = 0.0
|
||||
|
||||
//上传文件
|
||||
fun uploadFile(picPath: MutableList<String>, entity: TakeEntity, type: String) {
|
||||
fun uploadFile(picPath: MutableList<String>, entity: TakeEntity, type: String, mainInfoId: Long,
|
||||
fromType: String, longitude: Double, latitude: Double) {
|
||||
CosCallbackMapController.registerCallback(picPath, this)
|
||||
// CosLogger.setLogStatus(true)
|
||||
|
||||
this.entity = entity
|
||||
this.mType = type
|
||||
Log.d(TAG, "uploadFile type===$type ---- picPath = $picPath ")
|
||||
this.mainInfoId = mainInfoId
|
||||
this.mFromType = fromType
|
||||
this.mLongitude = longitude
|
||||
this.mLatitude = latitude
|
||||
Log.d(TAG, "uploadFile type===$type ---- mainInfoId =$mainInfoId ----mFromType = $mFromType ---- picPath = $picPath ")
|
||||
trackUploadCos(3)
|
||||
if (picPath.contains("backPic")) return
|
||||
//参数说明: paths:本地文件路径;(注:上传的本地路径不要重复);config:文件上传的优先级
|
||||
mPicEventId =
|
||||
CosUploadManagerImpl.getInstance(AbsMogoApplication.getApp().applicationContext).eventId
|
||||
CosUploadManagerImpl.getInstance(AbsMogoApplication.getApp().applicationContext).eventId
|
||||
CosUploadManagerImpl.getInstance(AbsMogoApplication.getApp().applicationContext)
|
||||
.upload(picPath, mPicEventId, DbPriorityConfig.PRIORITY_HIGH)
|
||||
.upload(picPath, mPicEventId, DbPriorityConfig.PRIORITY_HIGH)
|
||||
}
|
||||
|
||||
|
||||
@@ -68,22 +77,21 @@ class CosStatusController : CosStatusCallback {
|
||||
|
||||
override fun uploadCosFailed(cosPath: String?, eventId: String?, localPath: String?) {
|
||||
Log.d(TAG, "uploadCosFailed = $localPath")
|
||||
Log.d(TAG, "uploadCosFailed CarCorderController.mType = " + CarCorderController.mType)
|
||||
trackUploadCos(2)
|
||||
//语音播报 1:上报路况,2:交通检查,3:封路 默认 mType 应该为null
|
||||
if (CarCorderController.mType.equals(TANLU_ROAD_CONGESTION) || CarCorderController.mType.equals(
|
||||
TANLU_TRAFFIC_CHECK
|
||||
) || CarCorderController.mType.equals(TANLU_ROAD_CLOSURE)
|
||||
|| CarCorderController.mType.equals(TANLU_ROAD_CURRENT) || CarCorderController.mType.equals(
|
||||
TANLU_ROAD_PONDING
|
||||
) || CarCorderController.mType.equals(TANLU_ROAD_ICING)
|
||||
|| CarCorderController.mType.equals(TANLU_ROAD_HEAVY_FOG) || CarCorderController.mType.equals(
|
||||
TANLU_ROAD_ACCIDENT
|
||||
) || CarCorderController.mType.equals(TANLU_ROAD_WORK)
|
||||
TANLU_TRAFFIC_CHECK
|
||||
) || CarCorderController.mType.equals(TANLU_ROAD_CLOSURE)
|
||||
|| CarCorderController.mType.equals(TANLU_ROAD_CURRENT) || CarCorderController.mType.equals(
|
||||
TANLU_ROAD_PONDING
|
||||
) || CarCorderController.mType.equals(TANLU_ROAD_ICING)
|
||||
|| CarCorderController.mType.equals(TANLU_ROAD_HEAVY_FOG) || CarCorderController.mType.equals(
|
||||
TANLU_ROAD_ACCIDENT
|
||||
) || CarCorderController.mType.equals(TANLU_ROAD_WORK)
|
||||
) {
|
||||
// VoiceController.speakVoice("cos上报失败")
|
||||
Log.d(TAG, "uploadCosFailed mType = $mType")
|
||||
if (entity?.isCustom) {
|
||||
if (entity?.isCustom && mFromType != UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO) {
|
||||
sendGetInfoFailedReceiver("100")
|
||||
}
|
||||
}
|
||||
@@ -108,10 +116,10 @@ class CosStatusController : CosStatusCallback {
|
||||
}
|
||||
|
||||
override fun uploadCosCompleted(
|
||||
cosPath: String?,
|
||||
eventId: String?,
|
||||
downloadUrl: String?,
|
||||
localPath: String?
|
||||
cosPath: String?,
|
||||
eventId: String?,
|
||||
downloadUrl: String?,
|
||||
localPath: String?
|
||||
) {
|
||||
Log.d(TAG, "uploadFile mType= $mType")
|
||||
Log.d(TAG, "uploadCosCompleted localPath = $localPath")
|
||||
@@ -130,22 +138,21 @@ class CosStatusController : CosStatusCallback {
|
||||
Log.d(TAG, "videoAndThumbMap ${videoAndThumbMap}")
|
||||
if (videoAndThumbMap.size == 2) {
|
||||
Log.d(TAG, "videoAndThumbMap.size == 2 ")
|
||||
|
||||
var locationInfo = LocationUtil.getInstance().getLocationInfo()
|
||||
val locationStr: String = Gson().toJson(locationInfo)
|
||||
Log.d(TAG, "locationStr = " + locationStr)
|
||||
//如果失败,需要提示失败弹框
|
||||
if (locationInfo.address.isNullOrEmpty() || locationInfo.cityName.isNullOrEmpty() || locationInfo.cityCode.isNullOrEmpty()
|
||||
|| locationInfo.latitude == 0.0 || locationInfo.areaName.isNullOrEmpty() || locationInfo.street.isNullOrEmpty()
|
||||
|| locationInfo.areaCode.isNullOrEmpty() || locationInfo.provinceName.isNullOrEmpty()
|
||||
|| locationInfo.latitude == 0.0 || locationInfo.areaName.isNullOrEmpty() || locationInfo.street.isNullOrEmpty()
|
||||
|| locationInfo.areaCode.isNullOrEmpty() || locationInfo.provinceName.isNullOrEmpty()
|
||||
) {
|
||||
if (entity?.isCustom) {
|
||||
if (entity?.isCustom && mFromType != UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO) {
|
||||
sendGetInfoFailedReceiver("100")
|
||||
}
|
||||
} else {
|
||||
//分享成功,并打点,如果是上报拥堵,需要takeVideo
|
||||
LatLngStickyEventBus.getInstance()
|
||||
.postSticky(GetImageSuccessEvent(downloadUrl, mType))
|
||||
.postSticky(GetImageSuccessEvent(downloadUrl, mType))
|
||||
//上传录像以及缩略图成功
|
||||
sendInformation(INFO_TYPE_VIDEO, videoAndThumbMap)
|
||||
}
|
||||
@@ -155,10 +162,13 @@ class CosStatusController : CosStatusCallback {
|
||||
Log.d(TAG, "uploadCosCompleted 分享成功 ----mType = $mType")
|
||||
// if (mType.equals("1") || mType.equals("-1")) {
|
||||
sendInformationDirectly(
|
||||
INFO_TYPE_IMG,
|
||||
mutableMapOf("pic" to downloadUrl as String),
|
||||
mType,
|
||||
entity
|
||||
INFO_TYPE_IMG,
|
||||
mutableMapOf("pic" to downloadUrl as String),
|
||||
mType,
|
||||
entity,
|
||||
mainInfoId,
|
||||
mLongitude,
|
||||
mLatitude
|
||||
)
|
||||
// }
|
||||
}
|
||||
@@ -174,7 +184,7 @@ class CosStatusController : CosStatusCallback {
|
||||
// CosCallbackMapController.mainService?.sendCustomResult(it)
|
||||
// }
|
||||
// } else {
|
||||
sendInformationDirectly(type, map, mType, entity)
|
||||
sendInformationDirectly(type, map, mType, entity, mainInfoId, mLongitude, mLatitude)
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -182,18 +192,24 @@ class CosStatusController : CosStatusCallback {
|
||||
* 被动上报时直接上报,不用等待、选择情报类型
|
||||
*/
|
||||
fun sendInformationDirectly(
|
||||
type: Int,
|
||||
map: Map<String, String>,
|
||||
poiType: String,
|
||||
entity: TakeEntity
|
||||
type: Int,
|
||||
map: Map<String, String>,
|
||||
poiType: String,
|
||||
entity: TakeEntity,
|
||||
mainInfoId: Long,
|
||||
longitude: Double,
|
||||
latitude: Double
|
||||
) {
|
||||
Log.d(TAG, "sendInformationDirectly isCustomSend = ${entity?.isCustom}")
|
||||
Log.d(TAG, "sendInformationDirectly poiType= $poiType")
|
||||
Log.d(TAG, "sendInformationDirectly poiType= $poiType ---- mainInfoId= $mainInfoId")
|
||||
mainServiceHttpModel.sendInformationMessage(
|
||||
type = type,
|
||||
url = map,
|
||||
isCustom = entity?.isCustom,
|
||||
poiType = poiType
|
||||
type = type,
|
||||
url = map,
|
||||
isCustom = entity?.isCustom,
|
||||
poiType = poiType,
|
||||
mainInfoId = mainInfoId,
|
||||
longitude = longitude,
|
||||
latitude = latitude
|
||||
) { success ->
|
||||
CosCallbackMapController.unregisterCallbacks(map)
|
||||
CosCallbackMapController.mainService?.let {
|
||||
@@ -208,8 +224,8 @@ class CosStatusController : CosStatusCallback {
|
||||
//上传COS
|
||||
private fun trackUploadCos(type: Int) {
|
||||
trackNormalEvent(
|
||||
CarNet_Cos_Upload, mutableMapOf("type" to type),
|
||||
AbsMogoApplication.getApp().applicationContext
|
||||
CarNet_Cos_Upload, mutableMapOf("type" to type),
|
||||
AbsMogoApplication.getApp().applicationContext
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,9 @@ class MainService : Service() {
|
||||
var isCustom: Boolean = false
|
||||
|
||||
var params: UploadParams? = null
|
||||
|
||||
var mainInfoId: Long = 0
|
||||
private var mLongitude: Double = 0.0
|
||||
private var mLatitude: Double = 0.0
|
||||
|
||||
//发送主动上报结果广播给外部
|
||||
fun sendCustomResult(result: Boolean) {
|
||||
@@ -73,12 +75,9 @@ class MainService : Service() {
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
Log.d(TAG, "onStartCommand -----------> ")
|
||||
//清理多媒体资源和sp策略数据
|
||||
// DelayService.launchService(this)
|
||||
clearStrategyType(this)
|
||||
//初始化埋点
|
||||
Analytics.getInstance().start(this)
|
||||
//初始化定位
|
||||
// LocationUtil.getInstance().initLocation()
|
||||
//参数说明:appKey: app唯一标识(比如:包名)
|
||||
CosUploadManagerImpl.getInstance(AbsMogoApplication.getApp().applicationContext)
|
||||
.init(BuildConfig.APPLICATION_ID, 2)
|
||||
@@ -90,13 +89,15 @@ class MainService : Service() {
|
||||
params?.let {
|
||||
shareType = it.eventType
|
||||
fromType = it.fromType
|
||||
mainInfoId = 0 //TODO
|
||||
|
||||
Log.d(TAG, "onStartCommand shareType = $shareType")
|
||||
if (shareType == TANLU_ROAD_CONGESTION || shareType == TANLU_TRAFFIC_CHECK || shareType == TANLU_ROAD_CLOSURE || shareType == TANLU_ROAD_CURRENT
|
||||
|| shareType == TANLU_ROAD_PONDING || shareType == TANLU_ROAD_ICING || shareType == TANLU_ROAD_HEAVY_FOG
|
||||
|| shareType == TANLU_ROAD_ACCIDENT || shareType == TANLU_ROAD_WORK
|
||||
) {
|
||||
// takePhoto(1, false, true)
|
||||
if (!fromType.equals("5")) { // 是策略触发,不提示
|
||||
if (fromType != UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO) { // 是策略触发,不提示
|
||||
takeVideo(it.duration, isCustom = true, id = id)
|
||||
} else {
|
||||
takeVideo(it.duration)
|
||||
@@ -124,12 +125,6 @@ class MainService : Service() {
|
||||
var duration = p1.getIntExtra("duration", 3)
|
||||
takeVideo(duration, true)
|
||||
}
|
||||
} else if (p1.action == "com.zhidao.takevideo.test") {
|
||||
//视频
|
||||
takeVideo(p1.getIntExtra("duration", 10))
|
||||
} else if (p1.action == "com.zhidao.takepic.test") {
|
||||
//视频
|
||||
takePhoto(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -139,19 +134,11 @@ class MainService : Service() {
|
||||
override fun onReceive(p0: Context?, p1: Intent) {
|
||||
val id = p1.getLongExtra("id", 0L)
|
||||
if (p1.action == sendInformationAction) {
|
||||
takeVideo(10, isCustom = true, id = id)
|
||||
takeVideo(DEFAULT_VIDEO_DURATION, isCustom = true, id = id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送获取图片
|
||||
*/
|
||||
fun startUploadInformation() {
|
||||
var customIntent = Intent(sendInformationAction)
|
||||
sendBroadcast(customIntent)
|
||||
}
|
||||
|
||||
override fun onBind(intent: Intent?): IBinder? {
|
||||
return null
|
||||
}
|
||||
@@ -159,7 +146,6 @@ class MainService : Service() {
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
Log.d(TAG, "onCreate ------> 1")
|
||||
init()
|
||||
//初始化定位
|
||||
LocationUtil.getInstance().initLocation()
|
||||
@@ -198,7 +184,7 @@ class MainService : Service() {
|
||||
@Subscribe(threadMode = ThreadMode.MAIN, sticky = true, priority = 98)
|
||||
fun getImageEvent(getImageSuccessEvent: GetImageSuccessEvent) {
|
||||
var info = LocationUtil.getInstance().getLocationInfo()
|
||||
Log.e("MainService", "getImageEvent long = ${info.longitude} ----> lat= ${info.latitude}")
|
||||
Log.d("MainService", "getImageEvent long = ${info.longitude} ----> lat= ${info.latitude}")
|
||||
Log.d(
|
||||
"MainService",
|
||||
"getImageEvent url = " + getImageSuccessEvent.getImageUrl() + ">>>>type =" + getImageSuccessEvent.getType()
|
||||
@@ -267,7 +253,7 @@ class MainService : Service() {
|
||||
}
|
||||
|
||||
if (videoType == 1) {
|
||||
takeVideo(10)
|
||||
takeVideo(DEFAULT_VIDEO_DURATION)
|
||||
} else if (videoType == 2) {
|
||||
postVideoAlarmTask(true)
|
||||
}
|
||||
@@ -295,7 +281,7 @@ class MainService : Service() {
|
||||
Observable.intervalRange(0, 1, 0, 2_000, TimeUnit.MILLISECONDS)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(Consumer {
|
||||
CarCorderController.takePhoto(1, 1, false, isCustom, TANLU_ROAD_CURRENT)
|
||||
CarCorderController.takePhoto(1, 1, false, isCustom, TANLU_ROAD_CURRENT, mainInfoId, fromType, mLongitude, mLatitude)
|
||||
})
|
||||
// }
|
||||
|
||||
@@ -314,7 +300,7 @@ class MainService : Service() {
|
||||
Log.d("MainService", "takeVideo --------1---->")
|
||||
// if (isAuthorization(BaseApplication.getAppContext())) {
|
||||
// log(TAG, "takeVideo --------2---->")
|
||||
CarCorderController.takeVideo(1, duration, isCustom, id, if (isCustom) shareType else TANLU_ROAD_CURRENT)
|
||||
CarCorderController.takeVideo(1, duration, isCustom, id, if (isCustom) shareType else TANLU_ROAD_CURRENT, mainInfoId, fromType, mLongitude, mLatitude)
|
||||
// }
|
||||
postVideoAlarmTask(isInterval)
|
||||
|
||||
|
||||
@@ -226,16 +226,19 @@ class MainServiceController {
|
||||
trafficInfoType:String = "",
|
||||
isShare:Boolean = false,
|
||||
poiType:String,
|
||||
mainInfoId:Long,
|
||||
longitude: Double,
|
||||
latitude: Double,
|
||||
customSend: ((Boolean) -> Unit)? = null
|
||||
) {
|
||||
Log.d(TAG, " sendInformationMessage poiType = $poiType");
|
||||
//删除测试数据
|
||||
var locationInfo = LocationUtil.getInstance().getLocationInfo();
|
||||
if (locationInfo.address.isNullOrEmpty()) {
|
||||
geoLocation(type, url, locationInfo, isCustom,trafficInfoType, isShare, customSend,poiType)
|
||||
geoLocation(type, url, locationInfo, isCustom,trafficInfoType, isShare, customSend,poiType,mainInfoId,longitude,latitude)
|
||||
} else {
|
||||
postInformationMessage(
|
||||
getInformationBody(type, url, locationInfo, isCustom, trafficInfoType, isShare,poiType),
|
||||
getInformationBody(type, url, locationInfo, isCustom, trafficInfoType, isShare,poiType,mainInfoId,longitude,latitude),
|
||||
customSend
|
||||
)
|
||||
}
|
||||
@@ -251,19 +254,22 @@ class MainServiceController {
|
||||
trafficInfoType:String,
|
||||
isShare: Boolean,
|
||||
customSend: ((Boolean) -> Unit)? = null,
|
||||
poiType: String
|
||||
poiType: String,
|
||||
mainInfoId: Long,
|
||||
longitude: Double,
|
||||
latitude: Double
|
||||
) {
|
||||
Log.d(TAG, " geoLocation -- poiType = $poiType");
|
||||
LocationUtil.getInstance()
|
||||
.geoCodeLocation(locationInfo.toLatLngPoint(), { locInfo: LocationInfo ->
|
||||
postInformationMessage(
|
||||
getInformationBody(type, url, locationInfo, isCustom, trafficInfoType, isShare, poiType),
|
||||
getInformationBody(type, url, locationInfo, isCustom, trafficInfoType, isShare, poiType,mainInfoId,longitude,latitude),
|
||||
customSend
|
||||
)
|
||||
}, {
|
||||
//转换失败的情况下再重试一次
|
||||
geoRetryed = if (!geoRetryed) {
|
||||
geoLocation(type, url, locationInfo, isCustom, trafficInfoType, isShare, customSend, poiType)
|
||||
geoLocation(type, url, locationInfo, isCustom, trafficInfoType, isShare, customSend, poiType,mainInfoId,longitude,latitude)
|
||||
true
|
||||
} else {
|
||||
false
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.google.gson.JsonArray
|
||||
import com.google.gson.JsonObject
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.network.Utils
|
||||
import com.zhidao.roadcondition.constant.TANLU_ROAD_CURRENT
|
||||
import com.zhidao.roadcondition.model.InformationBody
|
||||
import com.zhidao.roadcondition.model.LocationInfo
|
||||
import com.zhidao.roadcondition.model.proxy.INFO_TYPE_IMG
|
||||
@@ -28,7 +29,10 @@ fun getInformationBody(
|
||||
isCustom: Boolean,
|
||||
trafficInfoType:String = "",
|
||||
isShare:Boolean,
|
||||
poiType: String
|
||||
poiType: String,
|
||||
mainInfoId: Long,
|
||||
latitude: Double,
|
||||
longitude: Double
|
||||
): InformationBody {
|
||||
var jsonArray = JsonArray()
|
||||
var type: Int
|
||||
@@ -53,8 +57,8 @@ fun getInformationBody(
|
||||
locationInfo.cityCode,
|
||||
locationInfo.cityName,
|
||||
System.currentTimeMillis(),
|
||||
locationInfo.latitude,
|
||||
locationInfo.longitude,
|
||||
if (latitude == 0.0) locationInfo.latitude else latitude,
|
||||
if (longitude == 0.0) locationInfo.longitude else longitude,
|
||||
locationInfo.provinceName,
|
||||
Utils.getSn(),
|
||||
locationInfo.street,
|
||||
@@ -65,7 +69,8 @@ fun getInformationBody(
|
||||
trafficInfoType,
|
||||
isShare,
|
||||
locationInfo.direction,
|
||||
poiType
|
||||
poiType,
|
||||
mainInfoId
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -7,15 +7,10 @@ import android.view.View;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.module.back.BackToLauncherConst;
|
||||
import com.mogo.module.common.MogoModule;
|
||||
import com.mogo.module.common.MogoModulePaths;
|
||||
import com.mogo.module.common.utils.CarSeries;
|
||||
import com.mogo.module.extensions.utils.ExtensionsConfig;
|
||||
import com.mogo.module.main.MainActivity;
|
||||
import com.mogo.module.main.cards.MogoModulesManager;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
/**
|
||||
* 针对作为Launcher的情况,做个性化操作
|
||||
@@ -32,12 +27,6 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
ExtensionsConfig.setNeedRequestUserInfo( true );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addModule() {
|
||||
super.addModule();
|
||||
MogoModulePaths.addModule( new MogoModule( BackToLauncherConst.MODULE_PATH, BackToLauncherConst.MODULE_NAME ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadContainerModules() {
|
||||
super.loadContainerModules();
|
||||
|
||||
@@ -148,7 +148,7 @@ public class AppNavigatorFragment extends MvpFragment< AppNavigatorView, AppNavi
|
||||
} else {
|
||||
properties.put( "appversion", CommonUtils.getVersionName( getContext() ) );
|
||||
}
|
||||
AppServiceHandler.getMogoAnalytics().track( "Launcher_APP_Icon", properties );
|
||||
AppServiceHandler.getApis().getAnalyticsApi().track( "Launcher_APP_Icon", properties );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
package com.mogo.module.apps;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
import com.mogo.service.cardmanager.IMogoCardManager;
|
||||
|
||||
/**
|
||||
* author : zyz
|
||||
@@ -21,23 +17,6 @@ public class AppServiceHandler {
|
||||
private static final String TAG = "AppServiceHandler";
|
||||
|
||||
private static IMogoServiceApis mApis;
|
||||
private static IMogoCardManager mMogoCardManager;
|
||||
private static IMogoAnalytics mMogoAnalytics;
|
||||
|
||||
public static void init( final Context context ) {
|
||||
mApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation( context );
|
||||
mMogoCardManager = mApis.getCardManagerApi();
|
||||
mMogoAnalytics = mApis.getAnalyticsApi();
|
||||
|
||||
}
|
||||
|
||||
public static IMogoCardManager getMogoCardManager() {
|
||||
return mMogoCardManager;
|
||||
}
|
||||
|
||||
public static IMogoAnalytics getMogoAnalytics() {
|
||||
return mMogoAnalytics;
|
||||
}
|
||||
|
||||
public static IMogoServiceApis getApis() {
|
||||
if ( mApis == null ) {
|
||||
|
||||
@@ -53,8 +53,6 @@ public class AppsFragment extends MvpFragment< AppsView, AppsPresenter > impleme
|
||||
getActivity().overridePendingTransition( 0, R.anim.module_apps_anim_exit);
|
||||
}
|
||||
} );
|
||||
// mAppsList = findViewById( R.id.module_apps_id_apps );
|
||||
// mAppsList.setLayoutManager( new GridLayoutManager( getContext(), 8 ) );
|
||||
mLoadingView = findViewById( R.id.module_apps_id_loading );
|
||||
mLoadingView.setVisibility( View.VISIBLE );
|
||||
mIndicator = findViewById( R.id.module_apps_id_indicator );
|
||||
|
||||
@@ -74,7 +74,6 @@ public class AppsFragmentProvider implements IMogoModuleProvider {
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
AppServiceHandler.init( context );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -37,7 +37,7 @@ public class AppsListPresenter extends Presenter< AppsListView > implements IMog
|
||||
@Override
|
||||
public void onCreate( @NonNull LifecycleOwner owner ) {
|
||||
super.onCreate( owner );
|
||||
mIntentManager = ( IMogoIntentManager ) ARouter.getInstance().build( MogoServicePaths.PATH_INTENT_MANAGER ).navigation( getContext() );
|
||||
mIntentManager = AppServiceHandler.getApis().getIntentManagerApi();
|
||||
mIntentManager.registerIntentListener( AppsConst.COMMAND_OPERATION, this );
|
||||
mIntentManager.registerIntentListener( Intent.ACTION_CLOSE_SYSTEM_DIALOGS, this );
|
||||
AIAssist.getInstance( getContext() ).registerUnWakeupCommand( AppsConst.CMD_UN_WAKE_CLOSE_APP_LIST, AppsConst.CMD_UN_WAKE_WORDS_CLOSE_APP_LIST, this );
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.mogo.module.apps;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.module.apps.applaunch.AppLaunchFilter;
|
||||
import com.mogo.module.apps.applaunch.AppLauncher;
|
||||
@@ -13,11 +12,8 @@ import com.mogo.module.apps.applaunch.InternalFunctionLauncher;
|
||||
import com.mogo.module.apps.model.AppInfo;
|
||||
import com.mogo.module.apps.model.AppsModel;
|
||||
import com.mogo.module.apps.model.UnScannedApps;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
import com.mogo.service.cardmanager.IMogoCardManager;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.utils.ThreadPoolService;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -42,17 +38,14 @@ public class AppsPresenter extends Presenter< AppsView > {
|
||||
private IMogoAnalytics mAnalytics;
|
||||
private AppLaunchFilter mLauncher;
|
||||
|
||||
private IMogoServiceApis mApis;
|
||||
|
||||
private IMogoCardManager mCardManager;
|
||||
|
||||
public AppsPresenter( AppsView view ) {
|
||||
super( view );
|
||||
mApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation( getContext() );
|
||||
mCardManager = mApis.getCardManagerApi();
|
||||
mCardManager = AppServiceHandler.getApis().getCardManagerApi();
|
||||
InternalFunctionLauncher internalFunctionLauncher = new InternalFunctionLauncher( getContext() );
|
||||
CardAppLauncher cardAppLauncher = new CardAppLauncher( this, mCardManager );
|
||||
GuideShowLauncher guideShowLauncher = new GuideShowLauncher( mApis.getMapServiceApi().getNavi( getContext() ) );
|
||||
GuideShowLauncher guideShowLauncher = new GuideShowLauncher( AppServiceHandler.getApis().getMapServiceApi().getNavi( getContext() ) );
|
||||
internalFunctionLauncher.setNext( cardAppLauncher );
|
||||
cardAppLauncher.setNext( guideShowLauncher );
|
||||
guideShowLauncher.setNext( new AppLauncher() );
|
||||
@@ -69,7 +62,7 @@ public class AppsPresenter extends Presenter< AppsView > {
|
||||
}
|
||||
} );
|
||||
|
||||
mAnalytics = mApis.getAnalyticsApi();
|
||||
mAnalytics = AppServiceHandler.getApis().getAnalyticsApi();
|
||||
}
|
||||
|
||||
private void renderAppsList() {
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
package com.mogo.module.back;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-02-26
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class Back2LauncherFragment extends Fragment {
|
||||
|
||||
private static final String TAG = "Back2LauncherFragment";
|
||||
|
||||
@Override
|
||||
public void onCreate( @Nullable Bundle savedInstanceState ) {
|
||||
super.onCreate( savedInstanceState );
|
||||
BackToMainHomeManager.addMainHomeView();
|
||||
Logger.d( TAG, "addMainHomeView" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
BackToMainHomeManager.removeMainHomeView();
|
||||
Logger.d( TAG, "removeMainHomeView" );
|
||||
}
|
||||
}
|
||||
@@ -49,46 +49,11 @@ public class BackToLauncherModuleProvider implements IMogoModuleProvider {
|
||||
return BackToLauncherConst.MODULE_NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoModuleLifecycle getCardLifecycle() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoMapListener getMapListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getType() {
|
||||
return ModuleType.TYPE_SERVICE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoNaviListener getNaviListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoLocationListener getLocationListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoMarkerClickListener getMarkerClickListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAppPackage() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAppName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
if ( CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X ) {
|
||||
|
||||
@@ -1,28 +1,20 @@
|
||||
package com.mogo.module.back;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.os.Build;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.module.back.utils.WindowManagerViewHelper;
|
||||
import com.mogo.module.common.wm.WindowManagerView;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.fragmentmanager.IMogoFragmentManager;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.utils.AppUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
public class BackToMainHomeManager {
|
||||
|
||||
private static final String TAG = "BackToMainHomeManager";
|
||||
|
||||
private static View mBackView;
|
||||
|
||||
private static IMogoFragmentManager mFragmentManager;
|
||||
private static IMogoStatusManager mStatusManager;
|
||||
private static IMogoServiceApis mApis;
|
||||
@@ -45,7 +37,7 @@ public class BackToMainHomeManager {
|
||||
return;
|
||||
}
|
||||
|
||||
Intent intent2 = new Intent( );
|
||||
Intent intent2 = new Intent();
|
||||
// 是否发自系统消息
|
||||
intent2.putExtra( "isHomeKeyDown", false );
|
||||
mApis.getIntentManagerApi().invoke( Intent.ACTION_CLOSE_SYSTEM_DIALOGS, intent2 );
|
||||
@@ -58,40 +50,34 @@ public class BackToMainHomeManager {
|
||||
AbsMogoApplication.getApp().startActivity( intent );
|
||||
}
|
||||
|
||||
private static WindowManagerView mWindowManagerView;
|
||||
|
||||
public static void addMainHomeView() {
|
||||
Logger.d( "BackToMainHomeManager", "addMainHomeView" );
|
||||
if ( mBackView != null ) WindowManagerViewHelper.removeView( mBackView );
|
||||
mBackView = LayoutInflater.from( AbsMogoApplication.getApp() ).inflate( R.layout.mogo_module_back_home_back_layout, null );
|
||||
final Context context = mBackView.getContext();
|
||||
if ( context == null || context.getApplicationContext() == null ) {
|
||||
return;
|
||||
|
||||
if ( mWindowManagerView == null ) {
|
||||
mWindowManagerView = new WindowManagerView.Builder( AbsMogoApplication.getApp() )
|
||||
.contentView( R.layout.mogo_module_back_home_back_layout )
|
||||
.position( AbsMogoApplication.getApp().getResources().getDimensionPixelOffset( R.dimen.module_back_main_home_icon_left ),
|
||||
AbsMogoApplication.getApp().getResources().getDimensionPixelOffset( R.dimen.module_back_main_home_icon_top ) )
|
||||
.size( WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.WRAP_CONTENT )
|
||||
.gravity( Gravity.LEFT | Gravity.TOP )
|
||||
.showInWindowManager();
|
||||
mWindowManagerView.attachTouchEvent( view -> {
|
||||
backToLauncher();
|
||||
} );
|
||||
}
|
||||
WindowManager windowManager = ( WindowManager ) context.getApplicationContext().getSystemService( Context.WINDOW_SERVICE );
|
||||
if ( windowManager == null ) {
|
||||
return;
|
||||
try {
|
||||
mWindowManagerView.show();
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
mBackView.setOnClickListener( view -> {
|
||||
backToLauncher();
|
||||
} );
|
||||
WindowManager.LayoutParams params = new WindowManager.LayoutParams();
|
||||
params.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
params.width = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
params.x = AbsMogoApplication.getApp().getResources().getDimensionPixelOffset( R.dimen.module_back_main_home_icon_left );
|
||||
params.y = AbsMogoApplication.getApp().getResources().getDimensionPixelOffset( R.dimen.module_back_main_home_icon_top );
|
||||
params.gravity = Gravity.LEFT | Gravity.CENTER;
|
||||
if ( Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ) {
|
||||
params.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
|
||||
} else {
|
||||
params.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
|
||||
}
|
||||
params.format = PixelFormat.RGBA_8888;
|
||||
params.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
|
||||
windowManager.addView( mBackView, params );
|
||||
WindowManagerViewHelper.attachMovementEvent( mBackView, params );
|
||||
}
|
||||
|
||||
public static void removeMainHomeView() {
|
||||
WindowManagerViewHelper.removeView( mBackView );
|
||||
if ( mWindowManagerView != null ) {
|
||||
mWindowManagerView.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.mogo.module.back.utils;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
|
||||
public class Utils {
|
||||
public static boolean isActivityExits( String packageName, String classStr ) {
|
||||
Intent intent = new Intent();
|
||||
intent.setClassName( packageName, classStr );
|
||||
ResolveInfo resolveInfo = AbsMogoApplication.getApp().getPackageManager().resolveActivity( intent, PackageManager.MATCH_DEFAULT_ONLY );
|
||||
if ( resolveInfo != null ) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,213 +0,0 @@
|
||||
package com.mogo.module.back.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.os.Build;
|
||||
import android.view.Gravity;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-04-30
|
||||
* <p>
|
||||
* 向 window manager 添加 view
|
||||
*/
|
||||
public class WindowManagerViewHelper {
|
||||
|
||||
public static void addView( View view ) {
|
||||
|
||||
final Context context = view.getContext();
|
||||
if ( context == null || context.getApplicationContext() == null ) {
|
||||
return;
|
||||
}
|
||||
WindowManager windowManager = ( WindowManager ) context.getApplicationContext().getSystemService( Context.WINDOW_SERVICE );
|
||||
if ( windowManager == null ) {
|
||||
return;
|
||||
}
|
||||
WindowManager.LayoutParams params = new WindowManager.LayoutParams();
|
||||
params.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
params.width = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
params.gravity = Gravity.LEFT | Gravity.CENTER;
|
||||
params.type = getFitWindowParamsType();
|
||||
params.format = PixelFormat.RGBA_8888;
|
||||
params.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
|
||||
windowManager.addView( view, params );
|
||||
|
||||
attachMovementEvent( view, params );
|
||||
}
|
||||
|
||||
private static int getFitWindowParamsType() {
|
||||
int type;
|
||||
if ( Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1 ) {
|
||||
// Need request permission.
|
||||
type = WindowManager.LayoutParams.TYPE_PHONE;
|
||||
} else if ( Build.MODEL.equalsIgnoreCase( "MI 5" ) ) {
|
||||
// MI 5 phone not display crawler dot in android 7.0
|
||||
type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
|
||||
} else {
|
||||
// It's will be dismissed automatically 3s after showing in Android 25.
|
||||
type = WindowManager.LayoutParams.TYPE_TOAST;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
public static void removeView( View view ) {
|
||||
if ( view == null || view.getContext() == null || view.getContext().getApplicationContext() == null ) {
|
||||
return;
|
||||
}
|
||||
WindowManager windowManager = ( WindowManager ) view.getContext().getApplicationContext().getSystemService( Context.WINDOW_SERVICE );
|
||||
if ( windowManager == null ) {
|
||||
return;
|
||||
}
|
||||
windowManager.removeViewImmediate( view );
|
||||
DispatchTouchEventWrapper.getInstance().release();
|
||||
|
||||
}
|
||||
|
||||
public static void attachMovementEvent( View view, WindowManager.LayoutParams params ) {
|
||||
if ( view == null ) {
|
||||
return;
|
||||
}
|
||||
view.setOnTouchListener( ( v, event ) -> {
|
||||
DispatchTouchEventWrapper.getInstance()
|
||||
.attach( view, params )
|
||||
.handle( event );
|
||||
return false;
|
||||
} );
|
||||
}
|
||||
|
||||
static class DispatchTouchEventWrapper {
|
||||
|
||||
private WindowViewHandler mWindowViewHandler;
|
||||
|
||||
int mActionDownX = -1;
|
||||
int mActionDownY = -1;
|
||||
|
||||
/**
|
||||
* Flag whether move after touch down.
|
||||
*/
|
||||
boolean mMoveFlag = false;
|
||||
|
||||
private static volatile DispatchTouchEventWrapper INST;
|
||||
|
||||
private DispatchTouchEventWrapper() {
|
||||
}
|
||||
|
||||
public static DispatchTouchEventWrapper getInstance() {
|
||||
if ( INST == null ) {
|
||||
synchronized ( DispatchTouchEventWrapper.class ) {
|
||||
if ( INST == null ) {
|
||||
INST = new DispatchTouchEventWrapper();
|
||||
}
|
||||
}
|
||||
}
|
||||
return INST;
|
||||
}
|
||||
|
||||
public DispatchTouchEventWrapper attach( View windowView, WindowManager.LayoutParams params ) {
|
||||
if ( mWindowViewHandler == null || mWindowViewHandler.getWindowView() != windowView ) {
|
||||
mWindowViewHandler = new WindowViewHandler.DefaultHandler( windowView, params );
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean handle( MotionEvent event ) {
|
||||
switch ( event.getAction() & MotionEvent.ACTION_MASK ) {
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
if ( onActionDown( event ) ) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
if ( onActionMove( event ) ) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case MotionEvent.ACTION_UP:
|
||||
if ( onActionUp( event ) ) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean onActionDown( MotionEvent event ) {
|
||||
mActionDownX = ( ( int ) event.getRawX() );
|
||||
mActionDownY = ( ( int ) event.getRawY() );
|
||||
if ( mWindowViewHandler != null ) {
|
||||
mWindowViewHandler.recordNewPosition();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean onActionMove( MotionEvent event ) {
|
||||
|
||||
if ( Math.abs( event.getRawX() - mActionDownX ) >= 20
|
||||
|| Math.abs( event.getRawY() - mActionDownY ) >= 20 ) {
|
||||
mMoveFlag = true;
|
||||
}
|
||||
|
||||
if ( isLastDownValueLegal() ) {
|
||||
moveWindowView( event );
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean onActionUp( MotionEvent event ) {
|
||||
if ( isClickEventLike() ) {
|
||||
if ( mWindowViewHandler != null ) {
|
||||
mWindowViewHandler.performClickLike();
|
||||
}
|
||||
} else {
|
||||
if ( mWindowViewHandler != null ) {
|
||||
mWindowViewHandler.moveToEdge();
|
||||
mWindowViewHandler.recordNewPosition();
|
||||
}
|
||||
}
|
||||
mMoveFlag = false;
|
||||
clearLastDownAxisValue();
|
||||
return true;
|
||||
}
|
||||
|
||||
private void clearLastDownAxisValue() {
|
||||
mActionDownX = mActionDownY = -1;
|
||||
}
|
||||
|
||||
private boolean isLastDownValueLegal() {
|
||||
return mActionDownX != -1 && mActionDownY != -1;
|
||||
}
|
||||
|
||||
private void moveWindowView( MotionEvent event ) {
|
||||
if ( mWindowViewHandler != null ) {
|
||||
mWindowViewHandler.move( event, mActionDownX, mActionDownY );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Simulate click event just like set {@link View.OnClickListener}
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private boolean isClickEventLike() {
|
||||
System.out.println( mMoveFlag );
|
||||
return isLastDownValueLegal() && !mMoveFlag;
|
||||
}
|
||||
|
||||
public void release() {
|
||||
if ( mWindowViewHandler != null ) {
|
||||
mWindowViewHandler.release();
|
||||
}
|
||||
mWindowViewHandler = null;
|
||||
mActionDownX = -1;
|
||||
mActionDownY = -1;
|
||||
mMoveFlag = false;
|
||||
INST = null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,119 +0,0 @@
|
||||
package com.mogo.module.back.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.utils.WindowUtils;
|
||||
|
||||
|
||||
/**
|
||||
* Created by congtaowang on 2017/6/20.
|
||||
*/
|
||||
|
||||
public interface WindowViewHandler {
|
||||
|
||||
View getWindowView();
|
||||
|
||||
void recordNewPosition();
|
||||
|
||||
void move(MotionEvent event, int downX, int downY);
|
||||
|
||||
void release();
|
||||
|
||||
void moveToEdge();
|
||||
|
||||
void performClickLike();
|
||||
|
||||
class DefaultHandler implements WindowViewHandler {
|
||||
|
||||
protected View mWindowView;
|
||||
|
||||
protected int mWindowViewLeft = -1;
|
||||
protected int mWindowViewTop = -1;
|
||||
|
||||
private WindowManager.LayoutParams mParams;
|
||||
|
||||
public DefaultHandler( View windowView, WindowManager.LayoutParams params ) {
|
||||
this.mWindowView = windowView;
|
||||
mParams = params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getWindowView() {
|
||||
return mWindowView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recordNewPosition() {
|
||||
mWindowViewLeft = mParams.x;
|
||||
mWindowViewTop = mParams.y;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void move( MotionEvent event, int downX, int downY ) {
|
||||
move( ( ( int ) ( event.getRawX() - downX ) ),
|
||||
( ( int ) ( event.getRawY() - downY ) ) );
|
||||
}
|
||||
|
||||
private void move( int distanceX, int distanceY ) {
|
||||
if ( mWindowView == null ) {
|
||||
return;
|
||||
}
|
||||
mParams.x = mWindowViewLeft + distanceX;
|
||||
mParams.y = mWindowViewTop + distanceY;
|
||||
WindowManager wm = ( ( WindowManager ) mWindowView.getContext().getSystemService( Context.WINDOW_SERVICE ) );
|
||||
|
||||
if ( wm == null ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( mWindowView instanceof WindowViewUIController ) {
|
||||
if ( mParams.x > WindowUtils.getScreenWidth( AbsMogoApplication.getApp() ) / 2 ) {
|
||||
( ( WindowViewUIController ) mWindowView ).rightMode();
|
||||
} else {
|
||||
( ( WindowViewUIController ) mWindowView ).leftMode();
|
||||
}
|
||||
}
|
||||
|
||||
wm.updateViewLayout( mWindowView, alignLayoutParamsBoundary( mParams ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void moveToEdge() {
|
||||
if ( mWindowView == null ) {
|
||||
return;
|
||||
}
|
||||
WindowManager wm = ( ( WindowManager ) mWindowView.getContext().getSystemService( Context.WINDOW_SERVICE ) );
|
||||
|
||||
if ( mParams.x > WindowUtils.getScreenWidth( AbsMogoApplication.getApp() ) / 2 ) {
|
||||
mParams.x = WindowUtils.getScreenWidth( AbsMogoApplication.getApp() ) - mWindowView.getMeasuredWidth();
|
||||
} else {
|
||||
mParams.x = 0;
|
||||
}
|
||||
|
||||
wm.updateViewLayout( mWindowView, alignLayoutParamsBoundary( mParams ) );
|
||||
}
|
||||
|
||||
protected WindowManager.LayoutParams alignLayoutParamsBoundary( WindowManager.LayoutParams params ) {
|
||||
return params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void performClickLike() {
|
||||
if ( mWindowView instanceof WindowViewUIController ) {
|
||||
( ( WindowViewUIController ) mWindowView ).performClickLike();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void release() {
|
||||
mWindowView = null;
|
||||
mWindowViewLeft = -1;
|
||||
mWindowViewTop = -1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.mogo.module.back.utils;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-05-12
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public interface WindowViewUIController {
|
||||
|
||||
void leftMode();
|
||||
|
||||
void rightMode();
|
||||
|
||||
void performClickLike();
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="module_back_main_home_icon_size">140px</dimen>
|
||||
<dimen name="module_back_main_home_icon_left">0px</dimen>
|
||||
<dimen name="module_back_main_home_icon_top">190px</dimen>
|
||||
<dimen name="module_back_main_home_icon_left">30px</dimen>
|
||||
<dimen name="module_back_main_home_icon_top">230px</dimen>
|
||||
|
||||
</resources>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="module_back_main_home_icon_size">80px</dimen>
|
||||
<dimen name="module_back_main_home_icon_left">0px</dimen>
|
||||
<dimen name="module_back_main_home_icon_top">100px</dimen>
|
||||
<dimen name="module_back_main_home_icon_left">16px</dimen>
|
||||
<dimen name="module_back_main_home_icon_top">140px</dimen>
|
||||
|
||||
</resources>
|
||||
@@ -12,6 +12,7 @@
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/module_ext_weather_container_paddingLeft"
|
||||
android:paddingEnd="@dimen/module_ext_weather_container_paddingRight"
|
||||
android:layout_marginEnd="@dimen/module_ext_msg_marginRight"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintRight_toLeftOf="@+id/module_ext_id_msg"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
||||
@@ -50,7 +50,6 @@ dependencies {
|
||||
api rootProject.ext.dependencies.moduleservice
|
||||
api rootProject.ext.dependencies.moduleapps
|
||||
api rootProject.ext.dependencies.moduleextensions
|
||||
api rootProject.ext.dependencies.mogomoduleback
|
||||
} else {
|
||||
api project(":foudations:mogo-utils")
|
||||
api project(":foudations:mogo-commons")
|
||||
@@ -61,7 +60,6 @@ dependencies {
|
||||
api project(':services:mogo-service')
|
||||
api project(':modules:mogo-module-apps')
|
||||
api project(':modules:mogo-module-extensions')
|
||||
api project(':modules:mogo-module-back')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -152,7 +152,6 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
MapCenterPointStrategy.setMapCenterPointByScene( mMogoMapUIController, Scene.AIMLESS );
|
||||
|
||||
// 加载地图,触发地图加载完毕回调,在初始化其他卡片模块,保证卡片模块可以正确获取地图相关服务。
|
||||
addModule();
|
||||
loadContainerModules();
|
||||
MogoModulesManager.getInstance().loadModules();
|
||||
mPresenter.delayOperations();
|
||||
@@ -185,13 +184,6 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
startService( intent );
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加模块
|
||||
*/
|
||||
protected void addModule() {
|
||||
|
||||
}
|
||||
|
||||
protected void loadContainerModules() {
|
||||
// MogoModulesManager.getInstance().loadExtensionsModule( R.id.module_main_id_header_fragment_container );
|
||||
MogoModulesManager.getInstance().loadEntrancesModule( R.id.module_main_id_entrance_fragment_container );
|
||||
|
||||
@@ -60,6 +60,7 @@ public class V2XConst {
|
||||
public static final String V2X_ROAD_SHOW = "v2x_road_show";
|
||||
public static final String V2X_ROAD_EVET = "v2x_road_event";
|
||||
public static final String V2X_ROAD_EVET_HISTORY_BUTTON = "V2X_button_click";
|
||||
public static final String V2X_ROAD_PRODUCE = "v2x_road_produce";
|
||||
/**
|
||||
* V2X 道路事件操作类型
|
||||
*/
|
||||
|
||||
@@ -31,7 +31,6 @@ import com.mogo.module.v2x.scenario.scene.park.V2XIllegalParkScenario;
|
||||
import com.mogo.module.v2x.scenario.scene.park.V2XIllegalParkWindow;
|
||||
import com.mogo.module.v2x.utils.FatigueDrivingUtils;
|
||||
import com.mogo.module.v2x.utils.TimeUtils;
|
||||
import com.mogo.module.v2x.utils.V2XSQLiteUtils;
|
||||
import com.mogo.module.v2x.utils.V2XUtils;
|
||||
import com.mogo.module.v2x.voice.V2XVoiceManager;
|
||||
import com.mogo.service.module.IMogoModuleLifecycle;
|
||||
@@ -156,8 +155,6 @@ public class V2XModuleProvider implements
|
||||
}
|
||||
// 刷新配置文件
|
||||
refreshStrategyConfig();
|
||||
// 清除V2X事件数据库中过期的数据,数据有效期为24小时
|
||||
V2XSQLiteUtils.clearYesterdayScenarioHistoryData();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -66,38 +66,13 @@ public class V2XShareEventAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
shareLoadStatusViewHolder holder = new shareLoadStatusViewHolder(v);
|
||||
return holder;
|
||||
}else {
|
||||
View v = shareLayoutInflater.inflate(R.layout.item_v2x_event_share_no_more, parent,
|
||||
View v = shareLayoutInflater.inflate(R.layout.footer_nomore_view, parent,
|
||||
false);
|
||||
shareLoadNoMoreViewHolder holder = new shareLoadNoMoreViewHolder(v);
|
||||
return holder;
|
||||
}
|
||||
}
|
||||
|
||||
private float getEnthusuasmIndex(double score) {
|
||||
if (score <= 0) {
|
||||
return 0;
|
||||
} else if (0 < score && score <= 5) {
|
||||
return (float) 0.5;
|
||||
} else if (5 < score && score <= 10) {
|
||||
return 1;
|
||||
} else if (10 < score && score <= 15) {
|
||||
return (float) 1.5;
|
||||
} else if (15 < score && score <= 20) {
|
||||
return 2;
|
||||
} else if (20 < score && score <= 25) {
|
||||
return (float) 2.5;
|
||||
} else if (25 < score && score <= 30) {
|
||||
return 3;
|
||||
} else if (30 < score && score <= 35) {
|
||||
return (float) 3.5;
|
||||
} else if (35 < score && score <= 40) {
|
||||
return 4;
|
||||
} else if (40 < score && score <= 45) {
|
||||
return (float) 4.5;
|
||||
}
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
|
||||
@@ -115,7 +90,7 @@ public class V2XShareEventAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
if (likeNum != null) {
|
||||
((shareDescriptionViewHolder) holder).approveNumTextView.setText(likeNum);
|
||||
}
|
||||
((shareDescriptionViewHolder) holder).ratingBar.setRating(getEnthusuasmIndex(enthusiasmIndex));
|
||||
((shareDescriptionViewHolder) holder).ratingBar.setRating((float) enthusiasmIndex);
|
||||
}
|
||||
}
|
||||
} else if (holder instanceof shareItemViewHolder) {
|
||||
@@ -207,7 +182,7 @@ public class V2XShareEventAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
}
|
||||
|
||||
/*
|
||||
* 去分享
|
||||
* 去分享 刷新
|
||||
* */
|
||||
class shareEmptyViewHolder extends RecyclerView.ViewHolder {
|
||||
public shareEmptyViewHolder(@NonNull View itemView) {
|
||||
@@ -218,6 +193,14 @@ public class V2XShareEventAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
V2XEventPanelFragment.Companion.getInstance().hidePanel();
|
||||
mApis.getShareManager().showShareDialog();
|
||||
});
|
||||
|
||||
Button refresh = itemView.findViewById(R.id.refresh_button);
|
||||
refresh.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
callback.getShareEventResponse();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -170,12 +170,22 @@ public class V2XOtherSeekHelpVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
.displayImage(mV2XPushMessageEntity.getHeadImgUrl(), ivHead);
|
||||
}
|
||||
tvName.setText(mV2XPushMessageEntity.getDisplayName());
|
||||
SpanUtils.with(tvDistance)
|
||||
.append("" + (int) mV2XPushMessageEntity.getDistance())
|
||||
.setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_text))
|
||||
.append("m")
|
||||
.setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_title))
|
||||
.create();
|
||||
|
||||
if (mV2XPushMessageEntity.getDistance() > 1000) {
|
||||
SpanUtils.with(tvDistance)
|
||||
.append("" + (int) mV2XPushMessageEntity.getDistance() / 1000)
|
||||
.setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_text))
|
||||
.append("km")
|
||||
.setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_title))
|
||||
.create();
|
||||
} else {
|
||||
SpanUtils.with(tvDistance)
|
||||
.append("" + (int) mV2XPushMessageEntity.getDistance())
|
||||
.setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_text))
|
||||
.append("m")
|
||||
.setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_title))
|
||||
.create();
|
||||
}
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm", Locale.CHINA);
|
||||
String eventTime = String.format("%s发布求助信息",
|
||||
sdf.format(new Date(mV2XPushMessageEntity.getCreateTime())));
|
||||
|
||||
@@ -80,12 +80,21 @@ public class V2XScenarioHistoryOtherSeekHelpVH extends V2XBaseViewHolder<V2XHist
|
||||
.displayImage(xPushMessageEntity.getHeadImgUrl(), mIvFaultHelpHead);
|
||||
}
|
||||
|
||||
SpanUtils.with(mTvFaultHelpDistance)
|
||||
.append("" + (int) xPushMessageEntity.getDistance())
|
||||
.setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_text))
|
||||
.append("m")
|
||||
.setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_title))
|
||||
.create();
|
||||
if (xPushMessageEntity.getDistance() > 1000) {
|
||||
SpanUtils.with(mTvFaultHelpDistance)
|
||||
.append("" + (int) xPushMessageEntity.getDistance() / 1000)
|
||||
.setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_text))
|
||||
.append("km")
|
||||
.setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_title))
|
||||
.create();
|
||||
} else {
|
||||
SpanUtils.with(mTvFaultHelpDistance)
|
||||
.append("" + (int) xPushMessageEntity.getDistance())
|
||||
.setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_text))
|
||||
.append("m")
|
||||
.setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_title))
|
||||
.create();
|
||||
}
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm", Locale.CHINA);
|
||||
String eventTime = String.format("%s发布求助信息",
|
||||
sdf.format(new Date(xPushMessageEntity.getCreateTime())));
|
||||
@@ -102,6 +111,7 @@ public class V2XScenarioHistoryOtherSeekHelpVH extends V2XBaseViewHolder<V2XHist
|
||||
}
|
||||
|
||||
mIvFaultHelpEventNavi.setOnClickListener(v -> {
|
||||
V2XServiceManager.getV2XRefreshModel().respondingToHelp(mUserInfo.getSn());
|
||||
triggerStartNavi(mNoveltyInfo);
|
||||
});
|
||||
|
||||
@@ -125,6 +135,7 @@ public class V2XScenarioHistoryOtherSeekHelpVH extends V2XBaseViewHolder<V2XHist
|
||||
|
||||
mIvFaultHelpEventCall.setOnClickListener(v -> {
|
||||
if (!V2XUtils.isFastClick()) {
|
||||
V2XServiceManager.getV2XRefreshModel().respondingToHelp(mUserInfo.getSn());
|
||||
try {
|
||||
mUserInfo.setSn(xPushMessageEntity.getSn());
|
||||
mUserInfo.setUserHead(xPushMessageEntity.getHeadImgUrl());
|
||||
@@ -147,7 +158,6 @@ public class V2XScenarioHistoryOtherSeekHelpVH extends V2XBaseViewHolder<V2XHist
|
||||
@Override
|
||||
public void delayedCloseWindow() {
|
||||
try {
|
||||
V2XServiceManager.getV2XRefreshModel().respondingToHelp(mUserInfo.getSn());
|
||||
|
||||
hideControlButton(View.GONE);
|
||||
// 进行数据库存储
|
||||
|
||||
@@ -64,7 +64,7 @@ public class V2XScenarioHistoryRoadEventVH extends V2XBaseViewHolder<V2XHistoryS
|
||||
|
||||
try {
|
||||
mTvIllegalNum.setText(mExploreWay.getUserInfo().getUserName() + " 的分享 时间:" +
|
||||
TimeUtils.millis2String(mExploreWay.getGenerateTime(), "MM月dd日 HH:mm"));
|
||||
TimeUtils.millis2String(mOldScenarioData.getTriggerTime(), "MM月dd日 HH:mm"));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mogo.module.v2x.fragment
|
||||
|
||||
import android.content.Intent
|
||||
import android.view.View
|
||||
import android.widget.RadioGroup
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.viewpager2.widget.ViewPager2
|
||||
import com.google.android.material.tabs.TabLayoutMediator
|
||||
@@ -12,8 +12,10 @@ import com.mogo.module.v2x.V2XServiceManager
|
||||
import com.mogo.module.v2x.adapter.V2XEventPagerAdapter
|
||||
import com.mogo.module.v2x.presenter.EventPanelPresenter
|
||||
import com.mogo.module.v2x.utils.TrackUtils
|
||||
import com.mogo.module.v2x.utils.V2XSQLiteUtils
|
||||
import com.mogo.module.v2x.view.V2XEventPanelHistoryCountView
|
||||
import com.mogo.module.v2x.voice.V2XVoiceCallbackListener
|
||||
import com.mogo.module.v2x.voice.V2XVoiceConstants
|
||||
import com.mogo.module.v2x.voice.V2XVoiceManager
|
||||
import com.mogo.utils.logger.Logger
|
||||
import kotlinx.android.synthetic.main.module_v2x_event_panel_fragment_event_panel.*
|
||||
|
||||
@@ -27,12 +29,16 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
|
||||
|
||||
private val TAG = "EventPanelFragment"
|
||||
|
||||
private var isFirstLoad = false
|
||||
|
||||
private var fragments: Array<Fragment>? = null
|
||||
|
||||
private var mediator: TabLayoutMediator? = null
|
||||
|
||||
private var mV2XEventPanelHistoryCountView: V2XEventPanelHistoryCountView? = null
|
||||
|
||||
private val mV2XScenarioHistoryFragment = V2XScenarioHistoryFragment()
|
||||
|
||||
companion object {
|
||||
private val fragment = V2XEventPanelFragment()
|
||||
fun getInstance(): V2XEventPanelFragment {
|
||||
@@ -40,57 +46,94 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
|
||||
}
|
||||
}
|
||||
|
||||
// 打开出行动态TAB
|
||||
private val mCheckHistoryEventCb = V2XVoiceCallbackListener { command: String?, intent: Intent? ->
|
||||
try {
|
||||
rbScenarioHistory?.isChecked=true
|
||||
} catch (e: java.lang.Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
// 打开周边事件TAB
|
||||
private val mCheckSurroundingCb = V2XVoiceCallbackListener { command: String?, intent: Intent? ->
|
||||
try {
|
||||
rbSurroundingEvent?.isChecked=true
|
||||
} catch (e: java.lang.Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
// 打开我的分享TAB
|
||||
private val mCheckShearEventCb = V2XVoiceCallbackListener { command: String?, intent: Intent? ->
|
||||
try {
|
||||
rbShareEvents?.isChecked=true
|
||||
} catch (e: java.lang.Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
// 打关闭事件面板
|
||||
private val mCloeEventCb = V2XVoiceCallbackListener { command: String?, intent: Intent? ->
|
||||
try {
|
||||
TrackUtils.trackV2xHistoryEvent(5)
|
||||
hidePanel()
|
||||
} catch (e: java.lang.Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.module_v2x_event_panel_fragment_event_panel
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
Logger.d(MODULE_NAME, "事件面板初始化……")
|
||||
fragments = arrayOf(
|
||||
V2XScenarioHistoryFragment(),
|
||||
V2XSurroundingFragment(),
|
||||
V2XShareEventsFragment()
|
||||
)
|
||||
//禁用预加载
|
||||
vpEventPanel.offscreenPageLimit = ViewPager2.OFFSCREEN_PAGE_LIMIT_DEFAULT
|
||||
vpEventPanel.adapter = V2XEventPagerAdapter(this, fragments!!)
|
||||
vpEventPanel.isUserInputEnabled = false; //true:滑动,false:禁止滑动
|
||||
try {
|
||||
fragments = arrayOf(
|
||||
mV2XScenarioHistoryFragment,
|
||||
V2XSurroundingFragment(),
|
||||
V2XShareEventsFragment()
|
||||
)
|
||||
//禁用预加载
|
||||
vpEventPanel.offscreenPageLimit = ViewPager2.OFFSCREEN_PAGE_LIMIT_DEFAULT
|
||||
vpEventPanel.adapter = V2XEventPagerAdapter(this, fragments!!)
|
||||
vpEventPanel.isUserInputEnabled = false; //true:滑动,false:禁止滑动
|
||||
|
||||
val radioGroup = findViewById<View>(R.id.rgTabSelect) as RadioGroup?
|
||||
radioGroup!!.setOnCheckedChangeListener { group, checkedId ->
|
||||
when (checkedId) {
|
||||
R.id.rbScenarioHistory -> {
|
||||
TrackUtils.trackV2xHistoryEvent(2)
|
||||
vpEventPanel.setCurrentItem(0, false)
|
||||
}
|
||||
R.id.rbSurroundingEvent -> {
|
||||
TrackUtils.trackV2xHistoryEvent(3)
|
||||
vpEventPanel.setCurrentItem(1, false)
|
||||
}
|
||||
R.id.rbShareEvents -> {
|
||||
TrackUtils.trackV2xHistoryEvent(4)
|
||||
vpEventPanel.setCurrentItem(2, false)
|
||||
rgTabSelect?.setOnCheckedChangeListener { group, checkedId ->
|
||||
when (checkedId) {
|
||||
R.id.rbScenarioHistory -> {
|
||||
TrackUtils.trackV2xHistoryEvent(2)
|
||||
vpEventPanel.setCurrentItem(0, false)
|
||||
}
|
||||
R.id.rbSurroundingEvent -> {
|
||||
TrackUtils.trackV2xHistoryEvent(3)
|
||||
vpEventPanel.setCurrentItem(1, false)
|
||||
}
|
||||
R.id.rbShareEvents -> {
|
||||
TrackUtils.trackV2xHistoryEvent(4)
|
||||
vpEventPanel.setCurrentItem(2, false)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
btnHidePanels.setOnClickListener {
|
||||
TrackUtils.trackV2xHistoryEvent(5)
|
||||
hidePanel()
|
||||
}
|
||||
|
||||
mV2XEventPanelHistoryCountView = V2XEventPanelHistoryCountView(context)
|
||||
mV2XEventPanelHistoryCountView!!.setOnClickListener {
|
||||
TrackUtils.trackV2xHistoryEvent(1)
|
||||
if (!isPanelShow()) {
|
||||
showPanel()
|
||||
} else {
|
||||
btnHidePanels.setOnClickListener {
|
||||
TrackUtils.trackV2xHistoryEvent(5)
|
||||
hidePanel()
|
||||
}
|
||||
}
|
||||
V2XServiceManager.getMogoEntranceButtonController().addBottomLayerView(mV2XEventPanelHistoryCountView)
|
||||
|
||||
changeEventCount()
|
||||
mV2XEventPanelHistoryCountView = V2XEventPanelHistoryCountView(context)
|
||||
mV2XEventPanelHistoryCountView!!.setOnClickListener {
|
||||
if (!isPanelShow()) {
|
||||
TrackUtils.trackV2xHistoryEvent(1)
|
||||
showPanel()
|
||||
}
|
||||
}
|
||||
V2XServiceManager.getMogoEntranceButtonController().addBottomLayerView(mV2XEventPanelHistoryCountView)
|
||||
changeEventCount()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
@@ -105,13 +148,29 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
|
||||
fun showPanel() {
|
||||
Logger.d(MODULE_NAME, "in fragment show panel")
|
||||
clPanelContainer.visibility = View.VISIBLE
|
||||
V2XServiceManager.getMoGoV2XStatusManager().setEventPanelWindowShow(TAG, true)
|
||||
// 注册语音交互
|
||||
V2XVoiceManager.registerUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_OPEN_HISTORY_EVENT_UN_WAKEUP, mCheckHistoryEventCb)
|
||||
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_OPEN_SURROUNDING_EVENT_UN_WAKEUP, mCheckSurroundingCb)
|
||||
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_OPEN_SHEAR_EVENT_UN_WAKEUP, mCheckShearEventCb)
|
||||
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_CLOSE_WINDOW_UN_WAKEUP, mCloeEventCb)
|
||||
try {
|
||||
if (isFirstLoad) {
|
||||
mV2XScenarioHistoryFragment.presenter.loadHistory()
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
isFirstLoad = true
|
||||
}
|
||||
|
||||
fun hidePanel() {
|
||||
Logger.d(MODULE_NAME, "in fragment hide panel")
|
||||
clPanelContainer.visibility = View.GONE
|
||||
V2XServiceManager.getMoGoV2XStatusManager().setEventPanelWindowShow(TAG, false)
|
||||
// 注册语音交互
|
||||
V2XVoiceManager.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_OPEN_HISTORY_EVENT_UN_WAKEUP)
|
||||
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_OPEN_SURROUNDING_EVENT_UN_WAKEUP)
|
||||
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_OPEN_SHEAR_EVENT_UN_WAKEUP)
|
||||
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_CLOSE_WINDOW_UN_WAKEUP)
|
||||
}
|
||||
|
||||
fun isPanelShow(): Boolean {
|
||||
|
||||
@@ -18,6 +18,8 @@ import com.mogo.module.v2x.adapter.V2XScenarioHistoryAdapter;
|
||||
import com.mogo.module.v2x.manager.IMoGoV2XStatusChangedListener;
|
||||
import com.mogo.module.v2x.manager.V2XStatusDescriptor;
|
||||
import com.mogo.module.v2x.presenter.ScenarioHistoryPresenter;
|
||||
import com.mogo.module.v2x.utils.ThreadUtils;
|
||||
import com.mogo.module.v2x.utils.V2XSQLiteUtils;
|
||||
import com.mogo.module.v2x.view.V2XListEmptyView;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
@@ -72,6 +74,7 @@ public class V2XScenarioHistoryFragment
|
||||
@Override
|
||||
public void onShearClick() {
|
||||
V2XServiceManager.getMogoShareManager().showShareDialog();
|
||||
V2XEventPanelFragment.Companion.getInstance().hidePanel();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -108,21 +111,28 @@ public class V2XScenarioHistoryFragment
|
||||
*/
|
||||
public void loadHistory(List<V2XHistoryScenarioData> v2XHistoryScenarioData) {
|
||||
Logger.d(TAG, "查询到历史消息:" + GsonUtil.jsonFromObject(v2XHistoryScenarioData));
|
||||
mV2XHistoryScenarioData.clear();
|
||||
if (v2XHistoryScenarioData.size() > 0) {
|
||||
mEmptyView.setVisibility(View.GONE);
|
||||
mClHistoryList.setVisibility(View.VISIBLE);
|
||||
mV2XHistoryScenarioData.addAll(v2XHistoryScenarioData);
|
||||
} else {
|
||||
mEmptyView.setVisibility(View.VISIBLE);
|
||||
mClHistoryList.setVisibility(View.GONE);
|
||||
}
|
||||
mV2XScenarioHistoryAdapter.notifyDataSetChanged();
|
||||
ThreadUtils.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mV2XHistoryScenarioData.clear();
|
||||
if (v2XHistoryScenarioData.size() > 0) {
|
||||
mEmptyView.setVisibility(View.GONE);
|
||||
mClHistoryList.setVisibility(View.VISIBLE);
|
||||
mV2XHistoryScenarioData.addAll(v2XHistoryScenarioData);
|
||||
} else {
|
||||
mEmptyView.setVisibility(View.VISIBLE);
|
||||
mClHistoryList.setVisibility(View.GONE);
|
||||
}
|
||||
mV2XScenarioHistoryAdapter.notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
// 清除V2X事件数据库中过期的数据,数据有效期为24小时
|
||||
V2XSQLiteUtils.clearYesterdayScenarioHistoryData();
|
||||
mPresenter.loadHistory();
|
||||
}
|
||||
|
||||
|
||||
@@ -77,8 +77,10 @@ public class V2XShareEventsFragment extends MvpFragment implements AdapterCallba
|
||||
/*
|
||||
* 获取热心指数,分享列表等分享内容
|
||||
* */
|
||||
private void getShareEventResponse() {
|
||||
@Override
|
||||
public void getShareEventResponse() {
|
||||
animatioonAcction(View.VISIBLE);
|
||||
|
||||
v2XShareNetworkModel.getShareEventResponse(pageNum, 10, new V2XRefreshCallback() {
|
||||
@Override
|
||||
public void onSuccess(Object result) {
|
||||
@@ -87,6 +89,9 @@ public class V2XShareEventsFragment extends MvpFragment implements AdapterCallba
|
||||
|
||||
if (resultData != null && resultData.getResult() != null
|
||||
&& resultData.getResult().getEnthusiasmIndex() != null) {
|
||||
if (dataArrayList.size() > 0) {
|
||||
dataArrayList.clear();
|
||||
}
|
||||
dataArrayList.add(resultData.getResult().getEnthusiasmIndex());
|
||||
Log.d(TAG, "热心指数:" + resultData.getResult().getEnthusiasmIndex());
|
||||
}
|
||||
@@ -97,7 +102,7 @@ public class V2XShareEventsFragment extends MvpFragment implements AdapterCallba
|
||||
|
||||
@Override
|
||||
public void onFail(String msg) {
|
||||
loadingView.stopWithError(msg);
|
||||
loadingView.stopWithError(msg, View.VISIBLE);
|
||||
loadingView.refresButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -106,6 +111,7 @@ public class V2XShareEventsFragment extends MvpFragment implements AdapterCallba
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
@@ -182,7 +188,7 @@ public class V2XShareEventsFragment extends MvpFragment implements AdapterCallba
|
||||
|
||||
@Override
|
||||
public void onFail(String msg) {
|
||||
|
||||
loadingView.stopWithError(msg, View.INVISIBLE);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -6,4 +6,6 @@ package com.mogo.module.v2x.listener;
|
||||
public interface AdapterCallback {
|
||||
//分享列表加载更多
|
||||
void loadMoreShareEventList();
|
||||
//分享列表首次刷新
|
||||
void getShareEventResponse();
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.mogo.module.v2x.utils.ADASUtils;
|
||||
import com.mogo.module.v2x.utils.DrivingDirectionUtils;
|
||||
import com.mogo.module.v2x.utils.LocationUtils;
|
||||
import com.mogo.module.v2x.utils.MarkerUtils;
|
||||
import com.mogo.module.v2x.utils.TrackUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
|
||||
@@ -157,6 +158,7 @@ public class V2XLocationListener implements IMogoLocationListener, CarStatusList
|
||||
);
|
||||
// Logger.w(MODULE_NAME, "V2X预警--前方数据距离:" + v2XRoadEventEntity.getDistance());
|
||||
// 触发展示操作
|
||||
TrackUtils.trackV2xRoadProduceEvent(1);
|
||||
V2XMessageEntity<V2XRoadEventEntity> v2XMessageEntity = new V2XMessageEntity<>();
|
||||
v2XMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING);
|
||||
v2XMessageEntity.setContent(v2XRoadEventEntity);
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.alarm.V2XAlarmServer;
|
||||
import com.mogo.module.v2x.utils.TimeConstants;
|
||||
import com.mogo.module.v2x.utils.TimeUtils;
|
||||
import com.mogo.module.v2x.utils.TrackUtils;
|
||||
import com.mogo.module.v2x.utils.V2XUtils;
|
||||
import com.mogo.service.connection.IMogoOnMessageListener;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -42,6 +43,7 @@ public class V2XMessageListener_401012 implements IMogoOnMessageListener<MarkerC
|
||||
public void onMsgReceived(MarkerCardResult response) {
|
||||
Logger.d(MODULE_NAME, "V2XMessageListener_401012==V2X服务端下发:\n"
|
||||
+ GsonUtil.jsonFromObject(response));
|
||||
TrackUtils.trackV2xRoadProduceEvent(2);
|
||||
try {
|
||||
long timeSpan = TimeUtils.getTimeSpan(TimeUtils.getNowMills(), response.getMessageTime(), TimeConstants.MIN);
|
||||
// 三分钟以内的消息才会提示用户
|
||||
|
||||
@@ -132,20 +132,17 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
|
||||
|
||||
if (exploreWayList != null) {
|
||||
for (MarkerExploreWay markerExploreWay : exploreWayList) {
|
||||
// 因为目前探路卡片不支持直播,所以这里做了过滤 @李小鹏
|
||||
if (!markerExploreWay.getCanLive()) {
|
||||
if (EventTypeUtils.isRoadEvent(markerExploreWay.getPoiType())) {
|
||||
MarkerLocation markerLocation = markerExploreWay.getLocation();
|
||||
// 记录道路事件
|
||||
V2XRoadEventEntity v2XRoadEventEntity = new V2XRoadEventEntity();
|
||||
v2XRoadEventEntity.setLocation(markerLocation);
|
||||
// 探路目前只有上报拥堵
|
||||
v2XRoadEventEntity.setPoiType(markerExploreWay.getPoiType());
|
||||
if (EventTypeUtils.isRoadEvent(markerExploreWay.getPoiType())) {
|
||||
MarkerLocation markerLocation = markerExploreWay.getLocation();
|
||||
// 记录道路事件
|
||||
V2XRoadEventEntity v2XRoadEventEntity = new V2XRoadEventEntity();
|
||||
v2XRoadEventEntity.setLocation(markerLocation);
|
||||
// 探路目前只有上报拥堵
|
||||
v2XRoadEventEntity.setPoiType(markerExploreWay.getPoiType());
|
||||
|
||||
v2XRoadEventEntity.setNoveltyInfo(markerExploreWay);
|
||||
v2XRoadEventEntity.setExpireTime(20000);
|
||||
mV2XRoadEventEntityArrayList.add(v2XRoadEventEntity);
|
||||
}
|
||||
v2XRoadEventEntity.setNoveltyInfo(markerExploreWay);
|
||||
v2XRoadEventEntity.setExpireTime(20000);
|
||||
mV2XRoadEventEntityArrayList.add(v2XRoadEventEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ public class V2XShareNetworkModel {
|
||||
public void onError(Throwable e) {
|
||||
super.onError(e);
|
||||
if (callback != null){
|
||||
callback.onFail("当前服务不可以, 请稍后重试");
|
||||
callback.onFail("网络异常,点击刷新重试");
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -180,7 +180,7 @@ public class V2XShareNetworkModel {
|
||||
public void onError(Throwable e) {
|
||||
super.onError(e);
|
||||
if (callback != null){
|
||||
callback.onFail("当前服务不可以, 请稍后重试");
|
||||
callback.onFail("网络异常,点击刷新重试");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -4,7 +4,9 @@ package com.mogo.module.v2x.presenter;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.module.common.entity.V2XHistoryScenarioData;
|
||||
import com.mogo.module.v2x.fragment.V2XScenarioHistoryFragment;
|
||||
import com.mogo.module.v2x.utils.ThreadUtils;
|
||||
import com.mogo.module.v2x.utils.V2XSQLiteUtils;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -18,7 +20,9 @@ public class ScenarioHistoryPresenter extends Presenter<V2XScenarioHistoryFragme
|
||||
}
|
||||
|
||||
public void loadHistory() {
|
||||
List<V2XHistoryScenarioData> v2XHistoryScenarioData = V2XSQLiteUtils.getScenarioHistoryData();
|
||||
mView.loadHistory(v2XHistoryScenarioData);
|
||||
WorkThreadHandler.getInstance().post(() -> {
|
||||
List<V2XHistoryScenarioData> v2XHistoryScenarioData = V2XSQLiteUtils.getScenarioHistoryData();
|
||||
mView.loadHistory(v2XHistoryScenarioData);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,4 +62,19 @@ public class TrackUtils {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param type type=1 短距离角度匹配
|
||||
* type=2 历史轨迹匹配
|
||||
*/
|
||||
public static void trackV2xRoadProduceEvent(int type) {
|
||||
try {
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("type", type);
|
||||
V2XServiceManager.getMogoAnalytics().track(V2XConst.V2X_ROAD_PRODUCE, properties);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public class V2XNetworkLoadingView extends RelativeLayout {
|
||||
}
|
||||
}
|
||||
|
||||
public void stopWithError(String errormsg) {
|
||||
public void stopWithError(String errormsg, int showRefreshButton) {
|
||||
if (v2XAnimationManager != null) {
|
||||
v2XAnimationManager.soptWithError();
|
||||
}
|
||||
@@ -84,7 +84,7 @@ public class V2XNetworkLoadingView extends RelativeLayout {
|
||||
textView.setText(errormsg);
|
||||
}
|
||||
if (refresButton != null) {
|
||||
refresButton.setVisibility(VISIBLE);
|
||||
refresButton.setVisibility(showRefreshButton);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ public class V2XVoiceConstants {
|
||||
* 关闭路况详情
|
||||
*/
|
||||
public static final String COMMAND_V2X_TO_CLOSE_WINDOW_UN_WAKEUP = "COMMAND_V2X_TO_CLOSE_WINDOW_UN_WAKEUP";
|
||||
public static final String[] COMMAND_V2X_TO_CLOSE_WINDOW_UN_WAKEUP_WORDS = {"关闭"};
|
||||
public static final String[] COMMAND_V2X_TO_CLOSE_WINDOW_UN_WAKEUP_WORDS = {"关闭", "关闭页面"};
|
||||
/**
|
||||
* 应用内免唤醒
|
||||
* 反馈"正确"语音回调
|
||||
@@ -207,6 +207,24 @@ public class V2XVoiceConstants {
|
||||
public static final String COMMAND_ZHIDAO_V2X_ILLEGAL_PARKMARKER_FEEDBACK_MEIYONG_UN_WAKEUP = "COMMAND_ZHIDAO_V2X_ILLEGAL_PARKMARKER_FEEDBACK_MEIYONG_UN_WAKEUP";
|
||||
public static final String[] COMMAND_ZHIDAO_V2X_ILLEGAL_PARKMARKER_FEEDBACK_MEIYONG_UN_WAKEUP_WORDS = {"没用"};
|
||||
|
||||
/**
|
||||
* 出行动态
|
||||
*/
|
||||
public static final String COMMAND_ZHIDAO_V2X_OPEN_HISTORY_EVENT_UN_WAKEUP = "COMMAND_ZHIDAO_V2X_OPEN_HISTORY_EVENT_UN_WAKEUP";
|
||||
public static final String[] COMMAND_ZHIDAO_V2X_OPEN_HISTORY_EVENT_UN_WAKEUP_WORDS = {"出行动态"};
|
||||
|
||||
/**
|
||||
* 周边事件
|
||||
*/
|
||||
public static final String COMMAND_ZHIDAO_V2X_OPEN_SURROUNDING_EVENT_UN_WAKEUP = "COMMAND_ZHIDAO_V2X_OPEN_SURROUNDING_EVENT_UN_WAKEUP";
|
||||
public static final String[] COMMAND_ZHIDAO_V2X_OPEN_SURROUNDING_EVENT_UN_WAKEUP_WORDS = {"周边事件"};
|
||||
|
||||
/**
|
||||
* 我的分享
|
||||
*/
|
||||
public static final String COMMAND_ZHIDAO_V2X_OPEN_SHEAR_EVENT_UN_WAKEUP = "COMMAND_ZHIDAO_V2X_OPEN_SHEAR_EVENT_UN_WAKEUP";
|
||||
public static final String[] COMMAND_ZHIDAO_V2X_OPEN_SHEAR_EVENT_UN_WAKEUP_WORDS = {"我的分享"};
|
||||
|
||||
static {
|
||||
// 免唤醒 默认
|
||||
sVoiceCmds.put(COMMAND_V2X_TO_CHAT_MORE_UN_WAKEUP, COMMAND_V2X_TO_CHAT_MORE_UN_WAKEUP_WORDS);
|
||||
@@ -230,6 +248,10 @@ public class V2XVoiceConstants {
|
||||
sVoiceCmds.put(COMMAND_ZHIDAO_V2X_ILLEGAL_PARKMARKER_FEEDBACK_YOUYONG_UN_WAKEUP, COMMAND_ZHIDAO_V2X_ILLEGAL_PARKMARKER_FEEDBACK_YOUYONG_UN_WAKEUP_WORDS);
|
||||
sVoiceCmds.put(COMMAND_ZHIDAO_V2X_ILLEGAL_PARKMARKER_FEEDBACK_MEIYONG_UN_WAKEUP, COMMAND_ZHIDAO_V2X_ILLEGAL_PARKMARKER_FEEDBACK_MEIYONG_UN_WAKEUP_WORDS);
|
||||
|
||||
sVoiceCmds.put(COMMAND_ZHIDAO_V2X_OPEN_HISTORY_EVENT_UN_WAKEUP, COMMAND_ZHIDAO_V2X_OPEN_HISTORY_EVENT_UN_WAKEUP_WORDS);
|
||||
sVoiceCmds.put(COMMAND_ZHIDAO_V2X_OPEN_SURROUNDING_EVENT_UN_WAKEUP, COMMAND_ZHIDAO_V2X_OPEN_SURROUNDING_EVENT_UN_WAKEUP_WORDS);
|
||||
sVoiceCmds.put(COMMAND_ZHIDAO_V2X_OPEN_SHEAR_EVENT_UN_WAKEUP, COMMAND_ZHIDAO_V2X_OPEN_SHEAR_EVENT_UN_WAKEUP_WORDS);
|
||||
|
||||
|
||||
//默认
|
||||
/* sCmds.add(COMMAND_ZHIDAO_V2X_CALL_CHATTING);
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="40px"
|
||||
android:paddingBottom="40px">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/event_share_load_no_more"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:alpha="0.6"
|
||||
android:paddingTop="12px"
|
||||
android:paddingBottom="12px"
|
||||
android:text="没有更多记录了"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="18px" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/left_line"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0.5px"
|
||||
android:alpha="0.5"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="46px"
|
||||
android:layout_marginRight="16px"
|
||||
android:layout_toLeftOf="@id/event_share_load_no_more"
|
||||
android:background="#FFFFFF" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/right_line"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0.5px"
|
||||
android:alpha="0.5"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="16px"
|
||||
android:layout_marginRight="46px"
|
||||
android:layout_toRightOf="@id/event_share_load_no_more"
|
||||
android:background="#FFFFFF" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -1,100 +1,94 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<com.mogo.module.v2x.view.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/clPanelContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:background="#10121E"
|
||||
android:clickable="true"
|
||||
android:paddingStart="@dimen/dp_30"
|
||||
android:paddingEnd="@dimen/dp_30"
|
||||
android:visibility="gone"
|
||||
app:roundLayoutRadius="@dimen/dp_40"
|
||||
tools:visibility="visible">
|
||||
|
||||
<com.mogo.module.v2x.view.RoundConstraintLayout
|
||||
android:id="@+id/clPanelContainer"
|
||||
<RadioGroup
|
||||
android:id="@+id/rgTabSelect"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#10121E"
|
||||
android:clickable="true"
|
||||
android:paddingStart="@dimen/dp_30"
|
||||
android:paddingEnd="@dimen/dp_30"
|
||||
android:visibility="gone"
|
||||
app:roundLayoutRadius="@dimen/dp_40"
|
||||
tools:visibility="visible">
|
||||
android:layout_height="@dimen/dp_154"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/rgTabSelect"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_130"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
<RadioButton
|
||||
android:id="@+id/rbScenarioHistory"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:button="@null"
|
||||
android:checked="true"
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/dp_40"
|
||||
android:paddingEnd="@dimen/dp_40"
|
||||
android:text="出行动态"
|
||||
android:textColor="@color/radiobutton_textcolor"
|
||||
android:textSize="@dimen/dp_40"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbScenarioHistory"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:button="@null"
|
||||
android:checked="true"
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/dp_40"
|
||||
android:paddingEnd="@dimen/dp_40"
|
||||
android:text="出行动态"
|
||||
android:textColor="@color/radiobutton_textcolor"
|
||||
android:textSize="@dimen/dp_40"
|
||||
android:textStyle="bold" />
|
||||
<View
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="@dimen/dp_42"
|
||||
android:background="#757575" />
|
||||
|
||||
<View
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="@dimen/dp_42"
|
||||
android:background="#757575" />
|
||||
<RadioButton
|
||||
android:id="@+id/rbSurroundingEvent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:button="@null"
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/dp_40"
|
||||
android:paddingEnd="@dimen/dp_40"
|
||||
android:text="周边事件"
|
||||
android:textColor="@color/radiobutton_textcolor"
|
||||
android:textSize="@dimen/dp_40"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbSurroundingEvent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:button="@null"
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/dp_40"
|
||||
android:paddingEnd="@dimen/dp_40"
|
||||
android:text="周边事件"
|
||||
android:textColor="@color/radiobutton_textcolor"
|
||||
android:textSize="@dimen/dp_40"
|
||||
android:textStyle="bold" />
|
||||
<View
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="@dimen/dp_42"
|
||||
android:background="#757575" />
|
||||
|
||||
<View
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="@dimen/dp_42"
|
||||
android:background="#757575" />
|
||||
<RadioButton
|
||||
android:id="@+id/rbShareEvents"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:button="@null"
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/dp_40"
|
||||
android:paddingEnd="@dimen/dp_40"
|
||||
android:text="我的分享"
|
||||
android:textColor="@color/radiobutton_textcolor"
|
||||
android:textSize="@dimen/dp_40"
|
||||
android:textStyle="bold" />
|
||||
</RadioGroup>
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbShareEvents"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:button="@null"
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/dp_40"
|
||||
android:paddingEnd="@dimen/dp_40"
|
||||
android:text="我的分享"
|
||||
android:textColor="@color/radiobutton_textcolor"
|
||||
android:textSize="@dimen/dp_40"
|
||||
android:textStyle="bold" />
|
||||
</RadioGroup>
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/vpEventPanel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:nestedScrollingEnabled="false"
|
||||
android:overScrollMode="never"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rgTabSelect" />
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/vpEventPanel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:nestedScrollingEnabled="false"
|
||||
android:overScrollMode="never"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rgTabSelect" />
|
||||
<ImageView
|
||||
android:id="@+id/btnHidePanels"
|
||||
android:layout_width="@dimen/dp_88"
|
||||
android:layout_height="@dimen/dp_88"
|
||||
android:background="@drawable/icon_window_close"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/rgTabSelect"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/rgTabSelect" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btnHidePanels"
|
||||
android:layout_width="@dimen/dp_88"
|
||||
android:layout_height="@dimen/dp_88"
|
||||
android:background="@drawable/icon_window_close"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/rgTabSelect"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/rgTabSelect" />
|
||||
|
||||
</com.mogo.module.v2x.view.RoundConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</com.mogo.module.v2x.view.RoundConstraintLayout>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center">
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/no_share_image"
|
||||
@@ -14,29 +14,52 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/share_event_null_des"
|
||||
android:layout_below="@+id/no_share_image"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/no_share_image"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:gravity="bottom"
|
||||
android:alpha="0.7"
|
||||
android:layout_marginTop="12.6px"
|
||||
android:textSize="18px"
|
||||
android:alpha="0.7"
|
||||
android:gravity="bottom"
|
||||
android:text="你还没有分享过道路事件,快去试试吧"
|
||||
android:textColor="#FFFFFF" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/share_event_button"
|
||||
android:layout_width="150px"
|
||||
android:layout_height="48px"
|
||||
android:layout_below="@+id/share_event_null_des"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@drawable/bg_v2x_event_live_show"
|
||||
android:clickable="true"
|
||||
android:onClick="shareEventAction"
|
||||
android:layout_marginTop="21px"
|
||||
android:text="去分享"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="25sp" />
|
||||
android:textSize="18px" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="33px">
|
||||
|
||||
<Button
|
||||
android:id="@+id/share_event_button"
|
||||
android:layout_width="150px"
|
||||
android:layout_height="48px"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_toLeftOf="@id/center"
|
||||
android:background="@drawable/v2xt_dw_common_corner_bkg_dark"
|
||||
android:clickable="true"
|
||||
android:onClick="shareEventAction"
|
||||
android:text="去分享"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="18px" />
|
||||
|
||||
<View
|
||||
android:id="@+id/center"
|
||||
android:layout_width="29px"
|
||||
android:layout_height="29px"
|
||||
android:layout_centerInParent="true" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/refresh_button"
|
||||
android:layout_width="150px"
|
||||
android:layout_height="48px"
|
||||
android:layout_toRightOf="@id/center"
|
||||
android:background="@drawable/v2xt_dw_common_corner_bkg_light"
|
||||
android:text="刷新"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="18px" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
@@ -2,8 +2,8 @@
|
||||
"coordinates":[
|
||||
{
|
||||
"createTime":1593678359872,
|
||||
"distance":100,
|
||||
"lat":39.966668,
|
||||
"distance":1100,
|
||||
"lat":39.866668,
|
||||
"lon":116.411211,
|
||||
"sn":"ZD801B1932L00041",
|
||||
"targetId":20007,
|
||||
|
||||
@@ -51,7 +51,10 @@ public interface IMogoModuleProvider extends IProvider {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
IMogoModuleLifecycle getCardLifecycle();
|
||||
@Deprecated
|
||||
default IMogoModuleLifecycle getCardLifecycle() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 地图监听对象
|
||||
@@ -60,7 +63,9 @@ public interface IMogoModuleProvider extends IProvider {
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
IMogoMapListener getMapListener();
|
||||
default IMogoMapListener getMapListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是哪种类型的提供者
|
||||
@@ -78,7 +83,9 @@ public interface IMogoModuleProvider extends IProvider {
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
IMogoNaviListener getNaviListener();
|
||||
default IMogoNaviListener getNaviListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 定位变化监听:此接口接受地图定位信息
|
||||
@@ -87,7 +94,9 @@ public interface IMogoModuleProvider extends IProvider {
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
IMogoLocationListener getLocationListener();
|
||||
default IMogoLocationListener getLocationListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* marker 点击回调
|
||||
@@ -96,19 +105,27 @@ public interface IMogoModuleProvider extends IProvider {
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
IMogoMarkerClickListener getMarkerClickListener();
|
||||
default IMogoMarkerClickListener getMarkerClickListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模块对应 app 的包名
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String getAppPackage();
|
||||
@Deprecated
|
||||
default String getAppPackage() {
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取对应模块 app 名称
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String getAppName();
|
||||
@Deprecated
|
||||
default String getAppName() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user