import android.os.IBinder;
import android.preference.PreferenceManager;
import android.provider.MediaStore;
import android.os.IBinder;
import android.preference.PreferenceManager;
import android.provider.MediaStore;
import com.actionbarsherlock.view.Window;
import com.owncloud.android.MainApp;
import com.owncloud.android.R;
import com.actionbarsherlock.view.Window;
import com.owncloud.android.MainApp;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.services.FileDownloader;
import com.owncloud.android.files.services.FileObserverService;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.services.FileDownloader;
import com.owncloud.android.files.services.FileObserverService;
import com.owncloud.android.files.services.FileUploader.FileUploaderBinder;
import com.owncloud.android.operations.CreateFolderOperation;
import com.owncloud.android.files.services.FileUploader.FileUploaderBinder;
import com.owncloud.android.operations.CreateFolderOperation;
import com.owncloud.android.lib.operations.common.RemoteOperation;
import com.owncloud.android.lib.operations.common.RemoteOperationResult;
import com.owncloud.android.lib.operations.common.RemoteOperationResult.ResultCode;
import com.owncloud.android.lib.operations.common.RemoteOperation;
import com.owncloud.android.lib.operations.common.RemoteOperationResult;
import com.owncloud.android.lib.operations.common.RemoteOperationResult.ResultCode;
-OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNavigationListener, OnSslValidatorListener, OnRemoteOperationListener, EditNameDialogListener {
+OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNavigationListener, OnSslValidatorListener, EditNameDialogListener {
private SyncBroadcastReceiver mSyncBroadcastReceiver;
private UploadFinishReceiver mUploadFinishReceiver;
private DownloadFinishReceiver mDownloadFinishReceiver;
private SyncBroadcastReceiver mSyncBroadcastReceiver;
private UploadFinishReceiver mUploadFinishReceiver;
private DownloadFinishReceiver mDownloadFinishReceiver;
private static final String TAG_SECOND_FRAGMENT = "SECOND_FRAGMENT";
private OCFile mWaitingToPreview;
private static final String TAG_SECOND_FRAGMENT = "SECOND_FRAGMENT";
private OCFile mWaitingToPreview;
/// bindings to transference services
mUploadConnection = new ListServiceConnection();
mDownloadConnection = new ListServiceConnection();
/// bindings to transference services
mUploadConnection = new ListServiceConnection();
mDownloadConnection = new ListServiceConnection();
// upload in progress - right now, files are not inserted in the local cache until the upload is successful
// get parent from path
parentPath = file.getRemotePath().substring(0, file.getRemotePath().lastIndexOf(file.getFileName()));
// upload in progress - right now, files are not inserted in the local cache until the upload is successful
// get parent from path
parentPath = file.getRemotePath().substring(0, file.getRemotePath().lastIndexOf(file.getFileName()));
updateFragmentsVisibility(!file.isFolder());
updateNavigationElementsInActionBar(file.isFolder() ? null : file);
}
updateFragmentsVisibility(!file.isFolder());
updateNavigationElementsInActionBar(file.isFolder() ? null : file);
}
if (PreviewMediaFragment.canBePreviewed(mWaitingToPreview)) {
startMediaPreview(mWaitingToPreview, 0, true);
detailsFragmentChanged = true;
} else {
if (PreviewMediaFragment.canBePreviewed(mWaitingToPreview)) {
startMediaPreview(mWaitingToPreview, 0, true);
detailsFragmentChanged = true;
} else {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getSherlock().getMenuInflater();
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getSherlock().getMenuInflater();
targetPath = mDirectories.getItem(i) + OCFile.PATH_SEPARATOR + targetPath;
}
targetPath = OCFile.PATH_SEPARATOR + targetPath;
targetPath = mDirectories.getItem(i) + OCFile.PATH_SEPARATOR + targetPath;
}
targetPath = OCFile.PATH_SEPARATOR + targetPath;
RemoteOperationResult synchResult = (RemoteOperationResult)intent.getSerializableExtra(FileSyncService.SYNC_RESULT);
if (getAccount() != null && accountName.equals(getAccount().name)
RemoteOperationResult synchResult = (RemoteOperationResult)intent.getSerializableExtra(FileSyncService.SYNC_RESULT);
if (getAccount() != null && accountName.equals(getAccount().name)
- OCFile currentFile = (getFile() == null) ? null : mStorageManager.getFileByPath(getFile().getRemotePath());
- OCFile currentDir = (getCurrentDir() == null) ? null : mStorageManager.getFileByPath(getCurrentDir().getRemotePath());
+ OCFile currentFile = (getFile() == null) ? null : getStorageManager().getFileByPath(getFile().getRemotePath());
+ OCFile currentDir = (getCurrentDir() == null) ? null : getStorageManager().getFileByPath(getCurrentDir().getRemotePath());
Account account = intent.getParcelableExtra(OperationsService.EXTRA_ACCOUNT);
RemoteOperationResult getSharesResult = (RemoteOperationResult)intent.getSerializableExtra(OperationsService.EXTRA_RESULT);
if (getAccount() != null && account.name.equals(getAccount().name)
Account account = intent.getParcelableExtra(OperationsService.EXTRA_ACCOUNT);
RemoteOperationResult getSharesResult = (RemoteOperationResult)intent.getSerializableExtra(OperationsService.EXTRA_RESULT);
if (getAccount() != null && account.name.equals(getAccount().name)
public void browseToRoot() {
OCFileListFragment listOfFiles = getListOfFilesFragment();
if (listOfFiles != null) { // should never be null, indeed
while (mDirectories.getCount() > 1) {
popDirname();
}
public void browseToRoot() {
OCFileListFragment listOfFiles = getListOfFilesFragment();
if (listOfFiles != null) { // should never be null, indeed
while (mDirectories.getCount() > 1) {
popDirname();
}
listOfFiles.listDirectory(root);
setFile(listOfFiles.getCurrentFile());
startSyncFolderOperation(root);
listOfFiles.listDirectory(root);
setFile(listOfFiles.getCurrentFile());
startSyncFolderOperation(root);
onCreateFolderOperationFinish((CreateFolderOperation)operation, result);
} else if (operation instanceof CreateShareOperation) {
onCreateFolderOperationFinish((CreateFolderOperation)operation, result);
} else if (operation instanceof CreateShareOperation) {
if (result.getCode() == ResultCode.FILE_NOT_FOUND) {
// Show a Message
Toast t = Toast.makeText(this, getString(R.string.share_link_file_no_exist), Toast.LENGTH_LONG);
t.show();
if (result.getCode() == ResultCode.FILE_NOT_FOUND) {
// Show a Message
Toast t = Toast.makeText(this, getString(R.string.share_link_file_no_exist), Toast.LENGTH_LONG);
t.show();
operation.execute( getAccount(),
FileDisplayActivity.this,
FileDisplayActivity.this,
operation.execute( getAccount(),
FileDisplayActivity.this,
FileDisplayActivity.this,