6.6.2 - Alpha5 - 主题色设置页面新布局支持历史记录功能
This commit is contained in:
@@ -11,8 +11,8 @@ open class CharsDictionaryDatabase private constructor(context: Context) : Dicti
|
||||
@Volatile
|
||||
private var instance: CharsDictionaryDatabase? = null
|
||||
|
||||
fun getInstance(context: Context): CharsDictionaryDatabase = instance ?: synchronized(this) {
|
||||
instance ?: CharsDictionaryDatabase(context.applicationContext).also { instance = it }
|
||||
fun getInstance(applicationContext: Context): CharsDictionaryDatabase = instance ?: synchronized(this) {
|
||||
instance ?: CharsDictionaryDatabase(applicationContext).also { instance = it }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ open class PhrasesDictionaryDatabase private constructor(context: Context): Dict
|
||||
@Volatile
|
||||
private var instance: PhrasesDictionaryDatabase? = null
|
||||
|
||||
fun getInstance(context: Context): PhrasesDictionaryDatabase = instance ?: synchronized(this) {
|
||||
instance ?: PhrasesDictionaryDatabase(context.applicationContext).also { instance = it }
|
||||
fun getInstance(applicationContext: Context): PhrasesDictionaryDatabase = instance ?: synchronized(this) {
|
||||
instance ?: PhrasesDictionaryDatabase(applicationContext).also { instance = it }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import kotlin.properties.Delegates
|
||||
|
||||
class WordDictionary(context: Context) {
|
||||
|
||||
private val db: SQLiteDatabase by lazy { WordDictionaryDatabase.getInstance(context).database }
|
||||
private val db: SQLiteDatabase by lazy { WordDictionaryDatabase.getInstance(context.applicationContext).database }
|
||||
private var minFreq by Delegates.notNull<Double>()
|
||||
|
||||
internal var trie = DictSegment(0.toChar())
|
||||
|
||||
@@ -11,8 +11,8 @@ open class WordDictionaryDatabase private constructor(context: Context): Diction
|
||||
@Volatile
|
||||
private var instance: WordDictionaryDatabase? = null
|
||||
|
||||
fun getInstance(context: Context): WordDictionaryDatabase = instance ?: synchronized(this) {
|
||||
instance ?: WordDictionaryDatabase(context.applicationContext).also { instance = it }
|
||||
fun getInstance(applicationContext: Context): WordDictionaryDatabase = instance ?: synchronized(this) {
|
||||
instance ?: WordDictionaryDatabase(applicationContext).also { instance = it }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user