Skip to content

Commit

Permalink
sample: UserConfig持久化示例
Browse files Browse the repository at this point in the history
  • Loading branch information
liangjingkanji committed Nov 9, 2023
1 parent f4a3cce commit 4e6ae7b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,6 @@ dependencies {
implementation "com.github.liangjingkanji:Tooltip:1.2.2" // 吐司工具
implementation 'com.github.liangjingkanji:Engine:0.0.74'
implementation "com.squareup.okhttp3:mockwebserver:4.10.0"
implementation 'com.github.liangjingkanji:Serialize:3.0.1'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.12'
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
package com.drake.net.sample.constants

import com.drake.serialize.serialize.annotation.SerializeConfig
import com.drake.serialize.serialize.serialLazy


/**
* 建议使用 https://github.com/liangjingkanji/Serialize 为字段提供持久化存储
* 本单例类使用 https://github.com/liangjingkanji/Serialize 为字段提供持久化存储
*/
@SerializeConfig(mmapID = "user_config")
object UserConfig {

var token = "6cad0ff06f5a214b9cfdf2a4a7c432339"
var token by serialLazy(default = "6cad0ff06f5a214b9cfdf2a4a7c432339")

var isLogin = true
var isLogin by serialLazy(default = false)
}

0 comments on commit 4e6ae7b

Please sign in to comment.