Implement basic icon picker

This commit is contained in:
MM20
2022-07-26 17:20:34 +02:00
parent 70bef9ac14
commit 32c82d74c3
8 changed files with 244 additions and 11 deletions
@@ -1,12 +1,19 @@
package de.mm20.launcher2.database
import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query
import de.mm20.launcher2.database.entities.CustomAttributeEntity
import kotlinx.coroutines.flow.Flow
@Dao
interface CustomAttrsDao {
@Query("SELECT * FROM CustomAttributes WHERE type = 'icon' AND key = :key LIMIT 1")
fun getCustomIcon(key: String) : Flow<CustomAttributeEntity?>
@Query("SELECT * FROM CustomAttributes WHERE type = :type AND key = :key LIMIT 1")
fun getCustomAttribute(key: String, type: String) : Flow<CustomAttributeEntity?>
@Query("DELETE FROM CustomAttributes WHERE type = :type AND key = :key")
fun clearCustomAttribute(key: String, type: String)
@Insert
fun setCustomAttribute(entity: CustomAttributeEntity)
}