From 892663cab3f3de9871756bc3845ae5c6d6d576fe Mon Sep 17 00:00:00 2001 From: Nik Clayton Date: Thu, 13 Jun 2024 21:16:10 +0200 Subject: [PATCH] refactor: Move ReselectableFragment to core.activity (#743) --- app/src/main/java/app/pachli/MainActivity.kt | 2 +- .../main/java/app/pachli/components/account/AccountActivity.kt | 2 +- .../app/pachli/components/conversation/ConversationsFragment.kt | 2 +- .../pachli/components/notifications/NotificationsFragment.kt | 2 +- .../java/app/pachli/components/timeline/TimelineFragment.kt | 2 +- .../java/app/pachli/components/trending/TrendingActivity.kt | 2 +- .../app/pachli/components/trending/TrendingLinksFragment.kt | 2 +- .../java/app/pachli/components/trending/TrendingTagsFragment.kt | 2 +- .../kotlin/app/pachli/core/activity}/ReselectableFragment.kt | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) rename {app/src/main/java/app/pachli/interfaces => core/activity/src/main/kotlin/app/pachli/core/activity}/ReselectableFragment.kt (78%) diff --git a/app/src/main/java/app/pachli/MainActivity.kt b/app/src/main/java/app/pachli/MainActivity.kt index 37c6d9bb1..07692a888 100644 --- a/app/src/main/java/app/pachli/MainActivity.kt +++ b/app/src/main/java/app/pachli/MainActivity.kt @@ -69,6 +69,7 @@ import app.pachli.components.notifications.showMigrationNoticeIfNecessary import app.pachli.core.activity.AccountSelectionListener import app.pachli.core.activity.BottomSheetActivity import app.pachli.core.activity.PostLookupFallbackBehavior +import app.pachli.core.activity.ReselectableFragment import app.pachli.core.activity.emojify import app.pachli.core.activity.extensions.TransitionKind import app.pachli.core.activity.extensions.startActivityWithDefaultTransition @@ -111,7 +112,6 @@ import app.pachli.core.ui.extensions.reduceSwipeSensitivity import app.pachli.databinding.ActivityMainBinding import app.pachli.db.DraftsAlert import app.pachli.interfaces.ActionButtonActivity -import app.pachli.interfaces.ReselectableFragment import app.pachli.pager.MainPagerAdapter import app.pachli.updatecheck.UpdateCheck import app.pachli.usecase.DeveloperToolsUseCase diff --git a/app/src/main/java/app/pachli/components/account/AccountActivity.kt b/app/src/main/java/app/pachli/components/account/AccountActivity.kt index 5e90760b4..4abe795ef 100644 --- a/app/src/main/java/app/pachli/components/account/AccountActivity.kt +++ b/app/src/main/java/app/pachli/components/account/AccountActivity.kt @@ -56,6 +56,7 @@ import androidx.viewpager2.widget.MarginPageTransformer import app.pachli.R import app.pachli.core.activity.AccountSelectionListener import app.pachli.core.activity.BottomSheetActivity +import app.pachli.core.activity.ReselectableFragment import app.pachli.core.activity.emojify import app.pachli.core.activity.extensions.TransitionKind import app.pachli.core.activity.extensions.startActivityWithDefaultTransition @@ -88,7 +89,6 @@ import app.pachli.databinding.ActivityAccountBinding import app.pachli.db.DraftsAlert import app.pachli.feature.lists.ListsForAccountFragment import app.pachli.interfaces.ActionButtonActivity -import app.pachli.interfaces.ReselectableFragment import app.pachli.util.Error import app.pachli.util.Loading import app.pachli.util.Success diff --git a/app/src/main/java/app/pachli/components/conversation/ConversationsFragment.kt b/app/src/main/java/app/pachli/components/conversation/ConversationsFragment.kt index c1ec5a366..8cf8e8066 100644 --- a/app/src/main/java/app/pachli/components/conversation/ConversationsFragment.kt +++ b/app/src/main/java/app/pachli/components/conversation/ConversationsFragment.kt @@ -38,6 +38,7 @@ import androidx.swiperefreshlayout.widget.SwipeRefreshLayout.OnRefreshListener import app.pachli.R import app.pachli.adapter.StatusBaseViewHolder import app.pachli.appstore.EventHub +import app.pachli.core.activity.ReselectableFragment import app.pachli.core.common.extensions.hide import app.pachli.core.common.extensions.show import app.pachli.core.common.extensions.viewBinding @@ -54,7 +55,6 @@ import app.pachli.core.ui.BackgroundMessage import app.pachli.databinding.FragmentTimelineBinding import app.pachli.fragment.SFragment import app.pachli.interfaces.ActionButtonActivity -import app.pachli.interfaces.ReselectableFragment import app.pachli.interfaces.StatusActionListener import app.pachli.util.ListStatusAccessibilityDelegate import at.connyduck.sparkbutton.helpers.Utils diff --git a/app/src/main/java/app/pachli/components/notifications/NotificationsFragment.kt b/app/src/main/java/app/pachli/components/notifications/NotificationsFragment.kt index c87f7e2e9..7e9488023 100644 --- a/app/src/main/java/app/pachli/components/notifications/NotificationsFragment.kt +++ b/app/src/main/java/app/pachli/components/notifications/NotificationsFragment.kt @@ -48,6 +48,7 @@ import androidx.swiperefreshlayout.widget.SwipeRefreshLayout.OnRefreshListener import app.pachli.R import app.pachli.adapter.StatusBaseViewHolder import app.pachli.components.timeline.TimelineLoadStateAdapter +import app.pachli.core.activity.ReselectableFragment import app.pachli.core.activity.openLink import app.pachli.core.common.extensions.hide import app.pachli.core.common.extensions.show @@ -64,7 +65,6 @@ import app.pachli.databinding.FragmentTimelineNotificationsBinding import app.pachli.fragment.SFragment import app.pachli.interfaces.AccountActionListener import app.pachli.interfaces.ActionButtonActivity -import app.pachli.interfaces.ReselectableFragment import app.pachli.interfaces.StatusActionListener import app.pachli.util.ListStatusAccessibilityDelegate import app.pachli.util.UserRefreshState diff --git a/app/src/main/java/app/pachli/components/timeline/TimelineFragment.kt b/app/src/main/java/app/pachli/components/timeline/TimelineFragment.kt index 27610c3b7..2dfcddd2a 100644 --- a/app/src/main/java/app/pachli/components/timeline/TimelineFragment.kt +++ b/app/src/main/java/app/pachli/components/timeline/TimelineFragment.kt @@ -50,6 +50,7 @@ import app.pachli.components.timeline.viewmodel.StatusActionSuccess import app.pachli.components.timeline.viewmodel.TimelineViewModel import app.pachli.components.timeline.viewmodel.UiSuccess import app.pachli.core.activity.RefreshableFragment +import app.pachli.core.activity.ReselectableFragment import app.pachli.core.activity.extensions.startActivityWithDefaultTransition import app.pachli.core.common.extensions.hide import app.pachli.core.common.extensions.show @@ -67,7 +68,6 @@ import app.pachli.databinding.FragmentTimelineBinding import app.pachli.fragment.SFragment import app.pachli.interfaces.ActionButtonActivity import app.pachli.interfaces.AppBarLayoutHost -import app.pachli.interfaces.ReselectableFragment import app.pachli.interfaces.StatusActionListener import app.pachli.util.ListStatusAccessibilityDelegate import app.pachli.util.PresentationState diff --git a/app/src/main/java/app/pachli/components/trending/TrendingActivity.kt b/app/src/main/java/app/pachli/components/trending/TrendingActivity.kt index ac914e89a..8f72539f2 100644 --- a/app/src/main/java/app/pachli/components/trending/TrendingActivity.kt +++ b/app/src/main/java/app/pachli/components/trending/TrendingActivity.kt @@ -30,12 +30,12 @@ import app.pachli.TabViewData import app.pachli.appstore.EventHub import app.pachli.appstore.MainTabsChangedEvent import app.pachli.core.activity.BottomSheetActivity +import app.pachli.core.activity.ReselectableFragment import app.pachli.core.common.extensions.viewBinding import app.pachli.core.model.Timeline import app.pachli.core.ui.extensions.reduceSwipeSensitivity import app.pachli.databinding.ActivityTrendingBinding import app.pachli.interfaces.AppBarLayoutHost -import app.pachli.interfaces.ReselectableFragment import app.pachli.pager.MainPagerAdapter import com.google.android.material.appbar.AppBarLayout import com.google.android.material.tabs.TabLayout diff --git a/app/src/main/java/app/pachli/components/trending/TrendingLinksFragment.kt b/app/src/main/java/app/pachli/components/trending/TrendingLinksFragment.kt index c1ec3d82a..49b53cb18 100644 --- a/app/src/main/java/app/pachli/components/trending/TrendingLinksFragment.kt +++ b/app/src/main/java/app/pachli/components/trending/TrendingLinksFragment.kt @@ -39,6 +39,7 @@ import app.pachli.components.trending.viewmodel.InfallibleUiAction import app.pachli.components.trending.viewmodel.LoadState import app.pachli.components.trending.viewmodel.TrendingLinksViewModel import app.pachli.core.activity.RefreshableFragment +import app.pachli.core.activity.ReselectableFragment import app.pachli.core.activity.openLink import app.pachli.core.common.extensions.hide import app.pachli.core.common.extensions.show @@ -49,7 +50,6 @@ import app.pachli.core.ui.BackgroundMessage import app.pachli.databinding.FragmentTrendingLinksBinding import app.pachli.interfaces.ActionButtonActivity import app.pachli.interfaces.AppBarLayoutHost -import app.pachli.interfaces.ReselectableFragment import com.google.android.material.color.MaterialColors import com.google.android.material.snackbar.Snackbar import com.mikepenz.iconics.IconicsDrawable diff --git a/app/src/main/java/app/pachli/components/trending/TrendingTagsFragment.kt b/app/src/main/java/app/pachli/components/trending/TrendingTagsFragment.kt index 9de52a92e..e48c3f3f4 100644 --- a/app/src/main/java/app/pachli/components/trending/TrendingTagsFragment.kt +++ b/app/src/main/java/app/pachli/components/trending/TrendingTagsFragment.kt @@ -38,6 +38,7 @@ import androidx.swiperefreshlayout.widget.SwipeRefreshLayout.OnRefreshListener import app.pachli.R import app.pachli.components.trending.viewmodel.TrendingTagsViewModel import app.pachli.core.activity.RefreshableFragment +import app.pachli.core.activity.ReselectableFragment import app.pachli.core.activity.extensions.startActivityWithDefaultTransition import app.pachli.core.common.extensions.hide import app.pachli.core.common.extensions.show @@ -48,7 +49,6 @@ import app.pachli.core.ui.BackgroundMessage import app.pachli.databinding.FragmentTrendingTagsBinding import app.pachli.interfaces.ActionButtonActivity import app.pachli.interfaces.AppBarLayoutHost -import app.pachli.interfaces.ReselectableFragment import app.pachli.viewdata.TrendingViewData import at.connyduck.sparkbutton.helpers.Utils import com.google.android.material.color.MaterialColors diff --git a/app/src/main/java/app/pachli/interfaces/ReselectableFragment.kt b/core/activity/src/main/kotlin/app/pachli/core/activity/ReselectableFragment.kt similarity index 78% rename from app/src/main/java/app/pachli/interfaces/ReselectableFragment.kt rename to core/activity/src/main/kotlin/app/pachli/core/activity/ReselectableFragment.kt index 4c64c9d4f..d6d8f3b6c 100644 --- a/app/src/main/java/app/pachli/interfaces/ReselectableFragment.kt +++ b/core/activity/src/main/kotlin/app/pachli/core/activity/ReselectableFragment.kt @@ -1,4 +1,4 @@ -package app.pachli.interfaces +package app.pachli.core.activity interface ReselectableFragment { /**