From 3ef64834e94d4f2f21e3fceafec0987e67e5c893 Mon Sep 17 00:00:00 2001 From: "David A. Velasco" Date: Fri, 30 Nov 2012 11:58:46 +0100 Subject: [PATCH] Added scroll to generic explanation activity. Enabled the copy of past uploads into ownCloud folder during synchronization. --- AndroidManifest.xml | 2 +- res/layout/{explanation.xml => generic_explanation.xml} | 6 +++--- res/values/strings.xml | 2 +- .../android/operations/SynchronizeFolderOperation.java | 4 ---- src/com/owncloud/android/syncadapter/FileSyncAdapter.java | 10 +++++----- ...anationActivity.java => GenericExplanationActivity.java} | 13 +++++++------ 6 files changed, 17 insertions(+), 20 deletions(-) rename res/layout/{explanation.xml => generic_explanation.xml} (93%) rename src/com/owncloud/android/ui/activity/{ExplanationActivity.java => GenericExplanationActivity.java} (82%) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index e0328d3a..b2998b56 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -132,7 +132,7 @@ - + diff --git a/res/layout/explanation.xml b/res/layout/generic_explanation.xml similarity index 93% rename from res/layout/explanation.xml rename to res/layout/generic_explanation.xml index b1619165..45305532 100644 --- a/res/layout/explanation.xml +++ b/res/layout/generic_explanation.xml @@ -26,8 +26,8 @@ diff --git a/res/values/strings.xml b/res/values/strings.xml index 878d084e..b6fe74fc 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -118,7 +118,7 @@ Contents of %1$d files could not be sync\'ed (%2$d conflicts) Some local files were forgotten %1$d files out of the ownCloud directory could not be copied into - "From version 1.3.16, uploaded files are copied to the local ownCloud folder to avoid problems when the same local file is uploaded to different folders or accounts.\n\nSome files uploaded in the past could not be copied during the account synchronization. %1$s will not track their current location anymore. You will need to download them again to access their contents from this app.\n\nSee below the list of untracked local files and the remote files in in %2$s they were linked to: + "From version 1.3.16, uploaded files are copied to the local ownCloud folder to avoid problems when the same local file is uploaded to different folders or accounts.\n\nSome files uploaded in the past could not be copied during the account synchronization. %1$s will not track their current location anymore. You will need to download them again to access their contents from this app.\n\nSee below the list of untracked local files and the remote files in in %2$s they were linked to. "Remote: " "Local: " diff --git a/src/com/owncloud/android/operations/SynchronizeFolderOperation.java b/src/com/owncloud/android/operations/SynchronizeFolderOperation.java index 36c3f3f0..3671ca0e 100644 --- a/src/com/owncloud/android/operations/SynchronizeFolderOperation.java +++ b/src/com/owncloud/android/operations/SynchronizeFolderOperation.java @@ -300,9 +300,6 @@ public class SynchronizeFolderOperation extends RemoteOperation { if (storagePath != null && !storagePath.equals(expectedPath)) { /// fix storagePaths out of the local ownCloud folder File originalFile = new File(storagePath); - mForgottenLocalFiles.put(file.getRemotePath(), storagePath); // TODO REMOVE - - /* TO TEST NOTIFICATION!!! - TODO UNCOMMENT if (ocLocalFolder.getUsableSpace() < originalFile.length()) { mForgottenLocalFiles.put(file.getRemotePath(), storagePath); file.setStoragePath(null); @@ -338,7 +335,6 @@ public class SynchronizeFolderOperation extends RemoteOperation { } } } - */ } } diff --git a/src/com/owncloud/android/syncadapter/FileSyncAdapter.java b/src/com/owncloud/android/syncadapter/FileSyncAdapter.java index 285b1522..2d88646e 100644 --- a/src/com/owncloud/android/syncadapter/FileSyncAdapter.java +++ b/src/com/owncloud/android/syncadapter/FileSyncAdapter.java @@ -35,7 +35,7 @@ import com.owncloud.android.operations.RemoteOperationResult; import com.owncloud.android.operations.SynchronizeFolderOperation; import com.owncloud.android.operations.UpdateOCVersionOperation; import com.owncloud.android.operations.RemoteOperationResult.ResultCode; -import com.owncloud.android.ui.activity.ExplanationActivity; +import com.owncloud.android.ui.activity.GenericExplanationActivity; import android.accounts.Account; import android.app.Notification; import android.app.NotificationManager; @@ -346,17 +346,17 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter { notification.flags |= Notification.FLAG_AUTO_CANCEL; /// includes a pending intent in the notification showing a more detailed explanation - Intent explanationIntent = new Intent(getContext(), ExplanationActivity.class); + Intent explanationIntent = new Intent(getContext(), GenericExplanationActivity.class); String message = String.format(getContext().getString(R.string.sync_foreign_files_forgotten_explanation), getContext().getString(R.string.app_name), getAccount().name); - explanationIntent.putExtra(ExplanationActivity.MESSAGE, message); + explanationIntent.putExtra(GenericExplanationActivity.MESSAGE, message); ArrayList remotePaths = new ArrayList(); ArrayList localPaths = new ArrayList(); for (String remote : mForgottenLocalFiles.keySet()) { remotePaths.add(getContext().getString(R.string.sync_foreign_files_forgotten_remote_prefix) + remote); localPaths.add(getContext().getString(R.string.sync_foreign_files_forgotten_local_prefix) + mForgottenLocalFiles.get(remote)); } - explanationIntent.putExtra(ExplanationActivity.EXTRA_LIST, localPaths); - explanationIntent.putExtra(ExplanationActivity.EXTRA_LIST_2, remotePaths); + explanationIntent.putExtra(GenericExplanationActivity.EXTRA_LIST, localPaths); + explanationIntent.putExtra(GenericExplanationActivity.EXTRA_LIST_2, remotePaths); explanationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); notification.contentIntent = PendingIntent.getActivity(getContext().getApplicationContext(), (int)System.currentTimeMillis(), explanationIntent, 0); diff --git a/src/com/owncloud/android/ui/activity/ExplanationActivity.java b/src/com/owncloud/android/ui/activity/GenericExplanationActivity.java similarity index 82% rename from src/com/owncloud/android/ui/activity/ExplanationActivity.java rename to src/com/owncloud/android/ui/activity/GenericExplanationActivity.java index d6849ffa..ccf3de86 100644 --- a/src/com/owncloud/android/ui/activity/ExplanationActivity.java +++ b/src/com/owncloud/android/ui/activity/GenericExplanationActivity.java @@ -5,6 +5,7 @@ import java.util.ArrayList; import android.content.Context; import android.content.Intent; import android.os.Bundle; +import android.text.method.ScrollingMovementMethod; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; @@ -23,11 +24,11 @@ import com.owncloud.android.R; * * @author David A. Velasco */ -public class ExplanationActivity extends SherlockFragmentActivity { +public class GenericExplanationActivity extends SherlockFragmentActivity { - public static final String EXTRA_LIST = ExplanationActivity.class.getCanonicalName() + ".EXTRA_LIST"; - public static final String EXTRA_LIST_2 = ExplanationActivity.class.getCanonicalName() + ".EXTRA_LIST_2"; - public static final String MESSAGE = ExplanationActivity.class.getCanonicalName() + ".MESSAGE"; + public static final String EXTRA_LIST = GenericExplanationActivity.class.getCanonicalName() + ".EXTRA_LIST"; + public static final String EXTRA_LIST_2 = GenericExplanationActivity.class.getCanonicalName() + ".EXTRA_LIST_2"; + public static final String MESSAGE = GenericExplanationActivity.class.getCanonicalName() + ".MESSAGE"; @Override @@ -39,11 +40,12 @@ public class ExplanationActivity extends SherlockFragmentActivity { ArrayList list = intent.getStringArrayListExtra(EXTRA_LIST); ArrayList list2 = intent.getStringArrayListExtra(EXTRA_LIST_2); - setContentView(R.layout.explanation); + setContentView(R.layout.generic_explanation); if (message != null) { TextView textView = (TextView) findViewById(R.id.message); textView.setText(message); + textView.setMovementMethod(new ScrollingMovementMethod()); } ListView listView = (ListView) findViewById(R.id.list); @@ -62,7 +64,6 @@ public class ExplanationActivity extends SherlockFragmentActivity { ArrayList mList2; ExplanationListAdapterView(Context context, ArrayList list, ArrayList list2) { - //super(context, android.R.layout.two_line_list_item, android.R.id.text1, list); super(context, android.R.layout.two_line_list_item, android.R.id.text1, list); mList = list; mList2 = list2; -- 2.11.0