You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
val hasWordProjection = arrayOf(UserDictionary.Words.WORD, UserDictionary.Words.LOCALE)
262
265
263
266
val select:String
264
-
val selectArgs:Array<String>?
267
+
val selectArgs:Array<String>
265
268
if (locale ==null) {
266
-
select ="${UserDictionary.Words.WORD}=? AND ${UserDictionary.Words.LOCALE} is null"
267
-
selectArgs = arrayOf(word)
269
+
if (shortcut.isNullOrEmpty()) {
270
+
select ="${UserDictionary.Words.WORD}=? AND ${UserDictionary.Words.LOCALE} is null AND (${UserDictionary.Words.SHORTCUT} is null OR ${UserDictionary.Words.SHORTCUT}='')"
271
+
selectArgs = arrayOf(word)
272
+
} else {
273
+
select ="${UserDictionary.Words.WORD}=? AND ${UserDictionary.Words.LOCALE} is null AND ${UserDictionary.Words.SHORTCUT}=?"
274
+
selectArgs = arrayOf(word, shortcut)
275
+
}
268
276
} else {
269
-
select ="${UserDictionary.Words.WORD}=? AND ${UserDictionary.Words.LOCALE}=?"
270
-
// requires use of locale string (as opposed to more useful language tag) for interaction with Android system
271
-
selectArgs = arrayOf(word, locale.toString())
277
+
if (shortcut.isNullOrEmpty()) {
278
+
select ="${UserDictionary.Words.WORD}=? AND ${UserDictionary.Words.LOCALE}=? AND (${UserDictionary.Words.SHORTCUT} is null OR ${UserDictionary.Words.SHORTCUT}='')"
279
+
selectArgs = arrayOf(word, locale.toString())
280
+
} else {
281
+
select ="${UserDictionary.Words.WORD}=? AND ${UserDictionary.Words.LOCALE}=? AND ${UserDictionary.Words.SHORTCUT}=?"
0 commit comments