diff options
author | Stefan Niedermann <info@niedermann.it> | 2023-03-09 12:19:32 +0300 |
---|---|---|
committer | Stefan Niedermann <info@niedermann.it> | 2023-03-09 12:19:32 +0300 |
commit | c80b3bf036a0ce0699291868bf3aa2100d62383d (patch) | |
tree | 0c183ccfd14e07f5784f588f69197ab09c8cf481 | |
parent | 85457a44dc8f9533b770d586db99d1d8f185a41e (diff) |
refactor: Move packages to clarify architecture
https://developer.android.com/topic/architecture
Signed-off-by: Stefan Niedermann <info@niedermann.it>
-rw-r--r-- | app/pfungstadt/release/output-metadata.json | 20 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/DeckApplication.java | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/DataBaseAdapter.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DataBaseAdapter.java) | 4 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/DeckDatabase.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DeckDatabase.java) | 118 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/converter/DateTypeConverter.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/converter/DateTypeConverter.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/converter/EnumConverter.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/converter/EnumConverter.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/AccessControlDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/AccessControlDao.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/AccountDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/AccountDao.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/ActivityDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/ActivityDao.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/AttachmentDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/AttachmentDao.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/BoardDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/BoardDao.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/CardDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/CardDao.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/CommentDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/CommentDao.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/GenericDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/GenericDao.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/JoinBoardWithLabelDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinBoardWithLabelDao.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/JoinBoardWithPermissionDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinBoardWithPermissionDao.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/JoinBoardWithUserDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinBoardWithUserDao.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/JoinCardWithLabelDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinCardWithLabelDao.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/JoinCardWithUserDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinCardWithUserDao.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/LabelDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/LabelDao.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/MentionDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/MentionDao.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/PermissionDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/PermissionDao.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/StackDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/StackDao.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/UserDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/UserDao.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/UserInBoardDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/UserInBoardDao.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/UserInGroupDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/UserInGroupDao.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/projects/JoinCardWithOcsProjectDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/projects/JoinCardWithOcsProjectDao.java) | 4 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/projects/OcsProjectDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/projects/OcsProjectDao.java) | 4 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/projects/OcsProjectResourceDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/projects/OcsProjectResourceDao.java) | 4 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/widgets/SingleCardWidgetModelDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/widgets/SingleCardWidgetModelDao.java) | 4 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/widgets/StackWidgetModelDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/widgets/StackWidgetModelDao.java) | 4 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/widgets/filter/FilterWidgetAccountDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/widgets/filter/FilterWidgetAccountDao.java) | 4 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/widgets/filter/FilterWidgetBoardDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/widgets/filter/FilterWidgetBoardDao.java) | 4 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/widgets/filter/FilterWidgetDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/widgets/filter/FilterWidgetDao.java) | 4 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/widgets/filter/FilterWidgetLabelDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/widgets/filter/FilterWidgetLabelDao.java) | 4 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/widgets/filter/FilterWidgetProjectDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/widgets/filter/FilterWidgetProjectDao.java) | 4 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/widgets/filter/FilterWidgetSortDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/widgets/filter/FilterWidgetSortDao.java) | 4 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/widgets/filter/FilterWidgetStackDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/widgets/filter/FilterWidgetStackDao.java) | 4 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/dao/widgets/filter/FilterWidgetUserDao.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/widgets/filter/FilterWidgetUserDao.java) | 4 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_10_11.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_10_11.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_11_12.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_11_12.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_12_13.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_12_13.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_13_14.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_13_14.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_14_15.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_14_15.java) | 4 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_15_16.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_15_16.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_16_17.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_16_17.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_17_18.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_17_18.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_18_19.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_18_19.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_19_20.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_19_20.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_20_21.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_20_21.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_21_22.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_21_22.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_22_23.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_22_23.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_23_24.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_23_24.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_24_25.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_24_25.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_25_26.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_25_26.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_26_27.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_26_27.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_27_28.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_27_28.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_28_29.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_28_29.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_29_30.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_29_30.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_30_31.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_30_31.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_31_32.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_31_32.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_8_9.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_8_9.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_9_10.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_9_10.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/model/Board.java | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/model/Label.java | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/SyncWorker.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/SyncWorker.java) | 9 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/adapters/ServerAdapter.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/ServerAdapter.java) | 10 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/api/ApiProvider.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/api/ApiProvider.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/api/DeckAPI.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/api/DeckAPI.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/api/GsonConfig.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/api/GsonConfig.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/api/GsonUTCInstantAdapter.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/api/GsonUTCInstantAdapter.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/api/IResponseCallback.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/api/IResponseCallback.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/api/JsonToEntityParser.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/api/JsonToEntityParser.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/api/LastSyncUtil.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/api/LastSyncUtil.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/api/NextcloudArrayDeserializer.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/api/NextcloudArrayDeserializer.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/api/NextcloudDeserializer.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/api/NextcloudDeserializer.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/api/NextcloudServerAPI.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/api/NextcloudServerAPI.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/api/RequestHelper.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/api/RequestHelper.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/api/ResponseCallback.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/api/ResponseCallback.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/api/ServerCommunicationErrorHandler.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/api/ServerCommunicationErrorHandler.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/api/json/JsonColorSerializer.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/api/json/JsonColorSerializer.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/DataPropagationHelper.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/DataPropagationHelper.java) | 10 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/SyncHelper.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/SyncHelper.java) | 12 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/AbstractSyncDataProvider.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/AbstractSyncDataProvider.java) | 10 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/AccessControlDataProvider.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/AccessControlDataProvider.java) | 10 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/ActivityDataProvider.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/ActivityDataProvider.java) | 8 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/AttachmentDataProvider.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/AttachmentDataProvider.java) | 8 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/BoardDataProvider.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/BoardDataProvider.java) | 12 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/CardDataProvider.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/CardDataProvider.java) | 10 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/CardLabelRelationshipProvider.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/CardLabelRelationshipProvider.java) | 4 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/CardPropagationDataProvider.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/CardPropagationDataProvider.java) | 8 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/CardUserRelationshipProvider.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/CardUserRelationshipProvider.java) | 4 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/DeckCommentsDataProvider.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/DeckCommentsDataProvider.java) | 9 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/IRelationshipProvider.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/IRelationshipProvider.java) | 4 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/LabelDataProvider.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/LabelDataProvider.java) | 8 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/OcsProjectDataProvider.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/OcsProjectDataProvider.java) | 8 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/StackDataProvider.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/StackDataProvider.java) | 10 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/UserDataProvider.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/UserDataProvider.java) | 8 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/partial/BoardWithAclDownSyncDataProvider.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/partial/BoardWithAclDownSyncDataProvider.java) | 14 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/partial/BoardWithStacksAndLabelsUpSyncDataProvider.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/partial/BoardWithStacksAndLabelsUpSyncDataProvider.java) | 12 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/util/AsyncUtil.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/util/AsyncUtil.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/util/ConnectivityUtil.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/util/ConnectivityUtil.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/repository/BaseRepository.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/BaseRepository.java) | 12 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/repository/PreferencesRepository.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/PreferencesRepository.java) | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/repository/SyncRepository.java (renamed from app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/SyncManager.java) | 75 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/ImportAccountActivity.java | 10 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/ImportAccountViewModel.java | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/PickStackActivity.java | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/PushNotificationViewModel.java | 12 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/archivedboards/ArchivedBoardsActivity.java | 6 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/archivedboards/ArchivedBoardsViewModel.java | 8 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/board/accesscontrol/AccessControlDialogFragment.java | 6 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/board/accesscontrol/AccessControlViewModel.java | 8 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/board/managelabels/LabelsViewModel.java | 8 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/board/managelabels/ManageLabelsDialogFragment.java | 6 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/card/EditCardViewModel.java | 18 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/card/LabelAutoCompleteAdapter.java | 6 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/card/NewCardViewModel.java | 4 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/card/UserAutoCompleteAdapter.java | 10 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/card/attachments/CardAttachmentsFragment.java | 6 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/card/comments/CardCommentsFragment.java | 6 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/card/comments/CardCommentsMentionProposer.java | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/card/comments/CommentsViewModel.java | 8 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/card/details/CardDetailsFragment.java | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/main/MainActivity.java | 12 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/main/MainViewModel.java | 90 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/preparecreate/PrepareCreateActivity.java | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/preparecreate/PrepareCreateViewModel.java | 6 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/settings/PreferencesViewModel.java | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/settings/SettingsFragment.java | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/sharetarget/ShareTargetActivity.java | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java | 8 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackViewModel.java | 12 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/theme/ThemedDialogFragment.java | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/theme/ThemedPreferenceCategory.java | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/upcomingcards/UpcomingCardsActivity.java | 8 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/upcomingcards/UpcomingCardsViewModel.java | 14 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/viewmodel/BaseViewModel.java | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/viewmodel/SyncViewModel.java | 14 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/filter/FilterWidget.java | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/filter/FilterWidgetFactory.java | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/filter/FilterWidgetViewModel.java | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/singlecard/SingleCardWidget.java | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/singlecard/SingleCardWidgetFactory.java | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/stack/StackWidget.java | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/stack/StackWidgetConfigurationActivity.java | 4 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/stack/StackWidgetConfigurationViewModel.java | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/stack/StackWidgetFactory.java | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/upcoming/UpcomingWidget.java | 4 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/upcoming/UpcomingWidgetFactory.java | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/util/AutoCompleteAdapter.java | 6 | ||||
-rw-r--r-- | app/src/test/java/it/niedermann/nextcloud/deck/database/DataBaseAdapterTest.java (renamed from app/src/test/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DataBaseAdapterTest.java) | 14 | ||||
-rw-r--r-- | app/src/test/java/it/niedermann/nextcloud/deck/database/DeckDatabaseTestUtil.java (renamed from app/src/test/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DeckDatabaseTestUtil.java) | 12 | ||||
-rw-r--r-- | app/src/test/java/it/niedermann/nextcloud/deck/database/dao/AbstractDaoTest.java (renamed from app/src/test/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/AbstractDaoTest.java) | 4 | ||||
-rw-r--r-- | app/src/test/java/it/niedermann/nextcloud/deck/database/dao/AccountDaoTest.java (renamed from app/src/test/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/AccountDaoTest.java) | 4 | ||||
-rw-r--r-- | app/src/test/java/it/niedermann/nextcloud/deck/database/dao/BoardDaoTest.java (renamed from app/src/test/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/BoardDaoTest.java) | 44 | ||||
-rw-r--r-- | app/src/test/java/it/niedermann/nextcloud/deck/database/dao/CardDaoTest.java (renamed from app/src/test/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/CardDaoTest.java) | 4 | ||||
-rw-r--r-- | app/src/test/java/it/niedermann/nextcloud/deck/database/dao/StackDaoTest.java (renamed from app/src/test/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/StackDaoTest.java) | 4 | ||||
-rw-r--r-- | app/src/test/java/it/niedermann/nextcloud/deck/database/dao/UserDaoTest.java (renamed from app/src/test/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/UserDaoTest.java) | 4 | ||||
-rw-r--r-- | app/src/test/java/it/niedermann/nextcloud/deck/remote/api/ResponseCallbackTest.java (renamed from app/src/test/java/it/niedermann/nextcloud/deck/api/ResponseCallbackTest.java) | 2 | ||||
-rw-r--r-- | app/src/test/java/it/niedermann/nextcloud/deck/remote/api/ServerCommunicationErrorHandlerTest.java (renamed from app/src/test/java/it/niedermann/nextcloud/deck/api/ServerCommunicationErrorHandlerTest.java) | 2 | ||||
-rw-r--r-- | app/src/test/java/it/niedermann/nextcloud/deck/repository/SyncRepositoryTest.java (renamed from app/src/test/java/it/niedermann/nextcloud/deck/persistence/sync/SyncManagerTest.java) | 76 | ||||
-rw-r--r-- | app/src/test/java/it/niedermann/nextcloud/deck/ui/card/comments/util/CommentsUtilTest.java (renamed from app/src/test/java/it/niedermann/nextcloud/deck/CommentsUtilTest.java) | 4 | ||||
-rw-r--r-- | app/src/test/java/it/niedermann/nextcloud/deck/util/MimeTypeUtilTest.java (renamed from app/src/test/java/it/niedermann/nextcloud/deck/MimeTypeUtilTest.java) | 4 |
164 files changed, 535 insertions, 586 deletions
diff --git a/app/pfungstadt/release/output-metadata.json b/app/pfungstadt/release/output-metadata.json deleted file mode 100644 index 8638b3466..000000000 --- a/app/pfungstadt/release/output-metadata.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": 3, - "artifactType": { - "type": "APK", - "kind": "Directory" - }, - "applicationId": "it.niedermann.nextcloud.deck.pfungstadt", - "variantName": "pfungstadtRelease", - "elements": [ - { - "type": "SINGLE", - "filters": [], - "attributes": [], - "versionCode": 1020002, - "versionName": "1.20.2", - "outputFile": "app-pfungstadt-release.apk" - } - ], - "elementType": "File" -}
\ No newline at end of file diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/DeckApplication.java b/app/src/main/java/it/niedermann/nextcloud/deck/DeckApplication.java index b7711502c..2b331caec 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/DeckApplication.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/DeckApplication.java @@ -8,7 +8,7 @@ import java.util.concurrent.SynchronousQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; -import it.niedermann.nextcloud.deck.persistence.PreferencesRepository; +import it.niedermann.nextcloud.deck.repository.PreferencesRepository; import it.niedermann.nextcloud.deck.util.CustomAppGlideModule; public class DeckApplication extends Application { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DataBaseAdapter.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/DataBaseAdapter.java index 284abf7d1..387350562 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DataBaseAdapter.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/DataBaseAdapter.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db; +package it.niedermann.nextcloud.deck.database; import static java.util.Collections.emptyList; import static java.util.Collections.singletonList; @@ -46,7 +46,6 @@ import it.niedermann.android.reactivelivedata.ReactiveLiveData; import it.niedermann.android.sharedpreferences.SharedPreferenceLongLiveData; import it.niedermann.nextcloud.deck.DeckLog; import it.niedermann.nextcloud.deck.R; -import it.niedermann.nextcloud.deck.api.IResponseCallback; import it.niedermann.nextcloud.deck.model.AccessControl; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.Attachment; @@ -89,6 +88,7 @@ import it.niedermann.nextcloud.deck.model.widget.filter.FilterWidgetStack; import it.niedermann.nextcloud.deck.model.widget.filter.FilterWidgetUser; import it.niedermann.nextcloud.deck.model.widget.filter.dto.FilterWidgetCard; import it.niedermann.nextcloud.deck.model.widget.singlecard.SingleCardWidgetModel; +import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; import it.niedermann.nextcloud.deck.ui.upcomingcards.UpcomingCardsAdapterItem; import it.niedermann.nextcloud.deck.ui.widget.singlecard.SingleCardWidget; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DeckDatabase.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/DeckDatabase.java index 739e4b9a4..b71abece1 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DeckDatabase.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/DeckDatabase.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db; +package it.niedermann.nextcloud.deck.database; import android.content.Context; @@ -10,7 +10,63 @@ import androidx.room.TypeConverters; import androidx.sqlite.db.SupportSQLiteDatabase; import it.niedermann.nextcloud.deck.DeckLog; -import it.niedermann.nextcloud.deck.api.LastSyncUtil; +import it.niedermann.nextcloud.deck.database.converter.DateTypeConverter; +import it.niedermann.nextcloud.deck.database.converter.EnumConverter; +import it.niedermann.nextcloud.deck.database.dao.AccessControlDao; +import it.niedermann.nextcloud.deck.database.dao.AccountDao; +import it.niedermann.nextcloud.deck.database.dao.ActivityDao; +import it.niedermann.nextcloud.deck.database.dao.AttachmentDao; +import it.niedermann.nextcloud.deck.database.dao.BoardDao; +import it.niedermann.nextcloud.deck.database.dao.CardDao; +import it.niedermann.nextcloud.deck.database.dao.CommentDao; +import it.niedermann.nextcloud.deck.database.dao.JoinBoardWithLabelDao; +import it.niedermann.nextcloud.deck.database.dao.JoinBoardWithPermissionDao; +import it.niedermann.nextcloud.deck.database.dao.JoinBoardWithUserDao; +import it.niedermann.nextcloud.deck.database.dao.JoinCardWithLabelDao; +import it.niedermann.nextcloud.deck.database.dao.JoinCardWithUserDao; +import it.niedermann.nextcloud.deck.database.dao.LabelDao; +import it.niedermann.nextcloud.deck.database.dao.MentionDao; +import it.niedermann.nextcloud.deck.database.dao.PermissionDao; +import it.niedermann.nextcloud.deck.database.dao.StackDao; +import it.niedermann.nextcloud.deck.database.dao.UserDao; +import it.niedermann.nextcloud.deck.database.dao.UserInBoardDao; +import it.niedermann.nextcloud.deck.database.dao.UserInGroupDao; +import it.niedermann.nextcloud.deck.database.dao.projects.JoinCardWithOcsProjectDao; +import it.niedermann.nextcloud.deck.database.dao.projects.OcsProjectDao; +import it.niedermann.nextcloud.deck.database.dao.projects.OcsProjectResourceDao; +import it.niedermann.nextcloud.deck.database.dao.widgets.SingleCardWidgetModelDao; +import it.niedermann.nextcloud.deck.database.dao.widgets.filter.FilterWidgetAccountDao; +import it.niedermann.nextcloud.deck.database.dao.widgets.filter.FilterWidgetBoardDao; +import it.niedermann.nextcloud.deck.database.dao.widgets.filter.FilterWidgetDao; +import it.niedermann.nextcloud.deck.database.dao.widgets.filter.FilterWidgetLabelDao; +import it.niedermann.nextcloud.deck.database.dao.widgets.filter.FilterWidgetProjectDao; +import it.niedermann.nextcloud.deck.database.dao.widgets.filter.FilterWidgetSortDao; +import it.niedermann.nextcloud.deck.database.dao.widgets.filter.FilterWidgetStackDao; +import it.niedermann.nextcloud.deck.database.dao.widgets.filter.FilterWidgetUserDao; +import it.niedermann.nextcloud.deck.database.migration.Migration_10_11; +import it.niedermann.nextcloud.deck.database.migration.Migration_11_12; +import it.niedermann.nextcloud.deck.database.migration.Migration_12_13; +import it.niedermann.nextcloud.deck.database.migration.Migration_13_14; +import it.niedermann.nextcloud.deck.database.migration.Migration_14_15; +import it.niedermann.nextcloud.deck.database.migration.Migration_15_16; +import it.niedermann.nextcloud.deck.database.migration.Migration_16_17; +import it.niedermann.nextcloud.deck.database.migration.Migration_17_18; +import it.niedermann.nextcloud.deck.database.migration.Migration_18_19; +import it.niedermann.nextcloud.deck.database.migration.Migration_19_20; +import it.niedermann.nextcloud.deck.database.migration.Migration_20_21; +import it.niedermann.nextcloud.deck.database.migration.Migration_21_22; +import it.niedermann.nextcloud.deck.database.migration.Migration_22_23; +import it.niedermann.nextcloud.deck.database.migration.Migration_23_24; +import it.niedermann.nextcloud.deck.database.migration.Migration_24_25; +import it.niedermann.nextcloud.deck.database.migration.Migration_25_26; +import it.niedermann.nextcloud.deck.database.migration.Migration_26_27; +import it.niedermann.nextcloud.deck.database.migration.Migration_27_28; +import it.niedermann.nextcloud.deck.database.migration.Migration_28_29; +import it.niedermann.nextcloud.deck.database.migration.Migration_29_30; +import it.niedermann.nextcloud.deck.database.migration.Migration_30_31; +import it.niedermann.nextcloud.deck.database.migration.Migration_31_32; +import it.niedermann.nextcloud.deck.database.migration.Migration_8_9; +import it.niedermann.nextcloud.deck.database.migration.Migration_9_10; import it.niedermann.nextcloud.deck.model.AccessControl; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.Attachment; @@ -42,63 +98,7 @@ import it.niedermann.nextcloud.deck.model.widget.filter.FilterWidgetSort; import it.niedermann.nextcloud.deck.model.widget.filter.FilterWidgetStack; import it.niedermann.nextcloud.deck.model.widget.filter.FilterWidgetUser; import it.niedermann.nextcloud.deck.model.widget.singlecard.SingleCardWidgetModel; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.converter.DateTypeConverter; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.converter.EnumConverter; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.AccessControlDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.AccountDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.ActivityDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.AttachmentDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.BoardDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.CardDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.CommentDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.JoinBoardWithLabelDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.JoinBoardWithPermissionDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.JoinBoardWithUserDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.JoinCardWithLabelDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.JoinCardWithUserDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.LabelDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.MentionDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.PermissionDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.StackDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.UserDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.UserInBoardDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.UserInGroupDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.projects.JoinCardWithOcsProjectDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.projects.OcsProjectDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.projects.OcsProjectResourceDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.widgets.SingleCardWidgetModelDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.widgets.filter.FilterWidgetAccountDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.widgets.filter.FilterWidgetBoardDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.widgets.filter.FilterWidgetDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.widgets.filter.FilterWidgetLabelDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.widgets.filter.FilterWidgetProjectDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.widgets.filter.FilterWidgetSortDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.widgets.filter.FilterWidgetStackDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.widgets.filter.FilterWidgetUserDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration.Migration_10_11; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration.Migration_11_12; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration.Migration_12_13; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration.Migration_13_14; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration.Migration_14_15; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration.Migration_15_16; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration.Migration_16_17; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration.Migration_17_18; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration.Migration_18_19; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration.Migration_19_20; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration.Migration_20_21; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration.Migration_21_22; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration.Migration_22_23; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration.Migration_23_24; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration.Migration_24_25; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration.Migration_25_26; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration.Migration_26_27; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration.Migration_27_28; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration.Migration_28_29; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration.Migration_29_30; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration.Migration_30_31; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration.Migration_31_32; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration.Migration_8_9; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration.Migration_9_10; +import it.niedermann.nextcloud.deck.remote.api.LastSyncUtil; @Database( entities = { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/converter/DateTypeConverter.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/converter/DateTypeConverter.java index a39a4a665..e76420416 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/converter/DateTypeConverter.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/converter/DateTypeConverter.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.converter; +package it.niedermann.nextcloud.deck.database.converter; import androidx.room.TypeConverter; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/converter/EnumConverter.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/converter/EnumConverter.java index 2cafaa8fe..062a67462 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/converter/EnumConverter.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/converter/EnumConverter.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.converter; +package it.niedermann.nextcloud.deck.database.converter; import androidx.annotation.Nullable; import androidx.room.TypeConverter; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/AccessControlDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/AccessControlDao.java index 2ed1e7d59..f5b5dd14d 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/AccessControlDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/AccessControlDao.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; +package it.niedermann.nextcloud.deck.database.dao; import androidx.lifecycle.LiveData; import androidx.room.Dao; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/AccountDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/AccountDao.java index a4d1af44d..d89d4aa9c 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/AccountDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/AccountDao.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; +package it.niedermann.nextcloud.deck.database.dao; import androidx.lifecycle.LiveData; import androidx.room.Dao; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/ActivityDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/ActivityDao.java index ed8e897c4..5d3cb3ecd 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/ActivityDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/ActivityDao.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; +package it.niedermann.nextcloud.deck.database.dao; import androidx.lifecycle.LiveData; import androidx.room.Dao; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/AttachmentDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/AttachmentDao.java index 8f7ee1cba..48faab180 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/AttachmentDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/AttachmentDao.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; +package it.niedermann.nextcloud.deck.database.dao; import androidx.lifecycle.LiveData; import androidx.room.Dao; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/BoardDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/BoardDao.java index 15daf8923..c0bd78884 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/BoardDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/BoardDao.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; +package it.niedermann.nextcloud.deck.database.dao; import androidx.lifecycle.LiveData; import androidx.room.Dao; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/CardDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/CardDao.java index 22a9b322e..fbbb1708b 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/CardDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/CardDao.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; +package it.niedermann.nextcloud.deck.database.dao; import androidx.lifecycle.LiveData; import androidx.room.Dao; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/CommentDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/CommentDao.java index 463cf4617..3b46001cf 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/CommentDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/CommentDao.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; +package it.niedermann.nextcloud.deck.database.dao; import androidx.lifecycle.LiveData; import androidx.room.Dao; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/GenericDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/GenericDao.java index f6a57a67a..268a2e44e 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/GenericDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/GenericDao.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; +package it.niedermann.nextcloud.deck.database.dao; import androidx.room.Delete; import androidx.room.Insert; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinBoardWithLabelDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/JoinBoardWithLabelDao.java index df8812f5b..2592ebd00 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinBoardWithLabelDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/JoinBoardWithLabelDao.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; +package it.niedermann.nextcloud.deck.database.dao; import androidx.room.Dao; import androidx.room.Query; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinBoardWithPermissionDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/JoinBoardWithPermissionDao.java index 28989d190..91019f6bd 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinBoardWithPermissionDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/JoinBoardWithPermissionDao.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; +package it.niedermann.nextcloud.deck.database.dao; import androidx.room.Dao; import androidx.room.Query; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinBoardWithUserDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/JoinBoardWithUserDao.java index b1663e52c..199878746 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinBoardWithUserDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/JoinBoardWithUserDao.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; +package it.niedermann.nextcloud.deck.database.dao; import androidx.room.Dao; import androidx.room.Query; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinCardWithLabelDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/JoinCardWithLabelDao.java index 491633a5d..6614ebb0a 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinCardWithLabelDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/JoinCardWithLabelDao.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; +package it.niedermann.nextcloud.deck.database.dao; import androidx.room.Dao; import androidx.room.Query; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinCardWithUserDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/JoinCardWithUserDao.java index 416d52eed..9ab6f11e1 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/JoinCardWithUserDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/JoinCardWithUserDao.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; +package it.niedermann.nextcloud.deck.database.dao; import androidx.room.Dao; import androidx.room.Query; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/LabelDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/LabelDao.java index 232283c11..a4f55328e 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/LabelDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/LabelDao.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; +package it.niedermann.nextcloud.deck.database.dao; import androidx.lifecycle.LiveData; import androidx.room.Dao; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/MentionDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/MentionDao.java index 0b3987027..01d1f61de 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/MentionDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/MentionDao.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; +package it.niedermann.nextcloud.deck.database.dao; import androidx.room.Dao; import androidx.room.Query; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/PermissionDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/PermissionDao.java index 7b6444ab3..1b2b70e55 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/PermissionDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/PermissionDao.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; +package it.niedermann.nextcloud.deck.database.dao; import androidx.room.Dao; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/StackDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/StackDao.java index 1d2649488..5e3093ad2 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/StackDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/StackDao.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; +package it.niedermann.nextcloud.deck.database.dao; import androidx.lifecycle.LiveData; import androidx.room.Dao; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/UserDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/UserDao.java index 7fad7499e..10f3289ce 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/UserDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/UserDao.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; +package it.niedermann.nextcloud.deck.database.dao; import androidx.lifecycle.LiveData; import androidx.room.Dao; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/UserInBoardDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/UserInBoardDao.java index 7a0476c53..136599bc9 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/UserInBoardDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/UserInBoardDao.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; +package it.niedermann.nextcloud.deck.database.dao; import androidx.room.Dao; import androidx.room.Query; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/UserInGroupDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/UserInGroupDao.java index fb3f5b26e..8287acf3e 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/UserInGroupDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/UserInGroupDao.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; +package it.niedermann.nextcloud.deck.database.dao; import androidx.room.Dao; import androidx.room.Query; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/projects/JoinCardWithOcsProjectDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/projects/JoinCardWithOcsProjectDao.java index 205c84aa0..6f106f12f 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/projects/JoinCardWithOcsProjectDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/projects/JoinCardWithOcsProjectDao.java @@ -1,12 +1,12 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.projects; +package it.niedermann.nextcloud.deck.database.dao.projects; import androidx.room.Dao; import androidx.room.Query; import java.util.List; +import it.niedermann.nextcloud.deck.database.dao.GenericDao; import it.niedermann.nextcloud.deck.model.ocs.projects.JoinCardWithProject; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.GenericDao; @Dao public interface JoinCardWithOcsProjectDao extends GenericDao<JoinCardWithProject> { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/projects/OcsProjectDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/projects/OcsProjectDao.java index fb0e3f836..904528bb6 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/projects/OcsProjectDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/projects/OcsProjectDao.java @@ -1,10 +1,10 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.projects; +package it.niedermann.nextcloud.deck.database.dao.projects; import androidx.room.Dao; import androidx.room.Query; +import it.niedermann.nextcloud.deck.database.dao.GenericDao; import it.niedermann.nextcloud.deck.model.ocs.projects.OcsProject; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.GenericDao; @Dao public interface OcsProjectDao extends GenericDao<OcsProject> { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/projects/OcsProjectResourceDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/projects/OcsProjectResourceDao.java index 8a544667a..2f39d2812 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/projects/OcsProjectResourceDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/projects/OcsProjectResourceDao.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.projects; +package it.niedermann.nextcloud.deck.database.dao.projects; import androidx.lifecycle.LiveData; import androidx.room.Dao; @@ -6,8 +6,8 @@ import androidx.room.Query; import java.util.List; +import it.niedermann.nextcloud.deck.database.dao.GenericDao; import it.niedermann.nextcloud.deck.model.ocs.projects.OcsProjectResource; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.GenericDao; @Dao public interface OcsProjectResourceDao extends GenericDao<OcsProjectResource> { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/widgets/SingleCardWidgetModelDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/widgets/SingleCardWidgetModelDao.java index a26269c30..fe688ff59 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/widgets/SingleCardWidgetModelDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/widgets/SingleCardWidgetModelDao.java @@ -1,12 +1,12 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.widgets; +package it.niedermann.nextcloud.deck.database.dao.widgets; import androidx.room.Dao; import androidx.room.Query; import androidx.room.Transaction; +import it.niedermann.nextcloud.deck.database.dao.GenericDao; import it.niedermann.nextcloud.deck.model.full.FullSingleCardWidgetModel; import it.niedermann.nextcloud.deck.model.widget.singlecard.SingleCardWidgetModel; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.GenericDao; @Dao public interface SingleCardWidgetModelDao extends GenericDao<SingleCardWidgetModel> { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/widgets/StackWidgetModelDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/widgets/StackWidgetModelDao.java index 9b370e32b..c06c1cb5b 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/widgets/StackWidgetModelDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/widgets/StackWidgetModelDao.java @@ -1,11 +1,11 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.widgets; +package it.niedermann.nextcloud.deck.database.dao.widgets; import androidx.room.Dao; import androidx.room.Query; import androidx.room.Transaction; +import it.niedermann.nextcloud.deck.database.dao.GenericDao; import it.niedermann.nextcloud.deck.model.appwidgets.StackWidgetModel; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.GenericDao; @Dao public interface StackWidgetModelDao extends GenericDao<StackWidgetModel> { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/widgets/filter/FilterWidgetAccountDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/widgets/filter/FilterWidgetAccountDao.java index 9133aa4bc..4f14835fb 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/widgets/filter/FilterWidgetAccountDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/widgets/filter/FilterWidgetAccountDao.java @@ -1,12 +1,12 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.widgets.filter; +package it.niedermann.nextcloud.deck.database.dao.widgets.filter; import androidx.room.Dao; import androidx.room.Query; import java.util.List; +import it.niedermann.nextcloud.deck.database.dao.GenericDao; import it.niedermann.nextcloud.deck.model.widget.filter.FilterWidgetAccount; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.GenericDao; @Dao public interface FilterWidgetAccountDao extends GenericDao<FilterWidgetAccount> { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/widgets/filter/FilterWidgetBoardDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/widgets/filter/FilterWidgetBoardDao.java index e71c1b51e..29c877a53 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/widgets/filter/FilterWidgetBoardDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/widgets/filter/FilterWidgetBoardDao.java @@ -1,12 +1,12 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.widgets.filter; +package it.niedermann.nextcloud.deck.database.dao.widgets.filter; import androidx.room.Dao; import androidx.room.Query; import java.util.List; +import it.niedermann.nextcloud.deck.database.dao.GenericDao; import it.niedermann.nextcloud.deck.model.widget.filter.FilterWidgetBoard; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.GenericDao; @Dao public interface FilterWidgetBoardDao extends GenericDao<FilterWidgetBoard> { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/widgets/filter/FilterWidgetDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/widgets/filter/FilterWidgetDao.java index 23dcbea0f..de76edd8a 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/widgets/filter/FilterWidgetDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/widgets/filter/FilterWidgetDao.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.widgets.filter; +package it.niedermann.nextcloud.deck.database.dao.widgets.filter; import androidx.room.Dao; import androidx.room.Query; @@ -6,9 +6,9 @@ import androidx.room.Transaction; import java.util.List; +import it.niedermann.nextcloud.deck.database.dao.GenericDao; import it.niedermann.nextcloud.deck.model.widget.filter.EWidgetType; import it.niedermann.nextcloud.deck.model.widget.filter.FilterWidget; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.GenericDao; @Dao public interface FilterWidgetDao extends GenericDao<FilterWidget> { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/widgets/filter/FilterWidgetLabelDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/widgets/filter/FilterWidgetLabelDao.java index 61ed01545..0afa4dc13 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/widgets/filter/FilterWidgetLabelDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/widgets/filter/FilterWidgetLabelDao.java @@ -1,12 +1,12 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.widgets.filter; +package it.niedermann.nextcloud.deck.database.dao.widgets.filter; import androidx.room.Dao; import androidx.room.Query; import java.util.List; +import it.niedermann.nextcloud.deck.database.dao.GenericDao; import it.niedermann.nextcloud.deck.model.widget.filter.FilterWidgetLabel; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.GenericDao; @Dao public interface FilterWidgetLabelDao extends GenericDao<FilterWidgetLabel> { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/widgets/filter/FilterWidgetProjectDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/widgets/filter/FilterWidgetProjectDao.java index 4e49684e3..5b9be4d91 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/widgets/filter/FilterWidgetProjectDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/widgets/filter/FilterWidgetProjectDao.java @@ -1,12 +1,12 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.widgets.filter; +package it.niedermann.nextcloud.deck.database.dao.widgets.filter; import androidx.room.Dao; import androidx.room.Query; import java.util.List; +import it.niedermann.nextcloud.deck.database.dao.GenericDao; import it.niedermann.nextcloud.deck.model.widget.filter.FilterWidgetProject; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.GenericDao; @Dao public interface FilterWidgetProjectDao extends GenericDao<FilterWidgetProject> { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/widgets/filter/FilterWidgetSortDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/widgets/filter/FilterWidgetSortDao.java index 6aa86a4a3..8ba760f2f 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/widgets/filter/FilterWidgetSortDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/widgets/filter/FilterWidgetSortDao.java @@ -1,12 +1,12 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.widgets.filter; +package it.niedermann.nextcloud.deck.database.dao.widgets.filter; import androidx.room.Dao; import androidx.room.Query; import java.util.List; +import it.niedermann.nextcloud.deck.database.dao.GenericDao; import it.niedermann.nextcloud.deck.model.widget.filter.FilterWidgetSort; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.GenericDao; @Dao public interface FilterWidgetSortDao extends GenericDao<FilterWidgetSort> { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/widgets/filter/FilterWidgetStackDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/widgets/filter/FilterWidgetStackDao.java index fd79a3ba9..b678570db 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/widgets/filter/FilterWidgetStackDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/widgets/filter/FilterWidgetStackDao.java @@ -1,12 +1,12 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.widgets.filter; +package it.niedermann.nextcloud.deck.database.dao.widgets.filter; import androidx.room.Dao; import androidx.room.Query; import java.util.List; +import it.niedermann.nextcloud.deck.database.dao.GenericDao; import it.niedermann.nextcloud.deck.model.widget.filter.FilterWidgetStack; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.GenericDao; @Dao public interface FilterWidgetStackDao extends GenericDao<FilterWidgetStack> { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/widgets/filter/FilterWidgetUserDao.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/widgets/filter/FilterWidgetUserDao.java index 6b44103e9..9a4bb4fcc 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/widgets/filter/FilterWidgetUserDao.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/dao/widgets/filter/FilterWidgetUserDao.java @@ -1,12 +1,12 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.widgets.filter; +package it.niedermann.nextcloud.deck.database.dao.widgets.filter; import androidx.room.Dao; import androidx.room.Query; import java.util.List; +import it.niedermann.nextcloud.deck.database.dao.GenericDao; import it.niedermann.nextcloud.deck.model.widget.filter.FilterWidgetUser; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.GenericDao; @Dao public interface FilterWidgetUserDao extends GenericDao<FilterWidgetUser> { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_10_11.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_10_11.java index e50c8a62e..0286c048b 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_10_11.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_10_11.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration; +package it.niedermann.nextcloud.deck.database.migration; import android.database.Cursor; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_11_12.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_11_12.java index acd646f63..a674e28fb 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_11_12.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_11_12.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration; +package it.niedermann.nextcloud.deck.database.migration; import androidx.room.migration.Migration; import androidx.sqlite.db.SupportSQLiteDatabase; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_12_13.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_12_13.java index 8a85f1651..dd6003a59 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_12_13.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_12_13.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration; +package it.niedermann.nextcloud.deck.database.migration; import androidx.room.migration.Migration; import androidx.sqlite.db.SupportSQLiteDatabase; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_13_14.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_13_14.java index dfb8994e8..eebce5a29 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_13_14.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_13_14.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration; +package it.niedermann.nextcloud.deck.database.migration; import androidx.room.migration.Migration; import androidx.sqlite.db.SupportSQLiteDatabase; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_14_15.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_14_15.java index dc07a12dd..110c69670 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_14_15.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_14_15.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration; +package it.niedermann.nextcloud.deck.database.migration; import android.content.Context; @@ -7,7 +7,7 @@ import androidx.preference.PreferenceManager; import androidx.room.migration.Migration; import androidx.sqlite.db.SupportSQLiteDatabase; -import it.niedermann.nextcloud.deck.persistence.sync.SyncWorker; +import it.niedermann.nextcloud.deck.remote.SyncWorker; /** * @see <a href="https://github.com/stefan-niedermann/nextcloud-deck/issues/570">Reinitializes the background synchronization</a> and diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_15_16.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_15_16.java index 3dd1a3d61..5c9d7bbfa 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_15_16.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_15_16.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration; +package it.niedermann.nextcloud.deck.database.migration; import androidx.room.migration.Migration; import androidx.sqlite.db.SupportSQLiteDatabase; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_16_17.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_16_17.java index f276fe879..11be5ede2 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_16_17.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_16_17.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration; +package it.niedermann.nextcloud.deck.database.migration; import androidx.room.migration.Migration; import androidx.sqlite.db.SupportSQLiteDatabase; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_17_18.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_17_18.java index f42be42af..dcf9a82b8 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_17_18.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_17_18.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration; +package it.niedermann.nextcloud.deck.database.migration; import androidx.room.migration.Migration; import androidx.sqlite.db.SupportSQLiteDatabase; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_18_19.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_18_19.java index 072a11541..3328bf47a 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_18_19.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_18_19.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration; +package it.niedermann.nextcloud.deck.database.migration; import androidx.room.migration.Migration; import androidx.sqlite.db.SupportSQLiteDatabase; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_19_20.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_19_20.java index f6667ec02..f625e2e87 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_19_20.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_19_20.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration; +package it.niedermann.nextcloud.deck.database.migration; import androidx.room.migration.Migration; import androidx.sqlite.db.SupportSQLiteDatabase; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_20_21.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_20_21.java index 36a907b20..4ac1b8f93 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_20_21.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_20_21.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration; +package it.niedermann.nextcloud.deck.database.migration; import android.database.Cursor; import android.graphics.Color; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_21_22.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_21_22.java index 768de3c5d..f993f9173 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_21_22.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_21_22.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration; +package it.niedermann.nextcloud.deck.database.migration; import android.content.Context; import android.content.SharedPreferences; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_22_23.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_22_23.java index 240f14ac1..49ae8084e 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_22_23.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_22_23.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration; +package it.niedermann.nextcloud.deck.database.migration; import androidx.room.migration.Migration; import androidx.sqlite.db.SupportSQLiteDatabase; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_23_24.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_23_24.java index cd0eb094e..068d2dd90 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_23_24.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_23_24.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration; +package it.niedermann.nextcloud.deck.database.migration; import android.content.Context; import android.content.SharedPreferences; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_24_25.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_24_25.java index 6d2bff544..4b9202a69 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_24_25.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_24_25.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration; +package it.niedermann.nextcloud.deck.database.migration; import androidx.room.migration.Migration; import androidx.sqlite.db.SupportSQLiteDatabase; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_25_26.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_25_26.java index 37c648d00..301e52a86 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_25_26.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_25_26.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration; +package it.niedermann.nextcloud.deck.database.migration; import androidx.room.migration.Migration; import androidx.sqlite.db.SupportSQLiteDatabase; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_26_27.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_26_27.java index f8e27ec6b..9a4c51627 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_26_27.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_26_27.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration; +package it.niedermann.nextcloud.deck.database.migration; import android.content.ContentValues; import android.database.Cursor; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_27_28.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_27_28.java index 3f588e4f4..844ec21cc 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_27_28.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_27_28.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration; +package it.niedermann.nextcloud.deck.database.migration; import androidx.room.migration.Migration; import androidx.sqlite.db.SupportSQLiteDatabase; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_28_29.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_28_29.java index 69c163639..10fb01f07 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_28_29.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_28_29.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration; +package it.niedermann.nextcloud.deck.database.migration; import androidx.room.migration.Migration; import androidx.sqlite.db.SupportSQLiteDatabase; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_29_30.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_29_30.java index 665fedeb4..15d46c672 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_29_30.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_29_30.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration; +package it.niedermann.nextcloud.deck.database.migration; import android.content.Context; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_30_31.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_30_31.java index 4426621f0..6e20ab436 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_30_31.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_30_31.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration; +package it.niedermann.nextcloud.deck.database.migration; import androidx.annotation.NonNull; import androidx.room.migration.Migration; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_31_32.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_31_32.java index c26208252..caffb0750 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_31_32.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_31_32.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration; +package it.niedermann.nextcloud.deck.database.migration; import android.content.Context; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_8_9.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_8_9.java index 4840dc050..d4bda9706 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_8_9.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_8_9.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration; +package it.niedermann.nextcloud.deck.database.migration; import androidx.room.migration.Migration; import androidx.sqlite.db.SupportSQLiteDatabase; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_9_10.java b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_9_10.java index 59e9200f4..76d0a80d1 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/migration/Migration_9_10.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/database/migration/Migration_9_10.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.migration; +package it.niedermann.nextcloud.deck.database.migration; import androidx.room.migration.Migration; import androidx.sqlite.db.SupportSQLiteDatabase; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/model/Board.java b/app/src/main/java/it/niedermann/nextcloud/deck/model/Board.java index d27c35545..317557a61 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/model/Board.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/model/Board.java @@ -16,9 +16,9 @@ import java.util.Objects; import it.niedermann.android.util.ColorUtil; import it.niedermann.nextcloud.deck.DeckLog; -import it.niedermann.nextcloud.deck.api.json.JsonColorSerializer; import it.niedermann.nextcloud.deck.model.enums.DBStatus; import it.niedermann.nextcloud.deck.model.interfaces.AbstractRemoteEntity; +import it.niedermann.nextcloud.deck.remote.api.json.JsonColorSerializer; @Entity( inheritSuperIndices = true, diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/model/Label.java b/app/src/main/java/it/niedermann/nextcloud/deck/model/Label.java index 5864823e4..b065f411c 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/model/Label.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/model/Label.java @@ -15,8 +15,8 @@ import java.io.Serializable; import it.niedermann.android.util.ColorUtil; import it.niedermann.nextcloud.deck.DeckLog; -import it.niedermann.nextcloud.deck.api.json.JsonColorSerializer; import it.niedermann.nextcloud.deck.model.interfaces.AbstractRemoteEntity; +import it.niedermann.nextcloud.deck.remote.api.json.JsonColorSerializer; @Entity(inheritSuperIndices = true, indices = {@Index("boardId"), @Index(value = {"boardId", "title"}, unique = true, name = "idx_label_title_unique")}, diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/SyncWorker.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/SyncWorker.java index a454dde1d..4f46efca9 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/SyncWorker.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/SyncWorker.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync; +package it.niedermann.nextcloud.deck.remote; import android.content.Context; import android.content.SharedPreferences; @@ -24,9 +24,10 @@ import java.util.concurrent.atomic.AtomicBoolean; import it.niedermann.nextcloud.deck.DeckLog; import it.niedermann.nextcloud.deck.R; -import it.niedermann.nextcloud.deck.api.ResponseCallback; import it.niedermann.nextcloud.deck.model.Account; -import it.niedermann.nextcloud.deck.persistence.BaseRepository; +import it.niedermann.nextcloud.deck.remote.api.ResponseCallback; +import it.niedermann.nextcloud.deck.repository.BaseRepository; +import it.niedermann.nextcloud.deck.repository.SyncRepository; public class SyncWorker extends Worker { @@ -70,7 +71,7 @@ public class SyncWorker extends Worker { try { for (Account account : accounts) { - new SyncManager(context, account).synchronize(new ResponseCallback<>(account) { + new SyncRepository(context, account).synchronize(new ResponseCallback<>(account) { @Override public void onResponse(Boolean response) { success.set(success.get() && Boolean.TRUE.equals(response)); diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/ServerAdapter.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/adapters/ServerAdapter.java index e5cdbf192..33c781a5d 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/ServerAdapter.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/adapters/ServerAdapter.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters; +package it.niedermann.nextcloud.deck.remote.adapters; import static it.niedermann.nextcloud.deck.util.MimeTypeUtil.TEXT_PLAIN; @@ -17,9 +17,6 @@ import java.io.File; import java.util.List; import it.niedermann.nextcloud.deck.R; -import it.niedermann.nextcloud.deck.api.ApiProvider; -import it.niedermann.nextcloud.deck.api.RequestHelper; -import it.niedermann.nextcloud.deck.api.ResponseCallback; import it.niedermann.nextcloud.deck.exceptions.OfflineException; import it.niedermann.nextcloud.deck.model.AccessControl; import it.niedermann.nextcloud.deck.model.Account; @@ -42,7 +39,10 @@ import it.niedermann.nextcloud.deck.model.ocs.user.OcsUser; import it.niedermann.nextcloud.deck.model.ocs.user.OcsUserList; import it.niedermann.nextcloud.deck.model.propagation.CardUpdate; import it.niedermann.nextcloud.deck.model.propagation.Reorder; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.util.ConnectivityUtil; +import it.niedermann.nextcloud.deck.remote.api.ApiProvider; +import it.niedermann.nextcloud.deck.remote.api.RequestHelper; +import it.niedermann.nextcloud.deck.remote.api.ResponseCallback; +import it.niedermann.nextcloud.deck.remote.helpers.util.ConnectivityUtil; import okhttp3.MediaType; import okhttp3.MultipartBody; import okhttp3.RequestBody; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/api/ApiProvider.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/api/ApiProvider.java index 2118fc068..542cc30ab 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/api/ApiProvider.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/api/ApiProvider.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.api; +package it.niedermann.nextcloud.deck.remote.api; import android.content.Context; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/api/DeckAPI.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/api/DeckAPI.java index 9e1b7d7f4..576ccc33b 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/api/DeckAPI.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/api/DeckAPI.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.api; +package it.niedermann.nextcloud.deck.remote.api; import com.nextcloud.android.sso.api.ParsedResponse; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/api/GsonConfig.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/api/GsonConfig.java index 4e61abfb3..0599d2156 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/api/GsonConfig.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/api/GsonConfig.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.api; +package it.niedermann.nextcloud.deck.remote.api; import com.google.gson.Gson; import com.google.gson.GsonBuilder; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/api/GsonUTCInstantAdapter.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/api/GsonUTCInstantAdapter.java index 5a6b5b0c0..72de0a456 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/api/GsonUTCInstantAdapter.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/api/GsonUTCInstantAdapter.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.api; +package it.niedermann.nextcloud.deck.remote.api; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/api/IResponseCallback.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/api/IResponseCallback.java index 8ca5c5434..51afb2155 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/api/IResponseCallback.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/api/IResponseCallback.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.api; +package it.niedermann.nextcloud.deck.remote.api; import androidx.annotation.CallSuper; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/api/JsonToEntityParser.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/api/JsonToEntityParser.java index 5c0b8da90..04a0b706e 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/api/JsonToEntityParser.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/api/JsonToEntityParser.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.api; +package it.niedermann.nextcloud.deck.remote.api; import static it.niedermann.nextcloud.deck.exceptions.DeckException.Hint.CAPABILITIES_VERSION_NOT_PARSABLE; import static it.niedermann.nextcloud.deck.exceptions.TraceableException.makeTraceableIfFails; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/api/LastSyncUtil.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/api/LastSyncUtil.java index 4c5da96a9..0e58d854c 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/api/LastSyncUtil.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/api/LastSyncUtil.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.api; +package it.niedermann.nextcloud.deck.remote.api; import android.content.Context; import android.content.SharedPreferences; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/api/NextcloudArrayDeserializer.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/api/NextcloudArrayDeserializer.java index 1fdd0f3f3..f10e9777f 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/api/NextcloudArrayDeserializer.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/api/NextcloudArrayDeserializer.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.api; +package it.niedermann.nextcloud.deck.remote.api; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/api/NextcloudDeserializer.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/api/NextcloudDeserializer.java index 0b84036a4..9b40ceb4f 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/api/NextcloudDeserializer.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/api/NextcloudDeserializer.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.api; +package it.niedermann.nextcloud.deck.remote.api; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/api/NextcloudServerAPI.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/api/NextcloudServerAPI.java index 6361f3c5c..6f260f31a 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/api/NextcloudServerAPI.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/api/NextcloudServerAPI.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.api; +package it.niedermann.nextcloud.deck.remote.api; import com.nextcloud.android.sso.api.ParsedResponse; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/api/RequestHelper.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/api/RequestHelper.java index 7cd79ed45..af23b6d2e 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/api/RequestHelper.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/api/RequestHelper.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.api; +package it.niedermann.nextcloud.deck.remote.api; import androidx.annotation.NonNull; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/api/ResponseCallback.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/api/ResponseCallback.java index 113d58332..1167fb7e2 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/api/ResponseCallback.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/api/ResponseCallback.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.api; +package it.niedermann.nextcloud.deck.remote.api; import android.annotation.SuppressLint; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/api/ServerCommunicationErrorHandler.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/api/ServerCommunicationErrorHandler.java index 307aab734..562e9c3cb 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/api/ServerCommunicationErrorHandler.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/api/ServerCommunicationErrorHandler.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.api; +package it.niedermann.nextcloud.deck.remote.api; import androidx.annotation.NonNull; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/api/json/JsonColorSerializer.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/api/json/JsonColorSerializer.java index 5169e7f5e..635344d0b 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/api/json/JsonColorSerializer.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/api/json/JsonColorSerializer.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.api.json; +package it.niedermann.nextcloud.deck.remote.api.json; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/DataPropagationHelper.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/DataPropagationHelper.java index 30829f4e4..ac6bdedc2 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/DataPropagationHelper.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/DataPropagationHelper.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.helpers; +package it.niedermann.nextcloud.deck.remote.helpers; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -6,13 +6,13 @@ import androidx.annotation.Nullable; import java.util.concurrent.ExecutorService; import java.util.function.BiConsumer; -import it.niedermann.nextcloud.deck.api.ResponseCallback; +import it.niedermann.nextcloud.deck.database.DataBaseAdapter; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.enums.DBStatus; import it.niedermann.nextcloud.deck.model.interfaces.IRemoteEntity; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.ServerAdapter; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DataBaseAdapter; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.AbstractSyncDataProvider; +import it.niedermann.nextcloud.deck.remote.adapters.ServerAdapter; +import it.niedermann.nextcloud.deck.remote.api.ResponseCallback; +import it.niedermann.nextcloud.deck.remote.helpers.providers.AbstractSyncDataProvider; public class DataPropagationHelper { @NonNull diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/SyncHelper.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/SyncHelper.java index b58d0bf9c..846c7cf0e 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/SyncHelper.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/SyncHelper.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.helpers; +package it.niedermann.nextcloud.deck.remote.helpers; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -11,14 +11,14 @@ import java.util.List; import java.util.concurrent.CountDownLatch; import it.niedermann.nextcloud.deck.DeckLog; -import it.niedermann.nextcloud.deck.api.ResponseCallback; +import it.niedermann.nextcloud.deck.database.DataBaseAdapter; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.enums.DBStatus; import it.niedermann.nextcloud.deck.model.interfaces.IRemoteEntity; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.ServerAdapter; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DataBaseAdapter; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.AbstractSyncDataProvider; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.IRelationshipProvider; +import it.niedermann.nextcloud.deck.remote.adapters.ServerAdapter; +import it.niedermann.nextcloud.deck.remote.api.ResponseCallback; +import it.niedermann.nextcloud.deck.remote.helpers.providers.AbstractSyncDataProvider; +import it.niedermann.nextcloud.deck.remote.helpers.providers.IRelationshipProvider; public class SyncHelper { @NonNull diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/AbstractSyncDataProvider.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/AbstractSyncDataProvider.java index dc2e4392a..36eba5704 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/AbstractSyncDataProvider.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/AbstractSyncDataProvider.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.helpers.providers; +package it.niedermann.nextcloud.deck.remote.helpers.providers; import androidx.annotation.Nullable; @@ -7,11 +7,11 @@ import java.util.ArrayList; import java.util.List; import it.niedermann.nextcloud.deck.DeckLog; -import it.niedermann.nextcloud.deck.api.ResponseCallback; +import it.niedermann.nextcloud.deck.database.DataBaseAdapter; import it.niedermann.nextcloud.deck.model.interfaces.IRemoteEntity; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.ServerAdapter; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DataBaseAdapter; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.SyncHelper; +import it.niedermann.nextcloud.deck.remote.adapters.ServerAdapter; +import it.niedermann.nextcloud.deck.remote.api.ResponseCallback; +import it.niedermann.nextcloud.deck.remote.helpers.SyncHelper; public abstract class AbstractSyncDataProvider<T extends IRemoteEntity> { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/AccessControlDataProvider.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/AccessControlDataProvider.java index 55cb5514b..cff7dae89 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/AccessControlDataProvider.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/AccessControlDataProvider.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.helpers.providers; +package it.niedermann.nextcloud.deck.remote.helpers.providers; import androidx.annotation.Nullable; @@ -7,16 +7,16 @@ import java.util.List; import java.util.concurrent.CountDownLatch; import it.niedermann.nextcloud.deck.DeckLog; -import it.niedermann.nextcloud.deck.api.ResponseCallback; +import it.niedermann.nextcloud.deck.database.DataBaseAdapter; import it.niedermann.nextcloud.deck.model.AccessControl; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.User; import it.niedermann.nextcloud.deck.model.full.FullBoard; import it.niedermann.nextcloud.deck.model.ocs.user.GroupMemberUIDs; import it.niedermann.nextcloud.deck.model.ocs.user.OcsUser; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.ServerAdapter; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DataBaseAdapter; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.util.AsyncUtil; +import it.niedermann.nextcloud.deck.remote.adapters.ServerAdapter; +import it.niedermann.nextcloud.deck.remote.api.ResponseCallback; +import it.niedermann.nextcloud.deck.remote.helpers.util.AsyncUtil; public class AccessControlDataProvider extends AbstractSyncDataProvider<AccessControl> { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/ActivityDataProvider.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/ActivityDataProvider.java index 5ecfd3f3c..018ac0282 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/ActivityDataProvider.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/ActivityDataProvider.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.helpers.providers; +package it.niedermann.nextcloud.deck.remote.helpers.providers; import androidx.annotation.NonNull; @@ -6,11 +6,11 @@ import java.time.Instant; import java.util.Collections; import java.util.List; -import it.niedermann.nextcloud.deck.api.ResponseCallback; +import it.niedermann.nextcloud.deck.database.DataBaseAdapter; import it.niedermann.nextcloud.deck.model.Card; import it.niedermann.nextcloud.deck.model.ocs.Activity; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.ServerAdapter; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DataBaseAdapter; +import it.niedermann.nextcloud.deck.remote.adapters.ServerAdapter; +import it.niedermann.nextcloud.deck.remote.api.ResponseCallback; public class ActivityDataProvider extends AbstractSyncDataProvider<Activity> { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/AttachmentDataProvider.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/AttachmentDataProvider.java index 41091b4a4..0d8ca5d51 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/AttachmentDataProvider.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/AttachmentDataProvider.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.helpers.providers; +package it.niedermann.nextcloud.deck.remote.helpers.providers; import android.annotation.SuppressLint; import android.net.Uri; @@ -9,13 +9,13 @@ import java.time.Instant; import java.util.List; import it.niedermann.nextcloud.deck.DeckLog; -import it.niedermann.nextcloud.deck.api.ResponseCallback; +import it.niedermann.nextcloud.deck.database.DataBaseAdapter; import it.niedermann.nextcloud.deck.model.Attachment; import it.niedermann.nextcloud.deck.model.Board; import it.niedermann.nextcloud.deck.model.Stack; import it.niedermann.nextcloud.deck.model.full.FullCard; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.ServerAdapter; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DataBaseAdapter; +import it.niedermann.nextcloud.deck.remote.adapters.ServerAdapter; +import it.niedermann.nextcloud.deck.remote.api.ResponseCallback; public class AttachmentDataProvider extends AbstractSyncDataProvider<Attachment> { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/BoardDataProvider.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/BoardDataProvider.java index 613623da5..cd8350535 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/BoardDataProvider.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/BoardDataProvider.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.helpers.providers; +package it.niedermann.nextcloud.deck.remote.helpers.providers; import android.annotation.SuppressLint; import android.util.Pair; @@ -15,17 +15,17 @@ import java.util.List; import java.util.Set; import it.niedermann.nextcloud.deck.DeckLog; -import it.niedermann.nextcloud.deck.api.ResponseCallback; +import it.niedermann.nextcloud.deck.database.DataBaseAdapter; import it.niedermann.nextcloud.deck.model.AccessControl; import it.niedermann.nextcloud.deck.model.Board; import it.niedermann.nextcloud.deck.model.Label; import it.niedermann.nextcloud.deck.model.User; import it.niedermann.nextcloud.deck.model.full.FullBoard; import it.niedermann.nextcloud.deck.model.full.FullStack; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.ServerAdapter; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DataBaseAdapter; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.SyncHelper; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.util.AsyncUtil; +import it.niedermann.nextcloud.deck.remote.adapters.ServerAdapter; +import it.niedermann.nextcloud.deck.remote.api.ResponseCallback; +import it.niedermann.nextcloud.deck.remote.helpers.SyncHelper; +import it.niedermann.nextcloud.deck.remote.helpers.util.AsyncUtil; public class BoardDataProvider extends AbstractSyncDataProvider<FullBoard> { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/CardDataProvider.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/CardDataProvider.java index de186fdde..b8f3e5000 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/CardDataProvider.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/CardDataProvider.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.helpers.providers; +package it.niedermann.nextcloud.deck.remote.helpers.providers; import android.annotation.SuppressLint; @@ -12,7 +12,7 @@ import java.util.List; import java.util.Set; import it.niedermann.nextcloud.deck.DeckLog; -import it.niedermann.nextcloud.deck.api.ResponseCallback; +import it.niedermann.nextcloud.deck.database.DataBaseAdapter; import it.niedermann.nextcloud.deck.exceptions.DeckException; import it.niedermann.nextcloud.deck.exceptions.OfflineException; import it.niedermann.nextcloud.deck.model.Account; @@ -27,9 +27,9 @@ import it.niedermann.nextcloud.deck.model.enums.DBStatus; import it.niedermann.nextcloud.deck.model.full.FullCard; import it.niedermann.nextcloud.deck.model.full.FullStack; import it.niedermann.nextcloud.deck.model.propagation.CardUpdate; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.ServerAdapter; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DataBaseAdapter; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.SyncHelper; +import it.niedermann.nextcloud.deck.remote.adapters.ServerAdapter; +import it.niedermann.nextcloud.deck.remote.api.ResponseCallback; +import it.niedermann.nextcloud.deck.remote.helpers.SyncHelper; public class CardDataProvider extends AbstractSyncDataProvider<FullCard> { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/CardLabelRelationshipProvider.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/CardLabelRelationshipProvider.java index 9a6b14a17..f3157bd58 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/CardLabelRelationshipProvider.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/CardLabelRelationshipProvider.java @@ -1,12 +1,12 @@ -package it.niedermann.nextcloud.deck.persistence.sync.helpers.providers; +package it.niedermann.nextcloud.deck.remote.helpers.providers; import java.util.List; +import it.niedermann.nextcloud.deck.database.DataBaseAdapter; import it.niedermann.nextcloud.deck.model.Card; import it.niedermann.nextcloud.deck.model.JoinCardWithLabel; import it.niedermann.nextcloud.deck.model.Label; import it.niedermann.nextcloud.deck.model.enums.DBStatus; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DataBaseAdapter; public class CardLabelRelationshipProvider implements IRelationshipProvider { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/CardPropagationDataProvider.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/CardPropagationDataProvider.java index 1b3914319..e9028c685 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/CardPropagationDataProvider.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/CardPropagationDataProvider.java @@ -1,16 +1,16 @@ -package it.niedermann.nextcloud.deck.persistence.sync.helpers.providers; +package it.niedermann.nextcloud.deck.remote.helpers.providers; import android.annotation.SuppressLint; -import it.niedermann.nextcloud.deck.api.ResponseCallback; +import it.niedermann.nextcloud.deck.database.DataBaseAdapter; import it.niedermann.nextcloud.deck.model.Board; import it.niedermann.nextcloud.deck.model.Card; import it.niedermann.nextcloud.deck.model.full.FullBoard; import it.niedermann.nextcloud.deck.model.full.FullCard; import it.niedermann.nextcloud.deck.model.full.FullStack; import it.niedermann.nextcloud.deck.model.propagation.CardUpdate; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.ServerAdapter; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DataBaseAdapter; +import it.niedermann.nextcloud.deck.remote.adapters.ServerAdapter; +import it.niedermann.nextcloud.deck.remote.api.ResponseCallback; public class CardPropagationDataProvider extends CardDataProvider { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/CardUserRelationshipProvider.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/CardUserRelationshipProvider.java index 84dc11ee2..ece44c463 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/CardUserRelationshipProvider.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/CardUserRelationshipProvider.java @@ -1,11 +1,11 @@ -package it.niedermann.nextcloud.deck.persistence.sync.helpers.providers; +package it.niedermann.nextcloud.deck.remote.helpers.providers; import java.util.List; +import it.niedermann.nextcloud.deck.database.DataBaseAdapter; import it.niedermann.nextcloud.deck.model.Card; import it.niedermann.nextcloud.deck.model.JoinCardWithUser; import it.niedermann.nextcloud.deck.model.User; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DataBaseAdapter; public class CardUserRelationshipProvider implements IRelationshipProvider { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/DeckCommentsDataProvider.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/DeckCommentsDataProvider.java index 97eca7e67..c366ca1fc 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/DeckCommentsDataProvider.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/DeckCommentsDataProvider.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.helpers.providers; +package it.niedermann.nextcloud.deck.remote.helpers.providers; import android.annotation.SuppressLint; @@ -10,14 +10,13 @@ import java.util.List; import java.util.concurrent.CountDownLatch; import it.niedermann.nextcloud.deck.DeckLog; -import it.niedermann.nextcloud.deck.api.IResponseCallback; -import it.niedermann.nextcloud.deck.api.ResponseCallback; +import it.niedermann.nextcloud.deck.database.DataBaseAdapter; import it.niedermann.nextcloud.deck.model.Card; import it.niedermann.nextcloud.deck.model.ocs.comment.DeckComment; import it.niedermann.nextcloud.deck.model.ocs.comment.Mention; import it.niedermann.nextcloud.deck.model.ocs.comment.OcsComment; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.ServerAdapter; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DataBaseAdapter; +import it.niedermann.nextcloud.deck.remote.adapters.ServerAdapter; +import it.niedermann.nextcloud.deck.remote.api.ResponseCallback; public class DeckCommentsDataProvider extends AbstractSyncDataProvider<OcsComment> { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/IRelationshipProvider.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/IRelationshipProvider.java index 4ebf5af08..58f6c0be2 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/IRelationshipProvider.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/IRelationshipProvider.java @@ -1,6 +1,6 @@ -package it.niedermann.nextcloud.deck.persistence.sync.helpers.providers; +package it.niedermann.nextcloud.deck.remote.helpers.providers; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DataBaseAdapter; +import it.niedermann.nextcloud.deck.database.DataBaseAdapter; public interface IRelationshipProvider { void insertAllNecessary(DataBaseAdapter dataBaseAdapter, long accountId); diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/LabelDataProvider.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/LabelDataProvider.java index 9bfeba8cd..9259391bb 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/LabelDataProvider.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/LabelDataProvider.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.helpers.providers; +package it.niedermann.nextcloud.deck.remote.helpers.providers; import android.annotation.SuppressLint; @@ -6,12 +6,12 @@ import java.time.Instant; import java.util.List; import it.niedermann.nextcloud.deck.DeckLog; -import it.niedermann.nextcloud.deck.api.ResponseCallback; +import it.niedermann.nextcloud.deck.database.DataBaseAdapter; import it.niedermann.nextcloud.deck.exceptions.HandledServerErrors; import it.niedermann.nextcloud.deck.model.Board; import it.niedermann.nextcloud.deck.model.Label; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.ServerAdapter; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DataBaseAdapter; +import it.niedermann.nextcloud.deck.remote.adapters.ServerAdapter; +import it.niedermann.nextcloud.deck.remote.api.ResponseCallback; public class LabelDataProvider extends AbstractSyncDataProvider<Label> { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/OcsProjectDataProvider.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/OcsProjectDataProvider.java index 39d049b10..40d661b8b 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/OcsProjectDataProvider.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/OcsProjectDataProvider.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.helpers.providers; +package it.niedermann.nextcloud.deck.remote.helpers.providers; import java.time.Instant; import java.util.Collections; @@ -6,13 +6,13 @@ import java.util.List; import java.util.stream.Collectors; import it.niedermann.nextcloud.deck.DeckLog; -import it.niedermann.nextcloud.deck.api.ResponseCallback; +import it.niedermann.nextcloud.deck.database.DataBaseAdapter; import it.niedermann.nextcloud.deck.model.Card; import it.niedermann.nextcloud.deck.model.ocs.projects.OcsProject; import it.niedermann.nextcloud.deck.model.ocs.projects.OcsProjectList; import it.niedermann.nextcloud.deck.model.ocs.projects.OcsProjectResource; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.ServerAdapter; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DataBaseAdapter; +import it.niedermann.nextcloud.deck.remote.adapters.ServerAdapter; +import it.niedermann.nextcloud.deck.remote.api.ResponseCallback; public class OcsProjectDataProvider extends AbstractSyncDataProvider<OcsProject> { private final Card card; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/StackDataProvider.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/StackDataProvider.java index 56fbd2506..6645390a5 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/StackDataProvider.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/StackDataProvider.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.helpers.providers; +package it.niedermann.nextcloud.deck.remote.helpers.providers; import java.time.Instant; import java.util.Collections; @@ -6,16 +6,16 @@ import java.util.List; import java.util.Set; import java.util.concurrent.ConcurrentSkipListSet; -import it.niedermann.nextcloud.deck.api.ResponseCallback; +import it.niedermann.nextcloud.deck.database.DataBaseAdapter; import it.niedermann.nextcloud.deck.exceptions.DeckException; import it.niedermann.nextcloud.deck.model.Board; import it.niedermann.nextcloud.deck.model.Card; import it.niedermann.nextcloud.deck.model.full.FullBoard; import it.niedermann.nextcloud.deck.model.full.FullCard; import it.niedermann.nextcloud.deck.model.full.FullStack; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.ServerAdapter; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DataBaseAdapter; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.SyncHelper; +import it.niedermann.nextcloud.deck.remote.adapters.ServerAdapter; +import it.niedermann.nextcloud.deck.remote.api.ResponseCallback; +import it.niedermann.nextcloud.deck.remote.helpers.SyncHelper; public class StackDataProvider extends AbstractSyncDataProvider<FullStack> { private FullBoard board; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/UserDataProvider.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/UserDataProvider.java index d72f24a86..e644b3a8d 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/UserDataProvider.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/UserDataProvider.java @@ -1,15 +1,15 @@ -package it.niedermann.nextcloud.deck.persistence.sync.helpers.providers; +package it.niedermann.nextcloud.deck.remote.helpers.providers; import java.time.Instant; import java.util.List; -import it.niedermann.nextcloud.deck.api.ResponseCallback; +import it.niedermann.nextcloud.deck.database.DataBaseAdapter; import it.niedermann.nextcloud.deck.model.Board; import it.niedermann.nextcloud.deck.model.User; import it.niedermann.nextcloud.deck.model.full.FullCard; import it.niedermann.nextcloud.deck.model.full.FullStack; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.ServerAdapter; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DataBaseAdapter; +import it.niedermann.nextcloud.deck.remote.adapters.ServerAdapter; +import it.niedermann.nextcloud.deck.remote.api.ResponseCallback; public class UserDataProvider extends AbstractSyncDataProvider<User> { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/partial/BoardWithAclDownSyncDataProvider.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/partial/BoardWithAclDownSyncDataProvider.java index 4c39bc7e1..6afa92d2f 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/partial/BoardWithAclDownSyncDataProvider.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/partial/BoardWithAclDownSyncDataProvider.java @@ -1,15 +1,15 @@ -package it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.partial; +package it.niedermann.nextcloud.deck.remote.helpers.providers.partial; import java.util.List; -import it.niedermann.nextcloud.deck.api.ResponseCallback; +import it.niedermann.nextcloud.deck.database.DataBaseAdapter; import it.niedermann.nextcloud.deck.model.AccessControl; import it.niedermann.nextcloud.deck.model.full.FullBoard; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.ServerAdapter; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DataBaseAdapter; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.SyncHelper; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.AccessControlDataProvider; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.BoardDataProvider; +import it.niedermann.nextcloud.deck.remote.adapters.ServerAdapter; +import it.niedermann.nextcloud.deck.remote.api.ResponseCallback; +import it.niedermann.nextcloud.deck.remote.helpers.SyncHelper; +import it.niedermann.nextcloud.deck.remote.helpers.providers.AccessControlDataProvider; +import it.niedermann.nextcloud.deck.remote.helpers.providers.BoardDataProvider; public class BoardWithAclDownSyncDataProvider extends BoardDataProvider { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/partial/BoardWithStacksAndLabelsUpSyncDataProvider.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/partial/BoardWithStacksAndLabelsUpSyncDataProvider.java index 9a674b65e..567af7ece 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/partial/BoardWithStacksAndLabelsUpSyncDataProvider.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/providers/partial/BoardWithStacksAndLabelsUpSyncDataProvider.java @@ -1,15 +1,15 @@ -package it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.partial; +package it.niedermann.nextcloud.deck.remote.helpers.providers.partial; import java.time.Instant; import java.util.Collections; import java.util.List; -import it.niedermann.nextcloud.deck.api.ResponseCallback; +import it.niedermann.nextcloud.deck.database.DataBaseAdapter; import it.niedermann.nextcloud.deck.model.full.FullBoard; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.ServerAdapter; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DataBaseAdapter; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.SyncHelper; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.BoardDataProvider; +import it.niedermann.nextcloud.deck.remote.adapters.ServerAdapter; +import it.niedermann.nextcloud.deck.remote.api.ResponseCallback; +import it.niedermann.nextcloud.deck.remote.helpers.SyncHelper; +import it.niedermann.nextcloud.deck.remote.helpers.providers.BoardDataProvider; public class BoardWithStacksAndLabelsUpSyncDataProvider extends BoardDataProvider { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/util/AsyncUtil.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/util/AsyncUtil.java index d996c6015..9fafca5fa 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/util/AsyncUtil.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/util/AsyncUtil.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.helpers.util; +package it.niedermann.nextcloud.deck.remote.helpers.util; import androidx.annotation.NonNull; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/util/ConnectivityUtil.java b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/util/ConnectivityUtil.java index fdc099753..98b6af22b 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/util/ConnectivityUtil.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/remote/helpers/util/ConnectivityUtil.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.helpers.util; +package it.niedermann.nextcloud.deck.remote.helpers.util; import android.content.Context; import android.content.SharedPreferences; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/BaseRepository.java b/app/src/main/java/it/niedermann/nextcloud/deck/repository/BaseRepository.java index 570b36b13..d978e33e7 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/BaseRepository.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/repository/BaseRepository.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence; +package it.niedermann.nextcloud.deck.repository; import android.content.Context; import android.content.SharedPreferences; @@ -21,9 +21,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import it.niedermann.android.reactivelivedata.ReactiveLiveData; -import it.niedermann.nextcloud.deck.api.IResponseCallback; -import it.niedermann.nextcloud.deck.api.LastSyncUtil; -import it.niedermann.nextcloud.deck.api.ResponseCallback; +import it.niedermann.nextcloud.deck.database.DataBaseAdapter; import it.niedermann.nextcloud.deck.model.AccessControl; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.Board; @@ -43,8 +41,10 @@ import it.niedermann.nextcloud.deck.model.ocs.comment.full.FullDeckComment; import it.niedermann.nextcloud.deck.model.ocs.projects.OcsProjectResource; import it.niedermann.nextcloud.deck.model.widget.filter.FilterWidget; import it.niedermann.nextcloud.deck.model.widget.filter.dto.FilterWidgetCard; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DataBaseAdapter; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.util.ConnectivityUtil; +import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; +import it.niedermann.nextcloud.deck.remote.api.LastSyncUtil; +import it.niedermann.nextcloud.deck.remote.api.ResponseCallback; +import it.niedermann.nextcloud.deck.remote.helpers.util.ConnectivityUtil; import it.niedermann.nextcloud.deck.ui.upcomingcards.UpcomingCardsAdapterItem; /** diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/PreferencesRepository.java b/app/src/main/java/it/niedermann/nextcloud/deck/repository/PreferencesRepository.java index 83101ad3d..683702048 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/PreferencesRepository.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/repository/PreferencesRepository.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence; +package it.niedermann.nextcloud.deck.repository; import static androidx.appcompat.app.AppCompatDelegate.setDefaultNightMode; import static java.util.concurrent.CompletableFuture.supplyAsync; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/SyncManager.java b/app/src/main/java/it/niedermann/nextcloud/deck/repository/SyncRepository.java index 9067809ce..fa425038a 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/SyncManager.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/repository/SyncRepository.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync; +package it.niedermann.nextcloud.deck.repository; import static java.net.HttpURLConnection.HTTP_NOT_MODIFIED; import static java.net.HttpURLConnection.HTTP_UNAVAILABLE; @@ -37,10 +37,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import it.niedermann.nextcloud.deck.DeckLog; -import it.niedermann.nextcloud.deck.api.GsonConfig; -import it.niedermann.nextcloud.deck.api.IResponseCallback; -import it.niedermann.nextcloud.deck.api.LastSyncUtil; -import it.niedermann.nextcloud.deck.api.ResponseCallback; +import it.niedermann.nextcloud.deck.database.DataBaseAdapter; import it.niedermann.nextcloud.deck.exceptions.DeckException; import it.niedermann.nextcloud.deck.exceptions.OfflineException; import it.niedermann.nextcloud.deck.model.AccessControl; @@ -61,31 +58,33 @@ import it.niedermann.nextcloud.deck.model.ocs.Capabilities; import it.niedermann.nextcloud.deck.model.ocs.comment.DeckComment; import it.niedermann.nextcloud.deck.model.ocs.comment.OcsComment; import it.niedermann.nextcloud.deck.model.ocs.user.OcsUserList; -import it.niedermann.nextcloud.deck.persistence.BaseRepository; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.ServerAdapter; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DataBaseAdapter; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.DataPropagationHelper; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.SyncHelper; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.AbstractSyncDataProvider; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.AccessControlDataProvider; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.ActivityDataProvider; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.AttachmentDataProvider; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.BoardDataProvider; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.CardDataProvider; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.CardPropagationDataProvider; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.DeckCommentsDataProvider; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.LabelDataProvider; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.StackDataProvider; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.partial.BoardWithAclDownSyncDataProvider; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.partial.BoardWithStacksAndLabelsUpSyncDataProvider; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.util.ConnectivityUtil; +import it.niedermann.nextcloud.deck.remote.adapters.ServerAdapter; +import it.niedermann.nextcloud.deck.remote.api.GsonConfig; +import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; +import it.niedermann.nextcloud.deck.remote.api.LastSyncUtil; +import it.niedermann.nextcloud.deck.remote.api.ResponseCallback; +import it.niedermann.nextcloud.deck.remote.helpers.DataPropagationHelper; +import it.niedermann.nextcloud.deck.remote.helpers.SyncHelper; +import it.niedermann.nextcloud.deck.remote.helpers.providers.AbstractSyncDataProvider; +import it.niedermann.nextcloud.deck.remote.helpers.providers.AccessControlDataProvider; +import it.niedermann.nextcloud.deck.remote.helpers.providers.ActivityDataProvider; +import it.niedermann.nextcloud.deck.remote.helpers.providers.AttachmentDataProvider; +import it.niedermann.nextcloud.deck.remote.helpers.providers.BoardDataProvider; +import it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider; +import it.niedermann.nextcloud.deck.remote.helpers.providers.CardPropagationDataProvider; +import it.niedermann.nextcloud.deck.remote.helpers.providers.DeckCommentsDataProvider; +import it.niedermann.nextcloud.deck.remote.helpers.providers.LabelDataProvider; +import it.niedermann.nextcloud.deck.remote.helpers.providers.StackDataProvider; +import it.niedermann.nextcloud.deck.remote.helpers.providers.partial.BoardWithAclDownSyncDataProvider; +import it.niedermann.nextcloud.deck.remote.helpers.providers.partial.BoardWithStacksAndLabelsUpSyncDataProvider; +import it.niedermann.nextcloud.deck.remote.helpers.util.ConnectivityUtil; /** * Extends {@link BaseRepository} by synchronization capabilities. * Therefore it always requires an {@link Account} to choose the correct {@link SingleSignOnAccount} for network operations. */ @SuppressWarnings("WeakerAccess") -public class SyncManager extends BaseRepository { +public class SyncRepository extends BaseRepository { @NonNull private final ServerAdapter serverAdapter; @@ -93,20 +92,20 @@ public class SyncManager extends BaseRepository { private final SyncHelper.Factory syncHelperFactory; @AnyThread - public SyncManager(@NonNull Context context, @NonNull Account account) throws NextcloudFilesAppAccountNotFoundException { + public SyncRepository(@NonNull Context context, @NonNull Account account) throws NextcloudFilesAppAccountNotFoundException { this(context, AccountImporter.getSingleSignOnAccount(context, account.getName()), new ConnectivityUtil(context)); } - private SyncManager(@NonNull Context context, - @NonNull SingleSignOnAccount ssoAccount, - @NonNull ConnectivityUtil connectivityUtil) { + private SyncRepository(@NonNull Context context, + @NonNull SingleSignOnAccount ssoAccount, + @NonNull ConnectivityUtil connectivityUtil) { this(context, new ServerAdapter(context.getApplicationContext(), ssoAccount, connectivityUtil), connectivityUtil, SyncHelper::new); } - protected SyncManager(@NonNull Context context, - @NonNull ServerAdapter serverAdapter, - @NonNull ConnectivityUtil connectivityUtil, - @NonNull SyncHelper.Factory syncHelperFactory) { + protected SyncRepository(@NonNull Context context, + @NonNull ServerAdapter serverAdapter, + @NonNull ConnectivityUtil connectivityUtil, + @NonNull SyncHelper.Factory syncHelperFactory) { super(context, connectivityUtil); this.serverAdapter = serverAdapter; this.syncHelperFactory = syncHelperFactory; @@ -114,12 +113,12 @@ public class SyncManager extends BaseRepository { } @VisibleForTesting - protected SyncManager(@NonNull Context context, - @NonNull ServerAdapter serverAdapter, - @NonNull ConnectivityUtil connectivityUtil, - @NonNull SyncHelper.Factory syncHelperFactory, - @NonNull DataBaseAdapter databaseAdapter, - @NonNull ExecutorService executor) { + protected SyncRepository(@NonNull Context context, + @NonNull ServerAdapter serverAdapter, + @NonNull ConnectivityUtil connectivityUtil, + @NonNull SyncHelper.Factory syncHelperFactory, + @NonNull DataBaseAdapter databaseAdapter, + @NonNull ExecutorService executor) { super(context, connectivityUtil, databaseAdapter, executor); this.serverAdapter = serverAdapter; this.syncHelperFactory = syncHelperFactory; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/ImportAccountActivity.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/ImportAccountActivity.java index 7a09e79a4..8702569dd 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/ImportAccountActivity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/ImportAccountActivity.java @@ -32,15 +32,15 @@ import java.util.concurrent.CompletableFuture; import it.niedermann.nextcloud.deck.DeckLog; import it.niedermann.nextcloud.deck.R; -import it.niedermann.nextcloud.deck.api.IResponseCallback; -import it.niedermann.nextcloud.deck.api.ResponseCallback; import it.niedermann.nextcloud.deck.databinding.ActivityImportAccountBinding; import it.niedermann.nextcloud.deck.exceptions.OfflineException; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.full.FullBoard; import it.niedermann.nextcloud.deck.model.ocs.Capabilities; -import it.niedermann.nextcloud.deck.persistence.sync.SyncManager; -import it.niedermann.nextcloud.deck.persistence.sync.SyncWorker; +import it.niedermann.nextcloud.deck.remote.SyncWorker; +import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; +import it.niedermann.nextcloud.deck.remote.api.ResponseCallback; +import it.niedermann.nextcloud.deck.repository.SyncRepository; import it.niedermann.nextcloud.deck.ui.exception.ExceptionDialogFragment; import it.niedermann.nextcloud.deck.ui.exception.ExceptionHandler; @@ -127,7 +127,7 @@ public class ImportAccountActivity extends AppCompatActivity { @Override public void onResponse(Account createdAccount) { try { - final var syncManager = new SyncManager(ImportAccountActivity.this, createdAccount); + final var syncManager = new SyncRepository(ImportAccountActivity.this, createdAccount); syncManager.refreshCapabilities(new ResponseCallback<>(createdAccount) { @Override diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/ImportAccountViewModel.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/ImportAccountViewModel.java index 6734a18f9..c391bf01a 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/ImportAccountViewModel.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/ImportAccountViewModel.java @@ -5,8 +5,8 @@ import android.app.Application; import androidx.annotation.NonNull; import androidx.lifecycle.LiveData; -import it.niedermann.nextcloud.deck.api.IResponseCallback; import it.niedermann.nextcloud.deck.model.Account; +import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; import it.niedermann.nextcloud.deck.ui.viewmodel.BaseViewModel; public class ImportAccountViewModel extends BaseViewModel { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/PickStackActivity.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/PickStackActivity.java index 5b4f33462..c5b92e7d8 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/PickStackActivity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/PickStackActivity.java @@ -12,11 +12,11 @@ import androidx.lifecycle.ViewModelProvider; import it.niedermann.android.reactivelivedata.ReactiveLiveData; import it.niedermann.nextcloud.deck.R; -import it.niedermann.nextcloud.deck.api.IResponseCallback; import it.niedermann.nextcloud.deck.databinding.ActivityPickStackBinding; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.Board; import it.niedermann.nextcloud.deck.model.Stack; +import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; import it.niedermann.nextcloud.deck.ui.exception.ExceptionDialogFragment; import it.niedermann.nextcloud.deck.ui.exception.ExceptionHandler; import it.niedermann.nextcloud.deck.ui.pickstack.PickStackFragment; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/PushNotificationViewModel.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/PushNotificationViewModel.java index 32dc2b9d4..0dd5a82b9 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/PushNotificationViewModel.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/PushNotificationViewModel.java @@ -21,10 +21,10 @@ import java.util.Optional; import it.niedermann.android.reactivelivedata.ReactiveLiveData; import it.niedermann.nextcloud.deck.DeckLog; import it.niedermann.nextcloud.deck.R; -import it.niedermann.nextcloud.deck.api.IResponseCallback; -import it.niedermann.nextcloud.deck.api.ResponseCallback; import it.niedermann.nextcloud.deck.model.Account; -import it.niedermann.nextcloud.deck.persistence.sync.SyncManager; +import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; +import it.niedermann.nextcloud.deck.remote.api.ResponseCallback; +import it.niedermann.nextcloud.deck.repository.SyncRepository; import it.niedermann.nextcloud.deck.ui.viewmodel.BaseViewModel; import it.niedermann.nextcloud.deck.util.ProjectUtil; @@ -57,7 +57,7 @@ public class PushNotificationViewModel extends BaseViewModel { .orElseThrow(() -> new IllegalArgumentException("Account not found")); this.account.postValue(account); - final var syncManager = new SyncManager(getApplication(), account); + final var syncManager = new SyncRepository(getApplication(), account); final var card = syncManager.getCardByRemoteIDDirectly(account.getId(), cardRemoteId); @@ -196,8 +196,8 @@ public class PushNotificationViewModel extends BaseViewModel { return Optional.ofNullable(baseRepository.readAccountDirectly(bundle.getString(KEY_ACCOUNT))); } - private Optional<Long> extractBoardLocalId(@NonNull SyncManager syncManager, long accountId, long cardRemoteId) { - return Optional.ofNullable(syncManager.getBoardLocalIdByAccountAndCardRemoteIdDirectly(accountId, cardRemoteId)); + private Optional<Long> extractBoardLocalId(@NonNull SyncRepository syncRepository, long accountId, long cardRemoteId) { + return Optional.ofNullable(syncRepository.getBoardLocalIdByAccountAndCardRemoteIdDirectly(accountId, cardRemoteId)); } public Optional<String> extractSubject(@Nullable Bundle bundle) { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/archivedboards/ArchivedBoardsActivity.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/archivedboards/ArchivedBoardsActivity.java index ac978adf8..b1253aa46 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/archivedboards/ArchivedBoardsActivity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/archivedboards/ArchivedBoardsActivity.java @@ -13,12 +13,12 @@ import androidx.lifecycle.ViewModelProvider; import it.niedermann.android.reactivelivedata.ReactiveLiveData; import it.niedermann.nextcloud.deck.DeckLog; -import it.niedermann.nextcloud.deck.api.IResponseCallback; import it.niedermann.nextcloud.deck.databinding.ActivityArchivedBinding; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.Board; import it.niedermann.nextcloud.deck.model.full.FullBoard; -import it.niedermann.nextcloud.deck.persistence.sync.SyncManager; +import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; +import it.niedermann.nextcloud.deck.repository.SyncRepository; import it.niedermann.nextcloud.deck.ui.board.ArchiveBoardListener; import it.niedermann.nextcloud.deck.ui.board.DeleteBoardListener; import it.niedermann.nextcloud.deck.ui.board.edit.EditBoardListener; @@ -87,7 +87,7 @@ public class ArchivedBoardsActivity extends AppCompatActivity implements Themed, @Override public void onError(Throwable throwable) { - if (SyncManager.isNoOnVoidError(throwable)) { + if (SyncRepository.isNoOnVoidError(throwable)) { IResponseCallback.super.onError(throwable); showExceptionDialog(throwable, account); } diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/archivedboards/ArchivedBoardsViewModel.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/archivedboards/ArchivedBoardsViewModel.java index c2cfa527a..bcd9345fc 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/archivedboards/ArchivedBoardsViewModel.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/archivedboards/ArchivedBoardsViewModel.java @@ -11,10 +11,10 @@ import java.util.Collections; import java.util.List; import it.niedermann.android.reactivelivedata.ReactiveLiveData; -import it.niedermann.nextcloud.deck.api.IResponseCallback; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.Board; import it.niedermann.nextcloud.deck.model.full.FullBoard; +import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; import it.niedermann.nextcloud.deck.ui.viewmodel.SyncViewModel; public class ArchivedBoardsViewModel extends SyncViewModel { @@ -29,14 +29,14 @@ public class ArchivedBoardsViewModel extends SyncViewModel { } public void updateBoard(@NonNull FullBoard board, @NonNull IResponseCallback<FullBoard> callback) { - syncManager.updateBoard(board, callback); + syncRepository.updateBoard(board, callback); } public void deleteBoard(@NonNull Board board, @NonNull IResponseCallback<Void> callback) { - syncManager.deleteBoard(board, callback); + syncRepository.deleteBoard(board, callback); } public void dearchiveBoard(@NonNull Board board, @NonNull IResponseCallback<FullBoard> callback) { - syncManager.dearchiveBoard(board, callback); + syncRepository.dearchiveBoard(board, callback); } } diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/accesscontrol/AccessControlDialogFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/accesscontrol/AccessControlDialogFragment.java index 72e444fb0..c1b698d4c 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/accesscontrol/AccessControlDialogFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/accesscontrol/AccessControlDialogFragment.java @@ -23,13 +23,13 @@ import java.util.List; import it.niedermann.nextcloud.deck.DeckLog; import it.niedermann.nextcloud.deck.R; -import it.niedermann.nextcloud.deck.api.IResponseCallback; import it.niedermann.nextcloud.deck.databinding.DialogBoardShareBinding; import it.niedermann.nextcloud.deck.model.AccessControl; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.User; import it.niedermann.nextcloud.deck.model.full.FullBoard; -import it.niedermann.nextcloud.deck.persistence.sync.SyncManager; +import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; +import it.niedermann.nextcloud.deck.repository.SyncRepository; import it.niedermann.nextcloud.deck.ui.card.UserAutoCompleteAdapter; import it.niedermann.nextcloud.deck.ui.exception.ExceptionDialogFragment; import it.niedermann.nextcloud.deck.ui.theme.ThemeUtils; @@ -148,7 +148,7 @@ public class AccessControlDialogFragment extends DialogFragment implements Acces @Override public void onError(Throwable throwable) { - if (SyncManager.isNoOnVoidError(throwable)) { + if (SyncRepository.isNoOnVoidError(throwable)) { IResponseCallback.super.onError(throwable); accessControlViewModel.getCurrentBoardColor(ac.getAccountId(), ac.getBoardId()) diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/accesscontrol/AccessControlViewModel.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/accesscontrol/AccessControlViewModel.java index d4ed8ba32..a83ead085 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/accesscontrol/AccessControlViewModel.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/accesscontrol/AccessControlViewModel.java @@ -10,10 +10,10 @@ import com.nextcloud.android.sso.exceptions.NextcloudFilesAppAccountNotFoundExce import java.util.List; import java.util.concurrent.CompletableFuture; -import it.niedermann.nextcloud.deck.api.IResponseCallback; import it.niedermann.nextcloud.deck.model.AccessControl; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.full.FullBoard; +import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; import it.niedermann.nextcloud.deck.ui.viewmodel.SyncViewModel; public class AccessControlViewModel extends SyncViewModel { @@ -35,14 +35,14 @@ public class AccessControlViewModel extends SyncViewModel { } public void createAccessControl(@NonNull Account account, @NonNull AccessControl entity, @NonNull IResponseCallback<AccessControl> callback) { - syncManager.createAccessControl(account.getId(), entity, callback); + syncRepository.createAccessControl(account.getId(), entity, callback); } public void updateAccessControl(@NonNull AccessControl entity, @NonNull IResponseCallback<AccessControl> callback) { - syncManager.updateAccessControl(entity, callback); + syncRepository.updateAccessControl(entity, callback); } public void deleteAccessControl(@NonNull AccessControl entity, @NonNull IResponseCallback<Void> callback) { - syncManager.deleteAccessControl(entity, callback); + syncRepository.deleteAccessControl(entity, callback); } } diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/managelabels/LabelsViewModel.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/managelabels/LabelsViewModel.java index 28fcee9e6..699d7ed8e 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/managelabels/LabelsViewModel.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/managelabels/LabelsViewModel.java @@ -8,10 +8,10 @@ import androidx.lifecycle.LiveData; import com.nextcloud.android.sso.exceptions.NextcloudFilesAppAccountNotFoundException; import it.niedermann.android.reactivelivedata.ReactiveLiveData; -import it.niedermann.nextcloud.deck.api.IResponseCallback; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.Label; import it.niedermann.nextcloud.deck.model.full.FullBoard; +import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; import it.niedermann.nextcloud.deck.ui.viewmodel.SyncViewModel; public class LabelsViewModel extends SyncViewModel { @@ -25,15 +25,15 @@ public class LabelsViewModel extends SyncViewModel { } public void updateLabel(@NonNull Label label, @NonNull IResponseCallback<Label> callback) { - syncManager.updateLabel(label, callback); + syncRepository.updateLabel(label, callback); } public void createLabel(@NonNull Label label, long localBoardId, @NonNull IResponseCallback<Label> callback) { - syncManager.createLabel(account.getId(), label, localBoardId, callback); + syncRepository.createLabel(account.getId(), label, localBoardId, callback); } public void deleteLabel(@NonNull Label label, @NonNull IResponseCallback<Void> callback) { - syncManager.deleteLabel(label, callback); + syncRepository.deleteLabel(label, callback); } public void countCardsWithLabel(long localLabelId, @NonNull IResponseCallback<Integer> callback) { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/managelabels/ManageLabelsDialogFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/managelabels/ManageLabelsDialogFragment.java index 677776fce..6b79d7ad2 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/managelabels/ManageLabelsDialogFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/managelabels/ManageLabelsDialogFragment.java @@ -19,11 +19,11 @@ import java.util.Random; import it.niedermann.nextcloud.deck.DeckLog; import it.niedermann.nextcloud.deck.R; -import it.niedermann.nextcloud.deck.api.IResponseCallback; import it.niedermann.nextcloud.deck.databinding.DialogBoardManageLabelsBinding; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.Label; -import it.niedermann.nextcloud.deck.persistence.sync.SyncManager; +import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; +import it.niedermann.nextcloud.deck.repository.SyncRepository; import it.niedermann.nextcloud.deck.ui.theme.DeleteAlertDialogBuilder; import it.niedermann.nextcloud.deck.ui.theme.ThemeUtils; import it.niedermann.nextcloud.deck.ui.theme.ThemedDialogFragment; @@ -169,7 +169,7 @@ public class ManageLabelsDialogFragment extends ThemedDialogFragment implements @Override public void onError(Throwable throwable) { - if (SyncManager.isNoOnVoidError(throwable)) { + if (SyncRepository.isNoOnVoidError(throwable)) { IResponseCallback.super.onError(throwable); toastFromThread(throwable.getLocalizedMessage()); } diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/EditCardViewModel.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/EditCardViewModel.java index 7a553f80c..2d2eb585f 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/EditCardViewModel.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/EditCardViewModel.java @@ -23,7 +23,6 @@ import it.niedermann.android.reactivelivedata.ReactiveLiveData; import it.niedermann.android.sharedpreferences.SharedPreferenceBooleanLiveData; import it.niedermann.nextcloud.deck.DeckLog; import it.niedermann.nextcloud.deck.R; -import it.niedermann.nextcloud.deck.api.IResponseCallback; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.Attachment; import it.niedermann.nextcloud.deck.model.Board; @@ -33,13 +32,14 @@ import it.niedermann.nextcloud.deck.model.full.FullBoard; import it.niedermann.nextcloud.deck.model.full.FullCard; import it.niedermann.nextcloud.deck.model.full.FullCardWithProjects; import it.niedermann.nextcloud.deck.model.ocs.Activity; -import it.niedermann.nextcloud.deck.persistence.sync.SyncManager; +import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; +import it.niedermann.nextcloud.deck.repository.SyncRepository; import it.niedermann.nextcloud.deck.ui.viewmodel.BaseViewModel; @SuppressWarnings("WeakerAccess") public class EditCardViewModel extends BaseViewModel { - private SyncManager syncManager; + private SyncRepository syncRepository; private Account account; private long boardId; private FullCardWithProjects originalCard; @@ -115,7 +115,7 @@ public class EditCardViewModel extends BaseViewModel { public void setAccount(@NonNull Account account) throws NextcloudFilesAppAccountNotFoundException { this.account = account; - this.syncManager = new SyncManager(getApplication(), account); + this.syncRepository = new SyncRepository(getApplication(), account); hasCommentsAbility = account.getServerDeckVersionAsObject().supportsComments(); } @@ -168,7 +168,7 @@ public class EditCardViewModel extends BaseViewModel { } public void createLabel(long accountId, Label label, long localBoardId, @NonNull IResponseCallback<Label> callback) { - syncManager.createLabel(accountId, label, localBoardId, callback); + syncRepository.createLabel(accountId, label, localBoardId, callback); } public LiveData<FullCardWithProjects> getFullCardWithProjectsByLocalId(long accountId, long cardLocalId) { @@ -179,19 +179,19 @@ public class EditCardViewModel extends BaseViewModel { * Saves the current {@link #fullCard}. If it is a new card, it will be created, otherwise it will be updated. */ public void saveCard(@NonNull IResponseCallback<FullCard> callback) { - syncManager.updateCard(getFullCard(), callback); + syncRepository.updateCard(getFullCard(), callback); } public LiveData<List<Activity>> syncActivitiesForCard(@NonNull Card card) { - return syncManager.syncActivitiesForCard(card); + return syncRepository.syncActivitiesForCard(card); } public void addAttachmentToCard(long accountId, long localCardId, @NonNull String mimeType, @NonNull File file, @NonNull IResponseCallback<Attachment> callback) { - syncManager.addAttachmentToCard(accountId, localCardId, mimeType, file, callback); + syncRepository.addAttachmentToCard(accountId, localCardId, mimeType, file, callback); } public void deleteAttachmentOfCard(long accountId, long localCardId, long localAttachmentId, @NonNull IResponseCallback<Void> callback) { - syncManager.deleteAttachmentOfCard(accountId, localCardId, localAttachmentId, callback); + syncRepository.deleteAttachmentOfCard(accountId, localCardId, localAttachmentId, callback); } public LiveData<Card> getCardByRemoteID(long accountId, long remoteId) { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/LabelAutoCompleteAdapter.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/LabelAutoCompleteAdapter.java index decca0630..0af489781 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/LabelAutoCompleteAdapter.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/LabelAutoCompleteAdapter.java @@ -44,14 +44,14 @@ public class LabelAutoCompleteAdapter extends AutoCompleteAdapter<Label> { final String[] colors = activity.getResources().getStringArray(R.array.board_default_colors); createLabelColor = Color.parseColor(colors[new Random().nextInt(colors.length)]); - canManage$ = new ReactiveLiveData<>(syncManager.getFullBoardById(account.getId(), boardId)) + canManage$ = new ReactiveLiveData<>(syncRepository.getFullBoardById(account.getId(), boardId)) .map(FullBoard::getBoard) .map(Board::isPermissionManage); constraint$ .flatMap(constraint -> TextUtils.isEmpty(constraint) - ? syncManager.findProposalsForLabelsToAssign(account.getId(), boardId, cardId) - : syncManager.searchNotYetAssignedLabelsByTitle(account, boardId, cardId, constraint)) + ? syncRepository.findProposalsForLabelsToAssign(account.getId(), boardId, cardId) + : syncRepository.searchNotYetAssignedLabelsByTitle(account, boardId, cardId, constraint)) .map(this::filterExcluded) .flatMap(this::addCreateLabelIfNeeded) .distinctUntilChanged() diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/NewCardViewModel.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/NewCardViewModel.java index 517c2267c..61de92a07 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/NewCardViewModel.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/NewCardViewModel.java @@ -14,11 +14,11 @@ import com.nextcloud.android.sso.exceptions.NextcloudFilesAppAccountNotFoundExce import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionStage; -import it.niedermann.nextcloud.deck.api.IResponseCallback; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.Card; import it.niedermann.nextcloud.deck.model.full.FullCard; import it.niedermann.nextcloud.deck.model.ocs.Version; +import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; import it.niedermann.nextcloud.deck.ui.viewmodel.SyncViewModel; public class NewCardViewModel extends SyncViewModel { @@ -35,7 +35,7 @@ public class NewCardViewModel extends SyncViewModel { final var result = new CompletableFuture<FullCard>(); supplyAsync(() -> baseRepository.readAccountDirectly(accountId)) - .thenAcceptAsync(account -> syncManager.createFullCard(accountId, boardId, stackId, createFullCard(account.getServerDeckVersionAsObject(), content), + .thenAcceptAsync(account -> syncRepository.createFullCard(accountId, boardId, stackId, createFullCard(account.getServerDeckVersionAsObject(), content), new IResponseCallback<>() { @Override public void onResponse(FullCard response) { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/UserAutoCompleteAdapter.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/UserAutoCompleteAdapter.java index 34a1bc177..11012bb75 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/UserAutoCompleteAdapter.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/UserAutoCompleteAdapter.java @@ -50,19 +50,19 @@ public class UserAutoCompleteAdapter extends AutoCompleteAdapter<User> { .debounce(300) .observe(activity, constraint -> { DeckLog.verbose("Triggering remote search"); - syncManager.triggerUserSearch(account, constraint); + syncRepository.triggerUserSearch(account, constraint); }); if (cardId == NO_CARD) { // No card means this adapter is used for searching users for Board ACL results$ = constraint$.flatMap(constraint -> TextUtils.isEmpty(constraint) - ? syncManager.findProposalsForUsersToAssignForACL(account.getId(), boardId, activity.getResources().getInteger(R.integer.max_users_suggested)) - : syncManager.searchUserByUidOrDisplayNameForACL(account.getId(), boardId, constraint)); + ? syncRepository.findProposalsForUsersToAssignForACL(account.getId(), boardId, activity.getResources().getInteger(R.integer.max_users_suggested)) + : syncRepository.searchUserByUidOrDisplayNameForACL(account.getId(), boardId, constraint)); } else { // Card is given, so we are searching for users to assign to a card (limited to users whom the board is shared with) results$ = constraint$.flatMap(constraint -> TextUtils.isEmpty(constraint) - ? syncManager.findProposalsForUsersToAssignForCards(account.getId(), boardId, cardId, activity.getResources().getInteger(R.integer.max_users_suggested)) - : syncManager.searchUserByUidOrDisplayNameForCards(account.getId(), boardId, cardId, constraint)); + ? syncRepository.findProposalsForUsersToAssignForCards(account.getId(), boardId, cardId, activity.getResources().getInteger(R.integer.max_users_suggested)) + : syncRepository.searchUserByUidOrDisplayNameForCards(account.getId(), boardId, cardId, constraint)); } results$ diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/attachments/CardAttachmentsFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/attachments/CardAttachmentsFragment.java index 61dc3e8ee..96292ecff 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/attachments/CardAttachmentsFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/attachments/CardAttachmentsFragment.java @@ -64,13 +64,13 @@ import it.niedermann.android.reactivelivedata.ReactiveLiveData; import it.niedermann.android.util.DimensionUtil; import it.niedermann.nextcloud.deck.DeckLog; import it.niedermann.nextcloud.deck.R; -import it.niedermann.nextcloud.deck.api.IResponseCallback; import it.niedermann.nextcloud.deck.databinding.FragmentCardEditTabAttachmentsBinding; import it.niedermann.nextcloud.deck.exceptions.UploadAttachmentFailedException; import it.niedermann.nextcloud.deck.model.Attachment; import it.niedermann.nextcloud.deck.model.Card; import it.niedermann.nextcloud.deck.model.enums.DBStatus; -import it.niedermann.nextcloud.deck.persistence.sync.SyncManager; +import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; +import it.niedermann.nextcloud.deck.repository.SyncRepository; import it.niedermann.nextcloud.deck.ui.card.EditCardViewModel; import it.niedermann.nextcloud.deck.ui.card.attachments.picker.AbstractPickerAdapter; import it.niedermann.nextcloud.deck.ui.card.attachments.picker.ContactAdapter; @@ -500,7 +500,7 @@ public class CardAttachmentsFragment extends Fragment implements AttachmentDelet @Override public void onError(Throwable throwable) { - if (SyncManager.isNoOnVoidError(throwable)) { + if (SyncRepository.isNoOnVoidError(throwable)) { IResponseCallback.super.onError(throwable); requireActivity().runOnUiThread(() -> ExceptionDialogFragment.newInstance(throwable, editViewModel.getAccount()).show(getChildFragmentManager(), ExceptionDialogFragment.class.getSimpleName())); } diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/comments/CardCommentsFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/comments/CardCommentsFragment.java index 9a7822bb2..254765a0a 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/comments/CardCommentsFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/comments/CardCommentsFragment.java @@ -26,12 +26,12 @@ import java.time.Instant; import it.niedermann.android.util.DimensionUtil; import it.niedermann.nextcloud.deck.DeckLog; import it.niedermann.nextcloud.deck.R; -import it.niedermann.nextcloud.deck.api.IResponseCallback; import it.niedermann.nextcloud.deck.databinding.FragmentCardEditTabCommentsBinding; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.ocs.comment.DeckComment; import it.niedermann.nextcloud.deck.model.ocs.comment.full.FullDeckComment; -import it.niedermann.nextcloud.deck.persistence.sync.SyncManager; +import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; +import it.niedermann.nextcloud.deck.repository.SyncRepository; import it.niedermann.nextcloud.deck.ui.card.EditActivity; import it.niedermann.nextcloud.deck.ui.card.EditCardViewModel; import it.niedermann.nextcloud.deck.ui.exception.ExceptionDialogFragment; @@ -177,7 +177,7 @@ public class CardCommentsFragment extends Fragment implements CommentEditedListe @Override public void onError(Throwable throwable) { - if (SyncManager.isNoOnVoidError(throwable)) { + if (SyncRepository.isNoOnVoidError(throwable)) { IResponseCallback.super.onError(throwable); requireActivity().runOnUiThread(() -> ExceptionDialogFragment.newInstance(throwable, editCardViewModel.getAccount()).show(getChildFragmentManager(), ExceptionDialogFragment.class.getSimpleName())); } diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/comments/CardCommentsMentionProposer.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/comments/CardCommentsMentionProposer.java index 5b5dead49..c41420147 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/comments/CardCommentsMentionProposer.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/comments/CardCommentsMentionProposer.java @@ -23,7 +23,7 @@ import it.niedermann.android.util.DimensionUtil; import it.niedermann.nextcloud.deck.R; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.User; -import it.niedermann.nextcloud.deck.persistence.BaseRepository; +import it.niedermann.nextcloud.deck.repository.BaseRepository; import it.niedermann.nextcloud.deck.ui.card.comments.util.CommentsUtil; public class CardCommentsMentionProposer implements TextWatcher { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/comments/CommentsViewModel.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/comments/CommentsViewModel.java index 5918c9b41..79b0043fe 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/comments/CommentsViewModel.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/comments/CommentsViewModel.java @@ -12,10 +12,10 @@ import com.nextcloud.android.sso.exceptions.NextcloudFilesAppAccountNotFoundExce import java.util.List; -import it.niedermann.nextcloud.deck.api.IResponseCallback; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.ocs.comment.DeckComment; import it.niedermann.nextcloud.deck.model.ocs.comment.full.FullDeckComment; +import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; import it.niedermann.nextcloud.deck.ui.viewmodel.SyncViewModel; @SuppressWarnings("WeakerAccess") @@ -40,14 +40,14 @@ public class CommentsViewModel extends SyncViewModel { } public void addCommentToCard(long accountId, long cardId, @NonNull DeckComment comment) { - syncManager.addCommentToCard(accountId, cardId, comment); + syncRepository.addCommentToCard(accountId, cardId, comment); } public void updateComment(long accountId, long localCardId, long localCommentId, String comment) { - syncManager.updateComment(accountId, localCardId, localCommentId, comment); + syncRepository.updateComment(accountId, localCardId, localCommentId, comment); } public void deleteComment(long accountId, long localCardId, long localCommentId, @NonNull IResponseCallback<Void> callback) { - syncManager.deleteComment(accountId, localCardId, localCommentId, callback); + syncRepository.deleteComment(accountId, localCardId, localCommentId, callback); } } diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/details/CardDetailsFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/details/CardDetailsFragment.java index 04874cee9..49a0b33ae 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/details/CardDetailsFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/details/CardDetailsFragment.java @@ -46,12 +46,12 @@ import it.niedermann.android.util.ColorUtil; import it.niedermann.android.util.DimensionUtil; import it.niedermann.nextcloud.deck.DeckLog; import it.niedermann.nextcloud.deck.R; -import it.niedermann.nextcloud.deck.api.IResponseCallback; import it.niedermann.nextcloud.deck.databinding.FragmentCardEditTabDetailsBinding; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.Label; import it.niedermann.nextcloud.deck.model.User; import it.niedermann.nextcloud.deck.model.full.FullCard; +import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; import it.niedermann.nextcloud.deck.ui.card.EditCardViewModel; import it.niedermann.nextcloud.deck.ui.card.LabelAutoCompleteAdapter; import it.niedermann.nextcloud.deck.ui.card.UserAutoCompleteAdapter; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/main/MainActivity.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/main/MainActivity.java index 282b07dac..b6c3d8a73 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/main/MainActivity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/main/MainActivity.java @@ -59,8 +59,6 @@ import it.niedermann.android.tablayouthelper.TabTitleGenerator; import it.niedermann.android.util.ColorUtil; import it.niedermann.nextcloud.deck.DeckLog; import it.niedermann.nextcloud.deck.R; -import it.niedermann.nextcloud.deck.api.IResponseCallback; -import it.niedermann.nextcloud.deck.api.ResponseCallback; import it.niedermann.nextcloud.deck.databinding.ActivityMainBinding; import it.niedermann.nextcloud.deck.databinding.NavHeaderMainBinding; import it.niedermann.nextcloud.deck.exceptions.OfflineException; @@ -73,7 +71,9 @@ import it.niedermann.nextcloud.deck.model.full.FullStack; import it.niedermann.nextcloud.deck.model.internal.FilterInformation; import it.niedermann.nextcloud.deck.model.ocs.Capabilities; import it.niedermann.nextcloud.deck.model.ocs.Version; -import it.niedermann.nextcloud.deck.persistence.sync.SyncManager; +import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; +import it.niedermann.nextcloud.deck.remote.api.ResponseCallback; +import it.niedermann.nextcloud.deck.repository.SyncRepository; import it.niedermann.nextcloud.deck.ui.ImportAccountActivity; import it.niedermann.nextcloud.deck.ui.StackChangeCallback; import it.niedermann.nextcloud.deck.ui.accountswitcher.AccountSwitcherDialog; @@ -620,7 +620,7 @@ public class MainActivity extends AppCompatActivity implements DeleteStackListen @Override public void onError(Throwable throwable) { - if (SyncManager.isNoOnVoidError(throwable)) { + if (SyncRepository.isNoOnVoidError(throwable)) { IResponseCallback.super.onError(throwable); showExceptionDialog(throwable, stack.getAccountId()); } @@ -810,7 +810,7 @@ public class MainActivity extends AppCompatActivity implements DeleteStackListen @Override public void onError(Throwable throwable) { - if (SyncManager.isNoOnVoidError(throwable)) { + if (SyncRepository.isNoOnVoidError(throwable)) { IResponseCallback.super.onError(throwable); showExceptionDialog(throwable, accountId); } @@ -828,7 +828,7 @@ public class MainActivity extends AppCompatActivity implements DeleteStackListen @Override public void onError(Throwable throwable) { - if (SyncManager.isNoOnVoidError(throwable)) { + if (SyncRepository.isNoOnVoidError(throwable)) { IResponseCallback.super.onError(throwable); showExceptionDialog(throwable, board.getAccountId()); } diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/main/MainViewModel.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/main/MainViewModel.java index 38edb933d..25e43fe4c 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/main/MainViewModel.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/main/MainViewModel.java @@ -20,8 +20,6 @@ import java.util.concurrent.CompletableFuture; import it.niedermann.android.reactivelivedata.ReactiveLiveData; import it.niedermann.nextcloud.deck.DeckLog; -import it.niedermann.nextcloud.deck.api.IResponseCallback; -import it.niedermann.nextcloud.deck.api.ResponseCallback; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.Attachment; import it.niedermann.nextcloud.deck.model.Board; @@ -32,14 +30,16 @@ import it.niedermann.nextcloud.deck.model.full.FullStack; import it.niedermann.nextcloud.deck.model.internal.FilterInformation; import it.niedermann.nextcloud.deck.model.ocs.Capabilities; import it.niedermann.nextcloud.deck.model.ocs.comment.DeckComment; -import it.niedermann.nextcloud.deck.persistence.sync.SyncManager; +import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; +import it.niedermann.nextcloud.deck.remote.api.ResponseCallback; +import it.niedermann.nextcloud.deck.repository.SyncRepository; import it.niedermann.nextcloud.deck.ui.viewmodel.BaseViewModel; @SuppressWarnings("WeakerAccess") public class MainViewModel extends BaseViewModel { @Nullable - private SyncManager syncManager; + private SyncRepository syncRepository; public MainViewModel(@NonNull Application application) { super(application); @@ -47,9 +47,9 @@ public class MainViewModel extends BaseViewModel { public void recreateSyncManager(@NonNull Account account) throws NextcloudFilesAppAccountNotFoundException { try { - this.syncManager = new SyncManager(getApplication(), account); + this.syncRepository = new SyncRepository(getApplication(), account); } catch (NextcloudFilesAppAccountNotFoundException e) { - this.syncManager = null; + this.syncRepository = null; throw e; } } @@ -59,18 +59,18 @@ public class MainViewModel extends BaseViewModel { } public void synchronize(@NonNull Account account, @NonNull IResponseCallback<Boolean> callback) { - if (syncManager == null) { + if (syncRepository == null) { callback.onError(getInvalidSyncManagerException()); } else { - syncManager.synchronize(ResponseCallback.from(account, callback)); + syncRepository.synchronize(ResponseCallback.from(account, callback)); } } public void refreshCapabilities(@NonNull ResponseCallback<Capabilities> callback) { - if (syncManager == null) { + if (syncRepository == null) { callback.onError(getInvalidSyncManagerException()); } else { - syncManager.refreshCapabilities(callback); + syncRepository.refreshCapabilities(callback); } } @@ -91,42 +91,42 @@ public class MainViewModel extends BaseViewModel { } public void createBoard(@NonNull Account account, @NonNull Board board, @NonNull IResponseCallback<FullBoard> callback) { - if (syncManager == null) { + if (syncRepository == null) { callback.onError(getInvalidSyncManagerException()); } else { - syncManager.createBoard(account, board, callback); + syncRepository.createBoard(account, board, callback); } } public void updateBoard(@NonNull FullBoard board, @NonNull IResponseCallback<FullBoard> callback) { - if (syncManager == null) { + if (syncRepository == null) { callback.onError(getInvalidSyncManagerException()); } else { - syncManager.updateBoard(board, callback); + syncRepository.updateBoard(board, callback); } } public void archiveBoard(@NonNull Board board, @NonNull IResponseCallback<FullBoard> callback) { - if (syncManager == null) { + if (syncRepository == null) { callback.onError(getInvalidSyncManagerException()); } else { - syncManager.archiveBoard(board, callback); + syncRepository.archiveBoard(board, callback); } } public void cloneBoard(long originAccountId, long originBoardLocalId, long targetAccountId, @ColorInt int targetBoardColor, boolean cloneCards, @NonNull IResponseCallback<FullBoard> callback) { - if (syncManager == null) { + if (syncRepository == null) { callback.onError(getInvalidSyncManagerException()); } else { - syncManager.cloneBoard(originAccountId, originBoardLocalId, targetAccountId, targetBoardColor, cloneCards, callback); + syncRepository.cloneBoard(originAccountId, originBoardLocalId, targetAccountId, targetBoardColor, cloneCards, callback); } } public void deleteBoard(@NonNull Board board, @NonNull IResponseCallback<Void> callback) { - if (syncManager == null) { + if (syncRepository == null) { callback.onError(getInvalidSyncManagerException()); } else { - syncManager.deleteBoard(board, callback); + syncRepository.deleteBoard(board, callback); } } @@ -135,98 +135,98 @@ public class MainViewModel extends BaseViewModel { } public void createStack(long accountId, long boardId, @NonNull String title, @NonNull IResponseCallback<FullStack> callback) { - if (syncManager == null) { + if (syncRepository == null) { callback.onError(getInvalidSyncManagerException()); } else { - syncManager.createStack(accountId, boardId, title, callback); + syncRepository.createStack(accountId, boardId, title, callback); } } public LiveData<FullStack> getStack(long accountId, long localStackId) { - if (syncManager == null) { + if (syncRepository == null) { return new MutableLiveData<>(); } - return syncManager.getStack(accountId, localStackId); + return syncRepository.getStack(accountId, localStackId); } public void reorderStack(long accountId, long boardId, long stackLocalId, boolean moveToRight) { - if (syncManager == null) { + if (syncRepository == null) { DeckLog.logError(getInvalidSyncManagerException()); } else { - syncManager.reorderStack(accountId, boardId, stackLocalId, moveToRight); + syncRepository.reorderStack(accountId, boardId, stackLocalId, moveToRight); } } public void updateStackTitle(long localStackId, @NonNull String newTitle, @NonNull IResponseCallback<FullStack> callback) { - if (syncManager == null) { + if (syncRepository == null) { callback.onError(getInvalidSyncManagerException()); } else { - syncManager.updateStackTitle(localStackId, newTitle, callback); + syncRepository.updateStackTitle(localStackId, newTitle, callback); } } public void deleteStack(long accountId, long boardId, long stackLocalId, @NonNull IResponseCallback<Void> callback) { - if (syncManager == null) { + if (syncRepository == null) { callback.onError(getInvalidSyncManagerException()); } else { - syncManager.deleteStack(accountId, boardId, stackLocalId, callback); + syncRepository.deleteStack(accountId, boardId, stackLocalId, callback); } } public void reorder(@NonNull FullCard movedCard, long newStackId, int newIndex) { - if (syncManager == null) { + if (syncRepository == null) { DeckLog.logError(getInvalidSyncManagerException()); } else { - syncManager.reorder(movedCard.getAccountId(), movedCard, newStackId, newIndex); + syncRepository.reorder(movedCard.getAccountId(), movedCard, newStackId, newIndex); } } public void countCardsInStack(long accountId, long stackId, @NonNull IResponseCallback<Integer> callback) { - if (syncManager == null) { + if (syncRepository == null) { callback.onError(getInvalidSyncManagerException()); } else { - syncManager.countCardsInStackDirectly(accountId, stackId, callback); + syncRepository.countCardsInStackDirectly(accountId, stackId, callback); } } public void archiveCardsInStack(long accountId, long stackId, @NonNull FilterInformation filterInformation, @NonNull IResponseCallback<Void> callback) { - if (syncManager == null) { + if (syncRepository == null) { callback.onError(getInvalidSyncManagerException()); } else { - syncManager.archiveCardsInStack(accountId, stackId, filterInformation, callback); + syncRepository.archiveCardsInStack(accountId, stackId, filterInformation, callback); } } public void updateCard(@NonNull FullCard fullCard, @NonNull IResponseCallback<FullCard> callback) { - if (syncManager == null) { + if (syncRepository == null) { callback.onError(getInvalidSyncManagerException()); } else { - syncManager.updateCard(fullCard, callback); + syncRepository.updateCard(fullCard, callback); } } public void addCommentToCard(long accountId, String message, long cardId) { - if (syncManager == null) { + if (syncRepository == null) { DeckLog.logError(getInvalidSyncManagerException()); } else { - supplyAsync(() -> syncManager.readAccountDirectly(accountId)) - .thenAcceptAsync(account -> syncManager.addCommentToCard(account.getId(), cardId, new DeckComment(message, account.getUserName(), Instant.now()))); + supplyAsync(() -> syncRepository.readAccountDirectly(accountId)) + .thenAcceptAsync(account -> syncRepository.addCommentToCard(account.getId(), cardId, new DeckComment(message, account.getUserName(), Instant.now()))); } } public void addAttachmentToCard(long accountId, long localCardId, @NonNull String mimeType, @NonNull File file, @NonNull IResponseCallback<Attachment> callback) { - if (syncManager == null) { + if (syncRepository == null) { callback.onError(getInvalidSyncManagerException()); } else { - syncManager.addAttachmentToCard(accountId, localCardId, mimeType, file, callback); + syncRepository.addAttachmentToCard(accountId, localCardId, mimeType, file, callback); } } public void addOrUpdateSingleCardWidget(int widgetId, long accountId, long boardId, long localCardId) { - if (syncManager == null) { + if (syncRepository == null) { DeckLog.logError(getInvalidSyncManagerException()); } else { - syncManager.addOrUpdateSingleCardWidget(widgetId, accountId, boardId, localCardId); + syncRepository.addOrUpdateSingleCardWidget(widgetId, accountId, boardId, localCardId); } } diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/preparecreate/PrepareCreateActivity.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/preparecreate/PrepareCreateActivity.java index c27a05006..d34c8ae72 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/preparecreate/PrepareCreateActivity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/preparecreate/PrepareCreateActivity.java @@ -11,9 +11,9 @@ import androidx.annotation.Nullable; import androidx.lifecycle.ViewModelProvider; import it.niedermann.nextcloud.deck.R; -import it.niedermann.nextcloud.deck.api.IResponseCallback; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.full.FullCard; +import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; import it.niedermann.nextcloud.deck.ui.PickStackActivity; import it.niedermann.nextcloud.deck.ui.card.EditActivity; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/preparecreate/PrepareCreateViewModel.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/preparecreate/PrepareCreateViewModel.java index 90524c22a..f6222fec4 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/preparecreate/PrepareCreateViewModel.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/preparecreate/PrepareCreateViewModel.java @@ -8,12 +8,12 @@ import androidx.annotation.Nullable; import com.nextcloud.android.sso.exceptions.NextcloudFilesAppAccountNotFoundException; -import it.niedermann.nextcloud.deck.api.IResponseCallback; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.Card; import it.niedermann.nextcloud.deck.model.full.FullCard; import it.niedermann.nextcloud.deck.model.ocs.Version; -import it.niedermann.nextcloud.deck.persistence.sync.SyncManager; +import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; +import it.niedermann.nextcloud.deck.repository.SyncRepository; import it.niedermann.nextcloud.deck.ui.viewmodel.BaseViewModel; @SuppressWarnings("WeakerAccess") @@ -37,7 +37,7 @@ public class PrepareCreateViewModel extends BaseViewModel { public void saveCard(@NonNull Account account, long boardLocalId, long stackLocalId, @NonNull FullCard fullCard, @NonNull IResponseCallback<FullCard> callback) { try { - new SyncManager(getApplication(), account).createFullCard(account.getId(), boardLocalId, stackLocalId, fullCard, callback); + new SyncRepository(getApplication(), account).createFullCard(account.getId(), boardLocalId, stackLocalId, fullCard, callback); } catch (NextcloudFilesAppAccountNotFoundException e) { callback.onError(e); } diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/settings/PreferencesViewModel.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/settings/PreferencesViewModel.java index 298beebb4..c1e6857f8 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/settings/PreferencesViewModel.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/settings/PreferencesViewModel.java @@ -5,7 +5,7 @@ import android.app.Application; import androidx.annotation.NonNull; import androidx.lifecycle.LiveData; -import it.niedermann.nextcloud.deck.persistence.PreferencesRepository; +import it.niedermann.nextcloud.deck.repository.PreferencesRepository; import it.niedermann.nextcloud.deck.ui.viewmodel.BaseViewModel; public class PreferencesViewModel extends BaseViewModel { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/settings/SettingsFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/settings/SettingsFragment.java index 79a03ab71..422095497 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/settings/SettingsFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/settings/SettingsFragment.java @@ -16,7 +16,7 @@ import java.util.stream.Stream; import it.niedermann.android.reactivelivedata.ReactiveLiveData; import it.niedermann.nextcloud.deck.DeckLog; import it.niedermann.nextcloud.deck.R; -import it.niedermann.nextcloud.deck.persistence.sync.SyncWorker; +import it.niedermann.nextcloud.deck.remote.SyncWorker; import it.niedermann.nextcloud.deck.ui.theme.ThemedSwitchPreference; public class SettingsFragment extends PreferenceFragmentCompat { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/sharetarget/ShareTargetActivity.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/sharetarget/ShareTargetActivity.java index b7547be0b..f6bd36b7d 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/sharetarget/ShareTargetActivity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/sharetarget/ShareTargetActivity.java @@ -25,12 +25,12 @@ import java.util.Map; import it.niedermann.nextcloud.deck.DeckLog; import it.niedermann.nextcloud.deck.R; -import it.niedermann.nextcloud.deck.api.IResponseCallback; import it.niedermann.nextcloud.deck.exceptions.UploadAttachmentFailedException; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.Attachment; import it.niedermann.nextcloud.deck.model.full.FullBoard; import it.niedermann.nextcloud.deck.model.full.FullCard; +import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; import it.niedermann.nextcloud.deck.ui.card.SelectCardListener; import it.niedermann.nextcloud.deck.ui.main.MainActivity; import it.niedermann.nextcloud.deck.util.MimeTypeUtil; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java index 302dbb0e3..084c642c7 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java @@ -22,14 +22,14 @@ import androidx.recyclerview.widget.RecyclerView; import it.niedermann.android.crosstabdnd.DragAndDropTab; import it.niedermann.android.reactivelivedata.ReactiveLiveData; import it.niedermann.nextcloud.deck.DeckLog; -import it.niedermann.nextcloud.deck.api.IResponseCallback; import it.niedermann.nextcloud.deck.databinding.FragmentStackBinding; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.Card; import it.niedermann.nextcloud.deck.model.Stack; import it.niedermann.nextcloud.deck.model.full.FullBoard; import it.niedermann.nextcloud.deck.model.full.FullCard; -import it.niedermann.nextcloud.deck.persistence.sync.SyncManager; +import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; +import it.niedermann.nextcloud.deck.repository.SyncRepository; import it.niedermann.nextcloud.deck.ui.card.CardActionListener; import it.niedermann.nextcloud.deck.ui.card.CardAdapter; import it.niedermann.nextcloud.deck.ui.card.SelectCardListener; @@ -174,7 +174,7 @@ public class StackFragment extends Fragment implements Themed, DragAndDropTab<Ca @Override public void onError(Throwable throwable) { IResponseCallback.super.onError(throwable); - if (SyncManager.isNoOnVoidError(throwable)) { + if (SyncRepository.isNoOnVoidError(throwable)) { ExceptionDialogFragment.newInstance(throwable, null).show(getChildFragmentManager(), ExceptionDialogFragment.class.getSimpleName()); } } @@ -231,7 +231,7 @@ public class StackFragment extends Fragment implements Themed, DragAndDropTab<Ca @Override public void onError(Throwable throwable) { - if (SyncManager.isNoOnVoidError(throwable)) { + if (SyncRepository.isNoOnVoidError(throwable)) { IResponseCallback.super.onError(throwable); showExceptionDialog(throwable, fullCard.getAccountId()); } diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackViewModel.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackViewModel.java index 8860fe3be..c6746449c 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackViewModel.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackViewModel.java @@ -14,13 +14,13 @@ import java.util.List; import java.util.concurrent.CompletableFuture; import it.niedermann.android.reactivelivedata.ReactiveLiveData; -import it.niedermann.nextcloud.deck.api.IResponseCallback; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.Card; import it.niedermann.nextcloud.deck.model.User; import it.niedermann.nextcloud.deck.model.full.FullBoard; import it.niedermann.nextcloud.deck.model.full.FullCard; import it.niedermann.nextcloud.deck.model.internal.FilterInformation; +import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; import it.niedermann.nextcloud.deck.ui.viewmodel.SyncViewModel; public class StackViewModel extends SyncViewModel { @@ -30,7 +30,7 @@ public class StackViewModel extends SyncViewModel { } public void moveCard(long originAccountId, long originCardLocalId, long targetAccountId, long targetBoardLocalId, long targetStackLocalId, @NonNull IResponseCallback<Void> callback) { - syncManager.moveCard(originAccountId, originCardLocalId, targetAccountId, targetBoardLocalId, targetStackLocalId, callback); + syncRepository.moveCard(originAccountId, originCardLocalId, targetAccountId, targetBoardLocalId, targetStackLocalId, callback); } public LiveData<Account> getAccount(long accountId) { @@ -65,20 +65,20 @@ public class StackViewModel extends SyncViewModel { } public void archiveCard(@NonNull FullCard card, @NonNull IResponseCallback<FullCard> callback) { - syncManager.archiveCard(card, callback); + syncRepository.archiveCard(card, callback); } public void deleteCard(@NonNull Card card, @NonNull IResponseCallback<Void> callback) { - syncManager.deleteCard(card, callback); + syncRepository.deleteCard(card, callback); } public void assignUserToCard(@NonNull FullCard fullCard) { - getAccountFuture(fullCard.getAccountId()).thenAcceptAsync(account -> syncManager.assignUserToCard(getUserByUidDirectly(fullCard.getCard().getAccountId(), account.getUserName()), fullCard.getCard())); + getAccountFuture(fullCard.getAccountId()).thenAcceptAsync(account -> syncRepository.assignUserToCard(getUserByUidDirectly(fullCard.getCard().getAccountId(), account.getUserName()), fullCard.getCard())); } public void unassignUserFromCard(@NonNull FullCard fullCard) { - getAccountFuture(fullCard.getAccountId()).thenAcceptAsync(account -> syncManager.unassignUserFromCard(getUserByUidDirectly(fullCard.getCard().getAccountId(), account.getUserName()), fullCard.getCard())); + getAccountFuture(fullCard.getAccountId()).thenAcceptAsync(account -> syncRepository.unassignUserFromCard(getUserByUidDirectly(fullCard.getCard().getAccountId(), account.getUserName()), fullCard.getCard())); } private User getUserByUidDirectly(long accountId, String uid) { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/theme/ThemedDialogFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/theme/ThemedDialogFragment.java index 6d45e4190..66bcc2394 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/theme/ThemedDialogFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/theme/ThemedDialogFragment.java @@ -3,7 +3,7 @@ package it.niedermann.nextcloud.deck.ui.theme; import androidx.fragment.app.DialogFragment; import it.niedermann.android.reactivelivedata.ReactiveLiveData; -import it.niedermann.nextcloud.deck.persistence.BaseRepository; +import it.niedermann.nextcloud.deck.repository.BaseRepository; public abstract class ThemedDialogFragment extends DialogFragment implements Themed { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/theme/ThemedPreferenceCategory.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/theme/ThemedPreferenceCategory.java index 39d79a84b..c79cf8731 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/theme/ThemedPreferenceCategory.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/theme/ThemedPreferenceCategory.java @@ -8,7 +8,7 @@ import androidx.annotation.NonNull; import androidx.preference.PreferenceCategory; import androidx.preference.PreferenceViewHolder; -import it.niedermann.nextcloud.deck.persistence.BaseRepository; +import it.niedermann.nextcloud.deck.repository.BaseRepository; public class ThemedPreferenceCategory extends PreferenceCategory { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/upcomingcards/UpcomingCardsActivity.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/upcomingcards/UpcomingCardsActivity.java index 2d004e733..9f92f1128 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/upcomingcards/UpcomingCardsActivity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/upcomingcards/UpcomingCardsActivity.java @@ -13,12 +13,12 @@ import androidx.lifecycle.ViewModelProvider; import com.nextcloud.android.sso.exceptions.NextcloudFilesAppAccountNotFoundException; import it.niedermann.nextcloud.deck.DeckLog; -import it.niedermann.nextcloud.deck.api.IResponseCallback; import it.niedermann.nextcloud.deck.databinding.ActivityUpcomingCardsBinding; import it.niedermann.nextcloud.deck.model.Card; import it.niedermann.nextcloud.deck.model.Stack; import it.niedermann.nextcloud.deck.model.full.FullCard; -import it.niedermann.nextcloud.deck.persistence.sync.SyncManager; +import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; +import it.niedermann.nextcloud.deck.repository.SyncRepository; import it.niedermann.nextcloud.deck.ui.exception.ExceptionDialogFragment; import it.niedermann.nextcloud.deck.ui.exception.ExceptionHandler; import it.niedermann.nextcloud.deck.ui.movecard.MoveCardListener; @@ -77,7 +77,7 @@ public class UpcomingCardsActivity extends AppCompatActivity implements MoveCard @Override public void onError(Throwable throwable) { - if (SyncManager.isNoOnVoidError(throwable)) { + if (SyncRepository.isNoOnVoidError(throwable)) { IResponseCallback.super.onError(throwable); runOnUiThread(() -> ExceptionDialogFragment.newInstance(throwable, null).show(getSupportFragmentManager(), ExceptionDialogFragment.class.getSimpleName())); } @@ -121,7 +121,7 @@ public class UpcomingCardsActivity extends AppCompatActivity implements MoveCard @Override public void onError(Throwable throwable) { IResponseCallback.super.onError(throwable); - if (SyncManager.isNoOnVoidError(throwable)) { + if (SyncRepository.isNoOnVoidError(throwable)) { ExceptionDialogFragment.newInstance(throwable, null).show(getSupportFragmentManager(), ExceptionDialogFragment.class.getSimpleName()); } } diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/upcomingcards/UpcomingCardsViewModel.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/upcomingcards/UpcomingCardsViewModel.java index 93234bc60..c3dbcb8a7 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/upcomingcards/UpcomingCardsViewModel.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/upcomingcards/UpcomingCardsViewModel.java @@ -9,11 +9,11 @@ import com.nextcloud.android.sso.exceptions.NextcloudFilesAppAccountNotFoundExce import java.util.List; -import it.niedermann.nextcloud.deck.api.IResponseCallback; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.Card; import it.niedermann.nextcloud.deck.model.full.FullCard; -import it.niedermann.nextcloud.deck.persistence.sync.SyncManager; +import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; +import it.niedermann.nextcloud.deck.repository.SyncRepository; import it.niedermann.nextcloud.deck.ui.viewmodel.BaseViewModel; @SuppressWarnings("WeakerAccess") @@ -28,12 +28,12 @@ public class UpcomingCardsViewModel extends BaseViewModel { } public void assignUser(@NonNull Account account, @NonNull Card card) throws NextcloudFilesAppAccountNotFoundException { - final var syncManager = new SyncManager(getApplication(), account); + final var syncManager = new SyncRepository(getApplication(), account); executor.submit(() -> syncManager.assignUserToCard(baseRepository.getUserByUidDirectly(card.getAccountId(), account.getUserName()), card)); } public void unassignUser(@NonNull Account account, @NonNull Card card) throws NextcloudFilesAppAccountNotFoundException { - final var syncManager = new SyncManager(getApplication(), account); + final var syncManager = new SyncRepository(getApplication(), account); executor.submit(() -> syncManager.unassignUserFromCard(baseRepository.getUserByUidDirectly(card.getAccountId(), account.getUserName()), card)); } @@ -41,7 +41,7 @@ public class UpcomingCardsViewModel extends BaseViewModel { executor.submit(() -> { final var account = baseRepository.readAccountDirectly(card.getAccountId()); try { - final var syncManager = new SyncManager(getApplication(), account); + final var syncManager = new SyncRepository(getApplication(), account); syncManager.archiveCard(card, callback); } catch (NextcloudFilesAppAccountNotFoundException e) { callback.onError(e); @@ -53,7 +53,7 @@ public class UpcomingCardsViewModel extends BaseViewModel { executor.submit(() -> { final var account = baseRepository.readAccountDirectly(card.getAccountId()); try { - final var syncManager = new SyncManager(getApplication(), account); + final var syncManager = new SyncRepository(getApplication(), account); syncManager.deleteCard(card, callback); } catch (NextcloudFilesAppAccountNotFoundException e) { callback.onError(e); @@ -65,7 +65,7 @@ public class UpcomingCardsViewModel extends BaseViewModel { executor.submit(() -> { final var account = baseRepository.readAccountDirectly(originAccountId); try { - final var syncManager = new SyncManager(getApplication(), account); + final var syncManager = new SyncRepository(getApplication(), account); syncManager.moveCard(originAccountId, originCardLocalId, targetAccountId, targetBoardLocalId, targetStackLocalId, callback); } catch (NextcloudFilesAppAccountNotFoundException e) { callback.onError(e); diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/viewmodel/BaseViewModel.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/viewmodel/BaseViewModel.java index d76007be4..02788ff07 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/viewmodel/BaseViewModel.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/viewmodel/BaseViewModel.java @@ -9,7 +9,7 @@ import androidx.lifecycle.ViewModel; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import it.niedermann.nextcloud.deck.persistence.BaseRepository; +import it.niedermann.nextcloud.deck.repository.BaseRepository; /** * To be used for {@link ViewModel}s which need an {@link BaseRepository} instance diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/viewmodel/SyncViewModel.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/viewmodel/SyncViewModel.java index 543c9ba92..0b9bff3e1 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/viewmodel/SyncViewModel.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/viewmodel/SyncViewModel.java @@ -9,7 +9,7 @@ import androidx.lifecycle.ViewModelProvider; import com.nextcloud.android.sso.exceptions.NextcloudFilesAppAccountNotFoundException; import it.niedermann.nextcloud.deck.model.Account; -import it.niedermann.nextcloud.deck.persistence.sync.SyncManager; +import it.niedermann.nextcloud.deck.repository.SyncRepository; import it.niedermann.nextcloud.deck.ui.archivedboards.ArchivedBoardsViewModel; import it.niedermann.nextcloud.deck.ui.board.accesscontrol.AccessControlViewModel; import it.niedermann.nextcloud.deck.ui.board.managelabels.LabelsViewModel; @@ -18,24 +18,24 @@ import it.niedermann.nextcloud.deck.ui.card.comments.CommentsViewModel; import it.niedermann.nextcloud.deck.ui.stack.StackViewModel; /** - * To be used for {@link ViewModel}s which need an {@link SyncManager} instance + * To be used for {@link ViewModel}s which need an {@link SyncRepository} instance */ public abstract class SyncViewModel extends BaseViewModel { protected final Account account; - protected final SyncManager syncManager; + protected final SyncRepository syncRepository; public SyncViewModel(@NonNull Application application, @NonNull Account account) throws NextcloudFilesAppAccountNotFoundException { - this(application, account, new SyncManager(application, account)); + this(application, account, new SyncRepository(application, account)); } public SyncViewModel(@NonNull Application application, @NonNull Account account, - @NonNull SyncManager syncManager) { - super(application, syncManager); + @NonNull SyncRepository syncRepository) { + super(application, syncRepository); this.account = account; - this.syncManager = syncManager; + this.syncRepository = syncRepository; } public static class Factory implements ViewModelProvider.Factory { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/filter/FilterWidget.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/filter/FilterWidget.java index 0d0acd7c4..134ab6985 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/filter/FilterWidget.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/filter/FilterWidget.java @@ -17,7 +17,7 @@ import java.util.concurrent.Executors; import it.niedermann.nextcloud.deck.DeckLog; import it.niedermann.nextcloud.deck.model.Account; -import it.niedermann.nextcloud.deck.persistence.BaseRepository; +import it.niedermann.nextcloud.deck.repository.BaseRepository; public class FilterWidget extends AppWidgetProvider { public static final String ACCOUNT_KEY = "filter_widget_account"; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/filter/FilterWidgetFactory.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/filter/FilterWidgetFactory.java index 77ff718f0..3f6322b35 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/filter/FilterWidgetFactory.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/filter/FilterWidgetFactory.java @@ -15,7 +15,7 @@ import it.niedermann.nextcloud.deck.DeckLog; import it.niedermann.nextcloud.deck.R; import it.niedermann.nextcloud.deck.model.full.FullCard; import it.niedermann.nextcloud.deck.model.widget.filter.dto.FilterWidgetCard; -import it.niedermann.nextcloud.deck.persistence.BaseRepository; +import it.niedermann.nextcloud.deck.repository.BaseRepository; public class FilterWidgetFactory implements RemoteViewsService.RemoteViewsFactory { private final Context context; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/filter/FilterWidgetViewModel.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/filter/FilterWidgetViewModel.java index 3f90acebb..bf8e4be1f 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/filter/FilterWidgetViewModel.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/filter/FilterWidgetViewModel.java @@ -6,8 +6,8 @@ import androidx.annotation.NonNull; import androidx.lifecycle.LiveData; import androidx.lifecycle.MutableLiveData; -import it.niedermann.nextcloud.deck.api.IResponseCallback; import it.niedermann.nextcloud.deck.model.widget.filter.FilterWidget; +import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; import it.niedermann.nextcloud.deck.ui.viewmodel.BaseViewModel; public class FilterWidgetViewModel extends BaseViewModel { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/singlecard/SingleCardWidget.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/singlecard/SingleCardWidget.java index b7d6eac44..08e32bf25 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/singlecard/SingleCardWidget.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/singlecard/SingleCardWidget.java @@ -23,7 +23,7 @@ import java.util.concurrent.Executors; import it.niedermann.nextcloud.deck.R; import it.niedermann.nextcloud.deck.model.Card; import it.niedermann.nextcloud.deck.model.full.FullSingleCardWidgetModel; -import it.niedermann.nextcloud.deck.persistence.BaseRepository; +import it.niedermann.nextcloud.deck.repository.BaseRepository; import it.niedermann.nextcloud.deck.ui.card.EditActivity; import it.niedermann.nextcloud.deck.util.DateUtil; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/singlecard/SingleCardWidgetFactory.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/singlecard/SingleCardWidgetFactory.java index 1e5760110..2a5bcadf5 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/singlecard/SingleCardWidgetFactory.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/singlecard/SingleCardWidgetFactory.java @@ -15,7 +15,7 @@ import java.util.NoSuchElementException; import it.niedermann.android.markdown.MarkdownUtil; import it.niedermann.nextcloud.deck.R; import it.niedermann.nextcloud.deck.model.full.FullSingleCardWidgetModel; -import it.niedermann.nextcloud.deck.persistence.BaseRepository; +import it.niedermann.nextcloud.deck.repository.BaseRepository; import it.niedermann.nextcloud.deck.ui.card.EditActivity; public class SingleCardWidgetFactory implements RemoteViewsService.RemoteViewsFactory { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/stack/StackWidget.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/stack/StackWidget.java index dc3e50416..0fb30cbb8 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/stack/StackWidget.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/stack/StackWidget.java @@ -21,7 +21,7 @@ import java.util.concurrent.Executors; import it.niedermann.nextcloud.deck.DeckLog; import it.niedermann.nextcloud.deck.R; import it.niedermann.nextcloud.deck.model.Stack; -import it.niedermann.nextcloud.deck.persistence.BaseRepository; +import it.niedermann.nextcloud.deck.repository.BaseRepository; import it.niedermann.nextcloud.deck.ui.card.EditActivity; import it.niedermann.nextcloud.deck.ui.main.MainActivity; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/stack/StackWidgetConfigurationActivity.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/stack/StackWidgetConfigurationActivity.java index 95604de26..eaa8ba264 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/stack/StackWidgetConfigurationActivity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/stack/StackWidgetConfigurationActivity.java @@ -13,14 +13,14 @@ import java.util.Collections; import it.niedermann.nextcloud.deck.DeckLog; import it.niedermann.nextcloud.deck.R; -import it.niedermann.nextcloud.deck.api.IResponseCallback; -import it.niedermann.nextcloud.deck.api.ResponseCallback; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.widget.filter.EWidgetType; import it.niedermann.nextcloud.deck.model.widget.filter.FilterWidget; import it.niedermann.nextcloud.deck.model.widget.filter.FilterWidgetAccount; import it.niedermann.nextcloud.deck.model.widget.filter.FilterWidgetBoard; import it.niedermann.nextcloud.deck.model.widget.filter.FilterWidgetStack; +import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; +import it.niedermann.nextcloud.deck.remote.api.ResponseCallback; import it.niedermann.nextcloud.deck.ui.PickStackActivity; public class StackWidgetConfigurationActivity extends PickStackActivity { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/stack/StackWidgetConfigurationViewModel.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/stack/StackWidgetConfigurationViewModel.java index 2b6248c4e..20709c4b8 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/stack/StackWidgetConfigurationViewModel.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/stack/StackWidgetConfigurationViewModel.java @@ -4,8 +4,8 @@ import android.app.Application; import androidx.annotation.NonNull; -import it.niedermann.nextcloud.deck.api.ResponseCallback; import it.niedermann.nextcloud.deck.model.widget.filter.FilterWidget; +import it.niedermann.nextcloud.deck.remote.api.ResponseCallback; import it.niedermann.nextcloud.deck.ui.viewmodel.BaseViewModel; @SuppressWarnings("WeakerAccess") diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/stack/StackWidgetFactory.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/stack/StackWidgetFactory.java index d5b4c8743..fbc306e0b 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/stack/StackWidgetFactory.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/stack/StackWidgetFactory.java @@ -18,7 +18,7 @@ import java.util.NoSuchElementException; import it.niedermann.nextcloud.deck.DeckLog; import it.niedermann.nextcloud.deck.R; import it.niedermann.nextcloud.deck.model.widget.filter.dto.FilterWidgetCard; -import it.niedermann.nextcloud.deck.persistence.BaseRepository; +import it.niedermann.nextcloud.deck.repository.BaseRepository; import it.niedermann.nextcloud.deck.ui.card.EditActivity; public class StackWidgetFactory implements RemoteViewsService.RemoteViewsFactory { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/upcoming/UpcomingWidget.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/upcoming/UpcomingWidget.java index fffc0a3c3..49081070a 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/upcoming/UpcomingWidget.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/upcoming/UpcomingWidget.java @@ -22,7 +22,6 @@ import java.util.stream.Collectors; import it.niedermann.nextcloud.deck.BuildConfig; import it.niedermann.nextcloud.deck.DeckLog; import it.niedermann.nextcloud.deck.R; -import it.niedermann.nextcloud.deck.api.IResponseCallback; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.enums.ESortCriteria; import it.niedermann.nextcloud.deck.model.widget.filter.EWidgetType; @@ -30,7 +29,8 @@ import it.niedermann.nextcloud.deck.model.widget.filter.FilterWidget; import it.niedermann.nextcloud.deck.model.widget.filter.FilterWidgetAccount; import it.niedermann.nextcloud.deck.model.widget.filter.FilterWidgetSort; import it.niedermann.nextcloud.deck.model.widget.filter.FilterWidgetUser; -import it.niedermann.nextcloud.deck.persistence.BaseRepository; +import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; +import it.niedermann.nextcloud.deck.repository.BaseRepository; import it.niedermann.nextcloud.deck.ui.card.EditActivity; public class UpcomingWidget extends AppWidgetProvider { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/upcoming/UpcomingWidgetFactory.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/upcoming/UpcomingWidgetFactory.java index 9f98bf6cb..d7c320a95 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/upcoming/UpcomingWidgetFactory.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/widget/upcoming/UpcomingWidgetFactory.java @@ -16,7 +16,7 @@ import it.niedermann.android.util.DimensionUtil; import it.niedermann.nextcloud.deck.DeckLog; import it.niedermann.nextcloud.deck.R; import it.niedermann.nextcloud.deck.model.full.FullCard; -import it.niedermann.nextcloud.deck.persistence.BaseRepository; +import it.niedermann.nextcloud.deck.repository.BaseRepository; import it.niedermann.nextcloud.deck.ui.upcomingcards.UpcomingCardsAdapterItem; import it.niedermann.nextcloud.deck.ui.upcomingcards.UpcomingCardsAdapterSectionItem; import it.niedermann.nextcloud.deck.ui.upcomingcards.UpcomingCardsUtil; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/util/AutoCompleteAdapter.java b/app/src/main/java/it/niedermann/nextcloud/deck/util/AutoCompleteAdapter.java index 6ce764191..2cabb472d 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/util/AutoCompleteAdapter.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/util/AutoCompleteAdapter.java @@ -20,7 +20,7 @@ import it.niedermann.android.reactivelivedata.ReactiveLiveData; import it.niedermann.nextcloud.deck.DeckLog; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.interfaces.IRemoteEntity; -import it.niedermann.nextcloud.deck.persistence.sync.SyncManager; +import it.niedermann.nextcloud.deck.repository.SyncRepository; public abstract class AutoCompleteAdapter<ItemType extends IRemoteEntity> extends BaseAdapter implements Filterable { @NonNull @@ -28,7 +28,7 @@ public abstract class AutoCompleteAdapter<ItemType extends IRemoteEntity> extend @NonNull private final List<ItemType> itemsToExclude = new ArrayList<>(); @NonNull - protected SyncManager syncManager; + protected SyncRepository syncRepository; protected final Account account; protected final long boardId; protected final ReactiveLiveData<String> constraint$ = new ReactiveLiveData<String>(); @@ -43,7 +43,7 @@ public abstract class AutoCompleteAdapter<ItemType extends IRemoteEntity> extend protected AutoCompleteAdapter(@NonNull Context context, @NonNull Account account, long boardId) throws NextcloudFilesAppAccountNotFoundException { this.account = account; this.boardId = boardId; - this.syncManager = new SyncManager(context, account); + this.syncRepository = new SyncRepository(context, account); } @Override diff --git a/app/src/test/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DataBaseAdapterTest.java b/app/src/test/java/it/niedermann/nextcloud/deck/database/DataBaseAdapterTest.java index f3c84a78c..50c093ebf 100644 --- a/app/src/test/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DataBaseAdapterTest.java +++ b/app/src/test/java/it/niedermann/nextcloud/deck/database/DataBaseAdapterTest.java @@ -1,10 +1,10 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db; +package it.niedermann.nextcloud.deck.database; import static org.junit.Assert.assertEquals; -import static java.lang.reflect.Modifier.isPrivate; -import static it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DeckDatabaseTestUtil.createAccount; -import static it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DeckDatabaseTestUtil.createBoard; -import static it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DeckDatabaseTestUtil.createUser; +import static java.lang.reflect.Modifier.isProtected; +import static it.niedermann.nextcloud.deck.database.DeckDatabaseTestUtil.createAccount; +import static it.niedermann.nextcloud.deck.database.DeckDatabaseTestUtil.createBoard; +import static it.niedermann.nextcloud.deck.database.DeckDatabaseTestUtil.createUser; import android.content.Context; @@ -38,13 +38,15 @@ public class DataBaseAdapterTest { @Before public void createAdapter() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException { final var constructor = DataBaseAdapter.class.getDeclaredConstructor(Context.class, DeckDatabase.class, ExecutorService.class, ExecutorService.class); - if (isPrivate(constructor.getModifiers())) { + if (isProtected(constructor.getModifiers())) { constructor.setAccessible(true); db = Room .inMemoryDatabaseBuilder(ApplicationProvider.getApplicationContext(), DeckDatabase.class) .allowMainThreadQueries() .build(); adapter = constructor.newInstance(ApplicationProvider.getApplicationContext(), db, MoreExecutors.newDirectExecutorService(), MoreExecutors.newDirectExecutorService()); + } else { + throw new RuntimeException("Expected constructor to be protected."); } } diff --git a/app/src/test/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DeckDatabaseTestUtil.java b/app/src/test/java/it/niedermann/nextcloud/deck/database/DeckDatabaseTestUtil.java index 99003f2d0..8da72d4c6 100644 --- a/app/src/test/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DeckDatabaseTestUtil.java +++ b/app/src/test/java/it/niedermann/nextcloud/deck/database/DeckDatabaseTestUtil.java @@ -1,19 +1,19 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db; +package it.niedermann.nextcloud.deck.database; import androidx.annotation.NonNull; import java.util.Random; +import it.niedermann.nextcloud.deck.database.dao.AccountDao; +import it.niedermann.nextcloud.deck.database.dao.BoardDao; +import it.niedermann.nextcloud.deck.database.dao.CardDao; +import it.niedermann.nextcloud.deck.database.dao.StackDao; +import it.niedermann.nextcloud.deck.database.dao.UserDao; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.Board; import it.niedermann.nextcloud.deck.model.Card; import it.niedermann.nextcloud.deck.model.Stack; import it.niedermann.nextcloud.deck.model.User; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.AccountDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.BoardDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.CardDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.StackDao; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.UserDao; public class DeckDatabaseTestUtil { diff --git a/app/src/test/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/AbstractDaoTest.java b/app/src/test/java/it/niedermann/nextcloud/deck/database/dao/AbstractDaoTest.java index fb0282d84..79a7e613c 100644 --- a/app/src/test/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/AbstractDaoTest.java +++ b/app/src/test/java/it/niedermann/nextcloud/deck/database/dao/AbstractDaoTest.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; +package it.niedermann.nextcloud.deck.database.dao; import androidx.arch.core.executor.testing.InstantTaskExecutorRule; import androidx.room.Room; @@ -10,7 +10,7 @@ import org.junit.Rule; import org.junit.runner.RunWith; import org.robolectric.RobolectricTestRunner; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DeckDatabase; +import it.niedermann.nextcloud.deck.database.DeckDatabase; @RunWith(RobolectricTestRunner.class) public abstract class AbstractDaoTest { diff --git a/app/src/test/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/AccountDaoTest.java b/app/src/test/java/it/niedermann/nextcloud/deck/database/dao/AccountDaoTest.java index 7cbf0d0d7..00b3d93fa 100644 --- a/app/src/test/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/AccountDaoTest.java +++ b/app/src/test/java/it/niedermann/nextcloud/deck/database/dao/AccountDaoTest.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; +package it.niedermann.nextcloud.deck.database.dao; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -11,9 +11,9 @@ import org.robolectric.RobolectricTestRunner; import java.net.MalformedURLException; import it.niedermann.nextcloud.deck.TestUtil; +import it.niedermann.nextcloud.deck.database.DeckDatabaseTestUtil; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.ocs.Capabilities; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DeckDatabaseTestUtil; import it.niedermann.nextcloud.sso.glide.SingleSignOnUrl; @RunWith(RobolectricTestRunner.class) diff --git a/app/src/test/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/BoardDaoTest.java b/app/src/test/java/it/niedermann/nextcloud/deck/database/dao/BoardDaoTest.java index 9116fdaf1..72ee0862a 100644 --- a/app/src/test/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/BoardDaoTest.java +++ b/app/src/test/java/it/niedermann/nextcloud/deck/database/dao/BoardDaoTest.java @@ -1,13 +1,13 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; +package it.niedermann.nextcloud.deck.database.dao; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -import static it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DeckDatabaseTestUtil.createAccount; -import static it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DeckDatabaseTestUtil.createBoard; -import static it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DeckDatabaseTestUtil.createCard; -import static it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DeckDatabaseTestUtil.createStack; -import static it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DeckDatabaseTestUtil.createUser; +import static it.niedermann.nextcloud.deck.database.DeckDatabaseTestUtil.createAccount; +import static it.niedermann.nextcloud.deck.database.DeckDatabaseTestUtil.createBoard; +import static it.niedermann.nextcloud.deck.database.DeckDatabaseTestUtil.createCard; +import static it.niedermann.nextcloud.deck.database.DeckDatabaseTestUtil.createStack; +import static it.niedermann.nextcloud.deck.database.DeckDatabaseTestUtil.createUser; import org.junit.Test; import org.junit.runner.RunWith; @@ -16,9 +16,9 @@ import org.robolectric.RobolectricTestRunner; import java.time.Instant; import it.niedermann.nextcloud.deck.TestUtil; +import it.niedermann.nextcloud.deck.database.DeckDatabaseTestUtil; import it.niedermann.nextcloud.deck.model.Board; import it.niedermann.nextcloud.deck.model.enums.DBStatus; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DeckDatabaseTestUtil; @RunWith(RobolectricTestRunner.class) public class BoardDaoTest extends AbstractDaoTest { @@ -45,35 +45,7 @@ public class BoardDaoTest extends AbstractDaoTest { } @Test - public void testGetBoardsForAccount() throws InterruptedException { - final var account = createAccount(db.getAccountDao()); - final var owner = createUser(db.getUserDao(), account); - final var boardVisible1 = createBoard(db.getBoardDao(), account, owner); - final var boardVisible2 = createBoard(db.getBoardDao(), account, owner); - final var boardVisible3 = createBoard(db.getBoardDao(), account, owner); - final var boardInVisible1 = createBoard(db.getBoardDao(), account, owner); - boardInVisible1.setDeletedAt(Instant.now()); - final var boardInVisible2 = createBoard(db.getBoardDao(), account, owner); - boardInVisible2.setStatus(3); - final var boardInVisible3 = createBoard(db.getBoardDao(), account, owner); - boardInVisible3.setStatusEnum(DBStatus.LOCAL_DELETED); - final var boardVisibleArchived = createBoard(db.getBoardDao(), account, owner); - boardVisibleArchived.setArchived(true); - db.getBoardDao().update(boardInVisible1, boardInVisible2, boardInVisible3, boardVisibleArchived); - - final var boards = TestUtil.getOrAwaitValue(db.getBoardDao().getNotDeletedBoards(account.getId(), 1)); - assertEquals(4, boards.size()); - assertTrue(boards.stream().anyMatch((board -> boardVisible1.getLocalId().equals(board.getLocalId())))); - assertTrue(boards.stream().anyMatch((board -> boardVisible2.getLocalId().equals(board.getLocalId())))); - assertTrue(boards.stream().anyMatch((board -> boardVisible3.getLocalId().equals(board.getLocalId())))); - assertTrue(boards.stream().anyMatch((board -> boardVisibleArchived.getLocalId().equals(board.getLocalId())))); - assertFalse(boards.stream().anyMatch((board -> boardInVisible1.getLocalId().equals(board.getLocalId())))); - assertFalse(boards.stream().anyMatch((board -> boardInVisible2.getLocalId().equals(board.getLocalId())))); - assertFalse(boards.stream().anyMatch((board -> boardInVisible3.getLocalId().equals(board.getLocalId())))); - } - - @Test - public void testGetArchivedBoardsForAccount() throws InterruptedException { + public void testGetNotDeletedBoardsForAccount() throws InterruptedException { final var account = createAccount(db.getAccountDao()); final var owner = createUser(db.getUserDao(), account); final var board1 = createBoard(db.getBoardDao(), account, owner); diff --git a/app/src/test/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/CardDaoTest.java b/app/src/test/java/it/niedermann/nextcloud/deck/database/dao/CardDaoTest.java index 336ebacf3..9e2062c73 100644 --- a/app/src/test/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/CardDaoTest.java +++ b/app/src/test/java/it/niedermann/nextcloud/deck/database/dao/CardDaoTest.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; +package it.niedermann.nextcloud.deck.database.dao; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -9,12 +9,12 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RobolectricTestRunner; +import it.niedermann.nextcloud.deck.database.DeckDatabaseTestUtil; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.Board; import it.niedermann.nextcloud.deck.model.Card; import it.niedermann.nextcloud.deck.model.User; import it.niedermann.nextcloud.deck.model.enums.DBStatus; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DeckDatabaseTestUtil; @RunWith(RobolectricTestRunner.class) public class CardDaoTest extends AbstractDaoTest { diff --git a/app/src/test/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/StackDaoTest.java b/app/src/test/java/it/niedermann/nextcloud/deck/database/dao/StackDaoTest.java index efbf978d1..dd9a89324 100644 --- a/app/src/test/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/StackDaoTest.java +++ b/app/src/test/java/it/niedermann/nextcloud/deck/database/dao/StackDaoTest.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; +package it.niedermann.nextcloud.deck.database.dao; import static org.junit.Assert.assertEquals; @@ -6,8 +6,8 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RobolectricTestRunner; +import it.niedermann.nextcloud.deck.database.DeckDatabaseTestUtil; import it.niedermann.nextcloud.deck.model.Stack; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DeckDatabaseTestUtil; @RunWith(RobolectricTestRunner.class) public class StackDaoTest extends AbstractDaoTest { diff --git a/app/src/test/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/UserDaoTest.java b/app/src/test/java/it/niedermann/nextcloud/deck/database/dao/UserDaoTest.java index 4b4e69aed..02fda1ae0 100644 --- a/app/src/test/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/dao/UserDaoTest.java +++ b/app/src/test/java/it/niedermann/nextcloud/deck/database/dao/UserDaoTest.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao; +package it.niedermann.nextcloud.deck.database.dao; import static org.junit.Assert.assertEquals; @@ -6,8 +6,8 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RobolectricTestRunner; +import it.niedermann.nextcloud.deck.database.DeckDatabaseTestUtil; import it.niedermann.nextcloud.deck.model.User; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DeckDatabaseTestUtil; @RunWith(RobolectricTestRunner.class) public class UserDaoTest extends AbstractDaoTest { diff --git a/app/src/test/java/it/niedermann/nextcloud/deck/api/ResponseCallbackTest.java b/app/src/test/java/it/niedermann/nextcloud/deck/remote/api/ResponseCallbackTest.java index 22805c51d..14c398132 100644 --- a/app/src/test/java/it/niedermann/nextcloud/deck/api/ResponseCallbackTest.java +++ b/app/src/test/java/it/niedermann/nextcloud/deck/remote/api/ResponseCallbackTest.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.api; +package it.niedermann.nextcloud.deck.remote.api; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; diff --git a/app/src/test/java/it/niedermann/nextcloud/deck/api/ServerCommunicationErrorHandlerTest.java b/app/src/test/java/it/niedermann/nextcloud/deck/remote/api/ServerCommunicationErrorHandlerTest.java index 147749056..b9c7288a0 100644 --- a/app/src/test/java/it/niedermann/nextcloud/deck/api/ServerCommunicationErrorHandlerTest.java +++ b/app/src/test/java/it/niedermann/nextcloud/deck/remote/api/ServerCommunicationErrorHandlerTest.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.api; +package it.niedermann.nextcloud.deck.remote.api; import static org.junit.Assert.assertEquals; diff --git a/app/src/test/java/it/niedermann/nextcloud/deck/persistence/sync/SyncManagerTest.java b/app/src/test/java/it/niedermann/nextcloud/deck/repository/SyncRepositoryTest.java index c50d5b3ae..54bc2dc4a 100644 --- a/app/src/test/java/it/niedermann/nextcloud/deck/persistence/sync/SyncManagerTest.java +++ b/app/src/test/java/it/niedermann/nextcloud/deck/repository/SyncRepositoryTest.java @@ -1,4 +1,4 @@ -package it.niedermann.nextcloud.deck.persistence.sync; +package it.niedermann.nextcloud.deck.repository; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -44,9 +44,7 @@ import java.util.Map; import java.util.concurrent.ExecutionException; import it.niedermann.nextcloud.deck.TestUtil; -import it.niedermann.nextcloud.deck.api.IResponseCallback; -import it.niedermann.nextcloud.deck.api.LastSyncUtil; -import it.niedermann.nextcloud.deck.api.ResponseCallback; +import it.niedermann.nextcloud.deck.database.DataBaseAdapter; import it.niedermann.nextcloud.deck.exceptions.OfflineException; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.Board; @@ -57,16 +55,18 @@ import it.niedermann.nextcloud.deck.model.full.FullStack; import it.niedermann.nextcloud.deck.model.interfaces.IRemoteEntity; import it.niedermann.nextcloud.deck.model.ocs.Capabilities; import it.niedermann.nextcloud.deck.model.ocs.Version; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.ServerAdapter; -import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.DataBaseAdapter; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.SyncHelper; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.AbstractSyncDataProvider; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.CardDataProvider; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.StackDataProvider; -import it.niedermann.nextcloud.deck.persistence.sync.helpers.util.ConnectivityUtil; +import it.niedermann.nextcloud.deck.remote.adapters.ServerAdapter; +import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; +import it.niedermann.nextcloud.deck.remote.api.LastSyncUtil; +import it.niedermann.nextcloud.deck.remote.api.ResponseCallback; +import it.niedermann.nextcloud.deck.remote.helpers.SyncHelper; +import it.niedermann.nextcloud.deck.remote.helpers.providers.AbstractSyncDataProvider; +import it.niedermann.nextcloud.deck.remote.helpers.providers.CardDataProvider; +import it.niedermann.nextcloud.deck.remote.helpers.providers.StackDataProvider; +import it.niedermann.nextcloud.deck.remote.helpers.util.ConnectivityUtil; @RunWith(RobolectricTestRunner.class) -public class SyncManagerTest { +public class SyncRepositoryTest { @Rule public InstantTaskExecutorRule instantTaskExecutorRule = new InstantTaskExecutorRule(); @@ -77,25 +77,25 @@ public class SyncManagerTest { private final SyncHelper.Factory syncHelperFactory = mock(SyncHelper.Factory.class); private final ConnectivityUtil connectivityUtil = mock(ConnectivityUtil.class); - private SyncManager syncManager; + private SyncRepository syncRepository; @Before public void setup() { when(dataBaseAdapter.getCurrentAccountId$()).thenReturn(new MutableLiveData<>()); - syncManager = new SyncManager(context, serverAdapter, connectivityUtil, syncHelperFactory, dataBaseAdapter, MoreExecutors.newDirectExecutorService()); + syncRepository = new SyncRepository(context, serverAdapter, connectivityUtil, syncHelperFactory, dataBaseAdapter, MoreExecutors.newDirectExecutorService()); } @Test public void testHasAccounts() throws InterruptedException { when(dataBaseAdapter.hasAccounts()).thenReturn(new MutableLiveData<>(true)); - final var hasAccountsPositive = syncManager.hasAccounts(); + final var hasAccountsPositive = syncRepository.hasAccounts(); assertTrue(TestUtil.getOrAwaitValue(hasAccountsPositive)); verify(dataBaseAdapter, times(1)).hasAccounts(); reset(dataBaseAdapter); when(dataBaseAdapter.hasAccounts()).thenReturn(new MutableLiveData<>(false)); - final var hasAccountsNegative = syncManager.hasAccounts(); + final var hasAccountsNegative = syncRepository.hasAccounts(); assertFalse(TestUtil.getOrAwaitValue(hasAccountsNegative)); verify(dataBaseAdapter, times(1)).hasAccounts(); } @@ -107,37 +107,37 @@ public class SyncManagerTest { account.setName("text@example.com"); when(dataBaseAdapter.readAccount(5)).thenReturn(new MutableLiveData<>(account)); - assertEquals(account, TestUtil.getOrAwaitValue(syncManager.readAccount(5))); + assertEquals(account, TestUtil.getOrAwaitValue(syncRepository.readAccount(5))); verify(dataBaseAdapter, times(1)).readAccount(5); reset(dataBaseAdapter); when(dataBaseAdapter.readAccount("test@example.com")).thenReturn(new MutableLiveData<>(account)); - assertEquals(account, TestUtil.getOrAwaitValue(syncManager.readAccount("test@example.com"))); + assertEquals(account, TestUtil.getOrAwaitValue(syncRepository.readAccount("test@example.com"))); verify(dataBaseAdapter, times(1)).readAccount("test@example.com"); reset(dataBaseAdapter); when(dataBaseAdapter.readAccount(5)).thenReturn(new MutableLiveData<>(null)); - assertNull(TestUtil.getOrAwaitValue(syncManager.readAccount(5))); + assertNull(TestUtil.getOrAwaitValue(syncRepository.readAccount(5))); verify(dataBaseAdapter, times(1)).readAccount(5); reset(dataBaseAdapter); when(dataBaseAdapter.readAccount("test@example.com")).thenReturn(new MutableLiveData<>(null)); - assertNull(TestUtil.getOrAwaitValue(syncManager.readAccount("test@example.com"))); + assertNull(TestUtil.getOrAwaitValue(syncRepository.readAccount("test@example.com"))); verify(dataBaseAdapter, times(1)).readAccount("test@example.com"); } @Test public void testDeleteAccount() { doNothing().when(dataBaseAdapter).deleteAccount(anyLong()); - syncManager.deleteAccount(1337L); + syncRepository.deleteAccount(1337L); verify(dataBaseAdapter, times(1)).deleteAccount(1337L); } /** - * When {@link SyncManager#synchronizeBoard(ResponseCallback, long)} is triggered, it should + * When {@link SyncRepository#synchronizeBoard(long, ResponseCallback)} is triggered, it should * pass the given {@link ResponseCallback} to the {@link SyncHelper} and trigger a * {@link SyncHelper#doSyncFor(AbstractSyncDataProvider)}. * {@link OfflineException} should be caught and passed to the {@link ResponseCallback} @@ -158,14 +158,14 @@ public class SyncManagerTest { } }); - syncManager.synchronizeBoard(1L, responseCallback); + syncRepository.synchronizeBoard(1L, responseCallback); verify(syncHelper, times(1)).setResponseCallback(responseCallback); verify(syncHelper, times(1)).doSyncFor(any(StackDataProvider.class)); doThrow(OfflineException.class).when(syncHelper).doSyncFor(any()); - syncManager.synchronizeBoard(1L, responseCallback); + syncRepository.synchronizeBoard(1L, responseCallback); verify(responseCallback, times(1)).onError(any(OfflineException.class)); } @@ -192,14 +192,14 @@ public class SyncManagerTest { final var card = new Card(); card.setStackId(5000L); - syncManager.synchronizeCard(responseCallback, card); + syncRepository.synchronizeCard(responseCallback, card); verify(syncHelper, times(1)).setResponseCallback(responseCallback); verify(syncHelper, times(1)).doSyncFor(any(CardDataProvider.class)); doThrow(OfflineException.class).when(syncHelper).doSyncFor(any()); - syncManager.synchronizeCard(responseCallback, card); + syncRepository.synchronizeCard(responseCallback, card); verify(responseCallback, times(1)).onError(any(OfflineException.class)); } @@ -216,7 +216,7 @@ public class SyncManagerTest { return null; }).when(serverAdapter).getBoards(any()); - syncManager.createAccount(account, callback); + syncRepository.createAccount(account, callback); verify(dataBaseAdapter, times(1)).createAccountDirectly(account); verify(callback, times(1)).onResponse(account); } @@ -233,7 +233,7 @@ public class SyncManagerTest { return null; }).when(serverAdapter).getBoards(any()); - syncManager.createAccount(account, callback); + syncRepository.createAccount(account, callback); verify(dataBaseAdapter, times(1)).createAccountDirectly(account); verify(callback, times(1)).onResponse(account); } @@ -242,7 +242,7 @@ public class SyncManagerTest { public void testReadAccountDirectly() { final var account = new Account(1337L, "Test", "Peter", "example.com"); when(dataBaseAdapter.readAccountDirectly(1337L)).thenReturn(account); - assertEquals(account, syncManager.readAccountDirectly(1337L)); + assertEquals(account, syncRepository.readAccountDirectly(1337L)); } @Test @@ -252,7 +252,7 @@ public class SyncManagerTest { wrappedAccounts.setValue(accounts); when(dataBaseAdapter.readAccounts()).thenReturn(wrappedAccounts); - final var result = TestUtil.getOrAwaitValue(syncManager.readAccounts()); + final var result = TestUtil.getOrAwaitValue(syncRepository.readAccounts()); verify(dataBaseAdapter, times(1)).readAccounts(); assertEquals(1, result.size()); @@ -262,7 +262,7 @@ public class SyncManagerTest { public void testReadAccountsDirectly() { final var accounts = Collections.singletonList(new Account(1337L, "Test", "Peter", "example.com")); when(dataBaseAdapter.getAllAccountsDirectly()).thenReturn(accounts); - assertEquals(1, syncManager.readAccountsDirectly().size()); + assertEquals(1, syncRepository.readAccountsDirectly().size()); } @Test @@ -288,7 +288,7 @@ public class SyncManagerTest { return null; }).when(serverAdapter).getCapabilities(anyString(), any()); - syncManager.refreshCapabilities(new ResponseCallback<>(account) { + syncRepository.refreshCapabilities(new ResponseCallback<>(account) { @Override public void onResponse(Capabilities response) { assertEquals("Capabilities from server must be returned to the original callback", @@ -313,7 +313,7 @@ public class SyncManagerTest { return null; }).when(serverAdapter).getCapabilities(anyString(), any()); - syncManager.refreshCapabilities(new ResponseCallback<>(account) { + syncRepository.refreshCapabilities(new ResponseCallback<>(account) { @Override public void onResponse(Capabilities response) { assertEquals("Capabilities from server must be returned to the original callback", @@ -339,7 +339,7 @@ public class SyncManagerTest { return null; }).when(serverAdapter).getCapabilities(anyString(), any()); - syncManager.refreshCapabilities(new ResponseCallback<>(account) { + syncRepository.refreshCapabilities(new ResponseCallback<>(account) { @Override public void onResponse(Capabilities response) { fail("In case of an HTTP 500 the callback must not be responded successfully."); @@ -362,7 +362,7 @@ public class SyncManagerTest { return null; }).when(serverAdapter).getCapabilities(anyString(), any()); - syncManager.refreshCapabilities(new ResponseCallback<>(account) { + syncRepository.refreshCapabilities(new ResponseCallback<>(account) { @Override public void onResponse(Capabilities response) { assertEquals(Version.of("20.0.1"), response.getNextcloudVersion()); @@ -384,7 +384,7 @@ public class SyncManagerTest { return null; }).when(serverAdapter).getCapabilities(anyString(), any()); - syncManager.refreshCapabilities(new ResponseCallback<>(account) { + syncRepository.refreshCapabilities(new ResponseCallback<>(account) { @Override public void onResponse(Capabilities response) { fail("In case of any other exception the callback must not be responded successfully."); @@ -401,7 +401,7 @@ public class SyncManagerTest { doThrow(new OfflineException()).when(serverAdapter).getCapabilities(anyString(), any()); - syncManager.refreshCapabilities(new ResponseCallback<>(account) { + syncRepository.refreshCapabilities(new ResponseCallback<>(account) { @Override public void onResponse(Capabilities response) { fail("In case of an " + OfflineException.class.getSimpleName() + " the callback must not be responded successfully."); @@ -416,7 +416,7 @@ public class SyncManagerTest { @Test public void testSynchronize() { - final var syncManagerSpy = spy(syncManager); + final var syncManagerSpy = spy(syncRepository); LastSyncUtil.init(ApplicationProvider.getApplicationContext()); final var account = new Account(1337L, "Test", "Peter", "example.com"); diff --git a/app/src/test/java/it/niedermann/nextcloud/deck/CommentsUtilTest.java b/app/src/test/java/it/niedermann/nextcloud/deck/ui/card/comments/util/CommentsUtilTest.java index bc76207e0..e187a2338 100644 --- a/app/src/test/java/it/niedermann/nextcloud/deck/CommentsUtilTest.java +++ b/app/src/test/java/it/niedermann/nextcloud/deck/ui/card/comments/util/CommentsUtilTest.java @@ -1,10 +1,8 @@ -package it.niedermann.nextcloud.deck; +package it.niedermann.nextcloud.deck.ui.card.comments.util; import org.junit.Assert; import org.junit.Test; -import it.niedermann.nextcloud.deck.ui.card.comments.util.CommentsUtil; - public class CommentsUtilTest { @SuppressWarnings("ConstantConditions") diff --git a/app/src/test/java/it/niedermann/nextcloud/deck/MimeTypeUtilTest.java b/app/src/test/java/it/niedermann/nextcloud/deck/util/MimeTypeUtilTest.java index aace528d3..0cf17900b 100644 --- a/app/src/test/java/it/niedermann/nextcloud/deck/MimeTypeUtilTest.java +++ b/app/src/test/java/it/niedermann/nextcloud/deck/util/MimeTypeUtilTest.java @@ -1,12 +1,10 @@ -package it.niedermann.nextcloud.deck; +package it.niedermann.nextcloud.deck.util; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import org.junit.Test; -import it.niedermann.nextcloud.deck.util.MimeTypeUtil; - /** * Local unit tests for MimeType detection */ |