Compare commits

..

No commits in common. "realm" and "master" have entirely different histories.

6 changed files with 23 additions and 45 deletions

View File

@ -7,7 +7,6 @@ plugins {
id 'dagger.hilt.android.plugin' //hilt id 'dagger.hilt.android.plugin' //hilt
id "com.google.protobuf" version "0.8.17" //Proto DataStore id "com.google.protobuf" version "0.8.17" //Proto DataStore
id 'androidx.navigation.safeargs.kotlin'//Safe Args传递数据 id 'androidx.navigation.safeargs.kotlin'//Safe Args传递数据
id 'io.realm.kotlin'
// id 'com.google.dagger.hilt.android' // id 'com.google.dagger.hilt.android'
} }
@ -44,11 +43,11 @@ android {
} }
} }
compileOptions { compileOptions {
sourceCompatibility JavaVersion.VERSION_11 sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_11 targetCompatibility JavaVersion.VERSION_1_8
} }
kotlinOptions { kotlinOptions {
jvmTarget = '11' jvmTarget = '1.8'
freeCompilerArgs += [ freeCompilerArgs += [
"-Xjvm-default=all", "-Xjvm-default=all",
] ]
@ -62,7 +61,7 @@ android {
dependencies { dependencies {
def nav_version = "2.5.3" def nav_version = "2.5.3"
implementation 'androidx.core:core-ktx:1.7.0' implementation 'androidx.core:core-ktx:1.8.0'
implementation 'androidx.appcompat:appcompat:1.5.1' implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.7.0' implementation 'com.google.android.material:material:1.7.0'
implementation "androidx.compose.material3:material3:1.0.0-alpha04" implementation "androidx.compose.material3:material3:1.0.0-alpha04"
@ -122,8 +121,8 @@ dependencies {
implementation("com.google.code.gson:gson:2.8.6") implementation("com.google.code.gson:gson:2.8.6")
//hilt //hilt
implementation 'com.google.dagger:hilt-android:2.45' implementation "com.google.dagger:hilt-android:2.41"
kapt 'com.google.dagger:hilt-compiler:2.45' kapt "com.google.dagger:hilt-compiler:2.41"
// https://github.com/nhaarman/supertooltips // https://github.com/nhaarman/supertooltips
implementation 'com.nhaarman.supertooltips:library:3.0.0' implementation 'com.nhaarman.supertooltips:library:3.0.0'
@ -153,9 +152,6 @@ dependencies {
// Proto DataStore // Proto DataStore
implementation "androidx.datastore:datastore-core:1.0.0" implementation "androidx.datastore:datastore-core:1.0.0"
implementation "com.google.protobuf:protobuf-javalite:3.18.0" implementation "com.google.protobuf:protobuf-javalite:3.18.0"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4'
implementation 'io.realm.kotlin:library-base:1.6.1'
} }
//Proto DataStore //Proto DataStore

View File

@ -1,8 +0,0 @@
package com.navinfo.volvo.model
import io.realm.kotlin.types.RealmObject
class Dog : RealmObject {
var name: String = ""
var age: Int = 0
}

View File

@ -31,11 +31,8 @@ import com.hjq.permissions.Permission
import com.hjq.permissions.XXPermissions import com.hjq.permissions.XXPermissions
import com.navinfo.volvo.R import com.navinfo.volvo.R
import com.navinfo.volvo.databinding.ActivityMainBinding import com.navinfo.volvo.databinding.ActivityMainBinding
import com.navinfo.volvo.model.Dog
import com.navinfo.volvo.utils.SystemConstant import com.navinfo.volvo.utils.SystemConstant
import dagger.hilt.android.AndroidEntryPoint import dagger.hilt.android.AndroidEntryPoint
import io.realm.kotlin.Realm
import io.realm.kotlin.RealmConfiguration
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@ -69,13 +66,6 @@ class MainActivity : BaseActivity() {
// 在SD卡创建项目目录 // 在SD卡创建项目目录
createRootFolder() createRootFolder()
setupNavigation() setupNavigation()
val config = RealmConfiguration.Builder(schema = setOf(Dog::class))
.directory(SystemConstant.LogFolder)
.log(io.realm.kotlin.log.LogLevel.DEBUG)
.name("${SystemConstant.ROOT_PATH}/Test.realm")
.build()
Log.d("mypath:",config.path)
val realm: Realm = Realm.open(config)
} }
override fun onDenied(permissions: MutableList<String>, never: Boolean) { override fun onDenied(permissions: MutableList<String>, never: Boolean) {

View File

@ -16,9 +16,9 @@ buildscript {
plugins { plugins {
id 'com.android.application' version '7.1.2' apply false id 'com.android.application' version '7.1.2' apply false
id 'com.android.library' version '7.1.2' apply false id 'com.android.library' version '7.1.2' apply false
id 'org.jetbrains.kotlin.android' version '1.7.20' apply false id 'org.jetbrains.kotlin.android' version '1.6.10' apply false
id 'io.realm.kotlin' version '1.6.1' apply false
id 'com.google.dagger.hilt.android' version "2.44.2" apply false // id 'com.google.dagger.hilt.android' version "2.44.2" apply false
// id 'io.realm.kotlin' version '0.10.0' apply false // id 'io.realm.kotlin' version '0.10.0' apply false
} }
allprojects { allprojects {

View File

@ -25,11 +25,11 @@ android {
} }
} }
compileOptions { compileOptions {
sourceCompatibility JavaVersion.VERSION_11 sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_11 targetCompatibility JavaVersion.VERSION_1_8
} }
kotlinOptions { kotlinOptions {
jvmTarget = '11' jvmTarget = '1.8'
} }
buildFeatures { buildFeatures {
viewBinding true viewBinding true
@ -38,8 +38,8 @@ android {
dependencies { dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.7.20" implementation "org.jetbrains.kotlin:kotlin-stdlib:1.6.10"
implementation 'androidx.core:core-ktx:1.7.0' implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.1' implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0' implementation 'com.google.android.material:material:1.4.0'
testImplementation 'junit:junit:4.13.2' testImplementation 'junit:junit:4.13.2'

View File

@ -1,27 +1,27 @@
pluginManagement { pluginManagement {
repositories { repositories {
jcenter()
gradlePluginPortal()
google()
mavenCentral()
maven { url 'https://jitpack.io' }
maven { url "https://maven.aliyun.com/repository/google" } maven { url "https://maven.aliyun.com/repository/google" }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' } maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
maven { url 'https://maven.aliyun.com/repository/public' } maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/jcenter' } maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://jitpack.io' }
jcenter()
gradlePluginPortal()
google()
mavenCentral()
} }
} }
dependencyResolutionManagement { dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories { repositories {
jcenter()
google()
mavenCentral()
maven { url 'https://jitpack.io' }
maven { url "https://maven.aliyun.com/repository/google" } maven { url "https://maven.aliyun.com/repository/google" }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' } maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
maven { url 'https://maven.aliyun.com/repository/public' } maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/jcenter' } maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://jitpack.io' }
jcenter()
google()
mavenCentral()
} }
} }
rootProject.name = "NavinfoVolvo" rootProject.name = "NavinfoVolvo"