Skip to content

Commit

Permalink
Merge pull request #4265 from owncloud/fix/navigation_details_view
Browse files Browse the repository at this point in the history
[FIX] Some bugs related to Details view
  • Loading branch information
JuancaG05 authored Jan 16, 2024
2 parents 124fe21 + 96dce53 commit f8b733c
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 3 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ ownCloud admins and users.

* Security - Improve biometric authentication security: [#4180](https://github.com/owncloud/android/issues/4180)
* Bugfix - Some Null Pointer Exceptions in MainFileListViewModel: [#4065](https://github.com/owncloud/android/issues/4065)
* Bugfix - Bugs related to Details view: [#4188](https://github.com/owncloud/android/issues/4188)
* Bugfix - Some Null Pointer Exceptions fixed from Google Play: [#4207](https://github.com/owncloud/android/issues/4207)
* Bugfix - Add "scope" parameter to /token endpoint HTTP requests: [#4260](https://github.com/owncloud/android/pull/4260)
* Change - Android library as a module instead of submodule: [#3962](https://github.com/owncloud/android/issues/3962)
Expand Down Expand Up @@ -68,6 +69,15 @@ ownCloud admins and users.
https://github.com/owncloud/android/issues/4065
https://github.com/owncloud/android/pull/4241

* Bugfix - Bugs related to Details view: [#4188](https://github.com/owncloud/android/issues/4188)

When coming to Details view from video or image previews, now the top bar is
shown correctly and navigation has the correct stack, so the back button has the
expected flow.

https://github.com/owncloud/android/issues/4188
https://github.com/owncloud/android/pull/4265

* Bugfix - Some Null Pointer Exceptions fixed from Google Play: [#4207](https://github.com/owncloud/android/issues/4207)

FileDisplayActivity and ReceiverExternalFilesActivity have prevented some
Expand Down
7 changes: 7 additions & 0 deletions changelog/unreleased/4265
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Bugfix: Bugs related to Details view

When coming to Details view from video or image previews, now the top bar is shown correctly
and navigation has the correct stack, so the back button has the expected flow.

https://github.com/owncloud/android/issues/4188
https://github.com/owncloud/android/pull/4265
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ class FileDisplayActivity : FileActivity(),
0,
file.remotePath.lastIndexOf(file.fileName)
)
if (storageManager.getFileByPath(parentPath) == null) {
if (storageManager.getFileByPath(parentPath, file.spaceId) == null) {
file = null // not able to know the directory where the file is uploading
}
} else {
Expand Down Expand Up @@ -470,7 +470,7 @@ class FileDisplayActivity : FileActivity(),
private fun setSecondFragment(fragment: Fragment) {
val transaction = supportFragmentManager.beginTransaction()
transaction.replace(R.id.right_fragment_container, fragment, TAG_SECOND_FRAGMENT)
transaction.commit()
transaction.commitNow()
updateFragmentsVisibility(true)
}

Expand Down Expand Up @@ -498,7 +498,7 @@ class FileDisplayActivity : FileActivity(),
if (second != null) {
val tr = supportFragmentManager.beginTransaction()
tr.remove(second)
tr.commit()
tr.commitNow()
}
updateFragmentsVisibility(false)
updateToolbar(null)
Expand Down Expand Up @@ -916,6 +916,9 @@ class FileDisplayActivity : FileActivity(),
private fun updateToolbar(chosenFileFromParam: OCFile?, space: OCSpace? = null) {
val chosenFile = chosenFileFromParam ?: file // If no file is passed, current file decides

// 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))) {
val title =
when (fileListOption) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ class PreviewImageActivity : FileActivity(),
putExtra(EXTRA_FILE, file)
putExtra(EXTRA_ACCOUNT, AccountUtils.getCurrentOwnCloudAccount(this@PreviewImageActivity))
}
finishAffinity()
startActivity(showDetailsIntent)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ class PreviewVideoActivity : FileActivity(), Player.Listener, OnPrepareVideoPlay
putExtra(FileActivity.EXTRA_FILE, file)
putExtra(FileActivity.EXTRA_ACCOUNT, AccountUtils.getCurrentOwnCloudAccount(this@PreviewVideoActivity))
}
finishAffinity()
startActivity(showDetailsIntent)
}

Expand Down

0 comments on commit f8b733c

Please sign in to comment.