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..afb44fda 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/App.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/App.java @@ -63,18 +63,18 @@ import me.leolin.shortcutbadger.ShortcutBadger; import okhttp3.ConnectionSpec; import okhttp3.OkHttpClient; import okhttp3.TlsVersion; -import pl.szczodrzynski.edziennik.activities.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.models.AppConfig; +import pl.szczodrzynski.edziennik.ui.modules.base.CrashActivity; +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; import pl.szczodrzynski.edziennik.receivers.JobsCreator; @@ -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 3a9f77a4..4995f873 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,22 +41,35 @@ 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.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.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 +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.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.GradesFragment +import pl.szczodrzynski.edziennik.ui.modules.home.HomeFragment +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.TimetableFragment import pl.szczodrzynski.edziennik.utils.SwipeRefreshLayoutNoTouch import pl.szczodrzynski.edziennik.utils.Utils import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetPrimaryItem @@ -85,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 @@ -110,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) @@ -135,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) @@ -524,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 @@ -540,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/Notifier.java b/app/src/main/java/pl/szczodrzynski/edziennik/Notifier.java index 512affed..cc2237c3 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/Notifier.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/Notifier.java @@ -16,9 +16,9 @@ import java.util.ArrayList; 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.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; 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..36296e39 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/WidgetTimetable.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/WidgetTimetable.java @@ -28,22 +28,22 @@ 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.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.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; +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; 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 eb0fde7c..99ab1a4b 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,27 +43,27 @@ 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.models.Date; -import pl.szczodrzynski.edziennik.models.Notification; +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; import pl.szczodrzynski.edziennik.sync.SyncJob; import pl.szczodrzynski.edziennik.utils.Themes; @@ -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_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; +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; @@ -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/api/Iuczniowie.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Iuczniowie.java similarity index 93% 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 ad32cb24..33c69671 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.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.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; @@ -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/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 e1787377..aa7f635f 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,39 +45,39 @@ 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.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.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; +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; @@ -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; @@ -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/api/Mobidziennik.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Mobidziennik.java similarity index 94% 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 14a1e168..4a3d191f 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.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.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; @@ -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/api/Vulcan.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Vulcan.java similarity index 94% 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 85893a62..355f974c 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,57 +35,57 @@ 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.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.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; +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; @@ -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/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 84% 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 2d33d515..962b1bef 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,13 +6,13 @@ 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.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; public interface EdziennikInterface { @@ -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; @@ -60,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 94% 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..84efcebc 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 @@ -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/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 83% 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 8ba1f79e..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,26 +1,26 @@ -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.messages.MessagesComposeInfo -import pl.szczodrzynski.edziennik.models.Endpoint +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 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/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 78% 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 552340fa..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,10 +1,25 @@ -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.models.Date +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) { val teacherList: LongSparseArray = LongSparseArray() @@ -115,4 +130,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/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 fba95f57..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,7 +6,53 @@ 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.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 75% 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 fa23123b..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,8 +1,8 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.converters; 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/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 77% 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 6ac9a8c6..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,8 +1,8 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.converters; 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/Announcement.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/modules/announcements/Announcement.java similarity index 90% 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 cfde4da3..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,11 +1,11 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.announcements; import androidx.annotation.Nullable; 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/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 91% 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 50fec470..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; @@ -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/data/db/modules/attendance/AttendanceDao.java similarity index 94% 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 d6367227..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; @@ -8,12 +8,11 @@ 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; +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 95% 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 c6e1244a..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,11 +1,11 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.events; 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/data/db/modules/events/EventDao.java similarity index 93% 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 3ae3affb..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; @@ -14,12 +14,12 @@ 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; -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 93% 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 69fe76c9..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; @@ -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/data/db/modules/lessons/LessonChange.java similarity index 94% 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 41cfcbc6..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; @@ -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/data/db/modules/lessons/LessonChangeDao.java similarity index 95% 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 a8238b4e..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; @@ -11,10 +11,10 @@ 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.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 98% 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 a464b886..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; @@ -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/data/db/modules/lessons/LessonFull.java similarity index 93% 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 2486b491..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,15 +1,15 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.lessons; import androidx.room.ColumnInfo; 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; -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 82% 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 0ddc8032..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,10 +1,10 @@ -package pl.szczodrzynski.edziennik.datamodels; +package pl.szczodrzynski.edziennik.data.db.modules.luckynumber; 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/data/db/modules/luckynumber/LuckyNumberDao.java similarity index 89% 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 308b3045..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; @@ -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/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 87% 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 321ee89b..e7f3a410 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.models.db.UnreadCounter; +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 { @@ -196,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); @@ -217,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/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 97% 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 1404e8bf..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,27 +1,22 @@ -package pl.szczodrzynski.edziennik.datamodels +package pl.szczodrzynski.edziennik.data.db.modules.profiles 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/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 93% 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..ae41a733 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,17 +1,18 @@ -package pl.szczodrzynski.edziennik.datamodels +package pl.szczodrzynski.edziennik.data.db.modules.profiles import android.content.Context 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.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 { @@ -51,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 -> { @@ -62,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 } @@ -73,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/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 2b56b9bc..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.fragments.DebugFragment; -import pl.szczodrzynski.edziennik.models.Notification; +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; @@ -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/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/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 93% 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..ccf28951 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; @@ -18,14 +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.dialogs.EventListDialog; -import pl.szczodrzynski.edziennik.dialogs.EventManualDialog; -import pl.szczodrzynski.edziennik.models.Date; +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/dialogs/EventListDialog.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventListDialog.java similarity index 94% 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..6cd3fbbd 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.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; 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 97% 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..4a24d2e0 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; @@ -36,29 +36,29 @@ 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.models.Date; -import pl.szczodrzynski.edziennik.models.Time; -import pl.szczodrzynski.edziennik.models.Week; +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; import pl.szczodrzynski.edziennik.network.ServerRequest; 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/dialogs/GradeDetailsDialog.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/grade/GradeDetailsDialog.java similarity index 83% 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..cabc3e63 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,41 +1,29 @@ -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.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/dialogs/LessonChangeDialog.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/lessonchange/LessonChangeDialog.java similarity index 84% 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..155bad51 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.data.db.modules.lessons.LessonFull; +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/RegisterAgendaCalendarFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/AgendaCalendarFragment.java similarity index 91% rename from app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterAgendaCalendarFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/AgendaCalendarFragment.java index bad747f9..ffd58d51 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterAgendaCalendarFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/AgendaCalendarFragment.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; @@ -27,20 +27,20 @@ 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.dialogs.EventListDialog; -import pl.szczodrzynski.edziennik.models.Date; +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; +import pl.szczodrzynski.edziennik.utils.models.Date; 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/fragments/RegisterAgendaDefaultFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/AgendaDefaultFragment.java similarity index 92% rename from app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterAgendaDefaultFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/AgendaDefaultFragment.java index b7d12bae..ec5f847b 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterAgendaDefaultFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/agenda/AgendaDefaultFragment.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; @@ -36,36 +36,33 @@ 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.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.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; +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; 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.utils.Utils.bs; +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.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 @@ -80,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/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/adapters/AnnouncementsAdapter.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/announcements/AnnouncementsAdapter.java similarity index 95% 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..1b0d4fda 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; @@ -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/fragments/RegisterAnnouncementsFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/announcements/AnnouncementsFragment.java similarity index 92% rename from app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterAnnouncementsFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/announcements/AnnouncementsFragment.java index e6f955db..c539486a 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterAnnouncementsFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/announcements/AnnouncementsFragment.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; @@ -7,31 +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.adapters.AnnouncementsAdapter; +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.datamodels.Metadata.TYPE_ANNOUNCEMENT; +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) { @@ -43,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/adapters/AttendancesAdapter.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/AttendanceAdapter.java similarity index 85% rename from app/src/main/java/pl/szczodrzynski/edziennik/adapters/AttendancesAdapter.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/AttendanceAdapter.java index 79793f93..e1e53f5a 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/adapters/AttendancesAdapter.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/AttendanceAdapter.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; @@ -15,21 +15,21 @@ 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 { +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; } @@ -125,4 +125,4 @@ public class AttendancesAdapter extends RecyclerView.Adapter { - 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); @@ -127,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()) @@ -159,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"); @@ -181,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; })); @@ -193,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(); @@ -275,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/activities/CrashActivity.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/CrashActivity.java similarity index 98% rename from app/src/main/java/pl/szczodrzynski/edziennik/activities/CrashActivity.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/CrashActivity.java index de8ed06c..f159282a 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/activities/CrashActivity.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/CrashActivity.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.activities; +package pl.szczodrzynski.edziennik.ui.modules.base; /* * Copyright 2014-2017 Eduard Ereza Martínez @@ -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 { @@ -177,4 +177,4 @@ public final class CrashActivity extends AppCompatActivity { Toast.makeText(CrashActivity.this, R.string.copied_to_clipboard, Toast.LENGTH_SHORT).show(); } } -} \ No newline at end of file +} diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/activities/CrashGtfoActivity.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/CrashGtfoActivity.java similarity index 92% rename from app/src/main/java/pl/szczodrzynski/edziennik/activities/CrashGtfoActivity.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/CrashGtfoActivity.java index b954a9a4..c5b54d03 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/activities/CrashGtfoActivity.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/CrashGtfoActivity.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.activities; +package pl.szczodrzynski.edziennik.ui.modules.base; import android.content.Context; import android.os.Bundle; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/DebugFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/DebugFragment.java similarity index 99% rename from app/src/main/java/pl/szczodrzynski/edziennik/fragments/DebugFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/DebugFragment.java index 35faaca3..0e606126 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/DebugFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/DebugFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.fragments; +package pl.szczodrzynski.edziennik.ui.modules.base; import android.os.Bundle; import androidx.annotation.NonNull; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/activities/FeedbackActivity.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/FeedbackActivity.java similarity index 98% rename from app/src/main/java/pl/szczodrzynski/edziennik/activities/FeedbackActivity.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/FeedbackActivity.java index 97cdba68..a1625acd 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/activities/FeedbackActivity.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/FeedbackActivity.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.activities; +package pl.szczodrzynski.edziennik.ui.modules.base; import androidx.appcompat.app.AppCompatActivity; import androidx.databinding.DataBindingUtil; @@ -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; @@ -352,7 +352,7 @@ public class FeedbackActivity extends AppCompatActivity { @Override protected void onResume() { super.onResume(); - registerReceiver(receiver, new IntentFilter("pl.szczodrzynski.edziennik.activities.FeedbackActivity")); + registerReceiver(receiver, new IntentFilter("pl.szczodrzynski.edziennik.ui.modules.base.FeedbackActivity")); } @Override diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/FeedbackFragment.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/FeedbackFragment.kt similarity index 98% rename from app/src/main/java/pl/szczodrzynski/edziennik/fragments/FeedbackFragment.kt rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/FeedbackFragment.kt index a0b774fa..4351a6f7 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/FeedbackFragment.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/FeedbackFragment.kt @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.fragments +package pl.szczodrzynski.edziennik.ui.modules.base import android.content.BroadcastReceiver import android.content.Context @@ -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 @@ -323,7 +323,7 @@ class FeedbackFragment : Fragment() { override fun onResume() { super.onResume() if (receiver != null) - activity.registerReceiver(receiver, IntentFilter("pl.szczodrzynski.edziennik.activities.FeedbackActivity")) + activity.registerReceiver(receiver, IntentFilter("pl.szczodrzynski.edziennik.ui.modules.base.FeedbackActivity")) } override fun onPause() { @@ -331,4 +331,4 @@ class FeedbackFragment : Fragment() { if (receiver != null) activity.unregisterReceiver(receiver) } -} \ No newline at end of file +} diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/HelpFragment.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/HelpFragment.kt similarity index 96% rename from app/src/main/java/pl/szczodrzynski/edziennik/fragments/HelpFragment.kt rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/HelpFragment.kt index 4553a7b0..d54e0fc6 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/HelpFragment.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/HelpFragment.kt @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.fragments +package pl.szczodrzynski.edziennik.ui.modules.base import android.os.Bundle import androidx.fragment.app.Fragment diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/LoadingFragment.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/LoadingFragment.kt similarity index 93% rename from app/src/main/java/pl/szczodrzynski/edziennik/fragments/LoadingFragment.kt rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/LoadingFragment.kt index 4573f4fd..b5626fa4 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/LoadingFragment.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/LoadingFragment.kt @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.fragments +package pl.szczodrzynski.edziennik.ui.modules.base import android.os.Bundle import android.view.LayoutInflater @@ -20,4 +20,4 @@ class LoadingFragment : Fragment() { b = FragmentLoadingBinding.inflate(inflater) return b.root } -} \ No newline at end of file +} diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/TemplateFragment.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/TemplateFragment.kt similarity index 96% rename from app/src/main/java/pl/szczodrzynski/edziennik/fragments/TemplateFragment.kt rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/TemplateFragment.kt index a7c8d526..6b055750 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/TemplateFragment.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/base/TemplateFragment.kt @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.fragments +package pl.szczodrzynski.edziennik.ui.modules.base import android.os.Bundle import android.view.LayoutInflater diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterNoticesFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/behaviour/BehaviourFragment.java similarity index 92% rename from app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterNoticesFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/behaviour/BehaviourFragment.java index fc495bbd..29f46afe 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterNoticesFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/behaviour/BehaviourFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.fragments; +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,23 +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.adapters.NoticesAdapter; -import pl.szczodrzynski.edziennik.databinding.FragmentRegisterNoticesBinding; -import pl.szczodrzynski.edziennik.datamodels.Notice; -import pl.szczodrzynski.edziennik.datamodels.NoticeFull; +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.datamodels.Metadata.TYPE_NOTICE; +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; @@ -57,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(); } @@ -79,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/adapters/NoticesAdapter.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/behaviour/NoticesAdapter.kt similarity index 92% rename from app/src/main/java/pl/szczodrzynski/edziennik/adapters/NoticesAdapter.kt rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/behaviour/NoticesAdapter.kt index ef8f1328..c9693842 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/adapters/NoticesAdapter.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/behaviour/NoticesAdapter.kt @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.adapters +package pl.szczodrzynski.edziennik.ui.modules.behaviour import android.content.Context import android.graphics.PorterDuff @@ -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.models.Date +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 @@ -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/RegisterGradesFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/GradesFragment.java similarity index 95% rename from app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterGradesFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/GradesFragment.java index 693675d4..1a6b99dc 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterGradesFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/GradesFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.fragments; +package pl.szczodrzynski.edziennik.ui.modules.grades; import android.os.AsyncTask; import android.os.Bundle; @@ -21,33 +21,32 @@ 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.adapters.GradesSubjectAdapter; -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.models.ItemGradesSubjectModel; +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.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; -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.models.AppConfig.ORDER_BY_DATE_ASC; -import static pl.szczodrzynski.edziennik.models.AppConfig.ORDER_BY_DATE_DESC; -import static pl.szczodrzynski.edziennik.models.AppConfig.ORDER_BY_SUBJECT_ASC; +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; -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) { @@ -59,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/adapters/GradesListAdapter.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/GradesListAdapter.java similarity index 93% rename from app/src/main/java/pl/szczodrzynski/edziennik/adapters/GradesListAdapter.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/GradesListAdapter.java index 722aa823..0c1c1326 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/adapters/GradesListAdapter.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/GradesListAdapter.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.adapters; +package pl.szczodrzynski.edziennik.ui.modules.grades; import android.content.Context; import android.graphics.PorterDuff; @@ -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.dialogs.GradeDetailsDialog; -import pl.szczodrzynski.edziennik.models.Date; +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/adapters/GradesSubjectAdapter.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/GradesSubjectAdapter.java similarity index 98% rename from app/src/main/java/pl/szczodrzynski/edziennik/adapters/GradesSubjectAdapter.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/GradesSubjectAdapter.java index 0038612c..25705cb3 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/adapters/GradesSubjectAdapter.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/GradesSubjectAdapter.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.adapters; +package pl.szczodrzynski.edziennik.ui.modules.grades; import android.content.Context; import android.graphics.PorterDuff; @@ -30,10 +30,10 @@ 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.models.ItemGradesSubjectModel; +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; import pl.szczodrzynski.edziennik.utils.Utils; @@ -41,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/adapters/GradesEditorAdapter.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/editor/GradesEditorAdapter.kt similarity index 95% rename from app/src/main/java/pl/szczodrzynski/edziennik/adapters/GradesEditorAdapter.kt rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/editor/GradesEditorAdapter.kt index 62701eff..c7553bb7 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/adapters/GradesEditorAdapter.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/editor/GradesEditorAdapter.kt @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.adapters +package pl.szczodrzynski.edziennik.ui.modules.grades.editor import android.content.Context import android.graphics.PorterDuff @@ -15,8 +15,7 @@ import com.daimajia.swipe.SwipeLayout import com.mikepenz.iconics.view.IconicsImageView import pl.szczodrzynski.edziennik.App import pl.szczodrzynski.edziennik.R -import pl.szczodrzynski.edziennik.fragments.GradesEditorFragment -import pl.szczodrzynski.edziennik.fragments.GradesEditorFragment.Companion.modifyGradeChooser +import pl.szczodrzynski.edziennik.ui.modules.grades.editor.GradesEditorFragment.Companion.modifyGradeChooser import pl.szczodrzynski.edziennik.utils.Colors.gradeNameToColor import java.text.DecimalFormat diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/GradesEditorFragment.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/editor/GradesEditorFragment.kt similarity index 96% rename from app/src/main/java/pl/szczodrzynski/edziennik/fragments/GradesEditorFragment.kt rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/editor/GradesEditorFragment.kt index 4d19f06c..7d8641ea 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/GradesEditorFragment.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/grades/editor/GradesEditorFragment.kt @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.fragments +package pl.szczodrzynski.edziennik.ui.modules.grades.editor import android.graphics.PorterDuff import android.graphics.PorterDuffColorFilter @@ -13,13 +13,12 @@ import androidx.lifecycle.Observer import androidx.recyclerview.widget.LinearLayoutManager import com.afollestad.materialdialogs.MaterialDialog import pl.szczodrzynski.edziennik.* -import pl.szczodrzynski.edziennik.adapters.GradesEditorAdapter 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/activities/CounterActivity.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/CounterActivity.java similarity index 96% rename from app/src/main/java/pl/szczodrzynski/edziennik/activities/CounterActivity.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/CounterActivity.java index 0e11eff0..14a6b71c 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/activities/CounterActivity.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/CounterActivity.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.activities; +package pl.szczodrzynski.edziennik.ui.modules.home; import androidx.databinding.DataBindingUtil; import android.os.AsyncTask; @@ -15,12 +15,11 @@ 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.fragments.HomeFragment; -import pl.szczodrzynski.edziennik.models.Date; -import pl.szczodrzynski.edziennik.models.Time; +import pl.szczodrzynski.edziennik.data.db.modules.lessons.LessonFull; +import pl.szczodrzynski.edziennik.utils.models.Date; +import pl.szczodrzynski.edziennik.utils.models.Time; -import static pl.szczodrzynski.edziennik.fragments.HomeFragment.updateInterval; +import static pl.szczodrzynski.edziennik.ui.modules.home.HomeFragment.updateInterval; public class CounterActivity extends AppCompatActivity { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/HomeFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/HomeFragment.java similarity index 94% rename from app/src/main/java/pl/szczodrzynski/edziennik/fragments/HomeFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/HomeFragment.java index 1836d5a9..24df37d0 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/HomeFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/HomeFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.fragments; +package pl.szczodrzynski.edziennik.ui.modules.home; import android.app.Activity; import android.content.Context; @@ -29,7 +29,6 @@ import androidx.databinding.DataBindingUtil; import androidx.fragment.app.Fragment; import com.afollestad.materialdialogs.MaterialDialog; -import com.google.gson.JsonObject; import com.mikepenz.iconics.IconicsColor; import com.mikepenz.iconics.IconicsDrawable; import com.mikepenz.iconics.IconicsSize; @@ -42,22 +41,17 @@ import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.BuildConfig; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.MainActivity; -import pl.szczodrzynski.edziennik.api.AppError; -import pl.szczodrzynski.edziennik.api.interfaces.SyncCallback; -import pl.szczodrzynski.edziennik.api.v2.librus.Librus; 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.LoginStore; -import pl.szczodrzynski.edziennik.datamodels.Profile; -import pl.szczodrzynski.edziennik.datamodels.ProfileFull; -import pl.szczodrzynski.edziennik.datamodels.Subject; -import pl.szczodrzynski.edziennik.messages.MessagesComposeActivity; -import pl.szczodrzynski.edziennik.models.Date; -import pl.szczodrzynski.edziennik.models.ItemGradesSubjectModel; -import pl.szczodrzynski.edziennik.models.Time; +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; +import pl.szczodrzynski.edziennik.utils.models.Time; import pl.szczodrzynski.edziennik.receivers.BootReceiver; import pl.szczodrzynski.edziennik.utils.Colors; import pl.szczodrzynski.edziennik.utils.Themes; @@ -66,14 +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_LIBRUS; -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/fragments/HomeTimetableCard.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/HomeTimetableCard.java similarity index 97% rename from app/src/main/java/pl/szczodrzynski/edziennik/fragments/HomeTimetableCard.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/HomeTimetableCard.java index 937d3fed..377efeb5 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/HomeTimetableCard.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/HomeTimetableCard.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.fragments; +package pl.szczodrzynski.edziennik.ui.modules.home; import android.content.Intent; import android.os.AsyncTask; @@ -23,17 +23,16 @@ import java.util.TimerTask; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.MainActivity; -import pl.szczodrzynski.edziennik.activities.CounterActivity; import pl.szczodrzynski.edziennik.databinding.CardTimetableBinding; -import pl.szczodrzynski.edziennik.datamodels.EventFull; -import pl.szczodrzynski.edziennik.datamodels.LessonFull; -import pl.szczodrzynski.edziennik.models.Date; -import pl.szczodrzynski.edziennik.models.Time; -import pl.szczodrzynski.edziennik.models.Week; +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.fragments.HomeFragment.updateInterval; +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; public class HomeTimetableCard { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/homework/HomeworkAdapter.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/homework/HomeworkAdapter.java similarity index 94% rename from app/src/main/java/pl/szczodrzynski/edziennik/homework/HomeworkAdapter.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/homework/HomeworkAdapter.java index e59a98ba..38644e37 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/homework/HomeworkAdapter.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/homework/HomeworkAdapter.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.homework; +package pl.szczodrzynski.edziennik.ui.modules.homework; import android.content.Context; import android.graphics.PorterDuff; @@ -17,10 +17,10 @@ import java.util.List; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.datamodels.EventFull; -import pl.szczodrzynski.edziennik.dialogs.EventManualDialog; -import pl.szczodrzynski.edziennik.fragments.HomeFragment; -import pl.szczodrzynski.edziennik.models.Date; +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; import static pl.szczodrzynski.edziennik.utils.Utils.bs; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/homework/HomeworkDate.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/homework/HomeworkDate.kt similarity index 66% rename from app/src/main/java/pl/szczodrzynski/edziennik/homework/HomeworkDate.kt rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/homework/HomeworkDate.kt index 53773502..d923c5a1 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/homework/HomeworkDate.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/homework/HomeworkDate.kt @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.homework +package pl.szczodrzynski.edziennik.ui.modules.homework class HomeworkDate { companion object { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/homework/HomeworkFragment.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/homework/HomeworkFragment.kt similarity index 94% rename from app/src/main/java/pl/szczodrzynski/edziennik/homework/HomeworkFragment.kt rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/homework/HomeworkFragment.kt index 9f7525c9..9ccd97ce 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/homework/HomeworkFragment.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/homework/HomeworkFragment.kt @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.homework +package pl.szczodrzynski.edziennik.ui.modules.homework import android.os.AsyncTask import android.os.Bundle @@ -9,14 +9,13 @@ import android.widget.Toast import androidx.fragment.app.Fragment import androidx.viewpager.widget.ViewPager import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial -import kotlinx.android.synthetic.main.activity_szkolny.* 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.dialogs.EventManualDialog -import pl.szczodrzynski.edziennik.messages.MessagesFragment +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 import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetPrimaryItem import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetSeparatorItem diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/homework/HomeworkListFragment.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/homework/HomeworkListFragment.kt similarity index 94% rename from app/src/main/java/pl/szczodrzynski/edziennik/homework/HomeworkListFragment.kt rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/homework/HomeworkListFragment.kt index 2e601755..22da31a5 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/homework/HomeworkListFragment.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/homework/HomeworkListFragment.kt @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.homework +package pl.szczodrzynski.edziennik.ui.modules.homework import android.os.Bundle import android.view.LayoutInflater @@ -11,9 +11,9 @@ 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.models.Date +import pl.szczodrzynski.edziennik.utils.models.Date import pl.szczodrzynski.edziennik.utils.Themes class HomeworkListFragment : Fragment() { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/intro/ChangelogIntroActivity.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/intro/ChangelogIntroActivity.java similarity index 96% rename from app/src/main/java/pl/szczodrzynski/edziennik/intro/ChangelogIntroActivity.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/intro/ChangelogIntroActivity.java index d8d9441b..eac89b71 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/intro/ChangelogIntroActivity.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/intro/ChangelogIntroActivity.java @@ -1,10 +1,9 @@ -package pl.szczodrzynski.edziennik.intro; +package pl.szczodrzynski.edziennik.ui.modules.intro; import android.os.Build; import android.os.Bundle; import com.heinrichreimersoftware.materialintro.app.IntroActivity; -import com.heinrichreimersoftware.materialintro.slide.SimpleSlide; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.BuildConfig; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/intro/FragmentSlideMod.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/intro/FragmentSlideMod.java similarity index 99% rename from app/src/main/java/pl/szczodrzynski/edziennik/intro/FragmentSlideMod.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/intro/FragmentSlideMod.java index e2a0c9ca..1d3cfb92 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/intro/FragmentSlideMod.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/intro/FragmentSlideMod.java @@ -22,7 +22,7 @@ * SOFTWARE. */ -package pl.szczodrzynski.edziennik.intro; +package pl.szczodrzynski.edziennik.ui.modules.intro; import android.content.Context; import android.os.Build; @@ -284,4 +284,4 @@ public class FragmentSlideMod implements Slide, RestorableSlide, ButtonCtaSlide return localInflater.inflate(getArguments().getInt(ARGUMENT_LAYOUT_RES), container, false); } } -} \ No newline at end of file +} diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/login/LoginActivity.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginActivity.java similarity index 98% rename from app/src/main/java/pl/szczodrzynski/edziennik/login/LoginActivity.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginActivity.java index c6d49280..5d5b210d 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/login/LoginActivity.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginActivity.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.login; +package pl.szczodrzynski.edziennik.ui.modules.login; import androidx.databinding.DataBindingUtil; import android.os.Bundle; @@ -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/login/LoginChooserFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginChooserFragment.java similarity index 96% rename from app/src/main/java/pl/szczodrzynski/edziennik/login/LoginChooserFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginChooserFragment.java index 0e36f157..8615d2aa 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/login/LoginChooserFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginChooserFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.login; +package pl.szczodrzynski.edziennik.ui.modules.login; import android.content.Intent; import android.os.Bundle; @@ -13,7 +13,7 @@ import androidx.fragment.app.Fragment; import androidx.navigation.NavController; import androidx.navigation.Navigation; import pl.szczodrzynski.edziennik.App; -import pl.szczodrzynski.edziennik.activities.FeedbackActivity; +import pl.szczodrzynski.edziennik.ui.modules.base.FeedbackActivity; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.databinding.FragmentLoginChooserBinding; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/login/LoginFinishFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginFinishFragment.java similarity index 97% rename from app/src/main/java/pl/szczodrzynski/edziennik/login/LoginFinishFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginFinishFragment.java index 4adfd2b6..a5c9cd47 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/login/LoginFinishFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginFinishFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.login; +package pl.szczodrzynski.edziennik.ui.modules.login; import android.app.Activity; import android.content.Intent; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/login/LoginIuczniowieFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginIuczniowieFragment.java similarity index 93% rename from app/src/main/java/pl/szczodrzynski/edziennik/login/LoginIuczniowieFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginIuczniowieFragment.java index feb1dc0a..e1eb8091 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/login/LoginIuczniowieFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginIuczniowieFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.login; +package pl.szczodrzynski.edziennik.ui.modules.login; import android.os.Bundle; @@ -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/login/LoginIuczniowieHelpFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginIuczniowieHelpFragment.java similarity index 96% rename from app/src/main/java/pl/szczodrzynski/edziennik/login/LoginIuczniowieHelpFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginIuczniowieHelpFragment.java index 5de85bd2..7b5c9d96 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/login/LoginIuczniowieHelpFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginIuczniowieHelpFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.login; +package pl.szczodrzynski.edziennik.ui.modules.login; import androidx.databinding.DataBindingUtil; import android.os.Bundle; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/login/LoginLibrusFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginLibrusFragment.java similarity index 93% rename from app/src/main/java/pl/szczodrzynski/edziennik/login/LoginLibrusFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginLibrusFragment.java index cde63c64..fb0612fd 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/login/LoginLibrusFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginLibrusFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.login; +package pl.szczodrzynski.edziennik.ui.modules.login; import android.os.Bundle; @@ -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/login/LoginLibrusHelpFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginLibrusHelpFragment.java similarity index 96% rename from app/src/main/java/pl/szczodrzynski/edziennik/login/LoginLibrusHelpFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginLibrusHelpFragment.java index 5dcca8ab..6984498a 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/login/LoginLibrusHelpFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginLibrusHelpFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.login; +package pl.szczodrzynski.edziennik.ui.modules.login; import androidx.databinding.DataBindingUtil; import android.os.Bundle; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/login/LoginMigrationFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginMigrationFragment.java similarity index 88% rename from app/src/main/java/pl/szczodrzynski/edziennik/login/LoginMigrationFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginMigrationFragment.java index 11000498..cd881665 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/login/LoginMigrationFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginMigrationFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.login; +package pl.szczodrzynski.edziennik.ui.modules.login; import android.app.Activity; import android.content.Context; @@ -18,22 +18,22 @@ 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.models.Date; -import pl.szczodrzynski.edziennik.models.Time; +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; import android.util.LongSparseArray; import android.view.LayoutInflater; @@ -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/login/LoginMigrationSyncFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginMigrationSyncFragment.java similarity index 92% rename from app/src/main/java/pl/szczodrzynski/edziennik/login/LoginMigrationSyncFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginMigrationSyncFragment.java index ebb8edad..8adeebf2 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/login/LoginMigrationSyncFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginMigrationSyncFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.login; +package pl.szczodrzynski.edziennik.ui.modules.login; import android.app.Activity; import android.content.Context; @@ -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/login/LoginMobidziennikFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginMobidziennikFragment.java similarity index 92% rename from app/src/main/java/pl/szczodrzynski/edziennik/login/LoginMobidziennikFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginMobidziennikFragment.java index 549bad84..0c4c5f33 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/login/LoginMobidziennikFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginMobidziennikFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.login; +package pl.szczodrzynski.edziennik.ui.modules.login; import androidx.databinding.DataBindingUtil; import android.os.Bundle; @@ -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/login/LoginMobidziennikHelpFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginMobidziennikHelpFragment.java similarity index 96% rename from app/src/main/java/pl/szczodrzynski/edziennik/login/LoginMobidziennikHelpFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginMobidziennikHelpFragment.java index f6ba19ab..511f6682 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/login/LoginMobidziennikHelpFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginMobidziennikHelpFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.login; +package pl.szczodrzynski.edziennik.ui.modules.login; import androidx.databinding.DataBindingUtil; import android.os.Bundle; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/login/LoginProfileObject.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginProfileObject.java similarity index 78% rename from app/src/main/java/pl/szczodrzynski/edziennik/login/LoginProfileObject.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginProfileObject.java index 8bed9821..9ee42950 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/login/LoginProfileObject.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginProfileObject.java @@ -1,12 +1,12 @@ -package pl.szczodrzynski.edziennik.login; +package pl.szczodrzynski.edziennik.ui.modules.login; 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/login/LoginProgressFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginProgressFragment.java similarity index 93% rename from app/src/main/java/pl/szczodrzynski/edziennik/login/LoginProgressFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginProgressFragment.java index 572cb78d..93f00fa3 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/login/LoginProgressFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginProgressFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.login; +package pl.szczodrzynski.edziennik.ui.modules.login; import androidx.databinding.DataBindingUtil; @@ -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/login/LoginSummaryFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginSummaryFragment.java similarity index 98% rename from app/src/main/java/pl/szczodrzynski/edziennik/login/LoginSummaryFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginSummaryFragment.java index d2e48969..43efd3fe 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/login/LoginSummaryFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginSummaryFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.login; +package pl.szczodrzynski.edziennik.ui.modules.login; import androidx.databinding.DataBindingUtil; @@ -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/login/LoginSyncErrorFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginSyncErrorFragment.java similarity index 95% rename from app/src/main/java/pl/szczodrzynski/edziennik/login/LoginSyncErrorFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginSyncErrorFragment.java index 3dc7d1cf..951c53e8 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/login/LoginSyncErrorFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginSyncErrorFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.login; +package pl.szczodrzynski.edziennik.ui.modules.login; import android.os.Bundle; @@ -11,7 +11,6 @@ import androidx.navigation.Navigation; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.databinding.FragmentLoginSyncErrorBinding; -import pl.szczodrzynski.edziennik.login.LoginActivity; import android.view.LayoutInflater; import android.view.View; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/login/LoginSyncFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginSyncFragment.java similarity index 76% rename from app/src/main/java/pl/szczodrzynski/edziennik/login/LoginSyncFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginSyncFragment.java index ba0d70d0..3b8c436e 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/login/LoginSyncFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginSyncFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.login; +package pl.szczodrzynski.edziennik.ui.modules.login; import android.content.Context; @@ -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 { @@ -224,4 +224,4 @@ public class LoginSyncFragment extends Fragment { begin(); } -} \ No newline at end of file +} diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/login/LoginTemplateFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginTemplateFragment.java similarity index 96% rename from app/src/main/java/pl/szczodrzynski/edziennik/login/LoginTemplateFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginTemplateFragment.java index 8a2ed9df..41ff3beb 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/login/LoginTemplateFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginTemplateFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.login; +package pl.szczodrzynski.edziennik.ui.modules.login; import androidx.databinding.DataBindingUtil; import android.os.Bundle; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/login/LoginVulcanFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginVulcanFragment.java similarity index 93% rename from app/src/main/java/pl/szczodrzynski/edziennik/login/LoginVulcanFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginVulcanFragment.java index 297a0ca8..7b65eead 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/login/LoginVulcanFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginVulcanFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.login; +package pl.szczodrzynski.edziennik.ui.modules.login; import android.content.Intent; import android.graphics.Color; @@ -36,16 +36,16 @@ import javax.crypto.ShortBufferException; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.activities.QrScannerActivity; -import pl.szczodrzynski.edziennik.api.AppError; +import pl.szczodrzynski.edziennik.ui.modules.webpush.QrScannerActivity; +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/login/LoginVulcanHelpFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginVulcanHelpFragment.java similarity index 96% rename from app/src/main/java/pl/szczodrzynski/edziennik/login/LoginVulcanHelpFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginVulcanHelpFragment.java index 9a1875d0..0aa899ae 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/login/LoginVulcanHelpFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginVulcanHelpFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.login; +package pl.szczodrzynski.edziennik.ui.modules.login; import androidx.databinding.DataBindingUtil; import android.os.Bundle; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/messages/MessagesAdapter.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesAdapter.java similarity index 96% rename from app/src/main/java/pl/szczodrzynski/edziennik/messages/MessagesAdapter.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesAdapter.java index 33d3e5b7..35b75308 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/messages/MessagesAdapter.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesAdapter.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.messages; +package pl.szczodrzynski.edziennik.ui.modules.messages; import android.graphics.Typeface; import android.text.Html; @@ -17,12 +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.models.Date; -import pl.szczodrzynski.edziennik.utils.Utils; +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/messages/MessagesComposeActivity.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesComposeActivity.java similarity index 93% rename from app/src/main/java/pl/szczodrzynski/edziennik/messages/MessagesComposeActivity.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesComposeActivity.java index 767e73de..ff22e48e 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/messages/MessagesComposeActivity.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesComposeActivity.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.messages; +package pl.szczodrzynski.edziennik.ui.modules.messages; import android.content.Context; import android.graphics.Color; @@ -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.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.api.AppError; +import pl.szczodrzynski.edziennik.data.api.Edziennik; +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 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/messages/MessagesComposeInfo.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesComposeInfo.java similarity index 93% rename from app/src/main/java/pl/szczodrzynski/edziennik/messages/MessagesComposeInfo.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesComposeInfo.java index ad472272..6812e00d 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/messages/MessagesComposeInfo.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesComposeInfo.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.messages; +package pl.szczodrzynski.edziennik.ui.modules.messages; public class MessagesComposeInfo { /** diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/messages/MessagesComposeSuggestionAdapter.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesComposeSuggestionAdapter.java similarity index 98% rename from app/src/main/java/pl/szczodrzynski/edziennik/messages/MessagesComposeSuggestionAdapter.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesComposeSuggestionAdapter.java index 441959fe..748e2c32 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/messages/MessagesComposeSuggestionAdapter.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesComposeSuggestionAdapter.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.messages; +package pl.szczodrzynski.edziennik.ui.modules.messages; import android.content.Context; import android.text.Html; @@ -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 { @@ -188,4 +188,4 @@ public class MessagesComposeSuggestionAdapter extends ArrayAdapter { } } } -} \ 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 97% 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..645b66d3 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; @@ -51,17 +51,17 @@ 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.models.Date; -import pl.szczodrzynski.edziennik.models.Time; +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; 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 96% 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..db7fae3b 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 @@ -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.* @@ -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 95% 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..17e77c41 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; @@ -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/messages/MessagesUtils.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesUtils.java similarity index 95% 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..91ed9a56 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,24 +1,22 @@ -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; 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/fragments/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/fragments/RegisterMessagesWebFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesWebFragment.java index 9c168eaf..343f4076 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterMessagesWebFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesWebFragment.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.fragments; +package pl.szczodrzynski.edziennik.ui.modules.messages; import android.Manifest; import android.annotation.SuppressLint; @@ -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/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/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/NotificationsFragment.java similarity index 87% rename from app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterNotificationsFragment.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notifications/NotificationsFragment.java index 7b96196c..0ed54999 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/fragments/RegisterNotificationsFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/notifications/NotificationsFragment.java @@ -1,28 +1,28 @@ -package pl.szczodrzynski.edziennik.fragments; +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.adapters.NotificationsAdapter; -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) { @@ -34,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/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 98% 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..34726682 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,27 +45,27 @@ 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; 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; @@ -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/adapters/TimetableAdapter.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/timetable/TimetableAdapter.java similarity index 95% 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..def0b58f 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; @@ -25,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.dialogs.EventListDialog; -import pl.szczodrzynski.edziennik.models.Date; +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"; @@ -199,4 +198,4 @@ public class TimetableAdapter extends RecyclerView.Adapter 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/java/pl/szczodrzynski/edziennik/activities/QrScannerActivity.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/webpush/QrScannerActivity.java similarity index 98% rename from app/src/main/java/pl/szczodrzynski/edziennik/activities/QrScannerActivity.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/webpush/QrScannerActivity.java index bd91328c..b9028ac5 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/activities/QrScannerActivity.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/webpush/QrScannerActivity.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.activities; +package pl.szczodrzynski.edziennik.ui.modules.webpush; import android.Manifest; import android.content.pm.PackageManager; diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/activities/WebPushConfigActivity.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/webpush/WebPushConfigActivity.java similarity index 98% rename from app/src/main/java/pl/szczodrzynski/edziennik/activities/WebPushConfigActivity.java rename to app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/webpush/WebPushConfigActivity.java index 916416e0..dcb652dd 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/activities/WebPushConfigActivity.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/webpush/WebPushConfigActivity.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.activities; +package pl.szczodrzynski.edziennik.ui.modules.webpush; import android.Manifest; import android.content.pm.PackageManager; @@ -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"; @@ -296,4 +296,4 @@ public class WebPushConfigActivity extends AppCompatActivity implements ZXingSca } super.onBackPressed(); } -} \ No newline at end of file +} 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/models/AppConfig.java b/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/AppConfig.java similarity index 89% rename from app/src/main/java/pl/szczodrzynski/edziennik/models/AppConfig.java rename to app/src/main/java/pl/szczodrzynski/edziennik/utils/models/AppConfig.java index 89335486..2aefccf0 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/models/AppConfig.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/AppConfig.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.models; +package pl.szczodrzynski.edziennik.utils.models; import android.util.Pair; @@ -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/models/Date.java b/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/Date.java similarity index 99% rename from app/src/main/java/pl/szczodrzynski/edziennik/models/Date.java rename to app/src/main/java/pl/szczodrzynski/edziennik/utils/models/Date.java index 1c609f2b..3b69cdc9 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/models/Date.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/Date.java @@ -1,4 +1,4 @@ -package pl.szczodrzynski.edziennik.models; +package pl.szczodrzynski.edziennik.utils.models; import androidx.annotation.NonNull; @@ -222,4 +222,4 @@ public class Date implements Comparable { ", 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 92% 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..2d2bc614 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,10 +1,10 @@ -package pl.szczodrzynski.edziennik.models; +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/models/ItemTimetableModel.java b/app/src/main/java/pl/szczodrzynski/edziennik/utils/models/ItemTimetableModel.java similarity index 65% 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..e9527793 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,9 +1,9 @@ -package pl.szczodrzynski.edziennik.models; +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/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..4004109c 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; @@ -29,12 +22,11 @@ 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; 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..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,8 +24,8 @@ 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.models.Date; +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/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/messages_compose_activity.xml b/app/src/main/res/layout/activity_compose_message.xml similarity index 97% rename from app/src/main/res/layout/messages_compose_activity.xml rename to app/src/main/res/layout/activity_compose_message.xml index d826b83b..ce5cb2e3 100644 --- a/app/src/main/res/layout/messages_compose_activity.xml +++ b/app/src/main/res/layout/activity_compose_message.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/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..52d8a8d2 100644 --- a/app/src/main/res/layout/dialog_grade_details.xml +++ b/app/src/main/res/layout/dialog_grade_details.xml @@ -5,11 +5,11 @@ - - + + + type="pl.szczodrzynski.edziennik.data.db.modules.grades.GradeFull" /> 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_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/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/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/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… 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" />