diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
index ab75be24..c8ff3936 100644
--- a/.idea/codeStyles/Project.xml
+++ b/.idea/codeStyles/Project.xml
@@ -1,9 +1,17 @@
+
+
+
+
+
+
+
+
diff --git a/.idea/dictionaries/Kuba.xml b/.idea/dictionaries/Kuba.xml
index 592a5d5e..7959d9aa 100644
--- a/.idea/dictionaries/Kuba.xml
+++ b/.idea/dictionaries/Kuba.xml
@@ -5,6 +5,7 @@
ciasteczko
csrf
edziennik
+ eggfall
elearning
gson
hebe
@@ -13,6 +14,7 @@
synergia
szczodrzyński
szkolny
+ usos
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
index 57334e8f..c6e8ef86 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -208,7 +208,7 @@ dependencies {
implementation "com.daimajia.swipelayout:library:1.2.0@aar"
implementation "com.github.Applandeo:Material-Calendar-View:15de569cbc" // https://github.com/Applandeo/Material-Calendar-View
implementation "com.github.CanHub:Android-Image-Cropper:2.2.2" // https://github.com/CanHub/Android-Image-Cropper
- implementation "com.github.ChuckerTeam.Chucker:library:3.0.1" // https://github.com/ChuckerTeam/chucker
+ implementation "com.github.ChuckerTeam.Chucker:library:3.5.2" // https://github.com/ChuckerTeam/chucker
implementation "com.github.antonKozyriatskyi:CircularProgressIndicator:1.2.2" // https://github.com/antonKozyriatskyi/CircularProgressIndicator
implementation "com.github.bassaer:chatmessageview:2.0.1" // https://github.com/bassaer/ChatMessageView
implementation "com.github.hypertrack:hyperlog-android:0.0.10" // https://github.com/hypertrack/hyperlog-android
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
index 1d72bf89..8618f020 100644
--- a/app/proguard-rules.pro
+++ b/app/proguard-rules.pro
@@ -22,6 +22,7 @@
-keep class android.support.v7.widget.** { *; }
-keep class pl.szczodrzynski.edziennik.utils.models.** { *; }
+-keep class pl.szczodrzynski.edziennik.data.db.enums.* { *; }
-keep class pl.szczodrzynski.edziennik.data.db.entity.Event { *; }
-keep class pl.szczodrzynski.edziennik.data.db.full.EventFull { *; }
-keep class pl.szczodrzynski.edziennik.data.db.entity.FeedbackMessage { *; }
@@ -31,6 +32,9 @@
-keepnames class pl.szczodrzynski.edziennik.ui.widgets.timetable.WidgetTimetableProvider
-keepnames class pl.szczodrzynski.edziennik.ui.widgets.notifications.WidgetNotificationsProvider
-keepnames class pl.szczodrzynski.edziennik.ui.widgets.luckynumber.WidgetLuckyNumberProvider
+-keep class pl.szczodrzynski.edziennik.config.AppData { *; }
+-keep class pl.szczodrzynski.edziennik.config.AppData$** { *; }
+-keep class pl.szczodrzynski.edziennik.utils.managers.TextStylingManager$HtmlMode { *; }
-keepnames class androidx.appcompat.view.menu.MenuBuilder { setHeaderTitleInt(java.lang.CharSequence); }
-keepnames class androidx.appcompat.view.menu.MenuPopupHelper { showPopup(int, int, boolean, boolean); }
diff --git a/app/schemas/pl.szczodrzynski.edziennik.data.db.AppDb/100.json b/app/schemas/pl.szczodrzynski.edziennik.data.db.AppDb/100.json
new file mode 100644
index 00000000..1bbdcf44
--- /dev/null
+++ b/app/schemas/pl.szczodrzynski.edziennik.data.db.AppDb/100.json
@@ -0,0 +1,2320 @@
+{
+ "formatVersion": 1,
+ "database": {
+ "version": 100,
+ "identityHash": "4c141460d807d32d00faad4fb3c12522",
+ "entities": [
+ {
+ "tableName": "grades",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `gradeId` INTEGER NOT NULL, `gradeName` TEXT NOT NULL, `gradeType` INTEGER NOT NULL, `gradeValue` REAL NOT NULL, `gradeWeight` REAL NOT NULL, `gradeColor` INTEGER NOT NULL, `gradeCategory` TEXT, `gradeDescription` TEXT, `gradeComment` TEXT, `gradeSemester` INTEGER NOT NULL, `teacherId` INTEGER NOT NULL, `subjectId` INTEGER NOT NULL, `addedDate` INTEGER NOT NULL, `gradeValueMax` REAL, `gradeClassAverage` REAL, `gradeParentId` INTEGER, `gradeIsImprovement` INTEGER NOT NULL, `keep` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `gradeId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "gradeId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "gradeName",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "gradeType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "value",
+ "columnName": "gradeValue",
+ "affinity": "REAL",
+ "notNull": true
+ },
+ {
+ "fieldPath": "weight",
+ "columnName": "gradeWeight",
+ "affinity": "REAL",
+ "notNull": true
+ },
+ {
+ "fieldPath": "color",
+ "columnName": "gradeColor",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "category",
+ "columnName": "gradeCategory",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "description",
+ "columnName": "gradeDescription",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "comment",
+ "columnName": "gradeComment",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "semester",
+ "columnName": "gradeSemester",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "teacherId",
+ "columnName": "teacherId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "subjectId",
+ "columnName": "subjectId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "addedDate",
+ "columnName": "addedDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "valueMax",
+ "columnName": "gradeValueMax",
+ "affinity": "REAL",
+ "notNull": false
+ },
+ {
+ "fieldPath": "classAverage",
+ "columnName": "gradeClassAverage",
+ "affinity": "REAL",
+ "notNull": false
+ },
+ {
+ "fieldPath": "parentId",
+ "columnName": "gradeParentId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "isImprovement",
+ "columnName": "gradeIsImprovement",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "keep",
+ "columnName": "keep",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "gradeId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [
+ {
+ "name": "index_grades_profileId",
+ "unique": false,
+ "columnNames": [
+ "profileId"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_grades_profileId` ON `${TABLE_NAME}` (`profileId`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "teachers",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `teacherId` INTEGER NOT NULL, `teacherLoginId` TEXT, `teacherName` TEXT, `teacherSurname` TEXT, `teacherType` INTEGER NOT NULL, `teacherTypeDescription` TEXT, `teacherSubjects` TEXT NOT NULL, PRIMARY KEY(`profileId`, `teacherId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "teacherId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "loginId",
+ "columnName": "teacherLoginId",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "teacherName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "surname",
+ "columnName": "teacherSurname",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "teacherType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "typeDescription",
+ "columnName": "teacherTypeDescription",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "subjects",
+ "columnName": "teacherSubjects",
+ "affinity": "TEXT",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "teacherId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "teacherAbsence",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `teacherAbsenceId` INTEGER NOT NULL, `teacherAbsenceType` INTEGER NOT NULL, `teacherAbsenceName` TEXT, `teacherAbsenceDateFrom` TEXT NOT NULL, `teacherAbsenceDateTo` TEXT NOT NULL, `teacherAbsenceTimeFrom` TEXT, `teacherAbsenceTimeTo` TEXT, `teacherId` INTEGER NOT NULL, `addedDate` INTEGER NOT NULL, `keep` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `teacherAbsenceId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "teacherAbsenceId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "teacherAbsenceType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "teacherAbsenceName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "dateFrom",
+ "columnName": "teacherAbsenceDateFrom",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "dateTo",
+ "columnName": "teacherAbsenceDateTo",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "timeFrom",
+ "columnName": "teacherAbsenceTimeFrom",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "timeTo",
+ "columnName": "teacherAbsenceTimeTo",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "teacherId",
+ "columnName": "teacherId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "addedDate",
+ "columnName": "addedDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "keep",
+ "columnName": "keep",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "teacherAbsenceId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [
+ {
+ "name": "index_teacherAbsence_profileId",
+ "unique": false,
+ "columnNames": [
+ "profileId"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_teacherAbsence_profileId` ON `${TABLE_NAME}` (`profileId`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "teacherAbsenceTypes",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `teacherAbsenceTypeId` INTEGER NOT NULL, `teacherAbsenceTypeName` TEXT NOT NULL, PRIMARY KEY(`profileId`, `teacherAbsenceTypeId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "teacherAbsenceTypeId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "teacherAbsenceTypeName",
+ "affinity": "TEXT",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "teacherAbsenceTypeId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "subjects",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `subjectId` INTEGER NOT NULL, `subjectLongName` TEXT, `subjectShortName` TEXT, `subjectColor` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `subjectId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "subjectId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "longName",
+ "columnName": "subjectLongName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "shortName",
+ "columnName": "subjectShortName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "color",
+ "columnName": "subjectColor",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "subjectId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "notices",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `noticeId` INTEGER NOT NULL, `noticeType` INTEGER NOT NULL, `noticeSemester` INTEGER NOT NULL, `noticeText` TEXT NOT NULL, `noticeCategory` TEXT, `noticePoints` REAL, `teacherId` INTEGER NOT NULL, `addedDate` INTEGER NOT NULL, `keep` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `noticeId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "noticeId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "noticeType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "semester",
+ "columnName": "noticeSemester",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "text",
+ "columnName": "noticeText",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "category",
+ "columnName": "noticeCategory",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "points",
+ "columnName": "noticePoints",
+ "affinity": "REAL",
+ "notNull": false
+ },
+ {
+ "fieldPath": "teacherId",
+ "columnName": "teacherId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "addedDate",
+ "columnName": "addedDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "keep",
+ "columnName": "keep",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "noticeId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [
+ {
+ "name": "index_notices_profileId",
+ "unique": false,
+ "columnNames": [
+ "profileId"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_notices_profileId` ON `${TABLE_NAME}` (`profileId`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "teams",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `teamId` INTEGER NOT NULL, `teamType` INTEGER NOT NULL, `teamName` TEXT, `teamCode` TEXT, `teamTeacherId` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `teamId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "teamId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "teamType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "teamName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "code",
+ "columnName": "teamCode",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "teacherId",
+ "columnName": "teamTeacherId",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "teamId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "attendances",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `attendanceId` INTEGER NOT NULL, `attendanceBaseType` INTEGER NOT NULL, `attendanceTypeName` TEXT NOT NULL, `attendanceTypeShort` TEXT NOT NULL, `attendanceTypeSymbol` TEXT NOT NULL, `attendanceTypeColor` INTEGER, `attendanceDate` TEXT NOT NULL, `attendanceTime` TEXT, `attendanceSemester` INTEGER NOT NULL, `teacherId` INTEGER NOT NULL, `subjectId` INTEGER NOT NULL, `addedDate` INTEGER NOT NULL, `attendanceLessonTopic` TEXT, `attendanceLessonNumber` INTEGER, `attendanceIsCounted` INTEGER NOT NULL, `keep` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `attendanceId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "attendanceId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "baseType",
+ "columnName": "attendanceBaseType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "typeName",
+ "columnName": "attendanceTypeName",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "typeShort",
+ "columnName": "attendanceTypeShort",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "typeSymbol",
+ "columnName": "attendanceTypeSymbol",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "typeColor",
+ "columnName": "attendanceTypeColor",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "date",
+ "columnName": "attendanceDate",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "startTime",
+ "columnName": "attendanceTime",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "semester",
+ "columnName": "attendanceSemester",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "teacherId",
+ "columnName": "teacherId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "subjectId",
+ "columnName": "subjectId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "addedDate",
+ "columnName": "addedDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "lessonTopic",
+ "columnName": "attendanceLessonTopic",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "lessonNumber",
+ "columnName": "attendanceLessonNumber",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "isCounted",
+ "columnName": "attendanceIsCounted",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "keep",
+ "columnName": "keep",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "attendanceId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [
+ {
+ "name": "index_attendances_profileId",
+ "unique": false,
+ "columnNames": [
+ "profileId"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_attendances_profileId` ON `${TABLE_NAME}` (`profileId`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "events",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `eventId` INTEGER NOT NULL, `eventDate` TEXT NOT NULL, `eventTime` TEXT, `eventTopic` TEXT NOT NULL, `eventColor` INTEGER, `eventType` INTEGER NOT NULL, `teacherId` INTEGER NOT NULL, `subjectId` INTEGER NOT NULL, `teamId` INTEGER NOT NULL, `addedDate` INTEGER NOT NULL, `eventAddedManually` INTEGER NOT NULL, `eventSharedBy` TEXT, `eventSharedByName` TEXT, `eventBlacklisted` INTEGER NOT NULL, `eventIsDone` INTEGER NOT NULL, `eventIsDownloaded` INTEGER NOT NULL, `homeworkBody` TEXT, `attachmentIds` TEXT, `attachmentNames` TEXT, `keep` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `eventId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "eventId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "date",
+ "columnName": "eventDate",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "time",
+ "columnName": "eventTime",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "topic",
+ "columnName": "eventTopic",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "color",
+ "columnName": "eventColor",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "eventType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "teacherId",
+ "columnName": "teacherId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "subjectId",
+ "columnName": "subjectId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "teamId",
+ "columnName": "teamId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "addedDate",
+ "columnName": "addedDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "addedManually",
+ "columnName": "eventAddedManually",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "sharedBy",
+ "columnName": "eventSharedBy",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "sharedByName",
+ "columnName": "eventSharedByName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "blacklisted",
+ "columnName": "eventBlacklisted",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "isDone",
+ "columnName": "eventIsDone",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "isDownloaded",
+ "columnName": "eventIsDownloaded",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "homeworkBody",
+ "columnName": "homeworkBody",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "attachmentIds",
+ "columnName": "attachmentIds",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "attachmentNames",
+ "columnName": "attachmentNames",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "keep",
+ "columnName": "keep",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "eventId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [
+ {
+ "name": "index_events_profileId_eventDate_eventTime",
+ "unique": false,
+ "columnNames": [
+ "profileId",
+ "eventDate",
+ "eventTime"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_events_profileId_eventDate_eventTime` ON `${TABLE_NAME}` (`profileId`, `eventDate`, `eventTime`)"
+ },
+ {
+ "name": "index_events_profileId_eventType",
+ "unique": false,
+ "columnNames": [
+ "profileId",
+ "eventType"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_events_profileId_eventType` ON `${TABLE_NAME}` (`profileId`, `eventType`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "eventTypes",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `eventType` INTEGER NOT NULL, `eventTypeName` TEXT NOT NULL, `eventTypeColor` INTEGER NOT NULL, `eventTypeOrder` INTEGER NOT NULL, `eventTypeSource` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `eventType`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "eventType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "eventTypeName",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "color",
+ "columnName": "eventTypeColor",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "order",
+ "columnName": "eventTypeOrder",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "source",
+ "columnName": "eventTypeSource",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "eventType"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "loginStores",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`loginStoreId` INTEGER NOT NULL, `loginStoreType` INTEGER NOT NULL, `loginStoreMode` INTEGER NOT NULL, `loginStoreData` TEXT NOT NULL, PRIMARY KEY(`loginStoreId`))",
+ "fields": [
+ {
+ "fieldPath": "id",
+ "columnName": "loginStoreId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "loginStoreType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "mode",
+ "columnName": "loginStoreMode",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "data",
+ "columnName": "loginStoreData",
+ "affinity": "TEXT",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "loginStoreId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "profiles",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `loginStoreId` INTEGER NOT NULL, `loginStoreType` INTEGER NOT NULL, `name` TEXT NOT NULL, `subname` TEXT, `studentNameLong` TEXT NOT NULL, `studentNameShort` TEXT NOT NULL, `accountName` TEXT, `studentData` TEXT NOT NULL, `image` TEXT, `empty` INTEGER NOT NULL, `archived` INTEGER NOT NULL, `syncEnabled` INTEGER NOT NULL, `enableSharedEvents` INTEGER NOT NULL, `registration` INTEGER NOT NULL, `userCode` TEXT NOT NULL, `archiveId` INTEGER, `studentNumber` INTEGER NOT NULL, `studentClassName` TEXT, `studentSchoolYearStart` INTEGER NOT NULL, `dateSemester1Start` TEXT NOT NULL, `dateSemester2Start` TEXT NOT NULL, `dateYearEnd` TEXT NOT NULL, `disabledNotifications` TEXT, `lastReceiversSync` INTEGER NOT NULL, PRIMARY KEY(`profileId`))",
+ "fields": [
+ {
+ "fieldPath": "id",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "loginStoreId",
+ "columnName": "loginStoreId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "loginStoreType",
+ "columnName": "loginStoreType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "name",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "subname",
+ "columnName": "subname",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "studentNameLong",
+ "columnName": "studentNameLong",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "studentNameShort",
+ "columnName": "studentNameShort",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "accountName",
+ "columnName": "accountName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "studentData",
+ "columnName": "studentData",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "image",
+ "columnName": "image",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "empty",
+ "columnName": "empty",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "archived",
+ "columnName": "archived",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "syncEnabled",
+ "columnName": "syncEnabled",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "unused1",
+ "columnName": "enableSharedEvents",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "registration",
+ "columnName": "registration",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "userCode",
+ "columnName": "userCode",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "archiveId",
+ "columnName": "archiveId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "studentNumber",
+ "columnName": "studentNumber",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "studentClassName",
+ "columnName": "studentClassName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "studentSchoolYearStart",
+ "columnName": "studentSchoolYearStart",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "dateSemester1Start",
+ "columnName": "dateSemester1Start",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "dateSemester2Start",
+ "columnName": "dateSemester2Start",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "dateYearEnd",
+ "columnName": "dateYearEnd",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "disabledNotifications",
+ "columnName": "disabledNotifications",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "lastReceiversSync",
+ "columnName": "lastReceiversSync",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "luckyNumbers",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `luckyNumberDate` INTEGER NOT NULL, `luckyNumber` INTEGER NOT NULL, `keep` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `luckyNumberDate`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "date",
+ "columnName": "luckyNumberDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "number",
+ "columnName": "luckyNumber",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "keep",
+ "columnName": "keep",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "luckyNumberDate"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "announcements",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `announcementId` INTEGER NOT NULL, `announcementSubject` TEXT NOT NULL, `announcementText` TEXT, `announcementStartDate` TEXT, `announcementEndDate` TEXT, `teacherId` INTEGER NOT NULL, `addedDate` INTEGER NOT NULL, `announcementIdString` TEXT, `keep` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `announcementId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "announcementId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "subject",
+ "columnName": "announcementSubject",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "text",
+ "columnName": "announcementText",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "startDate",
+ "columnName": "announcementStartDate",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "endDate",
+ "columnName": "announcementEndDate",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "teacherId",
+ "columnName": "teacherId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "addedDate",
+ "columnName": "addedDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "idString",
+ "columnName": "announcementIdString",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "keep",
+ "columnName": "keep",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "announcementId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [
+ {
+ "name": "index_announcements_profileId",
+ "unique": false,
+ "columnNames": [
+ "profileId"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_announcements_profileId` ON `${TABLE_NAME}` (`profileId`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "gradeCategories",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `categoryId` INTEGER NOT NULL, `weight` REAL NOT NULL, `color` INTEGER NOT NULL, `text` TEXT, `columns` TEXT, `valueFrom` REAL NOT NULL, `valueTo` REAL NOT NULL, `type` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `categoryId`, `type`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "categoryId",
+ "columnName": "categoryId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "weight",
+ "columnName": "weight",
+ "affinity": "REAL",
+ "notNull": true
+ },
+ {
+ "fieldPath": "color",
+ "columnName": "color",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "text",
+ "columnName": "text",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "columns",
+ "columnName": "columns",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "valueFrom",
+ "columnName": "valueFrom",
+ "affinity": "REAL",
+ "notNull": true
+ },
+ {
+ "fieldPath": "valueTo",
+ "columnName": "valueTo",
+ "affinity": "REAL",
+ "notNull": true
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "type",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "categoryId",
+ "type"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "feedbackMessages",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`messageId` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `received` INTEGER NOT NULL, `text` TEXT NOT NULL, `senderName` TEXT NOT NULL, `deviceId` TEXT, `deviceName` TEXT, `devId` INTEGER, `devImage` TEXT, `sentTime` INTEGER NOT NULL)",
+ "fields": [
+ {
+ "fieldPath": "messageId",
+ "columnName": "messageId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "received",
+ "columnName": "received",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "text",
+ "columnName": "text",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "senderName",
+ "columnName": "senderName",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "deviceId",
+ "columnName": "deviceId",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "deviceName",
+ "columnName": "deviceName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "devId",
+ "columnName": "devId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "devImage",
+ "columnName": "devImage",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "sentTime",
+ "columnName": "sentTime",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "messageId"
+ ],
+ "autoGenerate": true
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "messages",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `messageId` INTEGER NOT NULL, `messageType` INTEGER NOT NULL, `messageSubject` TEXT NOT NULL, `messageBody` TEXT, `senderId` INTEGER, `addedDate` INTEGER NOT NULL, `messageIsPinned` INTEGER NOT NULL, `hasAttachments` INTEGER NOT NULL, `attachmentIds` TEXT, `attachmentNames` TEXT, `attachmentSizes` TEXT, `keep` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `messageId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "messageId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "messageType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "subject",
+ "columnName": "messageSubject",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "body",
+ "columnName": "messageBody",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "senderId",
+ "columnName": "senderId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "addedDate",
+ "columnName": "addedDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "isStarred",
+ "columnName": "messageIsPinned",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "hasAttachments",
+ "columnName": "hasAttachments",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "attachmentIds",
+ "columnName": "attachmentIds",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "attachmentNames",
+ "columnName": "attachmentNames",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "attachmentSizes",
+ "columnName": "attachmentSizes",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "keep",
+ "columnName": "keep",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "messageId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [
+ {
+ "name": "index_messages_profileId_messageType",
+ "unique": false,
+ "columnNames": [
+ "profileId",
+ "messageType"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_profileId_messageType` ON `${TABLE_NAME}` (`profileId`, `messageType`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "messageRecipients",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `messageRecipientId` INTEGER NOT NULL, `messageRecipientReplyId` INTEGER NOT NULL, `messageRecipientReadDate` INTEGER NOT NULL, `messageId` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `messageRecipientId`, `messageId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "messageRecipientId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "replyId",
+ "columnName": "messageRecipientReplyId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "readDate",
+ "columnName": "messageRecipientReadDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "messageId",
+ "columnName": "messageId",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "messageRecipientId",
+ "messageId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "debugLogs",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `text` TEXT)",
+ "fields": [
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "text",
+ "columnName": "text",
+ "affinity": "TEXT",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "id"
+ ],
+ "autoGenerate": true
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "endpointTimers",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `endpointId` INTEGER NOT NULL, `endpointLastSync` INTEGER, `endpointNextSync` INTEGER NOT NULL, `endpointViewId` INTEGER, PRIMARY KEY(`profileId`, `endpointId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "endpointId",
+ "columnName": "endpointId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "lastSync",
+ "columnName": "endpointLastSync",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "nextSync",
+ "columnName": "endpointNextSync",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "featureType",
+ "columnName": "endpointViewId",
+ "affinity": "INTEGER",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "endpointId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "lessonRanges",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `lessonRangeNumber` INTEGER NOT NULL, `lessonRangeStart` TEXT NOT NULL, `lessonRangeEnd` TEXT NOT NULL, PRIMARY KEY(`profileId`, `lessonRangeNumber`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "lessonNumber",
+ "columnName": "lessonRangeNumber",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "startTime",
+ "columnName": "lessonRangeStart",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "endTime",
+ "columnName": "lessonRangeEnd",
+ "affinity": "TEXT",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "lessonRangeNumber"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "notifications",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `title` TEXT NOT NULL, `text` TEXT NOT NULL, `textLong` TEXT, `type` INTEGER NOT NULL, `profileId` INTEGER, `profileName` TEXT, `posted` INTEGER NOT NULL, `viewId` INTEGER, `extras` TEXT, `addedDate` INTEGER NOT NULL)",
+ "fields": [
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "title",
+ "columnName": "title",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "text",
+ "columnName": "text",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "textLong",
+ "columnName": "textLong",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "type",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "profileName",
+ "columnName": "profileName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "posted",
+ "columnName": "posted",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "navTarget",
+ "columnName": "viewId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "extras",
+ "columnName": "extras",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "addedDate",
+ "columnName": "addedDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "id"
+ ],
+ "autoGenerate": true
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "classrooms",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `id` INTEGER NOT NULL, `name` TEXT NOT NULL, PRIMARY KEY(`profileId`, `id`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "name",
+ "affinity": "TEXT",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "id"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "noticeTypes",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `id` INTEGER NOT NULL, `name` TEXT NOT NULL, PRIMARY KEY(`profileId`, `id`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "name",
+ "affinity": "TEXT",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "id"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "attendanceTypes",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `id` INTEGER NOT NULL, `baseType` INTEGER NOT NULL, `typeName` TEXT NOT NULL, `typeShort` TEXT NOT NULL, `typeSymbol` TEXT NOT NULL, `typeColor` INTEGER, PRIMARY KEY(`profileId`, `id`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "baseType",
+ "columnName": "baseType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "typeName",
+ "columnName": "typeName",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "typeShort",
+ "columnName": "typeShort",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "typeSymbol",
+ "columnName": "typeSymbol",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "typeColor",
+ "columnName": "typeColor",
+ "affinity": "INTEGER",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "id"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "timetable",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `id` INTEGER NOT NULL, `type` INTEGER NOT NULL, `date` TEXT, `lessonNumber` INTEGER, `startTime` TEXT, `endTime` TEXT, `subjectId` INTEGER, `teacherId` INTEGER, `teamId` INTEGER, `classroom` TEXT, `oldDate` TEXT, `oldLessonNumber` INTEGER, `oldStartTime` TEXT, `oldEndTime` TEXT, `oldSubjectId` INTEGER, `oldTeacherId` INTEGER, `oldTeamId` INTEGER, `oldClassroom` TEXT, `isExtra` INTEGER NOT NULL, `ownerId` INTEGER NOT NULL, `color` INTEGER, `keep` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `id`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "type",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "date",
+ "columnName": "date",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "lessonNumber",
+ "columnName": "lessonNumber",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "startTime",
+ "columnName": "startTime",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "endTime",
+ "columnName": "endTime",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "subjectId",
+ "columnName": "subjectId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "teacherId",
+ "columnName": "teacherId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "teamId",
+ "columnName": "teamId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "classroom",
+ "columnName": "classroom",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "oldDate",
+ "columnName": "oldDate",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "oldLessonNumber",
+ "columnName": "oldLessonNumber",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "oldStartTime",
+ "columnName": "oldStartTime",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "oldEndTime",
+ "columnName": "oldEndTime",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "oldSubjectId",
+ "columnName": "oldSubjectId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "oldTeacherId",
+ "columnName": "oldTeacherId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "oldTeamId",
+ "columnName": "oldTeamId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "oldClassroom",
+ "columnName": "oldClassroom",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "isExtra",
+ "columnName": "isExtra",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "ownerId",
+ "columnName": "ownerId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "color",
+ "columnName": "color",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "keep",
+ "columnName": "keep",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "id"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [
+ {
+ "name": "index_timetable_profileId_type_date",
+ "unique": false,
+ "columnNames": [
+ "profileId",
+ "type",
+ "date"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_timetable_profileId_type_date` ON `${TABLE_NAME}` (`profileId`, `type`, `date`)"
+ },
+ {
+ "name": "index_timetable_profileId_type_oldDate",
+ "unique": false,
+ "columnNames": [
+ "profileId",
+ "type",
+ "oldDate"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_timetable_profileId_type_oldDate` ON `${TABLE_NAME}` (`profileId`, `type`, `oldDate`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "config",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `key` TEXT NOT NULL, `value` TEXT, PRIMARY KEY(`profileId`, `key`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "key",
+ "columnName": "key",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "value",
+ "columnName": "value",
+ "affinity": "TEXT",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "key"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "librusLessons",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `lessonId` INTEGER NOT NULL, `teacherId` INTEGER NOT NULL, `subjectId` INTEGER NOT NULL, `teamId` INTEGER, PRIMARY KEY(`profileId`, `lessonId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "lessonId",
+ "columnName": "lessonId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "teacherId",
+ "columnName": "teacherId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "subjectId",
+ "columnName": "subjectId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "teamId",
+ "columnName": "teamId",
+ "affinity": "INTEGER",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "lessonId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [
+ {
+ "name": "index_librusLessons_profileId",
+ "unique": false,
+ "columnNames": [
+ "profileId"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_librusLessons_profileId` ON `${TABLE_NAME}` (`profileId`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "timetableManual",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `type` INTEGER NOT NULL, `repeatBy` INTEGER NOT NULL, `id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `date` INTEGER, `weekDay` INTEGER, `lessonNumber` INTEGER, `startTime` TEXT, `endTime` TEXT, `subjectId` INTEGER, `teacherId` INTEGER, `teamId` INTEGER, `classroom` TEXT)",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "type",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "repeatBy",
+ "columnName": "repeatBy",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "date",
+ "columnName": "date",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "weekDay",
+ "columnName": "weekDay",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "lessonNumber",
+ "columnName": "lessonNumber",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "startTime",
+ "columnName": "startTime",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "endTime",
+ "columnName": "endTime",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "subjectId",
+ "columnName": "subjectId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "teacherId",
+ "columnName": "teacherId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "teamId",
+ "columnName": "teamId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "classroom",
+ "columnName": "classroom",
+ "affinity": "TEXT",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "id"
+ ],
+ "autoGenerate": true
+ },
+ "indices": [
+ {
+ "name": "index_timetableManual_profileId_date",
+ "unique": false,
+ "columnNames": [
+ "profileId",
+ "date"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_timetableManual_profileId_date` ON `${TABLE_NAME}` (`profileId`, `date`)"
+ },
+ {
+ "name": "index_timetableManual_profileId_weekDay",
+ "unique": false,
+ "columnNames": [
+ "profileId",
+ "weekDay"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_timetableManual_profileId_weekDay` ON `${TABLE_NAME}` (`profileId`, `weekDay`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "notes",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `noteId` INTEGER NOT NULL, `noteOwnerType` TEXT, `noteOwnerId` INTEGER, `noteReplacesOriginal` INTEGER NOT NULL, `noteTopic` TEXT, `noteBody` TEXT NOT NULL, `noteColor` INTEGER, `noteSharedBy` TEXT, `noteSharedByName` TEXT, `addedDate` INTEGER NOT NULL, PRIMARY KEY(`noteId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "noteId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "ownerType",
+ "columnName": "noteOwnerType",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "ownerId",
+ "columnName": "noteOwnerId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "replacesOriginal",
+ "columnName": "noteReplacesOriginal",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "topic",
+ "columnName": "noteTopic",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "body",
+ "columnName": "noteBody",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "color",
+ "columnName": "noteColor",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "sharedBy",
+ "columnName": "noteSharedBy",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "sharedByName",
+ "columnName": "noteSharedByName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "addedDate",
+ "columnName": "addedDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "noteId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [
+ {
+ "name": "index_notes_profileId_noteOwnerType_noteOwnerId",
+ "unique": false,
+ "columnNames": [
+ "profileId",
+ "noteOwnerType",
+ "noteOwnerId"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_notes_profileId_noteOwnerType_noteOwnerId` ON `${TABLE_NAME}` (`profileId`, `noteOwnerType`, `noteOwnerId`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "metadata",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `metadataId` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `thingType` INTEGER NOT NULL, `thingId` INTEGER NOT NULL, `seen` INTEGER NOT NULL, `notified` INTEGER NOT NULL)",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "metadataId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "thingType",
+ "columnName": "thingType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "thingId",
+ "columnName": "thingId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "seen",
+ "columnName": "seen",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "notified",
+ "columnName": "notified",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "metadataId"
+ ],
+ "autoGenerate": true
+ },
+ "indices": [
+ {
+ "name": "index_metadata_profileId_thingType_thingId",
+ "unique": true,
+ "columnNames": [
+ "profileId",
+ "thingType",
+ "thingId"
+ ],
+ "orders": [],
+ "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_metadata_profileId_thingType_thingId` ON `${TABLE_NAME}` (`profileId`, `thingType`, `thingId`)"
+ }
+ ],
+ "foreignKeys": []
+ }
+ ],
+ "views": [],
+ "setupQueries": [
+ "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
+ "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '4c141460d807d32d00faad4fb3c12522')"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/app/schemas/pl.szczodrzynski.edziennik.data.db.AppDb/98.json b/app/schemas/pl.szczodrzynski.edziennik.data.db.AppDb/98.json
new file mode 100644
index 00000000..1a291aef
--- /dev/null
+++ b/app/schemas/pl.szczodrzynski.edziennik.data.db.AppDb/98.json
@@ -0,0 +1,2314 @@
+{
+ "formatVersion": 1,
+ "database": {
+ "version": 98,
+ "identityHash": "2612ebba9802eedc7ebc69724606a23c",
+ "entities": [
+ {
+ "tableName": "grades",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `gradeId` INTEGER NOT NULL, `gradeName` TEXT NOT NULL, `gradeType` INTEGER NOT NULL, `gradeValue` REAL NOT NULL, `gradeWeight` REAL NOT NULL, `gradeColor` INTEGER NOT NULL, `gradeCategory` TEXT, `gradeDescription` TEXT, `gradeComment` TEXT, `gradeSemester` INTEGER NOT NULL, `teacherId` INTEGER NOT NULL, `subjectId` INTEGER NOT NULL, `addedDate` INTEGER NOT NULL, `gradeValueMax` REAL, `gradeClassAverage` REAL, `gradeParentId` INTEGER, `gradeIsImprovement` INTEGER NOT NULL, `keep` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `gradeId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "gradeId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "gradeName",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "gradeType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "value",
+ "columnName": "gradeValue",
+ "affinity": "REAL",
+ "notNull": true
+ },
+ {
+ "fieldPath": "weight",
+ "columnName": "gradeWeight",
+ "affinity": "REAL",
+ "notNull": true
+ },
+ {
+ "fieldPath": "color",
+ "columnName": "gradeColor",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "category",
+ "columnName": "gradeCategory",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "description",
+ "columnName": "gradeDescription",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "comment",
+ "columnName": "gradeComment",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "semester",
+ "columnName": "gradeSemester",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "teacherId",
+ "columnName": "teacherId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "subjectId",
+ "columnName": "subjectId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "addedDate",
+ "columnName": "addedDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "valueMax",
+ "columnName": "gradeValueMax",
+ "affinity": "REAL",
+ "notNull": false
+ },
+ {
+ "fieldPath": "classAverage",
+ "columnName": "gradeClassAverage",
+ "affinity": "REAL",
+ "notNull": false
+ },
+ {
+ "fieldPath": "parentId",
+ "columnName": "gradeParentId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "isImprovement",
+ "columnName": "gradeIsImprovement",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "keep",
+ "columnName": "keep",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "gradeId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [
+ {
+ "name": "index_grades_profileId",
+ "unique": false,
+ "columnNames": [
+ "profileId"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_grades_profileId` ON `${TABLE_NAME}` (`profileId`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "teachers",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `teacherId` INTEGER NOT NULL, `teacherLoginId` TEXT, `teacherName` TEXT, `teacherSurname` TEXT, `teacherType` INTEGER NOT NULL, `teacherTypeDescription` TEXT, `teacherSubjects` TEXT NOT NULL, PRIMARY KEY(`profileId`, `teacherId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "teacherId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "loginId",
+ "columnName": "teacherLoginId",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "teacherName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "surname",
+ "columnName": "teacherSurname",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "teacherType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "typeDescription",
+ "columnName": "teacherTypeDescription",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "subjects",
+ "columnName": "teacherSubjects",
+ "affinity": "TEXT",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "teacherId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "teacherAbsence",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `teacherAbsenceId` INTEGER NOT NULL, `teacherAbsenceType` INTEGER NOT NULL, `teacherAbsenceName` TEXT, `teacherAbsenceDateFrom` TEXT NOT NULL, `teacherAbsenceDateTo` TEXT NOT NULL, `teacherAbsenceTimeFrom` TEXT, `teacherAbsenceTimeTo` TEXT, `teacherId` INTEGER NOT NULL, `addedDate` INTEGER NOT NULL, `keep` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `teacherAbsenceId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "teacherAbsenceId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "teacherAbsenceType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "teacherAbsenceName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "dateFrom",
+ "columnName": "teacherAbsenceDateFrom",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "dateTo",
+ "columnName": "teacherAbsenceDateTo",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "timeFrom",
+ "columnName": "teacherAbsenceTimeFrom",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "timeTo",
+ "columnName": "teacherAbsenceTimeTo",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "teacherId",
+ "columnName": "teacherId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "addedDate",
+ "columnName": "addedDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "keep",
+ "columnName": "keep",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "teacherAbsenceId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [
+ {
+ "name": "index_teacherAbsence_profileId",
+ "unique": false,
+ "columnNames": [
+ "profileId"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_teacherAbsence_profileId` ON `${TABLE_NAME}` (`profileId`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "teacherAbsenceTypes",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `teacherAbsenceTypeId` INTEGER NOT NULL, `teacherAbsenceTypeName` TEXT NOT NULL, PRIMARY KEY(`profileId`, `teacherAbsenceTypeId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "teacherAbsenceTypeId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "teacherAbsenceTypeName",
+ "affinity": "TEXT",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "teacherAbsenceTypeId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "subjects",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `subjectId` INTEGER NOT NULL, `subjectLongName` TEXT, `subjectShortName` TEXT, `subjectColor` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `subjectId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "subjectId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "longName",
+ "columnName": "subjectLongName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "shortName",
+ "columnName": "subjectShortName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "color",
+ "columnName": "subjectColor",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "subjectId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "notices",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `noticeId` INTEGER NOT NULL, `noticeType` INTEGER NOT NULL, `noticeSemester` INTEGER NOT NULL, `noticeText` TEXT NOT NULL, `noticeCategory` TEXT, `noticePoints` REAL, `teacherId` INTEGER NOT NULL, `addedDate` INTEGER NOT NULL, `keep` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `noticeId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "noticeId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "noticeType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "semester",
+ "columnName": "noticeSemester",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "text",
+ "columnName": "noticeText",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "category",
+ "columnName": "noticeCategory",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "points",
+ "columnName": "noticePoints",
+ "affinity": "REAL",
+ "notNull": false
+ },
+ {
+ "fieldPath": "teacherId",
+ "columnName": "teacherId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "addedDate",
+ "columnName": "addedDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "keep",
+ "columnName": "keep",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "noticeId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [
+ {
+ "name": "index_notices_profileId",
+ "unique": false,
+ "columnNames": [
+ "profileId"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_notices_profileId` ON `${TABLE_NAME}` (`profileId`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "teams",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `teamId` INTEGER NOT NULL, `teamType` INTEGER NOT NULL, `teamName` TEXT, `teamCode` TEXT, `teamTeacherId` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `teamId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "teamId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "teamType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "teamName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "code",
+ "columnName": "teamCode",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "teacherId",
+ "columnName": "teamTeacherId",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "teamId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "attendances",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `attendanceId` INTEGER NOT NULL, `attendanceBaseType` INTEGER NOT NULL, `attendanceTypeName` TEXT NOT NULL, `attendanceTypeShort` TEXT NOT NULL, `attendanceTypeSymbol` TEXT NOT NULL, `attendanceTypeColor` INTEGER, `attendanceDate` TEXT NOT NULL, `attendanceTime` TEXT, `attendanceSemester` INTEGER NOT NULL, `teacherId` INTEGER NOT NULL, `subjectId` INTEGER NOT NULL, `addedDate` INTEGER NOT NULL, `attendanceLessonTopic` TEXT, `attendanceLessonNumber` INTEGER, `attendanceIsCounted` INTEGER NOT NULL, `keep` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `attendanceId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "attendanceId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "baseType",
+ "columnName": "attendanceBaseType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "typeName",
+ "columnName": "attendanceTypeName",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "typeShort",
+ "columnName": "attendanceTypeShort",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "typeSymbol",
+ "columnName": "attendanceTypeSymbol",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "typeColor",
+ "columnName": "attendanceTypeColor",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "date",
+ "columnName": "attendanceDate",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "startTime",
+ "columnName": "attendanceTime",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "semester",
+ "columnName": "attendanceSemester",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "teacherId",
+ "columnName": "teacherId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "subjectId",
+ "columnName": "subjectId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "addedDate",
+ "columnName": "addedDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "lessonTopic",
+ "columnName": "attendanceLessonTopic",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "lessonNumber",
+ "columnName": "attendanceLessonNumber",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "isCounted",
+ "columnName": "attendanceIsCounted",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "keep",
+ "columnName": "keep",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "attendanceId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [
+ {
+ "name": "index_attendances_profileId",
+ "unique": false,
+ "columnNames": [
+ "profileId"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_attendances_profileId` ON `${TABLE_NAME}` (`profileId`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "events",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `eventId` INTEGER NOT NULL, `eventDate` TEXT NOT NULL, `eventTime` TEXT, `eventTopic` TEXT NOT NULL, `eventColor` INTEGER, `eventType` INTEGER NOT NULL, `teacherId` INTEGER NOT NULL, `subjectId` INTEGER NOT NULL, `teamId` INTEGER NOT NULL, `addedDate` INTEGER NOT NULL, `eventAddedManually` INTEGER NOT NULL, `eventSharedBy` TEXT, `eventSharedByName` TEXT, `eventBlacklisted` INTEGER NOT NULL, `eventIsDone` INTEGER NOT NULL, `eventIsDownloaded` INTEGER NOT NULL, `homeworkBody` TEXT, `attachmentIds` TEXT, `attachmentNames` TEXT, `keep` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `eventId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "eventId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "date",
+ "columnName": "eventDate",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "time",
+ "columnName": "eventTime",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "topic",
+ "columnName": "eventTopic",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "color",
+ "columnName": "eventColor",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "eventType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "teacherId",
+ "columnName": "teacherId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "subjectId",
+ "columnName": "subjectId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "teamId",
+ "columnName": "teamId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "addedDate",
+ "columnName": "addedDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "addedManually",
+ "columnName": "eventAddedManually",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "sharedBy",
+ "columnName": "eventSharedBy",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "sharedByName",
+ "columnName": "eventSharedByName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "blacklisted",
+ "columnName": "eventBlacklisted",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "isDone",
+ "columnName": "eventIsDone",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "isDownloaded",
+ "columnName": "eventIsDownloaded",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "homeworkBody",
+ "columnName": "homeworkBody",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "attachmentIds",
+ "columnName": "attachmentIds",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "attachmentNames",
+ "columnName": "attachmentNames",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "keep",
+ "columnName": "keep",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "eventId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [
+ {
+ "name": "index_events_profileId_eventDate_eventTime",
+ "unique": false,
+ "columnNames": [
+ "profileId",
+ "eventDate",
+ "eventTime"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_events_profileId_eventDate_eventTime` ON `${TABLE_NAME}` (`profileId`, `eventDate`, `eventTime`)"
+ },
+ {
+ "name": "index_events_profileId_eventType",
+ "unique": false,
+ "columnNames": [
+ "profileId",
+ "eventType"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_events_profileId_eventType` ON `${TABLE_NAME}` (`profileId`, `eventType`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "eventTypes",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `eventType` INTEGER NOT NULL, `eventTypeName` TEXT NOT NULL, `eventTypeColor` INTEGER NOT NULL, `eventTypeOrder` INTEGER NOT NULL, `eventTypeSource` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `eventType`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "eventType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "eventTypeName",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "color",
+ "columnName": "eventTypeColor",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "order",
+ "columnName": "eventTypeOrder",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "source",
+ "columnName": "eventTypeSource",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "eventType"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "loginStores",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`loginStoreId` INTEGER NOT NULL, `loginStoreType` INTEGER NOT NULL, `loginStoreMode` INTEGER NOT NULL, `loginStoreData` TEXT NOT NULL, PRIMARY KEY(`loginStoreId`))",
+ "fields": [
+ {
+ "fieldPath": "id",
+ "columnName": "loginStoreId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "loginStoreType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "mode",
+ "columnName": "loginStoreMode",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "data",
+ "columnName": "loginStoreData",
+ "affinity": "TEXT",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "loginStoreId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "profiles",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `loginStoreId` INTEGER NOT NULL, `loginStoreType` INTEGER NOT NULL, `name` TEXT NOT NULL, `subname` TEXT, `studentNameLong` TEXT NOT NULL, `studentNameShort` TEXT NOT NULL, `accountName` TEXT, `studentData` TEXT NOT NULL, `image` TEXT, `empty` INTEGER NOT NULL, `archived` INTEGER NOT NULL, `archiveId` INTEGER, `syncEnabled` INTEGER NOT NULL, `enableSharedEvents` INTEGER NOT NULL, `registration` INTEGER NOT NULL, `userCode` TEXT NOT NULL, `studentNumber` INTEGER NOT NULL, `studentClassName` TEXT, `studentSchoolYearStart` INTEGER NOT NULL, `dateSemester1Start` TEXT NOT NULL, `dateSemester2Start` TEXT NOT NULL, `dateYearEnd` TEXT NOT NULL, `disabledNotifications` TEXT, `lastReceiversSync` INTEGER NOT NULL, PRIMARY KEY(`profileId`))",
+ "fields": [
+ {
+ "fieldPath": "id",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "loginStoreId",
+ "columnName": "loginStoreId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "loginStoreType",
+ "columnName": "loginStoreType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "name",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "subname",
+ "columnName": "subname",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "studentNameLong",
+ "columnName": "studentNameLong",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "studentNameShort",
+ "columnName": "studentNameShort",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "accountName",
+ "columnName": "accountName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "studentData",
+ "columnName": "studentData",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "image",
+ "columnName": "image",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "empty",
+ "columnName": "empty",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "archived",
+ "columnName": "archived",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "archiveId",
+ "columnName": "archiveId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "syncEnabled",
+ "columnName": "syncEnabled",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "enableSharedEvents",
+ "columnName": "enableSharedEvents",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "registration",
+ "columnName": "registration",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "userCode",
+ "columnName": "userCode",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "studentNumber",
+ "columnName": "studentNumber",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "studentClassName",
+ "columnName": "studentClassName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "studentSchoolYearStart",
+ "columnName": "studentSchoolYearStart",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "dateSemester1Start",
+ "columnName": "dateSemester1Start",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "dateSemester2Start",
+ "columnName": "dateSemester2Start",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "dateYearEnd",
+ "columnName": "dateYearEnd",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "disabledNotifications",
+ "columnName": "disabledNotifications",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "lastReceiversSync",
+ "columnName": "lastReceiversSync",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "luckyNumbers",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `luckyNumberDate` INTEGER NOT NULL, `luckyNumber` INTEGER NOT NULL, `keep` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `luckyNumberDate`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "date",
+ "columnName": "luckyNumberDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "number",
+ "columnName": "luckyNumber",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "keep",
+ "columnName": "keep",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "luckyNumberDate"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "announcements",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `announcementId` INTEGER NOT NULL, `announcementSubject` TEXT NOT NULL, `announcementText` TEXT, `announcementStartDate` TEXT, `announcementEndDate` TEXT, `teacherId` INTEGER NOT NULL, `addedDate` INTEGER NOT NULL, `announcementIdString` TEXT, `keep` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `announcementId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "announcementId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "subject",
+ "columnName": "announcementSubject",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "text",
+ "columnName": "announcementText",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "startDate",
+ "columnName": "announcementStartDate",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "endDate",
+ "columnName": "announcementEndDate",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "teacherId",
+ "columnName": "teacherId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "addedDate",
+ "columnName": "addedDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "idString",
+ "columnName": "announcementIdString",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "keep",
+ "columnName": "keep",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "announcementId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [
+ {
+ "name": "index_announcements_profileId",
+ "unique": false,
+ "columnNames": [
+ "profileId"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_announcements_profileId` ON `${TABLE_NAME}` (`profileId`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "gradeCategories",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `categoryId` INTEGER NOT NULL, `weight` REAL NOT NULL, `color` INTEGER NOT NULL, `text` TEXT, `columns` TEXT, `valueFrom` REAL NOT NULL, `valueTo` REAL NOT NULL, `type` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `categoryId`, `type`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "categoryId",
+ "columnName": "categoryId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "weight",
+ "columnName": "weight",
+ "affinity": "REAL",
+ "notNull": true
+ },
+ {
+ "fieldPath": "color",
+ "columnName": "color",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "text",
+ "columnName": "text",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "columns",
+ "columnName": "columns",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "valueFrom",
+ "columnName": "valueFrom",
+ "affinity": "REAL",
+ "notNull": true
+ },
+ {
+ "fieldPath": "valueTo",
+ "columnName": "valueTo",
+ "affinity": "REAL",
+ "notNull": true
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "type",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "categoryId",
+ "type"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "feedbackMessages",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`messageId` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `received` INTEGER NOT NULL, `text` TEXT NOT NULL, `senderName` TEXT NOT NULL, `deviceId` TEXT, `deviceName` TEXT, `devId` INTEGER, `devImage` TEXT, `sentTime` INTEGER NOT NULL)",
+ "fields": [
+ {
+ "fieldPath": "messageId",
+ "columnName": "messageId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "received",
+ "columnName": "received",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "text",
+ "columnName": "text",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "senderName",
+ "columnName": "senderName",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "deviceId",
+ "columnName": "deviceId",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "deviceName",
+ "columnName": "deviceName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "devId",
+ "columnName": "devId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "devImage",
+ "columnName": "devImage",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "sentTime",
+ "columnName": "sentTime",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "messageId"
+ ],
+ "autoGenerate": true
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "messages",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `messageId` INTEGER NOT NULL, `messageType` INTEGER NOT NULL, `messageSubject` TEXT NOT NULL, `messageBody` TEXT, `senderId` INTEGER, `addedDate` INTEGER NOT NULL, `messageIsPinned` INTEGER NOT NULL, `hasAttachments` INTEGER NOT NULL, `attachmentIds` TEXT, `attachmentNames` TEXT, `attachmentSizes` TEXT, `keep` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `messageId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "messageId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "messageType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "subject",
+ "columnName": "messageSubject",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "body",
+ "columnName": "messageBody",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "senderId",
+ "columnName": "senderId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "addedDate",
+ "columnName": "addedDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "isStarred",
+ "columnName": "messageIsPinned",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "hasAttachments",
+ "columnName": "hasAttachments",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "attachmentIds",
+ "columnName": "attachmentIds",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "attachmentNames",
+ "columnName": "attachmentNames",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "attachmentSizes",
+ "columnName": "attachmentSizes",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "keep",
+ "columnName": "keep",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "messageId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [
+ {
+ "name": "index_messages_profileId_messageType",
+ "unique": false,
+ "columnNames": [
+ "profileId",
+ "messageType"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_profileId_messageType` ON `${TABLE_NAME}` (`profileId`, `messageType`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "messageRecipients",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `messageRecipientId` INTEGER NOT NULL, `messageRecipientReplyId` INTEGER NOT NULL, `messageRecipientReadDate` INTEGER NOT NULL, `messageId` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `messageRecipientId`, `messageId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "messageRecipientId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "replyId",
+ "columnName": "messageRecipientReplyId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "readDate",
+ "columnName": "messageRecipientReadDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "messageId",
+ "columnName": "messageId",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "messageRecipientId",
+ "messageId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "debugLogs",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `text` TEXT)",
+ "fields": [
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "text",
+ "columnName": "text",
+ "affinity": "TEXT",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "id"
+ ],
+ "autoGenerate": true
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "endpointTimers",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `endpointId` INTEGER NOT NULL, `endpointLastSync` INTEGER, `endpointNextSync` INTEGER NOT NULL, `endpointViewId` INTEGER, PRIMARY KEY(`profileId`, `endpointId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "endpointId",
+ "columnName": "endpointId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "lastSync",
+ "columnName": "endpointLastSync",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "nextSync",
+ "columnName": "endpointNextSync",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "viewId",
+ "columnName": "endpointViewId",
+ "affinity": "INTEGER",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "endpointId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "lessonRanges",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `lessonRangeNumber` INTEGER NOT NULL, `lessonRangeStart` TEXT NOT NULL, `lessonRangeEnd` TEXT NOT NULL, PRIMARY KEY(`profileId`, `lessonRangeNumber`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "lessonNumber",
+ "columnName": "lessonRangeNumber",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "startTime",
+ "columnName": "lessonRangeStart",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "endTime",
+ "columnName": "lessonRangeEnd",
+ "affinity": "TEXT",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "lessonRangeNumber"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "notifications",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `title` TEXT NOT NULL, `text` TEXT NOT NULL, `textLong` TEXT, `type` INTEGER NOT NULL, `profileId` INTEGER, `profileName` TEXT, `posted` INTEGER NOT NULL, `viewId` INTEGER, `extras` TEXT, `addedDate` INTEGER NOT NULL)",
+ "fields": [
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "title",
+ "columnName": "title",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "text",
+ "columnName": "text",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "textLong",
+ "columnName": "textLong",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "type",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "profileName",
+ "columnName": "profileName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "posted",
+ "columnName": "posted",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "viewId",
+ "columnName": "viewId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "extras",
+ "columnName": "extras",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "addedDate",
+ "columnName": "addedDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "id"
+ ],
+ "autoGenerate": true
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "classrooms",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `id` INTEGER NOT NULL, `name` TEXT NOT NULL, PRIMARY KEY(`profileId`, `id`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "name",
+ "affinity": "TEXT",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "id"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "noticeTypes",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `id` INTEGER NOT NULL, `name` TEXT NOT NULL, PRIMARY KEY(`profileId`, `id`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "name",
+ "affinity": "TEXT",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "id"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "attendanceTypes",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `id` INTEGER NOT NULL, `baseType` INTEGER NOT NULL, `typeName` TEXT NOT NULL, `typeShort` TEXT NOT NULL, `typeSymbol` TEXT NOT NULL, `typeColor` INTEGER, PRIMARY KEY(`profileId`, `id`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "baseType",
+ "columnName": "baseType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "typeName",
+ "columnName": "typeName",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "typeShort",
+ "columnName": "typeShort",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "typeSymbol",
+ "columnName": "typeSymbol",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "typeColor",
+ "columnName": "typeColor",
+ "affinity": "INTEGER",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "id"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "timetable",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `id` INTEGER NOT NULL, `type` INTEGER NOT NULL, `date` TEXT, `lessonNumber` INTEGER, `startTime` TEXT, `endTime` TEXT, `subjectId` INTEGER, `teacherId` INTEGER, `teamId` INTEGER, `classroom` TEXT, `oldDate` TEXT, `oldLessonNumber` INTEGER, `oldStartTime` TEXT, `oldEndTime` TEXT, `oldSubjectId` INTEGER, `oldTeacherId` INTEGER, `oldTeamId` INTEGER, `oldClassroom` TEXT, `isExtra` INTEGER NOT NULL, `color` INTEGER, `keep` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `id`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "type",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "date",
+ "columnName": "date",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "lessonNumber",
+ "columnName": "lessonNumber",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "startTime",
+ "columnName": "startTime",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "endTime",
+ "columnName": "endTime",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "subjectId",
+ "columnName": "subjectId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "teacherId",
+ "columnName": "teacherId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "teamId",
+ "columnName": "teamId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "classroom",
+ "columnName": "classroom",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "oldDate",
+ "columnName": "oldDate",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "oldLessonNumber",
+ "columnName": "oldLessonNumber",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "oldStartTime",
+ "columnName": "oldStartTime",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "oldEndTime",
+ "columnName": "oldEndTime",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "oldSubjectId",
+ "columnName": "oldSubjectId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "oldTeacherId",
+ "columnName": "oldTeacherId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "oldTeamId",
+ "columnName": "oldTeamId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "oldClassroom",
+ "columnName": "oldClassroom",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "isExtra",
+ "columnName": "isExtra",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "color",
+ "columnName": "color",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "keep",
+ "columnName": "keep",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "id"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [
+ {
+ "name": "index_timetable_profileId_type_date",
+ "unique": false,
+ "columnNames": [
+ "profileId",
+ "type",
+ "date"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_timetable_profileId_type_date` ON `${TABLE_NAME}` (`profileId`, `type`, `date`)"
+ },
+ {
+ "name": "index_timetable_profileId_type_oldDate",
+ "unique": false,
+ "columnNames": [
+ "profileId",
+ "type",
+ "oldDate"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_timetable_profileId_type_oldDate` ON `${TABLE_NAME}` (`profileId`, `type`, `oldDate`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "config",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `key` TEXT NOT NULL, `value` TEXT, PRIMARY KEY(`profileId`, `key`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "key",
+ "columnName": "key",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "value",
+ "columnName": "value",
+ "affinity": "TEXT",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "key"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "librusLessons",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `lessonId` INTEGER NOT NULL, `teacherId` INTEGER NOT NULL, `subjectId` INTEGER NOT NULL, `teamId` INTEGER, PRIMARY KEY(`profileId`, `lessonId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "lessonId",
+ "columnName": "lessonId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "teacherId",
+ "columnName": "teacherId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "subjectId",
+ "columnName": "subjectId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "teamId",
+ "columnName": "teamId",
+ "affinity": "INTEGER",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "lessonId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [
+ {
+ "name": "index_librusLessons_profileId",
+ "unique": false,
+ "columnNames": [
+ "profileId"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_librusLessons_profileId` ON `${TABLE_NAME}` (`profileId`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "timetableManual",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `type` INTEGER NOT NULL, `repeatBy` INTEGER NOT NULL, `id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `date` INTEGER, `weekDay` INTEGER, `lessonNumber` INTEGER, `startTime` TEXT, `endTime` TEXT, `subjectId` INTEGER, `teacherId` INTEGER, `teamId` INTEGER, `classroom` TEXT)",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "type",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "repeatBy",
+ "columnName": "repeatBy",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "date",
+ "columnName": "date",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "weekDay",
+ "columnName": "weekDay",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "lessonNumber",
+ "columnName": "lessonNumber",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "startTime",
+ "columnName": "startTime",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "endTime",
+ "columnName": "endTime",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "subjectId",
+ "columnName": "subjectId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "teacherId",
+ "columnName": "teacherId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "teamId",
+ "columnName": "teamId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "classroom",
+ "columnName": "classroom",
+ "affinity": "TEXT",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "id"
+ ],
+ "autoGenerate": true
+ },
+ "indices": [
+ {
+ "name": "index_timetableManual_profileId_date",
+ "unique": false,
+ "columnNames": [
+ "profileId",
+ "date"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_timetableManual_profileId_date` ON `${TABLE_NAME}` (`profileId`, `date`)"
+ },
+ {
+ "name": "index_timetableManual_profileId_weekDay",
+ "unique": false,
+ "columnNames": [
+ "profileId",
+ "weekDay"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_timetableManual_profileId_weekDay` ON `${TABLE_NAME}` (`profileId`, `weekDay`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "notes",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `noteId` INTEGER NOT NULL, `noteOwnerType` TEXT, `noteOwnerId` INTEGER, `noteReplacesOriginal` INTEGER NOT NULL, `noteTopic` TEXT, `noteBody` TEXT NOT NULL, `noteColor` INTEGER, `noteSharedBy` TEXT, `noteSharedByName` TEXT, `addedDate` INTEGER NOT NULL, PRIMARY KEY(`noteId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "noteId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "ownerType",
+ "columnName": "noteOwnerType",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "ownerId",
+ "columnName": "noteOwnerId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "replacesOriginal",
+ "columnName": "noteReplacesOriginal",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "topic",
+ "columnName": "noteTopic",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "body",
+ "columnName": "noteBody",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "color",
+ "columnName": "noteColor",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "sharedBy",
+ "columnName": "noteSharedBy",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "sharedByName",
+ "columnName": "noteSharedByName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "addedDate",
+ "columnName": "addedDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "noteId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [
+ {
+ "name": "index_notes_profileId_noteOwnerType_noteOwnerId",
+ "unique": false,
+ "columnNames": [
+ "profileId",
+ "noteOwnerType",
+ "noteOwnerId"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_notes_profileId_noteOwnerType_noteOwnerId` ON `${TABLE_NAME}` (`profileId`, `noteOwnerType`, `noteOwnerId`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "metadata",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `metadataId` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `thingType` INTEGER NOT NULL, `thingId` INTEGER NOT NULL, `seen` INTEGER NOT NULL, `notified` INTEGER NOT NULL)",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "metadataId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "thingType",
+ "columnName": "thingType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "thingId",
+ "columnName": "thingId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "seen",
+ "columnName": "seen",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "notified",
+ "columnName": "notified",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "metadataId"
+ ],
+ "autoGenerate": true
+ },
+ "indices": [
+ {
+ "name": "index_metadata_profileId_thingType_thingId",
+ "unique": true,
+ "columnNames": [
+ "profileId",
+ "thingType",
+ "thingId"
+ ],
+ "orders": [],
+ "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_metadata_profileId_thingType_thingId` ON `${TABLE_NAME}` (`profileId`, `thingType`, `thingId`)"
+ }
+ ],
+ "foreignKeys": []
+ }
+ ],
+ "views": [],
+ "setupQueries": [
+ "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
+ "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '2612ebba9802eedc7ebc69724606a23c')"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/app/schemas/pl.szczodrzynski.edziennik.data.db.AppDb/99.json b/app/schemas/pl.szczodrzynski.edziennik.data.db.AppDb/99.json
new file mode 100644
index 00000000..7db65929
--- /dev/null
+++ b/app/schemas/pl.szczodrzynski.edziennik.data.db.AppDb/99.json
@@ -0,0 +1,2314 @@
+{
+ "formatVersion": 1,
+ "database": {
+ "version": 99,
+ "identityHash": "2612ebba9802eedc7ebc69724606a23c",
+ "entities": [
+ {
+ "tableName": "grades",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `gradeId` INTEGER NOT NULL, `gradeName` TEXT NOT NULL, `gradeType` INTEGER NOT NULL, `gradeValue` REAL NOT NULL, `gradeWeight` REAL NOT NULL, `gradeColor` INTEGER NOT NULL, `gradeCategory` TEXT, `gradeDescription` TEXT, `gradeComment` TEXT, `gradeSemester` INTEGER NOT NULL, `teacherId` INTEGER NOT NULL, `subjectId` INTEGER NOT NULL, `addedDate` INTEGER NOT NULL, `gradeValueMax` REAL, `gradeClassAverage` REAL, `gradeParentId` INTEGER, `gradeIsImprovement` INTEGER NOT NULL, `keep` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `gradeId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "gradeId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "gradeName",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "gradeType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "value",
+ "columnName": "gradeValue",
+ "affinity": "REAL",
+ "notNull": true
+ },
+ {
+ "fieldPath": "weight",
+ "columnName": "gradeWeight",
+ "affinity": "REAL",
+ "notNull": true
+ },
+ {
+ "fieldPath": "color",
+ "columnName": "gradeColor",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "category",
+ "columnName": "gradeCategory",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "description",
+ "columnName": "gradeDescription",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "comment",
+ "columnName": "gradeComment",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "semester",
+ "columnName": "gradeSemester",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "teacherId",
+ "columnName": "teacherId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "subjectId",
+ "columnName": "subjectId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "addedDate",
+ "columnName": "addedDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "valueMax",
+ "columnName": "gradeValueMax",
+ "affinity": "REAL",
+ "notNull": false
+ },
+ {
+ "fieldPath": "classAverage",
+ "columnName": "gradeClassAverage",
+ "affinity": "REAL",
+ "notNull": false
+ },
+ {
+ "fieldPath": "parentId",
+ "columnName": "gradeParentId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "isImprovement",
+ "columnName": "gradeIsImprovement",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "keep",
+ "columnName": "keep",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "gradeId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [
+ {
+ "name": "index_grades_profileId",
+ "unique": false,
+ "columnNames": [
+ "profileId"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_grades_profileId` ON `${TABLE_NAME}` (`profileId`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "teachers",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `teacherId` INTEGER NOT NULL, `teacherLoginId` TEXT, `teacherName` TEXT, `teacherSurname` TEXT, `teacherType` INTEGER NOT NULL, `teacherTypeDescription` TEXT, `teacherSubjects` TEXT NOT NULL, PRIMARY KEY(`profileId`, `teacherId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "teacherId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "loginId",
+ "columnName": "teacherLoginId",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "teacherName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "surname",
+ "columnName": "teacherSurname",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "teacherType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "typeDescription",
+ "columnName": "teacherTypeDescription",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "subjects",
+ "columnName": "teacherSubjects",
+ "affinity": "TEXT",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "teacherId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "teacherAbsence",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `teacherAbsenceId` INTEGER NOT NULL, `teacherAbsenceType` INTEGER NOT NULL, `teacherAbsenceName` TEXT, `teacherAbsenceDateFrom` TEXT NOT NULL, `teacherAbsenceDateTo` TEXT NOT NULL, `teacherAbsenceTimeFrom` TEXT, `teacherAbsenceTimeTo` TEXT, `teacherId` INTEGER NOT NULL, `addedDate` INTEGER NOT NULL, `keep` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `teacherAbsenceId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "teacherAbsenceId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "teacherAbsenceType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "teacherAbsenceName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "dateFrom",
+ "columnName": "teacherAbsenceDateFrom",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "dateTo",
+ "columnName": "teacherAbsenceDateTo",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "timeFrom",
+ "columnName": "teacherAbsenceTimeFrom",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "timeTo",
+ "columnName": "teacherAbsenceTimeTo",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "teacherId",
+ "columnName": "teacherId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "addedDate",
+ "columnName": "addedDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "keep",
+ "columnName": "keep",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "teacherAbsenceId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [
+ {
+ "name": "index_teacherAbsence_profileId",
+ "unique": false,
+ "columnNames": [
+ "profileId"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_teacherAbsence_profileId` ON `${TABLE_NAME}` (`profileId`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "teacherAbsenceTypes",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `teacherAbsenceTypeId` INTEGER NOT NULL, `teacherAbsenceTypeName` TEXT NOT NULL, PRIMARY KEY(`profileId`, `teacherAbsenceTypeId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "teacherAbsenceTypeId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "teacherAbsenceTypeName",
+ "affinity": "TEXT",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "teacherAbsenceTypeId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "subjects",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `subjectId` INTEGER NOT NULL, `subjectLongName` TEXT, `subjectShortName` TEXT, `subjectColor` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `subjectId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "subjectId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "longName",
+ "columnName": "subjectLongName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "shortName",
+ "columnName": "subjectShortName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "color",
+ "columnName": "subjectColor",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "subjectId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "notices",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `noticeId` INTEGER NOT NULL, `noticeType` INTEGER NOT NULL, `noticeSemester` INTEGER NOT NULL, `noticeText` TEXT NOT NULL, `noticeCategory` TEXT, `noticePoints` REAL, `teacherId` INTEGER NOT NULL, `addedDate` INTEGER NOT NULL, `keep` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `noticeId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "noticeId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "noticeType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "semester",
+ "columnName": "noticeSemester",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "text",
+ "columnName": "noticeText",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "category",
+ "columnName": "noticeCategory",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "points",
+ "columnName": "noticePoints",
+ "affinity": "REAL",
+ "notNull": false
+ },
+ {
+ "fieldPath": "teacherId",
+ "columnName": "teacherId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "addedDate",
+ "columnName": "addedDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "keep",
+ "columnName": "keep",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "noticeId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [
+ {
+ "name": "index_notices_profileId",
+ "unique": false,
+ "columnNames": [
+ "profileId"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_notices_profileId` ON `${TABLE_NAME}` (`profileId`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "teams",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `teamId` INTEGER NOT NULL, `teamType` INTEGER NOT NULL, `teamName` TEXT, `teamCode` TEXT, `teamTeacherId` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `teamId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "teamId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "teamType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "teamName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "code",
+ "columnName": "teamCode",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "teacherId",
+ "columnName": "teamTeacherId",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "teamId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "attendances",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `attendanceId` INTEGER NOT NULL, `attendanceBaseType` INTEGER NOT NULL, `attendanceTypeName` TEXT NOT NULL, `attendanceTypeShort` TEXT NOT NULL, `attendanceTypeSymbol` TEXT NOT NULL, `attendanceTypeColor` INTEGER, `attendanceDate` TEXT NOT NULL, `attendanceTime` TEXT, `attendanceSemester` INTEGER NOT NULL, `teacherId` INTEGER NOT NULL, `subjectId` INTEGER NOT NULL, `addedDate` INTEGER NOT NULL, `attendanceLessonTopic` TEXT, `attendanceLessonNumber` INTEGER, `attendanceIsCounted` INTEGER NOT NULL, `keep` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `attendanceId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "attendanceId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "baseType",
+ "columnName": "attendanceBaseType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "typeName",
+ "columnName": "attendanceTypeName",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "typeShort",
+ "columnName": "attendanceTypeShort",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "typeSymbol",
+ "columnName": "attendanceTypeSymbol",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "typeColor",
+ "columnName": "attendanceTypeColor",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "date",
+ "columnName": "attendanceDate",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "startTime",
+ "columnName": "attendanceTime",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "semester",
+ "columnName": "attendanceSemester",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "teacherId",
+ "columnName": "teacherId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "subjectId",
+ "columnName": "subjectId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "addedDate",
+ "columnName": "addedDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "lessonTopic",
+ "columnName": "attendanceLessonTopic",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "lessonNumber",
+ "columnName": "attendanceLessonNumber",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "isCounted",
+ "columnName": "attendanceIsCounted",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "keep",
+ "columnName": "keep",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "attendanceId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [
+ {
+ "name": "index_attendances_profileId",
+ "unique": false,
+ "columnNames": [
+ "profileId"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_attendances_profileId` ON `${TABLE_NAME}` (`profileId`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "events",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `eventId` INTEGER NOT NULL, `eventDate` TEXT NOT NULL, `eventTime` TEXT, `eventTopic` TEXT NOT NULL, `eventColor` INTEGER, `eventType` INTEGER NOT NULL, `teacherId` INTEGER NOT NULL, `subjectId` INTEGER NOT NULL, `teamId` INTEGER NOT NULL, `addedDate` INTEGER NOT NULL, `eventAddedManually` INTEGER NOT NULL, `eventSharedBy` TEXT, `eventSharedByName` TEXT, `eventBlacklisted` INTEGER NOT NULL, `eventIsDone` INTEGER NOT NULL, `eventIsDownloaded` INTEGER NOT NULL, `homeworkBody` TEXT, `attachmentIds` TEXT, `attachmentNames` TEXT, `keep` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `eventId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "eventId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "date",
+ "columnName": "eventDate",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "time",
+ "columnName": "eventTime",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "topic",
+ "columnName": "eventTopic",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "color",
+ "columnName": "eventColor",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "eventType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "teacherId",
+ "columnName": "teacherId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "subjectId",
+ "columnName": "subjectId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "teamId",
+ "columnName": "teamId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "addedDate",
+ "columnName": "addedDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "addedManually",
+ "columnName": "eventAddedManually",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "sharedBy",
+ "columnName": "eventSharedBy",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "sharedByName",
+ "columnName": "eventSharedByName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "blacklisted",
+ "columnName": "eventBlacklisted",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "isDone",
+ "columnName": "eventIsDone",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "isDownloaded",
+ "columnName": "eventIsDownloaded",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "homeworkBody",
+ "columnName": "homeworkBody",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "attachmentIds",
+ "columnName": "attachmentIds",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "attachmentNames",
+ "columnName": "attachmentNames",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "keep",
+ "columnName": "keep",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "eventId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [
+ {
+ "name": "index_events_profileId_eventDate_eventTime",
+ "unique": false,
+ "columnNames": [
+ "profileId",
+ "eventDate",
+ "eventTime"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_events_profileId_eventDate_eventTime` ON `${TABLE_NAME}` (`profileId`, `eventDate`, `eventTime`)"
+ },
+ {
+ "name": "index_events_profileId_eventType",
+ "unique": false,
+ "columnNames": [
+ "profileId",
+ "eventType"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_events_profileId_eventType` ON `${TABLE_NAME}` (`profileId`, `eventType`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "eventTypes",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `eventType` INTEGER NOT NULL, `eventTypeName` TEXT NOT NULL, `eventTypeColor` INTEGER NOT NULL, `eventTypeOrder` INTEGER NOT NULL, `eventTypeSource` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `eventType`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "eventType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "eventTypeName",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "color",
+ "columnName": "eventTypeColor",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "order",
+ "columnName": "eventTypeOrder",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "source",
+ "columnName": "eventTypeSource",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "eventType"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "loginStores",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`loginStoreId` INTEGER NOT NULL, `loginStoreType` INTEGER NOT NULL, `loginStoreMode` INTEGER NOT NULL, `loginStoreData` TEXT NOT NULL, PRIMARY KEY(`loginStoreId`))",
+ "fields": [
+ {
+ "fieldPath": "id",
+ "columnName": "loginStoreId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "loginStoreType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "mode",
+ "columnName": "loginStoreMode",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "data",
+ "columnName": "loginStoreData",
+ "affinity": "TEXT",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "loginStoreId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "profiles",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `loginStoreId` INTEGER NOT NULL, `loginStoreType` INTEGER NOT NULL, `name` TEXT NOT NULL, `subname` TEXT, `studentNameLong` TEXT NOT NULL, `studentNameShort` TEXT NOT NULL, `accountName` TEXT, `studentData` TEXT NOT NULL, `image` TEXT, `empty` INTEGER NOT NULL, `archived` INTEGER NOT NULL, `archiveId` INTEGER, `syncEnabled` INTEGER NOT NULL, `enableSharedEvents` INTEGER NOT NULL, `registration` INTEGER NOT NULL, `userCode` TEXT NOT NULL, `studentNumber` INTEGER NOT NULL, `studentClassName` TEXT, `studentSchoolYearStart` INTEGER NOT NULL, `dateSemester1Start` TEXT NOT NULL, `dateSemester2Start` TEXT NOT NULL, `dateYearEnd` TEXT NOT NULL, `disabledNotifications` TEXT, `lastReceiversSync` INTEGER NOT NULL, PRIMARY KEY(`profileId`))",
+ "fields": [
+ {
+ "fieldPath": "id",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "loginStoreId",
+ "columnName": "loginStoreId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "loginStoreType",
+ "columnName": "loginStoreType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "name",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "subname",
+ "columnName": "subname",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "studentNameLong",
+ "columnName": "studentNameLong",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "studentNameShort",
+ "columnName": "studentNameShort",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "accountName",
+ "columnName": "accountName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "studentData",
+ "columnName": "studentData",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "image",
+ "columnName": "image",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "empty",
+ "columnName": "empty",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "archived",
+ "columnName": "archived",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "archiveId",
+ "columnName": "archiveId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "syncEnabled",
+ "columnName": "syncEnabled",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "enableSharedEvents",
+ "columnName": "enableSharedEvents",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "registration",
+ "columnName": "registration",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "userCode",
+ "columnName": "userCode",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "studentNumber",
+ "columnName": "studentNumber",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "studentClassName",
+ "columnName": "studentClassName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "studentSchoolYearStart",
+ "columnName": "studentSchoolYearStart",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "dateSemester1Start",
+ "columnName": "dateSemester1Start",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "dateSemester2Start",
+ "columnName": "dateSemester2Start",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "dateYearEnd",
+ "columnName": "dateYearEnd",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "disabledNotifications",
+ "columnName": "disabledNotifications",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "lastReceiversSync",
+ "columnName": "lastReceiversSync",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "luckyNumbers",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `luckyNumberDate` INTEGER NOT NULL, `luckyNumber` INTEGER NOT NULL, `keep` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `luckyNumberDate`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "date",
+ "columnName": "luckyNumberDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "number",
+ "columnName": "luckyNumber",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "keep",
+ "columnName": "keep",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "luckyNumberDate"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "announcements",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `announcementId` INTEGER NOT NULL, `announcementSubject` TEXT NOT NULL, `announcementText` TEXT, `announcementStartDate` TEXT, `announcementEndDate` TEXT, `teacherId` INTEGER NOT NULL, `addedDate` INTEGER NOT NULL, `announcementIdString` TEXT, `keep` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `announcementId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "announcementId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "subject",
+ "columnName": "announcementSubject",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "text",
+ "columnName": "announcementText",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "startDate",
+ "columnName": "announcementStartDate",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "endDate",
+ "columnName": "announcementEndDate",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "teacherId",
+ "columnName": "teacherId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "addedDate",
+ "columnName": "addedDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "idString",
+ "columnName": "announcementIdString",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "keep",
+ "columnName": "keep",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "announcementId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [
+ {
+ "name": "index_announcements_profileId",
+ "unique": false,
+ "columnNames": [
+ "profileId"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_announcements_profileId` ON `${TABLE_NAME}` (`profileId`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "gradeCategories",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `categoryId` INTEGER NOT NULL, `weight` REAL NOT NULL, `color` INTEGER NOT NULL, `text` TEXT, `columns` TEXT, `valueFrom` REAL NOT NULL, `valueTo` REAL NOT NULL, `type` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `categoryId`, `type`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "categoryId",
+ "columnName": "categoryId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "weight",
+ "columnName": "weight",
+ "affinity": "REAL",
+ "notNull": true
+ },
+ {
+ "fieldPath": "color",
+ "columnName": "color",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "text",
+ "columnName": "text",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "columns",
+ "columnName": "columns",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "valueFrom",
+ "columnName": "valueFrom",
+ "affinity": "REAL",
+ "notNull": true
+ },
+ {
+ "fieldPath": "valueTo",
+ "columnName": "valueTo",
+ "affinity": "REAL",
+ "notNull": true
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "type",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "categoryId",
+ "type"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "feedbackMessages",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`messageId` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `received` INTEGER NOT NULL, `text` TEXT NOT NULL, `senderName` TEXT NOT NULL, `deviceId` TEXT, `deviceName` TEXT, `devId` INTEGER, `devImage` TEXT, `sentTime` INTEGER NOT NULL)",
+ "fields": [
+ {
+ "fieldPath": "messageId",
+ "columnName": "messageId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "received",
+ "columnName": "received",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "text",
+ "columnName": "text",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "senderName",
+ "columnName": "senderName",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "deviceId",
+ "columnName": "deviceId",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "deviceName",
+ "columnName": "deviceName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "devId",
+ "columnName": "devId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "devImage",
+ "columnName": "devImage",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "sentTime",
+ "columnName": "sentTime",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "messageId"
+ ],
+ "autoGenerate": true
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "messages",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `messageId` INTEGER NOT NULL, `messageType` INTEGER NOT NULL, `messageSubject` TEXT NOT NULL, `messageBody` TEXT, `senderId` INTEGER, `addedDate` INTEGER NOT NULL, `messageIsPinned` INTEGER NOT NULL, `hasAttachments` INTEGER NOT NULL, `attachmentIds` TEXT, `attachmentNames` TEXT, `attachmentSizes` TEXT, `keep` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `messageId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "messageId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "messageType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "subject",
+ "columnName": "messageSubject",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "body",
+ "columnName": "messageBody",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "senderId",
+ "columnName": "senderId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "addedDate",
+ "columnName": "addedDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "isStarred",
+ "columnName": "messageIsPinned",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "hasAttachments",
+ "columnName": "hasAttachments",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "attachmentIds",
+ "columnName": "attachmentIds",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "attachmentNames",
+ "columnName": "attachmentNames",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "attachmentSizes",
+ "columnName": "attachmentSizes",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "keep",
+ "columnName": "keep",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "messageId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [
+ {
+ "name": "index_messages_profileId_messageType",
+ "unique": false,
+ "columnNames": [
+ "profileId",
+ "messageType"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_messages_profileId_messageType` ON `${TABLE_NAME}` (`profileId`, `messageType`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "messageRecipients",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `messageRecipientId` INTEGER NOT NULL, `messageRecipientReplyId` INTEGER NOT NULL, `messageRecipientReadDate` INTEGER NOT NULL, `messageId` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `messageRecipientId`, `messageId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "messageRecipientId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "replyId",
+ "columnName": "messageRecipientReplyId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "readDate",
+ "columnName": "messageRecipientReadDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "messageId",
+ "columnName": "messageId",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "messageRecipientId",
+ "messageId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "debugLogs",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `text` TEXT)",
+ "fields": [
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "text",
+ "columnName": "text",
+ "affinity": "TEXT",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "id"
+ ],
+ "autoGenerate": true
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "endpointTimers",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `endpointId` INTEGER NOT NULL, `endpointLastSync` INTEGER, `endpointNextSync` INTEGER NOT NULL, `endpointViewId` INTEGER, PRIMARY KEY(`profileId`, `endpointId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "endpointId",
+ "columnName": "endpointId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "lastSync",
+ "columnName": "endpointLastSync",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "nextSync",
+ "columnName": "endpointNextSync",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "viewId",
+ "columnName": "endpointViewId",
+ "affinity": "INTEGER",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "endpointId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "lessonRanges",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `lessonRangeNumber` INTEGER NOT NULL, `lessonRangeStart` TEXT NOT NULL, `lessonRangeEnd` TEXT NOT NULL, PRIMARY KEY(`profileId`, `lessonRangeNumber`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "lessonNumber",
+ "columnName": "lessonRangeNumber",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "startTime",
+ "columnName": "lessonRangeStart",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "endTime",
+ "columnName": "lessonRangeEnd",
+ "affinity": "TEXT",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "lessonRangeNumber"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "notifications",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `title` TEXT NOT NULL, `text` TEXT NOT NULL, `textLong` TEXT, `type` INTEGER NOT NULL, `profileId` INTEGER, `profileName` TEXT, `posted` INTEGER NOT NULL, `viewId` INTEGER, `extras` TEXT, `addedDate` INTEGER NOT NULL)",
+ "fields": [
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "title",
+ "columnName": "title",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "text",
+ "columnName": "text",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "textLong",
+ "columnName": "textLong",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "type",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "profileName",
+ "columnName": "profileName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "posted",
+ "columnName": "posted",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "viewId",
+ "columnName": "viewId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "extras",
+ "columnName": "extras",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "addedDate",
+ "columnName": "addedDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "id"
+ ],
+ "autoGenerate": true
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "classrooms",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `id` INTEGER NOT NULL, `name` TEXT NOT NULL, PRIMARY KEY(`profileId`, `id`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "name",
+ "affinity": "TEXT",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "id"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "noticeTypes",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `id` INTEGER NOT NULL, `name` TEXT NOT NULL, PRIMARY KEY(`profileId`, `id`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "name",
+ "columnName": "name",
+ "affinity": "TEXT",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "id"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "attendanceTypes",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `id` INTEGER NOT NULL, `baseType` INTEGER NOT NULL, `typeName` TEXT NOT NULL, `typeShort` TEXT NOT NULL, `typeSymbol` TEXT NOT NULL, `typeColor` INTEGER, PRIMARY KEY(`profileId`, `id`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "baseType",
+ "columnName": "baseType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "typeName",
+ "columnName": "typeName",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "typeShort",
+ "columnName": "typeShort",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "typeSymbol",
+ "columnName": "typeSymbol",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "typeColor",
+ "columnName": "typeColor",
+ "affinity": "INTEGER",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "id"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "timetable",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `id` INTEGER NOT NULL, `type` INTEGER NOT NULL, `date` TEXT, `lessonNumber` INTEGER, `startTime` TEXT, `endTime` TEXT, `subjectId` INTEGER, `teacherId` INTEGER, `teamId` INTEGER, `classroom` TEXT, `oldDate` TEXT, `oldLessonNumber` INTEGER, `oldStartTime` TEXT, `oldEndTime` TEXT, `oldSubjectId` INTEGER, `oldTeacherId` INTEGER, `oldTeamId` INTEGER, `oldClassroom` TEXT, `isExtra` INTEGER NOT NULL, `color` INTEGER, `keep` INTEGER NOT NULL, PRIMARY KEY(`profileId`, `id`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "type",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "date",
+ "columnName": "date",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "lessonNumber",
+ "columnName": "lessonNumber",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "startTime",
+ "columnName": "startTime",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "endTime",
+ "columnName": "endTime",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "subjectId",
+ "columnName": "subjectId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "teacherId",
+ "columnName": "teacherId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "teamId",
+ "columnName": "teamId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "classroom",
+ "columnName": "classroom",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "oldDate",
+ "columnName": "oldDate",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "oldLessonNumber",
+ "columnName": "oldLessonNumber",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "oldStartTime",
+ "columnName": "oldStartTime",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "oldEndTime",
+ "columnName": "oldEndTime",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "oldSubjectId",
+ "columnName": "oldSubjectId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "oldTeacherId",
+ "columnName": "oldTeacherId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "oldTeamId",
+ "columnName": "oldTeamId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "oldClassroom",
+ "columnName": "oldClassroom",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "isExtra",
+ "columnName": "isExtra",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "color",
+ "columnName": "color",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "keep",
+ "columnName": "keep",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "id"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [
+ {
+ "name": "index_timetable_profileId_type_date",
+ "unique": false,
+ "columnNames": [
+ "profileId",
+ "type",
+ "date"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_timetable_profileId_type_date` ON `${TABLE_NAME}` (`profileId`, `type`, `date`)"
+ },
+ {
+ "name": "index_timetable_profileId_type_oldDate",
+ "unique": false,
+ "columnNames": [
+ "profileId",
+ "type",
+ "oldDate"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_timetable_profileId_type_oldDate` ON `${TABLE_NAME}` (`profileId`, `type`, `oldDate`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "config",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `key` TEXT NOT NULL, `value` TEXT, PRIMARY KEY(`profileId`, `key`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "key",
+ "columnName": "key",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "value",
+ "columnName": "value",
+ "affinity": "TEXT",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "key"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "librusLessons",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `lessonId` INTEGER NOT NULL, `teacherId` INTEGER NOT NULL, `subjectId` INTEGER NOT NULL, `teamId` INTEGER, PRIMARY KEY(`profileId`, `lessonId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "lessonId",
+ "columnName": "lessonId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "teacherId",
+ "columnName": "teacherId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "subjectId",
+ "columnName": "subjectId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "teamId",
+ "columnName": "teamId",
+ "affinity": "INTEGER",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "profileId",
+ "lessonId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [
+ {
+ "name": "index_librusLessons_profileId",
+ "unique": false,
+ "columnNames": [
+ "profileId"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_librusLessons_profileId` ON `${TABLE_NAME}` (`profileId`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "timetableManual",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `type` INTEGER NOT NULL, `repeatBy` INTEGER NOT NULL, `id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `date` INTEGER, `weekDay` INTEGER, `lessonNumber` INTEGER, `startTime` TEXT, `endTime` TEXT, `subjectId` INTEGER, `teacherId` INTEGER, `teamId` INTEGER, `classroom` TEXT)",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "type",
+ "columnName": "type",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "repeatBy",
+ "columnName": "repeatBy",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "id",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "date",
+ "columnName": "date",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "weekDay",
+ "columnName": "weekDay",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "lessonNumber",
+ "columnName": "lessonNumber",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "startTime",
+ "columnName": "startTime",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "endTime",
+ "columnName": "endTime",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "subjectId",
+ "columnName": "subjectId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "teacherId",
+ "columnName": "teacherId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "teamId",
+ "columnName": "teamId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "classroom",
+ "columnName": "classroom",
+ "affinity": "TEXT",
+ "notNull": false
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "id"
+ ],
+ "autoGenerate": true
+ },
+ "indices": [
+ {
+ "name": "index_timetableManual_profileId_date",
+ "unique": false,
+ "columnNames": [
+ "profileId",
+ "date"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_timetableManual_profileId_date` ON `${TABLE_NAME}` (`profileId`, `date`)"
+ },
+ {
+ "name": "index_timetableManual_profileId_weekDay",
+ "unique": false,
+ "columnNames": [
+ "profileId",
+ "weekDay"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_timetableManual_profileId_weekDay` ON `${TABLE_NAME}` (`profileId`, `weekDay`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "notes",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `noteId` INTEGER NOT NULL, `noteOwnerType` TEXT, `noteOwnerId` INTEGER, `noteReplacesOriginal` INTEGER NOT NULL, `noteTopic` TEXT, `noteBody` TEXT NOT NULL, `noteColor` INTEGER, `noteSharedBy` TEXT, `noteSharedByName` TEXT, `addedDate` INTEGER NOT NULL, PRIMARY KEY(`noteId`))",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "noteId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "ownerType",
+ "columnName": "noteOwnerType",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "ownerId",
+ "columnName": "noteOwnerId",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "replacesOriginal",
+ "columnName": "noteReplacesOriginal",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "topic",
+ "columnName": "noteTopic",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "body",
+ "columnName": "noteBody",
+ "affinity": "TEXT",
+ "notNull": true
+ },
+ {
+ "fieldPath": "color",
+ "columnName": "noteColor",
+ "affinity": "INTEGER",
+ "notNull": false
+ },
+ {
+ "fieldPath": "sharedBy",
+ "columnName": "noteSharedBy",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "sharedByName",
+ "columnName": "noteSharedByName",
+ "affinity": "TEXT",
+ "notNull": false
+ },
+ {
+ "fieldPath": "addedDate",
+ "columnName": "addedDate",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "noteId"
+ ],
+ "autoGenerate": false
+ },
+ "indices": [
+ {
+ "name": "index_notes_profileId_noteOwnerType_noteOwnerId",
+ "unique": false,
+ "columnNames": [
+ "profileId",
+ "noteOwnerType",
+ "noteOwnerId"
+ ],
+ "orders": [],
+ "createSql": "CREATE INDEX IF NOT EXISTS `index_notes_profileId_noteOwnerType_noteOwnerId` ON `${TABLE_NAME}` (`profileId`, `noteOwnerType`, `noteOwnerId`)"
+ }
+ ],
+ "foreignKeys": []
+ },
+ {
+ "tableName": "metadata",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`profileId` INTEGER NOT NULL, `metadataId` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `thingType` INTEGER NOT NULL, `thingId` INTEGER NOT NULL, `seen` INTEGER NOT NULL, `notified` INTEGER NOT NULL)",
+ "fields": [
+ {
+ "fieldPath": "profileId",
+ "columnName": "profileId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "id",
+ "columnName": "metadataId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "thingType",
+ "columnName": "thingType",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "thingId",
+ "columnName": "thingId",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "seen",
+ "columnName": "seen",
+ "affinity": "INTEGER",
+ "notNull": true
+ },
+ {
+ "fieldPath": "notified",
+ "columnName": "notified",
+ "affinity": "INTEGER",
+ "notNull": true
+ }
+ ],
+ "primaryKey": {
+ "columnNames": [
+ "metadataId"
+ ],
+ "autoGenerate": true
+ },
+ "indices": [
+ {
+ "name": "index_metadata_profileId_thingType_thingId",
+ "unique": true,
+ "columnNames": [
+ "profileId",
+ "thingType",
+ "thingId"
+ ],
+ "orders": [],
+ "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_metadata_profileId_thingType_thingId` ON `${TABLE_NAME}` (`profileId`, `thingType`, `thingId`)"
+ }
+ ],
+ "foreignKeys": []
+ }
+ ],
+ "views": [],
+ "setupQueries": [
+ "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
+ "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '2612ebba9802eedc7ebc69724606a23c')"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index c5c273b4..2c24b426 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -12,7 +12,7 @@
-
+
@@ -157,6 +157,10 @@
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:theme="@style/Base.Theme.AppCompat" />
+
diff --git a/app/src/main/assets/pl-changelog.html b/app/src/main/assets/pl-changelog.html
index 2548b456..5104732c 100644
--- a/app/src/main/assets/pl-changelog.html
+++ b/app/src/main/assets/pl-changelog.html
@@ -1,12 +1,16 @@
-
Wersja 4.12.1, 2022-09-23
+Wersja 4.13, 2022-10-26
- - Vulcan UONET+: naprawiono działanie systemu wiadomości. @Antoni-Czaplicki
- - Vulcan UONET+: naprawiono błędy wersji 4.11.9 i starszych.
- - Poprawiono wyświetlanie lekcji odwołanych na stronie głównej.
- - Dodano dostęp do Laboratorium na ekranie logowania.
- - Usunięto obsługę dziennika EduDziennik. [*]
+ - Poprawione powiadomienia na Androidzie 13. @santoni0
+ - Opcja kolorowania bloków w planie lekcji.
+ - USOS - pierwsza wersja obsługi systemu. Osobne rodzaje wydarzeń (oraz wygląd niektórych części aplikacji) lepiej dostosowany do nauki na studiach.
+ - Możliwość dostosowania wyświetlania planu lekcji.
+ - Opcja ustawienia nowych wydarzeń domyślnie jako udostępnione.
+ - Poprawione udostępnianie notatek dotyczących danej lekcji
+ - Bardziej czytelna legenda rodzaju udostępnionego wydarzenia.
+ - Poprawione opcje filtrowania powiadomień i wyboru przycisków menu bocznego.
+ - Ulepszony system pobierania aktualizacji aplikacji.
Dzięki za korzystanie ze Szkolnego!
-© [Kuba Szczodrzyński](@kuba2k2), [Kacper Ziubryniewicz](@kapi2289) 2022
+© [Kuba Szczodrzyński](@kuba2k2) 2022
diff --git a/app/src/main/cpp/szkolny-signing.cpp b/app/src/main/cpp/szkolny-signing.cpp
index 639ca56e..40fa2337 100644
--- a/app/src/main/cpp/szkolny-signing.cpp
+++ b/app/src/main/cpp/szkolny-signing.cpp
@@ -9,7 +9,7 @@
/*secret password - removed for source code publication*/
static toys AES_IV[16] = {
- 0xdf, 0xe4, 0x2d, 0xa3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
+ 0xce, 0x63, 0xdd, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
unsigned char *agony(unsigned int laugh, unsigned char *box, unsigned char *heat);
diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/App.kt b/app/src/main/java/pl/szczodrzynski/edziennik/App.kt
index 56886775..30225982 100644
--- a/app/src/main/java/pl/szczodrzynski/edziennik/App.kt
+++ b/app/src/main/java/pl/szczodrzynski/edziennik/App.kt
@@ -12,6 +12,7 @@ import android.graphics.drawable.Icon
import android.os.Build
import android.provider.Settings
import android.util.Log
+import android.widget.Toast
import androidx.appcompat.app.AppCompatDelegate
import androidx.multidex.MultiDexApplication
import androidx.work.Configuration
@@ -27,36 +28,65 @@ import com.google.gson.Gson
import com.hypertrack.hyperlog.HyperLog
import com.mikepenz.iconics.Iconics
import im.wangchao.mhttp.MHttp
-import kotlinx.coroutines.*
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.Job
+import kotlinx.coroutines.launch
+import kotlinx.coroutines.withContext
import me.leolin.shortcutbadger.ShortcutBadger
import okhttp3.OkHttpClient
import org.greenrobot.eventbus.EventBus
+import pl.szczodrzynski.edziennik.config.AppData
import pl.szczodrzynski.edziennik.config.Config
import pl.szczodrzynski.edziennik.data.api.events.ProfileListEmptyEvent
import pl.szczodrzynski.edziennik.data.api.szkolny.SzkolnyApi
import pl.szczodrzynski.edziennik.data.api.szkolny.interceptor.Signing
import pl.szczodrzynski.edziennik.data.db.AppDb
import pl.szczodrzynski.edziennik.data.db.entity.Profile
+import pl.szczodrzynski.edziennik.data.db.enums.LoginType
import pl.szczodrzynski.edziennik.ext.DAY
import pl.szczodrzynski.edziennik.ext.MS
+import pl.szczodrzynski.edziennik.ext.putExtras
import pl.szczodrzynski.edziennik.ext.setLanguage
import pl.szczodrzynski.edziennik.network.SSLProviderInstaller
import pl.szczodrzynski.edziennik.network.cookie.DumbCookieJar
import pl.szczodrzynski.edziennik.sync.SyncWorker
import pl.szczodrzynski.edziennik.sync.UpdateWorker
import pl.szczodrzynski.edziennik.ui.base.CrashActivity
-import pl.szczodrzynski.edziennik.utils.*
+import pl.szczodrzynski.edziennik.ui.base.enums.NavTarget
+import pl.szczodrzynski.edziennik.utils.DebugLogFormat
+import pl.szczodrzynski.edziennik.utils.PermissionChecker
+import pl.szczodrzynski.edziennik.utils.Themes
+import pl.szczodrzynski.edziennik.utils.Utils
import pl.szczodrzynski.edziennik.utils.Utils.d
-import pl.szczodrzynski.edziennik.utils.managers.*
+import pl.szczodrzynski.edziennik.utils.managers.AttendanceManager
+import pl.szczodrzynski.edziennik.utils.managers.AvailabilityManager
+import pl.szczodrzynski.edziennik.utils.managers.BuildManager
+import pl.szczodrzynski.edziennik.utils.managers.EventManager
+import pl.szczodrzynski.edziennik.utils.managers.GradesManager
+import pl.szczodrzynski.edziennik.utils.managers.MessageManager
+import pl.szczodrzynski.edziennik.utils.managers.NoteManager
+import pl.szczodrzynski.edziennik.utils.managers.NotificationChannelsManager
+import pl.szczodrzynski.edziennik.utils.managers.PermissionManager
+import pl.szczodrzynski.edziennik.utils.managers.TextStylingManager
+import pl.szczodrzynski.edziennik.utils.managers.TimetableManager
+import pl.szczodrzynski.edziennik.utils.managers.UpdateManager
+import pl.szczodrzynski.edziennik.utils.managers.UserActionManager
import java.util.concurrent.TimeUnit
import kotlin.coroutines.CoroutineContext
+import kotlin.system.exitProcess
class App : MultiDexApplication(), Configuration.Provider, CoroutineScope {
companion object {
@Volatile
lateinit var db: AppDb
+ private set
lateinit var config: Config
+ // private set // for LabFragment
lateinit var profile: Profile
+ private set
+ lateinit var data: AppData
+ private set
val profileId
get() = profile.id
@@ -66,18 +96,19 @@ class App : MultiDexApplication(), Configuration.Provider, CoroutineScope {
}
val api by lazy { SzkolnyApi(this) }
- val notificationChannelsManager by lazy { NotificationChannelsManager(this) }
- val userActionManager by lazy { UserActionManager(this) }
- val gradesManager by lazy { GradesManager(this) }
- val timetableManager by lazy { TimetableManager(this) }
- val eventManager by lazy { EventManager(this) }
- val permissionManager by lazy { PermissionManager(this) }
val attendanceManager by lazy { AttendanceManager(this) }
- val buildManager by lazy { BuildManager(this) }
val availabilityManager by lazy { AvailabilityManager(this) }
- val textStylingManager by lazy { TextStylingManager(this) }
+ val buildManager by lazy { BuildManager(this) }
+ val eventManager by lazy { EventManager(this) }
+ val gradesManager by lazy { GradesManager(this) }
val messageManager by lazy { MessageManager(this) }
val noteManager by lazy { NoteManager(this) }
+ val notificationChannelsManager by lazy { NotificationChannelsManager(this) }
+ val permissionManager by lazy { PermissionManager(this) }
+ val textStylingManager by lazy { TextStylingManager(this) }
+ val timetableManager by lazy { TimetableManager(this) }
+ val updateManager by lazy { UpdateManager(this) }
+ val userActionManager by lazy { UserActionManager(this) }
val db
get() = App.db
@@ -87,6 +118,8 @@ class App : MultiDexApplication(), Configuration.Provider, CoroutineScope {
get() = App.profile
val profileId
get() = App.profileId
+ val data
+ get() = App.data
private val job = Job()
override val coroutineContext: CoroutineContext
@@ -121,9 +154,6 @@ class App : MultiDexApplication(), Configuration.Provider, CoroutineScope {
SSLProviderInstaller.enableSupportedTls(builder, enableCleartext = true)
if (devMode) {
- HyperLog.initialize(this)
- HyperLog.setLogLevel(Log.VERBOSE)
- HyperLog.setLogFormat(DebugLogFormat(this))
if (enableChucker) {
val chuckerCollector = ChuckerCollector(this, true, RetentionManager.Period.ONE_HOUR)
val chuckerInterceptor = ChuckerInterceptor(this, chuckerCollector)
@@ -178,15 +208,23 @@ class App : MultiDexApplication(), Configuration.Provider, CoroutineScope {
Iconics.respectFontBoundsDefault = true
// initialize companion object values
+ AppData.read(this)
App.db = AppDb(this)
App.config = Config(App.db)
- App.profile = Profile(0, 0, 0, "")
debugMode = BuildConfig.DEBUG
devMode = config.devMode ?: debugMode
enableChucker = config.enableChucker ?: devMode
+ if (devMode) {
+ HyperLog.initialize(this)
+ HyperLog.setLogLevel(Log.VERBOSE)
+ HyperLog.setLogFormat(DebugLogFormat(this))
+ }
+
if (!profileLoadById(config.lastProfileId)) {
- db.profileDao().firstId?.let { profileLoadById(it) }
+ val success = db.profileDao().firstId?.let { profileLoadById(it) }
+ if (success != true)
+ profileLoad(Profile(0, 0, LoginType.TEMPLATE, ""))
}
buildHttp()
@@ -224,35 +262,35 @@ class App : MultiDexApplication(), Configuration.Provider, CoroutineScope {
.setShortLabel(getString(R.string.shortcut_timetable)).setLongLabel(getString(R.string.shortcut_timetable))
.setIcon(Icon.createWithResource(this@App, R.mipmap.ic_shortcut_timetable))
.setIntent(Intent(Intent.ACTION_MAIN, null, this@App, MainActivity::class.java)
- .putExtra("fragmentId", MainActivity.DRAWER_ITEM_TIMETABLE))
+ .putExtras("fragmentId" to NavTarget.TIMETABLE))
.build()
val shortcutAgenda = ShortcutInfo.Builder(this@App, "item_agenda")
.setShortLabel(getString(R.string.shortcut_agenda)).setLongLabel(getString(R.string.shortcut_agenda))
.setIcon(Icon.createWithResource(this@App, R.mipmap.ic_shortcut_agenda))
.setIntent(Intent(Intent.ACTION_MAIN, null, this@App, MainActivity::class.java)
- .putExtra("fragmentId", MainActivity.DRAWER_ITEM_AGENDA))
+ .putExtras("fragmentId" to NavTarget.AGENDA))
.build()
val shortcutGrades = ShortcutInfo.Builder(this@App, "item_grades")
.setShortLabel(getString(R.string.shortcut_grades)).setLongLabel(getString(R.string.shortcut_grades))
.setIcon(Icon.createWithResource(this@App, R.mipmap.ic_shortcut_grades))
.setIntent(Intent(Intent.ACTION_MAIN, null, this@App, MainActivity::class.java)
- .putExtra("fragmentId", MainActivity.DRAWER_ITEM_GRADES))
+ .putExtras("fragmentId" to NavTarget.GRADES))
.build()
val shortcutHomework = ShortcutInfo.Builder(this@App, "item_homeworks")
.setShortLabel(getString(R.string.shortcut_homework)).setLongLabel(getString(R.string.shortcut_homework))
.setIcon(Icon.createWithResource(this@App, R.mipmap.ic_shortcut_homework))
.setIntent(Intent(Intent.ACTION_MAIN, null, this@App, MainActivity::class.java)
- .putExtra("fragmentId", MainActivity.DRAWER_ITEM_HOMEWORK))
+ .putExtras("fragmentId" to NavTarget.HOMEWORK))
.build()
val shortcutMessages = ShortcutInfo.Builder(this@App, "item_messages")
.setShortLabel(getString(R.string.shortcut_messages)).setLongLabel(getString(R.string.shortcut_messages))
.setIcon(Icon.createWithResource(this@App, R.mipmap.ic_shortcut_messages))
.setIntent(Intent(Intent.ACTION_MAIN, null, this@App, MainActivity::class.java)
- .putExtra("fragmentId", MainActivity.DRAWER_ITEM_MESSAGES))
+ .putExtras("fragmentId" to NavTarget.MESSAGES))
.build()
shortcutManager.dynamicShortcuts = listOf(
@@ -378,10 +416,22 @@ class App : MultiDexApplication(), Configuration.Provider, CoroutineScope {
}
}
+ fun profileLoad(profile: Profile) {
+ App.profile = profile
+ App.config.lastProfileId = profile.id
+ try {
+ App.data = AppData.get(profile.loginStoreType)
+ d("App", "Loaded AppData: ${App.data}")
+ } catch (e: Exception) {
+ Log.e("App", "Cannot load AppData", e)
+ Toast.makeText(this, R.string.app_cannot_load_data, Toast.LENGTH_LONG).show()
+ exitProcess(0)
+ }
+ }
+
private fun profileLoadById(profileId: Int): Boolean {
db.profileDao().getByIdNow(profileId)?.also {
- App.profile = it
- App.config.lastProfileId = it.id
+ profileLoad(it)
return true
}
return false
@@ -412,6 +462,8 @@ class App : MultiDexApplication(), Configuration.Provider, CoroutineScope {
}
fun profileSave() = profileSave(profile)
fun profileSave(profile: Profile) {
+ if (profile.id == profileId)
+ App.profile = profile
launch(Dispatchers.Default) {
App.db.profileDao().add(profile)
}
diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt b/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt
index 7197ea10..ce39bc77 100644
--- a/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt
+++ b/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt
@@ -28,7 +28,6 @@ import com.mikepenz.iconics.utils.sizeDp
import com.mikepenz.materialdrawer.model.*
import com.mikepenz.materialdrawer.model.interfaces.*
import com.mikepenz.materialdrawer.model.utils.hiddenInMiniDrawer
-import eu.szkolny.font.SzkolnyFont
import kotlinx.coroutines.*
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
@@ -39,52 +38,38 @@ import pl.szczodrzynski.edziennik.data.api.edziennik.EdziennikTask
import pl.szczodrzynski.edziennik.data.api.events.*
import pl.szczodrzynski.edziennik.data.api.models.ApiError
import pl.szczodrzynski.edziennik.data.api.szkolny.response.Update
-import pl.szczodrzynski.edziennik.data.db.entity.LoginStore
+import pl.szczodrzynski.edziennik.data.db.entity.Message
import pl.szczodrzynski.edziennik.data.db.entity.Metadata.*
import pl.szczodrzynski.edziennik.data.db.entity.Profile
+import pl.szczodrzynski.edziennik.data.db.enums.FeatureType
import pl.szczodrzynski.edziennik.databinding.ActivitySzkolnyBinding
import pl.szczodrzynski.edziennik.ext.*
import pl.szczodrzynski.edziennik.sync.AppManagerDetectedEvent
import pl.szczodrzynski.edziennik.sync.SyncWorker
+import pl.szczodrzynski.edziennik.sync.UpdateStateEvent
import pl.szczodrzynski.edziennik.sync.UpdateWorker
-import pl.szczodrzynski.edziennik.ui.agenda.AgendaFragment
-import pl.szczodrzynski.edziennik.ui.announcements.AnnouncementsFragment
-import pl.szczodrzynski.edziennik.ui.attendance.AttendanceFragment
import pl.szczodrzynski.edziennik.ui.base.MainSnackbar
-import pl.szczodrzynski.edziennik.ui.behaviour.BehaviourFragment
-import pl.szczodrzynski.edziennik.ui.debug.DebugFragment
-import pl.szczodrzynski.edziennik.ui.debug.LabFragment
+import pl.szczodrzynski.edziennik.ui.base.enums.NavTarget
+import pl.szczodrzynski.edziennik.ui.base.enums.NavTargetLocation
import pl.szczodrzynski.edziennik.ui.dialogs.ChangelogDialog
import pl.szczodrzynski.edziennik.ui.dialogs.settings.ProfileConfigDialog
import pl.szczodrzynski.edziennik.ui.dialogs.sync.RegisterUnavailableDialog
import pl.szczodrzynski.edziennik.ui.dialogs.sync.ServerMessageDialog
import pl.szczodrzynski.edziennik.ui.dialogs.sync.SyncViewListDialog
import pl.szczodrzynski.edziennik.ui.dialogs.sync.UpdateAvailableDialog
+import pl.szczodrzynski.edziennik.ui.dialogs.sync.UpdateProgressDialog
import pl.szczodrzynski.edziennik.ui.error.ErrorDetailsDialog
import pl.szczodrzynski.edziennik.ui.error.ErrorSnackbar
import pl.szczodrzynski.edziennik.ui.event.EventManualDialog
-import pl.szczodrzynski.edziennik.ui.feedback.FeedbackFragment
-import pl.szczodrzynski.edziennik.ui.grades.GradesListFragment
-import pl.szczodrzynski.edziennik.ui.grades.editor.GradesEditorFragment
-import pl.szczodrzynski.edziennik.ui.home.HomeFragment
-import pl.szczodrzynski.edziennik.ui.homework.HomeworkFragment
import pl.szczodrzynski.edziennik.ui.login.LoginActivity
-import pl.szczodrzynski.edziennik.ui.messages.compose.MessagesComposeFragment
import pl.szczodrzynski.edziennik.ui.messages.list.MessagesFragment
-import pl.szczodrzynski.edziennik.ui.messages.single.MessageFragment
-import pl.szczodrzynski.edziennik.ui.notes.NotesFragment
-import pl.szczodrzynski.edziennik.ui.notifications.NotificationsListFragment
-import pl.szczodrzynski.edziennik.ui.settings.ProfileManagerFragment
-import pl.szczodrzynski.edziennik.ui.settings.SettingsFragment
-import pl.szczodrzynski.edziennik.ui.teachers.TeachersListFragment
import pl.szczodrzynski.edziennik.ui.timetable.TimetableFragment
-import pl.szczodrzynski.edziennik.ui.webpush.WebPushFragment
import pl.szczodrzynski.edziennik.utils.*
import pl.szczodrzynski.edziennik.utils.Utils.d
import pl.szczodrzynski.edziennik.utils.Utils.dpToPx
import pl.szczodrzynski.edziennik.utils.managers.AvailabilityManager.Error.Type
+import pl.szczodrzynski.edziennik.utils.managers.UserActionManager
import pl.szczodrzynski.edziennik.utils.models.Date
-import pl.szczodrzynski.edziennik.utils.models.NavTarget
import pl.szczodrzynski.navlib.*
import pl.szczodrzynski.navlib.SystemBarsUtil.Companion.COLOR_HALF_TRANSPARENT
import pl.szczodrzynski.navlib.bottomsheet.NavBottomSheet
@@ -98,184 +83,8 @@ import kotlin.coroutines.CoroutineContext
import kotlin.math.roundToInt
class MainActivity : AppCompatActivity(), CoroutineScope {
- @Suppress("MemberVisibilityCanBePrivate")
companion object {
-
- const val TAG = "MainActivity"
-
- const val DRAWER_PROFILE_ADD_NEW = 200
- const val DRAWER_PROFILE_SYNC_ALL = 201
- const val DRAWER_PROFILE_MANAGE = 203
- const val DRAWER_PROFILE_MARK_ALL_AS_READ = 204
- const val DRAWER_ITEM_HOME = 1
- const val DRAWER_ITEM_TIMETABLE = 11
- const val DRAWER_ITEM_AGENDA = 12
- const val DRAWER_ITEM_GRADES = 13
- const val DRAWER_ITEM_MESSAGES = 17
- const val DRAWER_ITEM_HOMEWORK = 14
- const val DRAWER_ITEM_BEHAVIOUR = 15
- const val DRAWER_ITEM_ATTENDANCE = 16
- const val DRAWER_ITEM_ANNOUNCEMENTS = 18
- const val DRAWER_ITEM_NOTIFICATIONS = 20
- const val DRAWER_ITEM_MORE = 21
- const val DRAWER_ITEM_TEACHERS = 22
- const val DRAWER_ITEM_NOTES = 23
- const val DRAWER_ITEM_SETTINGS = 101
- const val DRAWER_ITEM_DEBUG = 102
-
- const val TARGET_GRADES_EDITOR = 501
- const val TARGET_FEEDBACK = 120
- const val TARGET_MESSAGES_DETAILS = 503
- const val TARGET_MESSAGES_COMPOSE = 504
- const val TARGET_WEB_PUSH = 140
- const val TARGET_LAB = 1000
-
- const val HOME_ID = DRAWER_ITEM_HOME
-
- val navTargetList: List by lazy {
- val list: MutableList = mutableListOf()
- val moreList: MutableList = mutableListOf()
-
- moreList += NavTarget(
- id = DRAWER_ITEM_NOTES,
- name = R.string.menu_notes,
- fragmentClass = NotesFragment::class)
- .withIcon(CommunityMaterial.Icon3.cmd_text_box_multiple_outline)
- .isStatic(true)
-
- moreList += NavTarget(DRAWER_ITEM_TEACHERS,
- R.string.menu_teachers,
- TeachersListFragment::class)
- .withIcon(CommunityMaterial.Icon3.cmd_shield_account_outline)
- .isStatic(true)
-
- // home item
- list += NavTarget(DRAWER_ITEM_HOME, R.string.menu_home_page, HomeFragment::class)
- .withTitle(R.string.app_name)
- .withIcon(CommunityMaterial.Icon2.cmd_home_outline)
- .isInDrawer(true)
- .isStatic(true)
- .withPopToHome(false)
-
- list += NavTarget(DRAWER_ITEM_TIMETABLE,
- R.string.menu_timetable,
- TimetableFragment::class)
- .withIcon(CommunityMaterial.Icon3.cmd_timetable)
- .withBadgeTypeId(TYPE_LESSON_CHANGE)
- .isInDrawer(true)
-
- list += NavTarget(DRAWER_ITEM_AGENDA, R.string.menu_agenda, AgendaFragment::class)
- .withIcon(CommunityMaterial.Icon.cmd_calendar_outline)
- .withBadgeTypeId(TYPE_EVENT)
- .isInDrawer(true)
-
- list += NavTarget(DRAWER_ITEM_GRADES, R.string.menu_grades, GradesListFragment::class)
- .withIcon(CommunityMaterial.Icon3.cmd_numeric_5_box_outline)
- .withBadgeTypeId(TYPE_GRADE)
- .isInDrawer(true)
-
- list += NavTarget(DRAWER_ITEM_MESSAGES, R.string.menu_messages, MessagesFragment::class)
- .withIcon(CommunityMaterial.Icon.cmd_email_outline)
- .withBadgeTypeId(TYPE_MESSAGE)
- .isInDrawer(true)
-
- list += NavTarget(DRAWER_ITEM_HOMEWORK, R.string.menu_homework, HomeworkFragment::class)
- .withIcon(SzkolnyFont.Icon.szf_notebook_outline)
- .withBadgeTypeId(TYPE_HOMEWORK)
- .isInDrawer(true)
-
- list += NavTarget(DRAWER_ITEM_BEHAVIOUR,
- R.string.menu_notices,
- BehaviourFragment::class)
- .withIcon(CommunityMaterial.Icon.cmd_emoticon_outline)
- .withBadgeTypeId(TYPE_NOTICE)
- .isInDrawer(true)
-
- list += NavTarget(DRAWER_ITEM_ATTENDANCE,
- R.string.menu_attendance,
- AttendanceFragment::class)
- .withIcon(CommunityMaterial.Icon.cmd_calendar_remove_outline)
- .withBadgeTypeId(TYPE_ATTENDANCE)
- .isInDrawer(true)
-
- list += NavTarget(DRAWER_ITEM_ANNOUNCEMENTS,
- R.string.menu_announcements,
- AnnouncementsFragment::class)
- .withIcon(CommunityMaterial.Icon.cmd_bullhorn_outline)
- .withBadgeTypeId(TYPE_ANNOUNCEMENT)
- .isInDrawer(true)
-
- list += NavTarget(DRAWER_ITEM_MORE, R.string.menu_more, null)
- .withIcon(CommunityMaterial.Icon.cmd_dots_horizontal)
- .isInDrawer(true)
- .isStatic(true)
- .withSubItems(*moreList.toTypedArray())
-
-
- // static drawer items
- list += NavTarget(DRAWER_ITEM_NOTIFICATIONS,
- R.string.menu_notifications,
- NotificationsListFragment::class)
- .withIcon(CommunityMaterial.Icon.cmd_bell_ring_outline)
- .isInDrawer(true)
- .isStatic(true)
- .isBelowSeparator(true)
-
- list += NavTarget(DRAWER_ITEM_SETTINGS, R.string.menu_settings, SettingsFragment::class)
- .withIcon(CommunityMaterial.Icon.cmd_cog_outline)
- .isInDrawer(true)
- .isStatic(true)
- .isBelowSeparator(true)
-
-
- // profile settings items
- list += NavTarget(DRAWER_PROFILE_ADD_NEW, R.string.menu_add_new_profile, null)
- .withIcon(CommunityMaterial.Icon3.cmd_plus)
- .withDescription(R.string.drawer_add_new_profile_desc)
- .isInProfileList(true)
-
- list += NavTarget(DRAWER_PROFILE_MANAGE,
- R.string.menu_manage_profiles,
- ProfileManagerFragment::class)
- .withTitle(R.string.title_profile_manager)
- .withIcon(CommunityMaterial.Icon.cmd_account_group)
- .withDescription(R.string.drawer_manage_profiles_desc)
- .isInProfileList(false)
-
- list += NavTarget(DRAWER_PROFILE_MARK_ALL_AS_READ,
- R.string.menu_mark_everything_as_read,
- null)
- .withIcon(CommunityMaterial.Icon.cmd_eye_check_outline)
- .isInProfileList(true)
-
- list += NavTarget(DRAWER_PROFILE_SYNC_ALL, R.string.menu_sync_all, null)
- .withIcon(CommunityMaterial.Icon.cmd_download_outline)
- .isInProfileList(true)
-
-
- // other target items, not directly navigated
- list += NavTarget(TARGET_GRADES_EDITOR,
- R.string.menu_grades_editor,
- GradesEditorFragment::class)
- list += NavTarget(TARGET_FEEDBACK, R.string.menu_feedback, FeedbackFragment::class)
- list += NavTarget(TARGET_MESSAGES_DETAILS,
- R.string.menu_message,
- MessageFragment::class).withPopTo(DRAWER_ITEM_MESSAGES)
- list += NavTarget(TARGET_MESSAGES_COMPOSE,
- R.string.menu_message_compose,
- MessagesComposeFragment::class)
- list += NavTarget(TARGET_WEB_PUSH, R.string.menu_web_push, WebPushFragment::class)
- if (App.devMode) {
- list += NavTarget(DRAWER_ITEM_DEBUG, R.string.menu_debug, DebugFragment::class)
- list += NavTarget(TARGET_LAB, R.string.menu_lab, LabFragment::class)
- .withIcon(CommunityMaterial.Icon2.cmd_flask_outline)
- .isInDrawer(true)
- .isBelowSeparator(true)
- .isStatic(true)
- }
-
- list
- }
+ private const val TAG = "MainActivity"
}
private var job = Job()
@@ -293,18 +102,16 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
val swipeRefreshLayout: SwipeRefreshLayoutNoTouch by lazy { b.swipeRefreshLayout }
var onBeforeNavigate: (() -> Boolean)? = null
- var pausedNavigationData: PausedNavigationData? = null
- private set
+ private var pausedNavigationData: PausedNavigationData? = null
val app: App by lazy {
applicationContext as App
}
private val fragmentManager by lazy { supportFragmentManager }
- private lateinit var navTarget: NavTarget
+ lateinit var navTarget: NavTarget
+ private set
private var navArguments: Bundle? = null
- val navTargetId
- get() = navTarget.id
private val navBackStack = mutableListOf>()
private var navLoading = true
@@ -368,7 +175,7 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
window.statusBarColor = statusBarColor
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
- && ColorUtils.calculateLuminance(statusBarColor) > 0.6
+ && ColorUtils.calculateLuminance(statusBarColor) > 0.6
) {
@Suppress("deprecation")
window.decorView.systemUiVisibility =
@@ -415,12 +222,15 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
drawerProfileListEmptyListener = {
onProfileListEmptyEvent(ProfileListEmptyEvent())
}
- drawerItemSelectedListener = { id, _, _ ->
- loadTarget(id)
+ drawerItemSelectedListener = { id, _, item ->
+ if (item is ExpandableDrawerItem)
+ false
+ else
+ navigate(navTarget = id.asNavTargetOrNull())
}
drawerProfileSelectedListener = { id, _, _, _ ->
// why is this negated -_-
- !loadProfile(id)
+ !navigate(profileId = id)
}
drawerProfileLongClickListener = { _, profile, _, view ->
if (view != null && profile is ProfileDrawerItem) {
@@ -444,7 +254,7 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
}
}
- navTarget = navTargetList[0]
+ navTarget = NavTarget.HOME
if (savedInstanceState != null) {
intent?.putExtras(savedInstanceState)
@@ -476,9 +286,6 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
handleIntent(intent?.extras)
app.db.metadataDao().unreadCounts.observe(this) { unreadCounters ->
- unreadCounters.map {
- it.type = it.thingType
- }
drawer.setUnreadCounterList(unreadCounters)
}
@@ -501,11 +308,11 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
app.db.profileDao().getNotArchivedOf(app.profile.archiveId!!)
}
if (profile != null)
- loadProfile(profile)
+ navigate(profile = profile)
else
- loadProfile(0)
+ navigate(profileId = 0)
} else {
- loadProfile(0)
+ navigate(profileId = 0)
}
}
}
@@ -596,39 +403,32 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
.withIcon(CommunityMaterial.Icon.cmd_download_outline)
.withOnClickListener {
bottomSheet.close()
- SyncViewListDialog(this, navTargetId).show()
+ SyncViewListDialog(this, navTarget).show()
},
BottomSheetSeparatorItem(false),
- BottomSheetPrimaryItem(false)
- .withTitle(R.string.menu_settings)
- .withIcon(CommunityMaterial.Icon.cmd_cog_outline)
- .withOnClickListener { loadTarget(DRAWER_ITEM_SETTINGS) },
- BottomSheetPrimaryItem(false)
- .withTitle(R.string.menu_feedback)
- .withIcon(CommunityMaterial.Icon2.cmd_help_circle_outline)
- .withOnClickListener { loadTarget(TARGET_FEEDBACK) }
)
- if (App.devMode) {
- bottomSheet += BottomSheetPrimaryItem(false)
- .withTitle(R.string.menu_debug)
- .withIcon(CommunityMaterial.Icon.cmd_android_debug_bridge)
- .withOnClickListener { loadTarget(DRAWER_ITEM_DEBUG) }
+ for (target in NavTarget.values()) {
+ if (target.location != NavTargetLocation.BOTTOM_SHEET)
+ continue
+ if (target.devModeOnly && !App.devMode)
+ continue
+ bottomSheet += target.toBottomSheetItem(this)
}
}
- private var profileSettingClickListener = { id: Int, _: View? ->
- when (id) {
- DRAWER_PROFILE_ADD_NEW -> {
+ private var profileSettingClickListener = { itemId: Int, _: View? ->
+ when (val item = itemId.asNavTarget()) {
+ NavTarget.PROFILE_ADD -> {
requestHandler.requestLogin()
}
- DRAWER_PROFILE_SYNC_ALL -> {
+ NavTarget.PROFILE_SYNC_ALL -> {
EdziennikTask.sync().enqueue(this)
}
- DRAWER_PROFILE_MARK_ALL_AS_READ -> {
+ NavTarget.PROFILE_MARK_AS_READ -> {
launch {
withContext(Dispatchers.Default) {
app.db.profileDao().allNow.forEach { profile ->
- if (profile.loginStoreType != LoginStore.LOGIN_TYPE_LIBRUS)
+ if (!profile.getAppData().uiConfig.enableMarkAsReadAnnouncements)
app.db.metadataDao()
.setAllSeenExceptMessagesAndAnnouncements(profile.id, true)
else
@@ -641,7 +441,7 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
}
}
else -> {
- loadTarget(id)
+ navigate(navTarget = item)
}
}
false
@@ -698,7 +498,7 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
when (error?.type) {
Type.NOT_AVAILABLE -> {
swipeRefreshLayout.isRefreshing = false
- loadTarget(DRAWER_ITEM_HOME)
+ navigate(navTarget = NavTarget.HOME)
RegisterUnavailableDialog(this, error.status!!).show()
return
}
@@ -709,21 +509,25 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
Type.NO_API_ACCESS -> {
Toast.makeText(this, R.string.error_no_api_access, Toast.LENGTH_SHORT).show()
}
+ else -> {}
}
swipeRefreshLayout.isRefreshing = true
- Toast.makeText(this, fragmentToSyncName(navTargetId), Toast.LENGTH_SHORT).show()
- val fragmentParam = when (navTargetId) {
- DRAWER_ITEM_MESSAGES -> MessagesFragment.pageSelection
- else -> 0
+ Toast.makeText(this, fragmentToSyncName(navTarget), Toast.LENGTH_SHORT).show()
+ val featureType = when (navTarget) {
+ NavTarget.MESSAGES -> when (MessagesFragment.pageSelection) {
+ Message.TYPE_SENT -> FeatureType.MESSAGES_SENT
+ else -> FeatureType.MESSAGES_INBOX
+ }
+ else -> navTarget.featureType
}
- val arguments = when (navTargetId) {
- DRAWER_ITEM_TIMETABLE -> JsonObject("weekStart" to TimetableFragment.pageSelection?.weekStart?.stringY_m_d)
+ val arguments = when (navTarget) {
+ NavTarget.TIMETABLE -> JsonObject("weekStart" to TimetableFragment.pageSelection?.weekStart?.stringY_m_d)
else -> null
}
EdziennikTask.syncProfile(
App.profileId,
- listOf(navTargetId to fragmentParam),
+ featureType?.let { setOf(it) },
arguments = arguments
).enqueue(this)
}
@@ -734,6 +538,14 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
UpdateAvailableDialog(this, event).show()
}
+ @Subscribe(threadMode = ThreadMode.MAIN, sticky = true)
+ fun onUpdateStateEvent(event: UpdateStateEvent) {
+ if (!event.running)
+ return
+ EventBus.getDefault().removeStickyEvent(event)
+ UpdateProgressDialog(this, event.update ?: return, event.downloadId).show()
+ }
+
@Subscribe(threadMode = ThreadMode.MAIN, sticky = true)
fun onRegisterAvailabilityEvent(event: RegisterAvailabilityEvent) {
EventBus.getDefault().removeStickyEvent(event)
@@ -853,22 +665,22 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
@Subscribe(threadMode = ThreadMode.MAIN)
fun onUserActionRequiredEvent(event: UserActionRequiredEvent) {
- app.userActionManager.execute(this, event.profileId, event.type)
+ app.userActionManager.execute(this, event, UserActionManager.UserActionCallback())
}
- private fun fragmentToSyncName(currentFragment: Int): Int {
- return when (currentFragment) {
- DRAWER_ITEM_TIMETABLE -> R.string.sync_feature_timetable
- DRAWER_ITEM_AGENDA -> R.string.sync_feature_agenda
- DRAWER_ITEM_GRADES -> R.string.sync_feature_grades
- DRAWER_ITEM_HOMEWORK -> R.string.sync_feature_homework
- DRAWER_ITEM_BEHAVIOUR -> R.string.sync_feature_notices
- DRAWER_ITEM_ATTENDANCE -> R.string.sync_feature_attendance
- DRAWER_ITEM_MESSAGES -> when (MessagesFragment.pageSelection) {
- 1 -> R.string.sync_feature_messages_outbox
+ private fun fragmentToSyncName(navTarget: NavTarget): Int {
+ return when (navTarget) {
+ NavTarget.TIMETABLE -> R.string.sync_feature_timetable
+ NavTarget.AGENDA -> R.string.sync_feature_agenda
+ NavTarget.GRADES -> R.string.sync_feature_grades
+ NavTarget.HOMEWORK -> R.string.sync_feature_homework
+ NavTarget.BEHAVIOUR -> R.string.sync_feature_notices
+ NavTarget.ATTENDANCE -> R.string.sync_feature_attendance
+ NavTarget.MESSAGES -> when (MessagesFragment.pageSelection) {
+ Message.TYPE_SENT -> R.string.sync_feature_messages_outbox
else -> R.string.sync_feature_messages_inbox
}
- DRAWER_ITEM_ANNOUNCEMENTS -> R.string.sync_feature_announcements
+ NavTarget.ANNOUNCEMENTS -> R.string.sync_feature_announcements
else -> R.string.sync_feature_syncing_all
}
}
@@ -886,18 +698,21 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
}
fun handleIntent(extras: Bundle?) {
-
d(TAG, "handleIntent() {")
extras?.keySet()?.forEach { key ->
d(TAG, " \"$key\": " + extras.get(key))
}
d(TAG, "}")
- var intentProfileId = -1
- var intentTargetId = -1
+ val intentProfileId = extras.getIntOrNull("profileId").takePositive()
+ var intentNavTarget = extras.getIntOrNull("fragmentId").asNavTargetOrNull()
if (extras?.containsKey("action") == true) {
val handled = when (extras.getString("action")) {
+ "updateRequest" -> {
+ UpdateAvailableDialog(this, app.config.update).show()
+ true
+ }
"serverMessage" -> {
ServerMessageDialog(
this,
@@ -907,15 +722,19 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
true
}
"feedbackMessage" -> {
- intentTargetId = TARGET_FEEDBACK
+ intentNavTarget = NavTarget.FEEDBACK
false
}
"userActionRequired" -> {
- app.userActionManager.execute(
- this,
- extras.getInt("profileId"),
- extras.getInt("type")
+ val event = UserActionRequiredEvent(
+ profileId = extras.getInt("profileId"),
+ type = extras.getEnum("type") ?: return,
+ params = extras.getBundle("params") ?: return,
+ errorText = 0,
)
+ app.userActionManager.execute(this,
+ event,
+ UserActionManager.UserActionCallback())
true
}
"createManualEvent" -> {
@@ -937,72 +756,59 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
}
if (extras?.containsKey("reloadProfileId") == true) {
- val reloadProfileId = extras.getInt("reloadProfileId", -1)
- extras.remove("reloadProfileId")
- if (reloadProfileId == -1 || app.profile.id == reloadProfileId) {
+ val reloadProfileId = extras.getIntOrNull("reloadProfileId").takePositive()
+ if (reloadProfileId == null || app.profile.id == reloadProfileId) {
reloadTarget()
return
}
}
- if (extras?.getInt("profileId", -1) != -1) {
- intentProfileId = extras.getInt("profileId", -1)
- extras?.remove("profileId")
- }
-
- if (extras?.getInt("fragmentId", -1) != -1) {
- intentTargetId = extras.getInt("fragmentId", -1)
- extras?.remove("fragmentId")
- }
+ extras?.remove("profileId")
+ extras?.remove("fragmentId")
+ extras?.remove("reloadProfileId")
/*if (intentTargetId == -1 && navController.currentDestination?.id == R.id.loadingFragment) {
intentTargetId = navTarget.id
}*/
- if (navLoading) {
+ if (navLoading)
b.fragment.removeAllViews()
- if (intentTargetId == -1)
- intentTargetId = HOME_ID
- }
when {
- app.profile.id == 0 -> {
- if (intentProfileId == -1)
- intentProfileId = app.config.lastProfileId
- loadProfile(intentProfileId, intentTargetId, extras)
- }
- intentProfileId != -1 -> {
- if (app.profile.id != intentProfileId)
- loadProfile(intentProfileId, intentTargetId, extras)
- else
- loadTarget(intentTargetId, extras)
- }
- intentTargetId != -1 -> {
- drawer.currentProfile = app.profile.id
- if (navTargetId != intentTargetId || navLoading)
- loadTarget(intentTargetId, extras)
- }
- else -> {
- drawer.currentProfile = app.profile.id
- }
+ app.profile.id == 0 -> navigate(
+ profileId = intentProfileId ?: app.config.lastProfileId,
+ navTarget = intentNavTarget,
+ args = extras,
+ )
+ intentProfileId != null -> navigate(
+ profileId = intentProfileId,
+ navTarget = intentNavTarget,
+ args = extras,
+ )
+ intentNavTarget != null -> navigate(
+ navTarget = intentNavTarget,
+ args = extras,
+ )
+ navLoading -> navigate()
+ else -> drawer.currentProfile = app.profile.id
}
navLoading = false
}
override fun recreate() {
- recreate(navTargetId)
+ recreate(navTarget)
}
- fun recreate(targetId: Int) {
- recreate(targetId, null)
+ fun recreate(navTarget: NavTarget) {
+ recreate(navTarget, null)
}
- fun recreate(targetId: Int? = null, arguments: Bundle? = null) {
+ fun recreate(navTarget: NavTarget? = null, arguments: Bundle? = null) {
val intent = Intent(this, MainActivity::class.java)
if (arguments != null)
intent.putExtras(arguments)
- if (targetId != null) {
- intent.putExtra("fragmentId", targetId)
+ if (navTarget != null) {
+ intent.putExtra("fragmentId", navTarget.id)
}
finish()
overridePendingTransition(R.anim.fade_in, R.anim.fade_out)
@@ -1042,7 +848,7 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
override fun onSaveInstanceState(outState: Bundle) {
super.onSaveInstanceState(outState)
- outState.putInt("fragmentId", navTargetId)
+ outState.putExtras("fragmentId" to navTarget)
}
override fun onNewIntent(intent: Intent?) {
@@ -1072,187 +878,126 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
private fun canNavigate(): Boolean = onBeforeNavigate?.invoke() != false
fun resumePausedNavigation(): Boolean {
- if (pausedNavigationData == null)
- return false
- pausedNavigationData?.let { data ->
- when (data) {
- is PausedNavigationData.LoadProfile -> loadProfile(
- id = data.id,
- drawerSelection = data.drawerSelection,
- arguments = data.arguments,
- skipBeforeNavigate = true,
- )
- is PausedNavigationData.LoadTarget -> loadTarget(
- id = data.id,
- arguments = data.arguments,
- skipBeforeNavigate = true,
- )
- else -> return false
- }
- }
+ val data = pausedNavigationData ?: return false
+ navigate(
+ profileId = data.profileId,
+ navTarget = data.navTarget,
+ args = data.args,
+ skipBeforeNavigate = true,
+ )
pausedNavigationData = null
return true
}
- fun loadProfile(id: Int) = loadProfile(id, navTargetId)
-
- // fun loadProfile(id: Int, arguments: Bundle?) = loadProfile(id, navTargetId, arguments)
- fun loadProfile(profile: Profile): Boolean {
- if (!canNavigate()) {
- pausedNavigationData = PausedNavigationData.LoadProfile(
- id = profile.id,
- drawerSelection = navTargetId,
- arguments = null,
- )
- return false
- }
-
- loadProfile(profile, navTargetId, null)
- return true
- }
-
- private fun loadProfile(
- id: Int,
- drawerSelection: Int,
- arguments: Bundle? = null,
- skipBeforeNavigate: Boolean = false,
- ): Boolean {
- if (!skipBeforeNavigate && !canNavigate()) {
- drawer.close()
- // restore the previous profile after changing it with the drawer
- // well, it still does not change the toolbar profile image,
- // but that's now NavView's problem, not mine.
- drawer.currentProfile = app.profile.id
- pausedNavigationData = PausedNavigationData.LoadProfile(
- id = id,
- drawerSelection = drawerSelection,
- arguments = arguments,
- )
- return false
- }
-
- if (App.profileId == id) {
- drawer.currentProfile = app.profile.id
- // skipBeforeNavigate because it's checked above already
- loadTarget(drawerSelection, arguments, skipBeforeNavigate = true)
- return true
- }
- app.profileLoad(id) {
- loadProfile(it, drawerSelection, arguments)
- }
- return true
- }
-
- private fun loadProfile(profile: Profile, drawerSelection: Int, arguments: Bundle?) {
- App.profile = profile
- MessagesFragment.pageSelection = -1
-
- setDrawerItems()
-
- val previousArchivedId = if (app.profile.archived) app.profile.id else null
- if (previousArchivedId != null) {
- // prevents accidentally removing the first item if the archived profile is not shown
- drawer.removeProfileById(previousArchivedId)
- }
- if (profile.archived) {
- drawer.prependProfile(Profile(
- id = profile.id,
- loginStoreId = profile.loginStoreId,
- loginStoreType = profile.loginStoreType,
- name = profile.name,
- subname = "Archiwum - ${profile.subname}"
- ).also {
- it.archived = true
- })
- }
-
- // the drawer profile is updated automatically when the drawer item is clicked
- // update it manually when switching profiles from other source
- //if (drawer.currentProfile != app.profile.id)
- drawer.currentProfile = app.profileId
- loadTarget(drawerSelection, arguments, skipBeforeNavigate = true)
- }
-
- fun loadTarget(
- id: Int,
- arguments: Bundle? = null,
- skipBeforeNavigate: Boolean = false,
- ): Boolean {
- var loadId = id
- if (loadId == -1) {
- loadId = DRAWER_ITEM_HOME
- }
- val targets = navTargetList
- .flatMap { it.subItems?.toList() ?: emptyList() }
- .plus(navTargetList)
- val target = targets.firstOrNull { it.id == loadId }
- return when {
- target == null -> {
- Toast.makeText(
- this,
- getString(R.string.error_invalid_fragment, id),
- Toast.LENGTH_LONG,
- ).show()
- loadTarget(navTargetList.first(), arguments, skipBeforeNavigate)
- }
- target.fragmentClass != null -> {
- loadTarget(target, arguments, skipBeforeNavigate)
- }
- else -> {
- false
- }
- }
- }
-
- private fun loadTarget(
- target: NavTarget,
+ fun navigate(
+ profileId: Int? = null,
+ profile: Profile? = null,
+ navTarget: NavTarget? = null,
args: Bundle? = null,
skipBeforeNavigate: Boolean = false,
): Boolean {
- d("NavDebug", "loadTarget(target = $target, args = $args)")
-
- if (!skipBeforeNavigate && !canNavigate()) {
+ d(TAG, "navigate(profileId = ${profile?.id ?: profileId}, target = ${navTarget?.name}, args = $args)")
+ if (!(skipBeforeNavigate || navTarget == this.navTarget) && !canNavigate()) {
bottomSheet.close()
drawer.close()
- pausedNavigationData = PausedNavigationData.LoadTarget(
- id = target.id,
- arguments = args,
- )
+ // restore the previous profile if changing it with the drawer
+ // well, it still does not change the toolbar profile image,
+ // but that's now NavView's problem, not mine.
+ drawer.currentProfile = App.profile.id
+ pausedNavigationData = PausedNavigationData(profileId, navTarget, args)
return false
}
- pausedNavigationData = null
+
+ val loadNavTarget = navTarget ?: this.navTarget
+ if (profile != null && profile.id != App.profileId) {
+ navigateImpl(profile, loadNavTarget, args, profileChanged = true)
+ return true
+ }
+ if (profileId != null && profileId != App.profileId) {
+ app.profileLoad(profileId) {
+ navigateImpl(it, loadNavTarget, args, profileChanged = true)
+ }
+ return true
+ }
+ navigateImpl(App.profile, loadNavTarget, args, profileChanged = false)
+ return true
+ }
+
+ private fun navigateImpl(
+ profile: Profile,
+ navTarget: NavTarget,
+ args: Bundle?,
+ profileChanged: Boolean,
+ ) {
+ d(TAG, "navigateImpl(profileId = ${profile.id}, target = ${navTarget.name}, args = $args)")
+
+ if (navTarget.featureType != null && !profile.hasUIFeature(navTarget.featureType)) {
+ navigateImpl(profile, NavTarget.HOME, args, profileChanged)
+ return
+ }
+
+ if (profileChanged) {
+ if (App.profileId != profile.id)
+ app.profileLoad(profile)
+ MessagesFragment.pageSelection = -1
+ // set new drawer items for this profile
+ setDrawerItems()
+
+ val previousArchivedId = if (app.profile.archived) app.profile.id else null
+ if (previousArchivedId != null) {
+ // prevents accidentally removing the first item if the archived profile is not shown
+ drawer.removeProfileById(previousArchivedId)
+ }
+ if (profile.archived) {
+ // add the same profile but with a different name
+ // (other fields are not needed by the drawer)
+ drawer.prependProfile(Profile(
+ id = profile.id,
+ loginStoreId = profile.loginStoreId,
+ loginStoreType = profile.loginStoreType,
+ name = profile.name,
+ subname = "Archiwum - ${profile.subname}"
+ ).also {
+ it.archived = true
+ })
+ }
+
+ // the drawer profile is updated automatically when the drawer item is clicked
+ // update it manually when switching profiles from other source
+ //if (drawer.currentProfile != app.profile.id)
+ drawer.currentProfile = App.profileId
+ }
val arguments = args
- ?: navBackStack.firstOrNull { it.first.id == target.id }?.second
+ ?: navBackStack.firstOrNull { it.first == navTarget }?.second
?: Bundle()
bottomSheet.close()
bottomSheet.removeAllContextual()
bottomSheet.toggleGroupEnabled = false
drawer.close()
- if (drawer.getSelection() != target.id)
- drawer.setSelection(target.id, fireOnClick = false)
- navView.toolbar.setTitle(target.title ?: target.name)
+ if (drawer.getSelection() != navTarget.id)
+ drawer.setSelection(navTarget.id, fireOnClick = false)
+ navView.toolbar.setTitle(navTarget.titleRes ?: navTarget.nameRes)
navView.bottomBar.fabEnable = false
navView.bottomBar.fabExtended = false
navView.bottomBar.setFabOnClickListener(null)
- d("NavDebug",
- "Navigating from ${navTarget.fragmentClass?.java?.simpleName} to ${target.fragmentClass?.java?.simpleName}")
+ d("NavDebug", "Navigating from ${this.navTarget.name} to ${navTarget.name}")
- val fragment = target.fragmentClass?.java?.newInstance() ?: return false
+ val fragment = navTarget.fragmentClass?.newInstance() ?: return
fragment.arguments = arguments
val transaction = fragmentManager.beginTransaction()
- if (navTarget == target) {
+ if (navTarget == this.navTarget) {
// just reload the current target
transaction.setCustomAnimations(
R.anim.fade_in,
R.anim.fade_out
)
} else {
- navBackStack.keys().lastIndexOf(target).let {
+ navBackStack.keys().lastIndexOf(navTarget).let {
if (it == -1)
- return@let target
+ return@let navTarget
// pop the back stack up until that target
transaction.setCustomAnimations(
R.anim.task_close_enter,
@@ -1271,8 +1016,8 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
for (i in 0 until popCount) {
navBackStack.removeAt(navBackStack.lastIndex)
}
- navTarget = target
- navArguments = arguments
+ this.navTarget = navTarget
+ this.navArguments = arguments
return@let null
}?.let {
@@ -1282,13 +1027,13 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
R.anim.task_open_enter,
R.anim.task_open_exit
)
- navBackStack.add(navTarget to navArguments)
- navTarget = target
- navArguments = arguments
+ navBackStack.add(this.navTarget to this.navArguments)
+ this.navTarget = navTarget
+ this.navArguments = arguments
}
}
- if (navTarget.popToHome) {
+ if (navTarget.popTo == NavTarget.HOME) {
// if the current has popToHome, let only home be in the back stack
// probably `if (navTarget.popToHome)` in popBackStack() is not needed now
val popCount = navBackStack.size - 1
@@ -1297,10 +1042,9 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
}
}
- d("NavDebug",
- "Current fragment ${navTarget.fragmentClass?.java?.simpleName}, pop to home ${navTarget.popToHome}, back stack:")
- navBackStack.forEachIndexed { index, target2 ->
- d("NavDebug", " - $index: ${target2.first.fragmentClass?.java?.simpleName}")
+ d("NavDebug", "Current fragment ${navTarget.name}, back stack:")
+ navBackStack.forEachIndexed { index, item ->
+ d("NavDebug", " - $index: ${item.first.name}")
}
transaction.replace(R.id.fragment, fragment)
@@ -1312,36 +1056,37 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
@Suppress("deprecation")
val taskDesc = ActivityManager.TaskDescription(
- if (target.id == HOME_ID)
+ if (navTarget == NavTarget.HOME)
getString(R.string.app_name)
else
- getString(R.string.app_task_format, getString(target.name)),
+ getString(R.string.app_task_format, getString(navTarget.nameRes)),
bm,
getColorFromAttr(this, R.attr.colorSurface)
)
setTaskDescription(taskDesc)
}
- return true
+ return
}
- fun reloadTarget() = loadTarget(navTarget)
+ fun reloadTarget() = navigate()
private fun popBackStack(skipBeforeNavigate: Boolean = false): Boolean {
if (navBackStack.size == 0) {
return false
}
// TODO back stack argument support
- when {
- navTarget.popToHome -> {
- loadTarget(HOME_ID, skipBeforeNavigate = skipBeforeNavigate)
- }
- navTarget.popTo != null -> {
- loadTarget(navTarget.popTo ?: HOME_ID, skipBeforeNavigate = skipBeforeNavigate)
- }
- else -> {
- navBackStack.last().let {
- loadTarget(it.first, it.second, skipBeforeNavigate = skipBeforeNavigate)
- }
+ if (navTarget.popTo != null) {
+ navigate(
+ navTarget = navTarget.popTo,
+ skipBeforeNavigate = skipBeforeNavigate,
+ )
+ } else {
+ navBackStack.last().let {
+ navigate(
+ navTarget = it.first,
+ args = it.second,
+ skipBeforeNavigate = skipBeforeNavigate,
+ )
}
}
return true
@@ -1396,33 +1141,32 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
| | | | '__/ _` \ \ /\ / / _ \ '__| | | __/ _ \ '_ ` _ \/ __|
| |__| | | | (_| |\ V V / __/ | | | || __/ | | | | \__ \
|_____/|_| \__,_| \_/\_/ \___|_| |_|\__\___|_| |_| |_|__*/
- @Suppress("UNUSED_PARAMETER")
private fun createDrawerItem(target: NavTarget, level: Int = 1): IDrawerItem<*> {
val item = when {
- target.subItems != null -> ExpandableDrawerItem()
+ // target.subItems != null -> ExpandableDrawerItem()
level > 1 -> SecondaryDrawerItem()
else -> DrawerPrimaryItem()
}
item.also {
it.identifier = target.id.toLong()
- it.nameRes = target.name
- it.hiddenInMiniDrawer = !app.config.ui.miniMenuButtons.contains(target.id)
- it.description = target.description?.toStringHolder()
+ it.nameRes = target.nameRes
+ it.descriptionRes = target.descriptionRes ?: -1
it.icon = target.icon?.toImageHolder()
+ it.hiddenInMiniDrawer = !app.config.ui.miniMenuButtons.contains(target)
if (it is DrawerPrimaryItem)
- it.appTitle = target.title?.resolveString(this)
- if (it is ColorfulBadgeable && target.badgeTypeId != null)
+ it.appTitle = target.titleRes?.resolveString(this)
+ if (/* it is ColorfulBadgeable && */ target.badgeType != null)
it.badgeStyle = drawer.badgeStyle
it.isSelectedBackgroundAnimated = false
it.level = level
}
- if (target.badgeTypeId != null)
- drawer.addUnreadCounterType(target.badgeTypeId!!, target.id)
+ if (target.badgeType != null)
+ drawer.addUnreadCounterType(target.badgeType.id, target.id)
- item.subItems = target.subItems?.map {
+ /* item.subItems = target.subItems?.map {
createDrawerItem(it, level + 1)
- }?.toMutableList() ?: mutableListOf()
+ }?.toMutableList() ?: mutableListOf() */
return item
}
@@ -1430,66 +1174,66 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
fun setDrawerItems() {
d("NavDebug", "setDrawerItems() app.profile = ${app.profile}")
val drawerItems = arrayListOf>()
+ val drawerItemsMore = arrayListOf>()
+ val drawerItemsBottom = arrayListOf>()
val drawerProfiles = arrayListOf()
- val supportedFragments = app.profile.supportedFragments
+ for (target in NavTarget.values()) {
+ if (target.devModeOnly && !App.devMode)
+ continue
+ if (target.featureType != null && !app.profile.hasUIFeature(target.featureType))
+ continue
- targetPopToHomeList.clear()
-
- var separatorAdded = false
-
- for (target in navTargetList) {
- if (target.isInDrawer && target.isBelowSeparator && !separatorAdded) {
- separatorAdded = true
- drawerItems += DividerDrawerItem()
- }
-
- if (target.popToHome)
- targetPopToHomeList += target.id
-
- if (target.isInDrawer && (
- target.isStatic
- || supportedFragments.isEmpty()
- || supportedFragments.contains(target.id))
- ) {
- drawerItems += createDrawerItem(target)
- if (target.id == 1) {
- targetHomeId = target.id
+ when (target.location) {
+ NavTargetLocation.DRAWER -> {
+ drawerItems += createDrawerItem(target, level = 1)
}
- }
-
- if (target.isInProfileList) {
- drawerProfiles += ProfileSettingDrawerItem().apply {
- identifier = target.id.toLong()
- nameRes = target.name
- if (target.description != null)
- descriptionRes = target.description!!
- if (target.icon != null)
- withIcon(target.icon!!)
+ NavTargetLocation.DRAWER_MORE -> {
+ drawerItemsMore += createDrawerItem(target, level = 2)
}
+ NavTargetLocation.DRAWER_BOTTOM -> {
+ drawerItemsBottom += createDrawerItem(target, level = 1)
+ }
+ NavTargetLocation.PROFILE_LIST -> {
+ drawerProfiles += ProfileSettingDrawerItem().also {
+ it.identifier = target.id.toLong()
+ it.nameRes = target.nameRes
+ it.descriptionRes = target.descriptionRes ?: -1
+ it.icon = target.icon?.toImageHolder()
+ }
+ }
+ else -> continue
}
}
+ drawerItems += ExpandableDrawerItem().also {
+ it.identifier = -1L
+ it.nameRes = R.string.menu_more
+ it.icon = CommunityMaterial.Icon.cmd_dots_horizontal.toImageHolder()
+ it.subItems = drawerItemsMore.toMutableList()
+ it.isSelectedBackgroundAnimated = false
+ it.isSelectable = false
+ }
+ drawerItems += DividerDrawerItem()
+ drawerItems += drawerItemsBottom
+
// seems that this cannot be open, because the itemAdapter has Profile items
// instead of normal Drawer items...
drawer.profileSelectionClose()
-
drawer.setItems(*drawerItems.toTypedArray())
drawer.removeAllProfileSettings()
drawer.addProfileSettings(*drawerProfiles.toTypedArray())
}
- private val targetPopToHomeList = arrayListOf()
- private var targetHomeId: Int = -1
override fun onBackPressed() {
- if (!b.navView.onBackPressed()) {
- if (App.config.ui.openDrawerOnBackPressed && ((navTarget.popTo == null && navTarget.popToHome)
- || navTarget.id == DRAWER_ITEM_HOME)
- ) {
- b.navView.drawer.toggle()
- } else {
+ if (App.config.ui.openDrawerOnBackPressed) {
+ if (drawer.isOpen)
+ navigateUp()
+ else if (!navView.onBackPressed())
+ drawer.open()
+ } else {
+ if (!navView.onBackPressed())
navigateUp()
- }
}
}
diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/config/AbstractConfig.kt b/app/src/main/java/pl/szczodrzynski/edziennik/config/AbstractConfig.kt
deleted file mode 100644
index d597a119..00000000
--- a/app/src/main/java/pl/szczodrzynski/edziennik/config/AbstractConfig.kt
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- * Copyright (c) Kuba Szczodrzyński 2019-11-27.
- */
-
-package pl.szczodrzynski.edziennik.config
-
-interface AbstractConfig {
- fun set(key: String, value: String?)
-}
\ No newline at end of file
diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/config/AppData.kt b/app/src/main/java/pl/szczodrzynski/edziennik/config/AppData.kt
new file mode 100644
index 00000000..6f72b82e
--- /dev/null
+++ b/app/src/main/java/pl/szczodrzynski/edziennik/config/AppData.kt
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) Kuba Szczodrzyński 2022-10-21.
+ */
+
+package pl.szczodrzynski.edziennik.config
+
+import com.google.gson.Gson
+import com.google.gson.JsonObject
+import com.google.gson.JsonParser
+import com.google.gson.stream.JsonReader
+import pl.szczodrzynski.edziennik.App
+import pl.szczodrzynski.edziennik.R
+import pl.szczodrzynski.edziennik.data.db.enums.LoginType
+import pl.szczodrzynski.edziennik.ext.getJsonObject
+import pl.szczodrzynski.edziennik.ext.mergeWith
+import pl.szczodrzynski.edziennik.utils.managers.TextStylingManager.HtmlMode
+
+data class AppData(
+ val configOverrides: Map,
+ val messagesConfig: MessagesConfig,
+ val uiConfig: UIConfig,
+ val eventTypes: List,
+) {
+ companion object {
+ private var data: JsonObject? = null
+ private val appData = mutableMapOf()
+
+ fun read(app: App) {
+ val res = app.resources.openRawResource(R.raw.app_data)
+ data = JsonParser.parseReader(JsonReader(res.reader())).asJsonObject
+ }
+
+ fun get(loginType: LoginType): AppData {
+ if (loginType in appData)
+ return appData.getValue(loginType)
+ val json = data?.getJsonObject("base")?.deepCopy()
+ ?: throw NoSuchElementException("Base data not found")
+ val overrides = setOf(loginType, loginType.schoolType)
+ for (overrideType in overrides) {
+ val override = data?.getJsonObject(overrideType.name.lowercase()) ?: continue
+ json.mergeWith(override)
+ }
+ val value = Gson().fromJson(json, AppData::class.java)
+ appData[loginType] = value
+ return value
+ }
+ }
+
+ data class MessagesConfig(
+ val subjectLength: Int?,
+ val bodyLength: Int?,
+ val textStyling: Boolean,
+ val syncRecipientList: Boolean,
+ val htmlMode: HtmlMode,
+ val needsReadStatus: Boolean,
+ )
+
+ data class UIConfig(
+ val lessonHeight: Int,
+ val enableMarkAsReadAnnouncements: Boolean,
+ val enableNoticePoints: Boolean,
+ )
+
+ data class EventType(
+ val id: Int,
+ val color: String,
+ val name: String,
+ )
+}
diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/config/BaseConfig.kt b/app/src/main/java/pl/szczodrzynski/edziennik/config/BaseConfig.kt
new file mode 100644
index 00000000..69d232c5
--- /dev/null
+++ b/app/src/main/java/pl/szczodrzynski/edziennik/config/BaseConfig.kt
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) Kuba Szczodrzyński 2019-11-27.
+ */
+
+package pl.szczodrzynski.edziennik.config
+
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.Job
+import kotlinx.coroutines.launch
+import pl.szczodrzynski.edziennik.config.db.ConfigEntry
+import pl.szczodrzynski.edziennik.data.db.AppDb
+import pl.szczodrzynski.edziennik.ext.takePositive
+import kotlin.coroutines.CoroutineContext
+
+abstract class BaseConfig(
+ @Transient
+ val db: AppDb,
+ val profileId: Int? = null,
+ protected var entries: List? = null,
+) : CoroutineScope {
+
+ private val job = Job()
+ override val coroutineContext: CoroutineContext
+ get() = job + Dispatchers.Default
+
+ val values = hashMapOf()
+
+ init {
+ if (entries == null)
+ entries = db.configDao().getAllNow()
+ values.clear()
+ for ((profileId, key, value) in entries!!) {
+ if (profileId.takePositive() != this.profileId)
+ continue
+ values[key] = value
+ }
+ }
+
+ fun set(key: String, value: String?) {
+ values[key] = value
+ launch(Dispatchers.IO) {
+ db.configDao().add(ConfigEntry(profileId ?: -1, key, value))
+ }
+ }
+}
diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/config/Config.kt b/app/src/main/java/pl/szczodrzynski/edziennik/config/Config.kt
index e29d93ad..54530a4e 100644
--- a/app/src/main/java/pl/szczodrzynski/edziennik/config/Config.kt
+++ b/app/src/main/java/pl/szczodrzynski/edziennik/config/Config.kt
@@ -5,151 +5,59 @@
package pl.szczodrzynski.edziennik.config
import com.google.gson.JsonObject
-import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.Job
-import kotlinx.coroutines.launch
import pl.szczodrzynski.edziennik.App
import pl.szczodrzynski.edziennik.BuildConfig
-import pl.szczodrzynski.edziennik.config.db.ConfigEntry
import pl.szczodrzynski.edziennik.config.utils.*
import pl.szczodrzynski.edziennik.data.api.szkolny.response.Update
import pl.szczodrzynski.edziennik.data.db.AppDb
-import kotlin.coroutines.CoroutineContext
-class Config(val db: AppDb) : CoroutineScope, AbstractConfig {
+@Suppress("RemoveExplicitTypeArguments")
+class Config(db: AppDb) : BaseConfig(db) {
companion object {
const val DATA_VERSION = 12
}
- private val job = Job()
- override val coroutineContext: CoroutineContext
- get() = job + Dispatchers.Default
-
- val values: HashMap = hashMapOf()
+ private val profileConfigs: HashMap = hashMapOf()
val ui by lazy { ConfigUI(this) }
val sync by lazy { ConfigSync(this) }
val timetable by lazy { ConfigTimetable(this) }
val grades by lazy { ConfigGrades(this) }
- private var mDataVersion: Int? = null
- var dataVersion: Int
- get() { mDataVersion = mDataVersion ?: values.get("dataVersion", 0); return mDataVersion ?: 0 }
- set(value) { set("dataVersion", value); mDataVersion = value }
+ var dataVersion by config(DATA_VERSION)
+ var hash by config("")
- private var mHash: String? = null
- var hash: String
- get() { mHash = mHash ?: values.get("hash", ""); return mHash ?: "" }
- set(value) { set("hash", value); mHash = value }
+ var lastProfileId by config(0)
+ var loginFinished by config(false)
+ var privacyPolicyAccepted by config(false)
+ var update by config(null)
+ var updatesChannel by config("release")
- private var mLastProfileId: Int? = null
- var lastProfileId: Int
- get() { mLastProfileId = mLastProfileId ?: values.get("lastProfileId", 0); return mLastProfileId ?: 0 }
- set(value) { set("lastProfileId", value); mLastProfileId = value }
+ var devMode by config(null)
+ var devModePassword by config(null)
+ var enableChucker by config(null)
- private var mUpdatesChannel: String? = null
- var updatesChannel: String
- get() { mUpdatesChannel = mUpdatesChannel ?: values.get("updatesChannel", "release"); return mUpdatesChannel ?: "release" }
- set(value) { set("updatesChannel", value); mUpdatesChannel = value }
- private var mUpdate: Update? = null
- var update: Update?
- get() { mUpdate = mUpdate ?: values.get("update", null as Update?); return mUpdate ?: null as Update? }
- set(value) { set("update", value); mUpdate = value }
+ var apiAvailabilityCheck by config(true)
+ var apiInvalidCert by config(null)
+ var apiKeyCustom by config(null)
+ var appInstalledTime by config(0L)
+ var appRateSnackbarTime by config(0L)
+ var appVersion by config(BuildConfig.VERSION_CODE)
+ var validation by config(null, "buildValidation")
- private var mAppVersion: Int? = null
- var appVersion: Int
- get() { mAppVersion = mAppVersion ?: values.get("appVersion", BuildConfig.VERSION_CODE); return mAppVersion ?: BuildConfig.VERSION_CODE }
- set(value) { set("appVersion", value); mAppVersion = value }
+ var archiverEnabled by config(true)
+ var runSync by config(false)
+ var widgetConfigs by config { JsonObject() }
- private var mLoginFinished: Boolean? = null
- var loginFinished: Boolean
- get() { mLoginFinished = mLoginFinished ?: values.get("loginFinished", false); return mLoginFinished ?: false }
- set(value) { set("loginFinished", value); mLoginFinished = value }
-
- private var mPrivacyPolicyAccepted: Boolean? = null
- var privacyPolicyAccepted: Boolean
- get() { mPrivacyPolicyAccepted = mPrivacyPolicyAccepted ?: values.get("privacyPolicyAccepted", false); return mPrivacyPolicyAccepted ?: false }
- set(value) { set("privacyPolicyAccepted", value); mPrivacyPolicyAccepted = value }
-
- private var mDevMode: Boolean? = null
- var devMode: Boolean?
- get() { mDevMode = mDevMode ?: values.getBooleanOrNull("debugMode"); return mDevMode }
- set(value) { set("debugMode", value?.toString()); mDevMode = value }
-
- private var mEnableChucker: Boolean? = null
- var enableChucker: Boolean?
- get() { mEnableChucker = mEnableChucker ?: values.getBooleanOrNull("enableChucker"); return mEnableChucker }
- set(value) { set("enableChucker", value?.toString()); mEnableChucker = value }
-
- private var mDevModePassword: String? = null
- var devModePassword: String?
- get() { mDevModePassword = mDevModePassword ?: values.get("devModePassword", null as String?); return mDevModePassword }
- set(value) { set("devModePassword", value); mDevModePassword = value }
-
- private var mAppInstalledTime: Long? = null
- var appInstalledTime: Long
- get() { mAppInstalledTime = mAppInstalledTime ?: values.get("appInstalledTime", 0L); return mAppInstalledTime ?: 0L }
- set(value) { set("appInstalledTime", value); mAppInstalledTime = value }
-
- private var mAppRateSnackbarTime: Long? = null
- var appRateSnackbarTime: Long
- get() { mAppRateSnackbarTime = mAppRateSnackbarTime ?: values.get("appRateSnackbarTime", 0L); return mAppRateSnackbarTime ?: 0L }
- set(value) { set("appRateSnackbarTime", value); mAppRateSnackbarTime = value }
-
- private var mRunSync: Boolean? = null
- var runSync: Boolean
- get() { mRunSync = mRunSync ?: values.get("runSync", false); return mRunSync ?: false }
- set(value) { set("runSync", value); mRunSync = value }
-
- private var mWidgetConfigs: JsonObject? = null
- var widgetConfigs: JsonObject
- get() { mWidgetConfigs = mWidgetConfigs ?: values.get("widgetConfigs", JsonObject()); return mWidgetConfigs ?: JsonObject() }
- set(value) { set("widgetConfigs", value); mWidgetConfigs = value }
-
- private var mArchiverEnabled: Boolean? = null
- var archiverEnabled: Boolean
- get() { mArchiverEnabled = mArchiverEnabled ?: values.get("archiverEnabled", true); return mArchiverEnabled ?: true }
- set(value) { set("archiverEnabled", value); mArchiverEnabled = value }
-
- private var mValidation: String? = null
- var validation: String?
- get() { mValidation = mValidation ?: values["buildValidation"]; return mValidation }
- set(value) { set("buildValidation", value); mValidation = value }
-
- private var mApiInvalidCert: String? = null
- var apiInvalidCert: String?
- get() { mApiInvalidCert = mApiInvalidCert ?: values["apiInvalidCert"]; return mApiInvalidCert }
- set(value) { set("apiInvalidCert", value); mApiInvalidCert = value }
-
- private var mApiAvailabilityCheck: Boolean? = null
- var apiAvailabilityCheck: Boolean
- get() { mApiAvailabilityCheck = mApiAvailabilityCheck ?: values.get("apiAvailabilityCheck", true); return mApiAvailabilityCheck ?: true }
- set(value) { set("apiAvailabilityCheck", value); mApiAvailabilityCheck = value }
-
- private var rawEntries: List = db.configDao().getAllNow()
- private val profileConfigs: HashMap = hashMapOf()
- init {
- rawEntries.toHashMap(-1, values)
- }
fun migrate(app: App) {
- if (dataVersion < DATA_VERSION)
+ if (dataVersion < DATA_VERSION || hash == "")
+ // migrate old data version OR freshly installed app (or updated from 3.x)
ConfigMigration(app, this)
}
- fun getFor(profileId: Int): ProfileConfig {
- return profileConfigs[profileId] ?: ProfileConfig(db, profileId, db.configDao().getAllNow(profileId)).also {
+
+ operator fun get(profileId: Int): ProfileConfig {
+ return profileConfigs[profileId] ?: ProfileConfig(db, profileId, entries).also {
profileConfigs[profileId] = it
}
}
- fun forProfile() = getFor(App.profileId)
-
- fun setProfile(profileId: Int) {
- }
-
- override fun set(key: String, value: String?) {
- values[key] = value
- launch {
- db.configDao().add(ConfigEntry(-1, key, value))
- }
- }
}
diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/config/ConfigGrades.kt b/app/src/main/java/pl/szczodrzynski/edziennik/config/ConfigGrades.kt
index 267ec322..a28dcc3d 100644
--- a/app/src/main/java/pl/szczodrzynski/edziennik/config/ConfigGrades.kt
+++ b/app/src/main/java/pl/szczodrzynski/edziennik/config/ConfigGrades.kt
@@ -4,13 +4,10 @@
package pl.szczodrzynski.edziennik.config
-import pl.szczodrzynski.edziennik.config.utils.get
-import pl.szczodrzynski.edziennik.config.utils.set
-import pl.szczodrzynski.edziennik.utils.managers.GradesManager
+import pl.szczodrzynski.edziennik.utils.managers.GradesManager.Companion.ORDER_BY_DATE_DESC
-class ConfigGrades(private val config: Config) {
- private var mOrderBy: Int? = null
- var orderBy: Int
- get() { mOrderBy = mOrderBy ?: config.values.get("gradesOrderBy", 0); return mOrderBy ?: GradesManager.ORDER_BY_DATE_DESC }
- set(value) { config.set("gradesOrderBy", value); mOrderBy = value }
+@Suppress("RemoveExplicitTypeArguments")
+class ConfigGrades(base: Config) {
+
+ var orderBy by base.config("gradesOrderBy", ORDER_BY_DATE_DESC)
}
diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/config/ConfigSync.kt b/app/src/main/java/pl/szczodrzynski/edziennik/config/ConfigSync.kt
index 387e5cf7..6688838b 100644
--- a/app/src/main/java/pl/szczodrzynski/edziennik/config/ConfigSync.kt
+++ b/app/src/main/java/pl/szczodrzynski/edziennik/config/ConfigSync.kt
@@ -4,139 +4,53 @@
package pl.szczodrzynski.edziennik.config
-import com.google.gson.Gson
-import com.google.gson.reflect.TypeToken
import pl.szczodrzynski.edziennik.BuildConfig
-import pl.szczodrzynski.edziennik.config.utils.get
-import pl.szczodrzynski.edziennik.config.utils.getIntList
-import pl.szczodrzynski.edziennik.config.utils.set
-import pl.szczodrzynski.edziennik.config.utils.setMap
import pl.szczodrzynski.edziennik.data.api.szkolny.response.RegisterAvailabilityStatus
+import pl.szczodrzynski.edziennik.ext.HOUR
import pl.szczodrzynski.edziennik.utils.models.Time
-class ConfigSync(private val config: Config) {
- private val gson = Gson()
+@Suppress("RemoveExplicitTypeArguments")
+class ConfigSync(base: Config) {
- private var mDontShowAppManagerDialog: Boolean? = null
- var dontShowAppManagerDialog: Boolean
- get() { mDontShowAppManagerDialog = mDontShowAppManagerDialog ?: config.values.get("dontShowAppManagerDialog", false); return mDontShowAppManagerDialog ?: false }
- set(value) { config.set("dontShowAppManagerDialog", value); mDontShowAppManagerDialog = value }
+ var enabled by base.config("syncEnabled", true)
+ var interval by base.config("syncInterval", 1 * HOUR.toInt())
+ var onlyWifi by base.config("syncOnlyWifi", false)
- private var mSyncEnabled: Boolean? = null
- var enabled: Boolean
- get() { mSyncEnabled = mSyncEnabled ?: config.values.get("syncEnabled", true); return mSyncEnabled ?: true }
- set(value) { config.set("syncEnabled", value); mSyncEnabled = value }
+ var dontShowAppManagerDialog by base.config(false)
+ var lastAppSync by base.config(0L)
+ var notifyAboutUpdates by base.config(true)
+ var webPushEnabled by base.config(true)
- private var mWebPushEnabled: Boolean? = null
- var webPushEnabled: Boolean
- get() { mWebPushEnabled = mWebPushEnabled ?: config.values.get("webPushEnabled", true); return mWebPushEnabled ?: true }
- set(value) { config.set("webPushEnabled", value); mWebPushEnabled = value }
+ // Quiet Hours
+ var quietHoursEnabled by base.config(false)
+ var quietHoursStart by base.config