<activity android:name=".extensions.ExtensionsListActivity"></activity>\r
<activity android:name=".ui.activity.AccountSelectActivity" android:uiOptions="none" android:label="@string/prefs_accounts"></activity>\r
<activity android:name=".ui.activity.ConflictsResolveActivity"/>
- <activity android:name=".ui.activity.ExplanationActivity"/>\r
+ <activity android:name="com.owncloud.android.ui.activity.GenericExplanationActivity"/>\r
<service android:name=".files.services.FileUploader" >\r
</service>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ownCloud Android client application
-
- Copyright (C) 2012 Bartek Przybylski
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- 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/>.
- -->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@color/owncloud_white"
- android:id="@+id/explanation"
- android:orientation="vertical">
-
- <TextView
- android:id="@+id/message"
- android:layout_width="match_parent"
- android:layout_height="1dp"
- android:layout_weight="1"
- android:padding="10dip"
- android:scrollbarAlwaysDrawVerticalTrack="true"
- android:text="@string/text_placeholder"
- />
-
- <ListView
- android:id="@+id/list"
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1"
- android:padding="10dip"
- />
-
-</LinearLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ownCloud Android client application
+
+ Copyright (C) 2012 Bartek Przybylski
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ 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/>.
+ -->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@color/owncloud_white"
+ android:id="@+id/explanation"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/message"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="2"
+ android:padding="10dip"
+ android:scrollbarAlwaysDrawVerticalTrack="true"
+ android:text="@string/text_placeholder"
+ />
+
+ <ListView
+ android:id="@+id/list"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="3"
+ android:padding="10dip"
+ />
+
+</LinearLayout>
\ No newline at end of file
<string name="sync_fail_in_favourites_content">Contents of %1$d files could not be sync\'ed (%2$d conflicts)</string>
<string name="sync_foreign_files_forgotten_ticker">Some local files were forgotten</string>
<string name="sync_foreign_files_forgotten_content">%1$d files out of the ownCloud directory could not be copied into</string>
- <string name="sync_foreign_files_forgotten_explanation">"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:</string>
+ <string name="sync_foreign_files_forgotten_explanation">"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.</string>
<string name="sync_foreign_files_forgotten_remote_prefix">"Remote: "</string>
<string name="sync_foreign_files_forgotten_local_prefix">"Local: "</string>
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);
}
}
}
- */
}
}
import com.owncloud.android.operations.SynchronizeFolderOperation;\r
import com.owncloud.android.operations.UpdateOCVersionOperation;\r
import com.owncloud.android.operations.RemoteOperationResult.ResultCode;\r
-import com.owncloud.android.ui.activity.ExplanationActivity;\r
+import com.owncloud.android.ui.activity.GenericExplanationActivity;\r
import android.accounts.Account;\r
import android.app.Notification;\r
import android.app.NotificationManager;\r
notification.flags |= Notification.FLAG_AUTO_CANCEL;\r
\r
/// includes a pending intent in the notification showing a more detailed explanation\r
- Intent explanationIntent = new Intent(getContext(), ExplanationActivity.class);\r
+ Intent explanationIntent = new Intent(getContext(), GenericExplanationActivity.class);\r
String message = String.format(getContext().getString(R.string.sync_foreign_files_forgotten_explanation), getContext().getString(R.string.app_name), getAccount().name);\r
- explanationIntent.putExtra(ExplanationActivity.MESSAGE, message);\r
+ explanationIntent.putExtra(GenericExplanationActivity.MESSAGE, message);\r
ArrayList<String> remotePaths = new ArrayList<String>();\r
ArrayList<String> localPaths = new ArrayList<String>();\r
for (String remote : mForgottenLocalFiles.keySet()) {\r
remotePaths.add(getContext().getString(R.string.sync_foreign_files_forgotten_remote_prefix) + remote);\r
localPaths.add(getContext().getString(R.string.sync_foreign_files_forgotten_local_prefix) + mForgottenLocalFiles.get(remote));\r
}\r
- explanationIntent.putExtra(ExplanationActivity.EXTRA_LIST, localPaths);\r
- explanationIntent.putExtra(ExplanationActivity.EXTRA_LIST_2, remotePaths); \r
+ explanationIntent.putExtra(GenericExplanationActivity.EXTRA_LIST, localPaths);\r
+ explanationIntent.putExtra(GenericExplanationActivity.EXTRA_LIST_2, remotePaths); \r
explanationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\r
\r
notification.contentIntent = PendingIntent.getActivity(getContext().getApplicationContext(), (int)System.currentTimeMillis(), explanationIntent, 0);\r
+++ /dev/null
-package com.owncloud.android.ui.activity;
-
-import java.util.ArrayList;
-
-import android.content.Context;
-import android.content.Intent;
-import android.os.Bundle;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ArrayAdapter;
-import android.widget.ListAdapter;
-import android.widget.ListView;
-import android.widget.TextView;
-
-import com.actionbarsherlock.app.SherlockFragmentActivity;
-import com.owncloud.android.R;
-
-/**
- * Activity showing a text message and, optionally, a couple of scrollable lists of texts.
- *
- * Added to show explanations for notifications when the user clicks on them, and there no place
- * better to show them.
- *
- * @author David A. Velasco
- */
-public class ExplanationActivity 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";
-
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- Intent intent = getIntent();
- String message = intent.getStringExtra(MESSAGE);
- ArrayList<String> list = intent.getStringArrayListExtra(EXTRA_LIST);
- ArrayList<String> list2 = intent.getStringArrayListExtra(EXTRA_LIST_2);
-
- setContentView(R.layout.explanation);
-
- if (message != null) {
- TextView textView = (TextView) findViewById(R.id.message);
- textView.setText(message);
- }
-
- ListView listView = (ListView) findViewById(R.id.list);
- if (list != null && list.size() > 0) {
- //ListAdapter adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, list);
- ListAdapter adapter = new ExplanationListAdapterView(this, list, list2);
- listView.setAdapter(adapter);
- } else {
- listView.setVisibility(View.GONE);
- }
- }
-
- public class ExplanationListAdapterView extends ArrayAdapter<String> {
-
- ArrayList<String> mList;
- ArrayList<String> mList2;
-
- ExplanationListAdapterView(Context context, ArrayList<String> list, ArrayList<String> 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;
- }
-
- @Override
- public boolean isEnabled(int position) {
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public View getView (int position, View convertView, ViewGroup parent) {
- View view = super.getView(position, convertView, parent);
- if (view != null) {
- if (mList2 != null && mList2.size() > 0 && position >= 0 && position < mList2.size()) {
- TextView text2 = (TextView) view.findViewById(android.R.id.text2);
- if (text2 != null) {
- text2.setText(mList2.get(position));
- }
- }
- }
- return view;
- }
- }
-
-}
--- /dev/null
+package com.owncloud.android.ui.activity;
+
+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;
+import android.widget.ListAdapter;
+import android.widget.ListView;
+import android.widget.TextView;
+
+import com.actionbarsherlock.app.SherlockFragmentActivity;
+import com.owncloud.android.R;
+
+/**
+ * Activity showing a text message and, optionally, a couple of scrollable lists of texts.
+ *
+ * Added to show explanations for notifications when the user clicks on them, and there no place
+ * better to show them.
+ *
+ * @author David A. Velasco
+ */
+public class GenericExplanationActivity extends SherlockFragmentActivity {
+
+ 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
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ Intent intent = getIntent();
+ String message = intent.getStringExtra(MESSAGE);
+ ArrayList<String> list = intent.getStringArrayListExtra(EXTRA_LIST);
+ ArrayList<String> list2 = intent.getStringArrayListExtra(EXTRA_LIST_2);
+
+ 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);
+ if (list != null && list.size() > 0) {
+ //ListAdapter adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, list);
+ ListAdapter adapter = new ExplanationListAdapterView(this, list, list2);
+ listView.setAdapter(adapter);
+ } else {
+ listView.setVisibility(View.GONE);
+ }
+ }
+
+ public class ExplanationListAdapterView extends ArrayAdapter<String> {
+
+ ArrayList<String> mList;
+ ArrayList<String> mList2;
+
+ ExplanationListAdapterView(Context context, ArrayList<String> list, ArrayList<String> list2) {
+ super(context, android.R.layout.two_line_list_item, android.R.id.text1, list);
+ mList = list;
+ mList2 = list2;
+ }
+
+ @Override
+ public boolean isEnabled(int position) {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public View getView (int position, View convertView, ViewGroup parent) {
+ View view = super.getView(position, convertView, parent);
+ if (view != null) {
+ if (mList2 != null && mList2.size() > 0 && position >= 0 && position < mList2.size()) {
+ TextView text2 = (TextView) view.findViewById(android.R.id.text2);
+ if (text2 != null) {
+ text2.setText(mList2.get(position));
+ }
+ }
+ }
+ return view;
+ }
+ }
+
+}