From 0d5d118267abea550d4ef818f86941ff30acdcb5 Mon Sep 17 00:00:00 2001 From: Nik Clayton Date: Thu, 3 Oct 2024 21:28:01 +0200 Subject: [PATCH] refactor: Move AccountManager to core.data.repository (#976) --- app/build.gradle.kts | 1 - .../java/app/pachli/appstore/CacheUpdater.kt | 2 +- .../components/account/AccountViewModel.kt | 5 ++- .../account/media/AccountMediaViewModel.kt | 2 +- .../accountlist/AccountListFragment.kt | 2 +- .../components/compose/ComposeViewModel.kt | 2 +- .../ConversationsRemoteMediator.kt | 2 +- .../conversation/ConversationsViewModel.kt | 2 +- .../components/drafts/DraftsViewModel.kt | 2 +- .../notifications/NotificationFetcher.kt | 2 +- .../notifications/NotificationsViewModel.kt | 2 +- .../notifications/PushNotificationHelper.kt | 2 +- .../AndroidNotificationsAreEnabledUseCase.kt | 2 +- .../domain/EnableAllNotificationsUseCase.kt | 2 +- .../preference/AccountPreferencesFragment.kt | 2 +- .../NotificationPreferencesFragment.kt | 2 +- .../preference/PreferencesFragment.kt | 2 +- .../fragments/ReportStatusesFragment.kt | 2 +- .../components/search/SearchViewModel.kt | 2 +- .../timeline/CachedTimelineRepository.kt | 2 +- .../timeline/NetworkTimelineRepository.kt | 2 +- .../viewmodel/CachedTimelineRemoteMediator.kt | 2 +- .../viewmodel/CachedTimelineViewModel.kt | 2 +- .../NetworkTimelineRemoteMediator.kt | 2 +- .../viewmodel/NetworkTimelineViewModel.kt | 2 +- .../timeline/viewmodel/TimelineViewModel.kt | 2 +- .../viewmodel/TrendingLinksViewModel.kt | 2 +- .../viewthread/ViewThreadViewModel.kt | 2 +- .../main/java/app/pachli/db/DraftsAlert.kt | 2 +- .../java/app/pachli/fragment/SFragment.kt | 2 +- .../receiver/SendStatusBroadcastReceiver.kt | 2 +- .../receiver/UnifiedPushBroadcastReceiver.kt | 2 +- .../app/pachli/service/SendStatusService.kt | 2 +- .../java/app/pachli/usecase/LogoutUseCase.kt | 2 +- .../app/pachli/util/ShareShortcutHelper.kt | 2 +- .../app/pachli/worker/PruneCacheWorker.kt | 2 +- .../test/java/app/pachli/MainActivityTest.kt | 2 +- .../components/compose/ComposeActivityTest.kt | 2 +- .../NotificationsViewModelTestBase.kt | 2 +- .../CachedTimelineRemoteMediatorTest.kt | 2 +- .../CachedTimelineViewModelTestBase.kt | 2 +- .../NetworkTimelineRemoteMediatorTest.kt | 2 +- .../NetworkTimelineViewModelTestBase.kt | 2 +- .../viewthread/ViewThreadViewModelTest.kt | 2 +- .../StatusDisplayOptionsRepositoryTest.kt | 2 +- core/accounts/build.gradle.kts | 43 ------------------- core/accounts/lint-baseline.xml | 4 -- .../src/main/kotlin/AndroidManifest.xml | 21 --------- core/activity/build.gradle.kts | 3 +- .../app/pachli/core/activity/BaseActivity.kt | 2 +- core/data/build.gradle.kts | 1 - .../core/data/repository}/AccountManager.kt | 2 +- .../repository/AccountPreferenceDataStore.kt | 1 - .../data/repository/InstanceInfoRepository.kt | 1 - .../data/repository/NetworkListsRepository.kt | 1 - .../core/data/repository/ServerRepository.kt | 1 - .../StatusDisplayOptionsRepository.kt | 1 - .../repository/InstanceInfoRepositoryTest.kt | 1 - core/domain/build.gradle.kts | 2 +- .../feature/about/AboutFragmentViewModel.kt | 2 +- .../about/NotificationDetailsFragment.kt | 2 +- .../feature/about/NotificationViewModel.kt | 2 +- settings.gradle.kts | 1 - 63 files changed, 54 insertions(+), 129 deletions(-) delete mode 100644 core/accounts/build.gradle.kts delete mode 100644 core/accounts/lint-baseline.xml delete mode 100644 core/accounts/src/main/kotlin/AndroidManifest.xml rename core/{accounts/src/main/kotlin/app/pachli/core/accounts => data/src/main/kotlin/app/pachli/core/data/repository}/AccountManager.kt (99%) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 67b260b74..f0111e102 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -121,7 +121,6 @@ dependencies { implementation(libs.androidx.hilt.work) ksp(libs.androidx.hilt.compiler) - implementation(projects.core.accounts) implementation(projects.core.activity) implementation(projects.core.common) implementation(projects.core.data) diff --git a/app/src/main/java/app/pachli/appstore/CacheUpdater.kt b/app/src/main/java/app/pachli/appstore/CacheUpdater.kt index 7e11393ff..c20dbe025 100644 --- a/app/src/main/java/app/pachli/appstore/CacheUpdater.kt +++ b/app/src/main/java/app/pachli/appstore/CacheUpdater.kt @@ -1,6 +1,6 @@ package app.pachli.appstore -import app.pachli.core.accounts.AccountManager +import app.pachli.core.data.repository.AccountManager import app.pachli.core.database.dao.TimelineDao import app.pachli.core.network.model.Poll import com.squareup.moshi.Moshi diff --git a/app/src/main/java/app/pachli/components/account/AccountViewModel.kt b/app/src/main/java/app/pachli/components/account/AccountViewModel.kt index 63554b57f..9f58ff1bb 100644 --- a/app/src/main/java/app/pachli/components/account/AccountViewModel.kt +++ b/app/src/main/java/app/pachli/components/account/AccountViewModel.kt @@ -9,7 +9,7 @@ import app.pachli.appstore.EventHub import app.pachli.appstore.MuteEvent import app.pachli.appstore.ProfileEditedEvent import app.pachli.appstore.UnfollowEvent -import app.pachli.core.accounts.AccountManager +import app.pachli.core.data.repository.AccountManager import app.pachli.core.network.model.Account import app.pachli.core.network.model.Relationship import app.pachli.core.network.retrofit.MastodonApi @@ -137,7 +137,8 @@ class AccountViewModel @Inject constructor( fun changeSubscribingState() { val relationship = relationshipData.value?.data - if (relationship?.notifying == true || // Mastodon 3.3.0rc1 + if (relationship?.notifying == true || + // Mastodon 3.3.0rc1 relationship?.subscribing == true // Pleroma ) { changeRelationship(RelationShipAction.UNSUBSCRIBE) diff --git a/app/src/main/java/app/pachli/components/account/media/AccountMediaViewModel.kt b/app/src/main/java/app/pachli/components/account/media/AccountMediaViewModel.kt index 3e0c03330..139d060af 100644 --- a/app/src/main/java/app/pachli/components/account/media/AccountMediaViewModel.kt +++ b/app/src/main/java/app/pachli/components/account/media/AccountMediaViewModel.kt @@ -22,7 +22,7 @@ import androidx.paging.ExperimentalPagingApi import androidx.paging.Pager import androidx.paging.PagingConfig import androidx.paging.cachedIn -import app.pachli.core.accounts.AccountManager +import app.pachli.core.data.repository.AccountManager import app.pachli.core.data.repository.StatusDisplayOptionsRepository import app.pachli.core.navigation.AttachmentViewData import app.pachli.core.network.retrofit.MastodonApi diff --git a/app/src/main/java/app/pachli/components/accountlist/AccountListFragment.kt b/app/src/main/java/app/pachli/components/accountlist/AccountListFragment.kt index f0953109e..b32d5c71c 100644 --- a/app/src/main/java/app/pachli/components/accountlist/AccountListFragment.kt +++ b/app/src/main/java/app/pachli/components/accountlist/AccountListFragment.kt @@ -31,13 +31,13 @@ import app.pachli.components.accountlist.adapter.FollowAdapter import app.pachli.components.accountlist.adapter.FollowRequestsAdapter import app.pachli.components.accountlist.adapter.FollowRequestsHeaderAdapter import app.pachli.components.accountlist.adapter.MutesAdapter -import app.pachli.core.accounts.AccountManager import app.pachli.core.activity.BottomSheetActivity import app.pachli.core.activity.PostLookupFallbackBehavior import app.pachli.core.activity.extensions.startActivityWithDefaultTransition import app.pachli.core.common.extensions.hide import app.pachli.core.common.extensions.show import app.pachli.core.common.extensions.viewBinding +import app.pachli.core.data.repository.AccountManager import app.pachli.core.navigation.AccountActivityIntent import app.pachli.core.navigation.AccountListActivityIntent.Kind import app.pachli.core.navigation.AccountListActivityIntent.Kind.BLOCKS diff --git a/app/src/main/java/app/pachli/components/compose/ComposeViewModel.kt b/app/src/main/java/app/pachli/components/compose/ComposeViewModel.kt index 303a74575..56f9cba95 100644 --- a/app/src/main/java/app/pachli/components/compose/ComposeViewModel.kt +++ b/app/src/main/java/app/pachli/components/compose/ComposeViewModel.kt @@ -30,10 +30,10 @@ import app.pachli.components.compose.ComposeActivity.QueuedMedia import app.pachli.components.compose.ComposeAutoCompleteAdapter.AutocompleteResult import app.pachli.components.drafts.DraftHelper import app.pachli.components.search.SearchType -import app.pachli.core.accounts.AccountManager import app.pachli.core.common.PachliError import app.pachli.core.common.string.mastodonLength import app.pachli.core.common.string.randomAlphanumericString +import app.pachli.core.data.repository.AccountManager import app.pachli.core.data.repository.InstanceInfoRepository import app.pachli.core.navigation.ComposeActivityIntent.ComposeOptions import app.pachli.core.navigation.ComposeActivityIntent.ComposeOptions.ComposeKind diff --git a/app/src/main/java/app/pachli/components/conversation/ConversationsRemoteMediator.kt b/app/src/main/java/app/pachli/components/conversation/ConversationsRemoteMediator.kt index 5ba0993bf..4474afc36 100644 --- a/app/src/main/java/app/pachli/components/conversation/ConversationsRemoteMediator.kt +++ b/app/src/main/java/app/pachli/components/conversation/ConversationsRemoteMediator.kt @@ -4,7 +4,7 @@ import androidx.paging.ExperimentalPagingApi import androidx.paging.LoadType import androidx.paging.PagingState import androidx.paging.RemoteMediator -import app.pachli.core.accounts.AccountManager +import app.pachli.core.data.repository.AccountManager import app.pachli.core.database.dao.ConversationsDao import app.pachli.core.database.di.TransactionProvider import app.pachli.core.database.model.ConversationEntity diff --git a/app/src/main/java/app/pachli/components/conversation/ConversationsViewModel.kt b/app/src/main/java/app/pachli/components/conversation/ConversationsViewModel.kt index e861bd53c..00845b72f 100644 --- a/app/src/main/java/app/pachli/components/conversation/ConversationsViewModel.kt +++ b/app/src/main/java/app/pachli/components/conversation/ConversationsViewModel.kt @@ -23,7 +23,7 @@ import androidx.paging.Pager import androidx.paging.PagingConfig import androidx.paging.cachedIn import androidx.paging.map -import app.pachli.core.accounts.AccountManager +import app.pachli.core.data.repository.AccountManager import app.pachli.core.database.Converters import app.pachli.core.database.dao.ConversationsDao import app.pachli.core.database.di.TransactionProvider diff --git a/app/src/main/java/app/pachli/components/drafts/DraftsViewModel.kt b/app/src/main/java/app/pachli/components/drafts/DraftsViewModel.kt index a4b4e850d..d6192a8b4 100644 --- a/app/src/main/java/app/pachli/components/drafts/DraftsViewModel.kt +++ b/app/src/main/java/app/pachli/components/drafts/DraftsViewModel.kt @@ -21,7 +21,7 @@ import androidx.lifecycle.viewModelScope import androidx.paging.Pager import androidx.paging.PagingConfig import androidx.paging.cachedIn -import app.pachli.core.accounts.AccountManager +import app.pachli.core.data.repository.AccountManager import app.pachli.core.database.dao.DraftDao import app.pachli.core.database.model.DraftEntity import app.pachli.core.network.model.Status diff --git a/app/src/main/java/app/pachli/components/notifications/NotificationFetcher.kt b/app/src/main/java/app/pachli/components/notifications/NotificationFetcher.kt index 73e835bcb..c6825bfe8 100644 --- a/app/src/main/java/app/pachli/components/notifications/NotificationFetcher.kt +++ b/app/src/main/java/app/pachli/components/notifications/NotificationFetcher.kt @@ -20,9 +20,9 @@ package app.pachli.components.notifications import android.app.NotificationManager import android.content.Context import androidx.annotation.WorkerThread -import app.pachli.core.accounts.AccountManager import app.pachli.core.activity.NotificationConfig import app.pachli.core.common.string.isLessThan +import app.pachli.core.data.repository.AccountManager import app.pachli.core.database.model.AccountEntity import app.pachli.core.network.model.Links import app.pachli.core.network.model.Marker diff --git a/app/src/main/java/app/pachli/components/notifications/NotificationsViewModel.kt b/app/src/main/java/app/pachli/components/notifications/NotificationsViewModel.kt index eb787bba4..2ab5d6484 100644 --- a/app/src/main/java/app/pachli/components/notifications/NotificationsViewModel.kt +++ b/app/src/main/java/app/pachli/components/notifications/NotificationsViewModel.kt @@ -30,8 +30,8 @@ import app.pachli.appstore.BlockEvent import app.pachli.appstore.EventHub import app.pachli.appstore.MuteConversationEvent import app.pachli.appstore.MuteEvent -import app.pachli.core.accounts.AccountManager import app.pachli.core.common.extensions.throttleFirst +import app.pachli.core.data.repository.AccountManager import app.pachli.core.data.repository.ContentFilterVersion import app.pachli.core.data.repository.ContentFiltersRepository import app.pachli.core.data.repository.StatusDisplayOptionsRepository diff --git a/app/src/main/java/app/pachli/components/notifications/PushNotificationHelper.kt b/app/src/main/java/app/pachli/components/notifications/PushNotificationHelper.kt index 04e5f6dec..1a3d22012 100644 --- a/app/src/main/java/app/pachli/components/notifications/PushNotificationHelper.kt +++ b/app/src/main/java/app/pachli/components/notifications/PushNotificationHelper.kt @@ -20,8 +20,8 @@ import android.content.Context import android.content.pm.PackageManager import android.os.Build import androidx.appcompat.app.AlertDialog -import app.pachli.core.accounts.AccountManager import app.pachli.core.activity.NotificationConfig +import app.pachli.core.data.repository.AccountManager import app.pachli.core.database.model.AccountEntity import app.pachli.core.network.model.Notification import app.pachli.core.network.retrofit.MastodonApi diff --git a/app/src/main/java/app/pachli/components/notifications/domain/AndroidNotificationsAreEnabledUseCase.kt b/app/src/main/java/app/pachli/components/notifications/domain/AndroidNotificationsAreEnabledUseCase.kt index a7defdc7b..8e63912d9 100644 --- a/app/src/main/java/app/pachli/components/notifications/domain/AndroidNotificationsAreEnabledUseCase.kt +++ b/app/src/main/java/app/pachli/components/notifications/domain/AndroidNotificationsAreEnabledUseCase.kt @@ -20,8 +20,8 @@ package app.pachli.components.notifications.domain import android.app.NotificationManager import android.content.Context import android.os.Build -import app.pachli.core.accounts.AccountManager import app.pachli.core.activity.NotificationConfig +import app.pachli.core.data.repository.AccountManager import java.util.Locale import javax.inject.Inject import timber.log.Timber diff --git a/app/src/main/java/app/pachli/components/notifications/domain/EnableAllNotificationsUseCase.kt b/app/src/main/java/app/pachli/components/notifications/domain/EnableAllNotificationsUseCase.kt index 5dc74db91..e5911aeff 100644 --- a/app/src/main/java/app/pachli/components/notifications/domain/EnableAllNotificationsUseCase.kt +++ b/app/src/main/java/app/pachli/components/notifications/domain/EnableAllNotificationsUseCase.kt @@ -23,8 +23,8 @@ import app.pachli.components.notifications.chooseUnifiedPushDistributor import app.pachli.components.notifications.disableAllNotifications import app.pachli.components.notifications.enablePullNotifications import app.pachli.components.notifications.hasPushScope -import app.pachli.core.accounts.AccountManager import app.pachli.core.activity.NotificationConfig +import app.pachli.core.data.repository.AccountManager import app.pachli.core.network.retrofit.MastodonApi import app.pachli.core.preferences.PrefKeys import javax.inject.Inject diff --git a/app/src/main/java/app/pachli/components/preference/AccountPreferencesFragment.kt b/app/src/main/java/app/pachli/components/preference/AccountPreferencesFragment.kt index 026b08eeb..05e9b4647 100644 --- a/app/src/main/java/app/pachli/components/preference/AccountPreferencesFragment.kt +++ b/app/src/main/java/app/pachli/components/preference/AccountPreferencesFragment.kt @@ -30,10 +30,10 @@ import app.pachli.BuildConfig import app.pachli.R import app.pachli.appstore.EventHub import app.pachli.components.notifications.activeAccountNeedsPushScope -import app.pachli.core.accounts.AccountManager import app.pachli.core.activity.extensions.TransitionKind import app.pachli.core.activity.extensions.startActivityWithTransition import app.pachli.core.common.util.unsafeLazy +import app.pachli.core.data.repository.AccountManager import app.pachli.core.data.repository.AccountPreferenceDataStore import app.pachli.core.data.repository.ContentFiltersRepository import app.pachli.core.designsystem.R as DR diff --git a/app/src/main/java/app/pachli/components/preference/NotificationPreferencesFragment.kt b/app/src/main/java/app/pachli/components/preference/NotificationPreferencesFragment.kt index 6aa035bc9..53aad88f7 100644 --- a/app/src/main/java/app/pachli/components/preference/NotificationPreferencesFragment.kt +++ b/app/src/main/java/app/pachli/components/preference/NotificationPreferencesFragment.kt @@ -22,7 +22,7 @@ import app.pachli.R import app.pachli.components.notifications.disablePullNotifications import app.pachli.components.notifications.domain.AndroidNotificationsAreEnabledUseCase import app.pachli.components.notifications.enablePullNotifications -import app.pachli.core.accounts.AccountManager +import app.pachli.core.data.repository.AccountManager import app.pachli.core.database.model.AccountEntity import app.pachli.core.preferences.PrefKeys import app.pachli.settings.makePreferenceScreen diff --git a/app/src/main/java/app/pachli/components/preference/PreferencesFragment.kt b/app/src/main/java/app/pachli/components/preference/PreferencesFragment.kt index 6876cb26e..1530b8461 100644 --- a/app/src/main/java/app/pachli/components/preference/PreferencesFragment.kt +++ b/app/src/main/java/app/pachli/components/preference/PreferencesFragment.kt @@ -42,11 +42,11 @@ import app.pachli.components.notifications.AppNotificationMethod import app.pachli.components.notifications.getApplicationLabel import app.pachli.components.notifications.hasPushScope import app.pachli.components.notifications.notificationMethod -import app.pachli.core.accounts.AccountManager import app.pachli.core.activity.NotificationConfig import app.pachli.core.common.extensions.hide import app.pachli.core.common.extensions.show import app.pachli.core.common.util.unsafeLazy +import app.pachli.core.data.repository.AccountManager import app.pachli.core.database.model.AccountEntity import app.pachli.core.designsystem.R as DR import app.pachli.core.network.model.Notification diff --git a/app/src/main/java/app/pachli/components/report/fragments/ReportStatusesFragment.kt b/app/src/main/java/app/pachli/components/report/fragments/ReportStatusesFragment.kt index 82cdc9983..a35571436 100644 --- a/app/src/main/java/app/pachli/components/report/fragments/ReportStatusesFragment.kt +++ b/app/src/main/java/app/pachli/components/report/fragments/ReportStatusesFragment.kt @@ -37,9 +37,9 @@ import app.pachli.components.report.ReportViewModel import app.pachli.components.report.Screen import app.pachli.components.report.adapter.AdapterHandler import app.pachli.components.report.adapter.StatusesAdapter -import app.pachli.core.accounts.AccountManager import app.pachli.core.common.extensions.viewBinding import app.pachli.core.common.extensions.visible +import app.pachli.core.data.repository.AccountManager import app.pachli.core.navigation.AccountActivityIntent import app.pachli.core.navigation.AttachmentViewData import app.pachli.core.navigation.TimelineActivityIntent diff --git a/app/src/main/java/app/pachli/components/search/SearchViewModel.kt b/app/src/main/java/app/pachli/components/search/SearchViewModel.kt index ad98e2ddd..1f9c55eb3 100644 --- a/app/src/main/java/app/pachli/components/search/SearchViewModel.kt +++ b/app/src/main/java/app/pachli/components/search/SearchViewModel.kt @@ -33,7 +33,7 @@ import app.pachli.components.search.SearchOperator.IsSensitiveOperator import app.pachli.components.search.SearchOperator.LanguageOperator import app.pachli.components.search.SearchOperator.WhereOperator import app.pachli.components.search.adapter.SearchPagingSourceFactory -import app.pachli.core.accounts.AccountManager +import app.pachli.core.data.repository.AccountManager import app.pachli.core.data.repository.ServerRepository import app.pachli.core.database.model.AccountEntity import app.pachli.core.model.ServerOperation.ORG_JOINMASTODON_SEARCH_QUERY_BY_DATE diff --git a/app/src/main/java/app/pachli/components/timeline/CachedTimelineRepository.kt b/app/src/main/java/app/pachli/components/timeline/CachedTimelineRepository.kt index 009ccf867..bba78d083 100644 --- a/app/src/main/java/app/pachli/components/timeline/CachedTimelineRepository.kt +++ b/app/src/main/java/app/pachli/components/timeline/CachedTimelineRepository.kt @@ -23,8 +23,8 @@ import androidx.paging.Pager import androidx.paging.PagingConfig import androidx.paging.PagingData import app.pachli.components.timeline.viewmodel.CachedTimelineRemoteMediator -import app.pachli.core.accounts.AccountManager import app.pachli.core.common.di.ApplicationScope +import app.pachli.core.data.repository.AccountManager import app.pachli.core.database.dao.RemoteKeyDao import app.pachli.core.database.dao.TimelineDao import app.pachli.core.database.dao.TranslatedStatusDao diff --git a/app/src/main/java/app/pachli/components/timeline/NetworkTimelineRepository.kt b/app/src/main/java/app/pachli/components/timeline/NetworkTimelineRepository.kt index 5be8ec931..f86f3ebc4 100644 --- a/app/src/main/java/app/pachli/components/timeline/NetworkTimelineRepository.kt +++ b/app/src/main/java/app/pachli/components/timeline/NetworkTimelineRepository.kt @@ -26,7 +26,7 @@ import androidx.paging.PagingSource import app.pachli.components.timeline.viewmodel.NetworkTimelinePagingSource import app.pachli.components.timeline.viewmodel.NetworkTimelineRemoteMediator import app.pachli.components.timeline.viewmodel.PageCache -import app.pachli.core.accounts.AccountManager +import app.pachli.core.data.repository.AccountManager import app.pachli.core.model.Timeline import app.pachli.core.network.model.Status import app.pachli.core.network.retrofit.MastodonApi diff --git a/app/src/main/java/app/pachli/components/timeline/viewmodel/CachedTimelineRemoteMediator.kt b/app/src/main/java/app/pachli/components/timeline/viewmodel/CachedTimelineRemoteMediator.kt index 2eed3b32f..cc332579f 100644 --- a/app/src/main/java/app/pachli/components/timeline/viewmodel/CachedTimelineRemoteMediator.kt +++ b/app/src/main/java/app/pachli/components/timeline/viewmodel/CachedTimelineRemoteMediator.kt @@ -24,7 +24,7 @@ import androidx.paging.LoadType import androidx.paging.PagingState import androidx.paging.RemoteMediator import androidx.room.Transaction -import app.pachli.core.accounts.AccountManager +import app.pachli.core.data.repository.AccountManager import app.pachli.core.database.dao.RemoteKeyDao import app.pachli.core.database.dao.TimelineDao import app.pachli.core.database.di.TransactionProvider diff --git a/app/src/main/java/app/pachli/components/timeline/viewmodel/CachedTimelineViewModel.kt b/app/src/main/java/app/pachli/components/timeline/viewmodel/CachedTimelineViewModel.kt index 335048bbb..d322d46b1 100644 --- a/app/src/main/java/app/pachli/components/timeline/viewmodel/CachedTimelineViewModel.kt +++ b/app/src/main/java/app/pachli/components/timeline/viewmodel/CachedTimelineViewModel.kt @@ -30,7 +30,7 @@ import app.pachli.appstore.FavoriteEvent import app.pachli.appstore.PinEvent import app.pachli.appstore.ReblogEvent import app.pachli.components.timeline.CachedTimelineRepository -import app.pachli.core.accounts.AccountManager +import app.pachli.core.data.repository.AccountManager import app.pachli.core.data.repository.ContentFiltersRepository import app.pachli.core.data.repository.StatusDisplayOptionsRepository import app.pachli.core.network.model.FilterAction diff --git a/app/src/main/java/app/pachli/components/timeline/viewmodel/NetworkTimelineRemoteMediator.kt b/app/src/main/java/app/pachli/components/timeline/viewmodel/NetworkTimelineRemoteMediator.kt index 290915001..b33c0bcdc 100644 --- a/app/src/main/java/app/pachli/components/timeline/viewmodel/NetworkTimelineRemoteMediator.kt +++ b/app/src/main/java/app/pachli/components/timeline/viewmodel/NetworkTimelineRemoteMediator.kt @@ -23,7 +23,7 @@ import androidx.paging.LoadType import androidx.paging.PagingState import androidx.paging.RemoteMediator import app.pachli.BuildConfig -import app.pachli.core.accounts.AccountManager +import app.pachli.core.data.repository.AccountManager import app.pachli.core.model.Timeline import app.pachli.core.network.model.Status import app.pachli.core.network.retrofit.MastodonApi diff --git a/app/src/main/java/app/pachli/components/timeline/viewmodel/NetworkTimelineViewModel.kt b/app/src/main/java/app/pachli/components/timeline/viewmodel/NetworkTimelineViewModel.kt index 01a7ca9e5..86409a427 100644 --- a/app/src/main/java/app/pachli/components/timeline/viewmodel/NetworkTimelineViewModel.kt +++ b/app/src/main/java/app/pachli/components/timeline/viewmodel/NetworkTimelineViewModel.kt @@ -30,7 +30,7 @@ import app.pachli.appstore.FavoriteEvent import app.pachli.appstore.PinEvent import app.pachli.appstore.ReblogEvent import app.pachli.components.timeline.NetworkTimelineRepository -import app.pachli.core.accounts.AccountManager +import app.pachli.core.data.repository.AccountManager import app.pachli.core.data.repository.ContentFiltersRepository import app.pachli.core.data.repository.StatusDisplayOptionsRepository import app.pachli.core.network.model.FilterAction diff --git a/app/src/main/java/app/pachli/components/timeline/viewmodel/TimelineViewModel.kt b/app/src/main/java/app/pachli/components/timeline/viewmodel/TimelineViewModel.kt index 26b35cd0f..452b07935 100644 --- a/app/src/main/java/app/pachli/components/timeline/viewmodel/TimelineViewModel.kt +++ b/app/src/main/java/app/pachli/components/timeline/viewmodel/TimelineViewModel.kt @@ -41,8 +41,8 @@ import app.pachli.appstore.StatusComposedEvent import app.pachli.appstore.StatusDeletedEvent import app.pachli.appstore.StatusEditedEvent import app.pachli.appstore.UnfollowEvent -import app.pachli.core.accounts.AccountManager import app.pachli.core.common.extensions.throttleFirst +import app.pachli.core.data.repository.AccountManager import app.pachli.core.data.repository.ContentFilterVersion import app.pachli.core.data.repository.ContentFiltersRepository import app.pachli.core.data.repository.StatusDisplayOptionsRepository diff --git a/app/src/main/java/app/pachli/components/trending/viewmodel/TrendingLinksViewModel.kt b/app/src/main/java/app/pachli/components/trending/viewmodel/TrendingLinksViewModel.kt index 083aff201..f2eac70ad 100644 --- a/app/src/main/java/app/pachli/components/trending/viewmodel/TrendingLinksViewModel.kt +++ b/app/src/main/java/app/pachli/components/trending/viewmodel/TrendingLinksViewModel.kt @@ -20,8 +20,8 @@ package app.pachli.components.trending.viewmodel import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import app.pachli.components.trending.TrendingLinksRepository -import app.pachli.core.accounts.AccountManager import app.pachli.core.common.extensions.throttleFirst +import app.pachli.core.data.repository.AccountManager import app.pachli.core.data.repository.StatusDisplayOptionsRepository import app.pachli.core.network.model.TrendsLink import app.pachli.core.preferences.PrefKeys diff --git a/app/src/main/java/app/pachli/components/viewthread/ViewThreadViewModel.kt b/app/src/main/java/app/pachli/components/viewthread/ViewThreadViewModel.kt index 8419ad2e6..a0920ec5b 100644 --- a/app/src/main/java/app/pachli/components/viewthread/ViewThreadViewModel.kt +++ b/app/src/main/java/app/pachli/components/viewthread/ViewThreadViewModel.kt @@ -29,7 +29,7 @@ import app.pachli.appstore.StatusDeletedEvent import app.pachli.appstore.StatusEditedEvent import app.pachli.components.timeline.CachedTimelineRepository import app.pachli.components.timeline.util.ifExpected -import app.pachli.core.accounts.AccountManager +import app.pachli.core.data.repository.AccountManager import app.pachli.core.data.repository.ContentFilterVersion import app.pachli.core.data.repository.ContentFiltersRepository import app.pachli.core.data.repository.StatusDisplayOptionsRepository diff --git a/app/src/main/java/app/pachli/db/DraftsAlert.kt b/app/src/main/java/app/pachli/db/DraftsAlert.kt index 728e41a1f..94c71cf55 100644 --- a/app/src/main/java/app/pachli/db/DraftsAlert.kt +++ b/app/src/main/java/app/pachli/db/DraftsAlert.kt @@ -23,7 +23,7 @@ import androidx.lifecycle.LifecycleCoroutineScope import androidx.lifecycle.LifecycleOwner import androidx.lifecycle.lifecycleScope import app.pachli.R -import app.pachli.core.accounts.AccountManager +import app.pachli.core.data.repository.AccountManager import app.pachli.core.database.dao.DraftDao import app.pachli.core.navigation.DraftsActivityIntent import javax.inject.Inject diff --git a/app/src/main/java/app/pachli/fragment/SFragment.kt b/app/src/main/java/app/pachli/fragment/SFragment.kt index 2fcc77f1d..3fb1943aa 100644 --- a/app/src/main/java/app/pachli/fragment/SFragment.kt +++ b/app/src/main/java/app/pachli/fragment/SFragment.kt @@ -38,13 +38,13 @@ import androidx.lifecycle.Lifecycle import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle import app.pachli.R -import app.pachli.core.accounts.AccountManager import app.pachli.core.activity.AccountSelectionListener import app.pachli.core.activity.BaseActivity import app.pachli.core.activity.BottomSheetActivity import app.pachli.core.activity.PostLookupFallbackBehavior import app.pachli.core.activity.extensions.startActivityWithDefaultTransition import app.pachli.core.activity.openLink +import app.pachli.core.data.repository.AccountManager import app.pachli.core.data.repository.ServerRepository import app.pachli.core.database.model.AccountEntity import app.pachli.core.database.model.TranslationState diff --git a/app/src/main/java/app/pachli/receiver/SendStatusBroadcastReceiver.kt b/app/src/main/java/app/pachli/receiver/SendStatusBroadcastReceiver.kt index 43439e0c2..c8b6fd1bd 100644 --- a/app/src/main/java/app/pachli/receiver/SendStatusBroadcastReceiver.kt +++ b/app/src/main/java/app/pachli/receiver/SendStatusBroadcastReceiver.kt @@ -37,8 +37,8 @@ import app.pachli.components.notifications.KEY_SENDER_ACCOUNT_IDENTIFIER import app.pachli.components.notifications.KEY_SPOILER import app.pachli.components.notifications.KEY_VISIBILITY import app.pachli.components.notifications.REPLY_ACTION -import app.pachli.core.accounts.AccountManager import app.pachli.core.common.string.randomAlphanumericString +import app.pachli.core.data.repository.AccountManager import app.pachli.core.designsystem.R as DR import app.pachli.core.network.model.Status import app.pachli.service.SendStatusService diff --git a/app/src/main/java/app/pachli/receiver/UnifiedPushBroadcastReceiver.kt b/app/src/main/java/app/pachli/receiver/UnifiedPushBroadcastReceiver.kt index dd8be520f..325b86c98 100644 --- a/app/src/main/java/app/pachli/receiver/UnifiedPushBroadcastReceiver.kt +++ b/app/src/main/java/app/pachli/receiver/UnifiedPushBroadcastReceiver.kt @@ -24,7 +24,7 @@ import androidx.work.OutOfQuotaPolicy import androidx.work.WorkManager import app.pachli.components.notifications.disablePushNotificationsForAccount import app.pachli.components.notifications.registerUnifiedPushEndpoint -import app.pachli.core.accounts.AccountManager +import app.pachli.core.data.repository.AccountManager import app.pachli.core.network.retrofit.MastodonApi import app.pachli.worker.NotificationWorker import dagger.hilt.android.AndroidEntryPoint diff --git a/app/src/main/java/app/pachli/service/SendStatusService.kt b/app/src/main/java/app/pachli/service/SendStatusService.kt index 9e3157b4a..d4bcdad6e 100644 --- a/app/src/main/java/app/pachli/service/SendStatusService.kt +++ b/app/src/main/java/app/pachli/service/SendStatusService.kt @@ -26,8 +26,8 @@ import app.pachli.appstore.StatusScheduledEvent import app.pachli.components.compose.MediaUploader import app.pachli.components.drafts.DraftHelper import app.pachli.components.notifications.pendingIntentFlags -import app.pachli.core.accounts.AccountManager import app.pachli.core.common.util.unsafeLazy +import app.pachli.core.data.repository.AccountManager import app.pachli.core.designsystem.R as DR import app.pachli.core.navigation.MainActivityIntent import app.pachli.core.network.model.Attachment diff --git a/app/src/main/java/app/pachli/usecase/LogoutUseCase.kt b/app/src/main/java/app/pachli/usecase/LogoutUseCase.kt index 6c56a9e42..b8e8a2976 100644 --- a/app/src/main/java/app/pachli/usecase/LogoutUseCase.kt +++ b/app/src/main/java/app/pachli/usecase/LogoutUseCase.kt @@ -4,7 +4,7 @@ import android.content.Context import app.pachli.components.drafts.DraftHelper import app.pachli.components.notifications.deleteNotificationChannelsForAccount import app.pachli.components.notifications.disablePushNotificationsForAccount -import app.pachli.core.accounts.AccountManager +import app.pachli.core.data.repository.AccountManager import app.pachli.core.database.dao.ConversationsDao import app.pachli.core.database.dao.RemoteKeyDao import app.pachli.core.database.dao.TimelineDao diff --git a/app/src/main/java/app/pachli/util/ShareShortcutHelper.kt b/app/src/main/java/app/pachli/util/ShareShortcutHelper.kt index fbdae7269..a6bcb35ea 100644 --- a/app/src/main/java/app/pachli/util/ShareShortcutHelper.kt +++ b/app/src/main/java/app/pachli/util/ShareShortcutHelper.kt @@ -26,7 +26,7 @@ import androidx.core.app.Person import androidx.core.content.pm.ShortcutInfoCompat import androidx.core.content.pm.ShortcutManagerCompat import androidx.core.graphics.drawable.IconCompat -import app.pachli.core.accounts.AccountManager +import app.pachli.core.data.repository.AccountManager import app.pachli.core.database.model.AccountEntity import app.pachli.core.designsystem.R as DR import app.pachli.core.navigation.MainActivityIntent diff --git a/app/src/main/java/app/pachli/worker/PruneCacheWorker.kt b/app/src/main/java/app/pachli/worker/PruneCacheWorker.kt index 521f440c3..0d275228b 100644 --- a/app/src/main/java/app/pachli/worker/PruneCacheWorker.kt +++ b/app/src/main/java/app/pachli/worker/PruneCacheWorker.kt @@ -26,7 +26,7 @@ import androidx.work.WorkerParameters import app.pachli.R import app.pachli.components.notifications.NOTIFICATION_ID_PRUNE_CACHE import app.pachli.components.notifications.createWorkerNotification -import app.pachli.core.accounts.AccountManager +import app.pachli.core.data.repository.AccountManager import app.pachli.core.database.dao.TimelineDao import dagger.assisted.Assisted import dagger.assisted.AssistedInject diff --git a/app/src/test/java/app/pachli/MainActivityTest.kt b/app/src/test/java/app/pachli/MainActivityTest.kt index f71d49e29..fae624dcb 100644 --- a/app/src/test/java/app/pachli/MainActivityTest.kt +++ b/app/src/test/java/app/pachli/MainActivityTest.kt @@ -29,7 +29,7 @@ import app.pachli.components.accountlist.AccountListActivity import app.pachli.components.compose.HiltTestApplication_Application import app.pachli.components.notifications.createNotificationChannelsForAccount import app.pachli.components.notifications.makeNotification -import app.pachli.core.accounts.AccountManager +import app.pachli.core.data.repository.AccountManager import app.pachli.core.database.model.AccountEntity import app.pachli.core.database.model.defaultTabs import app.pachli.core.model.Timeline diff --git a/app/src/test/java/app/pachli/components/compose/ComposeActivityTest.kt b/app/src/test/java/app/pachli/components/compose/ComposeActivityTest.kt index c5d8eb93b..8175d89dd 100644 --- a/app/src/test/java/app/pachli/components/compose/ComposeActivityTest.kt +++ b/app/src/test/java/app/pachli/components/compose/ComposeActivityTest.kt @@ -22,9 +22,9 @@ import androidx.test.core.app.ApplicationProvider import androidx.test.ext.junit.runners.AndroidJUnit4 import app.pachli.PachliApplication import app.pachli.R -import app.pachli.core.accounts.AccountManager import app.pachli.core.data.model.InstanceInfo.Companion.DEFAULT_CHARACTERS_RESERVED_PER_URL import app.pachli.core.data.model.InstanceInfo.Companion.DEFAULT_CHARACTER_LIMIT +import app.pachli.core.data.repository.AccountManager import app.pachli.core.data.repository.InstanceInfoRepository import app.pachli.core.navigation.ComposeActivityIntent import app.pachli.core.navigation.ComposeActivityIntent.ComposeOptions diff --git a/app/src/test/java/app/pachli/components/notifications/NotificationsViewModelTestBase.kt b/app/src/test/java/app/pachli/components/notifications/NotificationsViewModelTestBase.kt index ad0a14742..6e452792f 100644 --- a/app/src/test/java/app/pachli/components/notifications/NotificationsViewModelTestBase.kt +++ b/app/src/test/java/app/pachli/components/notifications/NotificationsViewModelTestBase.kt @@ -20,7 +20,7 @@ package app.pachli.components.notifications import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry import app.pachli.appstore.EventHub -import app.pachli.core.accounts.AccountManager +import app.pachli.core.data.repository.AccountManager import app.pachli.core.data.repository.AccountPreferenceDataStore import app.pachli.core.data.repository.ContentFilters import app.pachli.core.data.repository.ContentFiltersError diff --git a/app/src/test/java/app/pachli/components/timeline/CachedTimelineRemoteMediatorTest.kt b/app/src/test/java/app/pachli/components/timeline/CachedTimelineRemoteMediatorTest.kt index 6be1dc08e..3fd7f9dc0 100644 --- a/app/src/test/java/app/pachli/components/timeline/CachedTimelineRemoteMediatorTest.kt +++ b/app/src/test/java/app/pachli/components/timeline/CachedTimelineRemoteMediatorTest.kt @@ -12,7 +12,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry import app.pachli.components.timeline.viewmodel.CachedTimelineRemoteMediator import app.pachli.components.timeline.viewmodel.CachedTimelineRemoteMediator.Companion.TIMELINE_ID -import app.pachli.core.accounts.AccountManager +import app.pachli.core.data.repository.AccountManager import app.pachli.core.database.AppDatabase import app.pachli.core.database.Converters import app.pachli.core.database.di.TransactionProvider diff --git a/app/src/test/java/app/pachli/components/timeline/CachedTimelineViewModelTestBase.kt b/app/src/test/java/app/pachli/components/timeline/CachedTimelineViewModelTestBase.kt index cd868c187..17f461b7f 100644 --- a/app/src/test/java/app/pachli/components/timeline/CachedTimelineViewModelTestBase.kt +++ b/app/src/test/java/app/pachli/components/timeline/CachedTimelineViewModelTestBase.kt @@ -24,7 +24,7 @@ import app.pachli.PachliApplication import app.pachli.appstore.EventHub import app.pachli.components.timeline.viewmodel.CachedTimelineViewModel import app.pachli.components.timeline.viewmodel.TimelineViewModel -import app.pachli.core.accounts.AccountManager +import app.pachli.core.data.repository.AccountManager import app.pachli.core.data.repository.ContentFiltersRepository import app.pachli.core.data.repository.StatusDisplayOptionsRepository import app.pachli.core.model.Timeline diff --git a/app/src/test/java/app/pachli/components/timeline/NetworkTimelineRemoteMediatorTest.kt b/app/src/test/java/app/pachli/components/timeline/NetworkTimelineRemoteMediatorTest.kt index 1b433e699..75df4f118 100644 --- a/app/src/test/java/app/pachli/components/timeline/NetworkTimelineRemoteMediatorTest.kt +++ b/app/src/test/java/app/pachli/components/timeline/NetworkTimelineRemoteMediatorTest.kt @@ -28,7 +28,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import app.pachli.components.timeline.viewmodel.NetworkTimelineRemoteMediator import app.pachli.components.timeline.viewmodel.Page import app.pachli.components.timeline.viewmodel.PageCache -import app.pachli.core.accounts.AccountManager +import app.pachli.core.data.repository.AccountManager import app.pachli.core.database.model.AccountEntity import app.pachli.core.model.Timeline import app.pachli.core.network.model.Status diff --git a/app/src/test/java/app/pachli/components/timeline/NetworkTimelineViewModelTestBase.kt b/app/src/test/java/app/pachli/components/timeline/NetworkTimelineViewModelTestBase.kt index 218b336a3..3678d1996 100644 --- a/app/src/test/java/app/pachli/components/timeline/NetworkTimelineViewModelTestBase.kt +++ b/app/src/test/java/app/pachli/components/timeline/NetworkTimelineViewModelTestBase.kt @@ -23,7 +23,7 @@ import androidx.test.platform.app.InstrumentationRegistry import app.pachli.appstore.EventHub import app.pachli.components.timeline.viewmodel.NetworkTimelineViewModel import app.pachli.components.timeline.viewmodel.TimelineViewModel -import app.pachli.core.accounts.AccountManager +import app.pachli.core.data.repository.AccountManager import app.pachli.core.data.repository.ContentFiltersRepository import app.pachli.core.data.repository.StatusDisplayOptionsRepository import app.pachli.core.model.Timeline diff --git a/app/src/test/java/app/pachli/components/viewthread/ViewThreadViewModelTest.kt b/app/src/test/java/app/pachli/components/viewthread/ViewThreadViewModelTest.kt index bb236a0d4..7213d1f1c 100644 --- a/app/src/test/java/app/pachli/components/viewthread/ViewThreadViewModelTest.kt +++ b/app/src/test/java/app/pachli/components/viewthread/ViewThreadViewModelTest.kt @@ -11,7 +11,7 @@ import app.pachli.components.compose.HiltTestApplication_Application import app.pachli.components.timeline.CachedTimelineRepository import app.pachli.components.timeline.mockStatus import app.pachli.components.timeline.mockStatusViewData -import app.pachli.core.accounts.AccountManager +import app.pachli.core.data.repository.AccountManager import app.pachli.core.data.repository.ContentFilters import app.pachli.core.data.repository.ContentFiltersError import app.pachli.core.data.repository.ContentFiltersRepository diff --git a/app/src/test/java/app/pachli/util/StatusDisplayOptionsRepositoryTest.kt b/app/src/test/java/app/pachli/util/StatusDisplayOptionsRepositoryTest.kt index 21a3a0c1a..43ac75377 100644 --- a/app/src/test/java/app/pachli/util/StatusDisplayOptionsRepositoryTest.kt +++ b/app/src/test/java/app/pachli/util/StatusDisplayOptionsRepositoryTest.kt @@ -21,8 +21,8 @@ import androidx.core.content.edit import androidx.test.ext.junit.runners.AndroidJUnit4 import app.cash.turbine.test import app.pachli.PachliApplication -import app.pachli.core.accounts.AccountManager import app.pachli.core.data.model.StatusDisplayOptions +import app.pachli.core.data.repository.AccountManager import app.pachli.core.data.repository.AccountPreferenceDataStore import app.pachli.core.data.repository.StatusDisplayOptionsRepository import app.pachli.core.network.model.Account diff --git a/core/accounts/build.gradle.kts b/core/accounts/build.gradle.kts deleted file mode 100644 index 38f68f221..000000000 --- a/core/accounts/build.gradle.kts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2023 Pachli Association - * - * This file is a part of Pachli. - * - * This program is free software; you can redistribute it and/or modify it under the terms of the - * GNU General Public License as published by the Free Software Foundation; either version 3 of the - * License, or (at your option) any later version. - * - * Pachli is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General - * Public License for more details. - * - * You should have received a copy of the GNU General Public License along with Pachli; if not, - * see . - */ - -plugins { - alias(libs.plugins.pachli.android.library) - alias(libs.plugins.pachli.android.hilt) -} - -android { - namespace = "app.pachli.core.accounts" - - defaultConfig { - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - } -} - -dependencies { - // Depends on the okhttp3.Interceptor type - // class app.pachli.core.network.retrofit.InstanceSwitchAuthInterceptor, unresolved supertypes: okhttp3.Interceptor - compileOnly(libs.bundles.okhttp) - - // AccountManager exposes AccountEntity as part of its public API - // TODO: This should be wrapped in a type from this module to prevent this - api(projects.core.database) - - implementation(projects.core.common) - implementation(projects.core.network) - implementation(projects.core.preferences) -} diff --git a/core/accounts/lint-baseline.xml b/core/accounts/lint-baseline.xml deleted file mode 100644 index f32fed49a..000000000 --- a/core/accounts/lint-baseline.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/core/accounts/src/main/kotlin/AndroidManifest.xml b/core/accounts/src/main/kotlin/AndroidManifest.xml deleted file mode 100644 index 76e9ba6e7..000000000 --- a/core/accounts/src/main/kotlin/AndroidManifest.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - diff --git a/core/activity/build.gradle.kts b/core/activity/build.gradle.kts index f3a1809a9..f88b652c1 100644 --- a/core/activity/build.gradle.kts +++ b/core/activity/build.gradle.kts @@ -31,8 +31,9 @@ android { dependencies { // BaseActivity exposes AccountManager as an injected property - api(projects.core.accounts) + api(projects.core.database) + api(projects.core.data) implementation(projects.core.common) implementation(projects.core.designsystem) implementation(projects.core.navigation) diff --git a/core/activity/src/main/kotlin/app/pachli/core/activity/BaseActivity.kt b/core/activity/src/main/kotlin/app/pachli/core/activity/BaseActivity.kt index 5a6147270..1c2102602 100644 --- a/core/activity/src/main/kotlin/app/pachli/core/activity/BaseActivity.kt +++ b/core/activity/src/main/kotlin/app/pachli/core/activity/BaseActivity.kt @@ -36,10 +36,10 @@ import androidx.appcompat.app.AppCompatActivity import androidx.core.app.ActivityCompat import androidx.core.content.ContextCompat import androidx.core.view.MenuProvider -import app.pachli.core.accounts.AccountManager import app.pachli.core.activity.extensions.canOverrideActivityTransitions import app.pachli.core.activity.extensions.getTransitionKind import app.pachli.core.activity.extensions.startActivityWithDefaultTransition +import app.pachli.core.data.repository.AccountManager import app.pachli.core.database.model.AccountEntity import app.pachli.core.designsystem.EmbeddedFontFamily import app.pachli.core.designsystem.R as DR diff --git a/core/data/build.gradle.kts b/core/data/build.gradle.kts index 2097e7d85..e7d38c33e 100644 --- a/core/data/build.gradle.kts +++ b/core/data/build.gradle.kts @@ -30,7 +30,6 @@ android { } dependencies { - implementation(projects.core.accounts) implementation(projects.core.common) implementation(projects.core.database) implementation(projects.core.model) diff --git a/core/accounts/src/main/kotlin/app/pachli/core/accounts/AccountManager.kt b/core/data/src/main/kotlin/app/pachli/core/data/repository/AccountManager.kt similarity index 99% rename from core/accounts/src/main/kotlin/app/pachli/core/accounts/AccountManager.kt rename to core/data/src/main/kotlin/app/pachli/core/data/repository/AccountManager.kt index 76ccf94e3..fc8525a6d 100644 --- a/core/accounts/src/main/kotlin/app/pachli/core/accounts/AccountManager.kt +++ b/core/data/src/main/kotlin/app/pachli/core/data/repository/AccountManager.kt @@ -15,7 +15,7 @@ * see . */ -package app.pachli.core.accounts +package app.pachli.core.data.repository import android.content.Context import app.pachli.core.common.di.ApplicationScope diff --git a/core/data/src/main/kotlin/app/pachli/core/data/repository/AccountPreferenceDataStore.kt b/core/data/src/main/kotlin/app/pachli/core/data/repository/AccountPreferenceDataStore.kt index 43d9f2f06..ef86e3542 100644 --- a/core/data/src/main/kotlin/app/pachli/core/data/repository/AccountPreferenceDataStore.kt +++ b/core/data/src/main/kotlin/app/pachli/core/data/repository/AccountPreferenceDataStore.kt @@ -18,7 +18,6 @@ package app.pachli.core.data.repository import androidx.preference.PreferenceDataStore -import app.pachli.core.accounts.AccountManager import app.pachli.core.common.di.ApplicationScope import app.pachli.core.preferences.PrefKeys import javax.inject.Inject diff --git a/core/data/src/main/kotlin/app/pachli/core/data/repository/InstanceInfoRepository.kt b/core/data/src/main/kotlin/app/pachli/core/data/repository/InstanceInfoRepository.kt index 80041bced..750703768 100644 --- a/core/data/src/main/kotlin/app/pachli/core/data/repository/InstanceInfoRepository.kt +++ b/core/data/src/main/kotlin/app/pachli/core/data/repository/InstanceInfoRepository.kt @@ -18,7 +18,6 @@ package app.pachli.core.data.repository import androidx.annotation.VisibleForTesting -import app.pachli.core.accounts.AccountManager import app.pachli.core.common.di.ApplicationScope import app.pachli.core.data.model.InstanceInfo import app.pachli.core.data.model.InstanceInfo.Companion.DEFAULT_CHARACTERS_RESERVED_PER_URL diff --git a/core/data/src/main/kotlin/app/pachli/core/data/repository/NetworkListsRepository.kt b/core/data/src/main/kotlin/app/pachli/core/data/repository/NetworkListsRepository.kt index 198d62588..ef08c33dc 100644 --- a/core/data/src/main/kotlin/app/pachli/core/data/repository/NetworkListsRepository.kt +++ b/core/data/src/main/kotlin/app/pachli/core/data/repository/NetworkListsRepository.kt @@ -17,7 +17,6 @@ package app.pachli.core.data.repository -import app.pachli.core.accounts.AccountManager import app.pachli.core.common.di.ApplicationScope import app.pachli.core.data.repository.ListsError.Create import app.pachli.core.data.repository.ListsError.Delete diff --git a/core/data/src/main/kotlin/app/pachli/core/data/repository/ServerRepository.kt b/core/data/src/main/kotlin/app/pachli/core/data/repository/ServerRepository.kt index 3878218bc..ea013d4b2 100644 --- a/core/data/src/main/kotlin/app/pachli/core/data/repository/ServerRepository.kt +++ b/core/data/src/main/kotlin/app/pachli/core/data/repository/ServerRepository.kt @@ -18,7 +18,6 @@ package app.pachli.core.data.repository import androidx.annotation.StringRes -import app.pachli.core.accounts.AccountManager import app.pachli.core.common.PachliError import app.pachli.core.common.di.ApplicationScope import app.pachli.core.data.R diff --git a/core/data/src/main/kotlin/app/pachli/core/data/repository/StatusDisplayOptionsRepository.kt b/core/data/src/main/kotlin/app/pachli/core/data/repository/StatusDisplayOptionsRepository.kt index 2a3286eba..46e9ed755 100644 --- a/core/data/src/main/kotlin/app/pachli/core/data/repository/StatusDisplayOptionsRepository.kt +++ b/core/data/src/main/kotlin/app/pachli/core/data/repository/StatusDisplayOptionsRepository.kt @@ -19,7 +19,6 @@ package app.pachli.core.data.repository import androidx.annotation.VisibleForTesting import androidx.annotation.VisibleForTesting.Companion.PRIVATE -import app.pachli.core.accounts.AccountManager import app.pachli.core.common.di.ApplicationScope import app.pachli.core.data.model.StatusDisplayOptions import app.pachli.core.database.model.AccountEntity diff --git a/core/data/src/test/kotlin/app/pachli/core/data/repository/InstanceInfoRepositoryTest.kt b/core/data/src/test/kotlin/app/pachli/core/data/repository/InstanceInfoRepositoryTest.kt index 0f0b51caf..0c41868cc 100644 --- a/core/data/src/test/kotlin/app/pachli/core/data/repository/InstanceInfoRepositoryTest.kt +++ b/core/data/src/test/kotlin/app/pachli/core/data/repository/InstanceInfoRepositoryTest.kt @@ -20,7 +20,6 @@ package app.pachli.core.data.repository import android.app.Application import androidx.test.ext.junit.runners.AndroidJUnit4 import app.cash.turbine.test -import app.pachli.core.accounts.AccountManager import app.pachli.core.data.model.InstanceInfo.Companion.DEFAULT_CHARACTER_LIMIT import app.pachli.core.network.model.Account import app.pachli.core.network.model.InstanceConfiguration diff --git a/core/domain/build.gradle.kts b/core/domain/build.gradle.kts index a74cde6ae..392dfb6c3 100644 --- a/core/domain/build.gradle.kts +++ b/core/domain/build.gradle.kts @@ -29,6 +29,6 @@ android { } dependencies { - implementation(projects.core.accounts) + implementation(projects.core.data) implementation(projects.core.preferences) } diff --git a/feature/about/src/main/kotlin/app/pachli/feature/about/AboutFragmentViewModel.kt b/feature/about/src/main/kotlin/app/pachli/feature/about/AboutFragmentViewModel.kt index 570f81dc6..944f40873 100644 --- a/feature/about/src/main/kotlin/app/pachli/feature/about/AboutFragmentViewModel.kt +++ b/feature/about/src/main/kotlin/app/pachli/feature/about/AboutFragmentViewModel.kt @@ -20,7 +20,7 @@ package app.pachli.feature.about import android.app.Application import androidx.lifecycle.AndroidViewModel import androidx.lifecycle.viewModelScope -import app.pachli.core.accounts.AccountManager +import app.pachli.core.data.repository.AccountManager import app.pachli.core.data.repository.InstanceInfoRepository import dagger.hilt.android.lifecycle.HiltViewModel import javax.inject.Inject diff --git a/feature/about/src/main/kotlin/app/pachli/feature/about/NotificationDetailsFragment.kt b/feature/about/src/main/kotlin/app/pachli/feature/about/NotificationDetailsFragment.kt index 8a778724a..25220f79e 100644 --- a/feature/about/src/main/kotlin/app/pachli/feature/about/NotificationDetailsFragment.kt +++ b/feature/about/src/main/kotlin/app/pachli/feature/about/NotificationDetailsFragment.kt @@ -41,13 +41,13 @@ import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.ListAdapter import androidx.recyclerview.widget.RecyclerView import androidx.work.WorkInfo -import app.pachli.core.accounts.AccountManager import app.pachli.core.activity.NotificationConfig import app.pachli.core.activity.RefreshableFragment import app.pachli.core.common.extensions.hide import app.pachli.core.common.extensions.show import app.pachli.core.common.extensions.viewBinding import app.pachli.core.common.extensions.visible +import app.pachli.core.data.repository.AccountManager import app.pachli.feature.about.databinding.FragmentNotificationDetailsBinding import app.pachli.feature.about.databinding.ItemUsageEventBinding import app.pachli.feature.about.databinding.ItemWorkInfoBinding diff --git a/feature/about/src/main/kotlin/app/pachli/feature/about/NotificationViewModel.kt b/feature/about/src/main/kotlin/app/pachli/feature/about/NotificationViewModel.kt index 4fe696f89..e06501f69 100644 --- a/feature/about/src/main/kotlin/app/pachli/feature/about/NotificationViewModel.kt +++ b/feature/about/src/main/kotlin/app/pachli/feature/about/NotificationViewModel.kt @@ -26,8 +26,8 @@ import androidx.lifecycle.AndroidViewModel import androidx.lifecycle.viewModelScope import androidx.work.WorkInfo import androidx.work.WorkManager -import app.pachli.core.accounts.AccountManager import app.pachli.core.activity.NotificationConfig +import app.pachli.core.data.repository.AccountManager import com.github.michaelbull.result.Err import com.github.michaelbull.result.Ok import dagger.hilt.android.lifecycle.HiltViewModel diff --git a/settings.gradle.kts b/settings.gradle.kts index fef15028c..74377c9a3 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -50,7 +50,6 @@ enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") rootProject.name = "pachli-android" include(":app") -include(":core:accounts") include(":core:activity") include(":core:common") include(":core:data")