Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
da490c46e1 | |||
0eb3c00c13 |
@ -7,6 +7,7 @@ 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'
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,11 +44,11 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility JavaVersion.VERSION_11
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
targetCompatibility JavaVersion.VERSION_11
|
||||||
}
|
}
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
jvmTarget = '1.8'
|
jvmTarget = '11'
|
||||||
freeCompilerArgs += [
|
freeCompilerArgs += [
|
||||||
"-Xjvm-default=all",
|
"-Xjvm-default=all",
|
||||||
]
|
]
|
||||||
@ -61,7 +62,7 @@ android {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
def nav_version = "2.5.3"
|
def nav_version = "2.5.3"
|
||||||
implementation 'androidx.core:core-ktx:1.8.0'
|
implementation 'androidx.core:core-ktx:1.7.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"
|
||||||
@ -121,8 +122,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.41"
|
implementation 'com.google.dagger:hilt-android:2.45'
|
||||||
kapt "com.google.dagger:hilt-compiler:2.41"
|
kapt 'com.google.dagger:hilt-compiler:2.45'
|
||||||
|
|
||||||
// 显示错误提示 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'
|
||||||
@ -152,6 +153,9 @@ 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 数据存储插件
|
||||||
|
8
app/src/main/java/com/navinfo/volvo/model/Dog.kt
Normal file
8
app/src/main/java/com/navinfo/volvo/model/Dog.kt
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
package com.navinfo.volvo.model
|
||||||
|
|
||||||
|
import io.realm.kotlin.types.RealmObject
|
||||||
|
|
||||||
|
class Dog : RealmObject {
|
||||||
|
var name: String = ""
|
||||||
|
var age: Int = 0
|
||||||
|
}
|
@ -31,8 +31,11 @@ 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
|
||||||
|
|
||||||
|
|
||||||
@ -66,6 +69,13 @@ 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) {
|
||||||
|
@ -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.6.10' apply false
|
id 'org.jetbrains.kotlin.android' version '1.7.20' 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 {
|
||||||
|
@ -25,11 +25,11 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility JavaVersion.VERSION_11
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
targetCompatibility JavaVersion.VERSION_11
|
||||||
}
|
}
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
jvmTarget = '1.8'
|
jvmTarget = '11'
|
||||||
}
|
}
|
||||||
buildFeatures {
|
buildFeatures {
|
||||||
viewBinding true
|
viewBinding true
|
||||||
@ -38,8 +38,8 @@ android {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.6.10"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.7.20"
|
||||||
implementation 'androidx.core:core-ktx:1.6.0'
|
implementation 'androidx.core:core-ktx:1.7.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'
|
||||||
|
@ -1,27 +1,27 @@
|
|||||||
pluginManagement {
|
pluginManagement {
|
||||||
repositories {
|
repositories {
|
||||||
maven { url "https://maven.aliyun.com/repository/google" }
|
|
||||||
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
|
|
||||||
maven { url 'https://maven.aliyun.com/repository/public' }
|
|
||||||
maven { url 'https://maven.aliyun.com/repository/jcenter' }
|
|
||||||
maven { url 'https://jitpack.io' }
|
|
||||||
jcenter()
|
jcenter()
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
maven { url 'https://jitpack.io' }
|
||||||
|
maven { url "https://maven.aliyun.com/repository/google" }
|
||||||
|
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
|
||||||
|
maven { url 'https://maven.aliyun.com/repository/public' }
|
||||||
|
maven { url 'https://maven.aliyun.com/repository/jcenter' }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
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"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user