Revert "删除 independent 依赖"

This reverts commit a607680b
This commit is contained in:
董宏宇
2021-09-01 16:57:49 +08:00
parent a607680b44
commit 701eae35d1
407 changed files with 20588 additions and 0 deletions

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,2 @@
#-----ModuleSplash-----
-keep class com.zhidao.mogo.module.splash.SplashConst{*;}

View File

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

View File

@@ -0,0 +1,24 @@
# 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
#-----ModuleSplash-----
-keep class com.zhidao.mogo.module.splash.SplashConst.*{*;}

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 SplashConst {
const val MODULE_NAME = "MODULE_SPLASH"
const val PATH_NAME = "/splash/api"
}

View File

@@ -0,0 +1,78 @@
@file:Suppress("DEPRECATION")
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.SplashConst.MODULE_NAME
import com.zhidao.mogo.module.splash.SplashConst.PATH_NAME
import com.zhidao.mogo.module.splash.fragment.BydSplashFragment
/**
* 比亚迪车机provider
*
* @author tongchenfei
*/
@Route(path = PATH_NAME)
class SplashProvider : 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,55 @@
package com.zhidao.mogo.module.splash.fragment
import android.os.Handler
import android.os.Message
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.*
const val DEFAULT_COUNT_DOWN_TIME = 5
const val MSG_COUNT_DOWN = 1001
const val DEFAULT_COUNT_DOWN_DELAY = 1000L
class BydSplashFragment :MvpFragment<BydSplashFragment,BydSplashPresenter>(),Handler.Callback{
private val handler = Handler(this)
private var countDownTime = DEFAULT_COUNT_DOWN_TIME
override fun getLayoutId(): Int = R.layout.fragment_byd_splash
override fun initViews() {
startCountDown()
tvByd.setOnClickListener {
hideSplash()
}
}
override fun createPresenter(): BydSplashPresenter = BydSplashPresenter(this)
private fun startCountDown(){
handler.removeMessages(MSG_COUNT_DOWN)
countDownTime = DEFAULT_COUNT_DOWN_TIME
tvCountDown.text = countDownTime.toString()
handler.sendEmptyMessageDelayed(MSG_COUNT_DOWN, DEFAULT_COUNT_DOWN_DELAY)
}
override fun handleMessage(msg: Message): Boolean {
if (msg.what == MSG_COUNT_DOWN) {
tvCountDown?.also {
countDownTime--
if(countDownTime>0) {
it.text = countDownTime.toString()
handler.sendEmptyMessageDelayed(MSG_COUNT_DOWN, DEFAULT_COUNT_DOWN_DELAY)
}else{
hideSplash()
}
}
return true
}
return false
}
private fun hideSplash(){
handler.removeMessages(MSG_COUNT_DOWN)
activity!!.supportFragmentManager.beginTransaction().remove(this).commit()
}
}

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: 82 KiB

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#000" />
<size
android:width="@dimen/dp_100"
android:height="@dimen/dp_100" />
</shape>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<gradient android:startColor="#256BFF" android:endColor="#5CC1FF" android:angle="45" />
<corners android:radius="@dimen/dp_46" />
<padding android:bottom="@dimen/dp_12" android:left="@dimen/dp_75" android:top="@dimen/dp_12" android:right="@dimen/dp_75" />
</shape>
</item>
</selector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

View File

@@ -0,0 +1,41 @@
<?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">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/module_byd_splash" />
<TextView
android:id="@+id/tvByd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/byd_enter_btn_bg"
android:textColor="#0D172C"
android:text="开启行程"
android:textSize="@dimen/dp_46"
android:textStyle="bold"
android:layout_marginStart="@dimen/dp_182"
android:layout_marginBottom="@dimen/dp_251"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"/>
<TextView
android:id="@+id/tvCountDown"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="5"
android:gravity="center"
android:textColor="#fff"
android:textSize="@dimen/dp_54"
android:layout_marginTop="@dimen/dp_48"
android:layout_marginEnd="@dimen/dp_60"
android:background="@drawable/byd_count_down_bg"
app:layout_constraintRight_toRightOf="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)
}
}