修改module-byd为module-splash,暂未使用module-splash-noop模块
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
5
modules/mogo-module-splash/src/main/AndroidManifest.xml
Normal file
5
modules/mogo-module-splash/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.zhidao.mogo.module.splash">
|
||||
|
||||
/
|
||||
</manifest>
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.zhidao.mogo.module.splash
|
||||
|
||||
object BydConst {
|
||||
const val MODULE_NAME = "MODULE_SPLASH"
|
||||
const val PATH_NAME = "/splash/api"
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
}
|
||||
@@ -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) {
|
||||
}
|
||||
BIN
modules/mogo-module-splash/src/main/res/drawable-xhdpi/binli.jpg
Normal file
BIN
modules/mogo-module-splash/src/main/res/drawable-xhdpi/binli.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
@@ -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>
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user