diff --git a/app/build.gradle b/app/build.gradle index eb85ed4ff1..f25da83520 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -73,6 +73,7 @@ dependencies { implementation rootProject.ext.dependencies.modulepush,{ exclude group:'com.mogo.module',module:'module-common' } + implementation rootProject.ext.dependencies.moduleadcard implementation rootProject.ext.dependencies.moduleonlinecar diff --git a/app/src/main/java/com/mogo/launcher/MogoApplication.java b/app/src/main/java/com/mogo/launcher/MogoApplication.java index 8c3924cf8c..31f021f9c4 100644 --- a/app/src/main/java/com/mogo/launcher/MogoApplication.java +++ b/app/src/main/java/com/mogo/launcher/MogoApplication.java @@ -7,6 +7,7 @@ import androidx.multidex.MultiDex; import com.alibaba.android.arouter.launcher.ARouter; import com.mogo.commons.AbsMogoApplication; import com.mogo.commons.debug.DebugConfig; +import com.mogo.module.adcard.AdCardConstants; import com.mogo.module.carchatting.card.CallChatConstant; import com.mogo.module.common.MogoModule; import com.mogo.module.common.MogoModulePaths; @@ -30,24 +31,26 @@ public class MogoApplication extends AbsMogoApplication { super.onCreate(); // MogoModulePaths.addModule( new MogoModule( DemoConstants.TAG, "CARD_DEMO" ) ); // MogoModulePaths.addModule( new MogoModule( Demo2Constants.TAG, "CARD_DEMO2" ) ); - DebugConfig.setNetMode( BuildConfig.NET_ENV ); - MogoModulePaths.addModule( new MogoModule( OnLineCarConstants.TAG, OnLineCarConstants.MODULE_NAME ) ); - MogoModulePaths.addModule( new MogoModule( TanluConstants.TAG, TanluConstants.MODEL_NAME ) ); - MogoModulePaths.addModule( new MogoModule( CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME ) ); + DebugConfig.setNetMode(BuildConfig.NET_ENV); + //运营位卡片,需要默认显示,放在第一个加载 + MogoModulePaths.addModule(new MogoModule(AdCardConstants.TAG, AdCardConstants.MODULE_NAME)); + MogoModulePaths.addModule(new MogoModule(OnLineCarConstants.TAG, OnLineCarConstants.MODULE_NAME)); + MogoModulePaths.addModule(new MogoModule(TanluConstants.TAG, TanluConstants.MODEL_NAME)); + MogoModulePaths.addModule(new MogoModule(CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME)); MogoModulePaths.addModule(new MogoModule(MediaConstants.TAG, MediaConstants.MODULE_TYPE)); - MogoModulePaths.addModule( new MogoModule( PushUIConstants.TAG, PushUIConstants.TAG ) ); + MogoModulePaths.addModule(new MogoModule(PushUIConstants.TAG, PushUIConstants.TAG)); } @Override protected void init() { super.init(); - IMogoSocketManager mMogoSocketManager = ( IMogoSocketManager ) ARouter.getInstance().build( MogoServicePaths.PATH_SOCKET_MANAGER ).navigation(); - mMogoSocketManager.init( getApplicationContext(), BuildConfig.APPLICATION_ID ); + IMogoSocketManager mMogoSocketManager = (IMogoSocketManager) ARouter.getInstance().build(MogoServicePaths.PATH_SOCKET_MANAGER).navigation(); + mMogoSocketManager.init(getApplicationContext(), BuildConfig.APPLICATION_ID); } @Override - protected void attachBaseContext( Context base ) { - super.attachBaseContext( base ); - MultiDex.install( base ); + protected void attachBaseContext(Context base) { + super.attachBaseContext(base); + MultiDex.install(base); } } diff --git a/config.gradle b/config.gradle index 7cee8d5133..3ad2496be6 100644 --- a/config.gradle +++ b/config.gradle @@ -103,6 +103,8 @@ ext { modulemedia : "com.mogo.module:module-media:${MOGO_MODULE_MEDIA_VERSION}", modulesearch : "com.mogo.module:module-search:${MOGO_MODULE_SEARCH_VERSION}", modulepush : "com.mogo.module:module-push:${MOGO_MODULE_PUSH_VERSION}", + //运营位卡片 + moduleadcard : "com.mogo.module:module-adcard:${MOGO_MODULE_AD_CARD_VERSION}", // 长链 socketsdk : 'com.zhidao.socketsdk:socketsdk:2.1.0', socketsdkconnsvrprotoco : 'com.zhidao.ptech:connsvr-protoco:0.1.23', diff --git a/gradle.properties b/gradle.properties index 352d189739..193e485a23 100644 --- a/gradle.properties +++ b/gradle.properties @@ -51,5 +51,6 @@ MOGO_MODULE_ONLINECAR_VERSION=1.0.0-SNAPSHOT MOGO_MODULE_MEDIA_VERSION=1.0.0-SNAPSHOT MOGO_MODULE_PUSH_VERSION=1.0.0-SNAPSHOT MOGO_MODULE_SEARCH_VERSION=1.0.0-SNAPSHOT +MOGO_MODULE_AD_CARD_VERSION=1.0.0-SNAPSHOT diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluCardViewFragment.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluCardViewFragment.java index 007b241a4c..305ddc41b4 100644 --- a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluCardViewFragment.java +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluCardViewFragment.java @@ -463,7 +463,6 @@ public class TanluCardViewFragment extends MvpFragment> public void onCmdSelected(String cmd) { Logger.d(TAG, "免唤醒 onCmdSelected mogoVoiceListener cmd =" + cmd); if (cmd.equals(TanluConstants.PLAY_VIDEO)) { //播放路况 --ok - //TODO FullMediaActivity.Companion.launch(getActivity(), mVideoUrl, mImageUrl, mTitle, mGenerateTime); } } @@ -709,17 +708,11 @@ public class TanluCardViewFragment extends MvpFragment> refreshVideoData(markerExploreWay); } } - - } else { mEmptyLayout.setVisibility(View.VISIBLE); mRootLayout.setVisibility(View.GONE); mEmptyTv.setText(Html.fromHtml(getContext().getString(R.string.main_empty_content))); } - - //TODO liyz - getRoadLineData(); - } /** @@ -868,17 +861,21 @@ public class TanluCardViewFragment extends MvpFragment> /** - * push 类型,1为导航数据,2为通勤族 TODO + * push 类型,1为导航数据,2为通勤族 * * @param event */ @Subscribe(threadMode = ThreadMode.MAIN) public void onPushInfo(final PushTypeInfo event) { - Logger.d(TAG, " onPushInfo event.type =" + event.type); - if (event.type.equals("1")) { - getNaviRoadLineInfo(); - } else if (event.type.equals("2")) { - getRoadLineData(); + if (event != null && TextUtils.isEmpty(event.type)) { + Logger.d(TAG, " onPushInfo event.type =" + event.type); + if (event.type.equals("1")) { + getNaviRoadLineInfo(); + } else if (event.type.equals("2")) { + getRoadLineData(); + } + } else { + Log.e(TAG, "event == null "); } } diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/receiver/PushReceiver.kt b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/receiver/PushReceiver.kt index 731f251884..0a9cbf790c 100644 --- a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/receiver/PushReceiver.kt +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/receiver/PushReceiver.kt @@ -3,6 +3,7 @@ package com.mogo.module.tanlu.receiver import android.content.BroadcastReceiver import android.content.Context import android.content.Intent +import android.net.Uri import android.util.Log import com.mogo.module.tanlu.model.event.PushTypeInfo import com.mogo.module.tanlu.model.event.VoiceRoadInfo @@ -14,9 +15,9 @@ import org.greenrobot.eventbus.EventBus class PushReceiver : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { if (intent.action == "com.zhidao.roadcondition.split"){ - var type = intent.getStringExtra("type") - Log.d("PushReceiver", "type = $type") - EventBus.getDefault().post(PushTypeInfo(type)) + var uri = Uri.parse(intent.getStringExtra("uri")) + Log.d("PushReceiver", "uri = $uri") + EventBus.getDefault().post(PushTypeInfo(uri.getQueryParameter("type"))) } } }