Merge branch 'master' of gitlab.zhidaoauto.com:ecos/yycp-service/Launcher

# Conflicts:
#	gradle.properties
#	modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java
#	modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java
#	modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java
This commit is contained in:
wangcongtao
2020-08-03 17:54:28 +08:00
973 changed files with 33390 additions and 1305 deletions

View File

@@ -0,0 +1 @@
# 应用列表 + Launcher 模式下的左侧导航按钮

View File

@@ -45,7 +45,6 @@ dependencies {
implementation rootProject.ext.dependencies.material
annotationProcessor rootProject.ext.dependencies.aroutercompiler
implementation rootProject.ext.dependencies.androidxrecyclerview
implementation rootProject.ext.dependencies.guideshowprovider
if (Boolean.valueOf(RELEASE)) {
implementation rootProject.ext.dependencies.mogomap

View File

@@ -0,0 +1,4 @@
#-----AppModule-----
-keep class com.mogo.module.apps.model.AppEnum
-keep class com.mogo.module.apps.view.**{*;}
-keep class com.mogo.module.apps.AppFilter

View File

@@ -19,3 +19,8 @@
# If you keep the line number information, uncomment this to
# hide the original source file mName.
#-renamesourcefileattribute SourceFile
#-----AppModule-----
-keep class com.mogo.module.apps.model.AppEnum
-keep class com.mogo.module.apps.view.** {*;}
-keep class com.mogo.module.apps.AppFilter

View File

@@ -4,22 +4,10 @@ import android.content.Context;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.map.location.IMogoLocationClient;
import com.mogo.map.marker.IMogoMarkerManager;
import com.mogo.map.navi.IMogoNavi;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.module.common.entity.MarkerResponse;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.guideshow.provider.GuideShowProviderConstant;
import com.mogo.module.guideshow.provider.IGuideShowProvider;
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.connection.IMogoSocketManager;
import com.mogo.service.imageloader.IMogoImageloader;
import com.mogo.service.map.IMogoMapService;
import com.mogo.service.statusmanager.IMogoStatusManager;
/**
* author : zyz
@@ -35,13 +23,11 @@ public class AppServiceHandler {
private static IMogoServiceApis mApis;
private static IMogoCardManager mMogoCardManager;
private static IMogoAnalytics mMogoAnalytics;
private static IGuideShowProvider mMogoGuideShow;
public static void init( final Context context ) {
mApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation( context );
mMogoCardManager = mApis.getCardManagerApi();
mMogoAnalytics = mApis.getAnalyticsApi();
mMogoGuideShow = ( IGuideShowProvider ) ARouter.getInstance().build( GuideShowProviderConstant.GUIDE_SHOW_PROVIDER ).navigation( context );
}
@@ -53,10 +39,6 @@ public class AppServiceHandler {
return mMogoAnalytics;
}
public static IGuideShowProvider getMogoGuideShow() {
return mMogoGuideShow;
}
public static IMogoServiceApis getApis() {
if ( mApis == null ) {
mApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation( AbsMogoApplication.getApp() );

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

View File

@@ -1,9 +1,8 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.alibaba.arouter'
apply plugin: 'android-aspectjx'
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
@@ -51,7 +50,6 @@ dependencies {
implementation rootProject.ext.dependencies.androidxconstraintlayout
implementation rootProject.ext.dependencies.arouter
kapt rootProject.ext.dependencies.aroutercompiler
implementation rootProject.ext.dependencies.aspectj
if (Boolean.valueOf(RELEASE)) {
implementation rootProject.ext.dependencies.mogoutils

View File

@@ -0,0 +1,2 @@
#-----AuthorizeModule-----
-keep class com.mogo.module.authorize.module.bean.**{*;}

View File

@@ -19,3 +19,6 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-----AuthorizeModule-----
-keep class com.mogo.module.authorize.module.bean.**{*;}

View File

@@ -1,17 +0,0 @@
package com.mogo.module.authorize.aspectj
import org.aspectj.lang.annotation.Aspect
import org.aspectj.lang.annotation.Pointcut
@Aspect
class VoiceForbiddenWhenAuthorize {
companion object{
const val TAG = "VoiceForbiddenWhenAuthorize"
}
@Pointcut()
fun authorizeTrackPoint(){
}
}

View File

@@ -131,6 +131,7 @@ open class IMogoAuthorizeController {
}
}
onError {
//todo
Logger.d(TAG, it.message ?: "checkIfNeedAuthorize onError, message is null")
setAuthorizeStatus(agreementType, true)
}

View File

@@ -6,8 +6,6 @@ import com.mogo.module.authorize.authprovider.module.IMogoAcquireAuthorizeListen
import com.mogo.module.authorize.model.proxy.AuthorizeProxy
import com.mogo.module.authorize.model.proxy.toAuthorizeType
import com.mogo.module.authorize.util.SharedPreferenceUtil.needAuthorization
import com.mogo.module.authorize.util.SharedPreferenceUtil.setAuthorizeStatus
import com.mogo.module.authorize.util.isDeviceOfD
import com.mogo.utils.logger.Logger
open abstract class MogoAuthorizeManagerImpl : IMogoAuthorizeInvoke {
@@ -19,13 +17,9 @@ open abstract class MogoAuthorizeManagerImpl : IMogoAuthorizeInvoke {
private val baseController: IMogoAuthorizeController by lazy { IMogoAuthorizeController() }
override fun needAuthorize(tag: String): Boolean {
return if (isDeviceOfD()) {
Logger.d(TAG, "===== needAuthorize update agreement in background")
baseController.checkIfNeedAuthorize(tag.toAuthorizeType())
needAuthorization(tag.toAuthorizeType())
} else {
false
}
Logger.d(TAG, "===== needAuthorize update agreement in background")
baseController.checkIfNeedAuthorize(tag.toAuthorizeType())
return needAuthorization(tag.toAuthorizeType())
}
override fun updateAuthorizeStatus(tag: String) {

View File

@@ -9,24 +9,23 @@ import com.mogo.map.listener.IMogoMapListener
import com.mogo.map.location.IMogoLocationListener
import com.mogo.map.marker.IMogoMarkerClickListener
import com.mogo.map.navi.IMogoNaviListener
import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant.Companion.PATH_AGREEMENT_FRAGMENT
import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant.Companion.PATH_AGREEMENT_MODULE_NAME
import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.Companion.AUTHORIZE_TYPE_LAUNCHER_MAIN
import com.mogo.module.authorize.authprovider.launcher.MogoMainAuthorize.Companion.mogoAuthShow
import com.mogo.module.authorize.util.SharedPreferenceUtil.hasGuide
import com.mogo.module.authorize.util.isDeviceOfD
import com.mogo.service.MogoServicePaths
import com.mogo.service.auth.IMogoAuthManager
import com.mogo.service.module.IMogoModuleLifecycle
import com.mogo.service.module.IMogoModuleProvider
import com.mogo.service.module.ModuleType
import com.mogo.utils.logger.Logger
@Route(path = PATH_AGREEMENT_FRAGMENT)
class MogoAuthorizeProvider : IMogoModuleProvider {
@Route(path = MogoServicePaths.PATH_AGREEMENT)
class MogoAuthorizeProvider : IMogoAuthManager {
companion object {
const val TAG = "MogoAuthorizeProvider"
}
private var mContext:Context? = null
override fun createFragment(context: Context?, data: Bundle?): Fragment? {
return null
}
@@ -48,7 +47,7 @@ class MogoAuthorizeProvider : IMogoModuleProvider {
}
override fun getType(): Int {
return ModuleType.TYPE_SERVICE
return 0
}
override fun getNaviListener(): IMogoNaviListener? {
@@ -63,11 +62,10 @@ class MogoAuthorizeProvider : IMogoModuleProvider {
return null
}
override fun init(context: Context) {
//todo 引导判断暂时去掉 后续引导流程更改完再放开
// todo if (isDeviceOfD() && hasGuide() && mogoAuthShow.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_MAIN)) {
if (isDeviceOfD() && mogoAuthShow.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_MAIN)) {
mogoAuthShow.invokeAuthorizeForShow(context)
override fun showAuth(context: Context?) {
mContext = context
if (mogoAuthShow.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_MAIN)) {
mogoAuthShow.invokeAuthorizeForShow(mContext!!)
} else {
//首次进入Launcher同步一下授权状态防止由于用户清除数据造成首次加载还会出现授权状态不同步问题
mogoAuthShow.updateAuthorizeStatus(AUTHORIZE_TYPE_LAUNCHER_MAIN)
@@ -75,6 +73,16 @@ class MogoAuthorizeProvider : IMogoModuleProvider {
}
}
override fun dismiss() {
mogoAuthShow.hideAuthorizeView()
}
override fun init(context: Context) {
//todo 引导判断暂时去掉 后续引导流程更改完再放开
// todo if (isDeviceOfD() && hasGuide() && mogoAuthShow.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_MAIN)) {
// todo F系列暂时没有授权功能 1.1需求中添加 全量上
}
override fun getAppPackage(): String? {
return null
}
@@ -82,4 +90,5 @@ class MogoAuthorizeProvider : IMogoModuleProvider {
override fun getAppName(): String? {
return null
}
}

View File

@@ -6,11 +6,6 @@ class AuthorizeConstant {
const val PROVIDER_MODULE = "/authorize/biz"
const val PROVIDER_LAUNCHER = "/authorize/showbiz"
/**
* 展示用户协议模块地址
*/
const val PATH_AGREEMENT_FRAGMENT = "/agreement/showFragment"
/**
* provider模块实例名称(暂时仅有卡片用到)
*/

View File

@@ -2,15 +2,12 @@ package com.mogo.module.authorize.authprovider.launcher
import android.content.Context
import android.os.Looper
import com.mogo.commons.AbsMogoApplication
import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeManagerImpl
import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeRegisterHandler
import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant
import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.Companion.AUTHORIZE_TYPE_LAUNCHER_MAIN
import com.mogo.module.authorize.layout.AuthorizeLayout
import com.mogo.module.authorize.layout.AuthorizeDialog
import com.mogo.module.authorize.model.proxy.toAuthorizeType
import com.mogo.module.authorize.util.SharedPreferenceUtil.hasAuth
import com.mogo.module.common.wm.WindowManagerView
import com.mogo.utils.logger.Logger
class MogoMainAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMogoAuthorizeMainProvider {
@@ -24,7 +21,9 @@ class MogoMainAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMog
}
}
private var windowManagerView: WindowManagerView? = null
private var mContext: Context? = null
private var authorizeDialog: AuthorizeDialog? = null
override fun hasRegister(tag: String): Boolean {
if (tag.isNullOrBlank()) return false
@@ -41,7 +40,8 @@ class MogoMainAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMog
}
fun invokeAuthorizeForShow(context: Context) {
pushLayoutToMainWindow(context, AUTHORIZE_TYPE_LAUNCHER_MAIN)
mContext = context
pushLayoutToMainWindow(AUTHORIZE_TYPE_LAUNCHER_MAIN)
}
fun showAuthorizeView(tag: String, forbiddenVoice: (() -> Unit), onError: ((String) -> Unit)) {
@@ -64,25 +64,28 @@ class MogoMainAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMog
Logger.d(TAG, "ready to forbidden voice")
forbiddenVoice.invoke()
Logger.d(TAG, "ready to push fragment")
pushLayoutToMainWindow(AbsMogoApplication.getApp().applicationContext,tag)
pushLayoutToMainWindow(tag)
}
fun hideAuthorizeView() {
windowManagerView?.dismiss()
if (authorizeDialog != null && authorizeDialog!!.isShowing) {
authorizeDialog?.dismiss()
}
}
private fun pushLayoutToMainWindow(context: Context,tag: String) {
if (windowManagerView == null) {
val authorizeLayout = AuthorizeLayout(tag)
val view = authorizeLayout.getLayoutView()
windowManagerView = WindowManagerView.Builder(context).contentView(view).build()
private fun pushLayoutToMainWindow(tag: String) {
if (authorizeDialog == null) {
authorizeDialog = AuthorizeDialog(tag, mContext!!)
authorizeDialog!!.setOnDismissListener {
authorizeDialog = null
}
}
if (windowManagerView!!.isShowing) {
if (authorizeDialog!!.isShowing) {
Logger.d(TAG, "User is operation authorization, do not repeat invoke")
return
} else {
Logger.d(TAG, "pushLayoutToMainWindow")
windowManagerView!!.show()
authorizeDialog!!.show()
}
}

View File

@@ -0,0 +1,203 @@
package com.mogo.module.authorize.layout
import android.content.Context
import android.text.Html
import android.view.View
import android.widget.Button
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.debug.DebugConfig
import com.mogo.module.authorize.R
import com.mogo.module.authorize.util.AnalyticsUtil
import com.mogo.module.authorize.voice.IVoiceAuthorizeIntentListener
import com.mogo.module.authorize.voice.IVoiceCommandListener
import com.mogo.module.authorize.voice.VoiceUtil
import com.mogo.module.common.dialog.BaseFloatDialog
import com.mogo.utils.TipToast
import com.mogo.utils.logger.Logger
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.async
import kotlinx.coroutines.withContext
class AuthorizeDialog : BaseFloatDialog, View.OnClickListener, IVoiceCommandListener, IVoiceAuthorizeIntentListener {
companion object {
const val TAG = "AuthorizeDialog"
}
private var mContext: Context? = null
private var invokeTag: String? = null
private var agreementId: Long = 0L
private var clTopParent: ConstraintLayout? = null
private var clErrorContainer: ConstraintLayout? = null
private var clLoadAuthorizeContainer: ConstraintLayout? = null
private var clContainer: ConstraintLayout? = null
private var clAuthorizeLoading: ConstraintLayout? = null
private var btnAgree: Button? = null
private var btnDisAgree: Button? = null
private var btnLoadingError: Button? = null
private var tvTitle: TextView? = null
private var tvContent: TextView? = null
private var tvButtonContent: TextView? = null
private var tvLastContent: TextView? = null
private var authorizeController: AuthorizeController? = null
constructor(invokeTag: String, context: Context) : super(context) {
mContext = context
this.invokeTag = invokeTag
initView()
}
private fun initView() {
setContentView(R.layout.module_authorize_fragment)
setWrapContent()
initViews()
}
private fun setWrapContent() {
val mWindow = window
if(DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_BYD){
if (mWindow != null) {
val lp = mWindow.attributes
lp.width = 1024
lp.height = 600
mWindow.attributes = lp
}
}else{
if (mWindow != null) {
val lp = mWindow.attributes
lp.width = 1920
lp.height = 1000
mWindow.attributes = lp
}
}
}
fun initViews() {
Logger.d(TAG, "initView ")
AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_AUTHORIZE_SHOW)
init()
Logger.d(TAG, "invokeTag :$invokeTag")
authorizeController = AuthorizeController(invokeTag!!)
invokeAuthorizationContent()
VoiceUtil.registerAll(this, this)
}
private fun init() {
clTopParent = findViewById(R.id.clAuthorizeTopParent)
clErrorContainer = findViewById(R.id.clLoadingErrorContainer)
clLoadAuthorizeContainer = findViewById(R.id.clLoadingAuthorizeContainer)
clContainer = findViewById(R.id.clAuthorizeContainer)
clAuthorizeLoading = findViewById(R.id.clAuthorizeLoading)
btnAgree = findViewById(R.id.btnAuthorizeAgree)
btnDisAgree = findViewById(R.id.btnAuthorizeDisAgree)
btnLoadingError = findViewById(R.id.btnAuthorizeLoadingError)
tvTitle = findViewById(R.id.tvAuthorizeTitle)
tvContent = findViewById(R.id.tvAuthorizeContent)
tvButtonContent = findViewById(R.id.tvAuthorizeButtonContent)
tvLastContent = findViewById(R.id.tvAuthorizeLastContent)
btnAgree?.setOnClickListener(this)
btnDisAgree?.setOnClickListener(this)
btnLoadingError?.setOnClickListener(this)
clTopParent?.setOnClickListener(this)
clContainer?.setOnClickListener(this)
clErrorContainer?.setOnClickListener(this)
clLoadAuthorizeContainer?.setOnClickListener(this)
clAuthorizeLoading?.setOnClickListener(this)
}
private fun readyToAuthorize() {
clErrorContainer?.visibility = View.GONE
clLoadAuthorizeContainer?.visibility = View.VISIBLE
}
private fun showAuthorizationAgreementContent(
agreementId: Long,
agreementContent: String,
agreementTitle: String,
agreementBottom: String,
agreementLast: String) {
VoiceUtil.speak(AbsMogoApplication.getApp().applicationContext.resources.getString(R.string.module_authorize_agreement_tip), AbsMogoApplication.getApp().applicationContext, this)
this.agreementId = agreementId
clLoadAuthorizeContainer?.visibility = View.GONE
clContainer?.visibility = View.VISIBLE
tvTitle?.text = Html.fromHtml(agreementTitle)
GlobalScope.async(Dispatchers.IO) {
val spannable = Html.fromHtml(agreementContent)
withContext(Dispatchers.Main) {
tvContent?.text = spannable
}
}
tvButtonContent?.text = Html.fromHtml(agreementBottom)
tvLastContent?.text = Html.fromHtml(agreementLast)
}
private fun showAuthorizationError() {
clLoadAuthorizeContainer?.visibility = View.GONE
clErrorContainer?.visibility = View.VISIBLE
}
private fun voiceAuthorizeError() {
TipToast.shortTip("授权失败,请稍后重试")
VoiceUtil.speak(AbsMogoApplication.getApp().applicationContext.getString(R.string.module_authorize_failed), AbsMogoApplication.getApp().applicationContext, this)
Logger.d(TAG, "onDestroy")
VoiceUtil.unregisterAll(AbsMogoApplication.getApp().applicationContext, this)
}
override fun onClick(v: View) {
when (v.id) {
R.id.btnAuthorizeAgree -> {
AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_AUTHORIZE_CLICK, hashMapOf("operation_type" to 1, "operation_result" to 1))
agreeAuthorize()
}
R.id.btnAuthorizeDisAgree -> {
AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_AUTHORIZE_CLICK, hashMapOf("operation_type" to 1, "operation_result" to 2))
disAgreeAuthorize()
}
R.id.clLoadingErrorContainer, R.id.btnAuthorizeLoadingError -> {
invokeAuthorizationContent()
}
R.id.clAuthorizeTopParent -> {
Logger.i(TAG, "dismiss authorizeView")
authorizeController?.onDestroy()
}
}
}
override fun onVoiceCmdAgree() {
AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_AUTHORIZE_CLICK, hashMapOf("operation_type" to 2, "operation_result" to 1))
agreeAuthorize()
}
override fun onVoiceCmdDisAgree() {
AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_AUTHORIZE_CLICK, hashMapOf("operation_type" to 2, "operation_result" to 2))
disAgreeAuthorize()
}
private fun agreeAuthorize() {
authorizeController?.agreeAuthorize(invokeTag!!, agreementId) {
voiceAuthorizeError()
}
}
private fun disAgreeAuthorize() {
authorizeController?.disAgreeAuthorize(invokeTag!!, agreementId) {
voiceAuthorizeError()
}
}
private fun invokeAuthorizationContent() {
authorizeController?.invokeAuthorizationContent(invokeTag!!, {
readyToAuthorize()
}, { id: Long, content: String, title: String, bottomContent: String, lastContent: String ->
showAuthorizationAgreementContent(id, content, title, bottomContent, lastContent)
}, {
showAuthorizationError()
})
}
}

