|
|
|
@ -7,6 +7,7 @@ import android.view.ViewGroup
|
|
|
|
import androidx.core.graphics.Insets
|
|
|
|
import androidx.core.graphics.Insets
|
|
|
|
import androidx.core.view.updatePadding
|
|
|
|
import androidx.core.view.updatePadding
|
|
|
|
import androidx.fragment.app.viewModels
|
|
|
|
import androidx.fragment.app.viewModels
|
|
|
|
|
|
|
|
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
|
|
|
import coil.ImageLoader
|
|
|
|
import coil.ImageLoader
|
|
|
|
import com.google.android.material.snackbar.Snackbar
|
|
|
|
import com.google.android.material.snackbar.Snackbar
|
|
|
|
import dagger.hilt.android.AndroidEntryPoint
|
|
|
|
import dagger.hilt.android.AndroidEntryPoint
|
|
|
|
@ -33,7 +34,7 @@ import javax.inject.Inject
|
|
|
|
class FeedFragment :
|
|
|
|
class FeedFragment :
|
|
|
|
BaseFragment<FragmentFeedBinding>(),
|
|
|
|
BaseFragment<FragmentFeedBinding>(),
|
|
|
|
PaginationScrollListener.Callback,
|
|
|
|
PaginationScrollListener.Callback,
|
|
|
|
MangaListListener {
|
|
|
|
MangaListListener, SwipeRefreshLayout.OnRefreshListener {
|
|
|
|
|
|
|
|
|
|
|
|
@Inject
|
|
|
|
@Inject
|
|
|
|
lateinit var coil: ImageLoader
|
|
|
|
lateinit var coil: ImageLoader
|
|
|
|
@ -64,7 +65,7 @@ class FeedFragment :
|
|
|
|
with(binding.swipeRefreshLayout) {
|
|
|
|
with(binding.swipeRefreshLayout) {
|
|
|
|
setProgressBackgroundColorSchemeColor(context.getThemeColor(com.google.android.material.R.attr.colorPrimary))
|
|
|
|
setProgressBackgroundColorSchemeColor(context.getThemeColor(com.google.android.material.R.attr.colorPrimary))
|
|
|
|
setColorSchemeColors(context.getThemeColor(com.google.android.material.R.attr.colorOnPrimary))
|
|
|
|
setColorSchemeColors(context.getThemeColor(com.google.android.material.R.attr.colorOnPrimary))
|
|
|
|
isEnabled = false
|
|
|
|
setOnRefreshListener(this@FeedFragment)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
addMenuProvider(
|
|
|
|
addMenuProvider(
|
|
|
|
FeedMenuProvider(
|
|
|
|
FeedMenuProvider(
|
|
|
|
@ -94,6 +95,10 @@ class FeedFragment :
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun onRefresh() {
|
|
|
|
|
|
|
|
TrackWorker.startNow(context ?: return)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
override fun onRetryClick(error: Throwable) = Unit
|
|
|
|
override fun onRetryClick(error: Throwable) = Unit
|
|
|
|
|
|
|
|
|
|
|
|
override fun onUpdateFilter(tags: Set<MangaTag>) = Unit
|
|
|
|
override fun onUpdateFilter(tags: Set<MangaTag>) = Unit
|
|
|
|
|