add filterActionsForOfflineOperations

Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
alperozturk 2024-08-13 13:02:57 +02:00
parent 4ab29f0cd3
commit 570984adf0
No known key found for this signature in database
GPG key ID: 4E577DC593B59BDF
2 changed files with 18 additions and 1 deletions

View file

@ -157,6 +157,7 @@ public class OCFileListBottomSheetDialog extends BottomSheetDialog implements In
}
setupClickListener();
filterActionsForOfflineOperations();
}
private void setupClickListener() {
@ -210,6 +211,22 @@ public class OCFileListBottomSheetDialog extends BottomSheetDialog implements In
});
}
private void filterActionsForOfflineOperations() {
if (!file.isOfflineOperation()) {
return;
}
binding.menuCreateRichWorkspace.setVisibility(View.GONE);
binding.menuUploadFromApp.setVisibility(View.GONE);
binding.menuDirectCameraUpload.setVisibility(View.GONE);
binding.menuScanDocUpload.setVisibility(View.GONE);
binding.menuUploadFiles.setVisibility(View.GONE);
binding.menuNewDocument.setVisibility(View.GONE);
binding.menuNewSpreadsheet.setVisibility(View.GONE);
binding.menuNewPresentation.setVisibility(View.GONE);
binding.creatorsContainer.setVisibility(View.GONE);
}
@Override
protected void onStop() {
super.onStop();

View file

@ -1478,7 +1478,7 @@ public class OCFileListFragment extends ExtendedListFragment implements
}
// FAB
setFabEnabled(mFile != null && mFile.canWrite());
setFabEnabled(mFile != null && (mFile.canWrite() || mFile.isOfflineOperation()));
invalidateActionMode();
}