diff --git a/owncloudApp/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.kt b/owncloudApp/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.kt index 74319110fa8..6a817e2d54d 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.kt @@ -197,6 +197,7 @@ class FileDisplayActivity : FileActivity(), private lateinit var binding: ActivityMainBinding private var isLightUser = false + private var isMultiPersonal = false override fun onCreate(savedInstanceState: Bundle?) { Timber.v("onCreate() start") @@ -324,6 +325,7 @@ class FileDisplayActivity : FileActivity(), onCapabilitiesOperationFinish(it) }) isLightUser = manageAccountsViewModel.checkUserLight(account.name) + isMultiPersonal = capabilitiesViewModel.checkMultiPersonal() navigateTo(fileListOption, initialState = true) } @@ -762,8 +764,9 @@ class FileDisplayActivity : FileActivity(), } // If current file is root folder else if (currentDirDisplayed.parentId == ROOT_PARENT_ID) { - // If current space is a project space (not personal, not shares), navigate back to the spaces list - if (mainFileListFragment?.getCurrentSpace()?.isProject == true) { + // If current space is a project space or personal in a multi-personal account, navigate back to the spaces list + if (mainFileListFragment?.getCurrentSpace()?.isProject == true || + (mainFileListFragment?.getCurrentSpace()?.isPersonal == true && isMultiPersonal)) { navigateTo(FileListOption.SPACES_LIST) } // If current space is not a project space (personal or shares) or it is null ("Files" in oC10), close the app @@ -965,7 +968,8 @@ class FileDisplayActivity : FileActivity(), // If we come from a preview activity (image or video), not updating toolbar when initializing this activity or it will show the root folder one if (intent.action == ACTION_DETAILS && chosenFile?.remotePath == OCFile.ROOT_PATH && secondFragment is FileDetailsFragment) return - if (chosenFile == null || (chosenFile.remotePath == OCFile.ROOT_PATH && (space == null || !space.isProject))) { + if (chosenFile == null || (chosenFile.remotePath == OCFile.ROOT_PATH && (space == null || + (!space.isProject && !(space.isPersonal && isMultiPersonal))))) { val title = when (fileListOption) { FileListOption.AV_OFFLINE -> getString(R.string.drawer_item_only_available_offline) @@ -980,7 +984,7 @@ class FileDisplayActivity : FileActivity(), } setTitle(title) setupRootToolbar(title = title, isSearchEnabled = true, isAvatarRequested = false) - } else if (space?.isProject == true && chosenFile.remotePath == OCFile.ROOT_PATH) { + } else if ((space?.isProject == true || (space?.isPersonal == true && isMultiPersonal)) && chosenFile.remotePath == OCFile.ROOT_PATH) { updateStandardToolbar(title = space.name, displayHomeAsUpEnabled = true, homeButtonEnabled = true) } else { updateStandardToolbar(title = chosenFile.fileName, displayHomeAsUpEnabled = true, homeButtonEnabled = true)