Skip to content

Commit 437c160

Browse files
committed
Master rebased and AutoUpload icon changes in file detail fragment.
1 parent 4b0d069 commit 437c160

File tree

3 files changed

+8
-55
lines changed

3 files changed

+8
-55
lines changed

app/src/main/java/com/owncloud/android/datamodel/SyncedFolderProvider.java

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -218,48 +218,6 @@ public SyncedFolder findByLocalPathAndAccount(String localPath, User user) {
218218

219219
}
220220

221-
/**
222-
* method to check if sync folder for the remote path exist in table or not
223-
* @param remotePath to be check
224-
* @param user for which we are looking
225-
* @return
226-
*/
227-
public boolean findByRemotePathAndAccount(String remotePath, User user) {
228-
boolean result = false;
229-
230-
//if path ends with / then remove the last / to work the query right way
231-
//because the sub folders of synced folders will not have the slash at the end
232-
if(remotePath.endsWith("/")){
233-
remotePath = remotePath.substring(0, remotePath.length()-1);
234-
}
235-
236-
Cursor cursor = mContentResolver.query(
237-
ProviderMeta.ProviderTableMeta.CONTENT_URI_SYNCED_FOLDERS,
238-
null,
239-
ProviderMeta.ProviderTableMeta.SYNCED_FOLDER_REMOTE_PATH + " LIKE ? AND " +
240-
ProviderMeta.ProviderTableMeta.SYNCED_FOLDER_ACCOUNT + " =? ",
241-
new String[]{"%"+remotePath + "%", user.getAccountName()},
242-
null);
243-
244-
if (cursor != null && cursor.getCount() >= 1) {
245-
result = true;
246-
} else {
247-
if (cursor == null) {
248-
Log_OC.e(TAG, "Sync folder db cursor for remote path = " + remotePath + " in NULL.");
249-
} else {
250-
Log_OC.e(TAG, cursor.getCount() + " items for remote path = " + remotePath
251-
+ " available in sync folder db. Expected 1 or greater than 1. Failed to update sync folder db.");
252-
}
253-
}
254-
255-
if (cursor != null) {
256-
cursor.close();
257-
}
258-
259-
return result;
260-
261-
}
262-
263221
/**
264222
* Delete all synced folders for an account
265223
*

app/src/main/java/com/owncloud/android/ui/activity/ShareActivity.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
import android.os.Bundle;
2727

2828
import com.nextcloud.client.account.User;
29-
import com.nextcloud.client.core.Clock;
30-
import com.nextcloud.client.preferences.AppPreferences;
3129
import com.nextcloud.java.util.Optional;
3230
import com.owncloud.android.R;
3331
import com.owncloud.android.databinding.ShareActivityBinding;
@@ -69,7 +67,6 @@ protected void onCreate(Bundle savedInstanceState) {
6967

7068
ShareActivityBinding binding = ShareActivityBinding.inflate(getLayoutInflater());
7169
setContentView(binding.getRoot());
72-
syncedFolderProvider = new SyncedFolderProvider(getContentResolver(), appPreferences, clock);
7370

7471
OCFile file = getFile();
7572
Optional<User> optionalUser = getUser();

app/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,13 @@
4444
import com.google.android.material.floatingactionbutton.FloatingActionButton;
4545
import com.nextcloud.client.account.User;
4646
import com.nextcloud.client.account.UserAccountManager;
47-
import com.nextcloud.client.core.Clock;
48-
import com.nextcloud.client.device.DeviceInfo;
4947
import com.nextcloud.client.di.Injectable;
5048
import com.nextcloud.client.jobs.BackgroundJobManager;
5149
import com.nextcloud.client.network.ClientFactory;
5250
import com.nextcloud.client.network.ConnectivityService;
5351
import com.nextcloud.client.preferences.AppPreferences;
54-
import com.nextcloud.ui.fileactions.FileActionsBottomSheet;
5552
import com.nextcloud.utils.EditorUtils;
53+
import com.nextcloud.ui.fileactions.FileActionsBottomSheet;
5654
import com.nextcloud.utils.MenuUtils;
5755
import com.owncloud.android.MainApp;
5856
import com.owncloud.android.R;
@@ -132,11 +130,8 @@ public class FileDetailFragment extends FileFragment implements OnClickListener,
132130
@Inject FileDataStorageManager storageManager;
133131
@Inject ViewThemeUtils viewThemeUtils;
134132
@Inject BackgroundJobManager backgroundJobManager;
135-
@Inject DeviceInfo deviceInfo;
136133
@Inject EditorUtils editorUtils;
137-
@Inject Clock clock;
138-
139-
private SyncedFolderProvider syncedFolderProvider;
134+
@Inject SyncedFolderProvider syncedFolderProvider;
140135

141136
/**
142137
* Public factory method to create new FileDetailFragment instances.
@@ -226,8 +221,6 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
226221
throw new IllegalArgumentException("Arguments may not be null");
227222
}
228223

229-
syncedFolderProvider =new SyncedFolderProvider(requireActivity().getContentResolver(), preferences, clock);
230-
231224
setFile(arguments.getParcelable(ARG_FILE));
232225
parentFolder = arguments.getParcelable(ARG_PARENT_FOLDER);
233226
user = arguments.getParcelable(ARG_USER);
@@ -252,6 +245,11 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
252245
return null;
253246
}
254247

248+
FloatingActionButton fabMain = requireActivity().findViewById(R.id.fab_main);
249+
if (fabMain != null) {
250+
fabMain.hide();
251+
}
252+
255253
if (getFile().getTags().isEmpty()) {
256254
binding.tagsGroup.setVisibility(View.GONE);
257255
} else {
@@ -568,7 +566,7 @@ private void setFilePreview(OCFile file) {
568566
.getFolderTypeIcon(file.isSharedWithMe() || file.isSharedWithSharee(),
569567
file.isSharedViaLink(), file.isEncrypted(),
570568
file.isGroupFolder(),
571-
//syncedFolderProvider.findByRemotePathAndAccount(file.getRemotePath(), user),
569+
syncedFolderProvider.findByRemotePathAndAccount(file.getRemotePath(), user),
572570
file.getMountType(), requireContext(),
573571
viewThemeUtils));
574572
int leftRightPadding = requireContext().getResources().getDimensionPixelSize(R.dimen.standard_padding);

0 commit comments

Comments
 (0)