Icon picker: add icon pack filter

This commit is contained in:
MM20
2023-02-27 14:39:18 +01:00
parent 81c542d777
commit 6adbee224e
6 changed files with 128 additions and 33 deletions
@@ -19,8 +19,14 @@ interface IconDao {
@Query("SELECT * FROM Icons WHERE componentName = :componentName AND (type = 'app' OR type = 'calendar')")
suspend fun getIconsFromAllPacks(componentName: String): List<IconEntity>
@Query("SELECT * FROM Icons WHERE (type = 'app' OR type = 'calendar') AND (drawable LIKE :drawableQuery OR componentName LIKE :componentQuery OR name LIKE :nameQuery) ORDER BY iconPack, drawable LIMIT :limit")
suspend fun searchIconPackIcons(componentQuery: String, nameQuery: String, drawableQuery: String, limit: Int = 100): List<IconEntity>
@Query("SELECT * FROM Icons WHERE (type = 'app' OR type = 'calendar') AND (drawable LIKE :drawableQuery OR componentName LIKE :componentQuery OR name LIKE :nameQuery) AND (:iconPack IS NULL OR iconPack = :iconPack) ORDER BY iconPack, drawable LIMIT :limit")
suspend fun searchIconPackIcons(
componentQuery: String,
nameQuery: String,
drawableQuery: String,
iconPack: String?,
limit: Int = 100
): List<IconEntity>
@Query("SELECT * FROM Icons WHERE (type = 'greyscale_icon') AND componentName LIKE :query GROUP BY componentName ORDER BY drawable LIMIT :limit")
suspend fun searchGreyscaleIcons(query: String, limit: Int = 100): List<IconEntity>
@@ -681,6 +681,8 @@
<string name="icon_picker_default_icon">Default</string>
<string name="icon_picker_suggestions">Suggestions</string>
<string name="icon_picker_search_icon">Search icon</string>
<string name="icon_picker_no_packs_installed">No icon packs installed</string>
<string name="icon_picker_filter_all_packs">All icon packs</string>
<string name="apps_profile_main">Personal</string>
<string name="apps_profile_work">Work</string>
<string name="favorites">Favorites</string>