From 165a804ba996a70667ff87054ef43cc340a30226 Mon Sep 17 00:00:00 2001 From: Kacper Ziubryniewicz Date: Sat, 28 Sep 2019 14:37:05 +0200 Subject: [PATCH 1/3] [Structure] Move fragments, activities and adapters to specific modules --- app/src/main/AndroidManifest.xml | 22 ++++++------ .../java/pl/szczodrzynski/edziennik/App.java | 4 +-- .../szczodrzynski/edziennik/MainActivity.kt | 27 +++++++++++---- .../pl/szczodrzynski/edziennik/Notifier.java | 18 +++++----- .../edziennik/WidgetTimetable.java | 10 +++--- .../edziennik/api/Edziennik.java | 4 +-- .../edziennik/api/Iuczniowie.java | 10 +++--- .../szczodrzynski/edziennik/api/Librus.java | 10 +++--- .../edziennik/api/Mobidziennik.java | 10 +++--- .../szczodrzynski/edziennik/api/Vulcan.java | 10 +++--- .../api/interfaces/EdziennikInterface.java | 5 ++- .../edziennik/api/v2/librus/Librus.kt | 6 ++-- .../edziennik/api/v2/models/DataStore.kt | 4 +-- .../edziennik/datamodels/Announcement.java | 2 +- .../edziennik/datamodels/AppDb.java | 2 +- .../edziennik/datamodels/Attendance.java | 4 +-- .../edziennik/datamodels/AttendanceDao.java | 3 +- .../edziennik/datamodels/ConverterDate.java | 2 +- .../edziennik/datamodels/ConverterTime.java | 2 +- .../edziennik/datamodels/Event.java | 4 +-- .../edziennik/datamodels/EventDao.java | 4 +-- .../edziennik/datamodels/Lesson.java | 4 +-- .../edziennik/datamodels/LessonChange.java | 4 +-- .../edziennik/datamodels/LessonChangeDao.java | 4 +-- .../edziennik/datamodels/LessonDao.java | 5 ++- .../edziennik/datamodels/LessonFull.java | 2 +- .../edziennik/datamodels/LuckyNumber.java | 2 +- .../edziennik/datamodels/LuckyNumberDao.java | 2 +- .../edziennik/datamodels/MetadataDao.java | 2 +- .../edziennik/datamodels/Profile.kt | 7 +--- .../sync/MyFirebaseMessagingService.java | 8 ++--- .../{ => ui}/dialogs/GenericDialog.java | 6 +--- .../dialogs/changelog}/ChangelogDialog.java | 2 +- .../dialogs/event}/EventListAdapter.java | 6 ++-- .../dialogs/event}/EventListDialog.java | 15 +++----- .../dialogs/event}/EventManualDialog.java | 8 ++--- .../dialogs/grade}/GradeDetailsDialog.java | 16 ++------- .../lessonchange}/LessonChangeDialog.java | 13 +++---- .../modules}/agenda/LessonChangeEvent.java | 5 ++- .../agenda/LessonChangeEventRenderer.java | 5 +-- .../RegisterAgendaCalendarFragment.java | 6 ++-- .../RegisterAgendaDefaultFragment.java | 16 ++++----- .../announcements}/AnnouncementsAdapter.java | 2 +- .../RegisterAnnouncementsFragment.java | 3 +- .../attendance}/AttendancesAdapter.java | 4 +-- .../RegisterAttendancesFragment.java | 7 ++-- .../modules/base}/CrashActivity.java | 4 +-- .../modules/base}/CrashGtfoActivity.java | 2 +- .../modules/base}/DebugFragment.java | 2 +- .../modules/base}/FeedbackActivity.java | 4 +-- .../modules/base}/FeedbackFragment.kt | 6 ++-- .../modules/base}/HelpFragment.kt | 2 +- .../modules/base}/LoadingFragment.kt | 4 +-- .../modules/base}/TemplateFragment.kt | 2 +- .../modules/grades}/GradesListAdapter.java | 6 ++-- .../modules/grades}/GradesSubjectAdapter.java | 5 +-- .../grades}/RegisterGradesFragment.java | 11 +++--- .../grades/editor}/GradesEditorAdapter.kt | 5 ++- .../grades/editor}/GradesEditorFragment.kt | 3 +- .../modules/home}/CounterActivity.java | 10 +++--- .../modules/home}/HomeFragment.java | 17 +++------- .../modules/home}/HomeTimetableCard.java | 11 +++--- .../modules}/homework/HomeworkAdapter.java | 8 ++--- .../{ => ui/modules}/homework/HomeworkDate.kt | 2 +- .../modules}/homework/HomeworkFragment.kt | 7 ++-- .../modules}/homework/HomeworkListFragment.kt | 4 +-- .../intro/ChangelogIntroActivity.java | 3 +- .../modules}/intro/FragmentSlideMod.java | 4 +-- .../{ => ui/modules}/login/LoginActivity.java | 2 +- .../modules}/login/LoginChooserFragment.java | 4 +-- .../modules}/login/LoginFinishFragment.java | 2 +- .../login/LoginIuczniowieFragment.java | 2 +- .../login/LoginIuczniowieHelpFragment.java | 2 +- .../modules}/login/LoginLibrusFragment.java | 2 +- .../login/LoginLibrusHelpFragment.java | 2 +- .../login/LoginMigrationFragment.java | 6 ++-- .../login/LoginMigrationSyncFragment.java | 2 +- .../login/LoginMobidziennikFragment.java | 2 +- .../login/LoginMobidziennikHelpFragment.java | 2 +- .../modules}/login/LoginProfileObject.java | 2 +- .../modules}/login/LoginProgressFragment.java | 2 +- .../modules}/login/LoginSummaryFragment.java | 2 +- .../login/LoginSyncErrorFragment.java | 3 +- .../modules}/login/LoginSyncFragment.java | 4 +-- .../modules}/login/LoginTemplateFragment.java | 2 +- .../modules}/login/LoginVulcanFragment.java | 4 +-- .../login/LoginVulcanHelpFragment.java | 2 +- .../modules}/messages/MessagesAdapter.java | 5 ++- .../messages/MessagesComposeActivity.java | 2 +- .../messages/MessagesComposeInfo.java | 2 +- .../MessagesComposeSuggestionAdapter.java | 4 +-- .../messages/MessagesDetailsFragment.java | 8 ++--- .../modules}/messages/MessagesFragment.kt | 4 +-- .../messages/MessagesListFragment.java | 2 +- .../modules}/messages/MessagesUtils.java | 4 +-- .../RegisterMessagesWebFragment.java | 2 +- .../modules}/messages/SlideExplode.java | 2 +- .../modules}/messages/Transitions.java | 2 +- .../modules/notices}/NoticesAdapter.kt | 6 ++-- .../notices}/RegisterNoticesFragment.java | 3 +- .../notifications}/NotificationsAdapter.java | 6 ++-- .../RegisterNotificationsFragment.java | 3 +- .../settings}/ProfileManagerFragment.kt | 2 +- .../settings}/SettingsLicenseActivity.kt | 2 +- .../settings}/SettingsNewFragment.java | 12 +++---- .../RegisterTimetableDayFragment.java | 7 ++-- .../timetable}/RegisterTimetableFragment.java | 11 +++--- .../modules/timetable}/TimetableAdapter.java | 9 +++-- .../modules/webpush}/QrScannerActivity.java | 2 +- .../webpush}/WebPushConfigActivity.java | 4 +-- .../{ => utils}/models/AppConfig.java | 2 +- .../edziennik/{ => utils}/models/Date.java | 4 +-- .../{ => utils}/models/Endpoint.java | 4 +-- .../models/ItemGradesSubjectModel.java | 2 +- .../models/ItemTimetableModel.java | 2 +- .../models/ItemWidgetTimetableModel.java | 2 +- .../edziennik/{ => utils}/models/NavTarget.kt | 4 +-- .../{ => utils}/models/Notification.java | 2 +- .../edziennik/{ => utils}/models/Time.java | 2 +- .../edziennik/{ => utils}/models/Week.java | 16 ++++----- .../models/db/LessonChangeCounter.java | 4 +-- .../{ => utils}/models/db/UnreadCounter.kt | 2 +- .../widgets/WidgetConfigActivity.java | 8 ----- .../luckynumber/WidgetLuckyNumber.java | 2 +- .../WidgetNotificationsListProvider.java | 7 ++-- .../timetable/LessonDetailsActivity.java | 8 ++--- .../WidgetTimetableListProvider.java | 8 ++--- .../timetable/WidgetTimetableService.java | 4 +-- app/src/main/res/layout/activity_feedback.xml | 4 +-- .../main/res/layout/dialog_grade_details.xml | 4 +-- app/src/main/res/layout/fragment_debug.xml | 2 +- app/src/main/res/layout/fragment_home.xml | 4 +-- .../res/layout/messages_compose_activity.xml | 4 +-- app/src/main/res/navigation/nav_login.xml | 34 +++++++++---------- .../main/res/xml/widget_lucky_number_info.xml | 2 +- .../res/xml/widget_notifications_info.xml | 2 +- .../main/res/xml/widget_timetable_info.xml | 2 +- 137 files changed, 333 insertions(+), 400 deletions(-) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui}/dialogs/GenericDialog.java (87%) rename app/src/main/java/pl/szczodrzynski/edziennik/{dialogs => ui/dialogs/changelog}/ChangelogDialog.java (98%) rename app/src/main/java/pl/szczodrzynski/edziennik/{adapters => ui/dialogs/event}/EventListAdapter.java (96%) rename app/src/main/java/pl/szczodrzynski/edziennik/{dialogs => ui/dialogs/event}/EventListDialog.java (95%) rename app/src/main/java/pl/szczodrzynski/edziennik/{dialogs => ui/dialogs/event}/EventManualDialog.java (99%) rename app/src/main/java/pl/szczodrzynski/edziennik/{dialogs => ui/dialogs/grade}/GradeDetailsDialog.java (87%) rename app/src/main/java/pl/szczodrzynski/edziennik/{dialogs => ui/dialogs/lessonchange}/LessonChangeDialog.java (86%) rename app/src/main/java/pl/szczodrzynski/edziennik/{fragments => ui/modules}/agenda/LessonChangeEvent.java (96%) rename app/src/main/java/pl/szczodrzynski/edziennik/{fragments => ui/modules}/agenda/LessonChangeEventRenderer.java (84%) rename app/src/main/java/pl/szczodrzynski/edziennik/{fragments => ui/modules/agenda}/RegisterAgendaCalendarFragment.java (97%) rename app/src/main/java/pl/szczodrzynski/edziennik/{fragments => ui/modules/agenda}/RegisterAgendaDefaultFragment.java (97%) rename app/src/main/java/pl/szczodrzynski/edziennik/{adapters => ui/modules/announcements}/AnnouncementsAdapter.java (98%) rename app/src/main/java/pl/szczodrzynski/edziennik/{fragments => ui/modules/announcements}/RegisterAnnouncementsFragment.java (98%) rename app/src/main/java/pl/szczodrzynski/edziennik/{adapters => ui/modules/attendance}/AttendancesAdapter.java (98%) rename app/src/main/java/pl/szczodrzynski/edziennik/{fragments => ui/modules/attendance}/RegisterAttendancesFragment.java (98%) rename app/src/main/java/pl/szczodrzynski/edziennik/{activities => ui/modules/base}/CrashActivity.java (99%) rename app/src/main/java/pl/szczodrzynski/edziennik/{activities => ui/modules/base}/CrashGtfoActivity.java (92%) rename app/src/main/java/pl/szczodrzynski/edziennik/{fragments => ui/modules/base}/DebugFragment.java (99%) rename app/src/main/java/pl/szczodrzynski/edziennik/{activities => ui/modules/base}/FeedbackActivity.java (99%) rename app/src/main/java/pl/szczodrzynski/edziennik/{fragments => ui/modules/base}/FeedbackFragment.kt (99%) rename app/src/main/java/pl/szczodrzynski/edziennik/{fragments => ui/modules/base}/HelpFragment.kt (96%) rename app/src/main/java/pl/szczodrzynski/edziennik/{fragments => ui/modules/base}/LoadingFragment.kt (93%) rename app/src/main/java/pl/szczodrzynski/edziennik/{fragments => ui/modules/base}/TemplateFragment.kt (96%) rename app/src/main/java/pl/szczodrzynski/edziennik/{adapters => ui/modules/grades}/GradesListAdapter.java (96%) rename app/src/main/java/pl/szczodrzynski/edziennik/{adapters => ui/modules/grades}/GradesSubjectAdapter.java (99%) rename app/src/main/java/pl/szczodrzynski/edziennik/{fragments => ui/modules/grades}/RegisterGradesFragment.java (98%) rename app/src/main/java/pl/szczodrzynski/edziennik/{adapters => ui/modules/grades/editor}/GradesEditorAdapter.kt (95%) rename app/src/main/java/pl/szczodrzynski/edziennik/{fragments => ui/modules/grades/editor}/GradesEditorFragment.kt (99%) rename app/src/main/java/pl/szczodrzynski/edziennik/{activities => ui/modules/home}/CounterActivity.java (96%) rename app/src/main/java/pl/szczodrzynski/edziennik/{fragments => ui/modules/home}/HomeFragment.java (97%) rename app/src/main/java/pl/szczodrzynski/edziennik/{fragments => ui/modules/home}/HomeTimetableCard.java (98%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/homework/HomeworkAdapter.java (95%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/homework/HomeworkDate.kt (66%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/homework/HomeworkFragment.kt (95%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/homework/HomeworkListFragment.kt (96%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/intro/ChangelogIntroActivity.java (96%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/intro/FragmentSlideMod.java (99%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/login/LoginActivity.java (99%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/login/LoginChooserFragment.java (96%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/login/LoginFinishFragment.java (97%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/login/LoginIuczniowieFragment.java (99%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/login/LoginIuczniowieHelpFragment.java (96%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/login/LoginLibrusFragment.java (99%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/login/LoginLibrusHelpFragment.java (96%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/login/LoginMigrationFragment.java (99%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/login/LoginMigrationSyncFragment.java (98%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/login/LoginMobidziennikFragment.java (99%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/login/LoginMobidziennikHelpFragment.java (96%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/login/LoginProfileObject.java (93%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/login/LoginProgressFragment.java (99%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/login/LoginSummaryFragment.java (99%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/login/LoginSyncErrorFragment.java (95%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/login/LoginSyncFragment.java (99%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/login/LoginTemplateFragment.java (96%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/login/LoginVulcanFragment.java (98%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/login/LoginVulcanHelpFragment.java (96%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/messages/MessagesAdapter.java (98%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/messages/MessagesComposeActivity.java (99%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/messages/MessagesComposeInfo.java (93%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/messages/MessagesComposeSuggestionAdapter.java (99%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/messages/MessagesDetailsFragment.java (99%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/messages/MessagesFragment.kt (98%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/messages/MessagesListFragment.java (99%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/messages/MessagesUtils.java (98%) rename app/src/main/java/pl/szczodrzynski/edziennik/{fragments => ui/modules/messages}/RegisterMessagesWebFragment.java (99%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/messages/SlideExplode.java (97%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => ui/modules}/messages/Transitions.java (89%) rename app/src/main/java/pl/szczodrzynski/edziennik/{adapters => ui/modules/notices}/NoticesAdapter.kt (97%) rename app/src/main/java/pl/szczodrzynski/edziennik/{fragments => ui/modules/notices}/RegisterNoticesFragment.java (98%) rename app/src/main/java/pl/szczodrzynski/edziennik/{adapters => ui/modules/notifications}/NotificationsAdapter.java (95%) rename app/src/main/java/pl/szczodrzynski/edziennik/{fragments => ui/modules/notifications}/RegisterNotificationsFragment.java (95%) rename app/src/main/java/pl/szczodrzynski/edziennik/{fragments => ui/modules/settings}/ProfileManagerFragment.kt (96%) rename app/src/main/java/pl/szczodrzynski/edziennik/{activities => ui/modules/settings}/SettingsLicenseActivity.kt (99%) rename app/src/main/java/pl/szczodrzynski/edziennik/{fragments => ui/modules/settings}/SettingsNewFragment.java (99%) rename app/src/main/java/pl/szczodrzynski/edziennik/{fragments => ui/modules/timetable}/RegisterTimetableDayFragment.java (94%) rename app/src/main/java/pl/szczodrzynski/edziennik/{fragments => ui/modules/timetable}/RegisterTimetableFragment.java (98%) rename app/src/main/java/pl/szczodrzynski/edziennik/{adapters => ui/modules/timetable}/TimetableAdapter.java (98%) rename app/src/main/java/pl/szczodrzynski/edziennik/{activities => ui/modules/webpush}/QrScannerActivity.java (98%) rename app/src/main/java/pl/szczodrzynski/edziennik/{activities => ui/modules/webpush}/WebPushConfigActivity.java (99%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => utils}/models/AppConfig.java (98%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => utils}/models/Date.java (99%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => utils}/models/Endpoint.java (90%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => utils}/models/ItemGradesSubjectModel.java (98%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => utils}/models/ItemTimetableModel.java (90%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => utils}/models/ItemWidgetTimetableModel.java (94%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => utils}/models/NavTarget.kt (97%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => utils}/models/Notification.java (99%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => utils}/models/Time.java (99%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => utils}/models/Week.java (76%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => utils}/models/db/LessonChangeCounter.java (55%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => utils}/models/db/UnreadCounter.kt (86%) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 1fbc04ec..3234ebac 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -29,22 +29,22 @@ @@ -57,7 +57,7 @@ |_| |_|_| \___|_.__/ \__,_|___/\___/ --> @@ -72,7 +72,7 @@ |___/ --> @@ -113,14 +113,14 @@ android:theme="@style/Base.Theme.AppCompat" /> - + - \ No newline at end of file + diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/App.java b/app/src/main/java/pl/szczodrzynski/edziennik/App.java index 57237a9e..7822861b 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/App.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/App.java @@ -63,7 +63,7 @@ import me.leolin.shortcutbadger.ShortcutBadger; import okhttp3.ConnectionSpec; import okhttp3.OkHttpClient; import okhttp3.TlsVersion; -import pl.szczodrzynski.edziennik.activities.CrashActivity; +import pl.szczodrzynski.edziennik.ui.modules.base.CrashActivity; import pl.szczodrzynski.edziennik.api.Edziennik; import pl.szczodrzynski.edziennik.api.Iuczniowie; import pl.szczodrzynski.edziennik.api.Librus; @@ -74,7 +74,7 @@ import pl.szczodrzynski.edziennik.datamodels.DebugLog; import pl.szczodrzynski.edziennik.datamodels.LoginStore; import pl.szczodrzynski.edziennik.datamodels.Profile; import pl.szczodrzynski.edziennik.datamodels.ProfileFull; -import pl.szczodrzynski.edziennik.models.AppConfig; +import pl.szczodrzynski.edziennik.utils.models.AppConfig; import pl.szczodrzynski.edziennik.network.NetworkUtils; import pl.szczodrzynski.edziennik.network.TLSSocketFactory; import pl.szczodrzynski.edziennik.receivers.JobsCreator; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt b/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt index 3a9f77a4..77e72edb 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt @@ -48,15 +48,28 @@ import pl.szczodrzynski.edziennik.databinding.ActivitySzkolnyBinding import pl.szczodrzynski.edziennik.datamodels.LoginStore import pl.szczodrzynski.edziennik.datamodels.Profile import pl.szczodrzynski.edziennik.datamodels.ProfileFull -import pl.szczodrzynski.edziennik.dialogs.ChangelogDialog -import pl.szczodrzynski.edziennik.fragments.* -import pl.szczodrzynski.edziennik.homework.HomeworkFragment -import pl.szczodrzynski.edziennik.login.LoginActivity -import pl.szczodrzynski.edziennik.messages.MessagesDetailsFragment -import pl.szczodrzynski.edziennik.messages.MessagesFragment -import pl.szczodrzynski.edziennik.models.NavTarget +import pl.szczodrzynski.edziennik.ui.dialogs.changelog.ChangelogDialog +import pl.szczodrzynski.edziennik.ui.modules.homework.HomeworkFragment +import pl.szczodrzynski.edziennik.ui.modules.login.LoginActivity +import pl.szczodrzynski.edziennik.ui.modules.messages.MessagesDetailsFragment +import pl.szczodrzynski.edziennik.ui.modules.messages.MessagesFragment +import pl.szczodrzynski.edziennik.utils.models.NavTarget import pl.szczodrzynski.edziennik.network.ServerRequest import pl.szczodrzynski.edziennik.sync.SyncJob +import pl.szczodrzynski.edziennik.ui.modules.agenda.RegisterAgendaDefaultFragment +import pl.szczodrzynski.edziennik.ui.modules.announcements.RegisterAnnouncementsFragment +import pl.szczodrzynski.edziennik.ui.modules.attendance.RegisterAttendancesFragment +import pl.szczodrzynski.edziennik.ui.modules.base.DebugFragment +import pl.szczodrzynski.edziennik.ui.modules.base.FeedbackFragment +import pl.szczodrzynski.edziennik.ui.modules.base.HelpFragment +import pl.szczodrzynski.edziennik.ui.modules.grades.editor.GradesEditorFragment +import pl.szczodrzynski.edziennik.ui.modules.grades.RegisterGradesFragment +import pl.szczodrzynski.edziennik.ui.modules.home.HomeFragment +import pl.szczodrzynski.edziennik.ui.modules.notices.RegisterNoticesFragment +import pl.szczodrzynski.edziennik.ui.modules.notifications.RegisterNotificationsFragment +import pl.szczodrzynski.edziennik.ui.modules.settings.ProfileManagerFragment +import pl.szczodrzynski.edziennik.ui.modules.settings.SettingsNewFragment +import pl.szczodrzynski.edziennik.ui.modules.timetable.RegisterTimetableFragment import pl.szczodrzynski.edziennik.utils.SwipeRefreshLayoutNoTouch import pl.szczodrzynski.edziennik.utils.Utils import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetPrimaryItem diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/Notifier.java b/app/src/main/java/pl/szczodrzynski/edziennik/Notifier.java index 512affed..0ad8cc23 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/Notifier.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/Notifier.java @@ -17,8 +17,8 @@ import java.util.Collections; import java.util.List; import pl.szczodrzynski.edziennik.datamodels.ProfileFull; -import pl.szczodrzynski.edziennik.models.Date; -import pl.szczodrzynski.edziennik.models.Time; +import pl.szczodrzynski.edziennik.utils.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Time; import pl.szczodrzynski.edziennik.receivers.BootReceiver; import pl.szczodrzynski.edziennik.sync.SyncJob; import pl.szczodrzynski.edziennik.sync.SyncService; @@ -221,7 +221,7 @@ public class Notifier { | . ` |/ _ \| __| | _| |/ __/ _` | __| |/ _ \| '_ \ | |\ | (_) | |_| | | | | (_| (_| | |_| | (_) | | | | |_| \_|\___/ \__|_|_| |_|\___\__,_|\__|_|\___/|_| |*/ - public void add(pl.szczodrzynski.edziennik.models.Notification notification) { + public void add(pl.szczodrzynski.edziennik.utils.models.Notification notification) { app.appConfig.notifications.add(notification); } @@ -235,8 +235,8 @@ public class Notifier { } int unreadCount = 0; - List notificationList = new ArrayList<>(); - for (pl.szczodrzynski.edziennik.models.Notification notification: app.appConfig.notifications) { + List notificationList = new ArrayList<>(); + for (pl.szczodrzynski.edziennik.utils.models.Notification notification: app.appConfig.notifications) { if (!notification.notified) { notification.seen = false; notification.notified = true; @@ -250,7 +250,7 @@ public class Notifier { } } - for (pl.szczodrzynski.edziennik.models.Notification notification: notificationList) { + for (pl.szczodrzynski.edziennik.utils.models.Notification notification: notificationList) { Intent intent = new Intent(app, MainActivity.class); notification.fillIntent(intent); PendingIntent pendingIntent = PendingIntent.getActivity(app, notification.id, intent, 0); @@ -258,9 +258,9 @@ public class Notifier { // title, text, type, date .setContentTitle(notification.title) .setContentText(notification.text) - .setSubText(pl.szczodrzynski.edziennik.models.Notification.stringType(app, notification.type)) + .setSubText(pl.szczodrzynski.edziennik.utils.models.Notification.stringType(app, notification.type)) .setWhen(notification.addedDate) - .setTicker(app.getString(R.string.notification_ticker_format, pl.szczodrzynski.edziennik.models.Notification.stringType(app, notification.type))) + .setTicker(app.getString(R.string.notification_ticker_format, pl.szczodrzynski.edziennik.utils.models.Notification.stringType(app, notification.type))) // icon, color, lights, priority .setSmallIcon(R.drawable.ic_notification) .setColor(notificationColor) @@ -349,7 +349,7 @@ public class Notifier { } public void dump() { - for (pl.szczodrzynski.edziennik.models.Notification notification: app.appConfig.notifications) { + for (pl.szczodrzynski.edziennik.utils.models.Notification notification: app.appConfig.notifications) { Log.d(TAG, "Profile"+notification.profileId+" Notification from "+ Date.fromMillis(notification.addedDate).getFormattedString()+" "+ Time.fromMillis(notification.addedDate).getStringHMS()+" - "+notification.text); } } diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/WidgetTimetable.java b/app/src/main/java/pl/szczodrzynski/edziennik/WidgetTimetable.java index 8a2fe720..194dace4 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/WidgetTimetable.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/WidgetTimetable.java @@ -32,11 +32,11 @@ import pl.szczodrzynski.edziennik.datamodels.EventFull; import pl.szczodrzynski.edziennik.datamodels.LessonChange; import pl.szczodrzynski.edziennik.datamodels.LessonFull; import pl.szczodrzynski.edziennik.datamodels.Profile; -import pl.szczodrzynski.edziennik.fragments.HomeFragment; -import pl.szczodrzynski.edziennik.models.Date; -import pl.szczodrzynski.edziennik.models.ItemWidgetTimetableModel; -import pl.szczodrzynski.edziennik.models.Time; -import pl.szczodrzynski.edziennik.models.Week; +import pl.szczodrzynski.edziennik.ui.modules.home.HomeFragment; +import pl.szczodrzynski.edziennik.utils.models.Date; +import pl.szczodrzynski.edziennik.utils.models.ItemWidgetTimetableModel; +import pl.szczodrzynski.edziennik.utils.models.Time; +import pl.szczodrzynski.edziennik.utils.models.Week; import pl.szczodrzynski.edziennik.widgets.WidgetConfig; import pl.szczodrzynski.edziennik.sync.SyncJob; import pl.szczodrzynski.edziennik.widgets.timetable.LessonDetailsActivity; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/Edziennik.java b/app/src/main/java/pl/szczodrzynski/edziennik/api/Edziennik.java index eb0fde7c..c085e092 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/Edziennik.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/api/Edziennik.java @@ -62,8 +62,8 @@ import pl.szczodrzynski.edziennik.datamodels.NoticeFull; import pl.szczodrzynski.edziennik.datamodels.Profile; import pl.szczodrzynski.edziennik.datamodels.ProfileFull; import pl.szczodrzynski.edziennik.datamodels.Team; -import pl.szczodrzynski.edziennik.models.Date; -import pl.szczodrzynski.edziennik.models.Notification; +import pl.szczodrzynski.edziennik.utils.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Notification; import pl.szczodrzynski.edziennik.network.ServerRequest; import pl.szczodrzynski.edziennik.sync.SyncJob; import pl.szczodrzynski.edziennik.utils.Themes; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/Iuczniowie.java b/app/src/main/java/pl/szczodrzynski/edziennik/api/Iuczniowie.java index ad32cb24..ef582884 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/Iuczniowie.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/api/Iuczniowie.java @@ -59,11 +59,11 @@ import pl.szczodrzynski.edziennik.datamodels.ProfileFull; import pl.szczodrzynski.edziennik.datamodels.Subject; import pl.szczodrzynski.edziennik.datamodels.Teacher; import pl.szczodrzynski.edziennik.datamodels.Team; -import pl.szczodrzynski.edziennik.messages.MessagesComposeInfo; -import pl.szczodrzynski.edziennik.models.Date; -import pl.szczodrzynski.edziennik.models.Endpoint; -import pl.szczodrzynski.edziennik.models.Time; -import pl.szczodrzynski.edziennik.models.Week; +import pl.szczodrzynski.edziennik.ui.modules.messages.MessagesComposeInfo; +import pl.szczodrzynski.edziennik.utils.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Endpoint; +import pl.szczodrzynski.edziennik.utils.models.Time; +import pl.szczodrzynski.edziennik.utils.models.Week; import static pl.szczodrzynski.edziennik.api.AppError.CODE_INVALID_LOGIN; import static pl.szczodrzynski.edziennik.api.AppError.CODE_INVALID_SCHOOL_NAME; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/Librus.java b/app/src/main/java/pl/szczodrzynski/edziennik/api/Librus.java index e1787377..9eb31ea0 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/Librus.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/api/Librus.java @@ -73,11 +73,11 @@ import pl.szczodrzynski.edziennik.datamodels.ProfileFull; import pl.szczodrzynski.edziennik.datamodels.Subject; import pl.szczodrzynski.edziennik.datamodels.Teacher; import pl.szczodrzynski.edziennik.datamodels.Team; -import pl.szczodrzynski.edziennik.messages.MessagesComposeInfo; -import pl.szczodrzynski.edziennik.models.Date; -import pl.szczodrzynski.edziennik.models.Endpoint; -import pl.szczodrzynski.edziennik.models.Time; -import pl.szczodrzynski.edziennik.models.Week; +import pl.szczodrzynski.edziennik.ui.modules.messages.MessagesComposeInfo; +import pl.szczodrzynski.edziennik.utils.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Endpoint; +import pl.szczodrzynski.edziennik.utils.models.Time; +import pl.szczodrzynski.edziennik.utils.models.Week; import pl.szczodrzynski.edziennik.utils.Utils; import static java.net.HttpURLConnection.HTTP_BAD_REQUEST; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/Mobidziennik.java b/app/src/main/java/pl/szczodrzynski/edziennik/api/Mobidziennik.java index 14a1e168..e3ac7922 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/Mobidziennik.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/api/Mobidziennik.java @@ -65,11 +65,11 @@ import pl.szczodrzynski.edziennik.datamodels.ProfileFull; import pl.szczodrzynski.edziennik.datamodels.Subject; import pl.szczodrzynski.edziennik.datamodels.Teacher; import pl.szczodrzynski.edziennik.datamodels.Team; -import pl.szczodrzynski.edziennik.messages.MessagesComposeInfo; -import pl.szczodrzynski.edziennik.models.Date; -import pl.szczodrzynski.edziennik.models.Endpoint; -import pl.szczodrzynski.edziennik.models.Time; -import pl.szczodrzynski.edziennik.models.Week; +import pl.szczodrzynski.edziennik.ui.modules.messages.MessagesComposeInfo; +import pl.szczodrzynski.edziennik.utils.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Endpoint; +import pl.szczodrzynski.edziennik.utils.models.Time; +import pl.szczodrzynski.edziennik.utils.models.Week; import static pl.szczodrzynski.edziennik.api.AppError.CODE_INVALID_LOGIN; import static pl.szczodrzynski.edziennik.api.AppError.CODE_MAINTENANCE; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/Vulcan.java b/app/src/main/java/pl/szczodrzynski/edziennik/api/Vulcan.java index 85893a62..6694fc5d 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/Vulcan.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/api/Vulcan.java @@ -59,11 +59,11 @@ import pl.szczodrzynski.edziennik.datamodels.ProfileFull; import pl.szczodrzynski.edziennik.datamodels.Subject; import pl.szczodrzynski.edziennik.datamodels.Teacher; import pl.szczodrzynski.edziennik.datamodels.Team; -import pl.szczodrzynski.edziennik.messages.MessagesComposeInfo; -import pl.szczodrzynski.edziennik.models.Date; -import pl.szczodrzynski.edziennik.models.Endpoint; -import pl.szczodrzynski.edziennik.models.Time; -import pl.szczodrzynski.edziennik.models.Week; +import pl.szczodrzynski.edziennik.ui.modules.messages.MessagesComposeInfo; +import pl.szczodrzynski.edziennik.utils.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Endpoint; +import pl.szczodrzynski.edziennik.utils.models.Time; +import pl.szczodrzynski.edziennik.utils.models.Week; import pl.szczodrzynski.edziennik.utils.Utils; import static pl.szczodrzynski.edziennik.api.AppError.CODE_OTHER; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/EdziennikInterface.java b/app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/EdziennikInterface.java index 2d33d515..15770e2f 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/EdziennikInterface.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/EdziennikInterface.java @@ -7,12 +7,11 @@ import androidx.annotation.Nullable; import java.util.Map; import pl.szczodrzynski.edziennik.datamodels.LoginStore; -import pl.szczodrzynski.edziennik.datamodels.Message; import pl.szczodrzynski.edziennik.datamodels.MessageFull; import pl.szczodrzynski.edziennik.datamodels.Profile; import pl.szczodrzynski.edziennik.datamodels.ProfileFull; -import pl.szczodrzynski.edziennik.messages.MessagesComposeInfo; -import pl.szczodrzynski.edziennik.models.Endpoint; +import pl.szczodrzynski.edziennik.ui.modules.messages.MessagesComposeInfo; +import pl.szczodrzynski.edziennik.utils.models.Endpoint; public interface EdziennikInterface { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/Librus.kt b/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/Librus.kt index 8ba1f79e..d99bce51 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/Librus.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/Librus.kt @@ -19,8 +19,8 @@ import pl.szczodrzynski.edziennik.datamodels.LoginStore import pl.szczodrzynski.edziennik.datamodels.MessageFull import pl.szczodrzynski.edziennik.datamodels.Profile import pl.szczodrzynski.edziennik.datamodels.ProfileFull -import pl.szczodrzynski.edziennik.messages.MessagesComposeInfo -import pl.szczodrzynski.edziennik.models.Endpoint +import pl.szczodrzynski.edziennik.ui.modules.messages.MessagesComposeInfo +import pl.szczodrzynski.edziennik.utils.models.Endpoint import pl.szczodrzynski.edziennik.utils.Utils.d import java.lang.Exception @@ -198,4 +198,4 @@ class Librus(val app: App, val profile: Profile?, val loginStore: LoginStore) : override fun isEndpointEnabled(profile: Profile?, defaultActive: Boolean, name: String?): Boolean { TODO("not implemented") //To change body of created functions use File | Settings | File Templates. } -} \ No newline at end of file +} diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/models/DataStore.kt b/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/models/DataStore.kt index 552340fa..a3d12e97 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/models/DataStore.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/models/DataStore.kt @@ -4,7 +4,7 @@ import android.util.LongSparseArray import androidx.core.util.forEach import androidx.core.util.isNotEmpty import pl.szczodrzynski.edziennik.datamodels.* -import pl.szczodrzynski.edziennik.models.Date +import pl.szczodrzynski.edziennik.utils.models.Date data class DataStore(private val appDb: AppDb, val profileId: Int) { val teacherList: LongSparseArray = LongSparseArray() @@ -115,4 +115,4 @@ data class DataStore(private val appDb: AppDb, val profileId: Int) { if (messageMetadataList.isNotEmpty()) appDb.metadataDao().setSeen(messageMetadataList) } -} \ No newline at end of file +} diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Announcement.java b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Announcement.java index cfde4da3..516071f8 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Announcement.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Announcement.java @@ -5,7 +5,7 @@ import androidx.room.ColumnInfo; import androidx.room.Entity; import androidx.room.Ignore; import androidx.room.Index; -import pl.szczodrzynski.edziennik.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Date; @Entity(tableName = "announcements", primaryKeys = {"profileId", "announcementId"}, diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/AppDb.java b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/AppDb.java index fba95f57..05d390fd 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/AppDb.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/AppDb.java @@ -6,7 +6,7 @@ import androidx.room.Room; import androidx.room.RoomDatabase; import androidx.room.TypeConverters; import androidx.room.migration.Migration; -import pl.szczodrzynski.edziennik.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Date; import android.content.Context; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Attendance.java b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Attendance.java index 50fec470..ca8a5f58 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Attendance.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Attendance.java @@ -6,8 +6,8 @@ import androidx.room.Entity; import androidx.room.Ignore; import androidx.room.Index; -import pl.szczodrzynski.edziennik.models.Date; -import pl.szczodrzynski.edziennik.models.Time; +import pl.szczodrzynski.edziennik.utils.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Time; @Entity(tableName = "attendances", primaryKeys = {"profileId", "attendanceId", "attendanceLessonDate", "attendanceStartTime"}, diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/AttendanceDao.java b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/AttendanceDao.java index d6367227..5dacf4f0 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/AttendanceDao.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/AttendanceDao.java @@ -8,11 +8,10 @@ import androidx.room.Insert; import androidx.room.OnConflictStrategy; import androidx.room.Query; import androidx.room.RawQuery; -import pl.szczodrzynski.edziennik.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Date; import java.util.List; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_PRESENT; import static pl.szczodrzynski.edziennik.datamodels.Metadata.TYPE_ATTENDANCE; @Dao diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/ConverterDate.java b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/ConverterDate.java index fa23123b..e77c3e2b 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/ConverterDate.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/ConverterDate.java @@ -2,7 +2,7 @@ package pl.szczodrzynski.edziennik.datamodels; import androidx.room.TypeConverter; -import pl.szczodrzynski.edziennik.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Date; public class ConverterDate { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/ConverterTime.java b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/ConverterTime.java index 6ac9a8c6..c3a37864 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/ConverterTime.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/ConverterTime.java @@ -2,7 +2,7 @@ package pl.szczodrzynski.edziennik.datamodels; import androidx.room.TypeConverter; -import pl.szczodrzynski.edziennik.models.Time; +import pl.szczodrzynski.edziennik.utils.models.Time; public class ConverterTime { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Event.java b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Event.java index c6e1244a..24c916f0 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Event.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Event.java @@ -4,8 +4,8 @@ import androidx.room.ColumnInfo; import androidx.room.Entity; import androidx.room.Ignore; import androidx.room.Index; -import pl.szczodrzynski.edziennik.models.Date; -import pl.szczodrzynski.edziennik.models.Time; +import pl.szczodrzynski.edziennik.utils.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Time; @Entity(tableName = "events", primaryKeys = {"profileId", "eventId"}, diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/EventDao.java b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/EventDao.java index 3ae3affb..63c53ed1 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/EventDao.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/EventDao.java @@ -14,8 +14,8 @@ import android.util.Log; import java.util.List; -import pl.szczodrzynski.edziennik.models.Date; -import pl.szczodrzynski.edziennik.models.Time; +import pl.szczodrzynski.edziennik.utils.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Time; import static pl.szczodrzynski.edziennik.datamodels.Metadata.TYPE_EVENT; import static pl.szczodrzynski.edziennik.datamodels.Metadata.TYPE_HOMEWORK; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Lesson.java b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Lesson.java index 69fe76c9..0a1278e2 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Lesson.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Lesson.java @@ -8,8 +8,8 @@ import androidx.room.Ignore; import androidx.room.Index; import androidx.annotation.NonNull; -import pl.szczodrzynski.edziennik.models.Time; -import pl.szczodrzynski.edziennik.models.Week; +import pl.szczodrzynski.edziennik.utils.models.Time; +import pl.szczodrzynski.edziennik.utils.models.Week; @Entity(tableName = "lessons", primaryKeys = {"profileId", "lessonWeekDay", "lessonStartTime", "lessonEndTime"}, diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LessonChange.java b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LessonChange.java index 41cfcbc6..f85f34e4 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LessonChange.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LessonChange.java @@ -7,8 +7,8 @@ import androidx.annotation.NonNull; import java.util.List; -import pl.szczodrzynski.edziennik.models.Date; -import pl.szczodrzynski.edziennik.models.Time; +import pl.szczodrzynski.edziennik.utils.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Time; @Entity(tableName = "lessonChanges", primaryKeys = {"profileId", "lessonChangeDate", "lessonChangeStartTime", "lessonChangeEndTime"}, diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LessonChangeDao.java b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LessonChangeDao.java index a8238b4e..3e91bfde 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LessonChangeDao.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LessonChangeDao.java @@ -11,8 +11,8 @@ import androidx.room.RawQuery; import java.util.List; -import pl.szczodrzynski.edziennik.models.Date; -import pl.szczodrzynski.edziennik.models.db.LessonChangeCounter; +import pl.szczodrzynski.edziennik.utils.models.Date; +import pl.szczodrzynski.edziennik.utils.models.db.LessonChangeCounter; import static pl.szczodrzynski.edziennik.datamodels.Metadata.TYPE_LESSON_CHANGE; import static pl.szczodrzynski.edziennik.utils.Utils.d; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LessonDao.java b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LessonDao.java index a464b886..e2de1e2f 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LessonDao.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LessonDao.java @@ -9,12 +9,11 @@ import androidx.room.OnConflictStrategy; import androidx.room.Query; import androidx.room.RawQuery; import androidx.annotation.NonNull; -import android.util.Log; import java.util.List; -import pl.szczodrzynski.edziennik.models.Date; -import pl.szczodrzynski.edziennik.models.Time; +import pl.szczodrzynski.edziennik.utils.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Time; @Dao public abstract class LessonDao { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LessonFull.java b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LessonFull.java index 2486b491..e60b26d3 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LessonFull.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LessonFull.java @@ -5,7 +5,7 @@ import android.content.Context; import androidx.annotation.Nullable; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Date; import static pl.szczodrzynski.edziennik.datamodels.LessonChange.TYPE_ADDED; import static pl.szczodrzynski.edziennik.datamodels.LessonChange.TYPE_CANCELLED; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LuckyNumber.java b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LuckyNumber.java index 0ddc8032..6350a5f1 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LuckyNumber.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LuckyNumber.java @@ -4,7 +4,7 @@ import androidx.room.ColumnInfo; import androidx.room.Entity; import androidx.annotation.NonNull; -import pl.szczodrzynski.edziennik.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Date; @Entity(tableName = "luckyNumbers", primaryKeys = {"profileId", "luckyNumberDate"}) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LuckyNumberDao.java b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LuckyNumberDao.java index 308b3045..9fe62154 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LuckyNumberDao.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LuckyNumberDao.java @@ -8,7 +8,7 @@ import androidx.room.Query; import java.util.List; -import pl.szczodrzynski.edziennik.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Date; @Dao public interface LuckyNumberDao { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/MetadataDao.java b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/MetadataDao.java index 321ee89b..40a44d25 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/MetadataDao.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/MetadataDao.java @@ -9,7 +9,7 @@ import androidx.room.Transaction; import java.util.List; -import pl.szczodrzynski.edziennik.models.db.UnreadCounter; +import pl.szczodrzynski.edziennik.utils.models.db.UnreadCounter; import static pl.szczodrzynski.edziennik.datamodels.Metadata.TYPE_ANNOUNCEMENT; import static pl.szczodrzynski.edziennik.datamodels.Metadata.TYPE_ATTENDANCE; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Profile.kt b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Profile.kt index 1404e8bf..5cf1b446 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Profile.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Profile.kt @@ -3,25 +3,20 @@ package pl.szczodrzynski.edziennik.datamodels import androidx.room.ColumnInfo import androidx.room.Entity import android.content.Context -import android.graphics.BitmapFactory import android.graphics.PorterDuff import android.graphics.PorterDuffColorFilter import android.graphics.drawable.Drawable -import android.media.ThumbnailUtils import android.net.ConnectivityManager -import android.net.NetworkInfo import android.widget.ImageView -import androidx.core.graphics.drawable.RoundedBitmapDrawable import androidx.core.graphics.drawable.RoundedBitmapDrawableFactory -import com.google.gson.JsonElement import com.google.gson.JsonObject import androidx.room.Ignore import pl.droidsonroids.gif.GifDrawable import pl.szczodrzynski.edziennik.colorFromName -import pl.szczodrzynski.edziennik.models.Date +import pl.szczodrzynski.edziennik.utils.models.Date import pl.szczodrzynski.navlib.ImageHolder import pl.szczodrzynski.navlib.R import pl.szczodrzynski.navlib.drawer.IDrawerProfile diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/sync/MyFirebaseMessagingService.java b/app/src/main/java/pl/szczodrzynski/edziennik/sync/MyFirebaseMessagingService.java index 2b56b9bc..a9984194 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/sync/MyFirebaseMessagingService.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/sync/MyFirebaseMessagingService.java @@ -23,8 +23,8 @@ import pl.szczodrzynski.edziennik.datamodels.EventType; import pl.szczodrzynski.edziennik.datamodels.FeedbackMessage; import pl.szczodrzynski.edziennik.datamodels.ProfileFull; import pl.szczodrzynski.edziennik.datamodels.Team; -import pl.szczodrzynski.edziennik.fragments.DebugFragment; -import pl.szczodrzynski.edziennik.models.Notification; +import pl.szczodrzynski.edziennik.ui.modules.base.DebugFragment; +import pl.szczodrzynski.edziennik.utils.models.Notification; import pl.szczodrzynski.edziennik.network.ServerRequest; import static pl.szczodrzynski.edziennik.App.APP_URL; @@ -195,7 +195,7 @@ public class MyFirebaseMessagingService extends FirebaseMessagingService { app.checkDevModePassword(); feedbackMessage.text = "devmode "+(App.devMode ? "allowed" : "disallowed"); } - Intent intent = new Intent("pl.szczodrzynski.edziennik.activities.FeedbackActivity"); + Intent intent = new Intent("pl.szczodrzynski.edziennik.ui.modules.base.FeedbackActivity"); intent.putExtra("type", "user_chat"); intent.putExtra("message", app.gson.toJson(feedbackMessage)); app.sendBroadcast(intent); @@ -217,7 +217,7 @@ public class MyFirebaseMessagingService extends FirebaseMessagingService { feedbackMessage.fromUser = remoteMessage.getData().get("from_user"); feedbackMessage.fromUserName = remoteMessage.getData().get("from_user_name"); feedbackMessage.sentTime = Long.parseLong(remoteMessage.getData().get("sent_time")); - Intent intent = new Intent("pl.szczodrzynski.edziennik.activities.FeedbackActivity"); + Intent intent = new Intent("pl.szczodrzynski.edziennik.ui.modules.base.FeedbackActivity"); intent.putExtra("type", "user_chat"); intent.putExtra("message", app.gson.toJson(feedbackMessage)); app.sendBroadcast(intent); diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/dialogs/GenericDialog.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/GenericDialog.java similarity index 87% rename from app/src/main/java/pl/szczodrzynski/edziennik/dialogs/GenericDialog.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/GenericDialog.java index 2b5b23ef..df691a58 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/dialogs/GenericDialog.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/GenericDialog.java @@ -1,15 +1,11 @@ -package pl.szczodrzynski.edziennik.dialogs; +package pl.szczodrzynski.edziennik.ui.dialogs; import android.content.Context; -import android.content.res.Resources; -import androidx.annotation.ColorInt; -import android.util.TypedValue; import android.view.View; import com.afollestad.materialdialogs.MaterialDialog; import pl.szczodrzynski.edziennik.App; -import pl.szczodrzynski.edziennik.R; public class GenericDialog { private App app; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/dialogs/ChangelogDialog.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/changelog/ChangelogDialog.java similarity index 98% rename from app/src/main/java/pl/szczodrzynski/edziennik/dialogs/ChangelogDialog.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/changelog/ChangelogDialog.java index d27b7726..dfae3081 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/dialogs/ChangelogDialog.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/changelog/ChangelogDialog.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.dialogs; +package pl.szczodrzynski.edziennik.ui.dialogs.changelog; import android.app.Dialog; import android.os.Bundle; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/adapters/EventListAdapter.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventListAdapter.java similarity index 96% rename from app/src/main/java/pl/szczodrzynski/edziennik/adapters/EventListAdapter.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventListAdapter.java index b22b2308..3df99e78 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/adapters/EventListAdapter.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventListAdapter.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.adapters; +package pl.szczodrzynski.edziennik.ui.dialogs.event; import android.content.Context; import android.graphics.PorterDuff; @@ -20,9 +20,7 @@ import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.datamodels.Event; import pl.szczodrzynski.edziennik.datamodels.EventFull; -import pl.szczodrzynski.edziennik.dialogs.EventListDialog; -import pl.szczodrzynski.edziennik.dialogs.EventManualDialog; -import pl.szczodrzynski.edziennik.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Date; import pl.szczodrzynski.edziennik.utils.Utils; import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_HOMEWORK; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/dialogs/EventListDialog.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventListDialog.java similarity index 95% rename from app/src/main/java/pl/szczodrzynski/edziennik/dialogs/EventListDialog.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventListDialog.java index dd974450..57ae66fc 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/dialogs/EventListDialog.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventListDialog.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.dialogs; +package pl.szczodrzynski.edziennik.ui.dialogs.event; import android.content.Context; import android.content.DialogInterface; @@ -16,20 +16,13 @@ import androidx.lifecycle.LifecycleOwner; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import java.util.Calendar; -import java.util.List; -import java.util.Locale; - import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.adapters.EventListAdapter; import pl.szczodrzynski.edziennik.datamodels.LessonChange; import pl.szczodrzynski.edziennik.datamodels.LessonFull; -import pl.szczodrzynski.edziennik.fragments.agenda.LessonChangeEvent; -import pl.szczodrzynski.edziennik.models.Date; -import pl.szczodrzynski.edziennik.models.Time; -import pl.szczodrzynski.edziennik.models.db.LessonChangeCounter; -import pl.szczodrzynski.edziennik.utils.Colors; +import pl.szczodrzynski.edziennik.ui.dialogs.lessonchange.LessonChangeDialog; +import pl.szczodrzynski.edziennik.utils.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Time; public class EventListDialog { private App app; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/dialogs/EventManualDialog.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventManualDialog.java similarity index 99% rename from app/src/main/java/pl/szczodrzynski/edziennik/dialogs/EventManualDialog.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventManualDialog.java index 6b5fca15..bfdb5be7 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/dialogs/EventManualDialog.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventManualDialog.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.dialogs; +package pl.szczodrzynski.edziennik.ui.dialogs.event; import android.app.Activity; @@ -46,9 +46,9 @@ import pl.szczodrzynski.edziennik.datamodels.ProfileFull; import pl.szczodrzynski.edziennik.datamodels.Subject; import pl.szczodrzynski.edziennik.datamodels.Teacher; import pl.szczodrzynski.edziennik.datamodels.Team; -import pl.szczodrzynski.edziennik.models.Date; -import pl.szczodrzynski.edziennik.models.Time; -import pl.szczodrzynski.edziennik.models.Week; +import pl.szczodrzynski.edziennik.utils.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Time; +import pl.szczodrzynski.edziennik.utils.models.Week; import pl.szczodrzynski.edziennik.network.ServerRequest; import pl.szczodrzynski.edziennik.utils.TextInputDropDown; import pl.szczodrzynski.edziennik.utils.Themes; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/dialogs/GradeDetailsDialog.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/grade/GradeDetailsDialog.java similarity index 87% rename from app/src/main/java/pl/szczodrzynski/edziennik/dialogs/GradeDetailsDialog.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/grade/GradeDetailsDialog.java index 4082cf5d..43ad22d3 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/dialogs/GradeDetailsDialog.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/grade/GradeDetailsDialog.java @@ -1,38 +1,26 @@ -package pl.szczodrzynski.edziennik.dialogs; +package pl.szczodrzynski.edziennik.ui.dialogs.grade; import android.content.Context; import android.content.DialogInterface; import android.graphics.PorterDuff; import android.graphics.PorterDuffColorFilter; -import android.graphics.Typeface; import android.os.AsyncTask; import android.view.View; -import android.widget.LinearLayout; -import android.widget.TextView; -import androidx.appcompat.app.AppCompatActivity; import androidx.core.graphics.ColorUtils; -import androidx.lifecycle.LifecycleOwner; import androidx.recyclerview.widget.LinearLayoutManager; -import androidx.recyclerview.widget.RecyclerView; import com.afollestad.materialdialogs.MaterialDialog; import java.text.DecimalFormat; -import java.util.ArrayList; import java.util.List; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.adapters.EventListAdapter; -import pl.szczodrzynski.edziennik.adapters.GradesListAdapter; +import pl.szczodrzynski.edziennik.ui.modules.grades.GradesListAdapter; import pl.szczodrzynski.edziennik.databinding.DialogGradeDetailsBinding; import pl.szczodrzynski.edziennik.datamodels.Grade; import pl.szczodrzynski.edziennik.datamodels.GradeFull; -import pl.szczodrzynski.edziennik.datamodels.LessonChange; -import pl.szczodrzynski.edziennik.datamodels.LessonFull; -import pl.szczodrzynski.edziennik.models.Date; -import pl.szczodrzynski.edziennik.models.Time; import pl.szczodrzynski.edziennik.utils.Colors; import static pl.szczodrzynski.edziennik.datamodels.Profile.COLOR_MODE_DEFAULT; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/dialogs/LessonChangeDialog.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/lessonchange/LessonChangeDialog.java similarity index 86% rename from app/src/main/java/pl/szczodrzynski/edziennik/dialogs/LessonChangeDialog.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/lessonchange/LessonChangeDialog.java index ed03ca71..3d58f199 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/dialogs/LessonChangeDialog.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/lessonchange/LessonChangeDialog.java @@ -1,11 +1,8 @@ -package pl.szczodrzynski.edziennik.dialogs; +package pl.szczodrzynski.edziennik.ui.dialogs.lessonchange; import android.content.Context; -import android.content.res.Resources; -import android.util.TypedValue; import android.view.View; -import androidx.annotation.ColorInt; import androidx.databinding.DataBindingUtil; import androidx.lifecycle.LifecycleOwner; import androidx.recyclerview.widget.LinearLayoutManager; @@ -17,13 +14,11 @@ import java.util.List; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.adapters.TimetableAdapter; +import pl.szczodrzynski.edziennik.ui.modules.timetable.TimetableAdapter; import pl.szczodrzynski.edziennik.databinding.DialogLessonChangeListBinding; -import pl.szczodrzynski.edziennik.datamodels.Lesson; -import pl.szczodrzynski.edziennik.datamodels.LessonChange; import pl.szczodrzynski.edziennik.datamodels.LessonFull; -import pl.szczodrzynski.edziennik.models.Date; -import pl.szczodrzynski.edziennik.models.Time; +import pl.szczodrzynski.edziennik.utils.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Time; public class LessonChangeDialog { private App app; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/agenda/LessonChangeEvent.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/LessonChangeEvent.java similarity index 96% rename from app/src/main/java/pl/szczodrzynski/edziennik/fragments/agenda/LessonChangeEvent.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/LessonChangeEvent.java index 0d92e6cd..41e3f44a 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/agenda/LessonChangeEvent.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/LessonChangeEvent.java @@ -1,13 +1,12 @@ -package pl.szczodrzynski.edziennik.fragments.agenda; +package pl.szczodrzynski.edziennik.ui.modules.agenda; -import com.github.tibolte.agendacalendarview.models.BaseCalendarEvent; import com.github.tibolte.agendacalendarview.models.CalendarEvent; import com.github.tibolte.agendacalendarview.models.IDayItem; import com.github.tibolte.agendacalendarview.models.IWeekItem; import java.util.Calendar; -import pl.szczodrzynski.edziennik.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Date; public class LessonChangeEvent implements CalendarEvent { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/agenda/LessonChangeEventRenderer.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/LessonChangeEventRenderer.java similarity index 84% rename from app/src/main/java/pl/szczodrzynski/edziennik/fragments/agenda/LessonChangeEventRenderer.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/LessonChangeEventRenderer.java index 5a821614..b0e529cf 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/agenda/LessonChangeEventRenderer.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/LessonChangeEventRenderer.java @@ -1,8 +1,6 @@ -package pl.szczodrzynski.edziennik.fragments.agenda; +package pl.szczodrzynski.edziennik.ui.modules.agenda; -import android.graphics.Color; import android.view.View; -import android.widget.LinearLayout; import android.widget.TextView; import androidx.cardview.widget.CardView; @@ -10,7 +8,6 @@ import androidx.cardview.widget.CardView; import com.github.tibolte.agendacalendarview.render.EventRenderer; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.datamodels.Lesson; public class LessonChangeEventRenderer extends EventRenderer { @Override diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterAgendaCalendarFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/RegisterAgendaCalendarFragment.java similarity index 97% rename from app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterAgendaCalendarFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/RegisterAgendaCalendarFragment.java index bad747f9..4048694b 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterAgendaCalendarFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/RegisterAgendaCalendarFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.fragments; +package pl.szczodrzynski.edziennik.ui.modules.agenda; import android.app.Activity; import android.content.Context; @@ -30,8 +30,8 @@ import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.databinding.FragmentRegisterAgendaCalendarBinding; import pl.szczodrzynski.edziennik.datamodels.EventFull; import pl.szczodrzynski.edziennik.datamodels.LessonFull; -import pl.szczodrzynski.edziennik.dialogs.EventListDialog; -import pl.szczodrzynski.edziennik.models.Date; +import pl.szczodrzynski.edziennik.ui.dialogs.event.EventListDialog; +import pl.szczodrzynski.edziennik.utils.models.Date; import pl.szczodrzynski.edziennik.utils.Themes; import static pl.szczodrzynski.edziennik.utils.Utils.intToStr; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterAgendaDefaultFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/RegisterAgendaDefaultFragment.java similarity index 97% rename from app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterAgendaDefaultFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/RegisterAgendaDefaultFragment.java index b7d12bae..3e9ffcba 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterAgendaDefaultFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/RegisterAgendaDefaultFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.fragments; +package pl.szczodrzynski.edziennik.ui.modules.agenda; import android.app.Activity; import android.content.Context; @@ -40,14 +40,12 @@ import pl.szczodrzynski.edziennik.databinding.FragmentRegisterAgendaCalendarBind import pl.szczodrzynski.edziennik.databinding.FragmentRegisterAgendaDefaultBinding; import pl.szczodrzynski.edziennik.datamodels.EventFull; import pl.szczodrzynski.edziennik.datamodels.LessonFull; -import pl.szczodrzynski.edziennik.dialogs.EventListDialog; -import pl.szczodrzynski.edziennik.dialogs.EventManualDialog; -import pl.szczodrzynski.edziennik.dialogs.LessonChangeDialog; -import pl.szczodrzynski.edziennik.fragments.agenda.LessonChangeEvent; -import pl.szczodrzynski.edziennik.fragments.agenda.LessonChangeEventRenderer; -import pl.szczodrzynski.edziennik.models.Date; -import pl.szczodrzynski.edziennik.models.Time; -import pl.szczodrzynski.edziennik.models.db.LessonChangeCounter; +import pl.szczodrzynski.edziennik.ui.dialogs.event.EventListDialog; +import pl.szczodrzynski.edziennik.ui.dialogs.event.EventManualDialog; +import pl.szczodrzynski.edziennik.ui.dialogs.lessonchange.LessonChangeDialog; +import pl.szczodrzynski.edziennik.utils.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Time; +import pl.szczodrzynski.edziennik.utils.models.db.LessonChangeCounter; import pl.szczodrzynski.edziennik.utils.Colors; import pl.szczodrzynski.edziennik.utils.Themes; import pl.szczodrzynski.edziennik.utils.Utils; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/adapters/AnnouncementsAdapter.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/announcements/AnnouncementsAdapter.java similarity index 98% rename from app/src/main/java/pl/szczodrzynski/edziennik/adapters/AnnouncementsAdapter.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/announcements/AnnouncementsAdapter.java index 26df42c9..3b76fcb7 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/adapters/AnnouncementsAdapter.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/announcements/AnnouncementsAdapter.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.adapters; +package pl.szczodrzynski.edziennik.ui.modules.announcements; import android.content.Context; import android.graphics.PorterDuff; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterAnnouncementsFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/announcements/RegisterAnnouncementsFragment.java similarity index 98% rename from app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterAnnouncementsFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/announcements/RegisterAnnouncementsFragment.java index e6f955db..5b8d36a7 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterAnnouncementsFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/announcements/RegisterAnnouncementsFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.fragments; +package pl.szczodrzynski.edziennik.ui.modules.announcements; import android.os.AsyncTask; import android.os.Bundle; @@ -19,7 +19,6 @@ import androidx.recyclerview.widget.RecyclerView; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.MainActivity; -import pl.szczodrzynski.edziennik.adapters.AnnouncementsAdapter; import pl.szczodrzynski.edziennik.databinding.DialogAnnouncementBinding; import pl.szczodrzynski.edziennik.databinding.FragmentRegisterSchoolNoticesBinding; import pl.szczodrzynski.edziennik.utils.Themes; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/adapters/AttendancesAdapter.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/AttendancesAdapter.java similarity index 98% rename from app/src/main/java/pl/szczodrzynski/edziennik/adapters/AttendancesAdapter.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/AttendancesAdapter.java index 79793f93..35d3d1de 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/adapters/AttendancesAdapter.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/AttendancesAdapter.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.adapters; +package pl.szczodrzynski.edziennik.ui.modules.attendance; import android.content.Context; import android.graphics.PorterDuff; @@ -125,4 +125,4 @@ public class AttendancesAdapter extends RecyclerView.Adapter { } } } -} \ No newline at end of file +} diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/messages/MessagesDetailsFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesDetailsFragment.java similarity index 99% rename from app/src/main/java/pl/szczodrzynski/edziennik/messages/MessagesDetailsFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesDetailsFragment.java index 1174b654..654e424d 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/messages/MessagesDetailsFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesDetailsFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.messages; +package pl.szczodrzynski.edziennik.ui.modules.messages; import android.content.Context; import android.content.Intent; @@ -60,8 +60,8 @@ import pl.szczodrzynski.edziennik.datamodels.MessageFull; import pl.szczodrzynski.edziennik.datamodels.MessageRecipientFull; import pl.szczodrzynski.edziennik.datamodels.Profile; import pl.szczodrzynski.edziennik.datamodels.ProfileFull; -import pl.szczodrzynski.edziennik.models.Date; -import pl.szczodrzynski.edziennik.models.Time; +import pl.szczodrzynski.edziennik.utils.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Time; import pl.szczodrzynski.edziennik.utils.Anim; import pl.szczodrzynski.edziennik.utils.Themes; import pl.szczodrzynski.edziennik.utils.Utils; @@ -673,4 +673,4 @@ public class MessagesDetailsFragment extends Fragment { .show(); b.messageSender.setOnClickListener(onClickListener); b.messageProfileBackground.setOnClickListener(onClickListener); - }*/ \ No newline at end of file + }*/ diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/messages/MessagesFragment.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesFragment.kt similarity index 98% rename from app/src/main/java/pl/szczodrzynski/edziennik/messages/MessagesFragment.kt rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesFragment.kt index bee3ff13..3b130c0b 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/messages/MessagesFragment.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesFragment.kt @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.messages +package pl.szczodrzynski.edziennik.ui.modules.messages import android.os.Bundle import android.view.LayoutInflater @@ -103,4 +103,4 @@ class MessagesFragment : Fragment() { return mFragmentTitleList[position] } } -} \ No newline at end of file +} diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/messages/MessagesListFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesListFragment.java similarity index 99% rename from app/src/main/java/pl/szczodrzynski/edziennik/messages/MessagesListFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesListFragment.java index 2d4b9b9f..d4216103 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/messages/MessagesListFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesListFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.messages; +package pl.szczodrzynski.edziennik.ui.modules.messages; import android.content.Context; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/messages/MessagesUtils.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesUtils.java similarity index 98% rename from app/src/main/java/pl/szczodrzynski/edziennik/messages/MessagesUtils.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesUtils.java index d7c97888..8c3d1c1e 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/messages/MessagesUtils.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesUtils.java @@ -1,11 +1,9 @@ -package pl.szczodrzynski.edziennik.messages; +package pl.szczodrzynski.edziennik.ui.modules.messages; -import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.RectF; -import android.graphics.drawable.Drawable; import androidx.core.graphics.ColorUtils; import pl.szczodrzynski.edziennik.App; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterMessagesWebFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/RegisterMessagesWebFragment.java similarity index 99% rename from app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterMessagesWebFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/RegisterMessagesWebFragment.java index 9c168eaf..aeda8455 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterMessagesWebFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/RegisterMessagesWebFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.fragments; +package pl.szczodrzynski.edziennik.ui.modules.messages; import android.Manifest; import android.annotation.SuppressLint; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/messages/SlideExplode.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/SlideExplode.java similarity index 97% rename from app/src/main/java/pl/szczodrzynski/edziennik/messages/SlideExplode.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/SlideExplode.java index bac1d687..6161b6dd 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/messages/SlideExplode.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/SlideExplode.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.messages; +package pl.szczodrzynski.edziennik.ui.modules.messages; import android.animation.Animator; import android.animation.ObjectAnimator; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/messages/Transitions.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/Transitions.java similarity index 89% rename from app/src/main/java/pl/szczodrzynski/edziennik/messages/Transitions.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/Transitions.java index 67b3a5b3..4e6f38a2 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/messages/Transitions.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/Transitions.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.messages; +package pl.szczodrzynski.edziennik.ui.modules.messages; import android.animation.TimeInterpolator; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/adapters/NoticesAdapter.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notices/NoticesAdapter.kt similarity index 97% rename from app/src/main/java/pl/szczodrzynski/edziennik/adapters/NoticesAdapter.kt rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notices/NoticesAdapter.kt index ef8f1328..2d4daaa3 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/adapters/NoticesAdapter.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notices/NoticesAdapter.kt @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.adapters +package pl.szczodrzynski.edziennik.ui.modules.notices import android.content.Context import android.graphics.PorterDuff @@ -20,7 +20,7 @@ import pl.szczodrzynski.edziennik.App import pl.szczodrzynski.edziennik.R import pl.szczodrzynski.edziennik.datamodels.Notice import pl.szczodrzynski.edziennik.datamodels.NoticeFull -import pl.szczodrzynski.edziennik.models.Date +import pl.szczodrzynski.edziennik.utils.models.Date import pl.szczodrzynski.edziennik.datamodels.LoginStore.LOGIN_TYPE_MOBIDZIENNIK import pl.szczodrzynski.edziennik.utils.Utils.bs @@ -88,4 +88,4 @@ class NoticesAdapter//getting the context and product list with constructor var noticesItemTeacherName: TextView = itemView.findViewById(R.id.noticesItemTeacherName) var noticesItemAddedDate: TextView = itemView.findViewById(R.id.noticesItemAddedDate) } -} \ No newline at end of file +} diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterNoticesFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notices/RegisterNoticesFragment.java similarity index 98% rename from app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterNoticesFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notices/RegisterNoticesFragment.java index fc495bbd..02dbbd2f 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterNoticesFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notices/RegisterNoticesFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.fragments; +package pl.szczodrzynski.edziennik.ui.modules.notices; import android.graphics.Color; import android.os.AsyncTask; @@ -25,7 +25,6 @@ import com.mikepenz.iconics.typeface.library.community.material.CommunityMateria import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.MainActivity; -import pl.szczodrzynski.edziennik.adapters.NoticesAdapter; import pl.szczodrzynski.edziennik.databinding.FragmentRegisterNoticesBinding; import pl.szczodrzynski.edziennik.datamodels.Notice; import pl.szczodrzynski.edziennik.datamodels.NoticeFull; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/adapters/NotificationsAdapter.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notifications/NotificationsAdapter.java similarity index 95% rename from app/src/main/java/pl/szczodrzynski/edziennik/adapters/NotificationsAdapter.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notifications/NotificationsAdapter.java index 8ec253b0..f54810b9 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/adapters/NotificationsAdapter.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notifications/NotificationsAdapter.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.adapters; +package pl.szczodrzynski.edziennik.ui.modules.notifications; import android.app.Activity; import android.content.Context; @@ -19,8 +19,8 @@ import java.util.List; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.models.Date; -import pl.szczodrzynski.edziennik.models.Notification; +import pl.szczodrzynski.edziennik.utils.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Notification; import static pl.szczodrzynski.edziennik.utils.Utils.d; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterNotificationsFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notifications/RegisterNotificationsFragment.java similarity index 95% rename from app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterNotificationsFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notifications/RegisterNotificationsFragment.java index 7b96196c..44c7e8d0 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterNotificationsFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notifications/RegisterNotificationsFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.fragments; +package pl.szczodrzynski.edziennik.ui.modules.notifications; import android.app.Activity; import android.os.Bundle; @@ -14,7 +14,6 @@ import android.view.ViewGroup; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.adapters.NotificationsAdapter; import pl.szczodrzynski.edziennik.databinding.FragmentRegisterNotificationsBinding; import pl.szczodrzynski.edziennik.utils.Themes; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/ProfileManagerFragment.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/ProfileManagerFragment.kt similarity index 96% rename from app/src/main/java/pl/szczodrzynski/edziennik/fragments/ProfileManagerFragment.kt rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/ProfileManagerFragment.kt index 43dc77a2..06952328 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/ProfileManagerFragment.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/ProfileManagerFragment.kt @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.fragments +package pl.szczodrzynski.edziennik.ui.modules.settings import android.os.Bundle import androidx.fragment.app.Fragment diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/activities/SettingsLicenseActivity.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/SettingsLicenseActivity.kt similarity index 99% rename from app/src/main/java/pl/szczodrzynski/edziennik/activities/SettingsLicenseActivity.kt rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/SettingsLicenseActivity.kt index 32b40443..31933c4d 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/activities/SettingsLicenseActivity.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/SettingsLicenseActivity.kt @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.activities +package pl.szczodrzynski.edziennik.ui.modules.settings import android.content.Context import android.net.Uri diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/SettingsNewFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/SettingsNewFragment.java similarity index 99% rename from app/src/main/java/pl/szczodrzynski/edziennik/fragments/SettingsNewFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/SettingsNewFragment.java index bde0ecd7..9883f7ac 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/SettingsNewFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/SettingsNewFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.fragments; +package pl.szczodrzynski.edziennik.ui.modules.settings; import android.app.Activity; import android.content.Context; @@ -45,15 +45,15 @@ import pl.szczodrzynski.edziennik.BuildConfig; import pl.szczodrzynski.edziennik.Notifier; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.MainActivity; -import pl.szczodrzynski.edziennik.activities.SettingsLicenseActivity; -import pl.szczodrzynski.edziennik.activities.WebPushConfigActivity; -import pl.szczodrzynski.edziennik.dialogs.ChangelogDialog; -import pl.szczodrzynski.edziennik.models.Endpoint; -import pl.szczodrzynski.edziennik.models.Time; +import pl.szczodrzynski.edziennik.ui.modules.webpush.WebPushConfigActivity; +import pl.szczodrzynski.edziennik.ui.dialogs.changelog.ChangelogDialog; +import pl.szczodrzynski.edziennik.utils.models.Endpoint; +import pl.szczodrzynski.edziennik.utils.models.Time; import pl.szczodrzynski.edziennik.network.NetworkUtils; import pl.szczodrzynski.edziennik.network.ServerRequest; import pl.szczodrzynski.edziennik.receivers.BootReceiver; import pl.szczodrzynski.edziennik.sync.SyncJob; +import pl.szczodrzynski.edziennik.ui.modules.home.HomeFragment; import pl.szczodrzynski.edziennik.utils.Themes; import pl.szczodrzynski.edziennik.utils.Utils; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterTimetableDayFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/RegisterTimetableDayFragment.java similarity index 94% rename from app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterTimetableDayFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/RegisterTimetableDayFragment.java index 93f47d7d..ae04e29b 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterTimetableDayFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/RegisterTimetableDayFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.fragments; +package pl.szczodrzynski.edziennik.ui.modules.timetable; import android.os.Bundle; import androidx.annotation.NonNull; @@ -17,10 +17,9 @@ import java.util.ArrayList; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.MainActivity; -import pl.szczodrzynski.edziennik.adapters.TimetableAdapter; import pl.szczodrzynski.edziennik.databinding.FragmentRegisterTimetableDayBinding; -import pl.szczodrzynski.edziennik.models.Date; -import pl.szczodrzynski.edziennik.models.Time; +import pl.szczodrzynski.edziennik.utils.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Time; import pl.szczodrzynski.edziennik.utils.Themes; public class RegisterTimetableDayFragment extends Fragment { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterTimetableFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/RegisterTimetableFragment.java similarity index 98% rename from app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterTimetableFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/RegisterTimetableFragment.java index bf7a9229..01efce47 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterTimetableFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/RegisterTimetableFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.fragments; +package pl.szczodrzynski.edziennik.ui.modules.timetable; import android.content.Intent; import android.graphics.Bitmap; @@ -51,10 +51,11 @@ import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.MainActivity; import pl.szczodrzynski.edziennik.databinding.FragmentRegisterTimetableBinding; import pl.szczodrzynski.edziennik.datamodels.LessonFull; -import pl.szczodrzynski.edziennik.dialogs.EventManualDialog; -import pl.szczodrzynski.edziennik.models.Date; -import pl.szczodrzynski.edziennik.models.Time; -import pl.szczodrzynski.edziennik.models.Week; +import pl.szczodrzynski.edziennik.ui.dialogs.event.EventManualDialog; +import pl.szczodrzynski.edziennik.ui.modules.home.HomeFragment; +import pl.szczodrzynski.edziennik.utils.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Time; +import pl.szczodrzynski.edziennik.utils.models.Week; import pl.szczodrzynski.edziennik.utils.SpannableHtmlTagHandler; import pl.szczodrzynski.edziennik.utils.Themes; import pl.szczodrzynski.edziennik.utils.Utils; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/adapters/TimetableAdapter.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/TimetableAdapter.java similarity index 98% rename from app/src/main/java/pl/szczodrzynski/edziennik/adapters/TimetableAdapter.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/TimetableAdapter.java index d056c26c..bb29cd46 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/adapters/TimetableAdapter.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/TimetableAdapter.java @@ -1,7 +1,6 @@ -package pl.szczodrzynski.edziennik.adapters; +package pl.szczodrzynski.edziennik.ui.modules.timetable; import android.content.Context; -import android.graphics.Color; import android.graphics.PorterDuff; import android.graphics.PorterDuffColorFilter; import android.graphics.Typeface; @@ -28,8 +27,8 @@ import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.datamodels.EventFull; import pl.szczodrzynski.edziennik.datamodels.LessonChange; import pl.szczodrzynski.edziennik.datamodels.LessonFull; -import pl.szczodrzynski.edziennik.dialogs.EventListDialog; -import pl.szczodrzynski.edziennik.models.Date; +import pl.szczodrzynski.edziennik.ui.dialogs.event.EventListDialog; +import pl.szczodrzynski.edziennik.utils.models.Date; import pl.szczodrzynski.edziennik.utils.SpannableHtmlTagHandler; import pl.szczodrzynski.edziennik.utils.Themes; import pl.szczodrzynski.edziennik.utils.Utils; @@ -199,4 +198,4 @@ public class TimetableAdapter extends RecyclerView.Adapter { ", day=" + day + '}'; } -} \ No newline at end of file +} diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/models/Endpoint.java b/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/Endpoint.java similarity index 90% rename from app/src/main/java/pl/szczodrzynski/edziennik/models/Endpoint.java rename to app/src/main/java/pl/szczodrzynski/edziennik/utils/models/Endpoint.java index 56b4f239..79bfaacf 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/models/Endpoint.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/Endpoint.java @@ -1,6 +1,4 @@ -package pl.szczodrzynski.edziennik.models; - -import androidx.annotation.StringRes; +package pl.szczodrzynski.edziennik.utils.models; import java.util.List; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/models/ItemGradesSubjectModel.java b/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/ItemGradesSubjectModel.java similarity index 98% rename from app/src/main/java/pl/szczodrzynski/edziennik/models/ItemGradesSubjectModel.java rename to app/src/main/java/pl/szczodrzynski/edziennik/utils/models/ItemGradesSubjectModel.java index 48f04b27..abcf6f06 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/models/ItemGradesSubjectModel.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/ItemGradesSubjectModel.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.models; +package pl.szczodrzynski.edziennik.utils.models; import java.util.List; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/models/ItemTimetableModel.java b/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/ItemTimetableModel.java similarity index 90% rename from app/src/main/java/pl/szczodrzynski/edziennik/models/ItemTimetableModel.java rename to app/src/main/java/pl/szczodrzynski/edziennik/utils/models/ItemTimetableModel.java index 515f6dc0..24197cbf 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/models/ItemTimetableModel.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/ItemTimetableModel.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.models; +package pl.szczodrzynski.edziennik.utils.models; import java.util.List; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/models/ItemWidgetTimetableModel.java b/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/ItemWidgetTimetableModel.java similarity index 94% rename from app/src/main/java/pl/szczodrzynski/edziennik/models/ItemWidgetTimetableModel.java rename to app/src/main/java/pl/szczodrzynski/edziennik/utils/models/ItemWidgetTimetableModel.java index 15f09f08..479845da 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/models/ItemWidgetTimetableModel.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/ItemWidgetTimetableModel.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.models; +package pl.szczodrzynski.edziennik.utils.models; import java.util.ArrayList; import java.util.List; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/models/NavTarget.kt b/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/NavTarget.kt similarity index 97% rename from app/src/main/java/pl/szczodrzynski/edziennik/models/NavTarget.kt rename to app/src/main/java/pl/szczodrzynski/edziennik/utils/models/NavTarget.kt index 38389c83..5e707993 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/models/NavTarget.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/NavTarget.kt @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.models +package pl.szczodrzynski.edziennik.utils.models import androidx.fragment.app.Fragment import com.mikepenz.iconics.typeface.IIcon @@ -88,4 +88,4 @@ data class NavTarget( this.subItems = items return this } -} \ No newline at end of file +} diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/models/Notification.java b/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/Notification.java similarity index 99% rename from app/src/main/java/pl/szczodrzynski/edziennik/models/Notification.java rename to app/src/main/java/pl/szczodrzynski/edziennik/utils/models/Notification.java index 6d420358..047cd16f 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/models/Notification.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/Notification.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.models; +package pl.szczodrzynski.edziennik.utils.models; import android.content.Context; import android.content.Intent; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/models/Time.java b/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/Time.java similarity index 99% rename from app/src/main/java/pl/szczodrzynski/edziennik/models/Time.java rename to app/src/main/java/pl/szczodrzynski/edziennik/utils/models/Time.java index f990df1a..12277516 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/models/Time.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/Time.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.models; +package pl.szczodrzynski.edziennik.utils.models; import java.util.Calendar; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/models/Week.java b/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/Week.java similarity index 76% rename from app/src/main/java/pl/szczodrzynski/edziennik/models/Week.java rename to app/src/main/java/pl/szczodrzynski/edziennik/utils/models/Week.java index 33a5866b..309466c8 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/models/Week.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/Week.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.models; +package pl.szczodrzynski.edziennik.utils.models; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -15,7 +15,7 @@ public class Week { public static int SATURDAY = 5; public static int SUNDAY = 6; - public static pl.szczodrzynski.edziennik.models.Date getNearestWeekDayDate(int day) + public static pl.szczodrzynski.edziennik.utils.models.Date getNearestWeekDayDate(int day) { Calendar c = Calendar.getInstance(); int dayDiff = day - getTodayWeekDay(); @@ -23,21 +23,21 @@ public class Week { dayDiff = 7 + dayDiff; } c.setTimeInMillis(c.getTimeInMillis() + (dayDiff * 24 * 60 * 60 * 1000)); - return new pl.szczodrzynski.edziennik.models.Date(c.get(Calendar.YEAR), c.get(Calendar.MONTH)+1, c.get(Calendar.DAY_OF_MONTH)); + return new pl.szczodrzynski.edziennik.utils.models.Date(c.get(Calendar.YEAR), c.get(Calendar.MONTH)+1, c.get(Calendar.DAY_OF_MONTH)); } - public static pl.szczodrzynski.edziennik.models.Date getWeekStart() { - pl.szczodrzynski.edziennik.models.Date date = pl.szczodrzynski.edziennik.models.Date.getToday(); + public static pl.szczodrzynski.edziennik.utils.models.Date getWeekStart() { + pl.szczodrzynski.edziennik.utils.models.Date date = pl.szczodrzynski.edziennik.utils.models.Date.getToday(); date.stepForward(0, 0, -date.getWeekDay()); return date; } - public static pl.szczodrzynski.edziennik.models.Date getWeekEnd() { - pl.szczodrzynski.edziennik.models.Date date = pl.szczodrzynski.edziennik.models.Date.getToday(); + public static pl.szczodrzynski.edziennik.utils.models.Date getWeekEnd() { + pl.szczodrzynski.edziennik.utils.models.Date date = pl.szczodrzynski.edziennik.utils.models.Date.getToday(); date.stepForward(0, 0, 6-date.getWeekDay()); return date; } - public static int getWeekDayFromDate(pl.szczodrzynski.edziennik.models.Date date) + public static int getWeekDayFromDate(pl.szczodrzynski.edziennik.utils.models.Date date) { Calendar c = Calendar.getInstance(); c.set(date.year, date.month - 1, date.day); diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/models/db/LessonChangeCounter.java b/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/db/LessonChangeCounter.java similarity index 55% rename from app/src/main/java/pl/szczodrzynski/edziennik/models/db/LessonChangeCounter.java rename to app/src/main/java/pl/szczodrzynski/edziennik/utils/models/db/LessonChangeCounter.java index b98869c3..2ebf319a 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/models/db/LessonChangeCounter.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/db/LessonChangeCounter.java @@ -1,6 +1,6 @@ -package pl.szczodrzynski.edziennik.models.db; +package pl.szczodrzynski.edziennik.utils.models.db; -import pl.szczodrzynski.edziennik.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Date; public class LessonChangeCounter { public int profileId; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/models/db/UnreadCounter.kt b/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/db/UnreadCounter.kt similarity index 86% rename from app/src/main/java/pl/szczodrzynski/edziennik/models/db/UnreadCounter.kt rename to app/src/main/java/pl/szczodrzynski/edziennik/utils/models/db/UnreadCounter.kt index 04530296..7e05bc2b 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/models/db/UnreadCounter.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/db/UnreadCounter.kt @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.models.db +package pl.szczodrzynski.edziennik.utils.models.db import pl.szczodrzynski.navlib.drawer.IUnreadCounter diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/widgets/WidgetConfigActivity.java b/app/src/main/java/pl/szczodrzynski/edziennik/widgets/WidgetConfigActivity.java index 9649cc0b..5e466f19 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/widgets/WidgetConfigActivity.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/widgets/WidgetConfigActivity.java @@ -3,22 +3,15 @@ package pl.szczodrzynski.edziennik.widgets; import android.app.Activity; import android.app.WallpaperManager; import android.appwidget.AppWidgetManager; -import android.content.ComponentName; import android.content.Intent; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; import android.graphics.Color; import android.graphics.PorterDuff; import android.graphics.PorterDuffColorFilter; import android.graphics.drawable.ColorDrawable; -import android.media.ThumbnailUtils; import android.os.AsyncTask; import android.os.Bundle; import android.widget.SeekBar; -import androidx.core.graphics.drawable.RoundedBitmapDrawable; -import androidx.core.graphics.drawable.RoundedBitmapDrawableFactory; - import com.afollestad.materialdialogs.MaterialDialog; import com.afollestad.materialdialogs.simplelist.MaterialSimpleListAdapter; import com.afollestad.materialdialogs.simplelist.MaterialSimpleListItem; @@ -34,7 +27,6 @@ import pl.szczodrzynski.edziennik.widgets.luckynumber.WidgetLuckyNumber; import pl.szczodrzynski.edziennik.widgets.notifications.WidgetNotifications; import static pl.szczodrzynski.edziennik.ExtensionsKt.filterOutArchived; -import static pl.szczodrzynski.edziennik.utils.Utils.d; public class WidgetConfigActivity extends Activity { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/widgets/luckynumber/WidgetLuckyNumber.java b/app/src/main/java/pl/szczodrzynski/edziennik/widgets/luckynumber/WidgetLuckyNumber.java index 7c2b847c..02ea44a7 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/widgets/luckynumber/WidgetLuckyNumber.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/widgets/luckynumber/WidgetLuckyNumber.java @@ -25,7 +25,7 @@ import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.MainActivity; import pl.szczodrzynski.edziennik.datamodels.Profile; -import pl.szczodrzynski.edziennik.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Date; import pl.szczodrzynski.edziennik.sync.SyncJob; import pl.szczodrzynski.edziennik.widgets.WidgetConfig; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/widgets/notifications/WidgetNotificationsListProvider.java b/app/src/main/java/pl/szczodrzynski/edziennik/widgets/notifications/WidgetNotificationsListProvider.java index ff655dca..b3da2ee6 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/widgets/notifications/WidgetNotificationsListProvider.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/widgets/notifications/WidgetNotificationsListProvider.java @@ -7,13 +7,10 @@ import android.util.Log; import android.widget.RemoteViews; import android.widget.RemoteViewsService; -import java.util.List; - import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.models.Date; -import pl.szczodrzynski.edziennik.models.ItemWidgetTimetableModel; -import pl.szczodrzynski.edziennik.models.Notification; +import pl.szczodrzynski.edziennik.utils.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Notification; public class WidgetNotificationsListProvider implements RemoteViewsService.RemoteViewsFactory { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/widgets/timetable/LessonDetailsActivity.java b/app/src/main/java/pl/szczodrzynski/edziennik/widgets/timetable/LessonDetailsActivity.java index 12f7c157..7be441e6 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/widgets/timetable/LessonDetailsActivity.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/widgets/timetable/LessonDetailsActivity.java @@ -14,9 +14,9 @@ import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.MainActivity; import pl.szczodrzynski.edziennik.WidgetTimetable; -import pl.szczodrzynski.edziennik.dialogs.EventListDialog; -import pl.szczodrzynski.edziennik.models.Date; -import pl.szczodrzynski.edziennik.models.Time; +import pl.szczodrzynski.edziennik.ui.dialogs.event.EventListDialog; +import pl.szczodrzynski.edziennik.utils.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Time; import pl.szczodrzynski.edziennik.utils.Themes; import static android.content.Intent.FLAG_ACTIVITY_REORDER_TO_FRONT; @@ -68,4 +68,4 @@ public class LessonDetailsActivity extends AppCompatActivity { Toast.makeText(app, R.string.error_reading_lesson_details, Toast.LENGTH_SHORT).show(); finish(); } -} \ No newline at end of file +} diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/widgets/timetable/WidgetTimetableListProvider.java b/app/src/main/java/pl/szczodrzynski/edziennik/widgets/timetable/WidgetTimetableListProvider.java index 01e3475f..2872c15f 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/widgets/timetable/WidgetTimetableListProvider.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/widgets/timetable/WidgetTimetableListProvider.java @@ -28,9 +28,9 @@ import java.util.List; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.WidgetTimetable; -import pl.szczodrzynski.edziennik.models.Date; -import pl.szczodrzynski.edziennik.models.ItemWidgetTimetableModel; -import pl.szczodrzynski.edziennik.models.Time; +import pl.szczodrzynski.edziennik.utils.models.Date; +import pl.szczodrzynski.edziennik.utils.models.ItemWidgetTimetableModel; +import pl.szczodrzynski.edziennik.utils.models.Time; public class WidgetTimetableListProvider implements RemoteViewsService.RemoteViewsFactory { @@ -308,4 +308,4 @@ public class WidgetTimetableListProvider implements RemoteViewsService.RemoteVie public boolean hasStableIds() { return true; } -} \ No newline at end of file +} diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/widgets/timetable/WidgetTimetableService.java b/app/src/main/java/pl/szczodrzynski/edziennik/widgets/timetable/WidgetTimetableService.java index eedc3f5b..594fe591 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/widgets/timetable/WidgetTimetableService.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/widgets/timetable/WidgetTimetableService.java @@ -3,8 +3,6 @@ package pl.szczodrzynski.edziennik.widgets.timetable; import android.content.Intent; import android.widget.RemoteViewsService; -import pl.szczodrzynski.edziennik.widgets.timetable.WidgetTimetableListProvider; - public class WidgetTimetableService extends RemoteViewsService { /* * So pretty simple just defining the Adapter of the listview @@ -16,4 +14,4 @@ public class WidgetTimetableService extends RemoteViewsService { return (new WidgetTimetableListProvider(this.getApplicationContext(), intent)); } -} \ No newline at end of file +} diff --git a/app/src/main/res/layout/activity_feedback.xml b/app/src/main/res/layout/activity_feedback.xml index 59860d56..491780d5 100644 --- a/app/src/main/res/layout/activity_feedback.xml +++ b/app/src/main/res/layout/activity_feedback.xml @@ -7,7 +7,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" - tools:context=".activities.FeedbackActivity"> + tools:context=".ui.modules.base.FeedbackActivity"> - \ No newline at end of file + diff --git a/app/src/main/res/layout/dialog_grade_details.xml b/app/src/main/res/layout/dialog_grade_details.xml index d875abd5..691ca1ff 100644 --- a/app/src/main/res/layout/dialog_grade_details.xml +++ b/app/src/main/res/layout/dialog_grade_details.xml @@ -5,8 +5,8 @@ - - + + diff --git a/app/src/main/res/layout/fragment_debug.xml b/app/src/main/res/layout/fragment_debug.xml index 2608ac75..6dd2413c 100644 --- a/app/src/main/res/layout/fragment_debug.xml +++ b/app/src/main/res/layout/fragment_debug.xml @@ -4,7 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".fragments.DebugFragment"> + tools:context=".ui.modules.base.DebugFragment"> + tools:context=".ui.modules.home.HomeFragment"> - \ No newline at end of file + diff --git a/app/src/main/res/layout/messages_compose_activity.xml b/app/src/main/res/layout/messages_compose_activity.xml index d826b83b..ce5cb2e3 100644 --- a/app/src/main/res/layout/messages_compose_activity.xml +++ b/app/src/main/res/layout/messages_compose_activity.xml @@ -6,7 +6,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" - tools:context=".messages.MessagesComposeActivity"> + tools:context=".ui.modules.messages.MessagesComposeActivity"> - \ No newline at end of file + diff --git a/app/src/main/res/navigation/nav_login.xml b/app/src/main/res/navigation/nav_login.xml index 9c2b1bba..825b646f 100644 --- a/app/src/main/res/navigation/nav_login.xml +++ b/app/src/main/res/navigation/nav_login.xml @@ -6,7 +6,7 @@ - \ No newline at end of file + diff --git a/app/src/main/res/xml/widget_lucky_number_info.xml b/app/src/main/res/xml/widget_lucky_number_info.xml index e768ceaa..18721b35 100644 --- a/app/src/main/res/xml/widget_lucky_number_info.xml +++ b/app/src/main/res/xml/widget_lucky_number_info.xml @@ -12,4 +12,4 @@ android:updatePeriodMillis="1800000" android:widgetCategory="home_screen" android:configure="pl.szczodrzynski.edziennik.widgets.WidgetConfigActivity" - tools:ignore="UnusedAttribute" /> \ No newline at end of file + tools:ignore="UnusedAttribute" /> diff --git a/app/src/main/res/xml/widget_notifications_info.xml b/app/src/main/res/xml/widget_notifications_info.xml index b4931451..e15ea4b9 100644 --- a/app/src/main/res/xml/widget_notifications_info.xml +++ b/app/src/main/res/xml/widget_notifications_info.xml @@ -12,4 +12,4 @@ android:updatePeriodMillis="5400000" android:widgetCategory="home_screen" android:configure="pl.szczodrzynski.edziennik.widgets.WidgetConfigActivity" - tools:ignore="UnusedAttribute" /> \ No newline at end of file + tools:ignore="UnusedAttribute" /> diff --git a/app/src/main/res/xml/widget_timetable_info.xml b/app/src/main/res/xml/widget_timetable_info.xml index e8b8dadb..a549737f 100644 --- a/app/src/main/res/xml/widget_timetable_info.xml +++ b/app/src/main/res/xml/widget_timetable_info.xml @@ -12,4 +12,4 @@ android:updatePeriodMillis="1800000" android:widgetCategory="home_screen" android:configure="pl.szczodrzynski.edziennik.widgets.WidgetConfigActivity" - tools:ignore="UnusedAttribute" /> \ No newline at end of file + tools:ignore="UnusedAttribute" /> From 26c801ebee94d3ebff4aaa90c2dcfa077ab256b5 Mon Sep 17 00:00:00 2001 From: Kacper Ziubryniewicz Date: Sat, 28 Sep 2019 15:17:03 +0200 Subject: [PATCH 2/3] [Structure] Move daos and models to database modules --- .../java/pl/szczodrzynski/edziennik/App.java | 24 ++-- .../pl/szczodrzynski/edziennik/Extensions.kt | 4 +- .../szczodrzynski/edziennik/MainActivity.kt | 14 +- .../pl/szczodrzynski/edziennik/Notifier.java | 2 +- .../edziennik/WidgetTimetable.java | 10 +- .../api/interfaces/MessageListCallback.java | 9 -- .../interfaces/RecipientListGetCallback.java | 9 -- .../edziennik/api/v2/ApiLoginResult.kt | 6 - .../edziennik/api/v2/FirstLoginResult.kt | 6 - .../api/v2/librus/data/DataLibrus.kt | 10 -- .../v2/librus/firstlogin/FirstLoginLibrus.kt | 12 -- .../librus/firstlogin/FirstLoginSynergia.kt | 12 -- .../edziennik/{ => data}/api/AppError.java | 2 +- .../edziennik/{ => data}/api/Edziennik.java | 96 ++++++------- .../edziennik/{ => data}/api/Iuczniowie.java | 94 ++++++------ .../edziennik/{ => data}/api/Librus.java | 134 +++++++++--------- .../{ => data}/api/Mobidziennik.java | 96 ++++++------- .../edziennik/{ => data}/api/Vulcan.java | 90 ++++++------ .../api/interfaces/AttachmentGetCallback.java | 2 +- .../api/interfaces/EdziennikInterface.java | 13 +- .../api/interfaces/ErrorCallback.java | 4 +- .../api/interfaces/LoginCallback.java | 2 +- .../api/interfaces/MessageGetCallback.java | 5 +- .../api/interfaces/MessageListCallback.java | 9 ++ .../api/interfaces/ProgressCallback.java | 2 +- .../interfaces/RecipientListGetCallback.java | 9 ++ .../api/interfaces/SyncCallback.java | 11 +- .../edziennik/data/api/v2/ApiLoginResult.kt | 6 + .../edziennik/{ => data}/api/v2/Constants.kt | 2 +- .../edziennik/data/api/v2/FirstLoginResult.kt | 6 + .../{ => data}/api/v2/librus/Librus.kt | 36 ++--- .../data/api/v2/librus/data/DataLibrus.kt | 10 ++ .../v2/librus/firstlogin/FirstLoginLibrus.kt | 12 ++ .../librus/firstlogin/FirstLoginSynergia.kt | 12 ++ .../api/v2/librus/login/LoginJst.kt | 9 +- .../api/v2/librus/login/LoginLibrus.kt | 14 +- .../api/v2/librus/login/LoginSynergia.kt | 8 +- .../v2/librus/login/SynergiaTokenExtractor.kt | 18 +-- .../{ => data}/api/v2/models/DataStore.kt | 19 ++- .../{ => data}/api/v2/models/Feature.kt | 4 +- .../{ => data}/api/v2/models/Features.kt | 6 +- .../{datamodels => data/db}/AppDb.java | 48 ++++++- .../db/converters}/ConverterDate.java | 2 +- .../db/converters}/ConverterJsonObject.java | 2 +- .../db/converters}/ConverterListLong.java | 2 +- .../db/converters}/ConverterListString.java | 2 +- .../db/converters}/ConverterTime.java | 2 +- .../modules/announcements}/Announcement.java | 2 +- .../announcements}/AnnouncementDao.java | 6 +- .../announcements}/AnnouncementFull.java | 2 +- .../db/modules/attendance}/Attendance.java | 2 +- .../db/modules/attendance}/AttendanceDao.java | 4 +- .../modules/attendance}/AttendanceFull.java | 2 +- .../db/modules/debuglog}/DebugLog.java | 3 +- .../db/modules/debuglog}/DebugLogDao.java | 2 +- .../db/modules/events}/Event.java | 2 +- .../db/modules/events}/EventDao.java | 8 +- .../db/modules/events}/EventFull.java | 2 +- .../db/modules/events}/EventType.java | 4 +- .../db/modules/events}/EventTypeDao.java | 2 +- .../db/modules/feedback}/FeedbackMessage.java | 2 +- .../modules/feedback}/FeedbackMessageDao.java | 2 +- .../feedback}/FeedbackMessageWithCount.java | 2 +- .../db/modules/grades}/Grade.java | 2 +- .../db/modules/grades}/GradeCategory.java | 2 +- .../db/modules/grades}/GradeCategoryDao.java | 2 +- .../db/modules/grades}/GradeDao.java | 4 +- .../db/modules/grades}/GradeFull.java | 2 +- .../db/modules/lessons}/Lesson.java | 2 +- .../db/modules/lessons}/LessonChange.java | 2 +- .../db/modules/lessons}/LessonChangeDao.java | 4 +- .../db/modules/lessons}/LessonChangeFull.java | 2 +- .../db/modules/lessons}/LessonDao.java | 2 +- .../db/modules/lessons}/LessonFull.java | 8 +- .../db/modules/login}/LoginStore.java | 5 +- .../db/modules/login}/LoginStoreDao.java | 4 +- .../db/modules/luckynumber}/LuckyNumber.java | 2 +- .../modules/luckynumber}/LuckyNumberDao.java | 2 +- .../db/modules/messages}/Message.java | 2 +- .../db/modules/messages}/MessageDao.java | 12 +- .../db/modules/messages}/MessageFull.java | 2 +- .../modules/messages}/MessageRecipient.java | 2 +- .../messages}/MessageRecipientDao.java | 5 +- .../messages}/MessageRecipientFull.java | 2 +- .../db/modules/metadata}/Metadata.java | 2 +- .../db/modules/metadata}/MetadataDao.java | 26 ++-- .../db/modules/notices}/Notice.java | 2 +- .../db/modules/notices}/NoticeDao.java | 6 +- .../db/modules/notices}/NoticeFull.java | 2 +- .../db/modules/profiles}/Profile.kt | 2 +- .../db/modules/profiles}/ProfileDao.java | 4 +- .../db/modules/profiles}/ProfileFull.kt | 5 +- .../db/modules/subjects}/Subject.java | 2 +- .../db/modules/subjects}/SubjectDao.java | 2 +- .../db/modules/teachers}/Teacher.java | 3 +- .../db/modules/teachers}/TeacherDao.java | 2 +- .../db/modules/teams}/Team.java | 2 +- .../db/modules/teams}/TeamDao.java | 2 +- .../edziennik/network/ServerRequest.java | 4 +- .../sync/MyFirebaseMessagingService.java | 16 +-- .../edziennik/sync/SyncService.java | 10 +- .../ui/dialogs/event/EventListAdapter.java | 6 +- .../ui/dialogs/event/EventListDialog.java | 4 +- .../ui/dialogs/event/EventManualDialog.java | 30 ++-- .../ui/dialogs/grade/GradeDetailsDialog.java | 6 +- .../lessonchange/LessonChangeDialog.java | 2 +- .../RegisterAgendaCalendarFragment.java | 4 +- .../agenda/RegisterAgendaDefaultFragment.java | 10 +- .../announcements/AnnouncementsAdapter.java | 2 +- .../RegisterAnnouncementsFragment.java | 2 +- .../attendance/AttendancesAdapter.java | 14 +- .../RegisterAttendancesFragment.java | 22 +-- .../ui/modules/base/CrashActivity.java | 2 +- .../ui/modules/base/FeedbackActivity.java | 4 +- .../ui/modules/base/FeedbackFragment.kt | 2 +- .../ui/modules/grades/GradesListAdapter.java | 6 +- .../modules/grades/GradesSubjectAdapter.java | 15 +- .../grades/RegisterGradesFragment.java | 18 +-- .../grades/editor/GradesEditorFragment.kt | 10 +- .../ui/modules/home/CounterActivity.java | 3 +- .../ui/modules/home/HomeFragment.java | 22 +-- .../ui/modules/home/HomeTimetableCard.java | 8 +- .../ui/modules/homework/HomeworkAdapter.java | 2 +- .../ui/modules/homework/HomeworkFragment.kt | 2 +- .../modules/homework/HomeworkListFragment.kt | 2 +- .../ui/modules/login/LoginActivity.java | 2 +- .../login/LoginIuczniowieFragment.java | 8 +- .../ui/modules/login/LoginLibrusFragment.java | 8 +- .../modules/login/LoginMigrationFragment.java | 88 ++++++------ .../login/LoginMigrationSyncFragment.java | 10 +- .../login/LoginMobidziennikFragment.java | 12 +- .../ui/modules/login/LoginProfileObject.java | 4 +- .../modules/login/LoginProgressFragment.java | 14 +- .../modules/login/LoginSummaryFragment.java | 2 +- .../ui/modules/login/LoginSyncFragment.java | 60 ++++---- .../ui/modules/login/LoginVulcanFragment.java | 12 +- .../ui/modules/messages/MessagesAdapter.java | 6 +- .../messages/MessagesComposeActivity.java | 14 +- .../MessagesComposeSuggestionAdapter.java | 2 +- .../messages/MessagesDetailsFragment.java | 16 +-- .../ui/modules/messages/MessagesFragment.kt | 2 +- .../messages/MessagesListFragment.java | 20 +-- .../ui/modules/messages/MessagesUtils.java | 12 +- .../ui/modules/notices/NoticesAdapter.kt | 6 +- .../notices/RegisterNoticesFragment.java | 6 +- .../modules/settings/SettingsNewFragment.java | 14 +- .../timetable/RegisterTimetableFragment.java | 8 +- .../modules/timetable/TimetableAdapter.java | 8 +- .../webpush/WebPushConfigActivity.java | 2 +- .../szczodrzynski/edziennik/utils/Colors.java | 2 +- .../edziennik/utils/models/AppConfig.java | 8 +- .../utils/models/ItemGradesSubjectModel.java | 6 +- .../utils/models/ItemTimetableModel.java | 4 +- .../widgets/WidgetConfigActivity.java | 2 +- .../luckynumber/WidgetLuckyNumber.java | 2 +- .../main/res/layout/dialog_grade_details.xml | 2 +- 156 files changed, 872 insertions(+), 804 deletions(-) delete mode 100644 app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/MessageListCallback.java delete mode 100644 app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/RecipientListGetCallback.java delete mode 100644 app/src/main/java/pl/szczodrzynski/edziennik/api/v2/ApiLoginResult.kt delete mode 100644 app/src/main/java/pl/szczodrzynski/edziennik/api/v2/FirstLoginResult.kt delete mode 100644 app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/data/DataLibrus.kt delete mode 100644 app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/firstlogin/FirstLoginLibrus.kt delete mode 100644 app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/firstlogin/FirstLoginSynergia.kt rename app/src/main/java/pl/szczodrzynski/edziennik/{ => data}/api/AppError.java (99%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => data}/api/Edziennik.java (93%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => data}/api/Iuczniowie.java (95%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => data}/api/Librus.java (96%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => data}/api/Mobidziennik.java (96%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => data}/api/Vulcan.java (95%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => data}/api/interfaces/AttachmentGetCallback.java (85%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => data}/api/interfaces/EdziennikInterface.java (88%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => data}/api/interfaces/ErrorCallback.java (61%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => data}/api/interfaces/LoginCallback.java (50%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => data}/api/interfaces/MessageGetCallback.java (60%) create mode 100644 app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/MessageListCallback.java rename app/src/main/java/pl/szczodrzynski/edziennik/{ => data}/api/interfaces/ProgressCallback.java (77%) create mode 100644 app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/RecipientListGetCallback.java rename app/src/main/java/pl/szczodrzynski/edziennik/{ => data}/api/interfaces/SyncCallback.java (55%) create mode 100644 app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/ApiLoginResult.kt rename app/src/main/java/pl/szczodrzynski/edziennik/{ => data}/api/v2/Constants.kt (96%) create mode 100644 app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/FirstLoginResult.kt rename app/src/main/java/pl/szczodrzynski/edziennik/{ => data}/api/v2/librus/Librus.kt (85%) create mode 100644 app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/librus/data/DataLibrus.kt create mode 100644 app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/librus/firstlogin/FirstLoginLibrus.kt create mode 100644 app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/librus/firstlogin/FirstLoginSynergia.kt rename app/src/main/java/pl/szczodrzynski/edziennik/{ => data}/api/v2/librus/login/LoginJst.kt (50%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => data}/api/v2/librus/login/LoginLibrus.kt (96%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => data}/api/v2/librus/login/LoginSynergia.kt (55%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => data}/api/v2/librus/login/SynergiaTokenExtractor.kt (91%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => data}/api/v2/models/DataStore.kt (79%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => data}/api/v2/models/Feature.kt (64%) rename app/src/main/java/pl/szczodrzynski/edziennik/{ => data}/api/v2/models/Features.kt (73%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db}/AppDb.java (89%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/converters}/ConverterDate.java (87%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/converters}/ConverterJsonObject.java (89%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/converters}/ConverterListLong.java (90%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/converters}/ConverterListString.java (90%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/converters}/ConverterTime.java (88%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/announcements}/Announcement.java (94%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/announcements}/AnnouncementDao.java (92%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/announcements}/AnnouncementFull.java (74%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/attendance}/Attendance.java (96%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/attendance}/AttendanceDao.java (96%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/attendance}/AttendanceFull.java (81%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/debuglog}/DebugLog.java (82%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/debuglog}/DebugLogDao.java (69%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/events}/Event.java (98%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/events}/EventDao.java (95%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/events}/EventFull.java (96%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/events}/EventType.java (92%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/events}/EventTypeDao.java (93%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/feedback}/FeedbackMessage.java (91%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/feedback}/FeedbackMessageDao.java (94%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/feedback}/FeedbackMessageWithCount.java (62%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/grades}/Grade.java (98%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/grades}/GradeCategory.java (95%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/grades}/GradeCategoryDao.java (94%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/grades}/GradeDao.java (97%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/grades}/GradeFull.java (84%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/lessons}/Lesson.java (97%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/lessons}/LessonChange.java (98%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/lessons}/LessonChangeDao.java (97%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/lessons}/LessonChangeFull.java (84%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/lessons}/LessonDao.java (99%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/lessons}/LessonFull.java (94%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/login}/LoginStore.java (97%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/login}/LoginStoreDao.java (90%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/luckynumber}/LuckyNumber.java (90%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/luckynumber}/LuckyNumberDao.java (94%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/messages}/Message.java (97%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/messages}/MessageDao.java (89%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/messages}/MessageFull.java (89%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/messages}/MessageRecipient.java (94%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/messages}/MessageRecipientDao.java (92%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/messages}/MessageRecipientFull.java (88%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/metadata}/Metadata.java (97%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/metadata}/MetadataDao.java (88%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/notices}/Notice.java (94%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/notices}/NoticeDao.java (92%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/notices}/NoticeFull.java (75%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/profiles}/Profile.kt (99%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/profiles}/ProfileDao.java (95%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/profiles}/ProfileFull.kt (97%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/subjects}/Subject.java (96%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/subjects}/SubjectDao.java (94%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/teachers}/Teacher.java (98%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/teachers}/TeacherDao.java (95%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/teams}/Team.java (95%) rename app/src/main/java/pl/szczodrzynski/edziennik/{datamodels => data/db/modules/teams}/TeamDao.java (97%) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/App.java b/app/src/main/java/pl/szczodrzynski/edziennik/App.java index 7822861b..afb44fda 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/App.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/App.java @@ -64,16 +64,16 @@ import okhttp3.ConnectionSpec; import okhttp3.OkHttpClient; import okhttp3.TlsVersion; import pl.szczodrzynski.edziennik.ui.modules.base.CrashActivity; -import pl.szczodrzynski.edziennik.api.Edziennik; -import pl.szczodrzynski.edziennik.api.Iuczniowie; -import pl.szczodrzynski.edziennik.api.Librus; -import pl.szczodrzynski.edziennik.api.Mobidziennik; -import pl.szczodrzynski.edziennik.api.Vulcan; -import pl.szczodrzynski.edziennik.datamodels.AppDb; -import pl.szczodrzynski.edziennik.datamodels.DebugLog; -import pl.szczodrzynski.edziennik.datamodels.LoginStore; -import pl.szczodrzynski.edziennik.datamodels.Profile; -import pl.szczodrzynski.edziennik.datamodels.ProfileFull; +import pl.szczodrzynski.edziennik.data.api.Edziennik; +import pl.szczodrzynski.edziennik.data.api.Iuczniowie; +import pl.szczodrzynski.edziennik.data.api.Librus; +import pl.szczodrzynski.edziennik.data.api.Mobidziennik; +import pl.szczodrzynski.edziennik.data.api.Vulcan; +import pl.szczodrzynski.edziennik.data.db.AppDb; +import pl.szczodrzynski.edziennik.data.db.modules.debuglog.DebugLog; +import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.ProfileFull; import pl.szczodrzynski.edziennik.utils.models.AppConfig; import pl.szczodrzynski.edziennik.network.NetworkUtils; import pl.szczodrzynski.edziennik.network.TLSSocketFactory; @@ -83,8 +83,8 @@ import pl.szczodrzynski.edziennik.utils.PermissionChecker; import pl.szczodrzynski.edziennik.utils.Themes; import pl.szczodrzynski.edziennik.utils.Utils; -import static pl.szczodrzynski.edziennik.datamodels.LoginStore.LOGIN_TYPE_MOBIDZIENNIK; -import static pl.szczodrzynski.edziennik.datamodels.LoginStore.LOGIN_TYPE_VULCAN; +import static pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore.LOGIN_TYPE_MOBIDZIENNIK; +import static pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore.LOGIN_TYPE_VULCAN; public class App extends androidx.multidex.MultiDexApplication { private static final String TAG = "App"; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/Extensions.kt b/app/src/main/java/pl/szczodrzynski/edziennik/Extensions.kt index a1808960..76719287 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/Extensions.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/Extensions.kt @@ -9,8 +9,8 @@ import android.os.Bundle import androidx.core.app.ActivityCompat import com.google.gson.JsonArray import com.google.gson.JsonObject -import pl.szczodrzynski.edziennik.datamodels.Profile -import pl.szczodrzynski.edziennik.datamodels.Teacher +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile +import pl.szczodrzynski.edziennik.data.db.modules.teachers.Teacher import pl.szczodrzynski.navlib.R import pl.szczodrzynski.navlib.crc16 import pl.szczodrzynski.navlib.getColorFromRes diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt b/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt index 77e72edb..7e43c292 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt @@ -19,7 +19,7 @@ import com.mikepenz.iconics.typeface.library.community.material.CommunityMateria import com.mikepenz.iconics.typeface.library.szkolny.font.SzkolnyFont import com.mikepenz.materialdrawer.model.ProfileSettingDrawerItem import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem -import pl.szczodrzynski.edziennik.datamodels.Metadata.* +import pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.* import pl.szczodrzynski.edziennik.utils.Themes import pl.szczodrzynski.navlib.NavView import pl.szczodrzynski.navlib.SystemBarsUtil @@ -41,13 +41,13 @@ import com.mikepenz.materialdrawer.model.ProfileDrawerItem import com.mikepenz.materialdrawer.model.interfaces.IProfile import pl.droidsonroids.gif.GifDrawable import pl.szczodrzynski.edziennik.App.APP_URL -import pl.szczodrzynski.edziennik.api.AppError -import pl.szczodrzynski.edziennik.api.interfaces.EdziennikInterface.* -import pl.szczodrzynski.edziennik.api.interfaces.SyncCallback +import pl.szczodrzynski.edziennik.data.api.AppError +import pl.szczodrzynski.edziennik.data.api.interfaces.EdziennikInterface.* +import pl.szczodrzynski.edziennik.data.api.interfaces.SyncCallback import pl.szczodrzynski.edziennik.databinding.ActivitySzkolnyBinding -import pl.szczodrzynski.edziennik.datamodels.LoginStore -import pl.szczodrzynski.edziennik.datamodels.Profile -import pl.szczodrzynski.edziennik.datamodels.ProfileFull +import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile +import pl.szczodrzynski.edziennik.data.db.modules.profiles.ProfileFull import pl.szczodrzynski.edziennik.ui.dialogs.changelog.ChangelogDialog import pl.szczodrzynski.edziennik.ui.modules.homework.HomeworkFragment import pl.szczodrzynski.edziennik.ui.modules.login.LoginActivity diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/Notifier.java b/app/src/main/java/pl/szczodrzynski/edziennik/Notifier.java index 0ad8cc23..cc2237c3 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/Notifier.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/Notifier.java @@ -16,7 +16,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import pl.szczodrzynski.edziennik.datamodels.ProfileFull; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.ProfileFull; import pl.szczodrzynski.edziennik.utils.models.Date; import pl.szczodrzynski.edziennik.utils.models.Time; import pl.szczodrzynski.edziennik.receivers.BootReceiver; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/WidgetTimetable.java b/app/src/main/java/pl/szczodrzynski/edziennik/WidgetTimetable.java index 194dace4..36296e39 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/WidgetTimetable.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/WidgetTimetable.java @@ -28,10 +28,10 @@ import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; -import pl.szczodrzynski.edziennik.datamodels.EventFull; -import pl.szczodrzynski.edziennik.datamodels.LessonChange; -import pl.szczodrzynski.edziennik.datamodels.LessonFull; -import pl.szczodrzynski.edziennik.datamodels.Profile; +import pl.szczodrzynski.edziennik.data.db.modules.events.EventFull; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonChange; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonFull; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile; import pl.szczodrzynski.edziennik.ui.modules.home.HomeFragment; import pl.szczodrzynski.edziennik.utils.models.Date; import pl.szczodrzynski.edziennik.utils.models.ItemWidgetTimetableModel; @@ -43,7 +43,7 @@ import pl.szczodrzynski.edziennik.widgets.timetable.LessonDetailsActivity; import pl.szczodrzynski.edziennik.widgets.timetable.WidgetTimetableService; import static pl.szczodrzynski.edziennik.ExtensionsKt.filterOutArchived; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_HOMEWORK; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_HOMEWORK; import static pl.szczodrzynski.edziennik.utils.Utils.bs; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/MessageListCallback.java b/app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/MessageListCallback.java deleted file mode 100644 index 77137a0e..00000000 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/MessageListCallback.java +++ /dev/null @@ -1,9 +0,0 @@ -package pl.szczodrzynski.edziennik.api.interfaces; - -import java.util.List; - -import pl.szczodrzynski.edziennik.datamodels.MessageFull; - -public interface MessageListCallback { - void onSuccess(List messageList); -} diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/RecipientListGetCallback.java b/app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/RecipientListGetCallback.java deleted file mode 100644 index dce9ec9d..00000000 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/RecipientListGetCallback.java +++ /dev/null @@ -1,9 +0,0 @@ -package pl.szczodrzynski.edziennik.api.interfaces; - -import java.util.List; - -import pl.szczodrzynski.edziennik.datamodels.Teacher; - -public interface RecipientListGetCallback { - void onSuccess(List teacherList); -} diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/ApiLoginResult.kt b/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/ApiLoginResult.kt deleted file mode 100644 index 30b0edad..00000000 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/ApiLoginResult.kt +++ /dev/null @@ -1,6 +0,0 @@ -package pl.szczodrzynski.edziennik.api.v2 - -import pl.szczodrzynski.edziennik.api.AppError -import pl.szczodrzynski.edziennik.datamodels.LoginStore - -data class ApiLoginResult(val loginStore: LoginStore, val error: AppError?) \ No newline at end of file diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/FirstLoginResult.kt b/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/FirstLoginResult.kt deleted file mode 100644 index 92d3da9e..00000000 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/FirstLoginResult.kt +++ /dev/null @@ -1,6 +0,0 @@ -package pl.szczodrzynski.edziennik.api.v2 - -import pl.szczodrzynski.edziennik.api.AppError -import pl.szczodrzynski.edziennik.datamodels.Profile - -data class FirstLoginResult(val profileList: ArrayList, val error: AppError?) \ No newline at end of file diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/data/DataLibrus.kt b/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/data/DataLibrus.kt deleted file mode 100644 index 66fc9c39..00000000 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/data/DataLibrus.kt +++ /dev/null @@ -1,10 +0,0 @@ -package pl.szczodrzynski.edziennik.api.v2.librus.data - -import pl.szczodrzynski.edziennik.App -import pl.szczodrzynski.edziennik.api.interfaces.ProgressCallback -import pl.szczodrzynski.edziennik.datamodels.LoginStore -import pl.szczodrzynski.edziennik.datamodels.Profile - -class DataLibrus(val app: App, val profile: Profile, val loginStore: LoginStore, val callback: ProgressCallback, val onSuccess: () -> Unit) { - -} \ No newline at end of file diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/firstlogin/FirstLoginLibrus.kt b/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/firstlogin/FirstLoginLibrus.kt deleted file mode 100644 index e8255006..00000000 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/firstlogin/FirstLoginLibrus.kt +++ /dev/null @@ -1,12 +0,0 @@ -package pl.szczodrzynski.edziennik.api.v2.librus.firstlogin - -import pl.szczodrzynski.edziennik.App -import pl.szczodrzynski.edziennik.api.interfaces.ProgressCallback -import pl.szczodrzynski.edziennik.datamodels.LoginStore -import pl.szczodrzynski.edziennik.datamodels.Profile - -class FirstLoginLibrus(val app: App, val loginStore: LoginStore, val progressCallback: ProgressCallback, val onSuccess: (profileList: List) -> Unit) { - init { - - } -} \ No newline at end of file diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/firstlogin/FirstLoginSynergia.kt b/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/firstlogin/FirstLoginSynergia.kt deleted file mode 100644 index 376a86ac..00000000 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/firstlogin/FirstLoginSynergia.kt +++ /dev/null @@ -1,12 +0,0 @@ -package pl.szczodrzynski.edziennik.api.v2.librus.firstlogin - -import pl.szczodrzynski.edziennik.App -import pl.szczodrzynski.edziennik.api.interfaces.ProgressCallback -import pl.szczodrzynski.edziennik.datamodels.LoginStore -import pl.szczodrzynski.edziennik.datamodels.Profile - -class FirstLoginSynergia(val app: App, val loginStore: LoginStore, val progressCallback: ProgressCallback, val onSuccess: (profileList: List) -> Unit) { - init { - - } -} \ No newline at end of file diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/AppError.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/AppError.java similarity index 99% rename from app/src/main/java/pl/szczodrzynski/edziennik/api/AppError.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/api/AppError.java index d5f6c2a7..ea72e969 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/AppError.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/AppError.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.api; +package pl.szczodrzynski.edziennik.data.api; import android.content.Context; import android.os.AsyncTask; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/Edziennik.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Edziennik.java similarity index 93% rename from app/src/main/java/pl/szczodrzynski/edziennik/api/Edziennik.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/api/Edziennik.java index c085e092..1e18057d 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/Edziennik.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Edziennik.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.api; +package pl.szczodrzynski.edziennik.data.api; import android.app.Activity; import android.appwidget.AppWidgetManager; @@ -43,25 +43,25 @@ import pl.szczodrzynski.edziennik.BuildConfig; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.MainActivity; import pl.szczodrzynski.edziennik.WidgetTimetable; -import pl.szczodrzynski.edziennik.api.interfaces.EdziennikInterface; -import pl.szczodrzynski.edziennik.api.interfaces.SyncCallback; -import pl.szczodrzynski.edziennik.datamodels.AnnouncementFull; -import pl.szczodrzynski.edziennik.datamodels.Attendance; -import pl.szczodrzynski.edziennik.datamodels.AttendanceFull; -import pl.szczodrzynski.edziennik.datamodels.Event; -import pl.szczodrzynski.edziennik.datamodels.EventFull; -import pl.szczodrzynski.edziennik.datamodels.EventType; -import pl.szczodrzynski.edziennik.datamodels.GradeFull; -import pl.szczodrzynski.edziennik.datamodels.LessonFull; -import pl.szczodrzynski.edziennik.datamodels.LoginStore; -import pl.szczodrzynski.edziennik.datamodels.Message; -import pl.szczodrzynski.edziennik.datamodels.MessageFull; -import pl.szczodrzynski.edziennik.datamodels.Metadata; -import pl.szczodrzynski.edziennik.datamodels.Notice; -import pl.szczodrzynski.edziennik.datamodels.NoticeFull; -import pl.szczodrzynski.edziennik.datamodels.Profile; -import pl.szczodrzynski.edziennik.datamodels.ProfileFull; -import pl.szczodrzynski.edziennik.datamodels.Team; +import pl.szczodrzynski.edziennik.data.api.interfaces.EdziennikInterface; +import pl.szczodrzynski.edziennik.data.api.interfaces.SyncCallback; +import pl.szczodrzynski.edziennik.data.db.modules.announcements.AnnouncementFull; +import pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance; +import pl.szczodrzynski.edziennik.data.db.modules.attendance.AttendanceFull; +import pl.szczodrzynski.edziennik.data.db.modules.events.Event; +import pl.szczodrzynski.edziennik.data.db.modules.events.EventFull; +import pl.szczodrzynski.edziennik.data.db.modules.events.EventType; +import pl.szczodrzynski.edziennik.data.db.modules.grades.GradeFull; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonFull; +import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore; +import pl.szczodrzynski.edziennik.data.db.modules.messages.Message; +import pl.szczodrzynski.edziennik.data.db.modules.messages.MessageFull; +import pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata; +import pl.szczodrzynski.edziennik.data.db.modules.notices.Notice; +import pl.szczodrzynski.edziennik.data.db.modules.notices.NoticeFull; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.ProfileFull; +import pl.szczodrzynski.edziennik.data.db.modules.teams.Team; import pl.szczodrzynski.edziennik.utils.models.Date; import pl.szczodrzynski.edziennik.utils.models.Notification; import pl.szczodrzynski.edziennik.network.ServerRequest; @@ -75,34 +75,34 @@ import static com.mikepenz.iconics.utils.IconicsConvertersKt.colorInt; import static com.mikepenz.iconics.utils.IconicsConvertersKt.sizeDp; import static pl.szczodrzynski.edziennik.App.APP_URL; import static pl.szczodrzynski.edziennik.MainActivity.DRAWER_ITEM_HOME; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_OK; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_OTHER; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_PROFILE_ARCHIVED; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_PROFILE_NOT_FOUND; -import static pl.szczodrzynski.edziennik.api.AppError.stringErrorCode; -import static pl.szczodrzynski.edziennik.api.AppError.stringErrorType; -import static pl.szczodrzynski.edziennik.api.interfaces.EdziennikInterface.FEATURE_AGENDA; -import static pl.szczodrzynski.edziennik.api.interfaces.EdziennikInterface.FEATURE_ALL; -import static pl.szczodrzynski.edziennik.api.interfaces.EdziennikInterface.FEATURE_ANNOUNCEMENTS; -import static pl.szczodrzynski.edziennik.api.interfaces.EdziennikInterface.FEATURE_ATTENDANCES; -import static pl.szczodrzynski.edziennik.api.interfaces.EdziennikInterface.FEATURE_GRADES; -import static pl.szczodrzynski.edziennik.api.interfaces.EdziennikInterface.FEATURE_HOMEWORK; -import static pl.szczodrzynski.edziennik.api.interfaces.EdziennikInterface.FEATURE_MESSAGES_INBOX; -import static pl.szczodrzynski.edziennik.api.interfaces.EdziennikInterface.FEATURE_MESSAGES_OUTBOX; -import static pl.szczodrzynski.edziennik.api.interfaces.EdziennikInterface.FEATURE_NOTICES; -import static pl.szczodrzynski.edziennik.api.interfaces.EdziennikInterface.FEATURE_TIMETABLE; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_HOMEWORK; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_SEMESTER1_FINAL; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_SEMESTER1_PROPOSED; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_SEMESTER2_FINAL; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_SEMESTER2_PROPOSED; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_YEAR_FINAL; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_YEAR_PROPOSED; -import static pl.szczodrzynski.edziennik.datamodels.LoginStore.LOGIN_TYPE_IUCZNIOWIE; -import static pl.szczodrzynski.edziennik.datamodels.LoginStore.LOGIN_TYPE_LIBRUS; -import static pl.szczodrzynski.edziennik.datamodels.LoginStore.LOGIN_TYPE_MOBIDZIENNIK; -import static pl.szczodrzynski.edziennik.datamodels.LoginStore.LOGIN_TYPE_VULCAN; -import static pl.szczodrzynski.edziennik.datamodels.Profile.REGISTRATION_ENABLED; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_OK; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_OTHER; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_PROFILE_ARCHIVED; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_PROFILE_NOT_FOUND; +import static pl.szczodrzynski.edziennik.data.api.AppError.stringErrorCode; +import static pl.szczodrzynski.edziennik.data.api.AppError.stringErrorType; +import static pl.szczodrzynski.edziennik.data.api.interfaces.EdziennikInterface.FEATURE_AGENDA; +import static pl.szczodrzynski.edziennik.data.api.interfaces.EdziennikInterface.FEATURE_ALL; +import static pl.szczodrzynski.edziennik.data.api.interfaces.EdziennikInterface.FEATURE_ANNOUNCEMENTS; +import static pl.szczodrzynski.edziennik.data.api.interfaces.EdziennikInterface.FEATURE_ATTENDANCES; +import static pl.szczodrzynski.edziennik.data.api.interfaces.EdziennikInterface.FEATURE_GRADES; +import static pl.szczodrzynski.edziennik.data.api.interfaces.EdziennikInterface.FEATURE_HOMEWORK; +import static pl.szczodrzynski.edziennik.data.api.interfaces.EdziennikInterface.FEATURE_MESSAGES_INBOX; +import static pl.szczodrzynski.edziennik.data.api.interfaces.EdziennikInterface.FEATURE_MESSAGES_OUTBOX; +import static pl.szczodrzynski.edziennik.data.api.interfaces.EdziennikInterface.FEATURE_NOTICES; +import static pl.szczodrzynski.edziennik.data.api.interfaces.EdziennikInterface.FEATURE_TIMETABLE; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_HOMEWORK; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_SEMESTER1_FINAL; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_SEMESTER1_PROPOSED; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_SEMESTER2_FINAL; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_SEMESTER2_PROPOSED; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_YEAR_FINAL; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_YEAR_PROPOSED; +import static pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore.LOGIN_TYPE_IUCZNIOWIE; +import static pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore.LOGIN_TYPE_LIBRUS; +import static pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore.LOGIN_TYPE_MOBIDZIENNIK; +import static pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore.LOGIN_TYPE_VULCAN; +import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.REGISTRATION_ENABLED; import static pl.szczodrzynski.edziennik.sync.SyncService.PROFILE_MAX_PROGRESS; import static pl.szczodrzynski.edziennik.utils.Utils.d; import static pl.szczodrzynski.edziennik.utils.Utils.ns; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/Iuczniowie.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Iuczniowie.java similarity index 95% rename from app/src/main/java/pl/szczodrzynski/edziennik/api/Iuczniowie.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/api/Iuczniowie.java index ef582884..83b8a8e9 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/Iuczniowie.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Iuczniowie.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.api; +package pl.szczodrzynski.edziennik.data.api; import android.content.Context; import android.graphics.Color; @@ -34,58 +34,58 @@ import okhttp3.HttpUrl; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.BuildConfig; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.api.interfaces.AttachmentGetCallback; -import pl.szczodrzynski.edziennik.api.interfaces.EdziennikInterface; -import pl.szczodrzynski.edziennik.api.interfaces.LoginCallback; -import pl.szczodrzynski.edziennik.api.interfaces.MessageGetCallback; -import pl.szczodrzynski.edziennik.api.interfaces.RecipientListGetCallback; -import pl.szczodrzynski.edziennik.api.interfaces.SyncCallback; -import pl.szczodrzynski.edziennik.datamodels.Announcement; -import pl.szczodrzynski.edziennik.datamodels.Attendance; -import pl.szczodrzynski.edziennik.datamodels.Event; -import pl.szczodrzynski.edziennik.datamodels.Grade; -import pl.szczodrzynski.edziennik.datamodels.Lesson; -import pl.szczodrzynski.edziennik.datamodels.LessonChange; -import pl.szczodrzynski.edziennik.datamodels.LoginStore; -import pl.szczodrzynski.edziennik.datamodels.LuckyNumber; -import pl.szczodrzynski.edziennik.datamodels.Message; -import pl.szczodrzynski.edziennik.datamodels.MessageFull; -import pl.szczodrzynski.edziennik.datamodels.MessageRecipient; -import pl.szczodrzynski.edziennik.datamodels.MessageRecipientFull; -import pl.szczodrzynski.edziennik.datamodels.Metadata; -import pl.szczodrzynski.edziennik.datamodels.Notice; -import pl.szczodrzynski.edziennik.datamodels.Profile; -import pl.szczodrzynski.edziennik.datamodels.ProfileFull; -import pl.szczodrzynski.edziennik.datamodels.Subject; -import pl.szczodrzynski.edziennik.datamodels.Teacher; -import pl.szczodrzynski.edziennik.datamodels.Team; +import pl.szczodrzynski.edziennik.data.api.interfaces.AttachmentGetCallback; +import pl.szczodrzynski.edziennik.data.api.interfaces.EdziennikInterface; +import pl.szczodrzynski.edziennik.data.api.interfaces.LoginCallback; +import pl.szczodrzynski.edziennik.data.api.interfaces.MessageGetCallback; +import pl.szczodrzynski.edziennik.data.api.interfaces.RecipientListGetCallback; +import pl.szczodrzynski.edziennik.data.api.interfaces.SyncCallback; +import pl.szczodrzynski.edziennik.data.db.modules.announcements.Announcement; +import pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance; +import pl.szczodrzynski.edziennik.data.db.modules.events.Event; +import pl.szczodrzynski.edziennik.data.db.modules.grades.Grade; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.Lesson; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonChange; +import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore; +import pl.szczodrzynski.edziennik.data.db.modules.luckynumber.LuckyNumber; +import pl.szczodrzynski.edziennik.data.db.modules.messages.Message; +import pl.szczodrzynski.edziennik.data.db.modules.messages.MessageFull; +import pl.szczodrzynski.edziennik.data.db.modules.messages.MessageRecipient; +import pl.szczodrzynski.edziennik.data.db.modules.messages.MessageRecipientFull; +import pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata; +import pl.szczodrzynski.edziennik.data.db.modules.notices.Notice; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.ProfileFull; +import pl.szczodrzynski.edziennik.data.db.modules.subjects.Subject; +import pl.szczodrzynski.edziennik.data.db.modules.teachers.Teacher; +import pl.szczodrzynski.edziennik.data.db.modules.teams.Team; import pl.szczodrzynski.edziennik.ui.modules.messages.MessagesComposeInfo; import pl.szczodrzynski.edziennik.utils.models.Date; import pl.szczodrzynski.edziennik.utils.models.Endpoint; import pl.szczodrzynski.edziennik.utils.models.Time; import pl.szczodrzynski.edziennik.utils.models.Week; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_INVALID_LOGIN; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_INVALID_SCHOOL_NAME; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_MAINTENANCE; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_OTHER; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_ABSENT; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_ABSENT_EXCUSED; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_BELATED; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_PRESENT; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_RELEASED; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_SEMESTER1_FINAL; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_SEMESTER1_PROPOSED; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_YEAR_FINAL; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_YEAR_PROPOSED; -import static pl.szczodrzynski.edziennik.datamodels.LessonChange.TYPE_CANCELLED; -import static pl.szczodrzynski.edziennik.datamodels.LessonChange.TYPE_CHANGE; -import static pl.szczodrzynski.edziennik.datamodels.Message.TYPE_DELETED; -import static pl.szczodrzynski.edziennik.datamodels.Message.TYPE_RECEIVED; -import static pl.szczodrzynski.edziennik.datamodels.Message.TYPE_SENT; -import static pl.szczodrzynski.edziennik.datamodels.Notice.TYPE_NEGATIVE; -import static pl.szczodrzynski.edziennik.datamodels.Notice.TYPE_NEUTRAL; -import static pl.szczodrzynski.edziennik.datamodels.Notice.TYPE_POSITIVE; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_INVALID_LOGIN; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_INVALID_SCHOOL_NAME; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_MAINTENANCE; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_OTHER; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_ABSENT; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_ABSENT_EXCUSED; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_BELATED; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_PRESENT; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_RELEASED; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_SEMESTER1_FINAL; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_SEMESTER1_PROPOSED; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_YEAR_FINAL; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_YEAR_PROPOSED; +import static pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonChange.TYPE_CANCELLED; +import static pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonChange.TYPE_CHANGE; +import static pl.szczodrzynski.edziennik.data.db.modules.messages.Message.TYPE_DELETED; +import static pl.szczodrzynski.edziennik.data.db.modules.messages.Message.TYPE_RECEIVED; +import static pl.szczodrzynski.edziennik.data.db.modules.messages.Message.TYPE_SENT; +import static pl.szczodrzynski.edziennik.data.db.modules.notices.Notice.TYPE_NEGATIVE; +import static pl.szczodrzynski.edziennik.data.db.modules.notices.Notice.TYPE_NEUTRAL; +import static pl.szczodrzynski.edziennik.data.db.modules.notices.Notice.TYPE_POSITIVE; import static pl.szczodrzynski.edziennik.utils.Utils.crc16; import static pl.szczodrzynski.edziennik.utils.Utils.crc32; import static pl.szczodrzynski.edziennik.utils.Utils.d; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/Librus.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Librus.java similarity index 96% rename from app/src/main/java/pl/szczodrzynski/edziennik/api/Librus.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/api/Librus.java index 9eb31ea0..83bda4b6 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/Librus.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Librus.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.api; +package pl.szczodrzynski.edziennik.data.api; import android.content.Context; import android.graphics.Color; @@ -45,34 +45,34 @@ import im.wangchao.mhttp.callback.TextCallbackHandler; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.BuildConfig; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.api.interfaces.AttachmentGetCallback; -import pl.szczodrzynski.edziennik.api.interfaces.EdziennikInterface; -import pl.szczodrzynski.edziennik.api.interfaces.LoginCallback; -import pl.szczodrzynski.edziennik.api.interfaces.MessageGetCallback; -import pl.szczodrzynski.edziennik.api.interfaces.RecipientListGetCallback; -import pl.szczodrzynski.edziennik.api.interfaces.SyncCallback; -import pl.szczodrzynski.edziennik.api.v2.models.DataStore; -import pl.szczodrzynski.edziennik.datamodels.Announcement; -import pl.szczodrzynski.edziennik.datamodels.Attendance; -import pl.szczodrzynski.edziennik.datamodels.Event; -import pl.szczodrzynski.edziennik.datamodels.EventType; -import pl.szczodrzynski.edziennik.datamodels.Grade; -import pl.szczodrzynski.edziennik.datamodels.GradeCategory; -import pl.szczodrzynski.edziennik.datamodels.Lesson; -import pl.szczodrzynski.edziennik.datamodels.LessonChange; -import pl.szczodrzynski.edziennik.datamodels.LoginStore; -import pl.szczodrzynski.edziennik.datamodels.LuckyNumber; -import pl.szczodrzynski.edziennik.datamodels.Message; -import pl.szczodrzynski.edziennik.datamodels.MessageFull; -import pl.szczodrzynski.edziennik.datamodels.MessageRecipient; -import pl.szczodrzynski.edziennik.datamodels.MessageRecipientFull; -import pl.szczodrzynski.edziennik.datamodels.Metadata; -import pl.szczodrzynski.edziennik.datamodels.Notice; -import pl.szczodrzynski.edziennik.datamodels.Profile; -import pl.szczodrzynski.edziennik.datamodels.ProfileFull; -import pl.szczodrzynski.edziennik.datamodels.Subject; -import pl.szczodrzynski.edziennik.datamodels.Teacher; -import pl.szczodrzynski.edziennik.datamodels.Team; +import pl.szczodrzynski.edziennik.data.api.interfaces.AttachmentGetCallback; +import pl.szczodrzynski.edziennik.data.api.interfaces.EdziennikInterface; +import pl.szczodrzynski.edziennik.data.api.interfaces.LoginCallback; +import pl.szczodrzynski.edziennik.data.api.interfaces.MessageGetCallback; +import pl.szczodrzynski.edziennik.data.api.interfaces.RecipientListGetCallback; +import pl.szczodrzynski.edziennik.data.api.interfaces.SyncCallback; +import pl.szczodrzynski.edziennik.data.api.v2.models.DataStore; +import pl.szczodrzynski.edziennik.data.db.modules.announcements.Announcement; +import pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance; +import pl.szczodrzynski.edziennik.data.db.modules.events.Event; +import pl.szczodrzynski.edziennik.data.db.modules.events.EventType; +import pl.szczodrzynski.edziennik.data.db.modules.grades.Grade; +import pl.szczodrzynski.edziennik.data.db.modules.grades.GradeCategory; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.Lesson; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonChange; +import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore; +import pl.szczodrzynski.edziennik.data.db.modules.luckynumber.LuckyNumber; +import pl.szczodrzynski.edziennik.data.db.modules.messages.Message; +import pl.szczodrzynski.edziennik.data.db.modules.messages.MessageFull; +import pl.szczodrzynski.edziennik.data.db.modules.messages.MessageRecipient; +import pl.szczodrzynski.edziennik.data.db.modules.messages.MessageRecipientFull; +import pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata; +import pl.szczodrzynski.edziennik.data.db.modules.notices.Notice; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.ProfileFull; +import pl.szczodrzynski.edziennik.data.db.modules.subjects.Subject; +import pl.szczodrzynski.edziennik.data.db.modules.teachers.Teacher; +import pl.szczodrzynski.edziennik.data.db.modules.teams.Team; import pl.szczodrzynski.edziennik.ui.modules.messages.MessagesComposeInfo; import pl.szczodrzynski.edziennik.utils.models.Date; import pl.szczodrzynski.edziennik.utils.models.Endpoint; @@ -86,44 +86,44 @@ import static java.net.HttpURLConnection.HTTP_GONE; import static java.net.HttpURLConnection.HTTP_NOT_FOUND; import static java.net.HttpURLConnection.HTTP_OK; import static java.net.HttpURLConnection.HTTP_UNAUTHORIZED; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_INVALID_LOGIN; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_LIBRUS_DISCONNECTED; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_LIBRUS_NOT_ACTIVATED; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_MAINTENANCE; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_OTHER; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_PROFILE_NOT_FOUND; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_SYNERGIA_NOT_ACTIVATED; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_ABSENT; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_ABSENT_EXCUSED; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_BELATED; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_PRESENT; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_RELEASED; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_PT_MEETING; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_TEACHER_ABSENCE; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_NORMAL; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_SEMESTER1_FINAL; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_SEMESTER1_PROPOSED; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_SEMESTER2_FINAL; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_SEMESTER2_PROPOSED; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_YEAR_FINAL; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_YEAR_PROPOSED; -import static pl.szczodrzynski.edziennik.datamodels.LessonChange.TYPE_CANCELLED; -import static pl.szczodrzynski.edziennik.datamodels.LessonChange.TYPE_CHANGE; -import static pl.szczodrzynski.edziennik.datamodels.Message.TYPE_RECEIVED; -import static pl.szczodrzynski.edziennik.datamodels.Message.TYPE_SENT; -import static pl.szczodrzynski.edziennik.datamodels.Notice.TYPE_NEGATIVE; -import static pl.szczodrzynski.edziennik.datamodels.Notice.TYPE_NEUTRAL; -import static pl.szczodrzynski.edziennik.datamodels.Notice.TYPE_POSITIVE; -import static pl.szczodrzynski.edziennik.datamodels.Teacher.TYPE_EDUCATOR; -import static pl.szczodrzynski.edziennik.datamodels.Teacher.TYPE_LIBRARIAN; -import static pl.szczodrzynski.edziennik.datamodels.Teacher.TYPE_OTHER; -import static pl.szczodrzynski.edziennik.datamodels.Teacher.TYPE_PARENTS_COUNCIL; -import static pl.szczodrzynski.edziennik.datamodels.Teacher.TYPE_PEDAGOGUE; -import static pl.szczodrzynski.edziennik.datamodels.Teacher.TYPE_SCHOOL_ADMIN; -import static pl.szczodrzynski.edziennik.datamodels.Teacher.TYPE_SCHOOL_PARENTS_COUNCIL; -import static pl.szczodrzynski.edziennik.datamodels.Teacher.TYPE_SECRETARIAT; -import static pl.szczodrzynski.edziennik.datamodels.Teacher.TYPE_SUPER_ADMIN; -import static pl.szczodrzynski.edziennik.datamodels.Teacher.TYPE_TEACHER; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_INVALID_LOGIN; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_LIBRUS_DISCONNECTED; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_LIBRUS_NOT_ACTIVATED; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_MAINTENANCE; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_OTHER; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_PROFILE_NOT_FOUND; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_SYNERGIA_NOT_ACTIVATED; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_ABSENT; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_ABSENT_EXCUSED; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_BELATED; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_PRESENT; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_RELEASED; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_PT_MEETING; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_TEACHER_ABSENCE; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_NORMAL; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_SEMESTER1_FINAL; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_SEMESTER1_PROPOSED; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_SEMESTER2_FINAL; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_SEMESTER2_PROPOSED; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_YEAR_FINAL; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_YEAR_PROPOSED; +import static pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonChange.TYPE_CANCELLED; +import static pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonChange.TYPE_CHANGE; +import static pl.szczodrzynski.edziennik.data.db.modules.messages.Message.TYPE_RECEIVED; +import static pl.szczodrzynski.edziennik.data.db.modules.messages.Message.TYPE_SENT; +import static pl.szczodrzynski.edziennik.data.db.modules.notices.Notice.TYPE_NEGATIVE; +import static pl.szczodrzynski.edziennik.data.db.modules.notices.Notice.TYPE_NEUTRAL; +import static pl.szczodrzynski.edziennik.data.db.modules.notices.Notice.TYPE_POSITIVE; +import static pl.szczodrzynski.edziennik.data.db.modules.teachers.Teacher.TYPE_EDUCATOR; +import static pl.szczodrzynski.edziennik.data.db.modules.teachers.Teacher.TYPE_LIBRARIAN; +import static pl.szczodrzynski.edziennik.data.db.modules.teachers.Teacher.TYPE_OTHER; +import static pl.szczodrzynski.edziennik.data.db.modules.teachers.Teacher.TYPE_PARENTS_COUNCIL; +import static pl.szczodrzynski.edziennik.data.db.modules.teachers.Teacher.TYPE_PEDAGOGUE; +import static pl.szczodrzynski.edziennik.data.db.modules.teachers.Teacher.TYPE_SCHOOL_ADMIN; +import static pl.szczodrzynski.edziennik.data.db.modules.teachers.Teacher.TYPE_SCHOOL_PARENTS_COUNCIL; +import static pl.szczodrzynski.edziennik.data.db.modules.teachers.Teacher.TYPE_SECRETARIAT; +import static pl.szczodrzynski.edziennik.data.db.modules.teachers.Teacher.TYPE_SUPER_ADMIN; +import static pl.szczodrzynski.edziennik.data.db.modules.teachers.Teacher.TYPE_TEACHER; import static pl.szczodrzynski.edziennik.utils.Utils.bs; import static pl.szczodrzynski.edziennik.utils.Utils.c; import static pl.szczodrzynski.edziennik.utils.Utils.contains; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/Mobidziennik.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Mobidziennik.java similarity index 96% rename from app/src/main/java/pl/szczodrzynski/edziennik/api/Mobidziennik.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/api/Mobidziennik.java index e3ac7922..c8c6b52e 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/Mobidziennik.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Mobidziennik.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.api; +package pl.szczodrzynski.edziennik.data.api; import android.content.Context; import android.graphics.Color; @@ -40,59 +40,59 @@ import im.wangchao.mhttp.callback.TextCallbackHandler; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.BuildConfig; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.api.interfaces.AttachmentGetCallback; -import pl.szczodrzynski.edziennik.api.interfaces.EdziennikInterface; -import pl.szczodrzynski.edziennik.api.interfaces.LoginCallback; -import pl.szczodrzynski.edziennik.api.interfaces.MessageGetCallback; -import pl.szczodrzynski.edziennik.api.interfaces.RecipientListGetCallback; -import pl.szczodrzynski.edziennik.api.interfaces.SyncCallback; -import pl.szczodrzynski.edziennik.datamodels.Attendance; -import pl.szczodrzynski.edziennik.datamodels.Event; -import pl.szczodrzynski.edziennik.datamodels.Grade; -import pl.szczodrzynski.edziennik.datamodels.GradeCategory; -import pl.szczodrzynski.edziennik.datamodels.Lesson; -import pl.szczodrzynski.edziennik.datamodels.LessonChange; -import pl.szczodrzynski.edziennik.datamodels.LoginStore; -import pl.szczodrzynski.edziennik.datamodels.LuckyNumber; -import pl.szczodrzynski.edziennik.datamodels.Message; -import pl.szczodrzynski.edziennik.datamodels.MessageFull; -import pl.szczodrzynski.edziennik.datamodels.MessageRecipient; -import pl.szczodrzynski.edziennik.datamodels.MessageRecipientFull; -import pl.szczodrzynski.edziennik.datamodels.Metadata; -import pl.szczodrzynski.edziennik.datamodels.Notice; -import pl.szczodrzynski.edziennik.datamodels.Profile; -import pl.szczodrzynski.edziennik.datamodels.ProfileFull; -import pl.szczodrzynski.edziennik.datamodels.Subject; -import pl.szczodrzynski.edziennik.datamodels.Teacher; -import pl.szczodrzynski.edziennik.datamodels.Team; +import pl.szczodrzynski.edziennik.data.api.interfaces.AttachmentGetCallback; +import pl.szczodrzynski.edziennik.data.api.interfaces.EdziennikInterface; +import pl.szczodrzynski.edziennik.data.api.interfaces.LoginCallback; +import pl.szczodrzynski.edziennik.data.api.interfaces.MessageGetCallback; +import pl.szczodrzynski.edziennik.data.api.interfaces.RecipientListGetCallback; +import pl.szczodrzynski.edziennik.data.api.interfaces.SyncCallback; +import pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance; +import pl.szczodrzynski.edziennik.data.db.modules.events.Event; +import pl.szczodrzynski.edziennik.data.db.modules.grades.Grade; +import pl.szczodrzynski.edziennik.data.db.modules.grades.GradeCategory; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.Lesson; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonChange; +import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore; +import pl.szczodrzynski.edziennik.data.db.modules.luckynumber.LuckyNumber; +import pl.szczodrzynski.edziennik.data.db.modules.messages.Message; +import pl.szczodrzynski.edziennik.data.db.modules.messages.MessageFull; +import pl.szczodrzynski.edziennik.data.db.modules.messages.MessageRecipient; +import pl.szczodrzynski.edziennik.data.db.modules.messages.MessageRecipientFull; +import pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata; +import pl.szczodrzynski.edziennik.data.db.modules.notices.Notice; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.ProfileFull; +import pl.szczodrzynski.edziennik.data.db.modules.subjects.Subject; +import pl.szczodrzynski.edziennik.data.db.modules.teachers.Teacher; +import pl.szczodrzynski.edziennik.data.db.modules.teams.Team; import pl.szczodrzynski.edziennik.ui.modules.messages.MessagesComposeInfo; import pl.szczodrzynski.edziennik.utils.models.Date; import pl.szczodrzynski.edziennik.utils.models.Endpoint; import pl.szczodrzynski.edziennik.utils.models.Time; import pl.szczodrzynski.edziennik.utils.models.Week; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_INVALID_LOGIN; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_MAINTENANCE; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_OTHER; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_ABSENT; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_ABSENT_EXCUSED; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_BELATED; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_CUSTOM; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_PRESENT; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_RELEASED; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_DEFAULT; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_EXAM; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_SHORT_QUIZ; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_SEMESTER1_FINAL; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_SEMESTER1_PROPOSED; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_SEMESTER2_FINAL; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_SEMESTER2_PROPOSED; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_YEAR_FINAL; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_YEAR_PROPOSED; -import static pl.szczodrzynski.edziennik.datamodels.LoginStore.LOGIN_TYPE_MOBIDZIENNIK; -import static pl.szczodrzynski.edziennik.datamodels.Message.TYPE_DELETED; -import static pl.szczodrzynski.edziennik.datamodels.Message.TYPE_RECEIVED; -import static pl.szczodrzynski.edziennik.datamodels.Message.TYPE_SENT; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_INVALID_LOGIN; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_MAINTENANCE; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_OTHER; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_ABSENT; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_ABSENT_EXCUSED; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_BELATED; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_CUSTOM; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_PRESENT; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_RELEASED; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_DEFAULT; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_EXAM; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_SHORT_QUIZ; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_SEMESTER1_FINAL; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_SEMESTER1_PROPOSED; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_SEMESTER2_FINAL; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_SEMESTER2_PROPOSED; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_YEAR_FINAL; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_YEAR_PROPOSED; +import static pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore.LOGIN_TYPE_MOBIDZIENNIK; +import static pl.szczodrzynski.edziennik.data.db.modules.messages.Message.TYPE_DELETED; +import static pl.szczodrzynski.edziennik.data.db.modules.messages.Message.TYPE_RECEIVED; +import static pl.szczodrzynski.edziennik.data.db.modules.messages.Message.TYPE_SENT; import static pl.szczodrzynski.edziennik.utils.Utils.bs; import static pl.szczodrzynski.edziennik.utils.Utils.crc16; import static pl.szczodrzynski.edziennik.utils.Utils.d; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/Vulcan.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Vulcan.java similarity index 95% rename from app/src/main/java/pl/szczodrzynski/edziennik/api/Vulcan.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/api/Vulcan.java index 6694fc5d..d1095dcb 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/Vulcan.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Vulcan.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.api; +package pl.szczodrzynski.edziennik.data.api; import android.content.Context; import android.os.Build; @@ -35,30 +35,30 @@ import okhttp3.OkHttpClient; import okio.Buffer; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.api.interfaces.AttachmentGetCallback; -import pl.szczodrzynski.edziennik.api.interfaces.EdziennikInterface; -import pl.szczodrzynski.edziennik.api.interfaces.LoginCallback; -import pl.szczodrzynski.edziennik.api.interfaces.MessageGetCallback; -import pl.szczodrzynski.edziennik.api.interfaces.RecipientListGetCallback; -import pl.szczodrzynski.edziennik.api.interfaces.SyncCallback; -import pl.szczodrzynski.edziennik.datamodels.Attendance; -import pl.szczodrzynski.edziennik.datamodels.Event; -import pl.szczodrzynski.edziennik.datamodels.Grade; -import pl.szczodrzynski.edziennik.datamodels.GradeCategory; -import pl.szczodrzynski.edziennik.datamodels.Lesson; -import pl.szczodrzynski.edziennik.datamodels.LessonChange; -import pl.szczodrzynski.edziennik.datamodels.LoginStore; -import pl.szczodrzynski.edziennik.datamodels.Message; -import pl.szczodrzynski.edziennik.datamodels.MessageFull; -import pl.szczodrzynski.edziennik.datamodels.MessageRecipient; -import pl.szczodrzynski.edziennik.datamodels.MessageRecipientFull; -import pl.szczodrzynski.edziennik.datamodels.Metadata; -import pl.szczodrzynski.edziennik.datamodels.Notice; -import pl.szczodrzynski.edziennik.datamodels.Profile; -import pl.szczodrzynski.edziennik.datamodels.ProfileFull; -import pl.szczodrzynski.edziennik.datamodels.Subject; -import pl.szczodrzynski.edziennik.datamodels.Teacher; -import pl.szczodrzynski.edziennik.datamodels.Team; +import pl.szczodrzynski.edziennik.data.api.interfaces.AttachmentGetCallback; +import pl.szczodrzynski.edziennik.data.api.interfaces.EdziennikInterface; +import pl.szczodrzynski.edziennik.data.api.interfaces.LoginCallback; +import pl.szczodrzynski.edziennik.data.api.interfaces.MessageGetCallback; +import pl.szczodrzynski.edziennik.data.api.interfaces.RecipientListGetCallback; +import pl.szczodrzynski.edziennik.data.api.interfaces.SyncCallback; +import pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance; +import pl.szczodrzynski.edziennik.data.db.modules.events.Event; +import pl.szczodrzynski.edziennik.data.db.modules.grades.Grade; +import pl.szczodrzynski.edziennik.data.db.modules.grades.GradeCategory; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.Lesson; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonChange; +import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore; +import pl.szczodrzynski.edziennik.data.db.modules.messages.Message; +import pl.szczodrzynski.edziennik.data.db.modules.messages.MessageFull; +import pl.szczodrzynski.edziennik.data.db.modules.messages.MessageRecipient; +import pl.szczodrzynski.edziennik.data.db.modules.messages.MessageRecipientFull; +import pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata; +import pl.szczodrzynski.edziennik.data.db.modules.notices.Notice; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.ProfileFull; +import pl.szczodrzynski.edziennik.data.db.modules.subjects.Subject; +import pl.szczodrzynski.edziennik.data.db.modules.teachers.Teacher; +import pl.szczodrzynski.edziennik.data.db.modules.teams.Team; import pl.szczodrzynski.edziennik.ui.modules.messages.MessagesComposeInfo; import pl.szczodrzynski.edziennik.utils.models.Date; import pl.szczodrzynski.edziennik.utils.models.Endpoint; @@ -66,26 +66,26 @@ import pl.szczodrzynski.edziennik.utils.models.Time; import pl.szczodrzynski.edziennik.utils.models.Week; import pl.szczodrzynski.edziennik.utils.Utils; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_OTHER; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_ABSENT; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_ABSENT_EXCUSED; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_BELATED; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_BELATED_EXCUSED; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_PRESENT; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_RELEASED; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_EXAM; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_SHORT_QUIZ; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_SEMESTER1_FINAL; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_SEMESTER1_PROPOSED; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_SEMESTER2_FINAL; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_SEMESTER2_PROPOSED; -import static pl.szczodrzynski.edziennik.datamodels.LessonChange.TYPE_CANCELLED; -import static pl.szczodrzynski.edziennik.datamodels.LessonChange.TYPE_CHANGE; -import static pl.szczodrzynski.edziennik.datamodels.LoginStore.LOGIN_TYPE_VULCAN; -import static pl.szczodrzynski.edziennik.datamodels.Message.TYPE_RECEIVED; -import static pl.szczodrzynski.edziennik.datamodels.Message.TYPE_SENT; -import static pl.szczodrzynski.edziennik.datamodels.Metadata.TYPE_MESSAGE; -import static pl.szczodrzynski.edziennik.datamodels.Notice.TYPE_NEUTRAL; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_OTHER; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_ABSENT; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_ABSENT_EXCUSED; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_BELATED; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_BELATED_EXCUSED; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_PRESENT; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_RELEASED; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_EXAM; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_SHORT_QUIZ; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_SEMESTER1_FINAL; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_SEMESTER1_PROPOSED; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_SEMESTER2_FINAL; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_SEMESTER2_PROPOSED; +import static pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonChange.TYPE_CANCELLED; +import static pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonChange.TYPE_CHANGE; +import static pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore.LOGIN_TYPE_VULCAN; +import static pl.szczodrzynski.edziennik.data.db.modules.messages.Message.TYPE_RECEIVED; +import static pl.szczodrzynski.edziennik.data.db.modules.messages.Message.TYPE_SENT; +import static pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.TYPE_MESSAGE; +import static pl.szczodrzynski.edziennik.data.db.modules.notices.Notice.TYPE_NEUTRAL; import static pl.szczodrzynski.edziennik.utils.Utils.c; import static pl.szczodrzynski.edziennik.utils.Utils.crc16; import static pl.szczodrzynski.edziennik.utils.Utils.d; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/AttachmentGetCallback.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/AttachmentGetCallback.java similarity index 85% rename from app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/AttachmentGetCallback.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/AttachmentGetCallback.java index 1a24ee68..0bd76455 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/AttachmentGetCallback.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/AttachmentGetCallback.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.api.interfaces; +package pl.szczodrzynski.edziennik.data.api.interfaces; import im.wangchao.mhttp.Request; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/EdziennikInterface.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/EdziennikInterface.java similarity index 88% rename from app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/EdziennikInterface.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/EdziennikInterface.java index 15770e2f..5b2af1b8 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/EdziennikInterface.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/EdziennikInterface.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.api.interfaces; +package pl.szczodrzynski.edziennik.data.api.interfaces; import android.content.Context; import androidx.annotation.NonNull; @@ -6,10 +6,11 @@ import androidx.annotation.Nullable; import java.util.Map; -import pl.szczodrzynski.edziennik.datamodels.LoginStore; -import pl.szczodrzynski.edziennik.datamodels.MessageFull; -import pl.szczodrzynski.edziennik.datamodels.Profile; -import pl.szczodrzynski.edziennik.datamodels.ProfileFull; +import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore; +import pl.szczodrzynski.edziennik.data.db.modules.messages.MessageFull; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.ProfileFull; +import pl.szczodrzynski.edziennik.data.db.modules.teachers.Teacher; import pl.szczodrzynski.edziennik.ui.modules.messages.MessagesComposeInfo; import pl.szczodrzynski.edziennik.utils.models.Endpoint; @@ -59,7 +60,7 @@ public interface EdziennikInterface { * * Updates a database-saved {@code teacherList} with {@code loginId}s. * - * A {@link pl.szczodrzynski.edziennik.datamodels.Teacher} is considered as a recipient when its {@code loginId} is not null. + * A {@link Teacher} is considered as a recipient when its {@code loginId} is not null. * * May be executed on any thread. * diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/ErrorCallback.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/ErrorCallback.java similarity index 61% rename from app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/ErrorCallback.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/ErrorCallback.java index 4f84f640..cc8f2375 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/ErrorCallback.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/ErrorCallback.java @@ -1,10 +1,10 @@ -package pl.szczodrzynski.edziennik.api.interfaces; +package pl.szczodrzynski.edziennik.data.api.interfaces; import android.content.Context; import androidx.annotation.NonNull; -import pl.szczodrzynski.edziennik.api.AppError; +import pl.szczodrzynski.edziennik.data.api.AppError; public interface ErrorCallback { void onError(Context activityContext, @NonNull AppError error); diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/LoginCallback.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/LoginCallback.java similarity index 50% rename from app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/LoginCallback.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/LoginCallback.java index 4720eee4..cae0c65e 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/LoginCallback.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/LoginCallback.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.api.interfaces; +package pl.szczodrzynski.edziennik.data.api.interfaces; public interface LoginCallback { void onSuccess(); diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/MessageGetCallback.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/MessageGetCallback.java similarity index 60% rename from app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/MessageGetCallback.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/MessageGetCallback.java index 2fca992c..7fd973c8 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/MessageGetCallback.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/MessageGetCallback.java @@ -1,7 +1,6 @@ -package pl.szczodrzynski.edziennik.api.interfaces; +package pl.szczodrzynski.edziennik.data.api.interfaces; -import pl.szczodrzynski.edziennik.datamodels.Message; -import pl.szczodrzynski.edziennik.datamodels.MessageFull; +import pl.szczodrzynski.edziennik.data.db.modules.messages.MessageFull; /** * Callback containing a {@link MessageFull} which already has its {@code body} and {@code recipients}. diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/MessageListCallback.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/MessageListCallback.java new file mode 100644 index 00000000..71561ffd --- /dev/null +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/MessageListCallback.java @@ -0,0 +1,9 @@ +package pl.szczodrzynski.edziennik.data.api.interfaces; + +import java.util.List; + +import pl.szczodrzynski.edziennik.data.db.modules.messages.MessageFull; + +public interface MessageListCallback { + void onSuccess(List messageList); +} diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/ProgressCallback.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/ProgressCallback.java similarity index 77% rename from app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/ProgressCallback.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/ProgressCallback.java index 07a88987..32948eb9 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/ProgressCallback.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/ProgressCallback.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.api.interfaces; +package pl.szczodrzynski.edziennik.data.api.interfaces; import androidx.annotation.StringRes; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/RecipientListGetCallback.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/RecipientListGetCallback.java new file mode 100644 index 00000000..fc249432 --- /dev/null +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/RecipientListGetCallback.java @@ -0,0 +1,9 @@ +package pl.szczodrzynski.edziennik.data.api.interfaces; + +import java.util.List; + +import pl.szczodrzynski.edziennik.data.db.modules.teachers.Teacher; + +public interface RecipientListGetCallback { + void onSuccess(List teacherList); +} diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/SyncCallback.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/SyncCallback.java similarity index 55% rename from app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/SyncCallback.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/SyncCallback.java index 54329973..dfaf243b 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/interfaces/SyncCallback.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/SyncCallback.java @@ -1,15 +1,12 @@ -package pl.szczodrzynski.edziennik.api.interfaces; +package pl.szczodrzynski.edziennik.data.api.interfaces; import android.content.Context; import java.util.List; -import androidx.annotation.StringRes; - -import pl.szczodrzynski.edziennik.api.AppError; -import pl.szczodrzynski.edziennik.datamodels.LoginStore; -import pl.szczodrzynski.edziennik.datamodels.Profile; -import pl.szczodrzynski.edziennik.datamodels.ProfileFull; +import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.ProfileFull; /** * A callback used for error reporting, progress information. diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/ApiLoginResult.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/ApiLoginResult.kt new file mode 100644 index 00000000..8dc3ac89 --- /dev/null +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/ApiLoginResult.kt @@ -0,0 +1,6 @@ +package pl.szczodrzynski.edziennik.data.api.v2 + +import pl.szczodrzynski.edziennik.data.api.AppError +import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore + +data class ApiLoginResult(val loginStore: LoginStore, val error: AppError?) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/Constants.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/Constants.kt similarity index 96% rename from app/src/main/java/pl/szczodrzynski/edziennik/api/v2/Constants.kt rename to app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/Constants.kt index 0125de4d..59165f11 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/Constants.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/Constants.kt @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.api.v2 +package pl.szczodrzynski.edziennik.data.api.v2 const val FEATURE_ALL = 0 const val FEATURE_TIMETABLE = 1 diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/FirstLoginResult.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/FirstLoginResult.kt new file mode 100644 index 00000000..099c2771 --- /dev/null +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/FirstLoginResult.kt @@ -0,0 +1,6 @@ +package pl.szczodrzynski.edziennik.data.api.v2 + +import pl.szczodrzynski.edziennik.data.api.AppError +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile + +data class FirstLoginResult(val profileList: ArrayList, val error: AppError?) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/Librus.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/librus/Librus.kt similarity index 85% rename from app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/Librus.kt rename to app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/librus/Librus.kt index d99bce51..106a4f07 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/Librus.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/librus/Librus.kt @@ -1,24 +1,24 @@ -package pl.szczodrzynski.edziennik.api.v2.librus +package pl.szczodrzynski.edziennik.data.api.v2.librus import android.content.Context import pl.szczodrzynski.edziennik.App -import pl.szczodrzynski.edziennik.api.AppError -import pl.szczodrzynski.edziennik.api.AppError.* -import pl.szczodrzynski.edziennik.api.interfaces.* -import pl.szczodrzynski.edziennik.api.v2.LOGIN_MODE_LIBRUS_EMAIL -import pl.szczodrzynski.edziennik.api.v2.LOGIN_MODE_LIBRUS_JST -import pl.szczodrzynski.edziennik.api.v2.LOGIN_MODE_LIBRUS_SYNERGIA -import pl.szczodrzynski.edziennik.api.v2.librus.firstlogin.FirstLoginLibrus -import pl.szczodrzynski.edziennik.api.v2.librus.firstlogin.FirstLoginSynergia -import pl.szczodrzynski.edziennik.api.v2.librus.login.LoginJst -import pl.szczodrzynski.edziennik.api.v2.librus.login.LoginLibrus -import pl.szczodrzynski.edziennik.api.v2.librus.login.LoginSynergia -import pl.szczodrzynski.edziennik.api.v2.librus.login.SynergiaTokenExtractor -import pl.szczodrzynski.edziennik.api.v2.models.DataStore -import pl.szczodrzynski.edziennik.datamodels.LoginStore -import pl.szczodrzynski.edziennik.datamodels.MessageFull -import pl.szczodrzynski.edziennik.datamodels.Profile -import pl.szczodrzynski.edziennik.datamodels.ProfileFull +import pl.szczodrzynski.edziennik.data.api.AppError +import pl.szczodrzynski.edziennik.data.api.AppError.* +import pl.szczodrzynski.edziennik.data.api.interfaces.* +import pl.szczodrzynski.edziennik.data.api.v2.LOGIN_MODE_LIBRUS_EMAIL +import pl.szczodrzynski.edziennik.data.api.v2.LOGIN_MODE_LIBRUS_JST +import pl.szczodrzynski.edziennik.data.api.v2.LOGIN_MODE_LIBRUS_SYNERGIA +import pl.szczodrzynski.edziennik.data.api.v2.librus.firstlogin.FirstLoginLibrus +import pl.szczodrzynski.edziennik.data.api.v2.librus.firstlogin.FirstLoginSynergia +import pl.szczodrzynski.edziennik.data.api.v2.librus.login.LoginJst +import pl.szczodrzynski.edziennik.data.api.v2.librus.login.LoginLibrus +import pl.szczodrzynski.edziennik.data.api.v2.librus.login.LoginSynergia +import pl.szczodrzynski.edziennik.data.api.v2.librus.login.SynergiaTokenExtractor +import pl.szczodrzynski.edziennik.data.api.v2.models.DataStore +import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore +import pl.szczodrzynski.edziennik.data.db.modules.messages.MessageFull +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile +import pl.szczodrzynski.edziennik.data.db.modules.profiles.ProfileFull import pl.szczodrzynski.edziennik.ui.modules.messages.MessagesComposeInfo import pl.szczodrzynski.edziennik.utils.models.Endpoint import pl.szczodrzynski.edziennik.utils.Utils.d diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/librus/data/DataLibrus.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/librus/data/DataLibrus.kt new file mode 100644 index 00000000..85f1167e --- /dev/null +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/librus/data/DataLibrus.kt @@ -0,0 +1,10 @@ +package pl.szczodrzynski.edziennik.data.api.v2.librus.data + +import pl.szczodrzynski.edziennik.App +import pl.szczodrzynski.edziennik.data.api.interfaces.ProgressCallback +import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile + +class DataLibrus(val app: App, val profile: Profile, val loginStore: LoginStore, val callback: ProgressCallback, val onSuccess: () -> Unit) { + +} diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/librus/firstlogin/FirstLoginLibrus.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/librus/firstlogin/FirstLoginLibrus.kt new file mode 100644 index 00000000..0e8e02b6 --- /dev/null +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/librus/firstlogin/FirstLoginLibrus.kt @@ -0,0 +1,12 @@ +package pl.szczodrzynski.edziennik.data.api.v2.librus.firstlogin + +import pl.szczodrzynski.edziennik.App +import pl.szczodrzynski.edziennik.data.api.interfaces.ProgressCallback +import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile + +class FirstLoginLibrus(val app: App, val loginStore: LoginStore, val progressCallback: ProgressCallback, val onSuccess: (profileList: List) -> Unit) { + init { + + } +} diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/librus/firstlogin/FirstLoginSynergia.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/librus/firstlogin/FirstLoginSynergia.kt new file mode 100644 index 00000000..79587cd8 --- /dev/null +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/librus/firstlogin/FirstLoginSynergia.kt @@ -0,0 +1,12 @@ +package pl.szczodrzynski.edziennik.data.api.v2.librus.firstlogin + +import pl.szczodrzynski.edziennik.App +import pl.szczodrzynski.edziennik.data.api.interfaces.ProgressCallback +import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile + +class FirstLoginSynergia(val app: App, val loginStore: LoginStore, val progressCallback: ProgressCallback, val onSuccess: (profileList: List) -> Unit) { + init { + + } +} diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/login/LoginJst.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/librus/login/LoginJst.kt similarity index 50% rename from app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/login/LoginJst.kt rename to app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/librus/login/LoginJst.kt index 78ed7672..3baac1b1 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/login/LoginJst.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/librus/login/LoginJst.kt @@ -1,13 +1,12 @@ -package pl.szczodrzynski.edziennik.api.v2.librus.login +package pl.szczodrzynski.edziennik.data.api.v2.librus.login import pl.szczodrzynski.edziennik.App -import pl.szczodrzynski.edziennik.api.interfaces.ProgressCallback -import pl.szczodrzynski.edziennik.api.v2.ApiLoginResult -import pl.szczodrzynski.edziennik.datamodels.LoginStore +import pl.szczodrzynski.edziennik.data.api.interfaces.ProgressCallback +import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore class LoginJst(val app: App, val loginStore: LoginStore, val callback: ProgressCallback, val onSuccess: () -> Unit) { companion object { private const val TAG = "librus.LoginJst" } -} \ No newline at end of file +} diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/login/LoginLibrus.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/librus/login/LoginLibrus.kt similarity index 96% rename from app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/login/LoginLibrus.kt rename to app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/librus/login/LoginLibrus.kt index 959fc74c..26769951 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/login/LoginLibrus.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/librus/login/LoginLibrus.kt @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.api.v2.librus.login +package pl.szczodrzynski.edziennik.data.api.v2.librus.login import android.util.Pair import com.google.gson.JsonObject @@ -9,11 +9,11 @@ import im.wangchao.mhttp.callback.JsonCallbackHandler import im.wangchao.mhttp.callback.TextCallbackHandler import pl.szczodrzynski.edziennik.App import pl.szczodrzynski.edziennik.R -import pl.szczodrzynski.edziennik.api.AppError -import pl.szczodrzynski.edziennik.api.AppError.* -import pl.szczodrzynski.edziennik.api.interfaces.ProgressCallback -import pl.szczodrzynski.edziennik.api.v2.* -import pl.szczodrzynski.edziennik.datamodels.LoginStore +import pl.szczodrzynski.edziennik.data.api.AppError +import pl.szczodrzynski.edziennik.data.api.AppError.* +import pl.szczodrzynski.edziennik.data.api.interfaces.ProgressCallback +import pl.szczodrzynski.edziennik.data.api.v2.* +import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore import pl.szczodrzynski.edziennik.getInt import pl.szczodrzynski.edziennik.getString import pl.szczodrzynski.edziennik.utils.Utils.c @@ -180,4 +180,4 @@ class LoginLibrus(val app: App, val loginStore: LoginStore, val callback: Progre .build() .enqueue() } -} \ No newline at end of file +} diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/login/LoginSynergia.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/librus/login/LoginSynergia.kt similarity index 55% rename from app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/login/LoginSynergia.kt rename to app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/librus/login/LoginSynergia.kt index 026f3e50..ed48071f 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/login/LoginSynergia.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/librus/login/LoginSynergia.kt @@ -1,12 +1,12 @@ -package pl.szczodrzynski.edziennik.api.v2.librus.login +package pl.szczodrzynski.edziennik.data.api.v2.librus.login import pl.szczodrzynski.edziennik.App -import pl.szczodrzynski.edziennik.api.interfaces.ProgressCallback -import pl.szczodrzynski.edziennik.datamodels.LoginStore +import pl.szczodrzynski.edziennik.data.api.interfaces.ProgressCallback +import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore class LoginSynergia(val app: App, val loginStore: LoginStore, val callback: ProgressCallback, val onSuccess: () -> Unit) { companion object { private const val TAG = "librus.LoginSynergia" } -} \ No newline at end of file +} diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/login/SynergiaTokenExtractor.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/librus/login/SynergiaTokenExtractor.kt similarity index 91% rename from app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/login/SynergiaTokenExtractor.kt rename to app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/librus/login/SynergiaTokenExtractor.kt index c7f3f69e..983cd5b3 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/librus/login/SynergiaTokenExtractor.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/librus/login/SynergiaTokenExtractor.kt @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.api.v2.librus.login +package pl.szczodrzynski.edziennik.data.api.v2.librus.login import com.google.gson.JsonNull import com.google.gson.JsonObject @@ -6,13 +6,13 @@ import im.wangchao.mhttp.Request import im.wangchao.mhttp.Response import im.wangchao.mhttp.callback.JsonCallbackHandler import pl.szczodrzynski.edziennik.* -import pl.szczodrzynski.edziennik.api.AppError -import pl.szczodrzynski.edziennik.api.AppError.* -import pl.szczodrzynski.edziennik.api.v2.LIBRUS_USER_AGENT -import pl.szczodrzynski.edziennik.api.interfaces.ProgressCallback -import pl.szczodrzynski.edziennik.api.v2.LIBRUS_ACCOUNT_URL -import pl.szczodrzynski.edziennik.datamodels.LoginStore -import pl.szczodrzynski.edziennik.datamodels.Profile +import pl.szczodrzynski.edziennik.data.api.AppError +import pl.szczodrzynski.edziennik.data.api.AppError.* +import pl.szczodrzynski.edziennik.data.api.v2.LIBRUS_USER_AGENT +import pl.szczodrzynski.edziennik.data.api.interfaces.ProgressCallback +import pl.szczodrzynski.edziennik.data.api.v2.LIBRUS_ACCOUNT_URL +import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile import pl.szczodrzynski.edziennik.utils.Utils.d import java.net.HttpURLConnection.* @@ -107,4 +107,4 @@ class SynergiaTokenExtractor(val app: App, val profile: Profile, val loginStore: .enqueue() return true } -} \ No newline at end of file +} diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/models/DataStore.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/models/DataStore.kt similarity index 79% rename from app/src/main/java/pl/szczodrzynski/edziennik/api/v2/models/DataStore.kt rename to app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/models/DataStore.kt index a3d12e97..ac4c64eb 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/models/DataStore.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/models/DataStore.kt @@ -1,9 +1,24 @@ -package pl.szczodrzynski.edziennik.api.v2.models +package pl.szczodrzynski.edziennik.data.api.v2.models import android.util.LongSparseArray import androidx.core.util.forEach import androidx.core.util.isNotEmpty -import pl.szczodrzynski.edziennik.datamodels.* +import pl.szczodrzynski.edziennik.data.db.AppDb +import pl.szczodrzynski.edziennik.data.db.modules.announcements.Announcement +import pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance +import pl.szczodrzynski.edziennik.data.db.modules.events.Event +import pl.szczodrzynski.edziennik.data.db.modules.events.EventType +import pl.szczodrzynski.edziennik.data.db.modules.grades.Grade +import pl.szczodrzynski.edziennik.data.db.modules.grades.GradeCategory +import pl.szczodrzynski.edziennik.data.db.modules.lessons.Lesson +import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonChange +import pl.szczodrzynski.edziennik.data.db.modules.messages.Message +import pl.szczodrzynski.edziennik.data.db.modules.messages.MessageRecipient +import pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata +import pl.szczodrzynski.edziennik.data.db.modules.notices.Notice +import pl.szczodrzynski.edziennik.data.db.modules.subjects.Subject +import pl.szczodrzynski.edziennik.data.db.modules.teachers.Teacher +import pl.szczodrzynski.edziennik.data.db.modules.teams.Team import pl.szczodrzynski.edziennik.utils.models.Date data class DataStore(private val appDb: AppDb, val profileId: Int) { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/models/Feature.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/models/Feature.kt similarity index 64% rename from app/src/main/java/pl/szczodrzynski/edziennik/api/v2/models/Feature.kt rename to app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/models/Feature.kt index b502fe85..e9ca9fce 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/models/Feature.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/models/Feature.kt @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.api.v2.models +package pl.szczodrzynski.edziennik.data.api.v2.models data class Feature(val featureId: Int, val loginOptions: Map>) { @@ -7,4 +7,4 @@ data class Feature(val featureId: Int, val loginOptions: Map>) { } -} \ No newline at end of file +} diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/models/Features.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/models/Features.kt similarity index 73% rename from app/src/main/java/pl/szczodrzynski/edziennik/api/v2/models/Features.kt rename to app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/models/Features.kt index bf40bd80..6a0e9ece 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/models/Features.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/models/Features.kt @@ -1,6 +1,6 @@ -package pl.szczodrzynski.edziennik.api.v2.models +package pl.szczodrzynski.edziennik.data.api.v2.models -import pl.szczodrzynski.edziennik.api.v2.* +import pl.szczodrzynski.edziennik.data.api.v2.* val Features = listOf( Feature(FEATURE_TIMETABLE, mapOf( @@ -10,4 +10,4 @@ val Features = listOf( LOGIN_MODE_LIBRUS_JST ) )) -) \ No newline at end of file +) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/AppDb.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/AppDb.java similarity index 89% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/AppDb.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/AppDb.java index 05d390fd..647a94aa 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/AppDb.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/AppDb.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db; import androidx.sqlite.db.SupportSQLiteDatabase; import androidx.room.Database; @@ -6,6 +6,52 @@ import androidx.room.Room; import androidx.room.RoomDatabase; import androidx.room.TypeConverters; import androidx.room.migration.Migration; + +import pl.szczodrzynski.edziennik.data.db.modules.announcements.Announcement; +import pl.szczodrzynski.edziennik.data.db.modules.announcements.AnnouncementDao; +import pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance; +import pl.szczodrzynski.edziennik.data.db.modules.attendance.AttendanceDao; +import pl.szczodrzynski.edziennik.data.db.converters.ConverterDate; +import pl.szczodrzynski.edziennik.data.db.converters.ConverterJsonObject; +import pl.szczodrzynski.edziennik.data.db.converters.ConverterListLong; +import pl.szczodrzynski.edziennik.data.db.converters.ConverterListString; +import pl.szczodrzynski.edziennik.data.db.converters.ConverterTime; +import pl.szczodrzynski.edziennik.data.db.modules.debuglog.DebugLog; +import pl.szczodrzynski.edziennik.data.db.modules.debuglog.DebugLogDao; +import pl.szczodrzynski.edziennik.data.db.modules.events.Event; +import pl.szczodrzynski.edziennik.data.db.modules.events.EventDao; +import pl.szczodrzynski.edziennik.data.db.modules.events.EventType; +import pl.szczodrzynski.edziennik.data.db.modules.events.EventTypeDao; +import pl.szczodrzynski.edziennik.data.db.modules.feedback.FeedbackMessage; +import pl.szczodrzynski.edziennik.data.db.modules.feedback.FeedbackMessageDao; +import pl.szczodrzynski.edziennik.data.db.modules.grades.Grade; +import pl.szczodrzynski.edziennik.data.db.modules.grades.GradeCategory; +import pl.szczodrzynski.edziennik.data.db.modules.grades.GradeCategoryDao; +import pl.szczodrzynski.edziennik.data.db.modules.grades.GradeDao; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.Lesson; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonChange; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonChangeDao; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonDao; +import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore; +import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStoreDao; +import pl.szczodrzynski.edziennik.data.db.modules.luckynumber.LuckyNumber; +import pl.szczodrzynski.edziennik.data.db.modules.luckynumber.LuckyNumberDao; +import pl.szczodrzynski.edziennik.data.db.modules.messages.Message; +import pl.szczodrzynski.edziennik.data.db.modules.messages.MessageDao; +import pl.szczodrzynski.edziennik.data.db.modules.messages.MessageRecipient; +import pl.szczodrzynski.edziennik.data.db.modules.messages.MessageRecipientDao; +import pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata; +import pl.szczodrzynski.edziennik.data.db.modules.metadata.MetadataDao; +import pl.szczodrzynski.edziennik.data.db.modules.notices.Notice; +import pl.szczodrzynski.edziennik.data.db.modules.notices.NoticeDao; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.ProfileDao; +import pl.szczodrzynski.edziennik.data.db.modules.subjects.Subject; +import pl.szczodrzynski.edziennik.data.db.modules.subjects.SubjectDao; +import pl.szczodrzynski.edziennik.data.db.modules.teachers.Teacher; +import pl.szczodrzynski.edziennik.data.db.modules.teachers.TeacherDao; +import pl.szczodrzynski.edziennik.data.db.modules.teams.Team; +import pl.szczodrzynski.edziennik.data.db.modules.teams.TeamDao; import pl.szczodrzynski.edziennik.utils.models.Date; import android.content.Context; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/ConverterDate.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/converters/ConverterDate.java similarity index 87% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/ConverterDate.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/converters/ConverterDate.java index e77c3e2b..a130362b 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/ConverterDate.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/converters/ConverterDate.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.converters; import androidx.room.TypeConverter; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/ConverterJsonObject.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/converters/ConverterJsonObject.java similarity index 89% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/ConverterJsonObject.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/converters/ConverterJsonObject.java index e0b864f1..47d9b4d4 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/ConverterJsonObject.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/converters/ConverterJsonObject.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.converters; import androidx.room.TypeConverter; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/ConverterListLong.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/converters/ConverterListLong.java similarity index 90% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/ConverterListLong.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/converters/ConverterListLong.java index 583c2605..b5c2ceb1 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/ConverterListLong.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/converters/ConverterListLong.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.converters; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/ConverterListString.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/converters/ConverterListString.java similarity index 90% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/ConverterListString.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/converters/ConverterListString.java index 86abae6b..6f579104 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/ConverterListString.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/converters/ConverterListString.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.converters; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/ConverterTime.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/converters/ConverterTime.java similarity index 88% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/ConverterTime.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/converters/ConverterTime.java index c3a37864..63573772 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/ConverterTime.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/converters/ConverterTime.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.converters; import androidx.room.TypeConverter; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Announcement.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/announcements/Announcement.java similarity index 94% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Announcement.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/announcements/Announcement.java index 516071f8..49ba227c 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Announcement.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/announcements/Announcement.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.announcements; import androidx.annotation.Nullable; import androidx.room.ColumnInfo; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/AnnouncementDao.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/announcements/AnnouncementDao.java similarity index 92% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/AnnouncementDao.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/announcements/AnnouncementDao.java index 165ca00b..852e16f4 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/AnnouncementDao.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/announcements/AnnouncementDao.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.announcements; import java.util.List; @@ -11,7 +11,9 @@ import androidx.room.RawQuery; import androidx.sqlite.db.SimpleSQLiteQuery; import androidx.sqlite.db.SupportSQLiteQuery; -import static pl.szczodrzynski.edziennik.datamodels.Metadata.TYPE_ANNOUNCEMENT; +import pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata; + +import static pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.TYPE_ANNOUNCEMENT; @Dao public abstract class AnnouncementDao { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/AnnouncementFull.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/announcements/AnnouncementFull.java similarity index 74% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/AnnouncementFull.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/announcements/AnnouncementFull.java index d7c5fd74..29d4e814 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/AnnouncementFull.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/announcements/AnnouncementFull.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.announcements; public class AnnouncementFull extends Announcement { public String teacherFullName = ""; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Attendance.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/attendance/Attendance.java similarity index 96% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Attendance.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/attendance/Attendance.java index ca8a5f58..b7ae5ca4 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Attendance.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/attendance/Attendance.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.attendance; import androidx.annotation.NonNull; import androidx.room.ColumnInfo; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/AttendanceDao.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/attendance/AttendanceDao.java similarity index 96% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/AttendanceDao.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/attendance/AttendanceDao.java index 5dacf4f0..05c44822 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/AttendanceDao.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/attendance/AttendanceDao.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.attendance; import androidx.lifecycle.LiveData; import androidx.sqlite.db.SimpleSQLiteQuery; @@ -12,7 +12,7 @@ import pl.szczodrzynski.edziennik.utils.models.Date; import java.util.List; -import static pl.szczodrzynski.edziennik.datamodels.Metadata.TYPE_ATTENDANCE; +import static pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.TYPE_ATTENDANCE; @Dao public abstract class AttendanceDao { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/AttendanceFull.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/attendance/AttendanceFull.java similarity index 81% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/AttendanceFull.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/attendance/AttendanceFull.java index 8f6d4a7b..8f9f3751 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/AttendanceFull.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/attendance/AttendanceFull.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.attendance; public class AttendanceFull extends Attendance { public String teacherFullName = ""; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/DebugLog.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/debuglog/DebugLog.java similarity index 82% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/DebugLog.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/debuglog/DebugLog.java index 7d22db18..866a3882 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/DebugLog.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/debuglog/DebugLog.java @@ -1,7 +1,6 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.debuglog; import androidx.room.Entity; -import androidx.room.Index; import androidx.room.PrimaryKey; import static pl.szczodrzynski.edziennik.utils.Utils.d; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/DebugLogDao.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/debuglog/DebugLogDao.java similarity index 69% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/DebugLogDao.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/debuglog/DebugLogDao.java index b1a0a5e6..14dd6a88 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/DebugLogDao.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/debuglog/DebugLogDao.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.debuglog; import androidx.room.Dao; import androidx.room.Insert; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Event.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/events/Event.java similarity index 98% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Event.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/events/Event.java index 24c916f0..e55e2a47 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Event.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/events/Event.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.events; import androidx.room.ColumnInfo; import androidx.room.Entity; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/EventDao.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/events/EventDao.java similarity index 95% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/EventDao.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/events/EventDao.java index 63c53ed1..2d1e7d37 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/EventDao.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/events/EventDao.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.events; import androidx.lifecycle.LiveData; import androidx.sqlite.db.SimpleSQLiteQuery; @@ -17,9 +17,9 @@ import java.util.List; import pl.szczodrzynski.edziennik.utils.models.Date; import pl.szczodrzynski.edziennik.utils.models.Time; -import static pl.szczodrzynski.edziennik.datamodels.Metadata.TYPE_EVENT; -import static pl.szczodrzynski.edziennik.datamodels.Metadata.TYPE_HOMEWORK; -import static pl.szczodrzynski.edziennik.datamodels.Metadata.TYPE_LESSON_CHANGE; +import static pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.TYPE_EVENT; +import static pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.TYPE_HOMEWORK; +import static pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.TYPE_LESSON_CHANGE; @Dao public abstract class EventDao { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/EventFull.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/events/EventFull.java similarity index 96% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/EventFull.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/events/EventFull.java index 98887679..08b6966b 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/EventFull.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/events/EventFull.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.events; public class EventFull extends Event { public String typeName = ""; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/EventType.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/events/EventType.java similarity index 92% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/EventType.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/events/EventType.java index 10848dc6..e06f7656 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/EventType.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/events/EventType.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.events; import android.graphics.Color; @@ -28,4 +28,4 @@ public class EventType { public EventType(int profileId, int id, String name, String color) { this(profileId, id, name, Color.parseColor(color)); } -} \ No newline at end of file +} diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/EventTypeDao.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/events/EventTypeDao.java similarity index 93% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/EventTypeDao.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/events/EventTypeDao.java index 0b0b0dd6..7baf8189 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/EventTypeDao.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/events/EventTypeDao.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.events; import java.util.List; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/FeedbackMessage.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/feedback/FeedbackMessage.java similarity index 91% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/FeedbackMessage.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/feedback/FeedbackMessage.java index 9e8328ba..14cd5823 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/FeedbackMessage.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/feedback/FeedbackMessage.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.feedback; import androidx.room.Entity; import androidx.room.Ignore; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/FeedbackMessageDao.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/feedback/FeedbackMessageDao.java similarity index 94% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/FeedbackMessageDao.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/feedback/FeedbackMessageDao.java index f35f6743..24a45376 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/FeedbackMessageDao.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/feedback/FeedbackMessageDao.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.feedback; import java.util.List; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/FeedbackMessageWithCount.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/feedback/FeedbackMessageWithCount.java similarity index 62% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/FeedbackMessageWithCount.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/feedback/FeedbackMessageWithCount.java index bbea7461..17320fee 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/FeedbackMessageWithCount.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/feedback/FeedbackMessageWithCount.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.feedback; public class FeedbackMessageWithCount extends FeedbackMessage { public int messageCount = 0; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Grade.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/grades/Grade.java similarity index 98% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Grade.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/grades/Grade.java index 0ac89fd3..e6883003 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Grade.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/grades/Grade.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.grades; import androidx.room.ColumnInfo; import androidx.room.Entity; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/GradeCategory.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/grades/GradeCategory.java similarity index 95% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/GradeCategory.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/grades/GradeCategory.java index 4ebd05c3..dfe76dfd 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/GradeCategory.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/grades/GradeCategory.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.grades; import java.util.ArrayList; import java.util.List; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/GradeCategoryDao.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/grades/GradeCategoryDao.java similarity index 94% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/GradeCategoryDao.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/grades/GradeCategoryDao.java index 3cfd8cf6..6cdf6bbe 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/GradeCategoryDao.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/grades/GradeCategoryDao.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.grades; import java.util.List; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/GradeDao.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/grades/GradeDao.java similarity index 97% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/GradeDao.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/grades/GradeDao.java index b986e471..4487317b 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/GradeDao.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/grades/GradeDao.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.grades; import androidx.lifecycle.LiveData; import androidx.sqlite.db.SimpleSQLiteQuery; @@ -14,7 +14,7 @@ import android.util.SparseIntArray; import java.util.List; -import static pl.szczodrzynski.edziennik.datamodels.Metadata.TYPE_GRADE; +import static pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.TYPE_GRADE; @Dao public abstract class GradeDao { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/GradeFull.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/grades/GradeFull.java similarity index 84% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/GradeFull.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/grades/GradeFull.java index ac1259bb..44c62b0a 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/GradeFull.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/grades/GradeFull.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.grades; public class GradeFull extends Grade { //public String category = ""; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Lesson.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/lessons/Lesson.java similarity index 97% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Lesson.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/lessons/Lesson.java index 0a1278e2..95402750 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Lesson.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/lessons/Lesson.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.lessons; import java.util.List; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LessonChange.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/lessons/LessonChange.java similarity index 98% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LessonChange.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/lessons/LessonChange.java index f85f34e4..e651494e 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LessonChange.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/lessons/LessonChange.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.lessons; import androidx.room.ColumnInfo; import androidx.room.Entity; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LessonChangeDao.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/lessons/LessonChangeDao.java similarity index 97% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LessonChangeDao.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/lessons/LessonChangeDao.java index 3e91bfde..d270eed3 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LessonChangeDao.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/lessons/LessonChangeDao.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.lessons; import androidx.lifecycle.LiveData; import androidx.sqlite.db.SimpleSQLiteQuery; @@ -14,7 +14,7 @@ import java.util.List; import pl.szczodrzynski.edziennik.utils.models.Date; import pl.szczodrzynski.edziennik.utils.models.db.LessonChangeCounter; -import static pl.szczodrzynski.edziennik.datamodels.Metadata.TYPE_LESSON_CHANGE; +import static pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.TYPE_LESSON_CHANGE; import static pl.szczodrzynski.edziennik.utils.Utils.d; @Dao diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LessonChangeFull.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/lessons/LessonChangeFull.java similarity index 84% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LessonChangeFull.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/lessons/LessonChangeFull.java index e44f9242..87cb2b95 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LessonChangeFull.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/lessons/LessonChangeFull.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.lessons; public class LessonChangeFull extends LessonChange { /*public String changeTeacherFullName = ""; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LessonDao.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/lessons/LessonDao.java similarity index 99% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LessonDao.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/lessons/LessonDao.java index e2de1e2f..220977ab 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LessonDao.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/lessons/LessonDao.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.lessons; import androidx.lifecycle.LiveData; import androidx.sqlite.db.SimpleSQLiteQuery; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LessonFull.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/lessons/LessonFull.java similarity index 94% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LessonFull.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/lessons/LessonFull.java index e60b26d3..fc607833 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LessonFull.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/lessons/LessonFull.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.lessons; import androidx.room.ColumnInfo; import android.content.Context; @@ -7,9 +7,9 @@ import androidx.annotation.Nullable; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.utils.models.Date; -import static pl.szczodrzynski.edziennik.datamodels.LessonChange.TYPE_ADDED; -import static pl.szczodrzynski.edziennik.datamodels.LessonChange.TYPE_CANCELLED; -import static pl.szczodrzynski.edziennik.datamodels.LessonChange.TYPE_CHANGE; +import static pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonChange.TYPE_ADDED; +import static pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonChange.TYPE_CANCELLED; +import static pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonChange.TYPE_CHANGE; import static pl.szczodrzynski.edziennik.utils.Utils.bs; public class LessonFull extends Lesson { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LoginStore.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/login/LoginStore.java similarity index 97% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LoginStore.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/login/LoginStore.java index ec13779c..5545c5f5 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LoginStore.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/login/LoginStore.java @@ -1,16 +1,17 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.login; import android.os.Bundle; import androidx.annotation.Nullable; import androidx.room.ColumnInfo; import androidx.room.Entity; -import androidx.annotation.NonNull; import androidx.room.Ignore; import com.google.gson.JsonElement; import com.google.gson.JsonObject; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.ProfileFull; + @Entity(tableName = "loginStores", primaryKeys = {"loginStoreId"}) public class LoginStore { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LoginStoreDao.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/login/LoginStoreDao.java similarity index 90% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LoginStoreDao.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/login/LoginStoreDao.java index eee57539..49fc3eea 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LoginStoreDao.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/login/LoginStoreDao.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.login; import androidx.lifecycle.LiveData; import androidx.room.Dao; @@ -8,6 +8,8 @@ import androidx.room.Query; import java.util.List; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.ProfileFull; + @Dao public abstract class LoginStoreDao { @Insert(onConflict = OnConflictStrategy.REPLACE) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LuckyNumber.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/luckynumber/LuckyNumber.java similarity index 90% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LuckyNumber.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/luckynumber/LuckyNumber.java index 6350a5f1..c2ccd4bb 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LuckyNumber.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/luckynumber/LuckyNumber.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.luckynumber; import androidx.room.ColumnInfo; import androidx.room.Entity; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LuckyNumberDao.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/luckynumber/LuckyNumberDao.java similarity index 94% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LuckyNumberDao.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/luckynumber/LuckyNumberDao.java index 9fe62154..a775bedf 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/LuckyNumberDao.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/luckynumber/LuckyNumberDao.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.luckynumber; import androidx.lifecycle.LiveData; import androidx.room.Dao; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Message.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/messages/Message.java similarity index 97% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Message.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/messages/Message.java index 6fbca751..02fdaa24 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Message.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/messages/Message.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.messages; import java.util.ArrayList; import java.util.List; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/MessageDao.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/messages/MessageDao.java similarity index 89% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/MessageDao.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/messages/MessageDao.java index 7decdfb5..8f5048b4 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/MessageDao.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/messages/MessageDao.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.messages; import java.util.List; @@ -11,10 +11,12 @@ import androidx.room.RawQuery; import androidx.sqlite.db.SimpleSQLiteQuery; import androidx.sqlite.db.SupportSQLiteQuery; -import static pl.szczodrzynski.edziennik.datamodels.Message.TYPE_DELETED; -import static pl.szczodrzynski.edziennik.datamodels.Message.TYPE_RECEIVED; -import static pl.szczodrzynski.edziennik.datamodels.Message.TYPE_SENT; -import static pl.szczodrzynski.edziennik.datamodels.Metadata.TYPE_MESSAGE; +import pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata; + +import static pl.szczodrzynski.edziennik.data.db.modules.messages.Message.TYPE_DELETED; +import static pl.szczodrzynski.edziennik.data.db.modules.messages.Message.TYPE_RECEIVED; +import static pl.szczodrzynski.edziennik.data.db.modules.messages.Message.TYPE_SENT; +import static pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.TYPE_MESSAGE; @Dao public abstract class MessageDao { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/MessageFull.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/messages/MessageFull.java similarity index 89% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/MessageFull.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/messages/MessageFull.java index b6b5547b..30df0a81 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/MessageFull.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/messages/MessageFull.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.messages; import java.util.ArrayList; import java.util.List; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/MessageRecipient.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/messages/MessageRecipient.java similarity index 94% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/MessageRecipient.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/messages/MessageRecipient.java index 973cc3eb..29635e5a 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/MessageRecipient.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/messages/MessageRecipient.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.messages; import androidx.room.ColumnInfo; import androidx.room.Entity; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/MessageRecipientDao.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/messages/MessageRecipientDao.java similarity index 92% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/MessageRecipientDao.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/messages/MessageRecipientDao.java index 72058604..4bd876e3 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/MessageRecipientDao.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/messages/MessageRecipientDao.java @@ -1,8 +1,7 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.messages; import java.util.List; -import androidx.lifecycle.LiveData; import androidx.room.Dao; import androidx.room.Insert; import androidx.room.OnConflictStrategy; @@ -11,8 +10,6 @@ import androidx.room.RawQuery; import androidx.sqlite.db.SimpleSQLiteQuery; import androidx.sqlite.db.SupportSQLiteQuery; -import static pl.szczodrzynski.edziennik.datamodels.Metadata.TYPE_MESSAGE; - @Dao public abstract class MessageRecipientDao { @Query("DELETE FROM messageRecipients WHERE profileId = :profileId") diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/MessageRecipientFull.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/messages/MessageRecipientFull.java similarity index 88% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/MessageRecipientFull.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/messages/MessageRecipientFull.java index d3aed76b..69dbd54c 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/MessageRecipientFull.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/messages/MessageRecipientFull.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.messages; public class MessageRecipientFull extends MessageRecipient { public String fullName = null; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Metadata.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/metadata/Metadata.java similarity index 97% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Metadata.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/metadata/Metadata.java index 2ac2a6e0..3e5be9f0 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Metadata.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/metadata/Metadata.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.metadata; import androidx.room.ColumnInfo; import androidx.room.Entity; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/MetadataDao.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/metadata/MetadataDao.java similarity index 88% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/MetadataDao.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/metadata/MetadataDao.java index 40a44d25..95733185 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/MetadataDao.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/metadata/MetadataDao.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.metadata; import androidx.lifecycle.LiveData; import androidx.room.Dao; @@ -9,16 +9,24 @@ import androidx.room.Transaction; import java.util.List; +import pl.szczodrzynski.edziennik.data.db.modules.notices.Notice; +import pl.szczodrzynski.edziennik.data.db.modules.announcements.Announcement; +import pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance; +import pl.szczodrzynski.edziennik.data.db.modules.events.Event; +import pl.szczodrzynski.edziennik.data.db.modules.grades.Grade; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonChange; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonFull; +import pl.szczodrzynski.edziennik.data.db.modules.messages.Message; import pl.szczodrzynski.edziennik.utils.models.db.UnreadCounter; -import static pl.szczodrzynski.edziennik.datamodels.Metadata.TYPE_ANNOUNCEMENT; -import static pl.szczodrzynski.edziennik.datamodels.Metadata.TYPE_ATTENDANCE; -import static pl.szczodrzynski.edziennik.datamodels.Metadata.TYPE_EVENT; -import static pl.szczodrzynski.edziennik.datamodels.Metadata.TYPE_GRADE; -import static pl.szczodrzynski.edziennik.datamodels.Metadata.TYPE_HOMEWORK; -import static pl.szczodrzynski.edziennik.datamodels.Metadata.TYPE_LESSON_CHANGE; -import static pl.szczodrzynski.edziennik.datamodels.Metadata.TYPE_MESSAGE; -import static pl.szczodrzynski.edziennik.datamodels.Metadata.TYPE_NOTICE; +import static pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.TYPE_ANNOUNCEMENT; +import static pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.TYPE_ATTENDANCE; +import static pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.TYPE_EVENT; +import static pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.TYPE_GRADE; +import static pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.TYPE_HOMEWORK; +import static pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.TYPE_LESSON_CHANGE; +import static pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.TYPE_MESSAGE; +import static pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.TYPE_NOTICE; @Dao public abstract class MetadataDao { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Notice.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/notices/Notice.java similarity index 94% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Notice.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/notices/Notice.java index 230dd596..f80ac904 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Notice.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/notices/Notice.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.notices; import androidx.room.ColumnInfo; import androidx.room.Entity; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/NoticeDao.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/notices/NoticeDao.java similarity index 92% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/NoticeDao.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/notices/NoticeDao.java index 3fcda14b..0d6a28ec 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/NoticeDao.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/notices/NoticeDao.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.notices; import androidx.lifecycle.LiveData; import androidx.sqlite.db.SimpleSQLiteQuery; @@ -11,7 +11,9 @@ import androidx.room.RawQuery; import java.util.List; -import static pl.szczodrzynski.edziennik.datamodels.Metadata.TYPE_NOTICE; +import pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata; + +import static pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.TYPE_NOTICE; @Dao public abstract class NoticeDao { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/NoticeFull.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/notices/NoticeFull.java similarity index 75% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/NoticeFull.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/notices/NoticeFull.java index 5746118b..4fbf3119 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/NoticeFull.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/notices/NoticeFull.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.notices; public class NoticeFull extends Notice { public String teacherFullName = ""; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Profile.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/profiles/Profile.kt similarity index 99% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Profile.kt rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/profiles/Profile.kt index 5cf1b446..d53118c6 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Profile.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/profiles/Profile.kt @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels +package pl.szczodrzynski.edziennik.data.db.modules.profiles import androidx.room.ColumnInfo import androidx.room.Entity diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/ProfileDao.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/profiles/ProfileDao.java similarity index 95% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/ProfileDao.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/profiles/ProfileDao.java index a22aab66..2cb9fe68 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/ProfileDao.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/profiles/ProfileDao.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.profiles; import androidx.lifecycle.LiveData; import androidx.room.Dao; @@ -8,7 +8,7 @@ import androidx.room.Query; import java.util.List; -import static pl.szczodrzynski.edziennik.datamodels.Profile.REGISTRATION_ENABLED; +import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.REGISTRATION_ENABLED; @Dao public interface ProfileDao { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/ProfileFull.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/profiles/ProfileFull.kt similarity index 97% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/ProfileFull.kt rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/profiles/ProfileFull.kt index 037c29cc..f692bcf5 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/ProfileFull.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/profiles/ProfileFull.kt @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels +package pl.szczodrzynski.edziennik.data.db.modules.profiles import android.content.Context import androidx.room.ColumnInfo @@ -11,7 +11,8 @@ import pl.szczodrzynski.edziennik.MainActivity.Companion.DRAWER_ITEM_HOMEWORK import pl.szczodrzynski.edziennik.MainActivity.Companion.DRAWER_ITEM_MESSAGES import pl.szczodrzynski.edziennik.MainActivity.Companion.DRAWER_ITEM_NOTICES import pl.szczodrzynski.edziennik.MainActivity.Companion.DRAWER_ITEM_TIMETABLE -import pl.szczodrzynski.edziennik.datamodels.LoginStore.* +import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore +import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore.* import java.util.* class ProfileFull : Profile { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Subject.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/subjects/Subject.java similarity index 96% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Subject.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/subjects/Subject.java index e927ae15..f5192f20 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Subject.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/subjects/Subject.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.subjects; import java.util.List; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/SubjectDao.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/subjects/SubjectDao.java similarity index 94% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/SubjectDao.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/subjects/SubjectDao.java index a1f63e1f..1698efce 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/SubjectDao.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/subjects/SubjectDao.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.subjects; import androidx.lifecycle.LiveData; import androidx.room.Dao; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Teacher.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/teachers/Teacher.java similarity index 98% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Teacher.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/teachers/Teacher.java index 2679b5a5..ba7e84c6 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Teacher.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/teachers/Teacher.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.teachers; import android.content.Context; import android.graphics.Bitmap; @@ -6,7 +6,6 @@ import android.graphics.Bitmap; import java.util.List; import androidx.annotation.NonNull; -import androidx.annotation.Nullable; import androidx.room.ColumnInfo; import androidx.room.Entity; import androidx.room.Ignore; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/TeacherDao.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/teachers/TeacherDao.java similarity index 95% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/TeacherDao.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/teachers/TeacherDao.java index 649fea8f..cde76ccd 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/TeacherDao.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/teachers/TeacherDao.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.teachers; import androidx.lifecycle.LiveData; import androidx.room.Dao; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Team.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/teams/Team.java similarity index 95% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Team.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/teams/Team.java index 51073444..eb5b4af7 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/Team.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/teams/Team.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.teams; import androidx.room.ColumnInfo; import androidx.room.Entity; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/TeamDao.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/teams/TeamDao.java similarity index 97% rename from app/src/main/java/pl/szczodrzynski/edziennik/datamodels/TeamDao.java rename to app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/teams/TeamDao.java index 409b4b51..2abb9af5 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/datamodels/TeamDao.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/teams/TeamDao.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.teams; import androidx.lifecycle.LiveData; import androidx.room.Dao; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/network/ServerRequest.java b/app/src/main/java/pl/szczodrzynski/edziennik/network/ServerRequest.java index 373fa30b..aec2b69e 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/network/ServerRequest.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/network/ServerRequest.java @@ -16,10 +16,10 @@ import im.wangchao.mhttp.ThreadMode; import im.wangchao.mhttp.callback.JsonCallbackHandler; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.BuildConfig; -import pl.szczodrzynski.edziennik.datamodels.ProfileFull; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.ProfileFull; import pl.szczodrzynski.edziennik.utils.Utils; -import static pl.szczodrzynski.edziennik.datamodels.Profile.REGISTRATION_ENABLED; +import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.REGISTRATION_ENABLED; public class ServerRequest { private App app; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/sync/MyFirebaseMessagingService.java b/app/src/main/java/pl/szczodrzynski/edziennik/sync/MyFirebaseMessagingService.java index a9984194..d8841ebf 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/sync/MyFirebaseMessagingService.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/sync/MyFirebaseMessagingService.java @@ -17,19 +17,19 @@ import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.BuildConfig; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.MainActivity; -import pl.szczodrzynski.edziennik.datamodels.Event; -import pl.szczodrzynski.edziennik.datamodels.EventFull; -import pl.szczodrzynski.edziennik.datamodels.EventType; -import pl.szczodrzynski.edziennik.datamodels.FeedbackMessage; -import pl.szczodrzynski.edziennik.datamodels.ProfileFull; -import pl.szczodrzynski.edziennik.datamodels.Team; +import pl.szczodrzynski.edziennik.data.db.modules.events.Event; +import pl.szczodrzynski.edziennik.data.db.modules.events.EventFull; +import pl.szczodrzynski.edziennik.data.db.modules.events.EventType; +import pl.szczodrzynski.edziennik.data.db.modules.feedback.FeedbackMessage; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.ProfileFull; +import pl.szczodrzynski.edziennik.data.db.modules.teams.Team; import pl.szczodrzynski.edziennik.ui.modules.base.DebugFragment; import pl.szczodrzynski.edziennik.utils.models.Notification; import pl.szczodrzynski.edziennik.network.ServerRequest; import static pl.szczodrzynski.edziennik.App.APP_URL; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_HOMEWORK; -import static pl.szczodrzynski.edziennik.datamodels.LoginStore.LOGIN_TYPE_MOBIDZIENNIK; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_HOMEWORK; +import static pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore.LOGIN_TYPE_MOBIDZIENNIK; import static pl.szczodrzynski.edziennik.utils.Utils.d; import static pl.szczodrzynski.edziennik.utils.Utils.strToInt; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/sync/SyncService.java b/app/src/main/java/pl/szczodrzynski/edziennik/sync/SyncService.java index 5f4263ad..e3eddf3d 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/sync/SyncService.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/sync/SyncService.java @@ -14,11 +14,11 @@ import java.util.Collection; import java.util.List; import pl.szczodrzynski.edziennik.App; -import pl.szczodrzynski.edziennik.api.AppError; -import pl.szczodrzynski.edziennik.api.interfaces.SyncCallback; -import pl.szczodrzynski.edziennik.datamodels.LoginStore; -import pl.szczodrzynski.edziennik.datamodels.Profile; -import pl.szczodrzynski.edziennik.datamodels.ProfileFull; +import pl.szczodrzynski.edziennik.data.api.AppError; +import pl.szczodrzynski.edziennik.data.api.interfaces.SyncCallback; +import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.ProfileFull; import static pl.szczodrzynski.edziennik.Notifier.ID_GET_DATA; import static pl.szczodrzynski.edziennik.Notifier.ID_GET_DATA_ERROR; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventListAdapter.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventListAdapter.java index 3df99e78..ccf28951 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventListAdapter.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventListAdapter.java @@ -18,12 +18,12 @@ import java.util.List; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.datamodels.Event; -import pl.szczodrzynski.edziennik.datamodels.EventFull; +import pl.szczodrzynski.edziennik.data.db.modules.events.Event; +import pl.szczodrzynski.edziennik.data.db.modules.events.EventFull; import pl.szczodrzynski.edziennik.utils.models.Date; import pl.szczodrzynski.edziennik.utils.Utils; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_HOMEWORK; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_HOMEWORK; import static pl.szczodrzynski.edziennik.utils.Utils.bs; import static pl.szczodrzynski.edziennik.utils.Utils.d; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventListDialog.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventListDialog.java index 57ae66fc..6cd3fbbd 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventListDialog.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventListDialog.java @@ -18,8 +18,8 @@ import androidx.recyclerview.widget.RecyclerView; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.datamodels.LessonChange; -import pl.szczodrzynski.edziennik.datamodels.LessonFull; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonChange; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonFull; import pl.szczodrzynski.edziennik.ui.dialogs.lessonchange.LessonChangeDialog; import pl.szczodrzynski.edziennik.utils.models.Date; import pl.szczodrzynski.edziennik.utils.models.Time; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventManualDialog.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventManualDialog.java index bfdb5be7..4a24d2e0 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventManualDialog.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventManualDialog.java @@ -36,16 +36,16 @@ import java.util.List; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.MainActivity; -import pl.szczodrzynski.edziennik.api.AppError; -import pl.szczodrzynski.edziennik.datamodels.Event; -import pl.szczodrzynski.edziennik.datamodels.EventFull; -import pl.szczodrzynski.edziennik.datamodels.EventType; -import pl.szczodrzynski.edziennik.datamodels.LessonFull; -import pl.szczodrzynski.edziennik.datamodels.Metadata; -import pl.szczodrzynski.edziennik.datamodels.ProfileFull; -import pl.szczodrzynski.edziennik.datamodels.Subject; -import pl.szczodrzynski.edziennik.datamodels.Teacher; -import pl.szczodrzynski.edziennik.datamodels.Team; +import pl.szczodrzynski.edziennik.data.api.AppError; +import pl.szczodrzynski.edziennik.data.db.modules.events.Event; +import pl.szczodrzynski.edziennik.data.db.modules.events.EventFull; +import pl.szczodrzynski.edziennik.data.db.modules.events.EventType; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonFull; +import pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.ProfileFull; +import pl.szczodrzynski.edziennik.data.db.modules.subjects.Subject; +import pl.szczodrzynski.edziennik.data.db.modules.teachers.Teacher; +import pl.szczodrzynski.edziennik.data.db.modules.teams.Team; import pl.szczodrzynski.edziennik.utils.models.Date; import pl.szczodrzynski.edziennik.utils.models.Time; import pl.szczodrzynski.edziennik.utils.models.Week; @@ -54,11 +54,11 @@ import pl.szczodrzynski.edziennik.utils.TextInputDropDown; import pl.szczodrzynski.edziennik.utils.Themes; import static pl.szczodrzynski.edziennik.App.APP_URL; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_OTHER; -import static pl.szczodrzynski.edziennik.datamodels.Event.COLOR_DEFAULT; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_HOMEWORK; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_UNDEFINED; -import static pl.szczodrzynski.edziennik.datamodels.Profile.REGISTRATION_ENABLED; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_OTHER; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.COLOR_DEFAULT; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_HOMEWORK; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_UNDEFINED; +import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.REGISTRATION_ENABLED; import static pl.szczodrzynski.edziennik.utils.Utils.bs; import static pl.szczodrzynski.edziennik.utils.Utils.ns; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/grade/GradeDetailsDialog.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/grade/GradeDetailsDialog.java index 43ad22d3..cabc3e63 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/grade/GradeDetailsDialog.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/grade/GradeDetailsDialog.java @@ -19,11 +19,11 @@ import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.ui.modules.grades.GradesListAdapter; import pl.szczodrzynski.edziennik.databinding.DialogGradeDetailsBinding; -import pl.szczodrzynski.edziennik.datamodels.Grade; -import pl.szczodrzynski.edziennik.datamodels.GradeFull; +import pl.szczodrzynski.edziennik.data.db.modules.grades.Grade; +import pl.szczodrzynski.edziennik.data.db.modules.grades.GradeFull; import pl.szczodrzynski.edziennik.utils.Colors; -import static pl.szczodrzynski.edziennik.datamodels.Profile.COLOR_MODE_DEFAULT; +import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.COLOR_MODE_DEFAULT; public class GradeDetailsDialog { private App app; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/lessonchange/LessonChangeDialog.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/lessonchange/LessonChangeDialog.java index 3d58f199..155bad51 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/lessonchange/LessonChangeDialog.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/lessonchange/LessonChangeDialog.java @@ -16,7 +16,7 @@ import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.ui.modules.timetable.TimetableAdapter; import pl.szczodrzynski.edziennik.databinding.DialogLessonChangeListBinding; -import pl.szczodrzynski.edziennik.datamodels.LessonFull; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonFull; import pl.szczodrzynski.edziennik.utils.models.Date; import pl.szczodrzynski.edziennik.utils.models.Time; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/RegisterAgendaCalendarFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/RegisterAgendaCalendarFragment.java index 4048694b..0ac063fc 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/RegisterAgendaCalendarFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/RegisterAgendaCalendarFragment.java @@ -28,8 +28,8 @@ import java.util.List; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.databinding.FragmentRegisterAgendaCalendarBinding; -import pl.szczodrzynski.edziennik.datamodels.EventFull; -import pl.szczodrzynski.edziennik.datamodels.LessonFull; +import pl.szczodrzynski.edziennik.data.db.modules.events.EventFull; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonFull; import pl.szczodrzynski.edziennik.ui.dialogs.event.EventListDialog; import pl.szczodrzynski.edziennik.utils.models.Date; import pl.szczodrzynski.edziennik.utils.Themes; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/RegisterAgendaDefaultFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/RegisterAgendaDefaultFragment.java index 3e9ffcba..c3dbd0c6 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/RegisterAgendaDefaultFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/RegisterAgendaDefaultFragment.java @@ -38,8 +38,8 @@ import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.MainActivity; import pl.szczodrzynski.edziennik.databinding.FragmentRegisterAgendaCalendarBinding; import pl.szczodrzynski.edziennik.databinding.FragmentRegisterAgendaDefaultBinding; -import pl.szczodrzynski.edziennik.datamodels.EventFull; -import pl.szczodrzynski.edziennik.datamodels.LessonFull; +import pl.szczodrzynski.edziennik.data.db.modules.events.EventFull; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonFull; import pl.szczodrzynski.edziennik.ui.dialogs.event.EventListDialog; import pl.szczodrzynski.edziennik.ui.dialogs.event.EventManualDialog; import pl.szczodrzynski.edziennik.ui.dialogs.lessonchange.LessonChangeDialog; @@ -52,9 +52,9 @@ import pl.szczodrzynski.edziennik.utils.Utils; import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetPrimaryItem; import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetSeparatorItem; -import static pl.szczodrzynski.edziennik.datamodels.Metadata.TYPE_EVENT; -import static pl.szczodrzynski.edziennik.datamodels.Profile.AGENDA_CALENDAR; -import static pl.szczodrzynski.edziennik.datamodels.Profile.AGENDA_DEFAULT; +import static pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.TYPE_EVENT; +import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.AGENDA_CALENDAR; +import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.AGENDA_DEFAULT; import static pl.szczodrzynski.edziennik.utils.Utils.bs; import static pl.szczodrzynski.edziennik.utils.Utils.intToStr; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/announcements/AnnouncementsAdapter.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/announcements/AnnouncementsAdapter.java index 3b76fcb7..1b0d4fda 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/announcements/AnnouncementsAdapter.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/announcements/AnnouncementsAdapter.java @@ -15,7 +15,7 @@ import androidx.databinding.DataBindingUtil; import androidx.recyclerview.widget.RecyclerView; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.databinding.RowAnnouncementsItemBinding; -import pl.szczodrzynski.edziennik.datamodels.AnnouncementFull; +import pl.szczodrzynski.edziennik.data.db.modules.announcements.AnnouncementFull; public class AnnouncementsAdapter extends RecyclerView.Adapter { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/announcements/RegisterAnnouncementsFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/announcements/RegisterAnnouncementsFragment.java index 5b8d36a7..8e70a958 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/announcements/RegisterAnnouncementsFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/announcements/RegisterAnnouncementsFragment.java @@ -24,7 +24,7 @@ import pl.szczodrzynski.edziennik.databinding.FragmentRegisterSchoolNoticesBindi import pl.szczodrzynski.edziennik.utils.Themes; import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetPrimaryItem; -import static pl.szczodrzynski.edziennik.datamodels.Metadata.TYPE_ANNOUNCEMENT; +import static pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.TYPE_ANNOUNCEMENT; public class RegisterAnnouncementsFragment extends Fragment { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/AttendancesAdapter.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/AttendancesAdapter.java index 35d3d1de..a8b71528 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/AttendancesAdapter.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/AttendancesAdapter.java @@ -15,14 +15,14 @@ import java.util.List; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.datamodels.AttendanceFull; +import pl.szczodrzynski.edziennik.data.db.modules.attendance.AttendanceFull; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_ABSENT; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_ABSENT_EXCUSED; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_BELATED; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_BELATED_EXCUSED; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_PRESENT; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_RELEASED; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_ABSENT; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_ABSENT_EXCUSED; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_BELATED; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_BELATED_EXCUSED; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_PRESENT; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_RELEASED; public class AttendancesAdapter extends RecyclerView.Adapter { private Context context; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/RegisterAttendancesFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/RegisterAttendancesFragment.java index 638c934c..e5f8b43a 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/RegisterAttendancesFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/RegisterAttendancesFragment.java @@ -40,22 +40,22 @@ import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.MainActivity; import pl.szczodrzynski.edziennik.databinding.FragmentRegisterAttendancesBinding; -import pl.szczodrzynski.edziennik.datamodels.AttendanceFull; -import pl.szczodrzynski.edziennik.datamodels.Subject; +import pl.szczodrzynski.edziennik.data.db.modules.attendance.AttendanceFull; +import pl.szczodrzynski.edziennik.data.db.modules.subjects.Subject; import pl.szczodrzynski.edziennik.utils.models.Date; import pl.szczodrzynski.edziennik.utils.models.Week; import pl.szczodrzynski.edziennik.utils.Themes; import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetPrimaryItem; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_ABSENT; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_ABSENT_EXCUSED; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_BELATED; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_BELATED_EXCUSED; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_PRESENT; -import static pl.szczodrzynski.edziennik.datamodels.Attendance.TYPE_RELEASED; -import static pl.szczodrzynski.edziennik.datamodels.LoginStore.LOGIN_TYPE_MOBIDZIENNIK; -import static pl.szczodrzynski.edziennik.datamodels.LoginStore.LOGIN_TYPE_VULCAN; -import static pl.szczodrzynski.edziennik.datamodels.Metadata.TYPE_ATTENDANCE; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_ABSENT; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_ABSENT_EXCUSED; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_BELATED; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_BELATED_EXCUSED; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_PRESENT; +import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_RELEASED; +import static pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore.LOGIN_TYPE_MOBIDZIENNIK; +import static pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore.LOGIN_TYPE_VULCAN; +import static pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.TYPE_ATTENDANCE; public class RegisterAttendancesFragment extends Fragment { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/CrashActivity.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/CrashActivity.java index 2371e286..f159282a 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/CrashActivity.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/CrashActivity.java @@ -41,7 +41,7 @@ import pl.szczodrzynski.edziennik.network.ServerRequest; import pl.szczodrzynski.edziennik.utils.Themes; import static pl.szczodrzynski.edziennik.App.APP_URL; -import static pl.szczodrzynski.edziennik.datamodels.Profile.REGISTRATION_ENABLED; +import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.REGISTRATION_ENABLED; public final class CrashActivity extends AppCompatActivity { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/FeedbackActivity.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/FeedbackActivity.java index b09d8211..a1625acd 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/FeedbackActivity.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/FeedbackActivity.java @@ -6,8 +6,8 @@ import androidx.databinding.DataBindingUtil; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.databinding.ActivityFeedbackBinding; -import pl.szczodrzynski.edziennik.datamodels.FeedbackMessage; -import pl.szczodrzynski.edziennik.datamodels.FeedbackMessageWithCount; +import pl.szczodrzynski.edziennik.data.db.modules.feedback.FeedbackMessage; +import pl.szczodrzynski.edziennik.data.db.modules.feedback.FeedbackMessageWithCount; import pl.szczodrzynski.edziennik.network.ServerRequest; import pl.szczodrzynski.edziennik.utils.Anim; import pl.szczodrzynski.edziennik.utils.Themes; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/FeedbackFragment.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/FeedbackFragment.kt index e0689141..4351a6f7 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/FeedbackFragment.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/FeedbackFragment.kt @@ -25,7 +25,7 @@ import pl.szczodrzynski.edziennik.App.APP_URL import pl.szczodrzynski.edziennik.R import pl.szczodrzynski.edziennik.MainActivity import pl.szczodrzynski.edziennik.databinding.FragmentFeedbackBinding -import pl.szczodrzynski.edziennik.datamodels.FeedbackMessage +import pl.szczodrzynski.edziennik.data.db.modules.feedback.FeedbackMessage import pl.szczodrzynski.edziennik.network.ServerRequest import pl.szczodrzynski.edziennik.utils.Anim import pl.szczodrzynski.edziennik.utils.Themes diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/GradesListAdapter.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/GradesListAdapter.java index ec902e12..0c1c1326 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/GradesListAdapter.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/GradesListAdapter.java @@ -18,13 +18,13 @@ import java.util.List; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.datamodels.Grade; -import pl.szczodrzynski.edziennik.datamodels.GradeFull; +import pl.szczodrzynski.edziennik.data.db.modules.grades.Grade; +import pl.szczodrzynski.edziennik.data.db.modules.grades.GradeFull; import pl.szczodrzynski.edziennik.ui.dialogs.grade.GradeDetailsDialog; import pl.szczodrzynski.edziennik.utils.models.Date; import pl.szczodrzynski.edziennik.utils.Colors; -import static pl.szczodrzynski.edziennik.datamodels.Profile.COLOR_MODE_DEFAULT; +import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.COLOR_MODE_DEFAULT; public class GradesListAdapter extends RecyclerView.Adapter { private Context mContext; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/GradesSubjectAdapter.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/GradesSubjectAdapter.java index 30dd7562..25705cb3 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/GradesSubjectAdapter.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/GradesSubjectAdapter.java @@ -30,10 +30,9 @@ import java.util.List; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.MainActivity; -import pl.szczodrzynski.edziennik.datamodels.AppDb; -import pl.szczodrzynski.edziennik.datamodels.GradeFull; -import pl.szczodrzynski.edziennik.datamodels.Subject; -import pl.szczodrzynski.edziennik.ui.modules.grades.GradesListAdapter; +import pl.szczodrzynski.edziennik.data.db.AppDb; +import pl.szczodrzynski.edziennik.data.db.modules.grades.GradeFull; +import pl.szczodrzynski.edziennik.data.db.modules.subjects.Subject; import pl.szczodrzynski.edziennik.utils.models.ItemGradesSubjectModel; import pl.szczodrzynski.edziennik.utils.Anim; import pl.szczodrzynski.edziennik.utils.Colors; @@ -42,10 +41,10 @@ import pl.szczodrzynski.edziennik.utils.Utils; import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; import static pl.szczodrzynski.edziennik.MainActivity.TARGET_GRADES_EDITOR; -import static pl.szczodrzynski.edziennik.datamodels.Profile.COLOR_MODE_DEFAULT; -import static pl.szczodrzynski.edziennik.datamodels.Profile.YEAR_1_AVG_2_SEM; -import static pl.szczodrzynski.edziennik.datamodels.Profile.YEAR_1_SEM_2_AVG; -import static pl.szczodrzynski.edziennik.datamodels.Profile.YEAR_1_SEM_2_SEM; +import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.COLOR_MODE_DEFAULT; +import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.YEAR_1_AVG_2_SEM; +import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.YEAR_1_SEM_2_AVG; +import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.YEAR_1_SEM_2_SEM; public class GradesSubjectAdapter extends ArrayAdapter implements View.OnClickListener { private static final String TAG = "GradesSubjectAdapter"; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/RegisterGradesFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/RegisterGradesFragment.java index f74f8b22..dddd897b 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/RegisterGradesFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/RegisterGradesFragment.java @@ -24,20 +24,20 @@ import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.MainActivity; import pl.szczodrzynski.edziennik.databinding.FragmentRegisterGradesBinding; -import pl.szczodrzynski.edziennik.datamodels.Grade; -import pl.szczodrzynski.edziennik.datamodels.GradeFull; -import pl.szczodrzynski.edziennik.datamodels.Subject; +import pl.szczodrzynski.edziennik.data.db.modules.grades.Grade; +import pl.szczodrzynski.edziennik.data.db.modules.grades.GradeFull; +import pl.szczodrzynski.edziennik.data.db.modules.subjects.Subject; import pl.szczodrzynski.edziennik.utils.models.ItemGradesSubjectModel; import pl.szczodrzynski.edziennik.utils.Themes; import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetPrimaryItem; import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetSeparatorItem; -import static pl.szczodrzynski.edziennik.datamodels.Metadata.TYPE_GRADE; -import static pl.szczodrzynski.edziennik.datamodels.Profile.YEAR_1_AVG_2_AVG; -import static pl.szczodrzynski.edziennik.datamodels.Profile.YEAR_1_AVG_2_SEM; -import static pl.szczodrzynski.edziennik.datamodels.Profile.YEAR_1_SEM_2_AVG; -import static pl.szczodrzynski.edziennik.datamodels.Profile.YEAR_1_SEM_2_SEM; -import static pl.szczodrzynski.edziennik.datamodels.Profile.YEAR_ALL_GRADES; +import static pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.TYPE_GRADE; +import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.YEAR_1_AVG_2_AVG; +import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.YEAR_1_AVG_2_SEM; +import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.YEAR_1_SEM_2_AVG; +import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.YEAR_1_SEM_2_SEM; +import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.YEAR_ALL_GRADES; import static pl.szczodrzynski.edziennik.utils.models.AppConfig.ORDER_BY_DATE_ASC; import static pl.szczodrzynski.edziennik.utils.models.AppConfig.ORDER_BY_DATE_DESC; import static pl.szczodrzynski.edziennik.utils.models.AppConfig.ORDER_BY_SUBJECT_ASC; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/editor/GradesEditorFragment.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/editor/GradesEditorFragment.kt index 2d362f62..7d8641ea 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/editor/GradesEditorFragment.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/editor/GradesEditorFragment.kt @@ -14,11 +14,11 @@ import androidx.recyclerview.widget.LinearLayoutManager import com.afollestad.materialdialogs.MaterialDialog import pl.szczodrzynski.edziennik.* import pl.szczodrzynski.edziennik.databinding.FragmentGradesEditorBinding -import pl.szczodrzynski.edziennik.datamodels.Grade -import pl.szczodrzynski.edziennik.datamodels.Profile.Companion.YEAR_1_AVG_2_AVG -import pl.szczodrzynski.edziennik.datamodels.Profile.Companion.YEAR_1_AVG_2_SEM -import pl.szczodrzynski.edziennik.datamodels.Profile.Companion.YEAR_1_SEM_2_AVG -import pl.szczodrzynski.edziennik.datamodels.Profile.Companion.YEAR_ALL_GRADES +import pl.szczodrzynski.edziennik.data.db.modules.grades.Grade +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.Companion.YEAR_1_AVG_2_AVG +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.Companion.YEAR_1_AVG_2_SEM +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.Companion.YEAR_1_SEM_2_AVG +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.Companion.YEAR_ALL_GRADES import pl.szczodrzynski.edziennik.utils.Colors import pl.szczodrzynski.edziennik.utils.Themes import java.text.DecimalFormat diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/CounterActivity.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/CounterActivity.java index 5c408573..14a6b71c 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/CounterActivity.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/CounterActivity.java @@ -15,8 +15,7 @@ import java.util.TimerTask; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.databinding.ActivityCounterBinding; -import pl.szczodrzynski.edziennik.datamodels.LessonFull; -import pl.szczodrzynski.edziennik.ui.modules.home.HomeFragment; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonFull; import pl.szczodrzynski.edziennik.utils.models.Date; import pl.szczodrzynski.edziennik.utils.models.Time; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/HomeFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/HomeFragment.java index 5498305f..24df37d0 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/HomeFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/HomeFragment.java @@ -44,10 +44,10 @@ import pl.szczodrzynski.edziennik.MainActivity; import pl.szczodrzynski.edziennik.databinding.CardLuckyNumberBinding; import pl.szczodrzynski.edziennik.databinding.CardUpdateBinding; import pl.szczodrzynski.edziennik.databinding.FragmentHomeBinding; -import pl.szczodrzynski.edziennik.datamodels.GradeFull; -import pl.szczodrzynski.edziennik.datamodels.LessonFull; -import pl.szczodrzynski.edziennik.datamodels.Profile; -import pl.szczodrzynski.edziennik.datamodels.Subject; +import pl.szczodrzynski.edziennik.data.db.modules.grades.GradeFull; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonFull; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile; +import pl.szczodrzynski.edziennik.data.db.modules.subjects.Subject; import pl.szczodrzynski.edziennik.ui.modules.messages.MessagesComposeActivity; import pl.szczodrzynski.edziennik.utils.models.Date; import pl.szczodrzynski.edziennik.utils.models.ItemGradesSubjectModel; @@ -60,13 +60,13 @@ import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetPrimaryItem; import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetSeparatorItem; import static pl.szczodrzynski.edziennik.App.UPDATES_ON_PLAY_STORE; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_SEMESTER1_FINAL; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_SEMESTER1_PROPOSED; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_SEMESTER2_FINAL; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_SEMESTER2_PROPOSED; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_YEAR_FINAL; -import static pl.szczodrzynski.edziennik.datamodels.Grade.TYPE_YEAR_PROPOSED; -import static pl.szczodrzynski.edziennik.datamodels.LoginStore.LOGIN_TYPE_MOBIDZIENNIK; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_SEMESTER1_FINAL; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_SEMESTER1_PROPOSED; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_SEMESTER2_FINAL; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_SEMESTER2_PROPOSED; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_YEAR_FINAL; +import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_YEAR_PROPOSED; +import static pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore.LOGIN_TYPE_MOBIDZIENNIK; public class HomeFragment extends Fragment { private static final String TAG = "HomeFragment"; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/HomeTimetableCard.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/HomeTimetableCard.java index ab75de3d..377efeb5 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/HomeTimetableCard.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/HomeTimetableCard.java @@ -24,14 +24,14 @@ import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.MainActivity; import pl.szczodrzynski.edziennik.databinding.CardTimetableBinding; -import pl.szczodrzynski.edziennik.datamodels.EventFull; -import pl.szczodrzynski.edziennik.datamodels.LessonFull; +import pl.szczodrzynski.edziennik.data.db.modules.events.EventFull; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonFull; import pl.szczodrzynski.edziennik.utils.models.Date; import pl.szczodrzynski.edziennik.utils.models.Time; import pl.szczodrzynski.edziennik.utils.models.Week; -import static pl.szczodrzynski.edziennik.datamodels.LessonChange.TYPE_CANCELLED; -import static pl.szczodrzynski.edziennik.datamodels.LessonChange.TYPE_CHANGE; +import static pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonChange.TYPE_CANCELLED; +import static pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonChange.TYPE_CHANGE; import static pl.szczodrzynski.edziennik.ui.modules.home.HomeFragment.updateInterval; import static pl.szczodrzynski.edziennik.utils.Utils.bs; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/homework/HomeworkAdapter.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/homework/HomeworkAdapter.java index 547b37f6..38644e37 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/homework/HomeworkAdapter.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/homework/HomeworkAdapter.java @@ -17,7 +17,7 @@ import java.util.List; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.datamodels.EventFull; +import pl.szczodrzynski.edziennik.data.db.modules.events.EventFull; import pl.szczodrzynski.edziennik.ui.dialogs.event.EventManualDialog; import pl.szczodrzynski.edziennik.ui.modules.home.HomeFragment; import pl.szczodrzynski.edziennik.utils.models.Date; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/homework/HomeworkFragment.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/homework/HomeworkFragment.kt index 171f4bf9..9ccd97ce 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/homework/HomeworkFragment.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/homework/HomeworkFragment.kt @@ -13,7 +13,7 @@ import pl.szczodrzynski.edziennik.App import pl.szczodrzynski.edziennik.MainActivity import pl.szczodrzynski.edziennik.R import pl.szczodrzynski.edziennik.databinding.FragmentHomeworkBinding -import pl.szczodrzynski.edziennik.datamodels.Metadata +import pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata import pl.szczodrzynski.edziennik.ui.dialogs.event.EventManualDialog import pl.szczodrzynski.edziennik.ui.modules.messages.MessagesFragment import pl.szczodrzynski.edziennik.utils.Themes diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/homework/HomeworkListFragment.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/homework/HomeworkListFragment.kt index e0ac9d97..22da31a5 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/homework/HomeworkListFragment.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/homework/HomeworkListFragment.kt @@ -11,7 +11,7 @@ import pl.szczodrzynski.edziennik.App import pl.szczodrzynski.edziennik.MainActivity import pl.szczodrzynski.edziennik.R import pl.szczodrzynski.edziennik.databinding.HomeworkListBinding -import pl.szczodrzynski.edziennik.datamodels.Event +import pl.szczodrzynski.edziennik.data.db.modules.events.Event import pl.szczodrzynski.edziennik.getInt import pl.szczodrzynski.edziennik.utils.models.Date import pl.szczodrzynski.edziennik.utils.Themes diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginActivity.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginActivity.java index b95f5b3a..5d5b210d 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginActivity.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginActivity.java @@ -14,7 +14,7 @@ import androidx.navigation.NavOptions; import androidx.navigation.Navigation; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.api.AppError; +import pl.szczodrzynski.edziennik.data.api.AppError; import pl.szczodrzynski.edziennik.databinding.ActivityLoginBinding; public class LoginActivity extends AppCompatActivity { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginIuczniowieFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginIuczniowieFragment.java index 484710ea..e1eb8091 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginIuczniowieFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginIuczniowieFragment.java @@ -18,12 +18,12 @@ import androidx.navigation.NavController; import androidx.navigation.Navigation; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.api.AppError; +import pl.szczodrzynski.edziennik.data.api.AppError; import pl.szczodrzynski.edziennik.databinding.FragmentLoginIuczniowieBinding; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_INVALID_LOGIN; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_INVALID_SCHOOL_NAME; -import static pl.szczodrzynski.edziennik.datamodels.LoginStore.LOGIN_TYPE_IUCZNIOWIE; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_INVALID_LOGIN; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_INVALID_SCHOOL_NAME; +import static pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore.LOGIN_TYPE_IUCZNIOWIE; public class LoginIuczniowieFragment extends Fragment { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginLibrusFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginLibrusFragment.java index cf08423b..fb0612fd 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginLibrusFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginLibrusFragment.java @@ -18,12 +18,12 @@ import androidx.navigation.NavController; import androidx.navigation.Navigation; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.api.AppError; +import pl.szczodrzynski.edziennik.data.api.AppError; import pl.szczodrzynski.edziennik.databinding.FragmentLoginLibrusBinding; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_INVALID_LOGIN; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_LIBRUS_NOT_ACTIVATED; -import static pl.szczodrzynski.edziennik.datamodels.LoginStore.LOGIN_TYPE_LIBRUS; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_INVALID_LOGIN; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_LIBRUS_NOT_ACTIVATED; +import static pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore.LOGIN_TYPE_LIBRUS; public class LoginLibrusFragment extends Fragment { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginMigrationFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginMigrationFragment.java index e5679f59..cd881665 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginMigrationFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginMigrationFragment.java @@ -18,20 +18,20 @@ import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.BuildConfig; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.databinding.FragmentLoginMigrationBinding; -import pl.szczodrzynski.edziennik.datamodels.Attendance; -import pl.szczodrzynski.edziennik.datamodels.Event; -import pl.szczodrzynski.edziennik.datamodels.EventType; -import pl.szczodrzynski.edziennik.datamodels.Grade; -import pl.szczodrzynski.edziennik.datamodels.Lesson; -import pl.szczodrzynski.edziennik.datamodels.LessonChange; -import pl.szczodrzynski.edziennik.datamodels.LoginStore; -import pl.szczodrzynski.edziennik.datamodels.LuckyNumber; -import pl.szczodrzynski.edziennik.datamodels.Metadata; -import pl.szczodrzynski.edziennik.datamodels.Notice; -import pl.szczodrzynski.edziennik.datamodels.Profile; -import pl.szczodrzynski.edziennik.datamodels.Subject; -import pl.szczodrzynski.edziennik.datamodels.Teacher; -import pl.szczodrzynski.edziennik.datamodels.Team; +import pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance; +import pl.szczodrzynski.edziennik.data.db.modules.events.Event; +import pl.szczodrzynski.edziennik.data.db.modules.events.EventType; +import pl.szczodrzynski.edziennik.data.db.modules.grades.Grade; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.Lesson; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonChange; +import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore; +import pl.szczodrzynski.edziennik.data.db.modules.luckynumber.LuckyNumber; +import pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata; +import pl.szczodrzynski.edziennik.data.db.modules.notices.Notice; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile; +import pl.szczodrzynski.edziennik.data.db.modules.subjects.Subject; +import pl.szczodrzynski.edziennik.data.db.modules.teachers.Teacher; +import pl.szczodrzynski.edziennik.data.db.modules.teams.Team; import pl.szczodrzynski.edziennik.utils.models.Date; import pl.szczodrzynski.edziennik.utils.models.Time; @@ -52,36 +52,36 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; -import static pl.szczodrzynski.edziennik.datamodels.Event.COLOR_CLASS_EVENT; -import static pl.szczodrzynski.edziennik.datamodels.Event.COLOR_DEFAULT; -import static pl.szczodrzynski.edziennik.datamodels.Event.COLOR_ESSAY; -import static pl.szczodrzynski.edziennik.datamodels.Event.COLOR_EXAM; -import static pl.szczodrzynski.edziennik.datamodels.Event.COLOR_EXCURSION; -import static pl.szczodrzynski.edziennik.datamodels.Event.COLOR_HOMEWORK; -import static pl.szczodrzynski.edziennik.datamodels.Event.COLOR_INFORMATION; -import static pl.szczodrzynski.edziennik.datamodels.Event.COLOR_PROJECT; -import static pl.szczodrzynski.edziennik.datamodels.Event.COLOR_PT_MEETING; -import static pl.szczodrzynski.edziennik.datamodels.Event.COLOR_READING; -import static pl.szczodrzynski.edziennik.datamodels.Event.COLOR_SHORT_QUIZ; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_CLASS_EVENT; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_DEFAULT; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_ESSAY; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_EXAM; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_EXCURSION; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_HOMEWORK; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_INFORMATION; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_PROJECT; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_PT_MEETING; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_READING; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_SHORT_QUIZ; -import static pl.szczodrzynski.edziennik.datamodels.LoginStore.LOGIN_TYPE_DEMO; -import static pl.szczodrzynski.edziennik.datamodels.LoginStore.LOGIN_TYPE_IUCZNIOWIE; -import static pl.szczodrzynski.edziennik.datamodels.LoginStore.LOGIN_TYPE_LIBRUS; -import static pl.szczodrzynski.edziennik.datamodels.LoginStore.LOGIN_TYPE_MOBIDZIENNIK; -import static pl.szczodrzynski.edziennik.datamodels.LoginStore.LOGIN_TYPE_VULCAN; -import static pl.szczodrzynski.edziennik.datamodels.Profile.REGISTRATION_DISABLED; -import static pl.szczodrzynski.edziennik.datamodels.Profile.REGISTRATION_ENABLED; -import static pl.szczodrzynski.edziennik.datamodels.Profile.REGISTRATION_UNSPECIFIED; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.COLOR_CLASS_EVENT; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.COLOR_DEFAULT; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.COLOR_ESSAY; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.COLOR_EXAM; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.COLOR_EXCURSION; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.COLOR_HOMEWORK; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.COLOR_INFORMATION; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.COLOR_PROJECT; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.COLOR_PT_MEETING; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.COLOR_READING; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.COLOR_SHORT_QUIZ; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_CLASS_EVENT; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_DEFAULT; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_ESSAY; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_EXAM; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_EXCURSION; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_HOMEWORK; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_INFORMATION; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_PROJECT; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_PT_MEETING; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_READING; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_SHORT_QUIZ; +import static pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore.LOGIN_TYPE_DEMO; +import static pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore.LOGIN_TYPE_IUCZNIOWIE; +import static pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore.LOGIN_TYPE_LIBRUS; +import static pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore.LOGIN_TYPE_MOBIDZIENNIK; +import static pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore.LOGIN_TYPE_VULCAN; +import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.REGISTRATION_DISABLED; +import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.REGISTRATION_ENABLED; +import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.REGISTRATION_UNSPECIFIED; public class LoginMigrationFragment extends Fragment { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginMigrationSyncFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginMigrationSyncFragment.java index fed6e16d..8adeebf2 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginMigrationSyncFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginMigrationSyncFragment.java @@ -20,12 +20,12 @@ import androidx.navigation.NavController; import androidx.navigation.Navigation; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.api.AppError; -import pl.szczodrzynski.edziennik.api.interfaces.SyncCallback; +import pl.szczodrzynski.edziennik.data.api.AppError; +import pl.szczodrzynski.edziennik.data.api.interfaces.SyncCallback; import pl.szczodrzynski.edziennik.databinding.FragmentLoginMigrationSyncBinding; -import pl.szczodrzynski.edziennik.datamodels.LoginStore; -import pl.szczodrzynski.edziennik.datamodels.Profile; -import pl.szczodrzynski.edziennik.datamodels.ProfileFull; +import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.ProfileFull; import pl.szczodrzynski.edziennik.sync.SyncJob; import pl.szczodrzynski.edziennik.sync.SyncService; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginMobidziennikFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginMobidziennikFragment.java index f5797ac7..0c4c5f33 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginMobidziennikFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginMobidziennikFragment.java @@ -16,14 +16,14 @@ import androidx.navigation.NavController; import androidx.navigation.Navigation; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.api.AppError; +import pl.szczodrzynski.edziennik.data.api.AppError; import pl.szczodrzynski.edziennik.databinding.FragmentLoginMobidziennikBinding; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_ARCHIVED; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_INVALID_LOGIN; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_INVALID_SERVER_ADDRESS; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_OLD_PASSWORD; -import static pl.szczodrzynski.edziennik.datamodels.LoginStore.LOGIN_TYPE_MOBIDZIENNIK; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_ARCHIVED; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_INVALID_LOGIN; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_INVALID_SERVER_ADDRESS; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_OLD_PASSWORD; +import static pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore.LOGIN_TYPE_MOBIDZIENNIK; public class LoginMobidziennikFragment extends Fragment { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginProfileObject.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginProfileObject.java index 88fb5d4c..9ee42950 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginProfileObject.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginProfileObject.java @@ -5,8 +5,8 @@ import java.util.ArrayList; import java.util.List; import androidx.annotation.NonNull; -import pl.szczodrzynski.edziennik.datamodels.LoginStore; -import pl.szczodrzynski.edziennik.datamodels.Profile; +import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile; public class LoginProfileObject { LoginStore loginStore = null; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginProgressFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginProgressFragment.java index 63a9aea9..93f00fa3 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginProgressFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginProgressFragment.java @@ -20,15 +20,15 @@ import androidx.navigation.NavController; import androidx.navigation.Navigation; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.api.Edziennik; -import pl.szczodrzynski.edziennik.api.AppError; -import pl.szczodrzynski.edziennik.api.interfaces.SyncCallback; +import pl.szczodrzynski.edziennik.data.api.Edziennik; +import pl.szczodrzynski.edziennik.data.api.AppError; +import pl.szczodrzynski.edziennik.data.api.interfaces.SyncCallback; import pl.szczodrzynski.edziennik.databinding.FragmentLoginProgressBinding; -import pl.szczodrzynski.edziennik.datamodels.LoginStore; -import pl.szczodrzynski.edziennik.datamodels.Profile; -import pl.szczodrzynski.edziennik.datamodels.ProfileFull; +import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.ProfileFull; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_OTHER; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_OTHER; public class LoginProgressFragment extends Fragment { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginSummaryFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginSummaryFragment.java index d1e5a57f..43efd3fe 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginSummaryFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginSummaryFragment.java @@ -26,7 +26,7 @@ import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.databinding.FragmentLoginSummaryBinding; import pl.szczodrzynski.edziennik.databinding.RowLoginProfileListItemBinding; -import pl.szczodrzynski.edziennik.datamodels.Profile; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile; public class LoginSummaryFragment extends Fragment { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginSyncFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginSyncFragment.java index 9c5ab3f9..3b8c436e 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginSyncFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginSyncFragment.java @@ -22,40 +22,40 @@ import androidx.navigation.NavController; import androidx.navigation.Navigation; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.api.AppError; -import pl.szczodrzynski.edziennik.api.interfaces.SyncCallback; +import pl.szczodrzynski.edziennik.data.api.AppError; +import pl.szczodrzynski.edziennik.data.api.interfaces.SyncCallback; import pl.szczodrzynski.edziennik.databinding.FragmentLoginSyncBinding; -import pl.szczodrzynski.edziennik.datamodels.EventType; -import pl.szczodrzynski.edziennik.datamodels.LoginStore; -import pl.szczodrzynski.edziennik.datamodels.Profile; -import pl.szczodrzynski.edziennik.datamodels.ProfileFull; +import pl.szczodrzynski.edziennik.data.db.modules.events.EventType; +import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.ProfileFull; import pl.szczodrzynski.edziennik.sync.SyncJob; import pl.szczodrzynski.edziennik.sync.SyncService; -import static pl.szczodrzynski.edziennik.datamodels.Event.COLOR_CLASS_EVENT; -import static pl.szczodrzynski.edziennik.datamodels.Event.COLOR_DEFAULT; -import static pl.szczodrzynski.edziennik.datamodels.Event.COLOR_EXAM; -import static pl.szczodrzynski.edziennik.datamodels.Event.COLOR_EXCURSION; -import static pl.szczodrzynski.edziennik.datamodels.Event.COLOR_HOMEWORK; -import static pl.szczodrzynski.edziennik.datamodels.Event.COLOR_INFORMATION; -import static pl.szczodrzynski.edziennik.datamodels.Event.COLOR_PROJECT; -import static pl.szczodrzynski.edziennik.datamodels.Event.COLOR_PT_MEETING; -import static pl.szczodrzynski.edziennik.datamodels.Event.COLOR_READING; -import static pl.szczodrzynski.edziennik.datamodels.Event.COLOR_SHORT_QUIZ; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_CLASS_EVENT; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_DEFAULT; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_ESSAY; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_EXAM; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_EXCURSION; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_HOMEWORK; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_INFORMATION; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_PROJECT; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_PT_MEETING; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_READING; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_SHORT_QUIZ; -import static pl.szczodrzynski.edziennik.datamodels.Profile.REGISTRATION_DISABLED; -import static pl.szczodrzynski.edziennik.datamodels.Profile.REGISTRATION_ENABLED; -import static pl.szczodrzynski.edziennik.datamodels.Profile.REGISTRATION_UNSPECIFIED; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.COLOR_CLASS_EVENT; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.COLOR_DEFAULT; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.COLOR_EXAM; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.COLOR_EXCURSION; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.COLOR_HOMEWORK; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.COLOR_INFORMATION; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.COLOR_PROJECT; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.COLOR_PT_MEETING; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.COLOR_READING; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.COLOR_SHORT_QUIZ; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_CLASS_EVENT; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_DEFAULT; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_ESSAY; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_EXAM; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_EXCURSION; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_HOMEWORK; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_INFORMATION; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_PROJECT; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_PT_MEETING; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_READING; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_SHORT_QUIZ; +import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.REGISTRATION_DISABLED; +import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.REGISTRATION_ENABLED; +import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.REGISTRATION_UNSPECIFIED; import static pl.szczodrzynski.edziennik.utils.Utils.d; public class LoginSyncFragment extends Fragment { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginVulcanFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginVulcanFragment.java index 2c6911c4..7b65eead 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginVulcanFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginVulcanFragment.java @@ -37,15 +37,15 @@ import javax.crypto.ShortBufferException; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.ui.modules.webpush.QrScannerActivity; -import pl.szczodrzynski.edziennik.api.AppError; +import pl.szczodrzynski.edziennik.data.api.AppError; import pl.szczodrzynski.edziennik.databinding.FragmentLoginVulcanBinding; import pl.szczodrzynski.edziennik.utils.Utils; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_EXPIRED_TOKEN; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_INVALID_PIN; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_INVALID_SYMBOL; -import static pl.szczodrzynski.edziennik.api.AppError.CODE_INVALID_TOKEN; -import static pl.szczodrzynski.edziennik.datamodels.LoginStore.LOGIN_TYPE_VULCAN; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_EXPIRED_TOKEN; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_INVALID_PIN; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_INVALID_SYMBOL; +import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_INVALID_TOKEN; +import static pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore.LOGIN_TYPE_VULCAN; public class LoginVulcanFragment extends Fragment { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesAdapter.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesAdapter.java index 7a1574bf..35b75308 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesAdapter.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesAdapter.java @@ -17,11 +17,11 @@ import androidx.recyclerview.widget.RecyclerView; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.databinding.MessagesItemBinding; -import pl.szczodrzynski.edziennik.datamodels.MessageFull; +import pl.szczodrzynski.edziennik.data.db.modules.messages.MessageFull; import pl.szczodrzynski.edziennik.utils.models.Date; -import static pl.szczodrzynski.edziennik.datamodels.Message.TYPE_DRAFT; -import static pl.szczodrzynski.edziennik.datamodels.Message.TYPE_SENT; +import static pl.szczodrzynski.edziennik.data.db.modules.messages.Message.TYPE_DRAFT; +import static pl.szczodrzynski.edziennik.data.db.modules.messages.Message.TYPE_SENT; public class MessagesAdapter extends RecyclerView.Adapter { private App app; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesComposeActivity.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesComposeActivity.java index c496039c..04a0b025 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesComposeActivity.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesComposeActivity.java @@ -35,14 +35,14 @@ import java.util.List; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.api.Edziennik; -import pl.szczodrzynski.edziennik.api.AppError; -import pl.szczodrzynski.edziennik.api.interfaces.SyncCallback; +import pl.szczodrzynski.edziennik.data.api.Edziennik; +import pl.szczodrzynski.edziennik.data.api.AppError; +import pl.szczodrzynski.edziennik.data.api.interfaces.SyncCallback; import pl.szczodrzynski.edziennik.databinding.MessagesComposeActivityBinding; -import pl.szczodrzynski.edziennik.datamodels.LoginStore; -import pl.szczodrzynski.edziennik.datamodels.Profile; -import pl.szczodrzynski.edziennik.datamodels.ProfileFull; -import pl.szczodrzynski.edziennik.datamodels.Teacher; +import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.ProfileFull; +import pl.szczodrzynski.edziennik.data.db.modules.teachers.Teacher; import pl.szczodrzynski.edziennik.utils.Colors; import pl.szczodrzynski.edziennik.utils.Themes; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesComposeSuggestionAdapter.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesComposeSuggestionAdapter.java index 525fa9e6..748e2c32 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesComposeSuggestionAdapter.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesComposeSuggestionAdapter.java @@ -19,7 +19,7 @@ import java.util.Comparator; import java.util.List; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.datamodels.Teacher; +import pl.szczodrzynski.edziennik.data.db.modules.teachers.Teacher; public class MessagesComposeSuggestionAdapter extends ArrayAdapter { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesDetailsFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesDetailsFragment.java index 654e424d..645b66d3 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesDetailsFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesDetailsFragment.java @@ -51,15 +51,15 @@ import im.wangchao.mhttp.callback.FileCallbackHandler; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.MainActivity; -import pl.szczodrzynski.edziennik.api.Edziennik; -import pl.szczodrzynski.edziennik.api.AppError; -import pl.szczodrzynski.edziennik.api.interfaces.SyncCallback; +import pl.szczodrzynski.edziennik.data.api.Edziennik; +import pl.szczodrzynski.edziennik.data.api.AppError; +import pl.szczodrzynski.edziennik.data.api.interfaces.SyncCallback; import pl.szczodrzynski.edziennik.databinding.MessagesDetailsBinding; -import pl.szczodrzynski.edziennik.datamodels.LoginStore; -import pl.szczodrzynski.edziennik.datamodels.MessageFull; -import pl.szczodrzynski.edziennik.datamodels.MessageRecipientFull; -import pl.szczodrzynski.edziennik.datamodels.Profile; -import pl.szczodrzynski.edziennik.datamodels.ProfileFull; +import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore; +import pl.szczodrzynski.edziennik.data.db.modules.messages.MessageFull; +import pl.szczodrzynski.edziennik.data.db.modules.messages.MessageRecipientFull; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.ProfileFull; import pl.szczodrzynski.edziennik.utils.models.Date; import pl.szczodrzynski.edziennik.utils.models.Time; import pl.szczodrzynski.edziennik.utils.Anim; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesFragment.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesFragment.kt index 3b130c0b..db7fae3b 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesFragment.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesFragment.kt @@ -12,7 +12,7 @@ import pl.szczodrzynski.edziennik.App import pl.szczodrzynski.edziennik.R import pl.szczodrzynski.edziennik.MainActivity import pl.szczodrzynski.edziennik.databinding.FragmentMessagesBinding -import pl.szczodrzynski.edziennik.datamodels.Message +import pl.szczodrzynski.edziennik.data.db.modules.messages.Message import pl.szczodrzynski.edziennik.utils.Themes import java.util.* diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesListFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesListFragment.java index d4216103..17e77c41 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesListFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesListFragment.java @@ -29,20 +29,20 @@ import java.util.List; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.MainActivity; -import pl.szczodrzynski.edziennik.api.AppError; -import pl.szczodrzynski.edziennik.api.Edziennik; -import pl.szczodrzynski.edziennik.api.interfaces.SyncCallback; +import pl.szczodrzynski.edziennik.data.api.AppError; +import pl.szczodrzynski.edziennik.data.api.Edziennik; +import pl.szczodrzynski.edziennik.data.api.interfaces.SyncCallback; import pl.szczodrzynski.edziennik.databinding.MessagesListBinding; -import pl.szczodrzynski.edziennik.datamodels.LoginStore; -import pl.szczodrzynski.edziennik.datamodels.Message; -import pl.szczodrzynski.edziennik.datamodels.MessageFull; -import pl.szczodrzynski.edziennik.datamodels.MessageRecipientFull; -import pl.szczodrzynski.edziennik.datamodels.Profile; -import pl.szczodrzynski.edziennik.datamodels.ProfileFull; +import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore; +import pl.szczodrzynski.edziennik.data.db.modules.messages.Message; +import pl.szczodrzynski.edziennik.data.db.modules.messages.MessageFull; +import pl.szczodrzynski.edziennik.data.db.modules.messages.MessageRecipientFull; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.ProfileFull; import pl.szczodrzynski.edziennik.utils.Themes; import static androidx.recyclerview.widget.RecyclerView.NO_POSITION; -import static pl.szczodrzynski.edziennik.datamodels.LoginStore.LOGIN_TYPE_LIBRUS; +import static pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore.LOGIN_TYPE_LIBRUS; import static pl.szczodrzynski.edziennik.utils.Utils.d; public class MessagesListFragment extends Fragment { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesUtils.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesUtils.java index 8c3d1c1e..91ed9a56 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesUtils.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesUtils.java @@ -8,15 +8,15 @@ import android.graphics.RectF; import androidx.core.graphics.ColorUtils; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.datamodels.MessageFull; -import pl.szczodrzynski.edziennik.datamodels.MessageRecipientFull; +import pl.szczodrzynski.edziennik.data.db.modules.messages.MessageFull; +import pl.szczodrzynski.edziennik.data.db.modules.messages.MessageRecipientFull; import pl.szczodrzynski.edziennik.utils.Colors; import pl.szczodrzynski.edziennik.utils.Utils; -import static pl.szczodrzynski.edziennik.datamodels.Message.TYPE_DELETED; -import static pl.szczodrzynski.edziennik.datamodels.Message.TYPE_DRAFT; -import static pl.szczodrzynski.edziennik.datamodels.Message.TYPE_RECEIVED; -import static pl.szczodrzynski.edziennik.datamodels.Message.TYPE_SENT; +import static pl.szczodrzynski.edziennik.data.db.modules.messages.Message.TYPE_DELETED; +import static pl.szczodrzynski.edziennik.data.db.modules.messages.Message.TYPE_DRAFT; +import static pl.szczodrzynski.edziennik.data.db.modules.messages.Message.TYPE_RECEIVED; +import static pl.szczodrzynski.edziennik.data.db.modules.messages.Message.TYPE_SENT; public class MessagesUtils { public static class MessageInfo { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notices/NoticesAdapter.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notices/NoticesAdapter.kt index 2d4daaa3..41efc20f 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notices/NoticesAdapter.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notices/NoticesAdapter.kt @@ -18,11 +18,11 @@ import com.mikepenz.iconics.utils.colorRes import com.mikepenz.iconics.utils.sizeDp import pl.szczodrzynski.edziennik.App import pl.szczodrzynski.edziennik.R -import pl.szczodrzynski.edziennik.datamodels.Notice -import pl.szczodrzynski.edziennik.datamodels.NoticeFull +import pl.szczodrzynski.edziennik.data.db.modules.notices.Notice +import pl.szczodrzynski.edziennik.data.db.modules.notices.NoticeFull import pl.szczodrzynski.edziennik.utils.models.Date -import pl.szczodrzynski.edziennik.datamodels.LoginStore.LOGIN_TYPE_MOBIDZIENNIK +import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore.LOGIN_TYPE_MOBIDZIENNIK import pl.szczodrzynski.edziennik.utils.Utils.bs class NoticesAdapter//getting the context and product list with constructor diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notices/RegisterNoticesFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notices/RegisterNoticesFragment.java index 02dbbd2f..72a97e67 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notices/RegisterNoticesFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notices/RegisterNoticesFragment.java @@ -26,12 +26,12 @@ import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.MainActivity; import pl.szczodrzynski.edziennik.databinding.FragmentRegisterNoticesBinding; -import pl.szczodrzynski.edziennik.datamodels.Notice; -import pl.szczodrzynski.edziennik.datamodels.NoticeFull; +import pl.szczodrzynski.edziennik.data.db.modules.notices.Notice; +import pl.szczodrzynski.edziennik.data.db.modules.notices.NoticeFull; import pl.szczodrzynski.edziennik.utils.Themes; import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetPrimaryItem; -import static pl.szczodrzynski.edziennik.datamodels.Metadata.TYPE_NOTICE; +import static pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.TYPE_NOTICE; public class RegisterNoticesFragment extends Fragment { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/SettingsNewFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/SettingsNewFragment.java index 9883f7ac..41105860 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/SettingsNewFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/SettingsNewFragment.java @@ -59,13 +59,13 @@ import pl.szczodrzynski.edziennik.utils.Utils; import static android.app.Activity.RESULT_OK; import static pl.szczodrzynski.edziennik.App.APP_URL; -import static pl.szczodrzynski.edziennik.datamodels.Profile.REGISTRATION_DISABLED; -import static pl.szczodrzynski.edziennik.datamodels.Profile.REGISTRATION_ENABLED; -import static pl.szczodrzynski.edziennik.datamodels.Profile.YEAR_1_AVG_2_AVG; -import static pl.szczodrzynski.edziennik.datamodels.Profile.YEAR_1_AVG_2_SEM; -import static pl.szczodrzynski.edziennik.datamodels.Profile.YEAR_1_SEM_2_AVG; -import static pl.szczodrzynski.edziennik.datamodels.Profile.YEAR_1_SEM_2_SEM; -import static pl.szczodrzynski.edziennik.datamodels.Profile.YEAR_ALL_GRADES; +import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.REGISTRATION_DISABLED; +import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.REGISTRATION_ENABLED; +import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.YEAR_1_AVG_2_AVG; +import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.YEAR_1_AVG_2_SEM; +import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.YEAR_1_SEM_2_AVG; +import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.YEAR_1_SEM_2_SEM; +import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.YEAR_ALL_GRADES; import static pl.szczodrzynski.edziennik.utils.Utils.d; import static pl.szczodrzynski.edziennik.utils.Utils.getRealPathFromURI; import static pl.szczodrzynski.edziennik.utils.Utils.getResizedBitmap; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/RegisterTimetableFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/RegisterTimetableFragment.java index 01efce47..524b9b6d 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/RegisterTimetableFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/RegisterTimetableFragment.java @@ -50,7 +50,7 @@ import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.MainActivity; import pl.szczodrzynski.edziennik.databinding.FragmentRegisterTimetableBinding; -import pl.szczodrzynski.edziennik.datamodels.LessonFull; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonFull; import pl.szczodrzynski.edziennik.ui.dialogs.event.EventManualDialog; import pl.szczodrzynski.edziennik.ui.modules.home.HomeFragment; import pl.szczodrzynski.edziennik.utils.models.Date; @@ -62,9 +62,9 @@ import pl.szczodrzynski.edziennik.utils.Utils; import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetPrimaryItem; import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetSeparatorItem; -import static pl.szczodrzynski.edziennik.datamodels.LessonChange.TYPE_CANCELLED; -import static pl.szczodrzynski.edziennik.datamodels.LessonChange.TYPE_CHANGE; -import static pl.szczodrzynski.edziennik.datamodels.Metadata.TYPE_LESSON_CHANGE; +import static pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonChange.TYPE_CANCELLED; +import static pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonChange.TYPE_CHANGE; +import static pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.TYPE_LESSON_CHANGE; import static pl.szczodrzynski.edziennik.utils.Utils.bs; import static pl.szczodrzynski.edziennik.utils.Utils.d; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/TimetableAdapter.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/TimetableAdapter.java index bb29cd46..def0b58f 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/TimetableAdapter.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/TimetableAdapter.java @@ -24,16 +24,16 @@ import java.util.List; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.datamodels.EventFull; -import pl.szczodrzynski.edziennik.datamodels.LessonChange; -import pl.szczodrzynski.edziennik.datamodels.LessonFull; +import pl.szczodrzynski.edziennik.data.db.modules.events.EventFull; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonChange; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonFull; import pl.szczodrzynski.edziennik.ui.dialogs.event.EventListDialog; import pl.szczodrzynski.edziennik.utils.models.Date; import pl.szczodrzynski.edziennik.utils.SpannableHtmlTagHandler; import pl.szczodrzynski.edziennik.utils.Themes; import pl.szczodrzynski.edziennik.utils.Utils; -import static pl.szczodrzynski.edziennik.datamodels.Event.TYPE_HOMEWORK; +import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_HOMEWORK; public class TimetableAdapter extends RecyclerView.Adapter { private static final String TAG = "TimetableAdapter"; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/webpush/WebPushConfigActivity.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/webpush/WebPushConfigActivity.java index 006551c2..dcb652dd 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/webpush/WebPushConfigActivity.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/webpush/WebPushConfigActivity.java @@ -43,7 +43,7 @@ import pl.szczodrzynski.edziennik.utils.Themes; import pl.szczodrzynski.edziennik.utils.Utils; import static pl.szczodrzynski.edziennik.App.APP_URL; -import static pl.szczodrzynski.edziennik.datamodels.Profile.REGISTRATION_ENABLED; +import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.REGISTRATION_ENABLED; public class WebPushConfigActivity extends AppCompatActivity implements ZXingScannerView.ResultHandler { private static final String TAG = "WebPushConfigActivity"; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/utils/Colors.java b/app/src/main/java/pl/szczodrzynski/edziennik/utils/Colors.java index f01da724..ce9cdbcf 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/utils/Colors.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/utils/Colors.java @@ -10,7 +10,7 @@ import android.graphics.drawable.StateListDrawable; import android.graphics.drawable.shapes.RoundRectShape; import android.os.Build; import androidx.core.graphics.ColorUtils; -import pl.szczodrzynski.edziennik.datamodels.Grade; +import pl.szczodrzynski.edziennik.data.db.modules.grades.Grade; import java.security.MessageDigest; import java.util.Arrays; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/AppConfig.java b/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/AppConfig.java index 473e8a9e..2aefccf0 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/AppConfig.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/AppConfig.java @@ -12,10 +12,10 @@ import pl.szczodrzynski.edziennik.BuildConfig; import pl.szczodrzynski.edziennik.MainActivity; import pl.szczodrzynski.edziennik.widgets.WidgetConfig; -import static pl.szczodrzynski.edziennik.datamodels.LoginStore.LOGIN_TYPE_IUCZNIOWIE; -import static pl.szczodrzynski.edziennik.datamodels.LoginStore.LOGIN_TYPE_LIBRUS; -import static pl.szczodrzynski.edziennik.datamodels.LoginStore.LOGIN_TYPE_MOBIDZIENNIK; -import static pl.szczodrzynski.edziennik.datamodels.LoginStore.LOGIN_TYPE_VULCAN; +import static pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore.LOGIN_TYPE_IUCZNIOWIE; +import static pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore.LOGIN_TYPE_LIBRUS; +import static pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore.LOGIN_TYPE_MOBIDZIENNIK; +import static pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore.LOGIN_TYPE_VULCAN; public class AppConfig { private static final String TAG = "AppConfig"; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/ItemGradesSubjectModel.java b/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/ItemGradesSubjectModel.java index abcf6f06..2d2bc614 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/ItemGradesSubjectModel.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/ItemGradesSubjectModel.java @@ -2,9 +2,9 @@ package pl.szczodrzynski.edziennik.utils.models; import java.util.List; -import pl.szczodrzynski.edziennik.datamodels.GradeFull; -import pl.szczodrzynski.edziennik.datamodels.Profile; -import pl.szczodrzynski.edziennik.datamodels.Subject; +import pl.szczodrzynski.edziennik.data.db.modules.grades.GradeFull; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile; +import pl.szczodrzynski.edziennik.data.db.modules.subjects.Subject; public class ItemGradesSubjectModel { public Profile profile; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/ItemTimetableModel.java b/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/ItemTimetableModel.java index 24197cbf..e9527793 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/ItemTimetableModel.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/ItemTimetableModel.java @@ -2,8 +2,8 @@ package pl.szczodrzynski.edziennik.utils.models; import java.util.List; -import pl.szczodrzynski.edziennik.datamodels.Event; -import pl.szczodrzynski.edziennik.datamodels.LessonFull; +import pl.szczodrzynski.edziennik.data.db.modules.events.Event; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonFull; public class ItemTimetableModel { public LessonFull lesson; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/widgets/WidgetConfigActivity.java b/app/src/main/java/pl/szczodrzynski/edziennik/widgets/WidgetConfigActivity.java index 5e466f19..4004109c 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/widgets/WidgetConfigActivity.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/widgets/WidgetConfigActivity.java @@ -22,7 +22,7 @@ import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.WidgetTimetable; import pl.szczodrzynski.edziennik.databinding.DialogWidgetConfigBinding; -import pl.szczodrzynski.edziennik.datamodels.Profile; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile; import pl.szczodrzynski.edziennik.widgets.luckynumber.WidgetLuckyNumber; import pl.szczodrzynski.edziennik.widgets.notifications.WidgetNotifications; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/widgets/luckynumber/WidgetLuckyNumber.java b/app/src/main/java/pl/szczodrzynski/edziennik/widgets/luckynumber/WidgetLuckyNumber.java index 02ea44a7..6ce5640c 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/widgets/luckynumber/WidgetLuckyNumber.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/widgets/luckynumber/WidgetLuckyNumber.java @@ -24,7 +24,7 @@ import java.lang.reflect.Method; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.MainActivity; -import pl.szczodrzynski.edziennik.datamodels.Profile; +import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile; import pl.szczodrzynski.edziennik.utils.models.Date; import pl.szczodrzynski.edziennik.sync.SyncJob; import pl.szczodrzynski.edziennik.widgets.WidgetConfig; diff --git a/app/src/main/res/layout/dialog_grade_details.xml b/app/src/main/res/layout/dialog_grade_details.xml index 691ca1ff..52d8a8d2 100644 --- a/app/src/main/res/layout/dialog_grade_details.xml +++ b/app/src/main/res/layout/dialog_grade_details.xml @@ -9,7 +9,7 @@ + type="pl.szczodrzynski.edziennik.data.db.modules.grades.GradeFull" /> From 7d136d9d77b87418153a16c5ffd5583fd8790875 Mon Sep 17 00:00:00 2001 From: Kacper Ziubryniewicz Date: Sat, 28 Sep 2019 15:56:07 +0200 Subject: [PATCH 3/3] [Structure] Change file names (remove Register before fragment names) --- .../szczodrzynski/edziennik/MainActivity.kt | 40 ++++----- .../edziennik/data/api/Edziennik.java | 10 +-- .../edziennik/data/api/Iuczniowie.java | 62 ++++++------- .../edziennik/data/api/Librus.java | 38 ++++---- .../edziennik/data/api/Mobidziennik.java | 82 +++++++++--------- .../edziennik/data/api/Vulcan.java | 26 +++--- .../api/interfaces/EdziennikInterface.java | 2 +- .../edziennik/data/api/v2/Constants.kt | 2 +- .../data/db/modules/metadata/MetadataDao.java | 4 +- .../data/db/modules/profiles/ProfileFull.kt | 16 ++-- ...gment.java => AgendaCalendarFragment.java} | 8 +- ...agment.java => AgendaDefaultFragment.java} | 15 ++-- ...agment.java => AnnouncementsFragment.java} | 17 ++-- ...cesAdapter.java => AttendanceAdapter.java} | 4 +- ...sFragment.java => AttendanceFragment.java} | 86 +++++++++---------- .../BehaviourFragment.java} | 22 ++--- .../{notices => behaviour}/NoticesAdapter.kt | 2 +- ...radesFragment.java => GradesFragment.java} | 12 +-- .../messages/MessagesComposeActivity.java | 8 +- ...Fragment.java => MessagesWebFragment.java} | 27 +++--- ...agment.java => NotificationsFragment.java} | 15 ++-- .../modules/settings/SettingsNewFragment.java | 10 +-- ...ragment.java => TimetableDayFragment.java} | 20 ++--- ...leFragment.java => TimetableFragment.java} | 45 +++++----- ...ivity.xml => activity_compose_message.xml} | 0 ...endar.xml => fragment_agenda_calendar.xml} | 0 ...efault.xml => fragment_agenda_default.xml} | 0 ...notices.xml => fragment_announcements.xml} | 0 ...ttendances.xml => fragment_attendance.xml} | 10 +-- ...ter_notices.xml => fragment_behaviour.xml} | 0 ...egister_grades.xml => fragment_grades.xml} | 0 ...ages_web.xml => fragment_messages_web.xml} | 0 ...cations.xml => fragment_notifications.xml} | 0 ...r_timetable.xml => fragment_timetable.xml} | 0 ...ble_day.xml => fragment_timetable_day.xml} | 0 app/src/main/res/values-en/strings.xml | 12 +-- app/src/main/res/values/strings.xml | 12 +-- 37 files changed, 303 insertions(+), 304 deletions(-) rename app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/{RegisterAgendaCalendarFragment.java => AgendaCalendarFragment.java} (95%) rename app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/{RegisterAgendaDefaultFragment.java => AgendaDefaultFragment.java} (97%) rename app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/announcements/{RegisterAnnouncementsFragment.java => AnnouncementsFragment.java} (95%) rename app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/{AttendancesAdapter.java => AttendanceAdapter.java} (97%) rename app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/{RegisterAttendancesFragment.java => AttendanceFragment.java} (87%) rename app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/{notices/RegisterNoticesFragment.java => behaviour/BehaviourFragment.java} (95%) rename app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/{notices => behaviour}/NoticesAdapter.kt (98%) rename app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/{RegisterGradesFragment.java => GradesFragment.java} (99%) rename app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/{RegisterMessagesWebFragment.java => MessagesWebFragment.java} (97%) rename app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notifications/{RegisterNotificationsFragment.java => NotificationsFragment.java} (90%) rename app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/{RegisterTimetableDayFragment.java => TimetableDayFragment.java} (93%) rename app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/{RegisterTimetableFragment.java => TimetableFragment.java} (98%) rename app/src/main/res/layout/{messages_compose_activity.xml => activity_compose_message.xml} (100%) rename app/src/main/res/layout/{fragment_register_agenda_calendar.xml => fragment_agenda_calendar.xml} (100%) rename app/src/main/res/layout/{fragment_register_agenda_default.xml => fragment_agenda_default.xml} (100%) rename app/src/main/res/layout/{fragment_register_school_notices.xml => fragment_announcements.xml} (100%) rename app/src/main/res/layout/{fragment_register_attendances.xml => fragment_attendance.xml} (97%) rename app/src/main/res/layout/{fragment_register_notices.xml => fragment_behaviour.xml} (100%) rename app/src/main/res/layout/{fragment_register_grades.xml => fragment_grades.xml} (100%) rename app/src/main/res/layout/{fragment_register_messages_web.xml => fragment_messages_web.xml} (100%) rename app/src/main/res/layout/{fragment_register_notifications.xml => fragment_notifications.xml} (100%) rename app/src/main/res/layout/{fragment_register_timetable.xml => fragment_timetable.xml} (100%) rename app/src/main/res/layout/{fragment_register_timetable_day.xml => fragment_timetable_day.xml} (100%) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt b/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt index 7e43c292..4995f873 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt @@ -56,20 +56,20 @@ import pl.szczodrzynski.edziennik.ui.modules.messages.MessagesFragment import pl.szczodrzynski.edziennik.utils.models.NavTarget import pl.szczodrzynski.edziennik.network.ServerRequest import pl.szczodrzynski.edziennik.sync.SyncJob -import pl.szczodrzynski.edziennik.ui.modules.agenda.RegisterAgendaDefaultFragment -import pl.szczodrzynski.edziennik.ui.modules.announcements.RegisterAnnouncementsFragment -import pl.szczodrzynski.edziennik.ui.modules.attendance.RegisterAttendancesFragment +import pl.szczodrzynski.edziennik.ui.modules.agenda.AgendaDefaultFragment +import pl.szczodrzynski.edziennik.ui.modules.announcements.AnnouncementsFragment +import pl.szczodrzynski.edziennik.ui.modules.attendance.AttendanceFragment import pl.szczodrzynski.edziennik.ui.modules.base.DebugFragment import pl.szczodrzynski.edziennik.ui.modules.base.FeedbackFragment import pl.szczodrzynski.edziennik.ui.modules.base.HelpFragment import pl.szczodrzynski.edziennik.ui.modules.grades.editor.GradesEditorFragment -import pl.szczodrzynski.edziennik.ui.modules.grades.RegisterGradesFragment +import pl.szczodrzynski.edziennik.ui.modules.grades.GradesFragment import pl.szczodrzynski.edziennik.ui.modules.home.HomeFragment -import pl.szczodrzynski.edziennik.ui.modules.notices.RegisterNoticesFragment -import pl.szczodrzynski.edziennik.ui.modules.notifications.RegisterNotificationsFragment +import pl.szczodrzynski.edziennik.ui.modules.behaviour.BehaviourFragment +import pl.szczodrzynski.edziennik.ui.modules.notifications.NotificationsFragment import pl.szczodrzynski.edziennik.ui.modules.settings.ProfileManagerFragment import pl.szczodrzynski.edziennik.ui.modules.settings.SettingsNewFragment -import pl.szczodrzynski.edziennik.ui.modules.timetable.RegisterTimetableFragment +import pl.szczodrzynski.edziennik.ui.modules.timetable.TimetableFragment import pl.szczodrzynski.edziennik.utils.SwipeRefreshLayoutNoTouch import pl.szczodrzynski.edziennik.utils.Utils import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetPrimaryItem @@ -98,8 +98,8 @@ class MainActivity : AppCompatActivity() { const val DRAWER_ITEM_GRADES = 13 const val DRAWER_ITEM_MESSAGES = 17 const val DRAWER_ITEM_HOMEWORK = 14 - const val DRAWER_ITEM_NOTICES = 15 - const val DRAWER_ITEM_ATTENDANCES = 16 + 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_SETTINGS = 101 @@ -123,17 +123,17 @@ class MainActivity : AppCompatActivity() { .isStatic(true) .withPopToHome(false) - list += NavTarget(DRAWER_ITEM_TIMETABLE, R.string.menu_timetable, RegisterTimetableFragment::class) + list += NavTarget(DRAWER_ITEM_TIMETABLE, R.string.menu_timetable, TimetableFragment::class) .withIcon(CommunityMaterial.Icon2.cmd_timetable) .withBadgeTypeId(TYPE_LESSON_CHANGE) .isInDrawer(true) - list += NavTarget(DRAWER_ITEM_AGENDA, R.string.menu_agenda, RegisterAgendaDefaultFragment::class) + list += NavTarget(DRAWER_ITEM_AGENDA, R.string.menu_agenda, AgendaDefaultFragment::class) .withIcon(CommunityMaterial.Icon.cmd_calendar) .withBadgeTypeId(TYPE_EVENT) .isInDrawer(true) - list += NavTarget(DRAWER_ITEM_GRADES, R.string.menu_grades, RegisterGradesFragment::class) + list += NavTarget(DRAWER_ITEM_GRADES, R.string.menu_grades, GradesFragment::class) .withIcon(CommunityMaterial.Icon2.cmd_numeric_5_box) .withBadgeTypeId(TYPE_GRADE) .isInDrawer(true) @@ -148,24 +148,24 @@ class MainActivity : AppCompatActivity() { .withBadgeTypeId(TYPE_HOMEWORK) .isInDrawer(true) - list += NavTarget(DRAWER_ITEM_NOTICES, R.string.menu_notices, RegisterNoticesFragment::class) + list += NavTarget(DRAWER_ITEM_BEHAVIOUR, R.string.menu_notices, BehaviourFragment::class) .withIcon(CommunityMaterial.Icon2.cmd_message_alert) .withBadgeTypeId(TYPE_NOTICE) .isInDrawer(true) - list += NavTarget(DRAWER_ITEM_ATTENDANCES, R.string.menu_attendances, RegisterAttendancesFragment::class) + list += NavTarget(DRAWER_ITEM_ATTENDANCE, R.string.menu_attendance, AttendanceFragment::class) .withIcon(CommunityMaterial.Icon.cmd_calendar_remove) .withBadgeTypeId(TYPE_ATTENDANCE) .isInDrawer(true) - list += NavTarget(DRAWER_ITEM_ANNOUNCEMENTS, R.string.menu_announcements, RegisterAnnouncementsFragment::class) + list += NavTarget(DRAWER_ITEM_ANNOUNCEMENTS, R.string.menu_announcements, AnnouncementsFragment::class) .withIcon(CommunityMaterial.Icon.cmd_bulletin_board) .withBadgeTypeId(TYPE_ANNOUNCEMENT) .isInDrawer(true) // static drawer items - list += NavTarget(DRAWER_ITEM_NOTIFICATIONS, R.string.menu_notifications, RegisterNotificationsFragment::class) + list += NavTarget(DRAWER_ITEM_NOTIFICATIONS, R.string.menu_notifications, NotificationsFragment::class) .withIcon(CommunityMaterial.Icon.cmd_bell_ring) .isInDrawer(true) .isStatic(true) @@ -537,8 +537,8 @@ class MainActivity : AppCompatActivity() { DRAWER_ITEM_AGENDA -> FEATURE_AGENDA DRAWER_ITEM_GRADES -> FEATURE_GRADES DRAWER_ITEM_HOMEWORK -> FEATURE_HOMEWORK - DRAWER_ITEM_NOTICES -> FEATURE_NOTICES - DRAWER_ITEM_ATTENDANCES -> FEATURE_ATTENDANCES + DRAWER_ITEM_BEHAVIOUR -> FEATURE_NOTICES + DRAWER_ITEM_ATTENDANCE -> FEATURE_ATTENDANCE DRAWER_ITEM_MESSAGES -> when (MessagesFragment.pageSelection) { 1 -> FEATURE_MESSAGES_OUTBOX else -> FEATURE_MESSAGES_INBOX @@ -553,8 +553,8 @@ class MainActivity : AppCompatActivity() { 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_NOTICES -> R.string.sync_feature_notices - DRAWER_ITEM_ATTENDANCES -> R.string.sync_feature_attendances + 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 else -> R.string.sync_feature_messages_inbox diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Edziennik.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Edziennik.java index 1e18057d..99ab1a4b 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Edziennik.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Edziennik.java @@ -84,7 +84,7 @@ import static pl.szczodrzynski.edziennik.data.api.AppError.stringErrorType; import static pl.szczodrzynski.edziennik.data.api.interfaces.EdziennikInterface.FEATURE_AGENDA; import static pl.szczodrzynski.edziennik.data.api.interfaces.EdziennikInterface.FEATURE_ALL; import static pl.szczodrzynski.edziennik.data.api.interfaces.EdziennikInterface.FEATURE_ANNOUNCEMENTS; -import static pl.szczodrzynski.edziennik.data.api.interfaces.EdziennikInterface.FEATURE_ATTENDANCES; +import static pl.szczodrzynski.edziennik.data.api.interfaces.EdziennikInterface.FEATURE_ATTENDANCE; import static pl.szczodrzynski.edziennik.data.api.interfaces.EdziennikInterface.FEATURE_GRADES; import static pl.szczodrzynski.edziennik.data.api.interfaces.EdziennikInterface.FEATURE_HOMEWORK; import static pl.szczodrzynski.edziennik.data.api.interfaces.EdziennikInterface.FEATURE_MESSAGES_INBOX; @@ -354,7 +354,7 @@ public class Edziennik { app.notifier.add(new Notification(app.getContext(), text) .withProfileData(profile.getId(), profile.getName()) .withType(Notification.TYPE_NEW_NOTICE) - .withFragmentRedirect(MainActivity.DRAWER_ITEM_NOTICES) + .withFragmentRedirect(MainActivity.DRAWER_ITEM_BEHAVIOUR) .withLongExtra("noticeId", notice.id) .withAddedDate(notice.addedDate) ); @@ -382,7 +382,7 @@ public class Edziennik { app.notifier.add(new Notification(app.getContext(), text) .withProfileData(profile.getId(), profile.getName()) .withType(Notification.TYPE_NEW_ATTENDANCE) - .withFragmentRedirect(MainActivity.DRAWER_ITEM_ATTENDANCES) + .withFragmentRedirect(MainActivity.DRAWER_ITEM_ATTENDANCE) .withLongExtra("attendanceId", attendance.id) .withAddedDate(attendance.addedDate) ); @@ -849,7 +849,7 @@ public class Edziennik { app.getString(R.string.menu_grades), app.getString(R.string.menu_homework), app.getString(R.string.menu_notices), - app.getString(R.string.menu_attendances), + app.getString(R.string.menu_attendance), app.getString(R.string.title_messages_inbox_single), app.getString(R.string.title_messages_sent_single), app.getString(R.string.menu_announcements) @@ -860,7 +860,7 @@ public class Edziennik { FEATURE_GRADES, FEATURE_HOMEWORK, FEATURE_NOTICES, - FEATURE_ATTENDANCES, + FEATURE_ATTENDANCE, FEATURE_MESSAGES_INBOX, FEATURE_MESSAGES_OUTBOX, FEATURE_ANNOUNCEMENTS diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Iuczniowie.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Iuczniowie.java index 83b8a8e9..33c69671 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Iuczniowie.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Iuczniowie.java @@ -200,7 +200,7 @@ public class Iuczniowie implements EdziennikInterface { targetEndpoints.add("Exams"); targetEndpoints.add("Notices"); targetEndpoints.add("Announcements"); - targetEndpoints.add("Attendances"); + targetEndpoints.add("Attendance"); targetEndpoints.add("MessagesInbox"); targetEndpoints.add("MessagesOutbox"); targetEndpoints.add("Finish"); @@ -241,8 +241,8 @@ public class Iuczniowie implements EdziennikInterface { case FEATURE_NOTICES: targetEndpoints.add("Notices"); break; - case FEATURE_ATTENDANCES: - targetEndpoints.add("Attendances"); + case FEATURE_ATTENDANCE: + targetEndpoints.add("Attendance"); break; case FEATURE_MESSAGES_INBOX: targetEndpoints.add("MessagesInbox"); @@ -300,9 +300,9 @@ public class Iuczniowie implements EdziennikInterface { } } - this.attendancesMonth = today.month; - this.attendancesYear = today.year; - this.attendancesPrevMonthChecked = false; + this.attendanceMonth = today.month; + this.attendanceYear = today.year; + this.attendancePrevMonthChecked = false; this.examsMonth = today.month; this.examsYear = today.year; this.examsMonthsChecked = 0; @@ -352,8 +352,8 @@ public class Iuczniowie implements EdziennikInterface { case "Announcements": getAnnouncements(); break; - case "Attendances": - getAttendances(); + case "Attendance": + getAttendance(); break; case "MessagesInbox": getMessagesInbox(); @@ -1196,17 +1196,17 @@ public class Iuczniowie implements EdziennikInterface { }); } - private int attendancesYear; - private int attendancesMonth; - private boolean attendancesPrevMonthChecked = false; - private void getAttendances() { - callback.onActionStarted(R.string.sync_action_syncing_attendances); + private int attendanceYear; + private int attendanceMonth; + private boolean attendancePrevMonthChecked = false; + private void getAttendance() { + callback.onActionStarted(R.string.sync_action_syncing_attendance); apiRequest(Request.builder() .url(IDZIENNIK_URL +"/mod_panelRodzica/obecnosci/WS_obecnosciUcznia.asmx/pobierzObecnosciUcznia") .userAgent(userAgent) .addParameter("idPozDziennika", loginRegisterId) - .addParameter("mc", attendancesMonth) - .addParameter("rok", attendancesYear) + .addParameter("mc", attendanceMonth) + .addParameter("rok", attendanceYear) .addParameter("dataTygodnia", "") .postJson(), (result, response) -> { JsonObject data = result.getAsJsonObject("d"); @@ -1281,25 +1281,25 @@ public class Iuczniowie implements EdziennikInterface { } } - int attendancesDateValue = attendancesYear*10000 + attendancesMonth*100; - if (profile.getEmpty() && attendancesDateValue > profile.getSemesterStart(1).getValue()) { - attendancesPrevMonthChecked = true; // do not need to check prev month later - attendancesMonth--; - if (attendancesMonth < 1) { - attendancesMonth = 12; - attendancesYear--; + int attendanceDateValue = attendanceYear *10000 + attendanceMonth *100; + if (profile.getEmpty() && attendanceDateValue > profile.getSemesterStart(1).getValue()) { + attendancePrevMonthChecked = true; // do not need to check prev month later + attendanceMonth--; + if (attendanceMonth < 1) { + attendanceMonth = 12; + attendanceYear--; } - r("get", "Attendances"); - } else if (!attendancesPrevMonthChecked /* get also the previous month */) { - attendancesMonth--; - if (attendancesMonth < 1) { - attendancesMonth = 12; - attendancesYear--; + r("get", "Attendance"); + } else if (!attendancePrevMonthChecked /* get also the previous month */) { + attendanceMonth--; + if (attendanceMonth < 1) { + attendanceMonth = 12; + attendanceYear--; } - attendancesPrevMonthChecked = true; - r("get", "Attendances"); + attendancePrevMonthChecked = true; + r("get", "Attendance"); } else { - r("finish", "Attendances"); + r("finish", "Attendance"); } }); } diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Librus.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Librus.java index 83bda4b6..aa7f635f 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Librus.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Librus.java @@ -297,8 +297,8 @@ public class Librus implements EdziennikInterface { targetEndpoints.add("Homework"); targetEndpoints.add("LuckyNumbers"); targetEndpoints.add("Notices"); - targetEndpoints.add("AttendancesTypes"); - targetEndpoints.add("Attendances"); + targetEndpoints.add("AttendanceTypes"); + targetEndpoints.add("Attendance"); targetEndpoints.add("Announcements"); targetEndpoints.add("PtMeetings"); @@ -371,9 +371,9 @@ public class Librus implements EdziennikInterface { case FEATURE_NOTICES: targetEndpoints.add("Notices"); break; - case FEATURE_ATTENDANCES: - targetEndpoints.add("AttendancesTypes"); - targetEndpoints.add("Attendances"); + case FEATURE_ATTENDANCE: + targetEndpoints.add("AttendanceTypes"); + targetEndpoints.add("Attendance"); break; case FEATURE_MESSAGES_INBOX: if (!hasMessagesLogin) { @@ -527,11 +527,11 @@ public class Librus implements EdziennikInterface { case "Notices": getNotices(); break; - case "AttendancesTypes": - getAttendancesTypes(); + case "AttendanceTypes": + getAttendanceTypes(); break; - case "Attendances": - getAttendances(); + case "Attendance": + getAttendance(); break; case "Announcements": getAnnouncements(); @@ -2888,11 +2888,11 @@ public class Librus implements EdziennikInterface { } private SparseArray> attendanceTypes = new SparseArray<>(); - private void getAttendancesTypes() { + private void getAttendanceTypes() { callback.onActionStarted(R.string.sync_action_syncing_attendance_types); apiRequest("Attendances/Types", data -> { if (data == null) { - r("finish", "AttendancesTypes"); + r("finish", "AttendanceTypes"); return; } try { @@ -2907,7 +2907,7 @@ public class Librus implements EdziennikInterface { ) ); } - r("finish", "AttendancesTypes"); + r("finish", "AttendanceTypes"); } catch (Exception e) { finishWithError(new AppError(TAG, 2782, CODE_OTHER, e, data)); @@ -2915,18 +2915,18 @@ public class Librus implements EdziennikInterface { }); } - private void getAttendances() { - callback.onActionStarted(R.string.sync_action_syncing_attendances); + private void getAttendance() { + callback.onActionStarted(R.string.sync_action_syncing_attendance); apiRequest("Attendances"+(fullSync ? "" : "?dateFrom="+ Date.getToday().stepForward(0, -1, 0).getStringY_m_d()), data -> { if (data == null) { - r("finish", "Attendances"); + r("finish", "Attendance"); return; } try { - JsonArray jAttendances = data.get("Attendances").getAsJsonArray(); + JsonArray jAttendance = data.get("Attendances").getAsJsonArray(); - for (JsonElement attendanceEl : jAttendances) { + for (JsonElement attendanceEl : jAttendance) { JsonObject attendance = attendanceEl.getAsJsonObject(); int type = attendance.getAsJsonObject("Type").get("Id").getAsInt(); @@ -2992,7 +2992,7 @@ public class Librus implements EdziennikInterface { metadataList.add(new Metadata(profileId, Metadata.TYPE_ATTENDANCE, attendanceObject.id, profile.getEmpty(), profile.getEmpty(), addedDate)); } } - r("finish", "Attendances"); + r("finish", "Attendance"); } catch (Exception e) { finishWithError(new AppError(TAG, 2872, CODE_OTHER, e, data)); @@ -3380,7 +3380,7 @@ public class Librus implements EdziennikInterface { configurableEndpoints.put("Homework", new Endpoint("Homework",true, false, profile.getChangedEndpoints())); configurableEndpoints.put("LuckyNumbers", new Endpoint("LuckyNumbers",true, false, profile.getChangedEndpoints())); configurableEndpoints.put("Notices", new Endpoint("Notices",true, false, profile.getChangedEndpoints())); - configurableEndpoints.put("Attendances", new Endpoint("Attendances",true, false, profile.getChangedEndpoints())); + configurableEndpoints.put("Attendance", new Endpoint("Attendance",true, false, profile.getChangedEndpoints())); configurableEndpoints.put("Announcements", new Endpoint("Announcements",true, true, profile.getChangedEndpoints())); configurableEndpoints.put("PtMeetings", new Endpoint("PtMeetings",true, true, profile.getChangedEndpoints())); configurableEndpoints.put("TeacherFreeDays", new Endpoint("TeacherFreeDays",false, false, profile.getChangedEndpoints())); diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Mobidziennik.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Mobidziennik.java index c8c6b52e..4a3d191f 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Mobidziennik.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Mobidziennik.java @@ -150,7 +150,7 @@ public class Mobidziennik implements EdziennikInterface { private String loginPassword = null; private int studentId = -1; - private long attendancesLastSync = 0; + private long attendanceLastSync = 0; private boolean prepare(@NonNull Context activityContext, @NonNull SyncCallback callback, int profileId, @Nullable Profile profile, @NonNull LoginStore loginStore) { this.activityContext = activityContext; @@ -171,7 +171,7 @@ public class Mobidziennik implements EdziennikInterface { return false; } this.studentId = profile == null ? -1 : profile.getStudentData("studentId", -1); - this.attendancesLastSync = profile == null ? 0 : profile.getStudentData("attendancesLastSync", (long)0); + this.attendanceLastSync = profile == null ? 0 : profile.getStudentData("attendanceLastSync", (long)0); fakeLogin = BuildConfig.DEBUG && loginUsername.toLowerCase().startsWith("fake"); teamList = profileId == -1 ? new ArrayList<>() : app.db.teamDao().getAllNow(profileId); @@ -204,7 +204,7 @@ public class Mobidziennik implements EdziennikInterface { targetEndpoints = new ArrayList<>(); targetEndpoints.add("GetData"); targetEndpoints.add("ProcessData"); - targetEndpoints.add("Attendances"); + targetEndpoints.add("Attendance"); targetEndpoints.add("ClassCalendar"); targetEndpoints.add("GradeDetails"); targetEndpoints.add("NoticeDetails"); @@ -256,8 +256,8 @@ public class Mobidziennik implements EdziennikInterface { case FEATURE_NOTICES: targetEndpoints.add("NoticeDetails"); break; - case FEATURE_ATTENDANCES: - targetEndpoints.add("Attendances"); + case FEATURE_ATTENDANCE: + targetEndpoints.add("Attendance"); break; case FEATURE_MESSAGES_INBOX: targetEndpoints.add("MessagesInbox"); @@ -314,8 +314,8 @@ public class Mobidziennik implements EdziennikInterface { case "NoticeDetails": getNoticeDetails(); break; - case "Attendances": - getAttendances(); + case "Attendance": + getAttendance(); break; case "Messages": getAllMessages(); @@ -597,7 +597,7 @@ public class Mobidziennik implements EdziennikInterface { processLessons(table); } if (i == 16) { - processAttendances(table); + processAttendance(table); } if (i == 17) { processNotices(table); @@ -1051,20 +1051,20 @@ public class Mobidziennik implements EdziennikInterface { this.lessonId = lessonId; } } - private Date attendancesCheckDate = Week.getWeekStart(); - private void getAttendances() { - r("finish", "Attendances"); - // TODO: 2019-09-10 please download attendances from /dziennik/frekwencja. /mobile does not work above v13.0 + private Date attendanceCheckDate = Week.getWeekStart(); + private void getAttendance() { + r("finish", "Attendance"); + // TODO: 2019-09-10 please download attendance from /dziennik/frekwencja. /mobile does not work above v13.0 if (true) { return; } - callback.onActionStarted(R.string.sync_action_syncing_attendances); - d(TAG, "Get attendances for week "+attendancesCheckDate.getStringY_m_d()); + callback.onActionStarted(R.string.sync_action_syncing_attendance); + d(TAG, "Get attendance for week "+ attendanceCheckDate.getStringY_m_d()); Request.builder() .url(fakeLogin ? "https://szkolny.eu/mobimobi/mobi_mod_frekwencja.php" : "https://" + loginServerName + ".mobidziennik.pl/mobile/frekwencja") .userAgent(System.getProperty("http.agent")) .addParameter("uczen", studentId) - .addParameter("data_poniedzialek", attendancesCheckDate.getStringY_m_d()) + .addParameter("data_poniedzialek", attendanceCheckDate.getStringY_m_d()) .post() .callback(new TextCallbackHandler() { @Override @@ -1076,11 +1076,11 @@ public class Mobidziennik implements EdziennikInterface { public void onSuccess(String data, Response response) { // just skip any failures here if (data == null || data.equals("")) { - r("finish", "Attendances"); + r("finish", "Attendance"); return; } if (data.contains("nie-pamietam-hasla")) { - r("finish", "Attendances"); + r("finish", "Attendance"); return; } @@ -1135,7 +1135,7 @@ public class Mobidziennik implements EdziennikInterface { continue; AttendanceLessonRange range = ranges.get(currentIndex); - Date date = attendancesCheckDate.clone().stepForward(0, 0, range.weekDay); + Date date = attendanceCheckDate.clone().stepForward(0, 0, range.weekDay); long addedDate = date.combineWith(range.startTime); int markerIndex = 0; @@ -1201,7 +1201,7 @@ public class Mobidziennik implements EdziennikInterface { markerIndex++; attendanceList.add(attendanceObject); if (attendanceObject.type != TYPE_PRESENT) { - boolean markAsRead = onlyFeature == FEATURE_ATTENDANCES && attendancesLastSync == 0; + boolean markAsRead = onlyFeature == FEATURE_ATTENDANCE && attendanceLastSync == 0; metadataList.add(new Metadata(profileId, Metadata.TYPE_ATTENDANCE, attendanceObject.id, profile.getEmpty() || markAsRead, profile.getEmpty() || markAsRead, addedDate)); } } @@ -1209,40 +1209,40 @@ public class Mobidziennik implements EdziennikInterface { } catch (Exception e) { Crashlytics.logException(e); e.printStackTrace(); - if (onlyFeature == FEATURE_ATTENDANCES) + if (onlyFeature == FEATURE_ATTENDANCE) finishWithError(new AppError(TAG, 955, CODE_OTHER, response, e, data)); else - r("finish", "Attendances"); + r("finish", "Attendance"); return; } - if (onlyFeature == FEATURE_ATTENDANCES) { - // syncing attendances exclusively - if (attendancesLastSync == 0) { - // first sync - get attendances until it's start of the school year - attendancesLastSync = profile.getSemesterStart(1).getInMillis(); + if (onlyFeature == FEATURE_ATTENDANCE) { + // syncing attendance exclusively + if (attendanceLastSync == 0) { + // first sync - get attendance until it's start of the school year + attendanceLastSync = profile.getSemesterStart(1).getInMillis(); } - Date lastSyncDate = Date.fromMillis(attendancesLastSync); + Date lastSyncDate = Date.fromMillis(attendanceLastSync); lastSyncDate.stepForward(0, 0, -7); - if (lastSyncDate.getValue() < attendancesCheckDate.getValue()) { - attendancesCheckDate.stepForward(0, 0, -7); - r("get", "Attendances"); + if (lastSyncDate.getValue() < attendanceCheckDate.getValue()) { + attendanceCheckDate.stepForward(0, 0, -7); + r("get", "Attendance"); } else { - profile.putStudentData("attendancesLastSync", System.currentTimeMillis()); - r("finish", "Attendances"); + profile.putStudentData("attendanceLastSync", System.currentTimeMillis()); + r("finish", "Attendance"); } } else { - if (attendancesLastSync != 0) { + if (attendanceLastSync != 0) { // not a first sync - Date lastSyncDate = Date.fromMillis(attendancesLastSync); + Date lastSyncDate = Date.fromMillis(attendanceLastSync); lastSyncDate.stepForward(0, 0, 2); - if (lastSyncDate.getValue() >= attendancesCheckDate.getValue()) { - profile.putStudentData("attendancesLastSync", System.currentTimeMillis()); + if (lastSyncDate.getValue() >= attendanceCheckDate.getValue()) { + profile.putStudentData("attendanceLastSync", System.currentTimeMillis()); } } - r("finish", "Attendances"); + r("finish", "Attendance"); } } }) @@ -1675,12 +1675,12 @@ public class Mobidziennik implements EdziennikInterface { } } - private void processAttendances(String table) + private void processAttendance(String table) { if (true) return; - String[] attendances = table.split("\n"); - for (String attendanceStr: attendances) + String[] attendanceList = table.split("\n"); + for (String attendanceStr: attendanceList) { if (attendanceStr.isEmpty()) { continue; @@ -1718,7 +1718,7 @@ public class Mobidziennik implements EdziennikInterface { mobiLesson.date, mobiLesson.startTime, type); - attendanceList.add(attendanceObject); + this.attendanceList.add(attendanceObject); metadataList.add(new Metadata(profileId, Metadata.TYPE_ATTENDANCE, attendanceObject.id, profile.getEmpty(), profile.getEmpty(), System.currentTimeMillis())); } } diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Vulcan.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Vulcan.java index d1095dcb..355f974c 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Vulcan.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Vulcan.java @@ -110,7 +110,7 @@ public class Vulcan implements EdziennikInterface { private static final String ENDPOINT_EVENTS = "mobile-api/Uczen.v3.Uczen/Sprawdziany"; private static final String ENDPOINT_HOMEWORK = "mobile-api/Uczen.v3.Uczen/ZadaniaDomowe"; private static final String ENDPOINT_NOTICES = "mobile-api/Uczen.v3.Uczen/UwagiUcznia"; - private static final String ENDPOINT_ATTENDANCES = "mobile-api/Uczen.v3.Uczen/Frekwencje"; + private static final String ENDPOINT_ATTENDANCE = "mobile-api/Uczen.v3.Uczen/Frekwencje"; private static final String ENDPOINT_MESSAGES_RECEIVED = "mobile-api/Uczen.v3.Uczen/WiadomosciOdebrane"; private static final String ENDPOINT_MESSAGES_SENT = "mobile-api/Uczen.v3.Uczen/WiadomosciWyslane"; private static final String ENDPOINT_MESSAGES_CHANGE_STATUS = "mobile-api/Uczen.v3.Uczen/ZmienStatusWiadomosci"; @@ -261,7 +261,7 @@ public class Vulcan implements EdziennikInterface { targetEndpoints.add("Events"); targetEndpoints.add("Homework"); targetEndpoints.add("Notices"); - targetEndpoints.add("Attendances"); + targetEndpoints.add("Attendance"); targetEndpoints.add("MessagesInbox"); targetEndpoints.add("MessagesOutbox"); targetEndpoints.add("Finish"); @@ -303,8 +303,8 @@ public class Vulcan implements EdziennikInterface { case FEATURE_NOTICES: targetEndpoints.add("Notices"); break; - case FEATURE_ATTENDANCES: - targetEndpoints.add("Attendances"); + case FEATURE_ATTENDANCE: + targetEndpoints.add("Attendance"); break; case FEATURE_MESSAGES_INBOX: targetEndpoints.add("MessagesInbox"); @@ -386,8 +386,8 @@ public class Vulcan implements EdziennikInterface { case "Notices": getNotices(); break; - case "Attendances": - getAttendances(); + case "Attendance": + getAttendance(); break; case "MessagesInbox": getMessagesInbox(); @@ -1459,18 +1459,18 @@ public class Vulcan implements EdziennikInterface { }); } - private void getAttendances() { - callback.onActionStarted(R.string.sync_action_syncing_attendances); + private void getAttendance() { + callback.onActionStarted(R.string.sync_action_syncing_attendance); JsonObject json = new JsonObject(); json.addProperty("DataPoczatkowa", true ? getCurrentSemesterStartDate().getStringY_m_d() : oneMonthBack.getStringY_m_d()); json.addProperty("DataKoncowa", getCurrentSemesterEndDate().getStringY_m_d()); json.addProperty("IdOddzial", studentClassId); json.addProperty("IdUczen", studentId); json.addProperty("IdOkresKlasyfikacyjny", studentSemesterId); - apiRequest(schoolSymbol+"/"+ENDPOINT_ATTENDANCES, json, result -> { - JsonArray attendances = result.getAsJsonObject("Data").getAsJsonArray("Frekwencje"); + apiRequest(schoolSymbol+"/"+ ENDPOINT_ATTENDANCE, json, result -> { + JsonArray attendanceList = result.getAsJsonObject("Data").getAsJsonArray("Frekwencje"); - for (JsonElement attendanceEl: attendances) { + for (JsonElement attendanceEl: attendanceList) { JsonObject attendance = attendanceEl.getAsJsonObject(); Pair attendanceCategory = attendanceCategories.get(attendance.get("IdKategoria").getAsInt()); @@ -1497,12 +1497,12 @@ public class Vulcan implements EdziennikInterface { lessonRanges.get(attendance.get("IdPoraLekcji").getAsInt()).first, type); - attendanceList.add(attendanceObject); + this.attendanceList.add(attendanceObject); if (attendanceObject.type != TYPE_PRESENT) { metadataList.add(new Metadata(profileId, Metadata.TYPE_ATTENDANCE, attendanceObject.id, profile.getEmpty(), profile.getEmpty(), attendanceObject.lessonDate.combineWith(attendanceObject.startTime))); } } - r("finish", "Attendances"); + r("finish", "Attendance"); }); } diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/EdziennikInterface.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/EdziennikInterface.java index 5b2af1b8..962b1bef 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/EdziennikInterface.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/interfaces/EdziennikInterface.java @@ -36,7 +36,7 @@ public interface EdziennikInterface { int FEATURE_GRADES = 3; int FEATURE_HOMEWORK = 4; int FEATURE_NOTICES = 5; - int FEATURE_ATTENDANCES = 6; + int FEATURE_ATTENDANCE = 6; int FEATURE_MESSAGES_INBOX = 7; int FEATURE_MESSAGES_OUTBOX = 8; int FEATURE_ANNOUNCEMENTS = 9; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/Constants.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/Constants.kt index 59165f11..84efcebc 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/Constants.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/v2/Constants.kt @@ -6,7 +6,7 @@ const val FEATURE_AGENDA = 2 const val FEATURE_GRADES = 3 const val FEATURE_HOMEWORK = 4 const val FEATURE_NOTICES = 5 -const val FEATURE_ATTENDANCES = 6 +const val FEATURE_ATTENDANCE = 6 const val FEATURE_MESSAGES_INBOX = 7 const val FEATURE_MESSAGES_OUTBOX = 8 const val FEATURE_ANNOUNCEMENTS = 9 diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/metadata/MetadataDao.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/metadata/MetadataDao.java index 95733185..e7f3a410 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/metadata/MetadataDao.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/metadata/MetadataDao.java @@ -204,7 +204,7 @@ public abstract class MetadataDao { public abstract void deleteUnusedNotices(int profileId); @Query("DELETE FROM metadata WHERE profileId = :profileId AND thingType = "+TYPE_ATTENDANCE+" AND thingId NOT IN (SELECT attendanceId FROM attendances WHERE profileId = :profileId);") - public abstract void deleteUnusedAttendances(int profileId); + public abstract void deleteUnusedAttendance(int profileId); @Query("DELETE FROM metadata WHERE profileId = :profileId AND thingType = "+TYPE_EVENT+" AND thingId NOT IN (SELECT eventId FROM events WHERE profileId = :profileId AND eventType != -1);") public abstract void deleteUnusedEvents(int profileId); @@ -225,7 +225,7 @@ public abstract class MetadataDao { public void deleteUnused(int profileId) { deleteUnusedGrades(profileId); deleteUnusedNotices(profileId); - deleteUnusedAttendances(profileId); + deleteUnusedAttendance(profileId); deleteUnusedEvents(profileId); deleteUnusedHomework(profileId); deleteUnusedLessonChanges(profileId); diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/profiles/ProfileFull.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/profiles/ProfileFull.kt index f692bcf5..ae41a733 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/profiles/ProfileFull.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/profiles/ProfileFull.kt @@ -5,11 +5,11 @@ import androidx.room.ColumnInfo import com.google.gson.JsonObject import pl.szczodrzynski.edziennik.MainActivity.Companion.DRAWER_ITEM_AGENDA import pl.szczodrzynski.edziennik.MainActivity.Companion.DRAWER_ITEM_ANNOUNCEMENTS -import pl.szczodrzynski.edziennik.MainActivity.Companion.DRAWER_ITEM_ATTENDANCES +import pl.szczodrzynski.edziennik.MainActivity.Companion.DRAWER_ITEM_ATTENDANCE import pl.szczodrzynski.edziennik.MainActivity.Companion.DRAWER_ITEM_GRADES import pl.szczodrzynski.edziennik.MainActivity.Companion.DRAWER_ITEM_HOMEWORK import pl.szczodrzynski.edziennik.MainActivity.Companion.DRAWER_ITEM_MESSAGES -import pl.szczodrzynski.edziennik.MainActivity.Companion.DRAWER_ITEM_NOTICES +import pl.szczodrzynski.edziennik.MainActivity.Companion.DRAWER_ITEM_BEHAVIOUR import pl.szczodrzynski.edziennik.MainActivity.Companion.DRAWER_ITEM_TIMETABLE import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore.* @@ -52,8 +52,8 @@ class ProfileFull : Profile { fragmentIds.add(DRAWER_ITEM_GRADES) fragmentIds.add(DRAWER_ITEM_MESSAGES) fragmentIds.add(DRAWER_ITEM_HOMEWORK) - fragmentIds.add(DRAWER_ITEM_NOTICES) - fragmentIds.add(DRAWER_ITEM_ATTENDANCES) + fragmentIds.add(DRAWER_ITEM_BEHAVIOUR) + fragmentIds.add(DRAWER_ITEM_ATTENDANCE) return fragmentIds } LOGIN_TYPE_LIBRUS -> { @@ -63,8 +63,8 @@ class ProfileFull : Profile { fragmentIds.add(DRAWER_ITEM_GRADES) fragmentIds.add(DRAWER_ITEM_MESSAGES) fragmentIds.add(DRAWER_ITEM_HOMEWORK) - fragmentIds.add(DRAWER_ITEM_NOTICES) - fragmentIds.add(DRAWER_ITEM_ATTENDANCES) + fragmentIds.add(DRAWER_ITEM_BEHAVIOUR) + fragmentIds.add(DRAWER_ITEM_ATTENDANCE) fragmentIds.add(DRAWER_ITEM_ANNOUNCEMENTS) return fragmentIds } @@ -74,8 +74,8 @@ class ProfileFull : Profile { fragmentIds.add(DRAWER_ITEM_AGENDA) fragmentIds.add(DRAWER_ITEM_GRADES) fragmentIds.add(DRAWER_ITEM_MESSAGES) - fragmentIds.add(DRAWER_ITEM_NOTICES) - fragmentIds.add(DRAWER_ITEM_ATTENDANCES) + fragmentIds.add(DRAWER_ITEM_BEHAVIOUR) + fragmentIds.add(DRAWER_ITEM_ATTENDANCE) fragmentIds.add(DRAWER_ITEM_ANNOUNCEMENTS) return fragmentIds } diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/RegisterAgendaCalendarFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/AgendaCalendarFragment.java similarity index 95% rename from app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/RegisterAgendaCalendarFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/AgendaCalendarFragment.java index 0ac063fc..ffd58d51 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/RegisterAgendaCalendarFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/AgendaCalendarFragment.java @@ -27,7 +27,7 @@ import java.util.List; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.databinding.FragmentRegisterAgendaCalendarBinding; +import pl.szczodrzynski.edziennik.databinding.FragmentAgendaCalendarBinding; import pl.szczodrzynski.edziennik.data.db.modules.events.EventFull; import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonFull; import pl.szczodrzynski.edziennik.ui.dialogs.event.EventListDialog; @@ -36,11 +36,11 @@ import pl.szczodrzynski.edziennik.utils.Themes; import static pl.szczodrzynski.edziennik.utils.Utils.intToStr; -public class RegisterAgendaCalendarFragment extends Fragment { +public class AgendaCalendarFragment extends Fragment { private App app = null; private Activity activity = null; - private FragmentRegisterAgendaCalendarBinding b = null; + private FragmentAgendaCalendarBinding b = null; @Override public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { @@ -52,7 +52,7 @@ public class RegisterAgendaCalendarFragment extends Fragment { if (app.profile == null) return inflater.inflate(R.layout.fragment_loading, container, false); // activity, context and profile is valid - b = DataBindingUtil.inflate(inflater, R.layout.fragment_register_agenda_calendar, container, false); + b = DataBindingUtil.inflate(inflater, R.layout.fragment_agenda_calendar, container, false); return b.getRoot(); } diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/RegisterAgendaDefaultFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/AgendaDefaultFragment.java similarity index 97% rename from app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/RegisterAgendaDefaultFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/AgendaDefaultFragment.java index c3dbd0c6..ec5f847b 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/RegisterAgendaDefaultFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/AgendaDefaultFragment.java @@ -36,8 +36,8 @@ import java.util.Locale; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.MainActivity; -import pl.szczodrzynski.edziennik.databinding.FragmentRegisterAgendaCalendarBinding; -import pl.szczodrzynski.edziennik.databinding.FragmentRegisterAgendaDefaultBinding; +import pl.szczodrzynski.edziennik.databinding.FragmentAgendaCalendarBinding; +import pl.szczodrzynski.edziennik.databinding.FragmentAgendaDefaultBinding; import pl.szczodrzynski.edziennik.data.db.modules.events.EventFull; import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonFull; import pl.szczodrzynski.edziennik.ui.dialogs.event.EventListDialog; @@ -55,15 +55,14 @@ import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetSeparatorItem; import static pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.TYPE_EVENT; import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.AGENDA_CALENDAR; import static pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile.AGENDA_DEFAULT; -import static pl.szczodrzynski.edziennik.utils.Utils.bs; import static pl.szczodrzynski.edziennik.utils.Utils.intToStr; -public class RegisterAgendaDefaultFragment extends Fragment { +public class AgendaDefaultFragment extends Fragment { private App app = null; private MainActivity activity = null; - private FragmentRegisterAgendaDefaultBinding b_default = null; - private FragmentRegisterAgendaCalendarBinding b_calendar = null; + private FragmentAgendaDefaultBinding b_default = null; + private FragmentAgendaCalendarBinding b_calendar = null; private int viewType = AGENDA_DEFAULT; @Override @@ -78,11 +77,11 @@ public class RegisterAgendaDefaultFragment extends Fragment { // activity, context and profile is valid viewType = app.profile.getAgendaViewType(); if (viewType == AGENDA_DEFAULT) { - b_default = DataBindingUtil.inflate(inflater, R.layout.fragment_register_agenda_default, container, false); + b_default = DataBindingUtil.inflate(inflater, R.layout.fragment_agenda_default, container, false); return b_default.getRoot(); } else { - b_calendar = DataBindingUtil.inflate(inflater, R.layout.fragment_register_agenda_calendar, container, false); + b_calendar = DataBindingUtil.inflate(inflater, R.layout.fragment_agenda_calendar, container, false); return b_calendar.getRoot(); } } diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/announcements/RegisterAnnouncementsFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/announcements/AnnouncementsFragment.java similarity index 95% rename from app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/announcements/RegisterAnnouncementsFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/announcements/AnnouncementsFragment.java index 8e70a958..c539486a 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/announcements/RegisterAnnouncementsFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/announcements/AnnouncementsFragment.java @@ -7,30 +7,31 @@ import android.view.View; import android.view.ViewGroup; import android.widget.Toast; -import com.afollestad.materialdialogs.MaterialDialog; -import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial; - import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.databinding.DataBindingUtil; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; + +import com.afollestad.materialdialogs.MaterialDialog; +import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial; + import pl.szczodrzynski.edziennik.App; -import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.MainActivity; +import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.databinding.DialogAnnouncementBinding; -import pl.szczodrzynski.edziennik.databinding.FragmentRegisterSchoolNoticesBinding; +import pl.szczodrzynski.edziennik.databinding.FragmentAnnouncementsBinding; import pl.szczodrzynski.edziennik.utils.Themes; import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetPrimaryItem; import static pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.TYPE_ANNOUNCEMENT; -public class RegisterAnnouncementsFragment extends Fragment { +public class AnnouncementsFragment extends Fragment { private App app = null; private MainActivity activity = null; - private FragmentRegisterSchoolNoticesBinding b = null; + private FragmentAnnouncementsBinding b = null; @Override public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { @@ -42,7 +43,7 @@ public class RegisterAnnouncementsFragment extends Fragment { if (app.profile == null) return inflater.inflate(R.layout.fragment_loading, container, false); // activity, context and profile is valid - b = DataBindingUtil.inflate(inflater, R.layout.fragment_register_school_notices, container, false); + b = DataBindingUtil.inflate(inflater, R.layout.fragment_announcements, container, false); b.refreshLayout.setParent(activity.getSwipeRefreshLayout()); return b.getRoot(); } diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/AttendancesAdapter.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/AttendanceAdapter.java similarity index 97% rename from app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/AttendancesAdapter.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/AttendanceAdapter.java index a8b71528..e1e53f5a 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/AttendancesAdapter.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/AttendanceAdapter.java @@ -24,12 +24,12 @@ import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.T import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_PRESENT; import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_RELEASED; -public class AttendancesAdapter extends RecyclerView.Adapter { +public class AttendanceAdapter extends RecyclerView.Adapter { private Context context; public List attendanceList; //getting the context and product list with constructor - public AttendancesAdapter(Context mCtx, List noticeList) { + public AttendanceAdapter(Context mCtx, List noticeList) { this.context = mCtx; this.attendanceList = noticeList; } diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/RegisterAttendancesFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/AttendanceFragment.java similarity index 87% rename from app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/RegisterAttendancesFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/AttendanceFragment.java index e5f8b43a..d28aadf9 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/RegisterAttendancesFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/AttendanceFragment.java @@ -1,18 +1,8 @@ package pl.szczodrzynski.edziennik.ui.modules.attendance; -import androidx.appcompat.widget.PopupMenu; -import androidx.databinding.DataBindingUtil; - import android.graphics.Color; import android.os.AsyncTask; import android.os.Bundle; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.fragment.app.Fragment; -import androidx.core.graphics.ColorUtils; -import androidx.recyclerview.widget.LinearLayoutManager; - import android.os.Handler; import android.util.LongSparseArray; import android.view.Gravity; @@ -24,6 +14,14 @@ import android.view.animation.Animation; import android.view.animation.Transformation; import android.widget.Toast; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.widget.PopupMenu; +import androidx.core.graphics.ColorUtils; +import androidx.databinding.DataBindingUtil; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.LinearLayoutManager; + import com.danimahardhika.cafebar.CafeBar; import com.mikepenz.iconics.IconicsColor; import com.mikepenz.iconics.IconicsDrawable; @@ -37,14 +35,14 @@ import java.util.Locale; import antonkozyriatskyi.circularprogressindicator.CircularProgressIndicator; import pl.szczodrzynski.edziennik.App; -import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.MainActivity; -import pl.szczodrzynski.edziennik.databinding.FragmentRegisterAttendancesBinding; +import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.data.db.modules.attendance.AttendanceFull; import pl.szczodrzynski.edziennik.data.db.modules.subjects.Subject; +import pl.szczodrzynski.edziennik.databinding.FragmentAttendanceBinding; +import pl.szczodrzynski.edziennik.utils.Themes; import pl.szczodrzynski.edziennik.utils.models.Date; import pl.szczodrzynski.edziennik.utils.models.Week; -import pl.szczodrzynski.edziennik.utils.Themes; import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetPrimaryItem; import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_ABSENT; @@ -57,11 +55,11 @@ import static pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore.LOGIN_ import static pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore.LOGIN_TYPE_VULCAN; import static pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.TYPE_ATTENDANCE; -public class RegisterAttendancesFragment extends Fragment { +public class AttendanceFragment extends Fragment { private App app = null; private MainActivity activity = null; - private FragmentRegisterAttendancesBinding b = null; + private FragmentAttendanceBinding b = null; private int displayMode = MODE_YEAR; private static final int MODE_YEAR = 0; @@ -84,7 +82,7 @@ public class RegisterAttendancesFragment extends Fragment { if (app.profile == null) return inflater.inflate(R.layout.fragment_loading, container, false); // activity, context and profile is valid - b = DataBindingUtil.inflate(inflater, R.layout.fragment_register_attendances, container, false); + b = DataBindingUtil.inflate(inflater, R.layout.fragment_attendance, container, false); b.refreshLayout.setParent(activity.getSwipeRefreshLayout()); return b.getRoot(); } @@ -106,14 +104,14 @@ public class RegisterAttendancesFragment extends Fragment { ); /*b.refreshLayout.setOnRefreshListener(() -> { - activity.syncCurrentFeature(MainActivity.DRAWER_ITEM_ATTENDANCES, b.refreshLayout); + activity.syncCurrentFeature(MainActivity.DRAWER_ITEM_ATTENDANCE, b.refreshLayout); });*/ b.attendancePercentage.setProgressTextAdapter(PERCENTAGE_ADAPTER); b.attendancePercentage.setMaxProgress(100.0f); - b.attendancesSummaryTitle.setOnClickListener((v -> { - PopupMenu popupMenu = new PopupMenu(activity, b.attendancesSummaryTitle, Gravity.END); + b.attendanceSummaryTitle.setOnClickListener((v -> { + PopupMenu popupMenu = new PopupMenu(activity, b.attendanceSummaryTitle, Gravity.END); popupMenu.getMenu().add(0, 0, 0, R.string.summary_mode_year); popupMenu.getMenu().add(0, 1, 1, R.string.summary_mode_semester_1); popupMenu.getMenu().add(0, 2, 2, R.string.summary_mode_semester_2); @@ -126,11 +124,11 @@ public class RegisterAttendancesFragment extends Fragment { })); if (app.profile.getLoginStoreType() == LOGIN_TYPE_MOBIDZIENNIK) { - long attendancesLastSync = app.profile.getStudentData("attendancesLastSync", (long)0); - if (attendancesLastSync == 0) { - attendancesLastSync = app.profile.getSemesterStart(1).getInMillis(); + long attendanceLastSync = app.profile.getStudentData("attendanceLastSync", (long)0); + if (attendanceLastSync == 0) { + attendanceLastSync = app.profile.getSemesterStart(1).getInMillis(); } - Date lastSyncDate = Date.fromMillis(attendancesLastSync); + Date lastSyncDate = Date.fromMillis(attendanceLastSync); if (lastSyncDate.getValue() < Week.getWeekStart().getValue()) { CafeBar.builder(activity) .to(activity.getNavView().getCoordinator()) @@ -158,13 +156,13 @@ public class RegisterAttendancesFragment extends Fragment { } if (app.profile.getLoginStoreType() == LOGIN_TYPE_MOBIDZIENNIK && false) { - b.attendancesSummarySubject.setVisibility(View.GONE); + b.attendanceSummarySubject.setVisibility(View.GONE); } else { - b.attendancesSummarySubject.setOnClickListener((v -> { + b.attendanceSummarySubject.setOnClickListener((v -> { AsyncTask.execute(() -> { List subjectList = app.db.subjectDao().getAllNow(App.profileId); - PopupMenu popupMenu = new PopupMenu(activity, b.attendancesSummarySubject, Gravity.END); + PopupMenu popupMenu = new PopupMenu(activity, b.attendanceSummarySubject, Gravity.END); popupMenu.getMenu().add(0, -1, 0, R.string.subject_filter_disabled); int index = 0; DecimalFormat format = new DecimalFormat("0.00"); @@ -180,7 +178,7 @@ public class RegisterAttendancesFragment extends Fragment { } popupMenu.setOnMenuItemClickListener((item -> { subjectIdFilter = item.getItemId(); - b.attendancesSummarySubject.setText(item.getTitle().toString().replaceAll("\\s-\\s[0-9]{1,2}\\.[0-9]{1,2}%", "")); + b.attendanceSummarySubject.setText(item.getTitle().toString().replaceAll("\\s-\\s[0-9]{1,2}\\.[0-9]{1,2}%", "")); updateList(); return true; })); @@ -192,20 +190,20 @@ public class RegisterAttendancesFragment extends Fragment { LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext()); - b.attendancesView.setHasFixedSize(true); - b.attendancesView.setLayoutManager(linearLayoutManager); + b.attendanceView.setHasFixedSize(true); + b.attendanceView.setLayoutManager(linearLayoutManager); - app.db.attendanceDao().getAll(App.profileId).observe(this, attendances -> { + app.db.attendanceDao().getAll(App.profileId).observe(this, attendance -> { if (app == null || app.profile == null || activity == null || b == null || !isAdded()) return; - if (attendances == null) { - b.attendancesView.setVisibility(View.GONE); - b.attendancesNoData.setVisibility(View.VISIBLE); + if (attendance == null) { + b.attendanceView.setVisibility(View.GONE); + b.attendanceNoData.setVisibility(View.VISIBLE); return; } - attendanceList = attendances; + attendanceList = attendance; countSubjectStats(); @@ -274,29 +272,29 @@ public class RegisterAttendancesFragment extends Fragment { } } if (filteredList.size() > 0) { - AttendancesAdapter adapter; - b.attendancesView.setVisibility(View.VISIBLE); - b.attendancesNoData.setVisibility(View.GONE); - if ((adapter = (AttendancesAdapter) b.attendancesView.getAdapter()) != null) { + AttendanceAdapter adapter; + b.attendanceView.setVisibility(View.VISIBLE); + b.attendanceNoData.setVisibility(View.GONE); + if ((adapter = (AttendanceAdapter) b.attendanceView.getAdapter()) != null) { adapter.attendanceList = filteredList; adapter.notifyDataSetChanged(); } else { - adapter = new AttendancesAdapter(getContext(), filteredList); - b.attendancesView.setAdapter(adapter); + adapter = new AttendanceAdapter(getContext(), filteredList); + b.attendanceView.setAdapter(adapter); } } else { - b.attendancesView.setVisibility(View.GONE); - b.attendancesNoData.setVisibility(View.VISIBLE); + b.attendanceView.setVisibility(View.GONE); + b.attendanceNoData.setVisibility(View.VISIBLE); } // SUMMARY if (displayMode == MODE_YEAR) { - b.attendancesSummaryTitle.setText(getString(R.string.attendances_summary_title_year)); + b.attendanceSummaryTitle.setText(getString(R.string.attendance_summary_title_year)); } else { - b.attendancesSummaryTitle.setText(getString(R.string.attendances_summary_title_semester_format, displayMode)); + b.attendanceSummaryTitle.setText(getString(R.string.attendance_summary_title_semester_format, displayMode)); } b.presentCountContainer.setVisibility(presentCount == 0 ? View.GONE : View.VISIBLE); b.presentCount.setText(String.format(Locale.getDefault(), "%d", presentCount)); diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notices/RegisterNoticesFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/behaviour/BehaviourFragment.java similarity index 95% rename from app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notices/RegisterNoticesFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/behaviour/BehaviourFragment.java index 72a97e67..29f46afe 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notices/RegisterNoticesFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/behaviour/BehaviourFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.ui.modules.notices; +package pl.szczodrzynski.edziennik.ui.modules.behaviour; import android.graphics.Color; import android.os.AsyncTask; @@ -9,10 +9,6 @@ import android.view.View; import android.view.ViewGroup; import android.widget.Toast; -import java.util.ArrayList; -import java.util.List; -import java.util.Locale; - import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.widget.PopupMenu; @@ -22,22 +18,26 @@ import androidx.recyclerview.widget.LinearLayoutManager; import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial; +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; + import pl.szczodrzynski.edziennik.App; -import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.MainActivity; -import pl.szczodrzynski.edziennik.databinding.FragmentRegisterNoticesBinding; +import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.data.db.modules.notices.Notice; import pl.szczodrzynski.edziennik.data.db.modules.notices.NoticeFull; +import pl.szczodrzynski.edziennik.databinding.FragmentBehaviourBinding; import pl.szczodrzynski.edziennik.utils.Themes; import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetPrimaryItem; import static pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.TYPE_NOTICE; -public class RegisterNoticesFragment extends Fragment { +public class BehaviourFragment extends Fragment { private App app = null; private MainActivity activity = null; - private FragmentRegisterNoticesBinding b = null; + private FragmentBehaviourBinding b = null; private int displayMode = MODE_YEAR; private static final int MODE_YEAR = 0; @@ -56,7 +56,7 @@ public class RegisterNoticesFragment extends Fragment { if (app.profile == null) return inflater.inflate(R.layout.fragment_loading, container, false); // activity, context and profile is valid - b = DataBindingUtil.inflate(inflater, R.layout.fragment_register_notices, container, false); + b = DataBindingUtil.inflate(inflater, R.layout.fragment_behaviour, container, false); b.refreshLayout.setParent(activity.getSwipeRefreshLayout()); return b.getRoot(); } @@ -78,7 +78,7 @@ public class RegisterNoticesFragment extends Fragment { ); /*b.refreshLayout.setOnRefreshListener(() -> { - activity.syncCurrentFeature(MainActivity.DRAWER_ITEM_NOTICES, b.refreshLayout); + activity.syncCurrentFeature(MainActivity.DRAWER_ITEM_BEHAVIOUR, b.refreshLayout); });*/ b.noticesSummaryTitle.setOnClickListener((v -> { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notices/NoticesAdapter.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/behaviour/NoticesAdapter.kt similarity index 98% rename from app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notices/NoticesAdapter.kt rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/behaviour/NoticesAdapter.kt index 41efc20f..c9693842 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notices/NoticesAdapter.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/behaviour/NoticesAdapter.kt @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.ui.modules.notices +package pl.szczodrzynski.edziennik.ui.modules.behaviour import android.content.Context import android.graphics.PorterDuff diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/RegisterGradesFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/GradesFragment.java similarity index 99% rename from app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/RegisterGradesFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/GradesFragment.java index dddd897b..1a6b99dc 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/RegisterGradesFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/GradesFragment.java @@ -21,14 +21,14 @@ import java.util.ArrayList; import java.util.List; import pl.szczodrzynski.edziennik.App; -import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.MainActivity; -import pl.szczodrzynski.edziennik.databinding.FragmentRegisterGradesBinding; +import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.data.db.modules.grades.Grade; import pl.szczodrzynski.edziennik.data.db.modules.grades.GradeFull; import pl.szczodrzynski.edziennik.data.db.modules.subjects.Subject; -import pl.szczodrzynski.edziennik.utils.models.ItemGradesSubjectModel; +import pl.szczodrzynski.edziennik.databinding.FragmentGradesBinding; import pl.szczodrzynski.edziennik.utils.Themes; +import pl.szczodrzynski.edziennik.utils.models.ItemGradesSubjectModel; import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetPrimaryItem; import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetSeparatorItem; @@ -42,11 +42,11 @@ import static pl.szczodrzynski.edziennik.utils.models.AppConfig.ORDER_BY_DATE_AS import static pl.szczodrzynski.edziennik.utils.models.AppConfig.ORDER_BY_DATE_DESC; import static pl.szczodrzynski.edziennik.utils.models.AppConfig.ORDER_BY_SUBJECT_ASC; -public class RegisterGradesFragment extends Fragment { +public class GradesFragment extends Fragment { private App app = null; private MainActivity activity = null; - private FragmentRegisterGradesBinding b = null; + private FragmentGradesBinding b = null; @Override public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { @@ -58,7 +58,7 @@ public class RegisterGradesFragment extends Fragment { if (app.profile == null) return inflater.inflate(R.layout.fragment_loading, container, false); // activity, context and profile is valid - b = DataBindingUtil.inflate(inflater, R.layout.fragment_register_grades, container, false); + b = DataBindingUtil.inflate(inflater, R.layout.fragment_grades, container, false); b.refreshLayout.setParent(activity.getSwipeRefreshLayout()); b.refreshLayout.setNestedScrollingEnabled(true); return b.getRoot(); diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesComposeActivity.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesComposeActivity.java index 04a0b025..ff22e48e 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesComposeActivity.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesComposeActivity.java @@ -35,14 +35,14 @@ import java.util.List; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.data.api.Edziennik; import pl.szczodrzynski.edziennik.data.api.AppError; +import pl.szczodrzynski.edziennik.data.api.Edziennik; import pl.szczodrzynski.edziennik.data.api.interfaces.SyncCallback; -import pl.szczodrzynski.edziennik.databinding.MessagesComposeActivityBinding; import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore; import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile; import pl.szczodrzynski.edziennik.data.db.modules.profiles.ProfileFull; import pl.szczodrzynski.edziennik.data.db.modules.teachers.Teacher; +import pl.szczodrzynski.edziennik.databinding.ActivityComposeMessageBinding; import pl.szczodrzynski.edziennik.utils.Colors; import pl.szczodrzynski.edziennik.utils.Themes; @@ -50,7 +50,7 @@ public class MessagesComposeActivity extends AppCompatActivity { private static final String TAG = "MessageCompose"; private App app; - private MessagesComposeActivityBinding b; + private ActivityComposeMessageBinding b; private List teachers = new ArrayList<>(); private ActionBar actionBar; private MessagesComposeInfo composeInfo; @@ -60,7 +60,7 @@ public class MessagesComposeActivity extends AppCompatActivity { super.onCreate(savedInstanceState); app = (App)getApplication(); setTheme(Themes.INSTANCE.getAppTheme()); - b = DataBindingUtil.inflate(getLayoutInflater(), R.layout.messages_compose_activity, null, false); + b = DataBindingUtil.inflate(getLayoutInflater(), R.layout.activity_compose_message, null, false); setContentView(b.getRoot()); composeInfo = Edziennik.getApi(app, app.profile.getLoginStoreType()).getComposeInfo(app.profile); diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/RegisterMessagesWebFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesWebFragment.java similarity index 97% rename from app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/RegisterMessagesWebFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesWebFragment.java index aeda8455..343f4076 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/RegisterMessagesWebFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesWebFragment.java @@ -17,12 +17,6 @@ import android.os.Bundle; import android.os.Environment; import android.os.Handler; import android.provider.MediaStore; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.core.app.ActivityCompat; -import androidx.databinding.DataBindingUtil; -import androidx.fragment.app.Fragment; -import androidx.core.content.FileProvider; import android.util.Log; import android.view.LayoutInflater; import android.view.View; @@ -39,6 +33,13 @@ import android.widget.ProgressBar; import android.widget.TextView; import android.widget.Toast; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.core.app.ActivityCompat; +import androidx.core.content.FileProvider; +import androidx.databinding.DataBindingUtil; +import androidx.fragment.app.Fragment; + import com.afollestad.materialdialogs.MaterialDialog; import com.afollestad.materialdialogs.StackingBehavior; @@ -51,7 +52,7 @@ import java.util.Date; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.databinding.FragmentRegisterMessagesWebBinding; +import pl.szczodrzynski.edziennik.databinding.FragmentMessagesWebBinding; import pl.szczodrzynski.edziennik.utils.Anim; import pl.szczodrzynski.edziennik.utils.Themes; @@ -59,12 +60,12 @@ import static android.app.Activity.RESULT_OK; import static android.content.Context.DOWNLOAD_SERVICE; import static pl.szczodrzynski.edziennik.utils.Utils.readableFileSize; -public class RegisterMessagesWebFragment extends Fragment { +public class MessagesWebFragment extends Fragment { private static final String TAG = "RegisterMessagesWeb"; private App app = null; private Activity activity = null; - private FragmentRegisterMessagesWebBinding b = null; + private FragmentMessagesWebBinding b = null; private WebView webView; private ProgressBar progressBar; @@ -80,7 +81,7 @@ public class RegisterMessagesWebFragment extends Fragment { if (app.profile == null) return inflater.inflate(R.layout.fragment_loading, container, false); // activity, context and profile is valid - b = DataBindingUtil.inflate(inflater, R.layout.fragment_register_messages_web, container, false); + b = DataBindingUtil.inflate(inflater, R.layout.fragment_messages_web, container, false); return b.getRoot(); } @@ -350,7 +351,7 @@ public class RegisterMessagesWebFragment extends Fragment { @Override public void onPageStarted(WebView view, String url, Bitmap favicon) { super.onPageStarted(view, url, favicon); - RegisterMessagesWebFragment.this.error.setVisibility(View.GONE); + MessagesWebFragment.this.error.setVisibility(View.GONE); loadingFinished = false; //SHOW LOADING IF IT ISNT ALREADY VISIBLE if (progressBar.getVisibility() != View.VISIBLE) @@ -385,8 +386,8 @@ public class RegisterMessagesWebFragment extends Fragment { if (app == null || app.profile == null || activity == null || b == null || !isAdded()) return; - RegisterMessagesWebFragment.this.error.setVisibility(View.VISIBLE); - RegisterMessagesWebFragment.this.error.setText(getString(R.string.error_occured_format, error.toString())); + MessagesWebFragment.this.error.setVisibility(View.VISIBLE); + MessagesWebFragment.this.error.setText(getString(R.string.error_occured_format, error.toString())); super.onReceivedError(view, request, error); } }); diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notifications/RegisterNotificationsFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notifications/NotificationsFragment.java similarity index 90% rename from app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notifications/RegisterNotificationsFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notifications/NotificationsFragment.java index 44c7e8d0..0ed54999 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notifications/RegisterNotificationsFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notifications/NotificationsFragment.java @@ -2,26 +2,27 @@ package pl.szczodrzynski.edziennik.ui.modules.notifications; import android.app.Activity; import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.databinding.DataBindingUtil; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.databinding.FragmentRegisterNotificationsBinding; +import pl.szczodrzynski.edziennik.databinding.FragmentNotificationsBinding; import pl.szczodrzynski.edziennik.utils.Themes; -public class RegisterNotificationsFragment extends Fragment { +public class NotificationsFragment extends Fragment { private App app = null; private Activity activity = null; - private FragmentRegisterNotificationsBinding b = null; + private FragmentNotificationsBinding b = null; @Override public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { @@ -33,7 +34,7 @@ public class RegisterNotificationsFragment extends Fragment { if (app.profile == null) return inflater.inflate(R.layout.fragment_loading, container, false); // activity, context and profile is valid - b = DataBindingUtil.inflate(inflater, R.layout.fragment_register_notifications, container, false); + b = DataBindingUtil.inflate(inflater, R.layout.fragment_notifications, container, false); return b.getRoot(); } diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/SettingsNewFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/SettingsNewFragment.java index 41105860..34726682 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/SettingsNewFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/SettingsNewFragment.java @@ -351,8 +351,8 @@ public class SettingsNewFragment extends MaterialAboutFragment { buttonIds.add(MainActivity.DRAWER_ITEM_GRADES); buttonIds.add(MainActivity.DRAWER_ITEM_MESSAGES); buttonIds.add(MainActivity.DRAWER_ITEM_HOMEWORK); - buttonIds.add(MainActivity.DRAWER_ITEM_NOTICES); - buttonIds.add(MainActivity.DRAWER_ITEM_ATTENDANCES); + buttonIds.add(MainActivity.DRAWER_ITEM_BEHAVIOUR); + buttonIds.add(MainActivity.DRAWER_ITEM_ATTENDANCE); buttonIds.add(MainActivity.DRAWER_ITEM_ANNOUNCEMENTS); buttonIds.add(MainActivity.DRAWER_ITEM_NOTIFICATIONS); buttonIds.add(MainActivity.DRAWER_ITEM_SETTINGS); @@ -365,7 +365,7 @@ public class SettingsNewFragment extends MaterialAboutFragment { buttonCaptions.add(getString(R.string.menu_messages)); buttonCaptions.add(getString(R.string.menu_homework)); buttonCaptions.add(getString(R.string.menu_notices)); - buttonCaptions.add(getString(R.string.menu_attendances)); + buttonCaptions.add(getString(R.string.menu_attendance)); buttonCaptions.add(getString(R.string.menu_announcements)); buttonCaptions.add(getString(R.string.menu_notifications)); buttonCaptions.add(getString(R.string.menu_settings)); @@ -1101,8 +1101,8 @@ public class SettingsNewFragment extends MaterialAboutFragment { case "Notices": stringRes = R.string.settings_sync_customize_endpoint_notices; break; - case "Attendances": - stringRes = R.string.settings_sync_customize_endpoint_attendances; + case "Attendance": + stringRes = R.string.settings_sync_customize_endpoint_attendance; break; case "Announcements": stringRes = R.string.settings_sync_customize_endpoint_announcements; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/RegisterTimetableDayFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/TimetableDayFragment.java similarity index 93% rename from app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/RegisterTimetableDayFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/TimetableDayFragment.java index ae04e29b..26f78b82 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/RegisterTimetableDayFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/TimetableDayFragment.java @@ -1,6 +1,10 @@ package pl.szczodrzynski.edziennik.ui.modules.timetable; import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.databinding.DataBindingUtil; @@ -8,25 +12,21 @@ import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; - import java.util.ArrayList; import pl.szczodrzynski.edziennik.App; -import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.MainActivity; -import pl.szczodrzynski.edziennik.databinding.FragmentRegisterTimetableDayBinding; +import pl.szczodrzynski.edziennik.R; +import pl.szczodrzynski.edziennik.databinding.FragmentTimetableDayBinding; +import pl.szczodrzynski.edziennik.utils.Themes; import pl.szczodrzynski.edziennik.utils.models.Date; import pl.szczodrzynski.edziennik.utils.models.Time; -import pl.szczodrzynski.edziennik.utils.Themes; -public class RegisterTimetableDayFragment extends Fragment { +public class TimetableDayFragment extends Fragment { private App app = null; private MainActivity activity = null; - private FragmentRegisterTimetableDayBinding b = null; + private FragmentTimetableDayBinding b = null; private RecyclerView recyclerView; @@ -40,7 +40,7 @@ public class RegisterTimetableDayFragment extends Fragment { if (app.profile == null) return inflater.inflate(R.layout.fragment_loading, container, false); // activity, context and profile is valid - b = DataBindingUtil.inflate(inflater, R.layout.fragment_register_timetable_day, container, false); + b = DataBindingUtil.inflate(inflater, R.layout.fragment_timetable_day, container, false); b.refreshLayout.setParent(activity.getSwipeRefreshLayout()); return b.getRoot(); } diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/RegisterTimetableFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/TimetableFragment.java similarity index 98% rename from app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/RegisterTimetableFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/TimetableFragment.java index 524b9b6d..09eda619 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/RegisterTimetableFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/TimetableFragment.java @@ -14,18 +14,6 @@ import android.net.Uri; import android.os.AsyncTask; import android.os.Build; import android.os.Bundle; -import androidx.annotation.NonNull; -import com.google.android.material.tabs.TabLayout; - -import androidx.annotation.Nullable; -import androidx.core.content.FileProvider; -import androidx.databinding.DataBindingUtil; -import androidx.fragment.app.Fragment; -import androidx.fragment.app.FragmentManager; -import androidx.fragment.app.FragmentPagerAdapter; -import androidx.viewpager.widget.ViewPager; -import androidx.cardview.widget.CardView; - import android.os.Environment; import android.text.Html; import android.util.Log; @@ -36,7 +24,18 @@ import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.cardview.widget.CardView; +import androidx.core.content.FileProvider; +import androidx.databinding.DataBindingUtil; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentPagerAdapter; +import androidx.viewpager.widget.ViewPager; + import com.afollestad.materialdialogs.MaterialDialog; +import com.google.android.material.tabs.TabLayout; import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial; import java.io.File; @@ -47,18 +46,18 @@ import java.util.List; import java.util.TreeMap; import pl.szczodrzynski.edziennik.App; -import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.MainActivity; -import pl.szczodrzynski.edziennik.databinding.FragmentRegisterTimetableBinding; +import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonFull; +import pl.szczodrzynski.edziennik.databinding.FragmentTimetableBinding; import pl.szczodrzynski.edziennik.ui.dialogs.event.EventManualDialog; import pl.szczodrzynski.edziennik.ui.modules.home.HomeFragment; -import pl.szczodrzynski.edziennik.utils.models.Date; -import pl.szczodrzynski.edziennik.utils.models.Time; -import pl.szczodrzynski.edziennik.utils.models.Week; import pl.szczodrzynski.edziennik.utils.SpannableHtmlTagHandler; import pl.szczodrzynski.edziennik.utils.Themes; import pl.szczodrzynski.edziennik.utils.Utils; +import pl.szczodrzynski.edziennik.utils.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Time; +import pl.szczodrzynski.edziennik.utils.models.Week; import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetPrimaryItem; import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetSeparatorItem; @@ -68,12 +67,12 @@ import static pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.TYPE_ import static pl.szczodrzynski.edziennik.utils.Utils.bs; import static pl.szczodrzynski.edziennik.utils.Utils.d; -public class RegisterTimetableFragment extends Fragment { +public class TimetableFragment extends Fragment { private static final String TAG = "RegisterTimetable"; private App app = null; private MainActivity activity = null; - private FragmentRegisterTimetableBinding b = null; + private FragmentTimetableBinding b = null; private ViewPager viewPager; private static int pageSelection = -1; @@ -89,7 +88,7 @@ public class RegisterTimetableFragment extends Fragment { if (app.profile == null) return inflater.inflate(R.layout.fragment_loading, container, false); // activity, context and profile is valid - b = DataBindingUtil.inflate(inflater, R.layout.fragment_register_timetable, container, false); + b = DataBindingUtil.inflate(inflater, R.layout.fragment_timetable, container, false); return b.getRoot(); } @@ -154,13 +153,13 @@ public class RegisterTimetableFragment extends Fragment { for (int i = 0; i < app.appConfig.timetableDisplayDaysForward + app.appConfig.timetableDisplayDaysBackward + 1; i++) { Bundle args = new Bundle(); args.putLong("date", date.getValue()); - RegisterTimetableDayFragment registerTimetableDayFragment = new RegisterTimetableDayFragment(); - registerTimetableDayFragment.setArguments(args); + TimetableDayFragment timetableDayFragment = new TimetableDayFragment(); + timetableDayFragment.setArguments(args); StringBuilder pageTitle = new StringBuilder(Week.getFullDayName(date.getWeekDay())); if (i > weekEnd || i < weekBeginning) { pageTitle.append(", ").append(date.getStringDm()); } - adapter.addFragment(registerTimetableDayFragment, pageTitle.toString()); + adapter.addFragment(timetableDayFragment, pageTitle.toString()); date.stepForward(0, 0, 1); } viewPager.setAdapter(adapter); diff --git a/app/src/main/res/layout/messages_compose_activity.xml b/app/src/main/res/layout/activity_compose_message.xml similarity index 100% rename from app/src/main/res/layout/messages_compose_activity.xml rename to app/src/main/res/layout/activity_compose_message.xml diff --git a/app/src/main/res/layout/fragment_register_agenda_calendar.xml b/app/src/main/res/layout/fragment_agenda_calendar.xml similarity index 100% rename from app/src/main/res/layout/fragment_register_agenda_calendar.xml rename to app/src/main/res/layout/fragment_agenda_calendar.xml diff --git a/app/src/main/res/layout/fragment_register_agenda_default.xml b/app/src/main/res/layout/fragment_agenda_default.xml similarity index 100% rename from app/src/main/res/layout/fragment_register_agenda_default.xml rename to app/src/main/res/layout/fragment_agenda_default.xml diff --git a/app/src/main/res/layout/fragment_register_school_notices.xml b/app/src/main/res/layout/fragment_announcements.xml similarity index 100% rename from app/src/main/res/layout/fragment_register_school_notices.xml rename to app/src/main/res/layout/fragment_announcements.xml diff --git a/app/src/main/res/layout/fragment_register_attendances.xml b/app/src/main/res/layout/fragment_attendance.xml similarity index 97% rename from app/src/main/res/layout/fragment_register_attendances.xml rename to app/src/main/res/layout/fragment_attendance.xml index c8992f78..c0ddb3d4 100644 --- a/app/src/main/res/layout/fragment_register_attendances.xml +++ b/app/src/main/res/layout/fragment_attendance.xml @@ -27,7 +27,7 @@ android:orientation="vertical"> - \ No newline at end of file + diff --git a/app/src/main/res/layout/fragment_register_notices.xml b/app/src/main/res/layout/fragment_behaviour.xml similarity index 100% rename from app/src/main/res/layout/fragment_register_notices.xml rename to app/src/main/res/layout/fragment_behaviour.xml diff --git a/app/src/main/res/layout/fragment_register_grades.xml b/app/src/main/res/layout/fragment_grades.xml similarity index 100% rename from app/src/main/res/layout/fragment_register_grades.xml rename to app/src/main/res/layout/fragment_grades.xml diff --git a/app/src/main/res/layout/fragment_register_messages_web.xml b/app/src/main/res/layout/fragment_messages_web.xml similarity index 100% rename from app/src/main/res/layout/fragment_register_messages_web.xml rename to app/src/main/res/layout/fragment_messages_web.xml diff --git a/app/src/main/res/layout/fragment_register_notifications.xml b/app/src/main/res/layout/fragment_notifications.xml similarity index 100% rename from app/src/main/res/layout/fragment_register_notifications.xml rename to app/src/main/res/layout/fragment_notifications.xml diff --git a/app/src/main/res/layout/fragment_register_timetable.xml b/app/src/main/res/layout/fragment_timetable.xml similarity index 100% rename from app/src/main/res/layout/fragment_register_timetable.xml rename to app/src/main/res/layout/fragment_timetable.xml diff --git a/app/src/main/res/layout/fragment_register_timetable_day.xml b/app/src/main/res/layout/fragment_timetable_day.xml similarity index 100% rename from app/src/main/res/layout/fragment_register_timetable_day.xml rename to app/src/main/res/layout/fragment_timetable_day.xml diff --git a/app/src/main/res/values-en/strings.xml b/app/src/main/res/values-en/strings.xml index e898c234..599c4191 100644 --- a/app/src/main/res/values-en/strings.xml +++ b/app/src/main/res/values-en/strings.xml @@ -69,8 +69,8 @@ Releases: All subjects Summary - loading… - Summary - semester %d  - Summary - all year  + Summary - semester %d  + Summary - all year  Back Adjust the bell sync time. Format: ±H:MM:SS Incorrect format @@ -401,7 +401,7 @@ Add a new student Agenda Notice board - Attendance + Attendance Grades Grade editing simulator Help @@ -598,7 +598,7 @@ Share exams in your class Enable Event sharing Notice board - Attendances + Attendances Class free days Classrooms Events/agenda @@ -680,7 +680,7 @@ Getting account info Getting notice board Getting attendance types - Getting attendance + Getting attendance Getting behaviour grades categories Getting behaviour grades Getting agenda @@ -747,7 +747,7 @@ Syncing agenda… All Syncing announcements… - Syncing attendances… + Syncing attendance… Syncing grades… Syncing homework… Syncing received messages… diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index cc848455..b9de8bbb 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -76,8 +76,8 @@ Zwolnienia: Wszystkie przedmioty Podsumowanie - ładowanie… - Podsumowanie - semestr %d  - Podsumowanie - cały rok  + Podsumowanie - semestr %d  + Podsumowanie - cały rok  Wróć Dostosuj wartość przesunięcia dzwonka. Format: ±H:MM:SS Nieprawidłowy format @@ -425,7 +425,7 @@ Dodaj nowego ucznia Terminarz Tablica ogłoszeń - Frekwencja + Frekwencja Zapisz plan lekcji jako obraz Generuje plan lekcji na cały tydzień Oceny @@ -643,7 +643,7 @@ Udostępniaj sprawdziany w swojej klasie Włącz Udostępnianie wydarzeń Tablica ogłoszeń - Obecności/nieobecności + Obecności/nieobecności Dni wolne klasy Sale lekcyjne Wydarzenia/terminarz @@ -726,7 +726,7 @@ Pobieranie informacji o koncie Pobieranie ogłoszeń szkolnych Pobieranie kategorii obecności - Pobieranie obecności + Pobieranie obecności Pobieranie kategorii ocen z zachowania Pobieranie ocen z zachowania Pobieranie kalendarza @@ -794,7 +794,7 @@ Pobieram terminarz… Wszystkie Pobieram tablicę ogłoszeń… - Pobieram obecności… + Pobieram obecności… Pobieram oceny… Pobieram zadania domowe… Pobieram wiadomości odebrane…