change: Move RefreshableFragment to core.activity (#450)
This commit is contained in:
parent
11bf47e3b3
commit
4dbf6065fd
|
@ -20,8 +20,8 @@ import androidx.fragment.app.Fragment
|
||||||
import androidx.fragment.app.FragmentActivity
|
import androidx.fragment.app.FragmentActivity
|
||||||
import app.pachli.components.account.media.AccountMediaFragment
|
import app.pachli.components.account.media.AccountMediaFragment
|
||||||
import app.pachli.components.timeline.TimelineFragment
|
import app.pachli.components.timeline.TimelineFragment
|
||||||
|
import app.pachli.core.activity.RefreshableFragment
|
||||||
import app.pachli.core.network.model.TimelineKind
|
import app.pachli.core.network.model.TimelineKind
|
||||||
import app.pachli.interfaces.RefreshableFragment
|
|
||||||
import app.pachli.util.CustomFragmentStateAdapter
|
import app.pachli.util.CustomFragmentStateAdapter
|
||||||
|
|
||||||
class AccountPagerAdapter(
|
class AccountPagerAdapter(
|
||||||
|
|
|
@ -33,6 +33,7 @@ import androidx.recyclerview.widget.GridLayoutManager
|
||||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout.OnRefreshListener
|
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout.OnRefreshListener
|
||||||
import app.pachli.R
|
import app.pachli.R
|
||||||
import app.pachli.core.accounts.AccountManager
|
import app.pachli.core.accounts.AccountManager
|
||||||
|
import app.pachli.core.activity.RefreshableFragment
|
||||||
import app.pachli.core.activity.openLink
|
import app.pachli.core.activity.openLink
|
||||||
import app.pachli.core.common.extensions.hide
|
import app.pachli.core.common.extensions.hide
|
||||||
import app.pachli.core.common.extensions.show
|
import app.pachli.core.common.extensions.show
|
||||||
|
@ -44,7 +45,6 @@ import app.pachli.core.network.model.Attachment
|
||||||
import app.pachli.core.preferences.PrefKeys
|
import app.pachli.core.preferences.PrefKeys
|
||||||
import app.pachli.core.preferences.SharedPreferencesRepository
|
import app.pachli.core.preferences.SharedPreferencesRepository
|
||||||
import app.pachli.databinding.FragmentTimelineBinding
|
import app.pachli.databinding.FragmentTimelineBinding
|
||||||
import app.pachli.interfaces.RefreshableFragment
|
|
||||||
import com.google.android.material.color.MaterialColors
|
import com.google.android.material.color.MaterialColors
|
||||||
import com.mikepenz.iconics.IconicsDrawable
|
import com.mikepenz.iconics.IconicsDrawable
|
||||||
import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
|
import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
|
||||||
|
|
|
@ -49,6 +49,7 @@ import app.pachli.components.timeline.viewmodel.StatusActionSuccess
|
||||||
import app.pachli.components.timeline.viewmodel.TimelineViewModel
|
import app.pachli.components.timeline.viewmodel.TimelineViewModel
|
||||||
import app.pachli.components.timeline.viewmodel.UiSuccess
|
import app.pachli.components.timeline.viewmodel.UiSuccess
|
||||||
import app.pachli.core.activity.BaseActivity
|
import app.pachli.core.activity.BaseActivity
|
||||||
|
import app.pachli.core.activity.RefreshableFragment
|
||||||
import app.pachli.core.common.extensions.hide
|
import app.pachli.core.common.extensions.hide
|
||||||
import app.pachli.core.common.extensions.show
|
import app.pachli.core.common.extensions.show
|
||||||
import app.pachli.core.common.extensions.viewBinding
|
import app.pachli.core.common.extensions.viewBinding
|
||||||
|
@ -63,7 +64,6 @@ import app.pachli.databinding.FragmentTimelineBinding
|
||||||
import app.pachli.fragment.SFragment
|
import app.pachli.fragment.SFragment
|
||||||
import app.pachli.interfaces.ActionButtonActivity
|
import app.pachli.interfaces.ActionButtonActivity
|
||||||
import app.pachli.interfaces.AppBarLayoutHost
|
import app.pachli.interfaces.AppBarLayoutHost
|
||||||
import app.pachli.interfaces.RefreshableFragment
|
|
||||||
import app.pachli.interfaces.ReselectableFragment
|
import app.pachli.interfaces.ReselectableFragment
|
||||||
import app.pachli.interfaces.StatusActionListener
|
import app.pachli.interfaces.StatusActionListener
|
||||||
import app.pachli.util.ListStatusAccessibilityDelegate
|
import app.pachli.util.ListStatusAccessibilityDelegate
|
||||||
|
|
|
@ -37,6 +37,7 @@ import app.pachli.R
|
||||||
import app.pachli.components.trending.viewmodel.InfallibleUiAction
|
import app.pachli.components.trending.viewmodel.InfallibleUiAction
|
||||||
import app.pachli.components.trending.viewmodel.LoadState
|
import app.pachli.components.trending.viewmodel.LoadState
|
||||||
import app.pachli.components.trending.viewmodel.TrendingLinksViewModel
|
import app.pachli.components.trending.viewmodel.TrendingLinksViewModel
|
||||||
|
import app.pachli.core.activity.RefreshableFragment
|
||||||
import app.pachli.core.activity.openLink
|
import app.pachli.core.activity.openLink
|
||||||
import app.pachli.core.common.extensions.hide
|
import app.pachli.core.common.extensions.hide
|
||||||
import app.pachli.core.common.extensions.show
|
import app.pachli.core.common.extensions.show
|
||||||
|
@ -45,7 +46,6 @@ import app.pachli.core.designsystem.R as DR
|
||||||
import app.pachli.databinding.FragmentTrendingLinksBinding
|
import app.pachli.databinding.FragmentTrendingLinksBinding
|
||||||
import app.pachli.interfaces.ActionButtonActivity
|
import app.pachli.interfaces.ActionButtonActivity
|
||||||
import app.pachli.interfaces.AppBarLayoutHost
|
import app.pachli.interfaces.AppBarLayoutHost
|
||||||
import app.pachli.interfaces.RefreshableFragment
|
|
||||||
import app.pachli.interfaces.ReselectableFragment
|
import app.pachli.interfaces.ReselectableFragment
|
||||||
import com.google.android.material.color.MaterialColors
|
import com.google.android.material.color.MaterialColors
|
||||||
import com.google.android.material.snackbar.Snackbar
|
import com.google.android.material.snackbar.Snackbar
|
||||||
|
|
|
@ -38,6 +38,7 @@ import androidx.swiperefreshlayout.widget.SwipeRefreshLayout.OnRefreshListener
|
||||||
import app.pachli.R
|
import app.pachli.R
|
||||||
import app.pachli.components.trending.viewmodel.TrendingTagsViewModel
|
import app.pachli.components.trending.viewmodel.TrendingTagsViewModel
|
||||||
import app.pachli.core.activity.BaseActivity
|
import app.pachli.core.activity.BaseActivity
|
||||||
|
import app.pachli.core.activity.RefreshableFragment
|
||||||
import app.pachli.core.common.extensions.hide
|
import app.pachli.core.common.extensions.hide
|
||||||
import app.pachli.core.common.extensions.show
|
import app.pachli.core.common.extensions.show
|
||||||
import app.pachli.core.common.extensions.viewBinding
|
import app.pachli.core.common.extensions.viewBinding
|
||||||
|
@ -46,7 +47,6 @@ import app.pachli.core.navigation.StatusListActivityIntent
|
||||||
import app.pachli.databinding.FragmentTrendingTagsBinding
|
import app.pachli.databinding.FragmentTrendingTagsBinding
|
||||||
import app.pachli.interfaces.ActionButtonActivity
|
import app.pachli.interfaces.ActionButtonActivity
|
||||||
import app.pachli.interfaces.AppBarLayoutHost
|
import app.pachli.interfaces.AppBarLayoutHost
|
||||||
import app.pachli.interfaces.RefreshableFragment
|
|
||||||
import app.pachli.interfaces.ReselectableFragment
|
import app.pachli.interfaces.ReselectableFragment
|
||||||
import app.pachli.viewdata.TrendingViewData
|
import app.pachli.viewdata.TrendingViewData
|
||||||
import at.connyduck.sparkbutton.helpers.Utils
|
import at.connyduck.sparkbutton.helpers.Utils
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
package app.pachli.interfaces
|
|
||||||
|
|
||||||
interface RefreshableFragment {
|
|
||||||
/**
|
|
||||||
* Call this method to refresh fragment content
|
|
||||||
*/
|
|
||||||
fun refreshContent()
|
|
||||||
}
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2024 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 <http://www.gnu.org/licenses>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package app.pachli.core.activity
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fragments with refreshable content should implement this interface so the
|
||||||
|
* activity/fragment hosting them can trigger a refresh.
|
||||||
|
*/
|
||||||
|
interface RefreshableFragment {
|
||||||
|
/** The displayed content should be refreshed */
|
||||||
|
fun refreshContent()
|
||||||
|
}
|
Loading…
Reference in New Issue