From da9ccf6d29e749d4eb67271eb9917dd598dd5278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Sun, 13 Oct 2019 20:06:45 +0200 Subject: [PATCH] [APIv2] Update Feature lists and progress strings. --- .../edziennik/api/v2/librus/LibrusFeatures.kt | 99 ++++++++++++++- .../api/v2/librus/data/LibrusData.kt | 16 +-- .../v2/mobidziennik/MobidziennikFeatures.kt | 120 ++++++++---------- app/src/main/res/values/strings.xml | 4 + 4 files changed, 160 insertions(+), 79 deletions(-) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/LibrusFeatures.kt b/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/LibrusFeatures.kt index a71b74d7..a565cb38 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/LibrusFeatures.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/LibrusFeatures.kt @@ -5,6 +5,7 @@ package pl.szczodrzynski.edziennik.api.v2.librus import pl.szczodrzynski.edziennik.api.v2.* +import pl.szczodrzynski.edziennik.api.v2.librus.data.LibrusData import pl.szczodrzynski.edziennik.api.v2.models.Feature const val ENDPOINT_LIBRUS_API_ME = 1001 @@ -15,6 +16,7 @@ const val ENDPOINT_LIBRUS_API_UNITS = 1005 const val ENDPOINT_LIBRUS_API_USERS = 1006 const val ENDPOINT_LIBRUS_API_SUBJECTS = 1007 const val ENDPOINT_LIBRUS_API_CLASSROOMS = 1008 +const val ENDPOINT_LIBRUS_API_PUSH_CONFIG = 1010 const val ENDPOINT_LIBRUS_API_TIMETABLES = 1015 const val ENDPOINT_LIBRUS_API_SUBSTITUTIONS = 1016 const val ENDPOINT_LIBRUS_API_NORMAL_GC = 1021 @@ -51,11 +53,28 @@ const val ENDPOINT_LIBRUS_MESSAGES_GET = 3040 val LibrusFeatures = listOf( - // LIBRUS: API + // push config + Feature(LOGIN_TYPE_LIBRUS, FEATURE_PUSH_CONFIG, listOf( + ENDPOINT_LIBRUS_API_PUSH_CONFIG to LOGIN_METHOD_LIBRUS_API + ), listOf(LOGIN_METHOD_LIBRUS_API)).withShouldSync { data -> + data.app.appConfig.fcmTokens[LOGIN_TYPE_LIBRUS]?.second?.contains(data.profileId) == false + }, + + + + + + /** + * Timetable - using API. + */ Feature(LOGIN_TYPE_LIBRUS, FEATURE_TIMETABLE, listOf( ENDPOINT_LIBRUS_API_TIMETABLES to LOGIN_METHOD_LIBRUS_API, ENDPOINT_LIBRUS_API_SUBSTITUTIONS to LOGIN_METHOD_LIBRUS_API ), listOf(LOGIN_METHOD_LIBRUS_API)), + /** + * Agenda - using API. + * Events, Parent-teacher meetings, free days (teacher/school/class). + */ Feature(LOGIN_TYPE_LIBRUS, FEATURE_AGENDA, listOf( ENDPOINT_LIBRUS_API_EVENTS to LOGIN_METHOD_LIBRUS_API, ENDPOINT_LIBRUS_API_EVENT_TYPES to LOGIN_METHOD_LIBRUS_API, @@ -64,6 +83,10 @@ val LibrusFeatures = listOf( ENDPOINT_LIBRUS_API_SCHOOL_FREE_DAYS to LOGIN_METHOD_LIBRUS_API, ENDPOINT_LIBRUS_API_CLASS_FREE_DAYS to LOGIN_METHOD_LIBRUS_API ), listOf(LOGIN_METHOD_LIBRUS_API)), + /** + * Grades - using API. + * All grades + categories. + */ Feature(LOGIN_TYPE_LIBRUS, FEATURE_GRADES, listOf( ENDPOINT_LIBRUS_API_NORMAL_GC to LOGIN_METHOD_LIBRUS_API, ENDPOINT_LIBRUS_API_POINT_GC to LOGIN_METHOD_LIBRUS_API, @@ -78,65 +101,127 @@ val LibrusFeatures = listOf( ENDPOINT_LIBRUS_API_DESCRIPTIVE_TEXT_GRADES to LOGIN_METHOD_LIBRUS_API, ENDPOINT_LIBRUS_API_BEHAVIOUR_GRADES to LOGIN_METHOD_LIBRUS_API ), listOf(LOGIN_METHOD_LIBRUS_API)), + /** + * Homework - using API. + * Sync only if account has premium access. + */ Feature(LOGIN_TYPE_LIBRUS, FEATURE_HOMEWORK, listOf( ENDPOINT_LIBRUS_API_HOMEWORK to LOGIN_METHOD_LIBRUS_API - ), listOf(LOGIN_METHOD_LIBRUS_API)), + ), listOf(LOGIN_METHOD_LIBRUS_API)).withShouldSync { data -> + (data as DataLibrus).isPremium + }, + /** + * Behaviour - using API. + */ Feature(LOGIN_TYPE_LIBRUS, FEATURE_BEHAVIOUR, listOf( ENDPOINT_LIBRUS_API_NOTICES to LOGIN_METHOD_LIBRUS_API ), listOf(LOGIN_METHOD_LIBRUS_API)), + /** + * Attendance - using API. + */ Feature(LOGIN_TYPE_LIBRUS, FEATURE_ATTENDANCE, listOf( ENDPOINT_LIBRUS_API_ATTENDANCE_TYPES to LOGIN_METHOD_LIBRUS_API, ENDPOINT_LIBRUS_API_ATTENDANCES to LOGIN_METHOD_LIBRUS_API ), listOf(LOGIN_METHOD_LIBRUS_API)), + /** + * Announcements - using API. + */ Feature(LOGIN_TYPE_LIBRUS, FEATURE_ANNOUNCEMENTS, listOf( ENDPOINT_LIBRUS_API_ANNOUNCEMENTS to LOGIN_METHOD_LIBRUS_API ), listOf(LOGIN_METHOD_LIBRUS_API)), + + + + + + /** + * Student info - using API. + */ Feature(LOGIN_TYPE_LIBRUS, FEATURE_STUDENT_INFO, listOf( ENDPOINT_LIBRUS_API_ME to LOGIN_METHOD_LIBRUS_API ), listOf(LOGIN_METHOD_LIBRUS_API)), + /** + * School info - using API. + */ Feature(LOGIN_TYPE_LIBRUS, FEATURE_SCHOOL_INFO, listOf( ENDPOINT_LIBRUS_API_SCHOOLS to LOGIN_METHOD_LIBRUS_API, ENDPOINT_LIBRUS_API_UNITS to LOGIN_METHOD_LIBRUS_API ), listOf(LOGIN_METHOD_LIBRUS_API)), + /** + * Class info - using API. + */ Feature(LOGIN_TYPE_LIBRUS, FEATURE_CLASS_INFO, listOf( ENDPOINT_LIBRUS_API_CLASSES to LOGIN_METHOD_LIBRUS_API ), listOf(LOGIN_METHOD_LIBRUS_API)), + /** + * Team info - using API. + */ Feature(LOGIN_TYPE_LIBRUS, FEATURE_TEAM_INFO, listOf( ENDPOINT_LIBRUS_API_VIRTUAL_CLASSES to LOGIN_METHOD_LIBRUS_API ), listOf(LOGIN_METHOD_LIBRUS_API)), + /** + * Lucky number - using API. + */ Feature(LOGIN_TYPE_LIBRUS, FEATURE_LUCKY_NUMBER, listOf( ENDPOINT_LIBRUS_API_LUCKY_NUMBER to LOGIN_METHOD_LIBRUS_API ), listOf(LOGIN_METHOD_LIBRUS_API)), + /** + * Teacher list - using API. + */ Feature(LOGIN_TYPE_LIBRUS, FEATURE_TEACHERS, listOf( ENDPOINT_LIBRUS_API_USERS to LOGIN_METHOD_LIBRUS_API ), listOf(LOGIN_METHOD_LIBRUS_API)), + /** + * Subject list - using API. + */ Feature(LOGIN_TYPE_LIBRUS, FEATURE_SUBJECTS, listOf( ENDPOINT_LIBRUS_API_SUBJECTS to LOGIN_METHOD_LIBRUS_API ), listOf(LOGIN_METHOD_LIBRUS_API)), + /** + * Classroom list - using API. + */ Feature(LOGIN_TYPE_LIBRUS, FEATURE_CLASSROOMS, listOf( ENDPOINT_LIBRUS_API_CLASSROOMS to LOGIN_METHOD_LIBRUS_API ), listOf(LOGIN_METHOD_LIBRUS_API)), + /** + * Student info - using synergia scrapper. + */ Feature(LOGIN_TYPE_LIBRUS, FEATURE_STUDENT_INFO, listOf( ENDPOINT_LIBRUS_SYNERGIA_INFO to LOGIN_METHOD_LIBRUS_SYNERGIA ), listOf(LOGIN_METHOD_LIBRUS_SYNERGIA)), + /** + * Student number - using synergia scrapper. + */ Feature(LOGIN_TYPE_LIBRUS, FEATURE_STUDENT_NUMBER, listOf( ENDPOINT_LIBRUS_SYNERGIA_INFO to LOGIN_METHOD_LIBRUS_SYNERGIA ), listOf(LOGIN_METHOD_LIBRUS_SYNERGIA)), + + + /** + * Grades - using API + synergia scrapper. + */ + /*Feature(LOGIN_TYPE_LIBRUS, FEATURE_GRADES, listOf( + ENDPOINT_LIBRUS_API_NORMAL_GC to LOGIN_METHOD_LIBRUS_API, + ENDPOINT_LIBRUS_API_NORMAL_GRADES to LOGIN_METHOD_LIBRUS_API, + ENDPOINT_LIBRUS_SYNERGIA_GRADES to LOGIN_METHOD_LIBRUS_SYNERGIA + ), listOf(LOGIN_METHOD_LIBRUS_API, LOGIN_METHOD_LIBRUS_SYNERGIA)),*/ /*Endpoint(LOGIN_TYPE_LIBRUS, FEATURE_GRADES, listOf( ENDPOINT_LIBRUS_SYNERGIA_GRADES to LOGIN_METHOD_LIBRUS_SYNERGIA ), listOf(LOGIN_METHOD_LIBRUS_SYNERGIA)),*/ - Feature(LOGIN_TYPE_LIBRUS, FEATURE_GRADES, listOf( - ENDPOINT_LIBRUS_API_NORMAL_GC to LOGIN_METHOD_LIBRUS_API, - ENDPOINT_LIBRUS_API_NORMAL_GRADES to LOGIN_METHOD_LIBRUS_API, - ENDPOINT_LIBRUS_SYNERGIA_GRADES to LOGIN_METHOD_LIBRUS_SYNERGIA - ), listOf(LOGIN_METHOD_LIBRUS_API, LOGIN_METHOD_LIBRUS_SYNERGIA)), + + /** + * Messages inbox - using messages website. + */ Feature(LOGIN_TYPE_LIBRUS, FEATURE_MESSAGES_INBOX, listOf( ENDPOINT_LIBRUS_MESSAGES_RECEIVED to LOGIN_METHOD_LIBRUS_MESSAGES ), listOf(LOGIN_METHOD_LIBRUS_MESSAGES)), + /** + * Messages sent - using messages website. + */ Feature(LOGIN_TYPE_LIBRUS, FEATURE_MESSAGES_SENT, listOf( ENDPOINT_LIBRUS_MESSAGES_SENT to LOGIN_METHOD_LIBRUS_MESSAGES ), listOf(LOGIN_METHOD_LIBRUS_MESSAGES)) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/data/LibrusData.kt b/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/data/LibrusData.kt index 3420730b..16c944fe 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/data/LibrusData.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/data/LibrusData.kt @@ -36,35 +36,35 @@ class LibrusData(val data: DataLibrus, val onSuccess: () -> Unit) { Utils.d(TAG, "Using endpoint $endpointId") when (endpointId) { ENDPOINT_LIBRUS_API_ME -> { - data.startProgress(R.string.sync_action_getting_account) + data.startProgress(R.string.edziennik_progress_endpoint_student_info) LibrusApiMe(data) { onSuccess() } } ENDPOINT_LIBRUS_API_SCHOOLS -> { - data.startProgress(R.string.sync_action_syncing_school_info) + data.startProgress(R.string.edziennik_progress_endpoint_school_info) LibrusApiSchools(data) { onSuccess() } } ENDPOINT_LIBRUS_API_NORMAL_GRADES -> { - data.startProgress(R.string.sync_action_syncing_grades) + data.startProgress(R.string.edziennik_progress_endpoint_grades) LibrusApiGrades(data) { onSuccess() } } ENDPOINT_LIBRUS_API_EVENTS -> { - data.startProgress(R.string.sync_action_syncing_events) + data.startProgress(R.string.edziennik_progress_endpoint_events) LibrusApiEvents(data) { onSuccess() } } ENDPOINT_LIBRUS_API_HOMEWORK -> { - data.startProgress(R.string.sync_action_syncing_homework) + data.startProgress(R.string.edziennik_progress_endpoint_homework) LibrusApiHomework(data) { onSuccess() } } ENDPOINT_LIBRUS_API_ATTENDANCE_TYPES -> { - data.startProgress(R.string.sync_action_syncing_attendance_types) + data.startProgress(R.string.edziennik_progress_endpoint_attendance_types) LibrusApiAttendanceTypes(data) { onSuccess() } } ENDPOINT_LIBRUS_API_ATTENDANCES -> { - data.startProgress(R.string.sync_action_syncing_attendance) + data.startProgress(R.string.edziennik_progress_endpoint_attendance) LibrusApiAttendances(data) { onSuccess() } } ENDPOINT_LIBRUS_API_ANNOUNCEMENTS -> { - data.startProgress(R.string.sync_action_syncing_announcements) + data.startProgress(R.string.edziennik_progress_endpoint_announcements) LibrusApiAnnouncements(data) { onSuccess() } } else -> onSuccess() diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/mobidziennik/MobidziennikFeatures.kt b/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/mobidziennik/MobidziennikFeatures.kt index 0e92fe6d..788ad4af 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/mobidziennik/MobidziennikFeatures.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/mobidziennik/MobidziennikFeatures.kt @@ -5,6 +5,7 @@ package pl.szczodrzynski.edziennik.api.v2.mobidziennik import pl.szczodrzynski.edziennik.api.v2.* +import pl.szczodrzynski.edziennik.api.v2.librus.ENDPOINT_LIBRUS_API_PUSH_CONFIG import pl.szczodrzynski.edziennik.api.v2.models.Feature const val ENDPOINT_MOBIDZIENNIK_API_MAIN = 1000 @@ -20,80 +21,71 @@ const val ENDPOINT_MOBIDZIENNIK_WEB_ACCOUNT_EMAIL = 2200 const val ENDPOINT_MOBIDZIENNIK_API2_MAIN = 3000 val MobidziennikFeatures = listOf( - // timetable - Feature(LOGIN_TYPE_MOBIDZIENNIK, FEATURE_TIMETABLE, listOf( - ENDPOINT_MOBIDZIENNIK_API_MAIN to LOGIN_METHOD_MOBIDZIENNIK_WEB - ), listOf(LOGIN_METHOD_MOBIDZIENNIK_WEB)), - // agenda - Feature(LOGIN_TYPE_MOBIDZIENNIK, FEATURE_AGENDA, listOf( - ENDPOINT_MOBIDZIENNIK_API_MAIN to LOGIN_METHOD_MOBIDZIENNIK_WEB, - ENDPOINT_MOBIDZIENNIK_WEB_CALENDAR to LOGIN_METHOD_MOBIDZIENNIK_WEB - ), listOf(LOGIN_METHOD_MOBIDZIENNIK_WEB, LOGIN_METHOD_MOBIDZIENNIK_WEB)), - // grades - Feature(LOGIN_TYPE_MOBIDZIENNIK, FEATURE_GRADES, listOf( - ENDPOINT_MOBIDZIENNIK_API_MAIN to LOGIN_METHOD_MOBIDZIENNIK_WEB, - ENDPOINT_MOBIDZIENNIK_WEB_GRADES to LOGIN_METHOD_MOBIDZIENNIK_WEB - ), listOf(LOGIN_METHOD_MOBIDZIENNIK_WEB, LOGIN_METHOD_MOBIDZIENNIK_WEB)), - // homework - Feature(LOGIN_TYPE_MOBIDZIENNIK, FEATURE_HOMEWORK, listOf( - ENDPOINT_MOBIDZIENNIK_API_MAIN to LOGIN_METHOD_MOBIDZIENNIK_WEB - ), listOf(LOGIN_METHOD_MOBIDZIENNIK_WEB)), - // behaviour - Feature(LOGIN_TYPE_MOBIDZIENNIK, FEATURE_BEHAVIOUR, listOf( - ENDPOINT_MOBIDZIENNIK_API_MAIN to LOGIN_METHOD_MOBIDZIENNIK_WEB, - ENDPOINT_MOBIDZIENNIK_WEB_NOTICES to LOGIN_METHOD_MOBIDZIENNIK_WEB - ), listOf(LOGIN_METHOD_MOBIDZIENNIK_WEB, LOGIN_METHOD_MOBIDZIENNIK_WEB)), - // attendance - Feature(LOGIN_TYPE_MOBIDZIENNIK, FEATURE_ATTENDANCE, listOf( - ENDPOINT_MOBIDZIENNIK_WEB_ATTENDANCE to LOGIN_METHOD_MOBIDZIENNIK_WEB - ), listOf(LOGIN_METHOD_MOBIDZIENNIK_WEB)), - - // messages - Feature(LOGIN_TYPE_MOBIDZIENNIK, FEATURE_MESSAGES_INBOX, listOf( - ENDPOINT_MOBIDZIENNIK_WEB_MESSAGES_INBOX to LOGIN_METHOD_MOBIDZIENNIK_WEB, - ENDPOINT_MOBIDZIENNIK_WEB_MESSAGES_ALL to LOGIN_METHOD_MOBIDZIENNIK_WEB - ), listOf(LOGIN_METHOD_MOBIDZIENNIK_WEB)), - Feature(LOGIN_TYPE_MOBIDZIENNIK, FEATURE_MESSAGES_SENT, listOf( - ENDPOINT_MOBIDZIENNIK_WEB_MESSAGES_SENT to LOGIN_METHOD_MOBIDZIENNIK_WEB, - ENDPOINT_MOBIDZIENNIK_WEB_MESSAGES_ALL to LOGIN_METHOD_MOBIDZIENNIK_WEB - ), listOf(LOGIN_METHOD_MOBIDZIENNIK_WEB)), - + // always synced Feature(LOGIN_TYPE_MOBIDZIENNIK, FEATURE_ALWAYS_NEEDED, listOf( ENDPOINT_MOBIDZIENNIK_API_MAIN to LOGIN_METHOD_MOBIDZIENNIK_WEB, ENDPOINT_MOBIDZIENNIK_WEB_ACCOUNT_EMAIL to LOGIN_METHOD_MOBIDZIENNIK_WEB ), listOf(LOGIN_METHOD_MOBIDZIENNIK_WEB)), + // push config Feature(LOGIN_TYPE_MOBIDZIENNIK, FEATURE_PUSH_CONFIG, listOf( ENDPOINT_MOBIDZIENNIK_API2_MAIN to LOGIN_METHOD_MOBIDZIENNIK_API2 - ), listOf(LOGIN_METHOD_MOBIDZIENNIK_API2)), - /*Feature(LOGIN_TYPE_MOBIDZIENNIK, FEATURE_STUDENT_INFO, listOf( - ENDPOINT_MOBIDZIENNIK_API_MAIN to LOGIN_METHOD_MOBIDZIENNIK_WEB - ), listOf(LOGIN_METHOD_MOBIDZIENNIK_WEB)), - Feature(LOGIN_TYPE_MOBIDZIENNIK, FEATURE_STUDENT_NUMBER, listOf( - ENDPOINT_MOBIDZIENNIK_API_MAIN to LOGIN_METHOD_MOBIDZIENNIK_WEB - ), listOf(LOGIN_METHOD_MOBIDZIENNIK_WEB)), - Feature(LOGIN_TYPE_MOBIDZIENNIK, FEATURE_SCHOOL_INFO, listOf( - ENDPOINT_MOBIDZIENNIK_API_MAIN to LOGIN_METHOD_MOBIDZIENNIK_WEB - ), listOf(LOGIN_METHOD_MOBIDZIENNIK_WEB)), - Feature(LOGIN_TYPE_MOBIDZIENNIK, FEATURE_CLASS_INFO, listOf( - ENDPOINT_MOBIDZIENNIK_API_MAIN to LOGIN_METHOD_MOBIDZIENNIK_WEB - ), listOf(LOGIN_METHOD_MOBIDZIENNIK_WEB)), - Feature(LOGIN_TYPE_MOBIDZIENNIK, FEATURE_TEAM_INFO, listOf( - ENDPOINT_MOBIDZIENNIK_API_MAIN to LOGIN_METHOD_MOBIDZIENNIK_WEB - ), listOf(LOGIN_METHOD_MOBIDZIENNIK_WEB)), - Feature(LOGIN_TYPE_MOBIDZIENNIK, FEATURE_TEACHERS, listOf( - ENDPOINT_MOBIDZIENNIK_API_MAIN to LOGIN_METHOD_MOBIDZIENNIK_WEB - ), listOf(LOGIN_METHOD_MOBIDZIENNIK_WEB)), - Feature(LOGIN_TYPE_MOBIDZIENNIK, FEATURE_SUBJECTS, listOf( - ENDPOINT_MOBIDZIENNIK_API_MAIN to LOGIN_METHOD_MOBIDZIENNIK_WEB - ), listOf(LOGIN_METHOD_MOBIDZIENNIK_WEB)), - Feature(LOGIN_TYPE_MOBIDZIENNIK, FEATURE_CLASSROOMS, listOf( - ENDPOINT_MOBIDZIENNIK_API_MAIN to LOGIN_METHOD_MOBIDZIENNIK_WEB + ), listOf(LOGIN_METHOD_MOBIDZIENNIK_API2)).withShouldSync { data -> + data.app.appConfig.fcmTokens[LOGIN_TYPE_MOBIDZIENNIK]?.second?.contains(data.profileId) == false + }, + + + + + + /** + * Agenda - "API" + web scraping. + */ + Feature(LOGIN_TYPE_MOBIDZIENNIK, FEATURE_AGENDA, listOf( + ENDPOINT_MOBIDZIENNIK_API_MAIN to LOGIN_METHOD_MOBIDZIENNIK_WEB, + ENDPOINT_MOBIDZIENNIK_WEB_CALENDAR to LOGIN_METHOD_MOBIDZIENNIK_WEB + ), listOf(LOGIN_METHOD_MOBIDZIENNIK_WEB, LOGIN_METHOD_MOBIDZIENNIK_WEB)), + /** + * Grades - "API" + web scraping. + */ + Feature(LOGIN_TYPE_MOBIDZIENNIK, FEATURE_GRADES, listOf( + ENDPOINT_MOBIDZIENNIK_API_MAIN to LOGIN_METHOD_MOBIDZIENNIK_WEB, + ENDPOINT_MOBIDZIENNIK_WEB_GRADES to LOGIN_METHOD_MOBIDZIENNIK_WEB + ), listOf(LOGIN_METHOD_MOBIDZIENNIK_WEB, LOGIN_METHOD_MOBIDZIENNIK_WEB)), + /** + * Behaviour - "API" + web scraping. + */ + Feature(LOGIN_TYPE_MOBIDZIENNIK, FEATURE_BEHAVIOUR, listOf( + ENDPOINT_MOBIDZIENNIK_API_MAIN to LOGIN_METHOD_MOBIDZIENNIK_WEB, + ENDPOINT_MOBIDZIENNIK_WEB_NOTICES to LOGIN_METHOD_MOBIDZIENNIK_WEB + ), listOf(LOGIN_METHOD_MOBIDZIENNIK_WEB, LOGIN_METHOD_MOBIDZIENNIK_WEB)), + // attendance TODO implement website attendance scraping + /*Feature(LOGIN_TYPE_MOBIDZIENNIK, FEATURE_ATTENDANCE, listOf( + ENDPOINT_MOBIDZIENNIK_WEB_ATTENDANCE to LOGIN_METHOD_MOBIDZIENNIK_WEB ), listOf(LOGIN_METHOD_MOBIDZIENNIK_WEB)),*/ + + + + + /** + * Messages inbox - using web scraper. + */ + Feature(LOGIN_TYPE_MOBIDZIENNIK, FEATURE_MESSAGES_INBOX, listOf( + ENDPOINT_MOBIDZIENNIK_WEB_MESSAGES_INBOX to LOGIN_METHOD_MOBIDZIENNIK_WEB, + ENDPOINT_MOBIDZIENNIK_WEB_MESSAGES_ALL to LOGIN_METHOD_MOBIDZIENNIK_WEB + ), listOf(LOGIN_METHOD_MOBIDZIENNIK_WEB)), + /** + * Messages sent - using web scraper. + */ + Feature(LOGIN_TYPE_MOBIDZIENNIK, FEATURE_MESSAGES_SENT, listOf( + ENDPOINT_MOBIDZIENNIK_WEB_MESSAGES_SENT to LOGIN_METHOD_MOBIDZIENNIK_WEB, + ENDPOINT_MOBIDZIENNIK_WEB_MESSAGES_ALL to LOGIN_METHOD_MOBIDZIENNIK_WEB + ), listOf(LOGIN_METHOD_MOBIDZIENNIK_WEB)) + // lucky number possibilities // all endpoints that may supply the lucky number - Feature(LOGIN_TYPE_MOBIDZIENNIK, FEATURE_LUCKY_NUMBER, listOf( + /*Feature(LOGIN_TYPE_MOBIDZIENNIK, FEATURE_LUCKY_NUMBER, listOf( ENDPOINT_MOBIDZIENNIK_WEB_MANUALS to LOGIN_METHOD_MOBIDZIENNIK_WEB ), listOf(LOGIN_METHOD_MOBIDZIENNIK_WEB)).apply { priority = 10 }, @@ -111,6 +103,6 @@ val MobidziennikFeatures = listOf( Feature(LOGIN_TYPE_MOBIDZIENNIK, FEATURE_LUCKY_NUMBER, listOf( ENDPOINT_MOBIDZIENNIK_WEB_ATTENDANCE to LOGIN_METHOD_MOBIDZIENNIK_WEB - ), listOf(LOGIN_METHOD_MOBIDZIENNIK_WEB)).apply { priority = 4 } + ), listOf(LOGIN_METHOD_MOBIDZIENNIK_WEB)).apply { priority = 4 }*/ ) \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4ffc89a7..bba42794 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -939,4 +939,8 @@ Pobieram frekwencję ucznia... Logowanie do Vulcan API... Logowanie do API MobiDziennika... + Pobieranie wydarzeń kalendarza... + Pobieranie zadań domowych... + Pobieranie kategorii obecności... + Pobieranie ogłoszeń szkolnych...