Merge branch 'feature/v1.0.3' of gitlab.zhidaoauto.com:ecos/yycp-service/Launcher into feature/v1.0.3

This commit is contained in:
wangcongtao
2020-03-30 10:25:32 +08:00
9 changed files with 31 additions and 14 deletions

View File

@@ -98,6 +98,8 @@ dependencies {
// implementation rootProject.ext.dependencies.moduledemo2
implementation rootProject.ext.dependencies.carcallprovider
implementation rootProject.ext.dependencies.carcall
implementation rootProject.ext.dependencies.guideshowprovider
implementation rootProject.ext.dependencies.guideshow
implementation rootProject.ext.dependencies.modulemedia
implementation rootProject.ext.dependencies.modulefreshnews,{
exclude group:'com.mogo.module',module:'module-onlinecar'

View File

@@ -15,6 +15,7 @@ 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;
import com.mogo.module.guideshow.provider.GuideShowProviderConstant;
import com.mogo.module.media.MediaConstants;
import com.mogo.module.onlinecar.OnLineCarConstants;
import com.mogo.module.push.PushUIConstants;
@@ -51,6 +52,8 @@ public class MogoApplication extends AbsMogoApplication {
MogoModulePaths.addModule(new MogoModule(PATH_GUIDE_FRAGMENT, PATH_GUIDE_MODULE_NAME));
MogoModulePaths.addModule(new MogoModule(PATH_AGREEMENT_FRAGMENT, PATH_AGREEMENT_MODULE_NAME));
MogoModulePaths.addModule(new MogoModule(GuideShowProviderConstant.PATH_GUIDE_SHOW_FRAGMENT, GuideShowProviderConstant.PATH_GUIDE_SHOW_MODULE_NAME));
//运营位卡片,需要默认显示,放在第一个加载
MogoModulePaths.addModule(new MogoModule(AdCardConstants.TAG, AdCardConstants.MODULE_NAME));
MogoModulePaths.addModule(new MogoModule(MediaConstants.TAG, MediaConstants.MODULE_TYPE));

View File

@@ -96,6 +96,8 @@ ext {
moduleextensions : "com.mogo.module:module-extensions:${MOGO_MODULE_EXTENSIONS_VERSION}",
carcall : "com.mogo.module.carchatting:module-carchatting:${CARCHATTING_VERSION}",
carcallprovider : "com.mogo.module.carchatting:module-carchatting-provider:${CARCHATTINGPROVIDER_VERSION}",
guideshow : "com.mogo.module.guideshow:module-guideshow:${MOGO_MODULE_GUIDESHOW_VERSION}",
guideshowprovider : "com.mogo.module.guideshow:module-guideshow-provider:${MOGO_MODULE_GUIDESHOW_PROVIDER_VERSION}",
// 在线车辆
moduleonlinecar : "com.mogo.module:module-onlinecar:${MOGO_MODULE_ONLINECAR_VERSION}",
// V2X

View File

@@ -55,6 +55,10 @@ MOGO_MODULE_TANLU_VERSION=1.0.3-SNAPSHOT
CARCHATTING_VERSION=1.0.2.3-SNAPSHOT
# 车聊聊接口
CARCHATTINGPROVIDER_VERSION=1.0.2.3-SNAPSHOT
# 视频引导
MOGO_MODULE_GUIDESHOW_VERSION=1.0.0-SNAPSHOT
# 视频引导接口
MOGO_MODULE_GUIDESHOW_PROVIDER_VERSION=1.0.1-SNAPSHOT
# 在线车辆F
MOGO_MODULE_ONLINECAR_VERSION=1.0.2-SNAPSHOT
# v2x

View File

@@ -11,8 +11,8 @@ 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.hasAuth
import com.mogo.module.authorize.util.SharedPreferenceUtil.hasGuide
import com.mogo.service.module.IMogoModuleLifecycle
import com.mogo.service.module.IMogoModuleProvider
@@ -63,7 +63,7 @@ class MogoAuthorizeProvider : IMogoModuleProvider {
}
override fun init(context: Context?) {
if (hasGuide() && !hasAuth(0)) {
if (hasGuide() && mogoAuthShow.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_MAIN)) {
mogoAuthShow.invokeAuthorizeForShow()
} else {
Logger.d(TAG, "wait for guide invoke")

View File

@@ -16,15 +16,11 @@ object MogoAuthorizeMainController : IMogoAuthorizeController() {
@Synchronized
fun agreeAuthorize(tag: String, agrId: Long, onSuccess: (() -> Unit), onError: ((String) -> Unit)) {
val acquireAuthListener = MogoAuthorizeRegisterHandler.getAuthorizeListener(tag)
updateAuthorize(agrId, AGREEMENT_EFFECT, {
if (acquireAuthListener != null) {
setAuthorizeStatus(tag.toAuthorizeType(), true)
acquireAuthListener.authorizeSuccess()
onSuccess.invoke()
} else {
Logger.d(TAG, "agreeAuthorize --- can not find listener by this tag :$tag ")
}
authorizeSuccess(tag)
setAuthorizeStatus(tag.toAuthorizeType(), true)
onSuccess.invoke()
}, {
val errorMsg = it ?: "agreeAuthorize failed,please check network"
authorizeFailed(tag, errorMsg)
@@ -67,4 +63,12 @@ object MogoAuthorizeMainController : IMogoAuthorizeController() {
}
}
private fun authorizeSuccess(tag: String) {
val acquireAuthListener = MogoAuthorizeRegisterHandler.getAuthorizeListener(tag)
if (acquireAuthListener != null) {
acquireAuthListener.authorizeSuccess()
} else {
Logger.d(TAG, "agreeAuthorize --- can not find listener by this tag :$tag ")
}
}
}

View File

@@ -93,6 +93,7 @@ class AuthorizeFragment(private val invokeTag: String) : MvpFragment<AuthorizeCo
override fun onDestroy() {
super.onDestroy()
Logger.d(TAG,"onDestroy")
VoiceUtil.unregisterAll(context!!, this)
}

View File

@@ -2,6 +2,7 @@ package com.mogo.module.authorize.fragment
import androidx.lifecycle.LifecycleOwner
import com.mogo.commons.mvp.Presenter
import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeRegisterHandler
import com.mogo.module.authorize.authprovider.invoke.IMogoAuthorizeContentListener
import com.mogo.module.authorize.authprovider.launcher.MogoMainAuthorize.Companion.mogoAuthShow
import com.mogo.module.authorize.model.bean.Agreement
@@ -86,8 +87,8 @@ class AuthorizePresenter : Presenter<AuthorizeContract.View>, AuthorizeContract.
super.onDestroy(owner)
Logger.d(TAG, "onDestroy invokeTag : $invokeTag")
invokeTag?.let {
mogoAuthShow.unregisterInvokeAuthorizeContentListener(it)
mogoAuthShow.unregisterAuthorizeListener(it)
MogoAuthorizeRegisterHandler.getAuthorizeContentListener(it)?.requestContentFailed("user exit authorize by back press")
MogoAuthorizeRegisterHandler.getAuthorizeListener(it)?.authorizeFailed("user exit authorize by back press")
}
}
}

View File

@@ -23,8 +23,8 @@ object VoiceUtil {
}
//WakeUp Command (Intent)
const val VOICE_INTENT_AGREE = "system.application.operation" //同意
const val VOICE_INTENT_DISAGREE = "system.application.operation" //不同意
const val VOICE_INTENT_AGREE = "com.zhidao.agree" //同意
const val VOICE_INTENT_DISAGREE = "com.zhiao.disagree" //不同意
//unWakeUp Command
const val VOICE_REGISTER_AUTHORIZE_AGREE = "CMD_AUTHORIZATION_AGREE"