diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/vulcan/data/hebe/VulcanHebeTeachers.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/vulcan/data/hebe/VulcanHebeTeachers.kt index f2fdfe40..e9f209a3 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/vulcan/data/hebe/VulcanHebeTeachers.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/vulcan/data/hebe/VulcanHebeTeachers.kt @@ -4,12 +4,12 @@ package pl.szczodrzynski.edziennik.data.api.edziennik.vulcan.data.hebe -import pl.szczodrzynski.edziennik.DAY import pl.szczodrzynski.edziennik.data.api.VULCAN_HEBE_ENDPOINT_TEACHERS import pl.szczodrzynski.edziennik.data.api.edziennik.vulcan.DataVulcan import pl.szczodrzynski.edziennik.data.api.edziennik.vulcan.ENDPOINT_VULCAN_HEBE_TEACHERS import pl.szczodrzynski.edziennik.data.api.edziennik.vulcan.data.VulcanHebe -import pl.szczodrzynski.edziennik.getString +import pl.szczodrzynski.edziennik.ext.DAY +import pl.szczodrzynski.edziennik.ext.getString class VulcanHebeTeachers( override val data: DataVulcan, diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/db/migration/Migration96.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/migration/Migration96.kt index 52f77256..e8315aa3 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/data/db/migration/Migration96.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/migration/Migration96.kt @@ -10,6 +10,6 @@ import androidx.sqlite.db.SupportSQLiteDatabase class Migration96 : Migration(95, 96) { override fun migrate(database: SupportSQLiteDatabase) { // teachers - associated subjects list - database.execSQL("ALTER TABLE teachers ADD COLUMN teacherSubjects TEXT NOT NULL;") + database.execSQL("ALTER TABLE teachers ADD COLUMN teacherSubjects TEXT NOT NULL DEFAULT '[]';") } } diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/teachers/TeachersListFragment.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/teachers/TeachersListFragment.kt index 8c24e111..09d79e08 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/teachers/TeachersListFragment.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/teachers/TeachersListFragment.kt @@ -48,7 +48,7 @@ class TeachersListFragment : Fragment(), CoroutineScope { val adapter = TeachersAdapter(activity) - app.db.teacherDao().getAllTeachers(App.profileId).observe(this@TeachersListFragment, Observer { items -> + app.db.teacherDao().getAllTeachers(App.profileId).observe(viewLifecycleOwner, Observer { items -> if (!isAdded) return@Observer // load & configure the adapter