Merge branch 'dev' of gitlab.zhidaoauto.com:ecos/yycp-service/Launcher into dev
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
apply plugin: 'com.alibaba.arouter'
|
||||
|
||||
android {
|
||||
@@ -36,30 +39,21 @@ android {
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation rootProject.ext.dependencies.androidxcardview
|
||||
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
|
||||
annotationProcessor rootProject.ext.dependencies.aroutercompiler
|
||||
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
|
||||
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
// api rootProject.ext.dependencies.mogomap
|
||||
// api rootProject.ext.dependencies.mogomapapi
|
||||
// api rootProject.ext.dependencies.mogoutils
|
||||
// api rootProject.ext.dependencies.mogocommons
|
||||
// api rootProject.ext.dependencies.mogoserviceapi
|
||||
compileOnly rootProject.ext.dependencies.modulecommon
|
||||
} else {
|
||||
// api project(":libraries:mogo-map")
|
||||
// api project(":libraries:mogo-map-api")
|
||||
// api project(":foudations:mogo-utils")
|
||||
// api project(":foudations:mogo-commons")
|
||||
// api project(':services:mogo-service-api')
|
||||
compileOnly project(':modules:mogo-module-common')
|
||||
// implementation project(':modules:mogo-module-share')
|
||||
// implementation project(':modules:mogo-module-authorize')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
package com.zhidao.mogo.module.event.panel;
|
||||
|
||||
/**
|
||||
* 事件面板相关常量
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class EventPanelConstants {
|
||||
public static final String MODULE_NAME = "MODULE_EVENT_PANEL";
|
||||
public static final String PATH_NAME = "/event/panel";
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
package com.zhidao.mogo.module.event.panel;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
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.module.IMogoModuleLifecycle;
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import static com.zhidao.mogo.module.event.panel.EventPanelConstants.MODULE_NAME;
|
||||
import static com.zhidao.mogo.module.event.panel.EventPanelConstants.PATH_NAME;
|
||||
|
||||
/**
|
||||
* 事件面板provider
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
@Route(path = PATH_NAME)
|
||||
public class EventPanelModuleProvider implements IMogoModuleProvider {
|
||||
|
||||
/**
|
||||
* Do your init work in this method, it well be call when processor has been load.
|
||||
*
|
||||
* @param context ctx
|
||||
*/
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
Logger.d(MODULE_NAME,"模块初始化====");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment createFragment(Context context, Bundle data) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View createView(Context context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String getModuleName() {
|
||||
return MODULE_NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoModuleLifecycle getCardLifecycle() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoMapListener getMapListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getType() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
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
|
||||
|
||||
/**
|
||||
* 事件面板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, "模块初始化====")
|
||||
}
|
||||
|
||||
override fun createFragment(context: Context, data: Bundle?): Fragment? {
|
||||
return EventPanelFragment.getInstance()
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示面板
|
||||
*/
|
||||
override fun showPanel() {
|
||||
EventPanelFragment.getInstance().showPanel()
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 隐藏面板
|
||||
*/
|
||||
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
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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]
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.zhidao.mogo.module.event.panel.fragment
|
||||
|
||||
import android.view.View
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.utils.logger.Logger
|
||||
import com.zhidao.mogo.module.event.panel.EventPanelConstants.MODULE_NAME
|
||||
import com.zhidao.mogo.module.event.panel.R
|
||||
import com.zhidao.mogo.module.event.panel.adapter.EventPagerAdapter
|
||||
import com.zhidao.mogo.module.event.panel.presenter.EventPanelPresenter
|
||||
import kotlinx.android.synthetic.main.module_event_panel_fragment_event_panel.*
|
||||
|
||||
/**
|
||||
* 事件面板主fragment
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
class EventPanelFragment : MvpFragment<EventPanelFragment, EventPanelPresenter>() {
|
||||
|
||||
companion object{
|
||||
private val fragment = EventPanelFragment()
|
||||
fun getInstance():EventPanelFragment{
|
||||
return fragment
|
||||
}
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.module_event_panel_fragment_event_panel
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
Logger.d(MODULE_NAME, "EventPanelFragment init view===")
|
||||
vpEventPanel.adapter = EventPagerAdapter(this)
|
||||
|
||||
}
|
||||
override fun createPresenter(): EventPanelPresenter {
|
||||
return EventPanelPresenter(this)
|
||||
}
|
||||
|
||||
fun showPanel(){
|
||||
Logger.d(MODULE_NAME,"in fragment show panel")
|
||||
clPanelContainer.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
fun hidePanel(){
|
||||
Logger.d(MODULE_NAME,"in fragment hide panel")
|
||||
clPanelContainer.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.zhidao.mogo.module.event.panel.fragment
|
||||
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.zhidao.mogo.module.event.panel.R
|
||||
import com.zhidao.mogo.module.event.panel.presenter.MySharePresenter
|
||||
|
||||
class MyShareFragment : MvpFragment<MyShareFragment, MySharePresenter>() {
|
||||
/**
|
||||
* 布局资源
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
override fun getLayoutId(): Int = R.layout.module_event_panel_fragment_my_share
|
||||
|
||||
/**
|
||||
* 初始化控件,必须在初始化完成之后才可以实例化presenter,避免
|
||||
* presenter 生命周期错乱
|
||||
*/
|
||||
override fun initViews() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建 presenter 实例
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
override fun createPresenter(): MySharePresenter = MySharePresenter(this)
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.zhidao.mogo.module.event.panel.fragment
|
||||
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.zhidao.mogo.module.event.panel.R
|
||||
import com.zhidao.mogo.module.event.panel.presenter.SurroundingEventPresenter
|
||||
import kotlinx.android.synthetic.main.module_event_panel_fragment_surrounding_event.*
|
||||
|
||||
class SurroundingEventFragment:MvpFragment<SurroundingEventFragment,SurroundingEventPresenter>(){
|
||||
/**
|
||||
* 布局资源
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
override fun getLayoutId(): Int = R.layout.module_event_panel_fragment_surrounding_event
|
||||
|
||||
/**
|
||||
* 初始化控件,必须在初始化完成之后才可以实例化presenter,避免
|
||||
* presenter 生命周期错乱
|
||||
*/
|
||||
override fun initViews() {
|
||||
tvTitle.setOnClickListener {
|
||||
EventPanelFragment.getInstance().hidePanel()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建 presenter 实例
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
override fun createPresenter(): SurroundingEventPresenter = SurroundingEventPresenter(this)
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.zhidao.mogo.module.event.panel.fragment
|
||||
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.zhidao.mogo.module.event.panel.R
|
||||
import com.zhidao.mogo.module.event.panel.presenter.TripRecordPresenter
|
||||
|
||||
/**
|
||||
* 出行动态fragment
|
||||
*/
|
||||
class TripRecordFragment: MvpFragment<TripRecordFragment, TripRecordPresenter>() {
|
||||
/**
|
||||
* 布局资源
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
override fun getLayoutId(): Int = R.layout.module_event_panel_fragment_trip_record
|
||||
|
||||
/**
|
||||
* 初始化控件,必须在初始化完成之后才可以实例化presenter,避免
|
||||
* presenter 生命周期错乱
|
||||
*/
|
||||
override fun initViews() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建 presenter 实例
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
override fun createPresenter(): TripRecordPresenter = TripRecordPresenter(this)
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.zhidao.mogo.module.event.panel.presenter
|
||||
|
||||
import com.mogo.commons.mvp.Presenter
|
||||
import com.zhidao.mogo.module.event.panel.fragment.EventPanelFragment
|
||||
|
||||
/**
|
||||
* 事件面板presenter
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
class EventPanelPresenter(view: EventPanelFragment) : Presenter<EventPanelFragment>(view)
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.zhidao.mogo.module.event.panel.presenter
|
||||
|
||||
import com.mogo.commons.mvp.Presenter
|
||||
import com.zhidao.mogo.module.event.panel.fragment.MyShareFragment
|
||||
|
||||
class MySharePresenter(view: MyShareFragment) : Presenter<MyShareFragment>(view) {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.zhidao.mogo.module.event.panel.presenter
|
||||
|
||||
import com.mogo.commons.mvp.Presenter
|
||||
import com.zhidao.mogo.module.event.panel.fragment.SurroundingEventFragment
|
||||
|
||||
class SurroundingEventPresenter(view: SurroundingEventFragment) : Presenter<SurroundingEventFragment>(view) {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.zhidao.mogo.module.event.panel.presenter
|
||||
|
||||
import com.mogo.commons.mvp.Presenter
|
||||
import com.zhidao.mogo.module.event.panel.fragment.TripRecordFragment
|
||||
|
||||
class TripRecordPresenter(view: TripRecordFragment) : Presenter<TripRecordFragment>(view) {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/clPanelContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone">
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/vpEventPanel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/clPanelContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="My Share"
|
||||
android:textColor="#fff"
|
||||
android:textSize="40sp" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/clPanelContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="Surrounding Event"
|
||||
android:textColor="#fff"
|
||||
android:textSize="40sp" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/clPanelContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="Trip Record"
|
||||
android:textColor="#fff"
|
||||
android:textSize="40sp" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources></resources>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources></resources>
|
||||
@@ -53,6 +53,7 @@ dependencies {
|
||||
api rootProject.ext.dependencies.mogoserviceapi
|
||||
implementation rootProject.ext.dependencies.modulecommon
|
||||
implementation rootProject.ext.dependencies.moduleshare
|
||||
// implementation rootProject.ext.dependencies.moduleventpanel
|
||||
// implementation rootProject.ext.dependencies.mogomoduleauth
|
||||
} else {
|
||||
api project(":libraries:mogo-map")
|
||||
@@ -62,6 +63,7 @@ dependencies {
|
||||
api project(':services:mogo-service-api')
|
||||
implementation project(':modules:mogo-module-common')
|
||||
implementation project(':modules:mogo-module-share')
|
||||
// implementation project(':modules:mogo-module-event-panel')
|
||||
// implementation project(':modules:mogo-module-authorize')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import android.util.TypedValue;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -433,6 +434,9 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
} );
|
||||
mMsgCounter = findViewById( R.id.module_ext_id_msg_counter );
|
||||
mUserHeadImg.setOnClickListener(view ->{
|
||||
// todo 测试代码
|
||||
// mApis.getEventPanelManager().showPanel();
|
||||
// 原始逻辑
|
||||
try {
|
||||
LaunchUtils.launchByPkg(getContext(), "com.zhidao.auto.personal");
|
||||
// 埋点
|
||||
|
||||
@@ -173,5 +173,4 @@
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -53,6 +53,7 @@ dependencies {
|
||||
api rootProject.ext.dependencies.mogoconnection
|
||||
api rootProject.ext.dependencies.moduleextensions
|
||||
api rootProject.ext.dependencies.mogomoduleback
|
||||
// implementation rootProject.ext.dependencies.moduleventpanel
|
||||
} else {
|
||||
api project(":foudations:mogo-utils")
|
||||
api project(":foudations:mogo-commons")
|
||||
@@ -65,6 +66,7 @@ dependencies {
|
||||
api project(':foudations:mogo-connection')
|
||||
api project(':modules:mogo-module-extensions')
|
||||
api project(':modules:mogo-module-back')
|
||||
// implementation project(':modules:mogo-module-event-panel')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -178,6 +178,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
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 );
|
||||
MogoModulesManager.getInstance().loadEventPanelModule(R.id.module_main_id_event_panel_fragment_container);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -59,4 +59,10 @@ public interface MogoModulesHandler {
|
||||
* 2. mogo-module-service
|
||||
*/
|
||||
void loadBaseModule();
|
||||
|
||||
/**
|
||||
* 加载事件面板
|
||||
* @param containerId
|
||||
*/
|
||||
void loadEventPanelModule(int containerId);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.mogo.module.extensions.ExtensionsModuleConst;
|
||||
import com.mogo.module.main.EventDispatchCenter;
|
||||
import com.mogo.module.main.MainActivity;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
import com.mogo.utils.ResourcesHelper;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -130,6 +131,14 @@ public class MogoModulesManager implements MogoModulesHandler {
|
||||
addFragment( provider, containerId );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadEventPanelModule(int containerId) {
|
||||
IMogoModuleProvider provider = ( IMogoModuleProvider ) ARouter.getInstance()
|
||||
.build(MogoServicePaths.PATH_EVENT_PANEL)
|
||||
.navigation( getContext() );
|
||||
addFragment( provider, containerId );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadBaseModule() {
|
||||
List< MogoModule > baseModules = MogoModulePaths.getBaseModules();
|
||||
|
||||
@@ -41,6 +41,12 @@
|
||||
android:layout_height="match_parent"
|
||||
android:padding="@dimen/module_main_entrance_fragment_container_padding"
|
||||
android:layout_marginLeft="@dimen/module_main_id_entrance_fragment_container_marginLeft" />
|
||||
<FrameLayout
|
||||
android:id="@+id/module_main_id_event_panel_fragment_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="@dimen/module_main_entrance_fragment_container_padding"
|
||||
android:layout_marginLeft="@dimen/module_main_id_entrance_fragment_container_marginLeft" />
|
||||
|
||||
<!-- 浮层-->
|
||||
<FrameLayout
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.mogo.service.cardmanager.IMogoCardManager;
|
||||
import com.mogo.service.connection.IMogoSocketManager;
|
||||
import com.mogo.service.datamanager.IMogoDataManager;
|
||||
import com.mogo.service.entrance.IMogoEntranceButtonController;
|
||||
import com.mogo.service.eventpanel.IEventPanelProvider;
|
||||
import com.mogo.service.fragmentmanager.IMogoFragmentManager;
|
||||
import com.mogo.service.imageloader.IMogoImageloader;
|
||||
import com.mogo.service.intent.IMogoIntentManager;
|
||||
@@ -208,4 +209,10 @@ public interface IMogoServiceApis extends IProvider {
|
||||
* @return obuManager
|
||||
*/
|
||||
IMogoObuManager getObuManager();
|
||||
|
||||
/**
|
||||
* 获取事件面板manager
|
||||
* @return eventPanelProvider
|
||||
*/
|
||||
IEventPanelProvider getEventPanelManager();
|
||||
}
|
||||
|
||||
@@ -190,4 +190,6 @@ public class MogoServicePaths {
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String PATH_OBU = "/obu/api";
|
||||
|
||||
public static final String PATH_EVENT_PANEL = "/event/panel";
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.mogo.service.eventpanel;
|
||||
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
|
||||
/**
|
||||
* 事件面板provider接口
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public interface IEventPanelProvider extends IMogoModuleProvider {
|
||||
/**
|
||||
* 显示面板
|
||||
*/
|
||||
void showPanel();
|
||||
|
||||
/**
|
||||
* 隐藏面板
|
||||
*/
|
||||
void hidePanel();
|
||||
}
|
||||
@@ -14,6 +14,7 @@ import com.mogo.service.cardmanager.IMogoCardManager;
|
||||
import com.mogo.service.connection.IMogoSocketManager;
|
||||
import com.mogo.service.datamanager.IMogoDataManager;
|
||||
import com.mogo.service.entrance.IMogoEntranceButtonController;
|
||||
import com.mogo.service.eventpanel.IEventPanelProvider;
|
||||
import com.mogo.service.fragmentmanager.IMogoFragmentManager;
|
||||
import com.mogo.service.imageloader.IMogoImageloader;
|
||||
import com.mogo.service.impl.analytics.impl.MogoAnalyticsImpl;
|
||||
@@ -183,6 +184,11 @@ public class MogoServiceApis implements IMogoServiceApis {
|
||||
return getApiInstance(IMogoObuManager.class, MogoServicePaths.PATH_OBU);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEventPanelProvider getEventPanelManager() {
|
||||
return getApiInstance(IEventPanelProvider.class, MogoServicePaths.PATH_EVENT_PANEL);
|
||||
}
|
||||
|
||||
private static < T extends IProvider > T getApiInstance(Class< T > clazz, String path ) {
|
||||
T inst = SingletonsHolder.get( clazz );
|
||||
if ( inst == null ) {
|
||||
|
||||
Reference in New Issue
Block a user