Autocomplete tag input
This commit is contained in:
@@ -30,6 +30,8 @@ interface CustomAttributesRepository {
|
||||
|
||||
suspend fun export(toDir: File)
|
||||
suspend fun import(fromDir: File)
|
||||
|
||||
suspend fun getAllTags(startsWith: String? = null): List<String>
|
||||
}
|
||||
|
||||
internal class CustomAttributesRepositoryImpl(
|
||||
@@ -103,6 +105,15 @@ internal class CustomAttributesRepositoryImpl(
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun getAllTags(startsWith: String?): List<String> {
|
||||
val dao = appDatabase.customAttrsDao()
|
||||
return if (startsWith != null) {
|
||||
dao.getAllTagsLike("$startsWith%")
|
||||
} else {
|
||||
dao.getAllTags()
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun search(query: String): Flow<List<Searchable>> {
|
||||
if (query.isBlank()) {
|
||||
return flow {
|
||||
|
||||
Reference in New Issue
Block a user