Skip to content

Commit

Permalink
Merge pull request #4535 from owncloud/fix/navigation_auto_uploads
Browse files Browse the repository at this point in the history
[FIX] Up button in navigation in folder picker for auto-uploads not appearing
  • Loading branch information
DeepDiver1975 authored Jan 23, 2025
2 parents 9e49b1a + 858fb11 commit 9bb1026
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ ownCloud admins and users.

## Summary

* Bugfix - Navigation in automatic uploads folder picker: [#4340](https://github.com/owncloud/android/issues/4340)
* Change - Replace auto-uploads with automatic uploads: [#4252](https://github.com/owncloud/android/issues/4252)
* Enhancement - Unit tests for repository classes - Part 2: [#4233](https://github.com/owncloud/android/issues/4233)
* Enhancement - Unit tests for repository classes - Part 3: [#4234](https://github.com/owncloud/android/issues/4234)
Expand All @@ -48,6 +49,14 @@ ownCloud admins and users.

## Details

* Bugfix - Navigation in automatic uploads folder picker: [#4340](https://github.com/owncloud/android/issues/4340)

The button in the toolbar for going up when choosing an upload path has been
added when needed, since there were some cases in which it didn't appear.

https://github.com/owncloud/android/issues/4340
https://github.com/owncloud/android/pull/4535

* Change - Replace auto-uploads with automatic uploads: [#4252](https://github.com/owncloud/android/issues/4252)

Wording change in the feature name, in order to make it clearer in translations
Expand Down
7 changes: 7 additions & 0 deletions changelog/unreleased/4535
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Bugfix: Navigation in automatic uploads folder picker

The button in the toolbar for going up when choosing an upload path has been added
when needed, since there were some cases in which it didn't appear.

https://github.com/owncloud/android/issues/4340
https://github.com/owncloud/android/pull/4535
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,14 @@ open class FolderPickerActivity : FileActivity(),
}
// If current file is root folder
else if (currentDirDisplayed.parentId == OCFile.ROOT_PARENT_ID) {
// If we are not in COPY mode, or if we are in COPY mode and spaces are not allowed, close the activity
if (pickerMode != PickerMode.COPY || (pickerMode == PickerMode.COPY && currentDirDisplayed.spaceId == null)) {
// If we are not in COPY or CAMERA_FOLDER mode, or if we are in COPY or CAMERA_FOLDER mode and spaces are not allowed, close the activity
if ((pickerMode != PickerMode.COPY && pickerMode != PickerMode.CAMERA_FOLDER) ||
(pickerMode == PickerMode.COPY && currentDirDisplayed.spaceId == null) ||
(pickerMode == PickerMode.CAMERA_FOLDER && currentDirDisplayed.spaceId == null)) {
finish()
return
}
// If we are in COPY mode and inside a space, navigate back to the spaces list
// If we are in COPY or CAMERA_FOLDER mode and inside a space, navigate back to the spaces list
if (mainFileListFragment?.getCurrentSpace()?.isProject == true || mainFileListFragment?.getCurrentSpace()?.isPersonal == true) {
file = null
initAndShowListOfSpaces()
Expand Down Expand Up @@ -309,12 +311,13 @@ open class FolderPickerActivity : FileActivity(),

private fun updateToolbar(chosenFileFromParam: OCFile?, space: OCSpace? = null) {
val chosenFile = chosenFileFromParam ?: file // If no file is passed, current file decides
val isRootFromPersonalInCopyMode =
chosenFile != null && chosenFile.remotePath == OCFile.ROOT_PATH && space?.isProject == false && pickerMode == PickerMode.COPY
val isRootFromPersonalInCopyOrCameraFolderMode =
chosenFile != null && chosenFile.remotePath == OCFile.ROOT_PATH && space?.isProject == false &&
(pickerMode == PickerMode.COPY || pickerMode == PickerMode.CAMERA_FOLDER)
val isRootFromPersonal = chosenFile == null || (chosenFile.remotePath == OCFile.ROOT_PATH && (space == null || !space.isProject))
val isRootFromProject = space?.isProject == true && chosenFile.remotePath == OCFile.ROOT_PATH

if (isRootFromPersonalInCopyMode) {
if (isRootFromPersonalInCopyOrCameraFolderMode) {
updateStandardToolbar(
title = getString(R.string.default_display_name_for_root_folder),
displayHomeAsUpEnabled = true,
Expand All @@ -329,8 +332,8 @@ open class FolderPickerActivity : FileActivity(),
} else if (isRootFromProject) {
updateStandardToolbar(
title = space!!.name,
displayHomeAsUpEnabled = pickerMode == PickerMode.COPY,
homeButtonEnabled = pickerMode == PickerMode.COPY
displayHomeAsUpEnabled = pickerMode == PickerMode.COPY || pickerMode == PickerMode.CAMERA_FOLDER,
homeButtonEnabled = pickerMode == PickerMode.COPY || pickerMode == PickerMode.CAMERA_FOLDER
)
} else {
updateStandardToolbar(title = chosenFile.fileName, displayHomeAsUpEnabled = true, homeButtonEnabled = true)
Expand Down

0 comments on commit 9bb1026

Please sign in to comment.