diff --git a/owncloudApp/src/main/java/com/owncloud/android/presentation/files/details/FileDetailsFragment.kt b/owncloudApp/src/main/java/com/owncloud/android/presentation/files/details/FileDetailsFragment.kt index c7789ed2316..c32ec1d407e 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/presentation/files/details/FileDetailsFragment.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/presentation/files/details/FileDetailsFragment.kt @@ -228,6 +228,7 @@ class FileDetailsFragment : FileFragment() { openInWebProviders.forEach { (openInWebProviderName, menuItemId) -> if (menuItemId == item.itemId) { fileDetailsViewModel.openInWeb(safeFile.file.remoteId!!, openInWebProviderName) + fileOperationsViewModel.setLastUsageFile(safeFile.file) return true } } @@ -244,6 +245,7 @@ class FileDetailsFragment : FileFragment() { fileDetailsViewModel.updateActionInDetailsView(SYNC_AND_OPEN_WITH) } else { // Already downloaded -> Open it requireActivity().openOCFile(safeFile.file) + fileOperationsViewModel.setLastUsageFile(safeFile.file) } true } diff --git a/owncloudApp/src/main/java/com/owncloud/android/presentation/files/filelist/MainFileListFragment.kt b/owncloudApp/src/main/java/com/owncloud/android/presentation/files/filelist/MainFileListFragment.kt index aa996518464..c0126845de2 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/presentation/files/filelist/MainFileListFragment.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/presentation/files/filelist/MainFileListFragment.kt @@ -525,6 +525,7 @@ class MainFileListFragment : Fragment(), itemIcon = ResourcesCompat.getDrawable(resources, R.drawable.ic_open_in_web, null) setOnClickListener { mainFileListViewModel.openInWeb(file.remoteId!!, appRegistryProvider.name) + fileOperationsViewModel.setLastUsageFile(file) } } fileOptionsBottomSheetSingleFileLayout!!.addView(appProviderItemView, 1) 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 09281d59b5b..10365cf30d7 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 @@ -899,6 +899,7 @@ class FileDisplayActivity : FileActivity(), override fun openFile(file: OCFile) { if (file.isAvailableLocally) { fileOperationsHelper.openFile(file) + fileOperationsViewModel.setLastUsageFile(file) } else { startDownloadForOpening(file) }