[Android] File browser: force re-sorting on resume
Nicolas Pomepuy
git at videolan.org
Fri Jun 17 13:30:07 UTC 2022
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Fri Jun 17 15:18:15 2022 +0200| [94b38581cf3f9203d45838a2ba938eee4fd732fa] | committer: Duncan McNamara
File browser: force re-sorting on resume
> https://code.videolan.org/videolan/vlc-android/commit/94b38581cf3f9203d45838a2ba938eee4fd732fa
---
.../org/videolan/vlc/gui/browser/FileBrowserFragment.kt | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/browser/FileBrowserFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/browser/FileBrowserFragment.kt
index 69aea1274..a9c9f71c3 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/browser/FileBrowserFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/browser/FileBrowserFragment.kt
@@ -23,30 +23,24 @@
package org.videolan.vlc.gui.browser
-import android.net.Uri
import android.os.Bundle
import android.view.Menu
import android.view.MenuInflater
import android.view.View
-import androidx.appcompat.app.AppCompatActivity
import androidx.core.net.toUri
import androidx.fragment.app.Fragment
import androidx.lifecycle.lifecycleScope
-import kotlinx.coroutines.*
-import kotlinx.coroutines.flow.filterNotNull
-import kotlinx.coroutines.flow.first
-import org.videolan.medialibrary.MLServiceLocator
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.launch
+import kotlinx.coroutines.withContext
import org.videolan.medialibrary.interfaces.media.MediaWrapper
import org.videolan.medialibrary.media.MediaLibraryItem
import org.videolan.resources.AndroidDevices
import org.videolan.resources.CTX_FAV_ADD
import org.videolan.tools.removeFileScheme
-import org.videolan.vlc.ExternalMonitor
import org.videolan.vlc.R
import org.videolan.vlc.gui.SecondaryActivity
import org.videolan.vlc.gui.helpers.MedialibraryUtils
-import org.videolan.vlc.gui.helpers.hf.OtgAccess
-import org.videolan.vlc.gui.helpers.hf.requestOtgRoot
import org.videolan.vlc.util.FileUtils
import org.videolan.vlc.viewmodels.browser.TYPE_FILE
import org.videolan.vlc.viewmodels.browser.getBrowserModel
@@ -134,6 +128,11 @@ open class FileBrowserFragment : BaseBrowserFragment() {
override val isNetwork = false
override val isFile = true
+ override fun onResume() {
+ super.onResume()
+ viewModel.sort(viewModel.sort)
+ }
+
override fun onPrepareOptionsMenu(menu: Menu) {
super.onPrepareOptionsMenu(menu)
val item = menu.findItem(R.id.ml_menu_save) ?: return
More information about the Android
mailing list