[Android] Navigator: Remove backstack option

Geoffrey Métais git at videolan.org
Mon Jan 14 16:15:23 CET 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Jan 14 12:03:49 2019 +0100| [7d4f09b8689a9043f7aead6dc92324e8d2cccedc] | committer: Geoffrey Métais

Navigator: Remove backstack option

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

 vlc-android/src/org/videolan/vlc/gui/helpers/Navigator.kt | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/helpers/Navigator.kt b/vlc-android/src/org/videolan/vlc/gui/helpers/Navigator.kt
index ea4ec7c4d..63e94affd 100644
--- a/vlc-android/src/org/videolan/vlc/gui/helpers/Navigator.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/helpers/Navigator.kt
@@ -102,13 +102,12 @@ class Navigator(private val activity: MainActivity,
         showFragment(fragment, id, tag)
     }
 
-    private fun showFragment(fragment: androidx.fragment.app.Fragment, id: Int, tag: String = getTag(id), backTag: String? = null) {
+    private fun showFragment(fragment: androidx.fragment.app.Fragment, id: Int, tag: String = getTag(id)) {
         val fm = activity.supportFragmentManager
         if (currentFragment is BaseBrowserFragment && !(currentFragment as BaseBrowserFragment).isRootDirectory)
             fm.popBackStackImmediate("root", androidx.fragment.app.FragmentManager.POP_BACK_STACK_INCLUSIVE)
         val ft = fm.beginTransaction()
         ft.replace(R.id.fragment_placeholder, fragment, tag)
-        if (backTag !== null) ft.addToBackStack(backTag)
         ft.commit()
         activity.updateCheckedItem(id)
         currentFragment = fragment
@@ -220,12 +219,12 @@ class Navigator(private val activity: MainActivity,
             fragment.setExtensionService(extensionsService)
             when {
                 currentFragment !is ExtensionBrowser -> //case: non-extension to extension root
-                    showFragment(fragment, extensionId, title, null)
+                    showFragment(fragment, extensionId, title)
                 currentFragmentId == extensionId -> //case: extension root to extension sub dir
-                    showFragment(fragment, extensionId, title, getTag(currentFragmentId))
+                    showFragment(fragment, extensionId, title)
                 else -> { //case: extension to other extension root
                     clearBackstackFromClass(ExtensionBrowser::class.java)
-                    showFragment(fragment, extensionId, title, null)
+                    showFragment(fragment, extensionId, title)
                 }
             }
         }



More information about the Android mailing list