|
@@ -39,9 +39,9 @@ import android.view.MenuItem;
|
|
|
import android.view.View;
|
|
|
import android.view.View.OnClickListener;
|
|
|
|
|
|
+import com.google.android.material.button.MaterialButton;
|
|
|
import com.nextcloud.client.di.Injectable;
|
|
|
import com.nextcloud.client.preferences.AppPreferences;
|
|
|
-import com.google.android.material.button.MaterialButton;
|
|
|
import com.owncloud.android.R;
|
|
|
import com.owncloud.android.datamodel.FileDataStorageManager;
|
|
|
import com.owncloud.android.datamodel.OCFile;
|
|
@@ -63,7 +63,9 @@ import com.owncloud.android.utils.ThemeUtils;
|
|
|
|
|
|
import java.io.File;
|
|
|
import java.util.ArrayList;
|
|
|
+
|
|
|
import javax.inject.Inject;
|
|
|
+
|
|
|
import androidx.appcompat.app.ActionBar;
|
|
|
import androidx.fragment.app.Fragment;
|
|
|
import androidx.fragment.app.FragmentManager;
|
|
@@ -195,8 +197,7 @@ public class FolderPickerActivity extends FileActivity implements FileFragment.C
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Show a text message on screen view for notifying user if content is
|
|
|
- * loading or folder is empty
|
|
|
+ * Show a text message on screen view for notifying user if content is loading or folder is empty
|
|
|
*/
|
|
|
private void setBackgroundText() {
|
|
|
OCFileListFragment listFragment = getListOfFilesFragment();
|
|
@@ -250,7 +251,7 @@ public class FolderPickerActivity extends FileActivity implements FileFragment.C
|
|
|
|
|
|
// perform folder synchronization
|
|
|
RemoteOperation refreshFolderOperation = new RefreshFolderOperation(folder, currentSyncTime, false,
|
|
|
- ignoreETag, getStorageManager(), getAccount(), getApplicationContext());
|
|
|
+ ignoreETag, getStorageManager(), getAccount(), getApplicationContext());
|
|
|
|
|
|
refreshFolderOperation.execute(getAccount(), this, null, null);
|
|
|
setIndeterminate(true);
|
|
@@ -342,8 +343,8 @@ public class FolderPickerActivity extends FileActivity implements FileFragment.C
|
|
|
if (currentFile.isFolder()) {
|
|
|
finalFolder = currentFile;
|
|
|
} else if (currentFile.getRemotePath() != null) {
|
|
|
- long parentId = currentFile.getParentId();
|
|
|
- finalFolder = storageManager.getFileById(parentId);
|
|
|
+ String parentPath = new File(currentFile.getRemotePath()).getParent();
|
|
|
+ finalFolder = storageManager.getFileByPath(parentPath);
|
|
|
}
|
|
|
} else {
|
|
|
finalFolder = storageManager.getFileByPath(OCFile.ROOT_PATH);
|
|
@@ -449,8 +450,7 @@ public class FolderPickerActivity extends FileActivity implements FileFragment.C
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * Updates the view associated to the activity after the finish of an operation trying
|
|
|
- * to create a new folder.
|
|
|
+ * Updates the view associated to the activity after the finish of an operation trying to create a new folder.
|
|
|
*
|
|
|
* @param operation Creation operation performed.
|
|
|
* @param result Result of the creation.
|
|
@@ -502,7 +502,7 @@ public class FolderPickerActivity extends FileActivity implements FileFragment.C
|
|
|
if (currentDir == null) {
|
|
|
// current folder was removed from the server
|
|
|
DisplayUtils.showSnackMessage(getActivity(), R.string.sync_current_folder_was_removed,
|
|
|
- getCurrentFolder().getFileName());
|
|
|
+ getCurrentFolder().getFileName());
|
|
|
browseToRoot();
|
|
|
} else {
|
|
|
if (currentFile == null && !getFile().isFolder()) {
|