1. 增加room依赖
2. 增加空实现版本号
This commit is contained in:
@@ -58,9 +58,6 @@ MOGO_MODULE_MAIN_INDEPENDENT_VERSION = 1.2.1.11
|
||||
|
||||
MOGO_MODULE_OBU_VERSION = 1.2.1.10-SNAPSHOT
|
||||
|
||||
MOGO_MODULE_LEFT_PANEL_VERSION = 1.2.1.10-SNAPSHOT
|
||||
|
||||
|
||||
## 工程外部模块
|
||||
# 探路
|
||||
MOGO_MODULE_TANLU_VERSION=1.2.1.12
|
||||
@@ -83,6 +80,10 @@ MOGO_MODULE_AD_CARD_VERSION=1.0.1
|
||||
# 探路上报和分享模块
|
||||
TANLULIB_VERSION=1.2.1.12
|
||||
MOGO_MODULE_EVENT_PANEL_VERSION = 1.0.0-SNAPSHOT
|
||||
MOGO_MODULE_EVENT_PANEL_NOOP_VERSION = 1.0.0-SNAPSHOT
|
||||
#左侧面板模块
|
||||
MOGO_MODULE_LEFT_PANEL_VERSION = 1.2.1.10-SNAPSHOT
|
||||
MOGO_MODULE_LEFT_PANEL_NOOP_VERSION = 1.2.1.10-SNAPSHOT
|
||||
|
||||
# Boost分包
|
||||
BOOST_MULTIDEX_VERSION=1.0.0
|
||||
|
||||
@@ -49,6 +49,9 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.rxandroid
|
||||
implementation rootProject.ext.dependencies.androidxviewpager2
|
||||
implementation rootProject.ext.dependencies.androidxrecyclerview
|
||||
implementation rootProject.ext.dependencies.room
|
||||
kapt rootProject.ext.dependencies.roomAnnotationProcessor
|
||||
implementation rootProject.ext.dependencies.roomRxjava
|
||||
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
compileOnly rootProject.ext.dependencies.modulecommon
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.zhidao.mogo.module.event.panel;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("com.zhidao.mogo.module.event.panel.test", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.zhidao.mogo.module.event.panel.bean
|
||||
|
||||
import androidx.room.Entity
|
||||
import androidx.room.PrimaryKey
|
||||
|
||||
/**
|
||||
* 出行记录本地存储封装类
|
||||
*
|
||||
* @author
|
||||
*/
|
||||
@Entity
|
||||
class TripRecord {
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
var id:Int = 0
|
||||
var canUsed:Boolean = true
|
||||
var isUsed:Boolean = false
|
||||
var entity:String? = null
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.zhidao.mogo.module.event.panel.dao
|
||||
|
||||
import androidx.room.*
|
||||
import com.zhidao.mogo.module.event.panel.bean.TripRecord
|
||||
|
||||
@Dao
|
||||
interface TripRecordDao {
|
||||
// fun getAllTripRecord():List<TripRecord>
|
||||
|
||||
@Insert
|
||||
fun insert(vararg tripRecord: TripRecord)
|
||||
|
||||
@Update
|
||||
fun update(vararg tripRecord: TripRecord)
|
||||
|
||||
@Delete
|
||||
fun delete(vararg tripRecord: TripRecord)
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.zhidao.mogo.module.event.panel.dao
|
||||
|
||||
import android.content.Context
|
||||
import androidx.room.Database
|
||||
import androidx.room.Room
|
||||
import androidx.room.RoomDatabase
|
||||
import com.zhidao.mogo.module.event.panel.bean.TripRecord
|
||||
|
||||
@Database(entities = [TripRecord::class], version = 1, exportSchema = false)
|
||||
abstract class TripRecordDatabase : RoomDatabase() {
|
||||
companion object{
|
||||
const val DB_NAME = "TripRecordDatabase.db"
|
||||
}
|
||||
fun create(context: Context):TripRecordDatabase {
|
||||
return Room.databaseBuilder(context, TripRecordDatabase::class.java, DB_NAME).build()
|
||||
}
|
||||
|
||||
abstract fun getTripRecordDao():TripRecordDao
|
||||
}
|
||||
@@ -1,7 +1,15 @@
|
||||
package com.zhidao.mogo.module.event.panel.presenter
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.commons.mvp.Presenter
|
||||
import com.mogo.service.IMogoServiceApis
|
||||
import com.mogo.service.MogoServicePaths
|
||||
import com.zhidao.mogo.module.event.panel.fragment.TripRecordFragment
|
||||
|
||||
class TripRecordPresenter(view: TripRecordFragment) : Presenter<TripRecordFragment>(view) {
|
||||
private val serviceApis = ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(view.context) as IMogoServiceApis
|
||||
|
||||
init {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.zhidao.mogo.module.event.panel;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user