Skip to content
Snippets Groups Projects
Commit 4ea966ec authored by Nicolas Pomepuy's avatar Nicolas Pomepuy
Browse files

Add delay on loading and remove useless icons

parent a20ed914
No related branches found
No related tags found
No related merge requests found
Showing
with 11 additions and 4 deletions
application/vlc-android/res/drawable-hdpi/ic_clear_orange.png

282 B

application/vlc-android/res/drawable-hdpi/ic_queue_music.png

345 B

application/vlc-android/res/drawable-mdpi/ic_clear_orange.png

213 B

application/vlc-android/res/drawable-mdpi/ic_queue_music.png

245 B

application/vlc-android/res/drawable-xhdpi/ic_clear_orange.png

335 B

application/vlc-android/res/drawable-xhdpi/ic_queue_music.png

463 B

application/vlc-android/res/drawable-xxhdpi/ic_clear_orange.png

464 B

application/vlc-android/res/drawable-xxhdpi/ic_queue_music.png

725 B

application/vlc-android/res/drawable-xxxhdpi/ic_clear_orange.png

603 B

application/vlc-android/res/drawable-xxxhdpi/ic_queue_music.png

1008 B

......@@ -37,6 +37,7 @@ import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import kotlinx.android.synthetic.main.more_fragment.*
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.ObsoleteCoroutinesApi
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.onEach
import org.videolan.medialibrary.interfaces.Medialibrary
import org.videolan.medialibrary.interfaces.media.MediaWrapper
......@@ -105,8 +106,11 @@ class MoreFragment : BaseFragment(), IRefreshable, IHistory, SwipeRefreshLayout.
restoreMultiSelectHelper()
})
viewModel.loading.observe(viewLifecycleOwner) {
(activity as? MainActivity)?.refreshing = it
if (it) historyEntry.loading.state = EmptyLoadingState.LOADING
lifecycleScope.launchWhenStarted {
if (it) delay(300L)
(activity as? MainActivity)?.refreshing = it
if (it) historyEntry.loading.state = EmptyLoadingState.LOADING
}
}
historyAdapter.updateEvt.observe(viewLifecycleOwner) {
swipeRefreshLayout.isRefreshing = false
......@@ -131,8 +135,11 @@ class MoreFragment : BaseFragment(), IRefreshable, IHistory, SwipeRefreshLayout.
})
streamsViewModel.loading.observe(requireActivity(), Observer {
(activity as? MainActivity)?.refreshing = it
if (it) streamsEntry.loading.state = EmptyLoadingState.LOADING
lifecycleScope.launchWhenStarted {
if (it) delay(300L)
(activity as? MainActivity)?.refreshing = it
if (it) streamsEntry.loading.state = EmptyLoadingState.LOADING
}
})
settingsButton.setOnClickListener {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment