android:icon="@drawable/copy_link"/>
<activity
- android:name=".ui.activity.MoveActivity"
+ android:name=".ui.activity.FolderPickerActivity"
android:label="@string/app_name"/>
<activity
</PreferenceCategory>
<PreferenceCategory android:title="@string/prefs_category_instant_uploading">
- <com.owncloud.android.ui.PreferenceWithLongSummary android:title="@string/prefs_instant_upload_path_title" android:key="instant_upload_path" />
+ <com.owncloud.android.ui.PreferenceWithLongSummary
+ android:title="@string/prefs_instant_upload_path_title"
+ android:key="instant_upload_path" />
<com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:key="instant_uploading"
android:title="@string/prefs_instant_upload"
android:summary="@string/prefs_instant_upload_summary"/>
android:disableDependentsState="true"
android:title="@string/instant_upload_on_wifi"
android:key="instant_upload_on_wifi"/>
- <com.owncloud.android.ui.PreferenceWithLongSummary android:title="@string/prefs_instant_video_upload_path_title" android:key="instant_video_upload_path" />
+ <com.owncloud.android.ui.PreferenceWithLongSummary
+ android:title="@string/prefs_instant_video_upload_path_title"
+ android:key="instant_video_upload_path" />
<com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:key="instant_video_uploading"
android:title="@string/prefs_instant_video_upload"
android:summary="@string/prefs_instant_video_upload_summary"/>
} else if (requestCode == ACTION_SELECT_MULTIPLE_FILES && (resultCode == RESULT_OK || resultCode == UploadFilesActivity.RESULT_OK_AND_MOVE)) {
requestMultipleUpload(data, resultCode);
- } else if (requestCode == ACTION_MOVE_FILES && (resultCode == RESULT_OK ||
- resultCode == MoveActivity.RESULT_OK_AND_MOVE)){
+ } else if (requestCode == ACTION_MOVE_FILES && resultCode == RESULT_OK){
final Intent fData = data;
final int fResultCode = resultCode;
* @param resultCode Result code received
*/
private void requestMoveOperation(Intent data, int resultCode) {
- OCFile folderToMoveAt = (OCFile) data.getParcelableExtra(MoveActivity.EXTRA_CURRENT_FOLDER);
- OCFile targetFile = (OCFile) data.getParcelableExtra(MoveActivity.EXTRA_TARGET_FILE);
+ OCFile folderToMoveAt = (OCFile) data.getParcelableExtra(FolderPickerActivity.EXTRA_CURRENT_FOLDER);
+ OCFile targetFile = (OCFile) data.getParcelableExtra(FolderPickerActivity.EXTRA_TARGET_FILE);
getFileOperationsHelper().moveFile(folderToMoveAt, targetFile);
}
public class FolderPickerActivity extends FileActivity implements FileFragment.ContainerActivity,
OnClickListener, OnEnforceableRefreshListener {
- public static final String EXTRA_CURRENT_FOLDER = UploadFilesActivity.class.getCanonicalName() + ".EXTRA_CURRENT_FOLDER";
- public static final String EXTRA_TARGET_FILE = UploadFilesActivity.class.getCanonicalName() + "EXTRA_TARGET_FILE";
+ public static final String EXTRA_CURRENT_FOLDER = UploadFilesActivity.class.getCanonicalName()
+ + ".EXTRA_CURRENT_FOLDER";
+ public static final String EXTRA_TARGET_FILE = UploadFilesActivity.class.getCanonicalName()
+ + "EXTRA_TARGET_FILE";
- public static final int RESULT_OK = 1;
-
private SyncBroadcastReceiver mSyncBroadcastReceiver;
private static final String TAG = FolderPickerActivity.class.getSimpleName();
getSupportActionBar().setIcon(DisplayUtils.getSeasonalIconId());
}
- @Override
- protected void onDestroy() {
- super.onDestroy();
- }
-
/**
* Called when the ownCloud {@link Account} associated to the Activity was just updated.
*/
Log_OC.d(TAG, "Received broadcast " + event);
String accountName = intent.getStringExtra(FileSyncAdapter.EXTRA_ACCOUNT_NAME);
String synchFolderRemotePath = intent.getStringExtra(FileSyncAdapter.EXTRA_FOLDER_PATH);
- RemoteOperationResult synchResult = (RemoteOperationResult)intent.getSerializableExtra(FileSyncAdapter.EXTRA_RESULT);
- boolean sameAccount = (getAccount() != null && accountName.equals(getAccount().name) && getStorageManager() != null);
+ RemoteOperationResult synchResult = (RemoteOperationResult)intent.
+ getSerializableExtra(FileSyncAdapter.EXTRA_RESULT);
+ boolean sameAccount = (getAccount() != null &&
+ accountName.equals(getAccount().name) && getStorageManager() != null);
if (sameAccount) {
mSyncInProgress = true;
} else {
- OCFile currentFile = (getFile() == null) ? null : getStorageManager().getFileByPath(getFile().getRemotePath());
- OCFile currentDir = (getCurrentFolder() == null) ? null : getStorageManager().getFileByPath(getCurrentFolder().getRemotePath());
+ OCFile currentFile = (getFile() == null) ? null :
+ getStorageManager().getFileByPath(getFile().getRemotePath());
+ OCFile currentDir = (getCurrentFolder() == null) ? null :
+ getStorageManager().getFileByPath(getCurrentFolder().getRemotePath());
if (currentDir == null) {
// current folder was removed from the server
Toast.makeText( FolderPickerActivity.this,
- String.format(getString(R.string.sync_current_folder_was_removed), getCurrentFolder().getFileName()),
+ String.format(
+ getString(R.string.sync_current_folder_was_removed),
+ getCurrentFolder().getFileName()),
Toast.LENGTH_LONG)
.show();
browseToRoot();
currentFile = currentDir;
}
- if (synchFolderRemotePath != null && currentDir.getRemotePath().equals(synchFolderRemotePath)) {
+ if (synchFolderRemotePath != null && currentDir.getRemotePath().
+ equals(synchFolderRemotePath)) {
OCFileListFragment fileListFragment = getListOfFilesFragment();
if (fileListFragment != null) {
fileListFragment.listDirectory(currentDir);
setFile(currentFile);
}
- mSyncInProgress = (!FileSyncAdapter.EVENT_FULL_SYNC_END.equals(event) && !SynchronizeFolderOperation.EVENT_SINGLE_FOLDER_SHARES_SYNCED.equals(event));
+ mSyncInProgress = (!FileSyncAdapter.EVENT_FULL_SYNC_END.equals(event) &&
+ !SynchronizeFolderOperation.EVENT_SINGLE_FOLDER_SHARES_SYNCED.equals(event));
if (SynchronizeFolderOperation.EVENT_SINGLE_FOLDER_CONTENTS_SYNCED.
equals(event) &&
+++ /dev/null
-/* ownCloud Android client application
- * Copyright (C) 2012-2014 ownCloud Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package com.owncloud.android.ui.activity;
-
-import android.content.Intent;
-
-import android.view.View;
-import android.view.View.OnClickListener;
-
-
-
-import com.owncloud.android.datamodel.OCFile;
-import com.owncloud.android.ui.fragment.FileFragment;
-
-
-public class MoveActivity extends FolderPickerActivity implements FileFragment.ContainerActivity,
- OnClickListener, OnEnforceableRefreshListener {
-
- public static final int RESULT_OK_AND_MOVE = 1;
-
-
- @Override
- public void onClick(View v) {
- if (v == mCancelBtn) {
- finish();
- } else if (v == mChooseBtn) {
- Intent i = getIntent();
- OCFile targetFile = (OCFile) i.getParcelableExtra(MoveActivity.EXTRA_TARGET_FILE);
-
- Intent data = new Intent();
- data.putExtra(EXTRA_CURRENT_FOLDER, getCurrentFolder());
- data.putExtra(EXTRA_TARGET_FILE, targetFile);
- setResult(RESULT_OK_AND_MOVE, data);
- finish();
- }
- }
-}
if (v == mCancelBtn) {
finish();
} else if (v == mChooseBtn) {
- Intent i = getIntent();
- OCFile targetFile = (OCFile) i.getParcelableExtra(UploadPathActivity.EXTRA_TARGET_FILE);
-
Intent data = new Intent();
data.putExtra(EXTRA_CURRENT_FOLDER, getCurrentFolder());
- data.putExtra(EXTRA_TARGET_FILE, targetFile);
setResult(RESULT_OK_SET_UPLOAD_PATH, data);
finish();
}
import com.owncloud.android.files.FileMenuFilter;
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.ui.activity.FileDisplayActivity;
-import com.owncloud.android.ui.activity.MoveActivity;
+import com.owncloud.android.ui.activity.FolderPickerActivity;
import com.owncloud.android.ui.activity.OnEnforceableRefreshListener;
import com.owncloud.android.ui.adapter.FileListListAdapter;
import com.owncloud.android.ui.dialog.ConfirmationDialogFragment;
return true;
}
case R.id.action_move: {
- Intent action = new Intent(getActivity(), MoveActivity.class);
+ Intent action = new Intent(getActivity(), FolderPickerActivity.class);
// Pass mTargetFile that contains info of selected file/folder
- action.putExtra(MoveActivity.EXTRA_TARGET_FILE, mTargetFile);
+ action.putExtra(FolderPickerActivity.EXTRA_TARGET_FILE, mTargetFile);
getActivity().startActivityForResult(action, FileDisplayActivity.ACTION_MOVE_FILES);
return true;
}