[UI] Fix notes not showing in note list dialog.

This commit is contained in:
Kuba Szczodrzyński 2022-10-25 20:07:48 +02:00
parent c21d89cf60
commit 00e077d01f
No known key found for this signature in database
GPG Key ID: 70CB8A85BA1633CB

View File

@ -5,13 +5,37 @@
package pl.szczodrzynski.edziennik.data.db.converter
import androidx.room.TypeConverter
import pl.szczodrzynski.edziennik.data.db.enums.FeatureType
import pl.szczodrzynski.edziennik.data.db.enums.LoginMethod
import pl.szczodrzynski.edziennik.data.db.enums.LoginMode
import pl.szczodrzynski.edziennik.data.db.enums.LoginType
import pl.szczodrzynski.edziennik.data.db.enums.MetadataType
import pl.szczodrzynski.edziennik.data.db.enums.NotificationType
import pl.szczodrzynski.edziennik.ext.*
import pl.szczodrzynski.edziennik.ui.base.enums.NavTarget
class ConverterEnums {
@TypeConverter
fun fromEnum(value: Enum<*>?) = value?.toInt()
fun fromFeatureType(value: FeatureType?) = value?.id
@TypeConverter
fun fromLoginMethod(value: LoginMethod?) = value?.id
@TypeConverter
fun fromLoginMode(value: LoginMode?) = value?.id
@TypeConverter
fun fromLoginType(value: LoginType?) = value?.id
@TypeConverter
fun fromMetadataType(value: MetadataType?) = value?.id
@TypeConverter
fun fromNotificationType(value: NotificationType?) = value?.id
@TypeConverter
fun fromNavTarget(value: NavTarget?) = value?.id
@TypeConverter
fun toFeatureType(value: Int?) = value.asFeatureTypeOrNull()