X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/279670c303c6b5e2c5a437b712e8d5ecf6f8b1a7..00482b6dcb1e98da39df54374f7098b51d66bee5:/src/com/owncloud/android/ui/activity/ErrorsWhileCopyingHandlerActivity.java
diff --git a/src/com/owncloud/android/ui/activity/ErrorsWhileCopyingHandlerActivity.java b/src/com/owncloud/android/ui/activity/ErrorsWhileCopyingHandlerActivity.java
index cb7e721f..d7d96fab 100644
--- a/src/com/owncloud/android/ui/activity/ErrorsWhileCopyingHandlerActivity.java
+++ b/src/com/owncloud/android/ui/activity/ErrorsWhileCopyingHandlerActivity.java
@@ -1,3 +1,23 @@
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 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 .
+ *
+ */
+
package com.owncloud.android.ui.activity;
import java.io.File;
@@ -10,8 +30,8 @@ import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.DialogFragment;
+import android.support.v7.app.ActionBarActivity;
import android.text.method.ScrollingMovementMethod;
-import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
@@ -22,32 +42,36 @@ import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
-import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
+import com.owncloud.android.lib.common.utils.Log_OC;
+
import com.owncloud.android.ui.dialog.IndeterminateProgressDialog;
import com.owncloud.android.utils.FileStorageUtils;
+
/**
- * Activity reporting errors occurred when local files uploaded to an ownCloud account with an app in
- * version under 1.3.16 where being copied to the ownCloud local folder.
+ * Activity reporting errors occurred when local files uploaded to an ownCloud account with an app
+ * in version under 1.3.16 where being copied to the ownCloud local folder.
*
- * Allows the user move the files to the ownCloud local folder, or let them unlinked to the remote
+ * Allows the user move the files to the ownCloud local folder. let them unlinked to the remote
* files.
*
* Shown when the error notification summarizing the list of errors is clicked by the user.
- *
- * @author David A. Velasco
*/
-public class ErrorsWhileCopyingHandlerActivity extends SherlockFragmentActivity implements OnClickListener {
+public class ErrorsWhileCopyingHandlerActivity extends ActionBarActivity
+ implements OnClickListener {
private static final String TAG = ErrorsWhileCopyingHandlerActivity.class.getSimpleName();
- public static final String EXTRA_ACCOUNT = ErrorsWhileCopyingHandlerActivity.class.getCanonicalName() + ".EXTRA_ACCOUNT";
- public static final String EXTRA_LOCAL_PATHS = ErrorsWhileCopyingHandlerActivity.class.getCanonicalName() + ".EXTRA_LOCAL_PATHS";
- public static final String EXTRA_REMOTE_PATHS = ErrorsWhileCopyingHandlerActivity.class.getCanonicalName() + ".EXTRA_REMOTE_PATHS";
+ public static final String EXTRA_ACCOUNT =
+ ErrorsWhileCopyingHandlerActivity.class.getCanonicalName() + ".EXTRA_ACCOUNT";
+ public static final String EXTRA_LOCAL_PATHS =
+ ErrorsWhileCopyingHandlerActivity.class.getCanonicalName() + ".EXTRA_LOCAL_PATHS";
+ public static final String EXTRA_REMOTE_PATHS =
+ ErrorsWhileCopyingHandlerActivity.class.getCanonicalName() + ".EXTRA_REMOTE_PATHS";
private static final String WAIT_DIALOG_TAG = "WAIT_DIALOG";
@@ -84,7 +108,8 @@ public class ErrorsWhileCopyingHandlerActivity extends SherlockFragmentActivity
/// customize text message
TextView textView = (TextView) findViewById(R.id.message);
String appName = getString(R.string.app_name);
- String message = String.format(getString(R.string.sync_foreign_files_forgotten_explanation), appName, appName, appName, appName, mAccount.name);
+ String message = String.format(getString(R.string.sync_foreign_files_forgotten_explanation),
+ appName, appName, appName, appName, mAccount.name);
textView.setText(message);
textView.setMovementMethod(new ScrollingMovementMethod());
@@ -101,6 +126,7 @@ public class ErrorsWhileCopyingHandlerActivity extends SherlockFragmentActivity
/// customize buttons
Button cancelBtn = (Button) findViewById(R.id.cancel);
Button okBtn = (Button) findViewById(R.id.ok);
+
okBtn.setText(R.string.foreign_files_move);
cancelBtn.setOnClickListener(this);
okBtn.setOnClickListener(this);
@@ -108,15 +134,14 @@ public class ErrorsWhileCopyingHandlerActivity extends SherlockFragmentActivity
/**
- * Customized adapter, showing the local files as main text in two-lines list item and the remote files
- * as the secondary text.
- *
- * @author David A. Velasco
+ * Customized adapter, showing the local files as main text in two-lines list item and the
+ * remote files as the secondary text.
*/
public class ErrorsWhileCopyingListAdapter extends ArrayAdapter {
ErrorsWhileCopyingListAdapter() {
- super(ErrorsWhileCopyingHandlerActivity.this, android.R.layout.two_line_list_item, android.R.id.text1, mLocalPaths);
+ super(ErrorsWhileCopyingHandlerActivity.this, android.R.layout.two_line_list_item,
+ android.R.id.text1, mLocalPaths);
}
@Override
@@ -131,7 +156,8 @@ public class ErrorsWhileCopyingHandlerActivity extends SherlockFragmentActivity
public View getView (int position, View convertView, ViewGroup parent) {
View view = convertView;
if (view == null) {
- LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ LayoutInflater vi = (LayoutInflater) getSystemService(
+ Context.LAYOUT_INFLATER_SERVICE);
view = vi.inflate(android.R.layout.two_line_list_item, null);
}
if (view != null) {
@@ -142,7 +168,8 @@ public class ErrorsWhileCopyingHandlerActivity extends SherlockFragmentActivity
text1.setText(String.format(getString(R.string.foreign_files_local_text), localPath));
}
}
- if (mRemotePaths != null && mRemotePaths.size() > 0 && position >= 0 && position < mRemotePaths.size()) {
+ if (mRemotePaths != null && mRemotePaths.size() > 0 && position >= 0 &&
+ position < mRemotePaths.size()) {
TextView text2 = (TextView) view.findViewById(android.R.id.text2);
String remotePath = mRemotePaths.get(position);
if (text2 != null && remotePath != null) {
@@ -164,24 +191,22 @@ public class ErrorsWhileCopyingHandlerActivity extends SherlockFragmentActivity
public void onClick(View v) {
if (v.getId() == R.id.ok) {
/// perform movement operation in background thread
- Log.d(TAG, "Clicked MOVE, start movement");
+ Log_OC.d(TAG, "Clicked MOVE, start movement");
new MoveFilesTask().execute();
} else if (v.getId() == R.id.cancel) {
/// just finish
- Log.d(TAG, "Clicked CANCEL, bye");
+ Log_OC.d(TAG, "Clicked CANCEL, bye");
finish();
} else {
- Log.e(TAG, "Clicked phantom button, id: " + v.getId());
+ Log_OC.e(TAG, "Clicked phantom button, id: " + v.getId());
}
}
/**
* Asynchronous task performing the move of all the local files to the ownCloud folder.
- *
- * @author David A. Velasco
*/
private class MoveFilesTask extends AsyncTask {
@@ -244,12 +269,14 @@ public class ErrorsWhileCopyingHandlerActivity extends SherlockFragmentActivity
if (result) {
// nothing else to do in this activity
- Toast t = Toast.makeText(ErrorsWhileCopyingHandlerActivity.this, getString(R.string.foreign_files_success), Toast.LENGTH_LONG);
+ Toast t = Toast.makeText(ErrorsWhileCopyingHandlerActivity.this,
+ getString(R.string.foreign_files_success), Toast.LENGTH_LONG);
t.show();
finish();
} else {
- Toast t = Toast.makeText(ErrorsWhileCopyingHandlerActivity.this, getString(R.string.foreign_files_fail), Toast.LENGTH_LONG);
+ Toast t = Toast.makeText(ErrorsWhileCopyingHandlerActivity.this,
+ getString(R.string.foreign_files_fail), Toast.LENGTH_LONG);
t.show();
}
}