View File

@@ -50,11 +50,11 @@ class AuthorizeLayout(private val invokeTag: String) : View.OnClickListener, IVo
return layoutInflater
}
private fun getLayoutId(): Int {
fun getLayoutId(): Int {
return R.layout.module_authorize_fragment
}
private fun initViews(mRootView: View) {
fun initViews(mRootView: View) {
Logger.d(TAG, "initView ")
AnalyticsUtil.track(INVOKE_TRACK_AUTHORIZE_SHOW)
init(mRootView)

View File

@@ -1,10 +0,0 @@
package com.mogo.module.authorize.util
import com.mogo.module.common.utils.CarSeries.*
fun isDeviceOfD(): Boolean {
return when (getSeries()) {
CAR_SERIES_D80X, CAR_SERIES_D81X, CAR_SERIES_D82X, CAR_SERIES_D84X -> true
else -> false
}
}

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape>
<corners android:radius="@dimen/dp_59" />
<gradient android:endColor="#805CC1FF" android:startColor="#803E7FFC" />
</shape>
</item>
<item>
<shape>
<corners android:radius="@dimen/dp_59" />
<gradient android:endColor="#5CC1FF" android:startColor="#3E7FFC" />
</shape>
</item>
</selector>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape>
<corners android:bottomLeftRadius="@dimen/dp_30" />
<gradient android:endColor="#805CC1FF" android:startColor="#803E7FFC" />
</shape>
</item>
<item>
<shape>
<corners android:bottomLeftRadius="@dimen/dp_30" />
<gradient android:endColor="#5CC1FF" android:startColor="#3E7FFC" />
</shape>
</item>
</selector>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/dp_30" />
<gradient
android:endColor="#3F4057"
android:startColor="#50526E " />
</shape>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape>
<corners android:bottomRightRadius="@dimen/dp_30" />
<gradient android:endColor="#803F4057" android:startColor="#8050526E" />
</shape>
</item>
<item>
<shape>
<corners android:bottomRightRadius="@dimen/dp_30" />
<gradient android:endColor="#3F4057" android:startColor="#50526E " />
</shape>
</item>
</selector>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:topLeftRadius="@dimen/dp_30" android:topRightRadius="@dimen/dp_30" />
<gradient
android:endColor="#2A2B38"
android:startColor="#3F4057" />
</shape>

View File

@@ -0,0 +1,210 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/clAuthorizeTopParent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#CC000000">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/clLoadingAuthorizeContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/dp_301"
android:layout_marginTop="@dimen/dp_100"
android:layout_marginRight="@dimen/dp_301"
android:layout_marginBottom="@dimen/dp_100"
android:background="@drawable/module_authorize_selector_dark_corner"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/clAuthorizeLoading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/ivAuthorizeLoading"
android:layout_width="@dimen/dp_154"
android:layout_height="@dimen/dp_154"
android:src="@mipmap/module_authorize_loading"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvAuthorizeLoading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_40"
android:text="@string/module_authorize_agreement_loading"
android:textColor="#99FFFFFF"
android:textSize="@dimen/dp_40"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ivAuthorizeLoading" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/clLoadingErrorContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/dp_301"
android:layout_marginTop="@dimen/dp_100"
android:layout_marginRight="@dimen/dp_301"
android:layout_marginBottom="@dimen/dp_100"
android:background="@drawable/module_authorize_selector_dark_corner"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<Button
android:id="@+id/btnAuthorizeLoadingError"
android:layout_width="@dimen/dp_400"
android:layout_height="@dimen/dp_110"
android:layout_marginTop="@dimen/dp_71"
android:background="@drawable/module_authorize_selector_blue_corner"
android:gravity="center"
android:text="@string/module_authorize_agreement_retry"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_40"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvAuthorizeLoadingError" />
<ImageView
android:id="@+id/ivAuthorizeLoadingError"
android:layout_width="@dimen/dp_125"
android:layout_height="@dimen/dp_125"
android:layout_marginTop="@dimen/dp_155"
android:src="@mipmap/module_authorize_loading_error"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvAuthorizeLoadingError"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_29"
android:text="@string/module_authorize_agreement_error"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_40"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ivAuthorizeLoadingError" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/clAuthorizeContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/dp_301"
android:layout_marginTop="@dimen/dp_100"
android:layout_marginRight="@dimen/dp_301"
android:layout_marginBottom="@dimen/dp_100"
android:background="@drawable/module_authorize_selector_dark_corner"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<Button
android:id="@+id/btnAuthorizeAgree"
android:layout_width="0px"
android:layout_height="@dimen/dp_123"
android:background="@drawable/module_authorize_selector_blue_left_corner"
android:gravity="center"
android:text="@string/module_authorize_agreement_agree"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_40"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@+id/btnAuthorizeDisAgree" />
<Button
android:id="@+id/btnAuthorizeDisAgree"
android:layout_width="0px"
android:layout_height="@dimen/dp_123"
android:background="@drawable/module_authorize_selector_dark_right_corner"
android:gravity="center"
android:text="@string/module_authorize_agreement_disagree"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_40"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toRightOf="@+id/btnAuthorizeAgree"
app:layout_constraintRight_toRightOf="parent" />
<ScrollView
android:layout_width="0px"
android:layout_height="0px"
android:layout_marginBottom="@dimen/dp_123"
android:scrollbarSize="@dimen/dp_442"
android:layout_marginTop="@dimen/dp_35"
android:scrollbarTrackHorizontal="@drawable/module_authorize_scrollbar"
android:scrollbarThumbVertical="@drawable/module_authorize_scrollbar"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvAuthorizeTitle">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/dp_55"
android:layout_marginRight="@dimen/dp_55"
android:orientation="vertical">
<TextView
android:id="@+id/tvAuthorizeContent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:lineSpacingExtra="@dimen/dp_15"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_36" />
<TextView
android:id="@+id/tvAuthorizeButtonContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_36" />
<TextView
android:id="@+id/tvAuthorizeLastContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/dp_15"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_36" />
</LinearLayout>
</ScrollView>
<TextView
android:id="@+id/tvAuthorizeTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_62"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_42"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1 @@
# Launcher 模式下分体机F系列的返回桌面悬浮按钮 和 "返回桌面"语音指令

View File

@@ -1,6 +1,6 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.alibaba.arouter'
android {

View File

@@ -0,0 +1,2 @@
#-----ModuleBack-----
-keep class com.mogo.module.back.BackToLauncherConst.*{*;}

View File

@@ -19,3 +19,6 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-----ModuleBack-----
-keep class com.mogo.module.back.BackToLauncherConst.*{*;}

View File

@@ -0,0 +1,11 @@
# 基础框架
## 基于 WindowManger.addView 方式实现的弹窗
## 大而全数据定义
## 地图中心点控制策略
## 自研车机类型判断
## 模块加载类

View File

@@ -0,0 +1,8 @@
#-----CommonModule-----
-keep class com.mogo.module.common.entity.** {*;}
-keep class com.mogo.module.common.map.Interrupter
-keep class com.mogo.module.common.map.Scene
-keep class com.mogo.module.common.wm.** {*;}
-keep class com.mogo.module.common.ModuleNames
-keep class com.mogo.module.common.ModuleType
-keep class com.mogo.module.common.MogoModulePaths

View File

@@ -19,3 +19,10 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-----CommonModule-----
-keep class com.mogo.module.common.entity.** {*;}
-keep class com.mogo.module.common.map.Interrupter
-keep class com.mogo.module.common.map.Scene
-keep class com.mogo.module.common.wm.** {*;}
-keep class com.mogo.module.common.MogoModulePaths

View File

@@ -6,6 +6,7 @@ import android.view.WindowManager;
import androidx.annotation.NonNull;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.module.common.R;
/**
@@ -20,7 +21,9 @@ public class BaseFloatDialog extends Dialog {
public BaseFloatDialog(@NonNull Context context, int themeResId) {
super(context, themeResId);
addFlag();
if(DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_BYD) {
addFlag();
}
}
private void addFlag() {

View File

@@ -0,0 +1,88 @@
package com.mogo.module.common.entity;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
/**
* author : donghongyu
* e-mail : 1358506549@qq.com
* date : 2020/3/11 4:25 PM
* desc : V2X事件列表展示
* version: 1.0
*/
public class V2XEventShowEntity implements Serializable {
// 0---默认展示详情1--直播4--道路事件详情
private int viewType;
// 道路事件详情
private V2XRoadEventEntity v2XRoadEventEntity;
// 直播车机 @see viewType = 1
private V2XLiveCarInfoEntity v2XLiveCarInfoRes;
// 直播车机列表
private List<V2XLiveCarInfoEntity> v2XLiveCarList;
public int getViewType() {
return viewType;
}
public void setViewType(int viewType) {
this.viewType = viewType;
}
public V2XRoadEventEntity getV2XRoadEventEntity() {
return v2XRoadEventEntity;
}
public void setV2XRoadEventEntity(V2XRoadEventEntity v2XRoadEventEntity) {
this.v2XRoadEventEntity = v2XRoadEventEntity;
}
public V2XLiveCarInfoEntity getV2XLiveCarInfoRes() {
return v2XLiveCarInfoRes;
}
public void setV2XLiveCarInfoRes(V2XLiveCarInfoEntity v2XLiveCarInfoRes) {
this.v2XLiveCarInfoRes = v2XLiveCarInfoRes;
}
public List<V2XLiveCarInfoEntity> getV2XLiveCarList() {
return v2XLiveCarList;
}
public void setV2XLiveCarList(List<V2XLiveCarInfoEntity> v2XLiveCarList) {
this.v2XLiveCarList = v2XLiveCarList;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
V2XEventShowEntity that = (V2XEventShowEntity) o;
return viewType == that.viewType &&
Objects.equals(v2XRoadEventEntity, that.v2XRoadEventEntity) &&
Objects.equals(v2XLiveCarInfoRes, that.v2XLiveCarInfoRes) &&
Objects.equals(v2XLiveCarList, that.v2XLiveCarList);
}
@Override
public int hashCode() {
return Objects.hash(viewType, v2XRoadEventEntity, v2XLiveCarInfoRes, v2XLiveCarList);
}
@Override
public String toString() {
return "V2XEventShowEntity{" +
"viewType=" + viewType +
", v2XRoadEventEntity=" + v2XRoadEventEntity +
", v2XLiveCarInfoRes=" + v2XLiveCarInfoRes +
", v2XLiveCarList=" + v2XLiveCarList +
'}';
}
}

View File

@@ -0,0 +1,66 @@
package com.mogo.module.common.entity;
import java.util.Objects;
/**
* 可直播车机基本信息,再通过 appDataService/integratedServices/app/push/no/livePush/v1
* 获取直播信息
* @author donghongyu
*/
public class V2XLiveCarInfoEntity {
private String sn;
private double lon;
private double lat;
public String getSn() {
return sn;
}
public void setSn(String sn) {
this.sn = sn;
}
public double getLon() {
return lon;
}
public void setLon(double lon) {
this.lon = lon;
}
public double getLat() {
return lat;
}
public void setLat(double lat) {
this.lat = lat;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
V2XLiveCarInfoEntity that = (V2XLiveCarInfoEntity) o;
return Double.compare(that.lon, lon) == 0 &&
Double.compare(that.lat, lat) == 0 &&
Objects.equals(sn, that.sn);
}
@Override
public int hashCode() {
return Objects.hash(sn, lon, lat);
}
@Override
public String toString() {
return "V2XLiveCarEntity{" +
"sn='" + sn + '\'' +
", lon=" + lon +
", lat=" + lat +
'}';
}
}

View File

@@ -0,0 +1,125 @@
package com.mogo.module.common.entity;
import androidx.annotation.IntDef;
import java.io.Serializable;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Objects;
/**
* e-mail : 1358506549@qq.com
* date : 2020/5/15 4:35 PM
* desc : V2X 场景消息聚合
* version: 1.0
*
* @author donghongyu
*/
public class V2XMessageEntity<T> implements Serializable {
/**
* 场景类型
*
* @see V2XTypeEnum
*/
@MessageType
int type;
/**
* 是否展示对话框
* true-展示false-不展示
*/
boolean showState;
/**
* 场景具体的数据内容
*/
T content;
public int getType() {
return type;
}
public void setType(@MessageType int type) {
this.type = type;
}
public boolean isShowState() {
return showState;
}
public void setShowState(boolean showState) {
this.showState = showState;
}
public T getContent() {
return content;
}
public void setContent(T content) {
this.content = content;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
V2XMessageEntity<?> that = (V2XMessageEntity<?>) o;
return type == that.type &&
content.equals(that.content);
}
@Override
public int hashCode() {
return Objects.hash(type, content);
}
/**
* V2X 场景类型
*/
public interface V2XTypeEnum {
// 道路事件预警
int ALERT_ROAD_WARNING = 1_000;
// 他车求助预警
int ALERT_SEEK_WARNING = 1_001;
// 疲劳驾驶预警
int ALERT_FATIGUE_DRIVING = 1_002;
// 后台推送展示 Window
int ALERT_PUSH_WINDOW_WARNING = 1_003;
// 后台推送展示 Toast
int ALERT_PUSH_TOAST_WARNING = 1_004;
// 后台推送展示 展示的直播
int ALERT_PUSH_LIVE_CAR_WARNING = 1_005;
// V2X场景动画展示
int ALERT_ANIMATION_WARNING = 1_006;
// 道路事件直播预警
int ALERT_ROAD_LIVE_CAR_WARNING = 1_007;
// 道路事件违章停车
int ALERT_ILLEGAL_PARK_WARNING = 1_008;
// 自车求助
int ALERT_CAR_FOR_HELP = 8_000;
}
@IntDef(value = {
V2XTypeEnum.ALERT_ROAD_WARNING,
V2XTypeEnum.ALERT_SEEK_WARNING,
V2XTypeEnum.ALERT_FATIGUE_DRIVING,
V2XTypeEnum.ALERT_PUSH_WINDOW_WARNING,
V2XTypeEnum.ALERT_PUSH_TOAST_WARNING,
V2XTypeEnum.ALERT_PUSH_LIVE_CAR_WARNING,
V2XTypeEnum.ALERT_ANIMATION_WARNING,
V2XTypeEnum.ALERT_ROAD_LIVE_CAR_WARNING,
V2XTypeEnum.ALERT_ILLEGAL_PARK_WARNING,
V2XTypeEnum.ALERT_CAR_FOR_HELP,
})
@Target({
ElementType.PARAMETER,
ElementType.FIELD,
ElementType.METHOD,
}) //表示注解作用范围,参数注解,成员注解,方法注解
@Retention(RetentionPolicy.SOURCE) //表示注解所存活的时间,在运行时,而不会存在 .class 文件中
public @interface MessageType { //接口,定义新的注解类型
}
}

View File

@@ -0,0 +1,31 @@
package com.mogo.module.common.entity;
/**
* author : donghongyu
* e-mail : 1358506549@qq.com
* date : 2020/3/31 4:53 PM
* desc : V2X 道路事件类型
* version: 1.0
*/
public interface V2XPoiTypeEnum extends MarkerPoiTypeEnum {
// 前方静止or慢速车辆报警
String ALERT_FRONT_CAR = "99999";
// 限行管理
String ALERT_TRAFFIC_CONTROL = "99998";
// 红绿灯事件、是建议以多少速度驶过
String ALERT_TRAFFIC_LIGHT_SUGGEST = "99997";
// 红绿灯事件、一种是绿灯不足3秒
String ALERT_TRAFFIC_LIGHT_WARNING = "99996";
// 故障车辆
int ALERT_CAR_TROUBLE_WARNING = 20007;
// TODO 这里目前是演示DEMO会用到想着是打算商用先这么处理的
// 取快递
String ALERT_TRAFFIC_EXPRESS = "99995";
// 顺风车
String ALERT_TRAFFIC_TAXI = "99994";
// 疲劳驾驶
String ALERT_FATIGUE_DRIVING = "99993";
// 违章停车
String ALERT_ILLEGAL_PARK = "99992";
}

View File

@@ -0,0 +1,264 @@
package com.mogo.module.common.entity;
import android.text.TextUtils;
import java.io.Serializable;
import java.util.Objects;
/**
* author : donghongyu
* e-mail : 1358506549@qq.com
* date : 2020-02-0315:49
* desc : V2X警报数据
* version: 1.0
*/
public class V2XPushMessageEntity implements Serializable {
// 0---默认展示详情1--直播2--停车场3--加油站4--道路事件详情
private int viewType;
private String sceneId;
private String sceneName;
private short sceneCategory;
private short sceneLevel;
private String sceneDescription;
private boolean zoom;
private int zoomScale;
private String alarmContent;
private String tts;
private String videoUrl;
private String videoSn;
private String videoChannel;
private int expireTime;
private double lat;
private double lon;
private String sn;
private String headImgUrl;
private String msgImgUrl;
private String address;
private double distance;
private boolean isShowWindow;
public int getViewType() {
return viewType;
}
public void setViewType(int viewType) {
this.viewType = viewType;
}
public String getSceneId() {
return sceneId;
}
public void setSceneId(String sceneId) {
this.sceneId = sceneId;
}
public String getSceneName() {
return sceneName;
}
public void setSceneName(String sceneName) {
this.sceneName = sceneName;
}
public short getSceneCategory() {
return sceneCategory;
}
public void setSceneCategory(short sceneCategory) {
this.sceneCategory = sceneCategory;
}
public short getSceneLevel() {
return sceneLevel;
}
public void setSceneLevel(short sceneLevel) {
this.sceneLevel = sceneLevel;
}
public String getSceneDescription() {
return sceneDescription;
}
public void setSceneDescription(String sceneDescription) {
this.sceneDescription = sceneDescription;
}
public boolean isZoom() {
return zoom;
}
public void setZoom(boolean zoom) {
this.zoom = zoom;
}
public String getAlarmContent() {
if (TextUtils.isEmpty(alarmContent)) {
return "";
}
return alarmContent;
}
public void setAlarmContent(String alarmContent) {
this.alarmContent = alarmContent;
}
public String getTts() {
if (TextUtils.isEmpty(tts)) {
return "";
}
return tts;
}
public void setTts(String tts) {
this.tts = tts;
}
public String getVideoUrl() {
return videoUrl;
}
public void setVideoUrl(String videoUrl) {
this.videoUrl = videoUrl;
}
public String getVideoSn() {
return videoSn;
}
public void setVideoSn(String videoSn) {
this.videoSn = videoSn;
}
public String getVideoChannel() {
return videoChannel;
}
public void setVideoChannel(String videoChannel) {
this.videoChannel = videoChannel;
}
public int getExpireTime() {
return expireTime;
}
public void setExpireTime(int expireTime) {
this.expireTime = expireTime;
}
public int getZoomScale() {
return zoomScale;
}
public void setZoomScale(int zoomScale) {
this.zoomScale = zoomScale;
}
public double getLat() {
return lat;
}
public void setLat(double lat) {
this.lat = lat;
}
public double getLon() {
return lon;
}
public void setLon(double lon) {
this.lon = lon;
}
public String getSn() {
return sn;
}
public void setSn(String sn) {
this.sn = sn;
}
public String getHeadImgUrl() {
return headImgUrl;
}
public void setHeadImgUrl(String headImgUrl) {
this.headImgUrl = headImgUrl;
}
public String getMsgImgUrl() {
return msgImgUrl;
}
public void setMsgImgUrl(String msgImgUrl) {
this.msgImgUrl = msgImgUrl;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public double getDistance() {
return distance;
}
public void setDistance(double distance) {
this.distance = distance;
}
public boolean isShowWindow() {
return isShowWindow;
}
public void setShowWindow(boolean showWindow) {
isShowWindow = showWindow;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
V2XPushMessageEntity that = (V2XPushMessageEntity) o;
return Objects.equals(sceneId, that.sceneId) &&
Objects.equals(tts, that.tts);
}
@Override
public int hashCode() {
return Objects.hash(sceneId, tts);
}
@Override
public String toString() {
return "V2XPushMessageEntity{" +
"viewType=" + viewType +
", sceneId='" + sceneId + '\'' +
", sceneName='" + sceneName + '\'' +
", sceneCategory=" + sceneCategory +
", sceneLevel=" + sceneLevel +
", sceneDescription='" + sceneDescription + '\'' +
", zoom=" + zoom +
", zoomScale=" + zoomScale +
", alarmContent='" + alarmContent + '\'' +
", tts='" + tts + '\'' +
", videoUrl='" + videoUrl + '\'' +
", videoSn='" + videoSn + '\'' +
", videoChannel='" + videoChannel + '\'' +
", expireTime=" + expireTime +
", lat=" + lat +
", lon=" + lon +
", sn='" + sn + '\'' +
", headImgUrl='" + headImgUrl + '\'' +
", msgImgUrl='" + msgImgUrl + '\'' +
", address='" + address + '\'' +
", distance=" + distance +
", isShowWindow=" + isShowWindow +
'}';
}
}

View File

@@ -0,0 +1,298 @@
package com.mogo.module.common.entity;
import android.text.TextUtils;
import java.io.Serializable;
import java.util.Objects;
/**
* author : donghongyu
* e-mail : 1358506549@qq.com
* date : 2020/4/13 11:17 AM
* desc : 道路事件的聚合位置、详情用于V2X情况下展示
* version: 1.0
*/
public class V2XRoadEventEntity implements Serializable {
/**
* @see MarkerPoiTypeEnum
*/
// 事件类型
private String poiType;
// 事件位置
private MarkerLocation location;
// 具体的信息
private MarkerExploreWay noveltyInfo;
// tts 提示
private String tts;
// ADAS 展示文案
private String alarmContent;
// 距离当前车辆的距离
private double distance;
// 默认展示时间
private int expireTime;
// 展示Button
private boolean isShowEventButton;
// 绑定 MarkerView 的数据, 业务需要啥数据就传入啥数据
private Object bindObj;
public MarkerLocation getLocation() {
return location;
}
public void setLocation(MarkerLocation location) {
this.location = location;
}
public String getPoiType() {
if (TextUtils.isEmpty(poiType)) {
return "";
}
return poiType;
}
public void setPoiType(String poiType) {
this.poiType = poiType;
}
public String getTts(boolean haveLiveCar) {
tts = "前方#" + (int) getDistance() + "米#";
switch (getPoiType()) {
// 停车场
case V2XPoiTypeEnum.FOURS_PARKING:
tts += "停车场";
break;
// 加油站
case V2XPoiTypeEnum.GAS_STATION:
tts += "加油站";
break;
// 交通检查
case V2XPoiTypeEnum.TRAFFIC_CHECK:
tts += "交通检查";
break;
// 封路
case V2XPoiTypeEnum.ROAD_CLOSED:
tts += "道路封路";
break;
// 施工
case V2XPoiTypeEnum.FOURS_ROAD_WORK:
tts += "道路施工";
break;
// 拥堵
case V2XPoiTypeEnum.FOURS_BLOCK_UP:
tts += "道路拥堵";
break;
// 积水
case V2XPoiTypeEnum.FOURS_PONDING:
tts += "道路积水";
break;
// 浓雾
case V2XPoiTypeEnum.FOURS_FOG:
tts += "出现浓雾";
break;
// 结冰
case V2XPoiTypeEnum.FOURS_ICE:
tts += "路面结冰";
break;
// 事故
case V2XPoiTypeEnum.FOURS_ACCIDENT:
tts += "交通事故";
break;
default:
tts += "道路事件";
break;
}
if (haveLiveCar) {
tts += ",查看实况请说确定。";
setShowEventButton(true);
} else {
tts += ",请注意躲避。";
setShowEventButton(false);
}
return tts;
}
/**
* 检测到附近#道路施工#,确认该信息是否正确?您可以说“正确”或“错误”帮助其他车友。
*/
public String getTtsWithFeedback() {
tts = "检测到附近";
switch (getPoiType()) {
// 停车场
case V2XPoiTypeEnum.FOURS_PARKING:
tts += "有停车场";
break;
// 加油站
case V2XPoiTypeEnum.GAS_STATION:
tts += "有加油站";
break;
// 交通检查
case V2XPoiTypeEnum.TRAFFIC_CHECK:
tts += "交通检查";
break;
// 封路
case V2XPoiTypeEnum.ROAD_CLOSED:
tts += "封路";
break;
// 施工
case V2XPoiTypeEnum.FOURS_ROAD_WORK:
tts += "施工";
break;
// 拥堵
case V2XPoiTypeEnum.FOURS_BLOCK_UP:
tts += "道路拥堵";
break;
// 积水
case V2XPoiTypeEnum.FOURS_PONDING:
tts += "道路积水";
break;
// 浓雾
case V2XPoiTypeEnum.FOURS_FOG:
tts += "出现浓雾";
break;
// 结冰
case V2XPoiTypeEnum.FOURS_ICE:
tts += "路面结冰";
break;
// 事故
case V2XPoiTypeEnum.FOURS_ACCIDENT:
tts += "交通事故";
break;
default:
tts += "道路事件";
break;
}
tts += ",确认该信息是否正确?您可以说“正确”或“错误”帮助其他车友。";
return tts;
}
public String getTts() {
return tts;
}
public void setTts(String tts) {
this.tts = tts;
}
public boolean isShowEventButton() {
return isShowEventButton;
}
public void setShowEventButton(boolean showEventButton) {
isShowEventButton = showEventButton;
}
public String getAlarmContent() {
switch (getPoiType()) {
// 停车场
case V2XPoiTypeEnum.FOURS_PARKING:
alarmContent = "停车场附近";
break;
// 加油站
case V2XPoiTypeEnum.GAS_STATION:
alarmContent = "加油站附近";
break;
// 交通检查
case V2XPoiTypeEnum.TRAFFIC_CHECK:
alarmContent = "前方交通检查";
break;
// 封路
case V2XPoiTypeEnum.ROAD_CLOSED:
alarmContent = "前方封路";
break;
// 施工
case V2XPoiTypeEnum.FOURS_ROAD_WORK:
alarmContent = "前方施工";
break;
// 拥堵
case V2XPoiTypeEnum.FOURS_BLOCK_UP:
alarmContent = "前方道路拥堵";
break;
// 积水
case V2XPoiTypeEnum.FOURS_PONDING:
alarmContent = "前方道路积水";
break;
// 浓雾
case V2XPoiTypeEnum.FOURS_FOG:
alarmContent = "前方出现浓雾";
break;
// 结冰
case V2XPoiTypeEnum.FOURS_ICE:
alarmContent = "前方路面结冰";
break;
// 事故
case V2XPoiTypeEnum.FOURS_ACCIDENT:
alarmContent = "前方交通事故";
break;
default:
tts += "道路事件";
break;
}
return alarmContent;
}
public void setAlarmContent(String alarmContent) {
this.alarmContent = alarmContent;
}
public double getDistance() {
return distance;
}
public void setDistance(double distance) {
this.distance = distance;
}
public int getExpireTime() {
return expireTime;
}
public void setExpireTime(int expireTime) {
this.expireTime = expireTime;
}
public MarkerExploreWay getNoveltyInfo() {
return noveltyInfo;
}
public void setNoveltyInfo(MarkerExploreWay noveltyInfo) {
this.noveltyInfo = noveltyInfo;
}
public Object getBindObj() {
return bindObj;
}
public void setBindObj(Object bindObj) {
this.bindObj = bindObj;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
V2XRoadEventEntity that = (V2XRoadEventEntity) o;
return Objects.equals(noveltyInfo.getInfoId(), that.noveltyInfo.getInfoId()) &&
Objects.equals(poiType, that.poiType);
}
@Override
public int hashCode() {
return Objects.hash(poiType, noveltyInfo.getInfoId());
}
@Override
public String toString() {
return "V2XRoadEventEntity{" +
"poiType='" + poiType + '\'' +
", location=" + location +
", noveltyInfo=" + noveltyInfo +
", tts='" + tts + '\'' +
", alarmContent='" + alarmContent + '\'' +
", distance=" + distance +
", expireTime=" + expireTime +
", isShowEventButton=" + isShowEventButton +
", bindObj=" + bindObj +
'}';
}
}

View File

@@ -0,0 +1,27 @@
package com.mogo.module.common.entity;
/**
* author : donghongyu
* e-mail : 1358506549@qq.com
* date : 2020/3/31 4:53 PM
* desc : V2X 道路提醒类型
* version: 1.0
*/
public interface V2XWindowTypeEnum {
// 默认展示详情
int DEFAULT_WINDOW = 0;
// 直播
int LIVE_CAR_WINDOW = 1;
// 道路事件详情
int ROAD_EVENT_WINDOW = 2;
// 推送事件详情
int PUSH_EVENT_WINDOW = 3;
// 演示动画场景
int ANIMATION_WINDOW = 4;
// 疲劳驾驶
int FATIGUE_DRIVING_WINDOW = 5;
// 他人故障求助
int SEEK_HELP_WINDOW = 6;
// 违章停车
int ILLEGAL_PARK_WINDOW = 7;
}

View File

@@ -0,0 +1,47 @@
package com.mogo.module.common.wm;
import android.app.Dialog;
import android.view.View;
import android.view.ViewGroup;
import com.mogo.module.common.dialog.BaseFloatDialog;
import com.mogo.utils.logger.Logger;
/**
* 采用Dialog实现接口
*/
class DialogImpl implements IWindowManagerView {
private Dialog dialog;
private View contentView;
@Override
public void init(WindowManagerView.WMViewParams params) {
Logger.d("DialogImpl", "init====");
dialog = new BaseFloatDialog(params.mContext);
contentView = params.mContentView;
Logger.d("DialogImpl", "params view : " + contentView);
dialog.setContentView(contentView);
}
@Override
public boolean isShowing() {
return dialog.isShowing();
}
@Override
public void show() {
dialog.show();
}
@Override
public void hide() {
/*
* 取得view的父组件然后移除view
*/
if (contentView != null) {
((ViewGroup) contentView.getParent()).removeView(contentView);
}
dialog.dismiss();
}
}

View File

@@ -0,0 +1,25 @@
package com.mogo.module.common.wm;
interface IWindowManagerView {
/**
* 初始化
* @param params contentView包装类
*/
void init(WindowManagerView.WMViewParams params);
/**
* 是否显示
* @return true - 显示中
*/
boolean isShowing();
/**
* 显示
*/
void show();
/**
* 隐藏
*/
void hide();
}

View File

@@ -0,0 +1,67 @@
package com.mogo.module.common.wm;
import android.content.Context;
import android.graphics.PixelFormat;
import android.os.Build;
import android.view.Gravity;
import android.view.WindowManager;
import com.mogo.module.common.utils.CarSeries;
import com.mogo.utils.WindowUtils;
/**
* 采用windowManager实现接口
*/
class WindowManagerImpl implements IWindowManagerView {
private WindowManager mWindowManager;
private WindowManager.LayoutParams mLayoutParams;
private WindowManagerView.WMViewParams mParams;
private boolean isShowing;
@Override
public void init(WindowManagerView.WMViewParams params) {
mParams = params;
mWindowManager = (WindowManager) mParams.mContext.getApplicationContext().getSystemService( Context.WINDOW_SERVICE );
mLayoutParams = new WindowManager.LayoutParams();
if ( Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ) {
mLayoutParams.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
} else {
mLayoutParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
}
mLayoutParams.format = PixelFormat.TRANSLUCENT;
mLayoutParams.gravity = Gravity.CENTER;
mLayoutParams.flags = WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
if ( CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X ) {
mLayoutParams.width = 1920;
mLayoutParams.height = 1080;
} else {
mLayoutParams.width = WindowUtils.getScreenWidth( mParams.mContext );
mLayoutParams.height = WindowUtils.getScreenHeight( mParams.mContext );
}
mLayoutParams.dimAmount = 0.5f;
mLayoutParams.x = 0;
mLayoutParams.y = 0;
}
@Override
public boolean isShowing() {
return isShowing;
}
@Override
public void show() {
if(!isShowing){
isShowing = true;
mWindowManager.addView(mParams.mContentView,mLayoutParams);
}
}
@Override
public void hide() {
if (isShowing && mParams != null) {
mWindowManager.removeView(mParams.mContentView);
isShowing = false;
}
}
}

View File

@@ -11,6 +11,7 @@ import android.view.WindowManager;
import androidx.annotation.IdRes;
import androidx.annotation.LayoutRes;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.module.common.utils.CarSeries;
import com.mogo.utils.WindowUtils;
@@ -23,89 +24,57 @@ import com.mogo.utils.WindowUtils;
public class WindowManagerView {
private WMViewParams mParams;
private boolean mIsShowing;
private WindowManager mWindowManager;
private WindowManager.LayoutParams mLayoutParams;
private WindowManagerView( WMViewParams params ) {
private IWindowManagerView managerView;
private WindowManagerView(WMViewParams params) {
this.mParams = params;
init();
}
private void init() {
mWindowManager = ( WindowManager ) mParams.mContext.getApplicationContext().getSystemService( Context.WINDOW_SERVICE );
mLayoutParams = new WindowManager.LayoutParams();
if ( Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ) {
mLayoutParams.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
} else {
mLayoutParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
}
mLayoutParams.format = PixelFormat.TRANSLUCENT;
mLayoutParams.gravity = Gravity.CENTER;
mLayoutParams.flags = WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
if ( CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X ) {
mLayoutParams.width = 1920;
mLayoutParams.height = 1080;
} else {
mLayoutParams.width = WindowUtils.getScreenWidth( mParams.mContext );
mLayoutParams.height = WindowUtils.getScreenHeight( mParams.mContext );
}
mLayoutParams.dimAmount = 0.5f;
mLayoutParams.x = 0;
mLayoutParams.y = 0;
managerView = new DialogImpl();
managerView.init(params);
// init();
}
public boolean isShowing() {
return mIsShowing;
return managerView.isShowing();
}
public < T extends View > T findViewById( @IdRes int id ) {
return mParams.mContentView.findViewById( id );
public <T extends View> T findViewById(@IdRes int id) {
return mParams.mContentView.findViewById(id);
}
public void show() {
if ( mIsShowing ) {
return;
}
mIsShowing = true;
mWindowManager.addView( mParams.mContentView, mLayoutParams );
managerView.show();
}
public void dismiss() {
if ( !mIsShowing ) {
return;
}
if ( mParams != null ) {
mWindowManager.removeViewImmediate( mParams.mContentView );
}
mIsShowing = false;
managerView.hide();
}
public static class Builder {
private WMViewParams mParams = null;
public Builder( Context context ) {
public Builder(Context context) {
mParams = new WMViewParams();
mParams.mContext = context;
}
public Builder contentView( View contentView ) {
public Builder contentView(View contentView) {
mParams.mContentView = contentView;
return this;
}
public Builder contentView( @LayoutRes int contentViewId ) {
mParams.mContentView = LayoutInflater.from( mParams.mContext ).inflate( contentViewId, null );
public Builder contentView(@LayoutRes int contentViewId) {
mParams.mContentView = LayoutInflater.from(mParams.mContext).inflate(contentViewId,
null);
return this;
}
public WindowManagerView build() {
if ( mParams.mContentView == null ) {
throw new NullPointerException( "WMViewParams#mContentView must not be null." );
if (mParams.mContentView == null) {
throw new NullPointerException("WMViewParams#mContentView must not be null.");
}
return new WindowManagerView( mParams );
return new WindowManagerView(mParams);
}
}

View File

@@ -1016,7 +1016,9 @@
<dimen name="dp_997">997px</dimen>
<dimen name="dp_998">998px</dimen>
<dimen name="dp_999">999px</dimen>
<dimen name="dp_1000">1000px</dimen>
<dimen name="dp_1300">1300px</dimen>
<dimen name="dp_1920">1920px</dimen>

View File

@@ -0,0 +1 @@
/build

View File

@@ -0,0 +1,55 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.alibaba.arouter'
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
// buildToolsVersion rootProject.ext.android.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
versionCode Integer.valueOf(VERSION_CODE)
versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION")
javaCompileOptions {
annotationProcessorOptions {
arguments = [AROUTER_MODULE_NAME: project.getName()]
}
}
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation rootProject.ext.dependencies.androidxccorektx
implementation rootProject.ext.dependencies.kotlinstdlibjdk7
implementation rootProject.ext.dependencies.androidxappcompat
implementation rootProject.ext.dependencies.arouter
kapt rootProject.ext.dependencies.aroutercompiler
if (Boolean.valueOf(RELEASE)) {
compileOnly rootProject.ext.dependencies.modulecommon
} else {
compileOnly project(':modules:mogo-module-common')
}
}
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()

View File

@@ -0,0 +1 @@
-keep class com.zhidao.mogo.module.event.panel.EventPanelConstants

View File

@@ -0,0 +1,3 @@
GROUP=com.mogo.module
POM_ARTIFACT_ID=module-event-panel-noop
VERSION_CODE=1

View File

@@ -0,0 +1,23 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
-keep class com.zhidao.mogo.module.event.panel.EventPanelConstants

View File

@@ -0,0 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.zhidao.mogo.module.event.panel">
/
</manifest>

View File

@@ -0,0 +1,11 @@
package com.zhidao.mogo.module.event.panel
/**
* 事件面板相关常量
*
* @author tongchenfei
*/
object EventPanelConstants {
const val MODULE_NAME = "MODULE_EVENT_PANEL"
const val PATH_NAME = "/event/panel"
}

View File

@@ -0,0 +1,94 @@
package com.zhidao.mogo.module.event.panel
import android.content.Context
import android.os.Bundle
import android.view.View
import androidx.fragment.app.Fragment
import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.map.listener.IMogoMapListener
import com.mogo.map.location.IMogoLocationListener
import com.mogo.map.marker.IMogoMarkerClickListener
import com.mogo.map.navi.IMogoNaviListener
import com.mogo.service.MogoServicePaths
import com.mogo.service.eventpanel.IEventPanelProvider
import com.mogo.service.module.IMogoModuleLifecycle
import com.mogo.utils.logger.Logger
import com.zhidao.mogo.module.event.panel.EventPanelConstants.MODULE_NAME
/**
* 事件面板provider的空方法实现
*
* @author tongchenfei
*/
const val TAG = "EventPanelNoopModule"
@Route(path = MogoServicePaths.PATH_EVENT_PANEL)
class EventPanelModuleProvider : IEventPanelProvider {
override fun init(context: Context) {
Logger.d(TAG, "模块初始化====")
}
override fun createFragment(context: Context, data: Bundle?): Fragment? {
return null
}
/**
* 显示面板
*/
override fun showPanel() {
}
/**
* 隐藏面板
*/
override fun hidePanel() {
}
override fun createView(context: Context): View? {
return null
}
override fun getModuleName(): String {
return MODULE_NAME
}
override fun getCardLifecycle(): IMogoModuleLifecycle? {
return null
}
override fun getMapListener(): IMogoMapListener? {
return null
}
override fun getType(): Int {
return 0
}
override fun getNaviListener(): IMogoNaviListener? {
return null
}
override fun getLocationListener(): IMogoLocationListener? {
return null
}
override fun getMarkerClickListener(): IMogoMarkerClickListener? {
return null
}
override fun getAppPackage(): String? {
return null
}
override fun getAppName(): String? {
return null
}
override fun isPanelShow(): Boolean {
return false
}
}

View File

@@ -0,0 +1 @@
/build

View File

@@ -0,0 +1,63 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.alibaba.arouter'
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
// buildToolsVersion rootProject.ext.android.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
versionCode Integer.valueOf(VERSION_CODE)
versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION")
javaCompileOptions {
annotationProcessorOptions {
arguments = [AROUTER_MODULE_NAME: project.getName()]
}
}
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation rootProject.ext.dependencies.androidxccorektx
implementation rootProject.ext.dependencies.kotlinstdlibjdk7
implementation rootProject.ext.dependencies.androidxappcompat
implementation rootProject.ext.dependencies.androidxconstraintlayout
implementation rootProject.ext.dependencies.arouter
kapt rootProject.ext.dependencies.aroutercompiler
implementation rootProject.ext.dependencies.rxjava
implementation rootProject.ext.dependencies.rxandroid
implementation rootProject.ext.dependencies.androidxviewpager2
implementation rootProject.ext.dependencies.androidxrecyclerview
implementation rootProject.ext.dependencies.room
kapt rootProject.ext.dependencies.roomAnnotationProcessor
implementation rootProject.ext.dependencies.roomRxjava
if (Boolean.valueOf(RELEASE)) {
compileOnly rootProject.ext.dependencies.modulecommon
} else {
compileOnly project(':modules:mogo-module-common')
}
}
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()

View File

@@ -0,0 +1,5 @@
#-----EventPanel------
-keep class com.zhidao.mogo.module.event.panel.bean.** {*;}
-keep class com.zhidao.mogo.module.event.panel.dao.** {*;}
-keep class com.zhidao.mogo.module.event.panel.listener.** {*;}
-keep class com.zhidao.mogo.module.event.panel.EventPanelConstants

View File

@@ -0,0 +1,3 @@
GROUP=com.mogo.module
POM_ARTIFACT_ID=module-event-panel
VERSION_CODE=1

View File

@@ -0,0 +1,27 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-----EventPanel------
-keep class com.zhidao.mogo.module.event.panel.bean.** {*;}
-keep class com.zhidao.mogo.module.event.panel.dao.** {*;}
-keep class com.zhidao.mogo.module.event.panel.listener.** {*;}
-keep class com.zhidao.mogo.module.event.panel.EventPanelConstants

View File

@@ -0,0 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.zhidao.mogo.module.event.panel">
/
</manifest>

View File

@@ -0,0 +1,15 @@
package com.zhidao.mogo.module.event.panel
/**
* 事件面板相关常量
*
* @author tongchenfei
*/
object EventPanelConstants {
const val MODULE_NAME = "MODULE_EVENT_PANEL"
const val PATH_NAME = "/event/panel"
const val ROAD_EVENT_USEFUL = "2"
const val ROAD_EVENT_UNUSEFUL = "1"
const val ROAD_EVENT_USEFUL_STATUS_UNSET = "0"
}

View File

@@ -0,0 +1,103 @@
package com.zhidao.mogo.module.event.panel
import android.content.Context
import android.os.Bundle
import android.view.View
import androidx.fragment.app.Fragment
import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.map.listener.IMogoMapListener
import com.mogo.map.location.IMogoLocationListener
import com.mogo.map.marker.IMogoMarkerClickListener
import com.mogo.map.navi.IMogoNaviListener
import com.mogo.service.eventpanel.IEventPanelProvider
import com.mogo.service.module.IMogoModuleLifecycle
import com.mogo.service.module.IMogoModuleProvider
import com.mogo.utils.logger.Logger
import com.zhidao.mogo.module.event.panel.EventPanelConstants.MODULE_NAME
import com.zhidao.mogo.module.event.panel.EventPanelConstants.PATH_NAME
import com.zhidao.mogo.module.event.panel.fragment.EventPanelFragment
import com.zhidao.mogo.module.event.panel.util.MogoApiManager
import com.zhidao.mogo.module.event.panel.util.TripRecordDataManager
/**
* 事件面板provider
*
* @author tongchenfei
*/
@Route(path = PATH_NAME)
class EventPanelModuleProvider : IEventPanelProvider {
/**
* Do your init work in this method, it well be call when processor has been load.
*
* @param context ctx
*/
override fun init(context: Context) {
Logger.d(MODULE_NAME, "模块初始化====")
MogoApiManager.init(context)
TripRecordDataManager.init(context)
}
override fun createFragment(context: Context, data: Bundle?): Fragment? {
return EventPanelFragment.getInstance()
}
/**
* 显示面板
*/
override fun showPanel() {
EventPanelFragment.getInstance().showPanel()
}
override fun isPanelShow(): Boolean {
return EventPanelFragment.getInstance().isPanelShow()
}
/**
* 隐藏面板
*/
override fun hidePanel() {
EventPanelFragment.getInstance().hidePanel()
}
override fun createView(context: Context): View? {
return null
}
override fun getModuleName(): String {
return MODULE_NAME
}
override fun getCardLifecycle(): IMogoModuleLifecycle? {
return null
}
override fun getMapListener(): IMogoMapListener? {
return null
}
override fun getType(): Int {
return 0
}
override fun getNaviListener(): IMogoNaviListener? {
return null
}
override fun getLocationListener(): IMogoLocationListener? {
return null
}
override fun getMarkerClickListener(): IMogoMarkerClickListener? {
return null
}
override fun getAppPackage(): String? {
return null
}
override fun getAppName(): String? {
return null
}
}

View File

@@ -0,0 +1,23 @@
package com.zhidao.mogo.module.event.panel.adapter
import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.zhidao.mogo.module.event.panel.fragment.MyShareFragment
import com.zhidao.mogo.module.event.panel.fragment.SurroundingEventFragment
import com.zhidao.mogo.module.event.panel.fragment.TripRecordFragment
/**
* 事件面板viewpager2的adapter
*
* @author tongchenfei
*/
class EventPagerAdapter(fragment: Fragment) : FragmentStateAdapter(fragment) {
private val fragments:Array<Fragment> = arrayOf(TripRecordFragment(), SurroundingEventFragment(), MyShareFragment())
/**
* 目前一共就三个fragment
*/
override fun getItemCount(): Int = fragments.size
override fun createFragment(position: Int): Fragment = fragments[position]
}

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