Skip to content

Commit

Permalink
Add rename support for file itself
Browse files Browse the repository at this point in the history
  • Loading branch information
alperozturk96 committed Sep 2, 2024
1 parent 617dd6e commit a17d0a1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,7 @@ public abstract class FileActivity extends DrawerActivity
@Inject
UserAccountManager accountManager;

@Inject
ConnectivityService connectivityService;
@Inject public ConnectivityService connectivityService;

@Inject
BackgroundJobManager backgroundJobManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
package com.owncloud.android.ui.fragment;

import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.view.View;

import com.google.android.material.bottomsheet.BottomSheetDialog;
Expand Down Expand Up @@ -212,18 +214,26 @@ private void setupClickListener() {
}

private void filterActionsForOfflineOperations() {
if (!file.isOfflineOperation() || file.isRootDirectory()) {
return;
}
// TODO add callback for isNetworkAndServerAvailable
new Thread(() -> {
boolean isNetworkAndServerAvailable = fileActivity.connectivityService.isNetworkAndServerAvailable();
new Handler(Looper.getMainLooper()).post(() -> {
if (file.isRootDirectory()) {
return;
}

binding.menuCreateRichWorkspace.setVisibility(View.GONE);
binding.menuUploadFromApp.setVisibility(View.GONE);
binding.menuDirectCameraUpload.setVisibility(View.GONE);
binding.menuScanDocUpload.setVisibility(View.GONE);
binding.menuNewDocument.setVisibility(View.GONE);
binding.menuNewSpreadsheet.setVisibility(View.GONE);
binding.menuNewPresentation.setVisibility(View.GONE);
binding.creatorsContainer.setVisibility(View.GONE);
if (!isNetworkAndServerAvailable || file.isOfflineOperation()) {
binding.menuCreateRichWorkspace.setVisibility(View.GONE);
binding.menuUploadFromApp.setVisibility(View.GONE);
binding.menuDirectCameraUpload.setVisibility(View.GONE);
binding.menuScanDocUpload.setVisibility(View.GONE);
binding.menuNewDocument.setVisibility(View.GONE);
binding.menuNewSpreadsheet.setVisibility(View.GONE);
binding.menuNewPresentation.setVisibility(View.GONE);
binding.creatorsContainer.setVisibility(View.GONE);
}
});
}).start();
}

@Override
Expand Down

0 comments on commit a17d0a1

Please sign in to comment.