Change Icons schema:

- drop useless `scale` column
- add `themed` column
- add `name` column
This commit is contained in:
MM20
2023-02-14 21:12:11 +01:00
parent ebcd91091d
commit 6407d0577f
6 changed files with 531 additions and 23 deletions
@@ -4,27 +4,30 @@ import android.content.ComponentName
import de.mm20.launcher2.database.entities.IconEntity
data class IconPackIcon(
val type: String,
val componentName: ComponentName?,
val drawable: String?,
val iconPack: String,
val scale: Float? = null
val type: String,
val componentName: ComponentName?,
val drawable: String?,
val iconPack: String,
val themed: Boolean = false,
val name: String? = null,
) {
constructor(entity: IconEntity) : this(
type = entity.type,
componentName = entity.componentName,
drawable = entity.drawable,
iconPack = entity.iconPack,
scale = entity.scale
type = entity.type,
componentName = entity.componentName,
drawable = entity.drawable,
iconPack = entity.iconPack,
themed = entity.themed,
name = entity.name,
)
fun toDatabaseEntity(): IconEntity {
return IconEntity(
type = type,
componentName = componentName,
drawable = drawable,
iconPack = iconPack,
scale = scale
type = type,
componentName = componentName,
drawable = drawable,
iconPack = iconPack,
themed = themed,
name = name,
)
}
}