Skip to content

Commit

Permalink
Added functionality lastUsage in Open in web and Open with
Browse files Browse the repository at this point in the history
  • Loading branch information
Aitorbp committed Nov 2, 2023
1 parent 80ea9fa commit b4faeb0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand All @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -899,6 +899,7 @@ class FileDisplayActivity : FileActivity(),
override fun openFile(file: OCFile) {
if (file.isAvailableLocally) {
fileOperationsHelper.openFile(file)
fileOperationsViewModel.setLastUsageFile(file)
} else {
startDownloadForOpening(file)
}
Expand Down

0 comments on commit b4faeb0

Please sign in to comment.