@@ -613,7 +613,7 @@ class FileDisplayActivity : FileActivity(),
613613 // Handle calls form internal activities.
614614 if (requestCode == REQUEST_CODE__SELECT_CONTENT_FROM_APPS && (resultCode == RESULT_OK || resultCode == RESULT_OK_AND_MOVE )) {
615615 if (! manageAccountsViewModel.hasEnoughQuota(account.name)) {
616- showMessageInSnackbar(message = getString(R .string.failed_upload_quota_exceeded_text))
616+ showMessageInSnackbar(message = getString(R .string.failed_upload_quota_exceeded_text), attachedToBottomBar = true )
617617 }
618618
619619 requestUploadOfContentFromApps(data)
@@ -631,7 +631,7 @@ class FileDisplayActivity : FileActivity(),
631631 ) {
632632 if (hasEnoughSpace) {
633633 if (! manageAccountsViewModel.hasEnoughQuota(account.name)) {
634- showMessageInSnackbar(message = getString(R .string.failed_upload_quota_exceeded_text))
634+ showMessageInSnackbar(message = getString(R .string.failed_upload_quota_exceeded_text), attachedToBottomBar = true )
635635 }
636636 requestUploadOfFilesFromFileSystem(capturedFilePaths)
637637 }
@@ -672,7 +672,7 @@ class FileDisplayActivity : FileActivity(),
672672
673673 } else {
674674 Timber .d(" User clicked on 'Update' with no selection" )
675- showMessageInSnackbar(R .id.list_layout, getString(R .string.filedisplay_no_file_selected))
675+ showMessageInSnackbar(layoutId = R .id.list_layout, message = getString(R .string.filedisplay_no_file_selected), attachedToBottomBar = true )
676676 }
677677 }
678678
@@ -887,11 +887,12 @@ class FileDisplayActivity : FileActivity(),
887887 if (currentDir == null ) {
888888 // current folder was removed from the server
889889 showMessageInSnackbar(
890- R .id.list_layout,
891- String .format(
890+ layoutId = R .id.list_layout,
891+ message = String .format(
892892 getString(R .string.sync_current_folder_was_removed),
893893 synchFolderRemotePath
894- )
894+ ),
895+ attachedToBottomBar = true
895896 )
896897 browseToRoot()
897898
@@ -924,7 +925,7 @@ class FileDisplayActivity : FileActivity(),
924925 if (synchResult.httpPhrase == " Error: Call to a member function getUID() on null" ) {
925926 showRequestAccountChangeNotice(getString(R .string.auth_failure_snackbar), false )
926927 } else {
927- showMessageInSnackbar(R .id.list_layout, synchResult.httpPhrase)
928+ showMessageInSnackbar(layoutId = R .id.list_layout, message = synchResult.httpPhrase, attachedToBottomBar = true )
928929 }
929930 } else {
930931 showRequestAccountChangeNotice(getString(R .string.auth_failure_snackbar), false )
@@ -1026,7 +1027,7 @@ class FileDisplayActivity : FileActivity(),
10261027 val singleRemoval = listOfFilesRemoved.size == 1
10271028
10281029 if (singleRemoval) {
1029- showMessageInSnackbar(message = getString(R .string.remove_success_msg))
1030+ showMessageInSnackbar(message = getString(R .string.remove_success_msg), attachedToBottomBar = true )
10301031 }
10311032
10321033 // Clean second fragment and refresh first one
@@ -1049,7 +1050,11 @@ class FileDisplayActivity : FileActivity(),
10491050
10501051 is UIResult .Error -> {
10511052 dismissLoadingDialog()
1052- showErrorInSnackbar(R .string.remove_fail_msg, uiResult.getThrowableOrNull())
1053+ showErrorInSnackbar(
1054+ genericErrorMessageId = R .string.remove_fail_msg,
1055+ throwable = uiResult.getThrowableOrNull(),
1056+ attachedToBottomBar = true
1057+ )
10531058
10541059 if (uiResult.getThrowableOrNull() is SSLRecoverablePeerUnverifiedException ) {
10551060 showUntrustedCertDialogForThrowable(uiResult.getThrowableOrNull())
@@ -1100,7 +1105,8 @@ class FileDisplayActivity : FileActivity(),
11001105
11011106 uiResult.error?.let {
11021107 showMessageInSnackbar(
1103- message = it.parseError(getString(R .string.move_file_error), resources, true )
1108+ message = it.parseError(getString(R .string.move_file_error), resources, true ),
1109+ attachedToBottomBar = true
11041110 )
11051111 }
11061112 }
@@ -1155,7 +1161,8 @@ class FileDisplayActivity : FileActivity(),
11551161 genericErrorMessage = getString(R .string.copy_file_error),
11561162 resources = resources,
11571163 showJustReason = true ,
1158- )
1164+ ),
1165+ attachedToBottomBar = true
11591166 )
11601167 }
11611168 }
@@ -1180,7 +1187,7 @@ class FileDisplayActivity : FileActivity(),
11801187 },
11811188 )
11821189 } else {
1183- showMessageInSnackbar(R .id.list_layout, message)
1190+ showMessageInSnackbar(layoutId = R .id.list_layout, message = message, attachedToBottomBar = true )
11841191 }
11851192 }
11861193
@@ -1377,7 +1384,11 @@ class FileDisplayActivity : FileActivity(),
13771384 is UIResult .Error -> {
13781385 dismissLoadingDialog()
13791386
1380- showErrorInSnackbar(R .string.rename_server_fail_msg, uiResult.error)
1387+ showErrorInSnackbar(
1388+ genericErrorMessageId = R .string.rename_server_fail_msg,
1389+ throwable = uiResult.error,
1390+ attachedToBottomBar = true
1391+ )
13811392
13821393 if (uiResult.getThrowableOrNull() is SSLRecoverablePeerUnverifiedException ) {
13831394 showUntrustedCertDialogForThrowable(uiResult.getThrowableOrNull())
@@ -1596,7 +1607,8 @@ class FileDisplayActivity : FileActivity(),
15961607 owner = this ,
15971608 onWorkEnqueued = {
15981609 showMessageInSnackbar(
1599- message = String .format(getString(R .string.downloader_download_enqueued_ticker), file.fileName)
1610+ message = String .format(getString(R .string.downloader_download_enqueued_ticker), file.fileName),
1611+ attachedToBottomBar = true
16001612 )
16011613 },
16021614 onWorkRunning = { progress -> Timber .d(" Downloading - Progress $progress " ) },
@@ -1618,7 +1630,8 @@ class FileDisplayActivity : FileActivity(),
16181630 },
16191631 onWorkFailed = {
16201632 showMessageInSnackbar(
1621- message = String .format(getString(R .string.downloader_download_failed_ticker), file.fileName)
1633+ message = String .format(getString(R .string.downloader_download_failed_ticker), file.fileName),
1634+ attachedToBottomBar = true
16221635 )
16231636 if (file.id == waitingToSend?.id) {
16241637 waitingToSend = null
@@ -1976,7 +1989,7 @@ class FileDisplayActivity : FileActivity(),
19761989
19771990 override fun uploadShortcutFileFromApp (shortcutFilePath : Array <String >) {
19781991 if (! manageAccountsViewModel.hasEnoughQuota(account.name)) {
1979- showMessageInSnackbar(message = getString(R .string.failed_upload_quota_exceeded_text))
1992+ showMessageInSnackbar(message = getString(R .string.failed_upload_quota_exceeded_text), attachedToBottomBar = true )
19801993 }
19811994 requestUploadOfFilesFromFileSystem(shortcutFilePath)
19821995 }
@@ -2015,7 +2028,7 @@ class FileDisplayActivity : FileActivity(),
20152028 is UIResult .Error -> {
20162029 dismissLoadingDialog()
20172030 if (uiResult.error is FileNotFoundException ) {
2018- showMessageInSnackbar(message = getString(R .string.deep_link_user_no_access))
2031+ showMessageInSnackbar(message = getString(R .string.deep_link_user_no_access), attachedToBottomBar = true )
20192032 changeUser()
20202033 } else {
20212034 showMessageInSnackbar(
@@ -2025,7 +2038,8 @@ class FileDisplayActivity : FileActivity(),
20252038 } else {
20262039 R .string.default_error_msg
20272040 }
2028- )
2041+ ),
2042+ attachedToBottomBar = true
20292043 )
20302044 }
20312045 }
0 commit comments