[Android] Fix indexation customization during onboarding

Nicolas Pomepuy git at videolan.org
Thu Jul 8 11:08:53 UTC 2021


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Thu Jul  8 08:55:59 2021 +0200| [7ab9ced133d5f97fd5e18f7e4aa882c544c68643] | committer: Nicolas Pomepuy

Fix indexation customization during onboarding

Fixes #2079

> https://code.videolan.org/videolan/vlc-android/commit/7ab9ced133d5f97fd5e18f7e4aa882c544c68643
---

 application/vlc-android/src/org/videolan/vlc/gui/SecondaryActivity.kt | 4 ++++
 .../src/org/videolan/vlc/gui/browser/StorageFragmentDelegate.kt       | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/SecondaryActivity.kt b/application/vlc-android/src/org/videolan/vlc/gui/SecondaryActivity.kt
index 9bd94e77d..199c21743 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/SecondaryActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/SecondaryActivity.kt
@@ -67,6 +67,10 @@ class SecondaryActivity : ContentActivity(), IDialogManager {
     private var fragment: Fragment? = null
     override val displayTitle = true
     private val dialogsDelegate = DialogDelegate()
+    val isOnboarding:Boolean
+    get() {
+        return intent.getStringExtra(KEY_FRAGMENT) == STORAGE_BROWSER_ONBOARDING
+    }
 
     override fun forcedTheme() =
         if (intent.getStringExtra(KEY_FRAGMENT) == STORAGE_BROWSER_ONBOARDING) R.style.Theme_VLC_Black
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/browser/StorageFragmentDelegate.kt b/application/vlc-android/src/org/videolan/vlc/gui/browser/StorageFragmentDelegate.kt
index cdf375920..5dc148e91 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/browser/StorageFragmentDelegate.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/browser/StorageFragmentDelegate.kt
@@ -33,9 +33,9 @@ import org.videolan.medialibrary.interfaces.EntryPointsEventsCb
 import org.videolan.medialibrary.interfaces.Medialibrary
 import org.videolan.tools.*
 import org.videolan.vlc.MediaParsingService
+import org.videolan.vlc.gui.SecondaryActivity
 import org.videolan.vlc.gui.helpers.MedialibraryUtils
 import org.videolan.vlc.gui.helpers.ThreeStatesCheckbox
-import org.videolan.vlc.gui.onboarding.OnboardingActivity
 
 interface IStorageFragmentDelegate {
     fun checkBoxAction(v: View, mrl: String)
@@ -72,7 +72,7 @@ class StorageFragmentDelegate : IStorageFragmentDelegate, EntryPointsEventsCb {
     override fun checkBoxAction(v: View, mrl: String) {
         val tscb = v as ThreeStatesCheckbox
         val checked = tscb.state == ThreeStatesCheckbox.STATE_CHECKED
-        if (context is OnboardingActivity) {
+        if ((context as? SecondaryActivity)?.isOnboarding == true) {
             val path = mrl.sanitizePath()
             if (checked) {
                 MediaParsingService.preselectedStorages.removeAll { it.startsWith(path) }



More information about the Android mailing list