From 00e077d01f9006b83a22b6a0caecff62b0203949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Tue, 25 Oct 2022 20:07:48 +0200 Subject: [PATCH] [UI] Fix notes not showing in note list dialog. --- .../data/db/converter/ConverterEnums.kt | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/db/converter/ConverterEnums.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/converter/ConverterEnums.kt index ff3bd2b3..d9fc893b 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/data/db/converter/ConverterEnums.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/converter/ConverterEnums.kt @@ -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()