Skip to content

Commit ed3c5b0

Browse files
Merge pull request #16177 from nextcloud/backport/16176/stable-3.35
[stable-3.35] fix: navigation from child oc file list fragment
2 parents 6872a3d + 7edc507 commit ed3c5b0

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

app/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.kt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -564,10 +564,17 @@ class FileDisplayActivity :
564564
ALL_FILES == action -> {
565565
Log_OC.d(this, "Switch to oc file fragment")
566566
menuItemId = R.id.nav_all_files
567-
if (leftFragment !is OCFileListFragment) {
568-
leftFragment = OCFileListFragment()
569-
supportFragmentManager.executePendingTransactions()
567+
568+
// Replace only if the fragment is NOT exactly OCFileListFragment
569+
// Using `is OCFileListFragment` would also match subclasses,
570+
// its needed because reinitializing OCFileListFragment itself causes an empty screen
571+
leftFragment?.let {
572+
if (it::class != OCFileListFragment::class) {
573+
leftFragment = OCFileListFragment()
574+
supportFragmentManager.executePendingTransactions()
575+
}
570576
}
577+
571578
browseToRoot()
572579
}
573580

0 commit comments

Comments
 (0)