This commit is contained in:
unknown
2020-07-16 14:41:45 +08:00
50 changed files with 665 additions and 61 deletions

View File

@@ -1,7 +1,7 @@
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'

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

@@ -20,7 +20,7 @@ public class BaseFloatDialog extends Dialog {
public BaseFloatDialog(@NonNull Context context, int themeResId) {
super(context, themeResId);
addFlag();
// addFlag();
}
private void addFlag() {

View File

@@ -1,7 +1,7 @@
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'
android {

View File

@@ -1,7 +1,7 @@
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'
android {

View File

@@ -1,7 +1,7 @@
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'
android {

View File

@@ -1,7 +1,7 @@
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'
android {

View File

@@ -124,6 +124,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
final long start = System.currentTimeMillis();
MogoModulesManager.getInstance().init( this, getApis() );
loadSplash();
mMogoMapService = mServiceApis.getMapServiceApi();
if ( mMogoMapService != null ) {
mMogoMapService.getHostListenerRegister().registerHostMapListener( EventDispatchCenter.getInstance() );
@@ -204,6 +205,11 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
// mCardsContainer.setAdapter( mCardModulesAdapter );
}
@Override
public void loadSplash() {
MogoModulesManager.getInstance().loadSplashModule(R.id.module_main_id_splash_container);
}
@NonNull
@Override
protected MainPresenter createPresenter() {

View File

@@ -32,4 +32,9 @@ public interface MainView extends IView {
* @return
*/
IMogoServiceApis getApis();
/**
* 加载闪屏页
*/
void loadSplash();
}

View File

@@ -71,4 +71,10 @@ public interface MogoModulesHandler {
* @param containerId
*/
void loadLeftPanelModule(int containerId);
/**
* 加载比亚迪模块
* @param containerId
*/
void loadSplashModule(int containerId);
}

View File

@@ -8,7 +8,6 @@ import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.module.common.MogoModule;
import com.mogo.module.common.MogoModulePaths;
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;
@@ -147,6 +146,14 @@ public class MogoModulesManager implements MogoModulesHandler {
addFragment( provider, containerId );
}
@Override
public void loadSplashModule(int containerId) {
IMogoModuleProvider provider = ( IMogoModuleProvider ) ARouter.getInstance()
.build(MogoServicePaths.PATH_SPLASH)
.navigation( getContext() );
addFragment( provider, containerId );
}
@Override
public void loadBaseModule() {
List< MogoModule > baseModules = MogoModulePaths.getBaseModules();

View File

@@ -9,23 +9,23 @@
<FrameLayout
android:id="@+id/module_main_id_map_fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="match_parent" />
<FrameLayout
android:id="@+id/module_main_id_map_left_shadow_frame"
android:layout_width="@dimen/module_main_map_left_shadow_frame_width"
android:layout_height="match_parent"
android:visibility="gone"
android:background="@drawable/module_main_dw_left_frame_bkg"
android:visibility="gone"
tools:visibility="visible" />
<!-- 时间、天气、消息 与entrance合到了一起减少一个view -->
<!-- <FrameLayout-->
<!-- android:id="@+id/module_main_id_header_fragment_container"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="@dimen/module_ext_height"-->
<!-- android:layout_marginLeft="@dimen/module_main_header_fragment_container_marginLeft"-->
<!-- android:layout_marginTop="@dimen/module_main_header_fragment_container_marginTop" />-->
<!-- <FrameLayout-->
<!-- android:id="@+id/module_main_id_header_fragment_container"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="@dimen/module_ext_height"-->
<!-- android:layout_marginLeft="@dimen/module_main_header_fragment_container_marginLeft"-->
<!-- android:layout_marginTop="@dimen/module_main_header_fragment_container_marginTop" />-->
<!-- 左边按钮 -->
<FrameLayout
@@ -36,23 +36,24 @@
<!-- 左侧浮层,布局位置目前只考虑了1+16独立app情况 -->
<FrameLayout
android:id="@+id/module_main_id_left_panel_fragment_container"
android:layout_width="@dimen/module_main_id_left_panel_fragment_container_width"
android:layout_height="match_parent"
android:id="@+id/module_main_id_left_panel_fragment_container" />
android:layout_height="match_parent" />
<!--快捷操作浮层-->
<FrameLayout
android:id="@+id/module_main_id_entrance_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" />
android:layout_marginLeft="@dimen/module_main_id_entrance_fragment_container_marginLeft"
android:padding="@dimen/module_main_entrance_fragment_container_padding" />
<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" />
android:layout_marginLeft="@dimen/module_main_id_entrance_fragment_container_marginLeft"
android:padding="@dimen/module_main_entrance_fragment_container_padding" />
<!-- 浮层-->
<FrameLayout
@@ -73,5 +74,10 @@
android:visibility="visible"
tools:visibility="gone" />
<FrameLayout
android:id="@+id/module_main_id_splash_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>

View File

@@ -1,7 +1,7 @@
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'
android {

View File

@@ -115,6 +115,11 @@ public class ShareControl implements IMogoShareManager, IMogoIntentListener, IMo
}
}
@Override
public void resetContext(Context context) {
mContext = context;
}
private void realShowDialog() {
if (mShareDialog == null) {
mShareDialog = new LaucherShareDialog(mContext);

View File

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

View File

@@ -0,0 +1,58 @@
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
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,3 @@
GROUP=com.mogo.module
POM_ARTIFACT_ID=module-splash-noop
VERSION_CODE=1

View File

@@ -0,0 +1,21 @@
# 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

View File

@@ -0,0 +1,24 @@
package com.zhidao.mogo.module.splash
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.zhidao.mogo.module.byd.test", appContext.packageName)
}
}

View File

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

View File

@@ -0,0 +1,6 @@
package com.zhidao.mogo.module.splash
object BydConst {
const val MODULE_NAME = "MODULE_BYD"
const val PATH_NAME = "/carmachine/byd"
}

View File

@@ -0,0 +1,72 @@
package com.zhidao.mogo.module.splash
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.module.IMogoModuleLifecycle
import com.mogo.service.module.IMogoModuleProvider
import com.mogo.utils.logger.Logger
import com.zhidao.mogo.module.splash.BydConst.MODULE_NAME
import com.zhidao.mogo.module.splash.BydConst.PATH_NAME
/**
* 比亚迪车机provider
*
* @author tongchenfei
*/
@Route(path = PATH_NAME)
class BydProvider:IMogoModuleProvider {
override fun getNaviListener(): IMogoNaviListener? {
return null
}
override fun getLocationListener(): IMogoLocationListener? {
return null
}
override fun getType(): Int {
return 0
}
override fun getMarkerClickListener(): IMogoMarkerClickListener? {
return null
}
override fun init(context: Context?) {
Logger.d(MODULE_NAME, "比亚迪noop模块初始化===")
}
override fun getMapListener(): IMogoMapListener? {
return null
}
override fun getAppPackage(): String {
return ""
}
override fun createView(context: Context?): View? {
return null
}
override fun createFragment(context: Context?, data: Bundle?): Fragment? {
return null
}
override fun getModuleName(): String {
return MODULE_NAME
}
override fun getAppName(): String {
return ""
}
override fun getCardLifecycle(): IMogoModuleLifecycle? {
return null
}
}

View File

@@ -0,0 +1,17 @@
package com.zhidao.mogo.module.splash
import org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}

1
modules/mogo-module-splash/.gitignore vendored Normal file
View File

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

View File

@@ -0,0 +1,58 @@
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
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,3 @@
GROUP=com.mogo.module
POM_ARTIFACT_ID=module-splash
VERSION_CODE=1

View File

@@ -0,0 +1,21 @@
# 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

View File

@@ -0,0 +1,24 @@
package com.zhidao.mogo.module.splash
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.zhidao.mogo.module.byd.test", appContext.packageName)
}
}

View File

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

View File

@@ -0,0 +1,6 @@
package com.zhidao.mogo.module.splash
object BydConst {
const val MODULE_NAME = "MODULE_SPLASH"
const val PATH_NAME = "/splash/api"
}

View File

@@ -0,0 +1,76 @@
package com.zhidao.mogo.module.splash
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.commons.debug.DebugConfig
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 com.zhidao.mogo.module.splash.BydConst.MODULE_NAME
import com.zhidao.mogo.module.splash.BydConst.PATH_NAME
import com.zhidao.mogo.module.splash.fragment.BydSplashFragment
/**
* 比亚迪车机provider
*
* @author tongchenfei
*/
@Route(path = PATH_NAME)
class BydProvider : IMogoModuleProvider {
override fun getNaviListener(): IMogoNaviListener? {
return null
}
override fun getLocationListener(): IMogoLocationListener? {
return null
}
override fun getType(): Int {
return 0
}
override fun getMarkerClickListener(): IMogoMarkerClickListener? {
return null
}
override fun init(context: Context?) {
Logger.d(MODULE_NAME, "比亚迪模块初始化===")
}
override fun getMapListener(): IMogoMapListener? {
return null
}
override fun getAppPackage(): String {
return ""
}
override fun createView(context: Context?): View? {
return null
}
override fun createFragment(context: Context?, data: Bundle?): Fragment? = if (DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_BYD) {
BydSplashFragment()
} else {
null
}
override fun getModuleName(): String {
return MODULE_NAME
}
override fun getAppName(): String {
return ""
}
override fun getCardLifecycle(): IMogoModuleLifecycle? {
return null
}
}

View File

@@ -0,0 +1,19 @@
package com.zhidao.mogo.module.splash.fragment
import com.mogo.commons.mvp.MvpFragment
import com.zhidao.mogo.module.splash.R
import com.zhidao.mogo.module.splash.presenter.BydSplashPresenter
import kotlinx.android.synthetic.main.fragment_byd_splash.*
class BydSplashFragment :MvpFragment<BydSplashFragment,BydSplashPresenter>(){
override fun getLayoutId(): Int = R.layout.fragment_byd_splash
override fun initViews() {
tvByd.setOnClickListener {
activity!!.supportFragmentManager.beginTransaction().remove(this).commit()
}
}
override fun createPresenter(): BydSplashPresenter = BydSplashPresenter(this)
}

View File

@@ -0,0 +1,7 @@
package com.zhidao.mogo.module.splash.presenter
import com.mogo.commons.mvp.Presenter
import com.zhidao.mogo.module.splash.fragment.BydSplashFragment
class BydSplashPresenter(view: BydSplashFragment) : Presenter<BydSplashFragment>(view) {
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -0,0 +1,23 @@
<?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:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fff">
<TextView
android:id="@+id/tvByd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#fff"
android:drawableTop="@drawable/binli"
android:drawablePadding="10dp"
android:gravity="center"
android:text="比亚迪"
android:textSize="40sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,17 @@
package com.zhidao.mogo.module.splash
import org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}