X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/34923cf74ba9a09e10276bc919f05ddadc7ab6f7..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 cf69a48c..d7d96fab 100644 --- a/src/com/owncloud/android/ui/activity/ErrorsWhileCopyingHandlerActivity.java +++ b/src/com/owncloud/android/ui/activity/ErrorsWhileCopyingHandlerActivity.java @@ -1,5 +1,8 @@ -/* ownCloud Android client application - * Copyright (C) 2012-2013 ownCloud Inc. +/** + * 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, @@ -27,6 +30,7 @@ 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.view.LayoutInflater; import android.view.View; @@ -38,35 +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; -import com.owncloud.android.utils.Log_OC; /** - * 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. 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"; @@ -103,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()); @@ -128,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 @@ -151,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) { @@ -162,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) { @@ -200,8 +207,6 @@ public class ErrorsWhileCopyingHandlerActivity extends SherlockFragmentActivity /** * Asynchronous task performing the move of all the local files to the ownCloud folder. - * - * @author David A. Velasco */ private class MoveFilesTask extends AsyncTask { @@ -264,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(); } }