mirror of
https://github.com/videolan/vlc-android
synced 2024-11-23 09:56:36 +08:00
Fix IllegalStateException
This commit is contained in:
parent
6ea4fafd0f
commit
e9667f39f4
@ -198,17 +198,6 @@ abstract class BaseBrowserFragment : MediaBrowserFragment<BrowserModel>(), IRefr
|
||||
}
|
||||
isRootDirectory = defineIsRoot()
|
||||
browserFavRepository = BrowserFavRepository.getInstance(requireContext())
|
||||
lifecycleScope.launch(Dispatchers.Main) {
|
||||
viewLifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) {
|
||||
needRefresh.observe(this@BaseBrowserFragment) {
|
||||
|
||||
if (it) {
|
||||
viewModel.refreshMW()
|
||||
needRefresh.postValue(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun manageDisplay() {
|
||||
@ -288,6 +277,17 @@ abstract class BaseBrowserFragment : MediaBrowserFragment<BrowserModel>(), IRefr
|
||||
}
|
||||
|
||||
inCards = Settings.getInstance(requireActivity()).getBoolean(BROWSER_DISPLAY_IN_CARDS, false)
|
||||
lifecycleScope.launch(Dispatchers.Main) {
|
||||
viewLifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) {
|
||||
needRefresh.observe(viewLifecycleOwner) {
|
||||
|
||||
if (it) {
|
||||
viewModel.refreshMW()
|
||||
needRefresh.postValue(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDisplaySettingChanged(key: String, value: Any) {
|
||||
|
Loading…
Reference in New Issue
Block a user