kopia lustrzana https://github.com/TeamNewPipe/NewPipe
Merge pull request #6550 from Douile/fix/clickthrough-feed-refresh
Disable feed click events while refresh overlay is shownpull/6827/head
commit
a9623f8e6a
|
@ -96,6 +96,7 @@ class FeedFragment : BaseStateFragment<FeedState>() {
|
|||
|
||||
private var onSettingsChangeListener: SharedPreferences.OnSharedPreferenceChangeListener? = null
|
||||
private var updateListViewModeOnResume = false
|
||||
private var isRefreshing = false
|
||||
|
||||
init {
|
||||
setHasOptionsMenu(true)
|
||||
|
@ -259,6 +260,7 @@ class FeedFragment : BaseStateFragment<FeedState>() {
|
|||
feedBinding.refreshRootView.animate(false, 0)
|
||||
feedBinding.loadingProgressText.animate(true, 200)
|
||||
feedBinding.swipeRefreshLayout.isRefreshing = true
|
||||
isRefreshing = true
|
||||
}
|
||||
|
||||
override fun hideLoading() {
|
||||
|
@ -267,6 +269,7 @@ class FeedFragment : BaseStateFragment<FeedState>() {
|
|||
feedBinding.refreshRootView.animate(true, 200)
|
||||
feedBinding.loadingProgressText.animate(false, 0)
|
||||
feedBinding.swipeRefreshLayout.isRefreshing = false
|
||||
isRefreshing = false
|
||||
}
|
||||
|
||||
override fun showEmptyState() {
|
||||
|
@ -293,6 +296,7 @@ class FeedFragment : BaseStateFragment<FeedState>() {
|
|||
feedBinding.refreshRootView.animate(false, 0)
|
||||
feedBinding.loadingProgressText.animate(false, 0)
|
||||
feedBinding.swipeRefreshLayout.isRefreshing = false
|
||||
isRefreshing = false
|
||||
}
|
||||
|
||||
private fun handleProgressState(progressState: FeedState.ProgressState) {
|
||||
|
@ -359,7 +363,7 @@ class FeedFragment : BaseStateFragment<FeedState>() {
|
|||
|
||||
private val listenerStreamItem = object : OnItemClickListener, OnItemLongClickListener {
|
||||
override fun onItemClick(item: Item<*>, view: View) {
|
||||
if (item is StreamItem) {
|
||||
if (item is StreamItem && !isRefreshing) {
|
||||
val stream = item.streamWithState.stream
|
||||
NavigationHelper.openVideoDetailFragment(
|
||||
requireContext(), fm,
|
||||
|
@ -369,7 +373,7 @@ class FeedFragment : BaseStateFragment<FeedState>() {
|
|||
}
|
||||
|
||||
override fun onItemLongClick(item: Item<*>, view: View): Boolean {
|
||||
if (item is StreamItem) {
|
||||
if (item is StreamItem && !isRefreshing) {
|
||||
showStreamDialog(item.streamWithState.stream.toStreamInfoItem())
|
||||
return true
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue