|
@@ -36,14 +36,16 @@ class RemoveFilesDialogFragment : ConfirmationDialogFragment(), ConfirmationDial
|
|
|
@Inject
|
|
|
lateinit var fileDataStorageManager: FileDataStorageManager
|
|
|
|
|
|
+ private var positiveButton: MaterialButton? = null
|
|
|
+
|
|
|
override fun onStart() {
|
|
|
super.onStart()
|
|
|
|
|
|
val alertDialog = dialog as AlertDialog? ?: return
|
|
|
|
|
|
- val positiveButton = alertDialog.getButton(AlertDialog.BUTTON_POSITIVE) as? MaterialButton
|
|
|
+ positiveButton = alertDialog.getButton(AlertDialog.BUTTON_POSITIVE) as? MaterialButton
|
|
|
positiveButton?.let {
|
|
|
- viewThemeUtils?.material?.colorMaterialButtonPrimaryTonal(positiveButton)
|
|
|
+ viewThemeUtils?.material?.colorMaterialButtonPrimaryTonal(it)
|
|
|
}
|
|
|
|
|
|
val negativeButton = alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE) as? MaterialButton
|
|
@@ -171,7 +173,8 @@ class RemoveFilesDialogFragment : ConfirmationDialogFragment(), ConfirmationDial
|
|
|
|
|
|
putInt(ARG_POSITIVE_BTN_RES, R.string.file_delete)
|
|
|
|
|
|
- if (containsFolder || containsDown) {
|
|
|
+ val isAnyFileOffline = files.any { it.isOfflineOperation }
|
|
|
+ if ((containsFolder || containsDown) && !isAnyFileOffline) {
|
|
|
putInt(ARG_NEGATIVE_BTN_RES, R.string.confirmation_remove_local)
|
|
|
}
|
|
|
|