Merge remote-tracking branch 'remotes/upstream/master' into sortAccents
authortobiasKaminsky <tobias@kaminsky.me>
Fri, 2 Oct 2015 14:04:18 +0000 (16:04 +0200)
committertobiasKaminsky <tobias@kaminsky.me>
Fri, 2 Oct 2015 14:04:18 +0000 (16:04 +0200)
186 files changed:
.gitmodules
AndroidManifest.xml
CHANGELOG.md
SETUP.md
build.gradle
doc/oCC2015_Android_workshop.odp [new file with mode: 0644]
oc_jb_workaround/AndroidManifest.xml
owncloud-android-library
res/drawable-hdpi/file.png
res/drawable-hdpi/file_application.png [new file with mode: 0644]
res/drawable-hdpi/file_calendar.png [new file with mode: 0644]
res/drawable-hdpi/file_code.png [new file with mode: 0644]
res/drawable-hdpi/file_doc.png
res/drawable-hdpi/file_image.png
res/drawable-hdpi/file_movie.png
res/drawable-hdpi/file_pdf.png
res/drawable-hdpi/file_ppt.png
res/drawable-hdpi/file_sound.png
res/drawable-hdpi/file_text.png [new file with mode: 0644]
res/drawable-hdpi/file_vcard.png [new file with mode: 0644]
res/drawable-hdpi/file_xls.png
res/drawable-hdpi/file_zip.png
res/drawable-hdpi/folder_external.png [new file with mode: 0644]
res/drawable-hdpi/folder_public.png
res/drawable-hdpi/ic_menu_archive.png
res/drawable-hdpi/shared_with_me_folder.png
res/drawable-ldpi-v9/ic_action_download.png [deleted file]
res/drawable-ldpi-v9/ic_action_refresh.png [deleted file]
res/drawable-ldpi-v9/ic_action_settings.png [deleted file]
res/drawable-ldpi/common_error.png [deleted file]
res/drawable-ldpi/copy_link.png [deleted file]
res/drawable-ldpi/file.png [deleted file]
res/drawable-ldpi/file_doc.png [deleted file]
res/drawable-ldpi/file_image.png [deleted file]
res/drawable-ldpi/file_movie.png [deleted file]
res/drawable-ldpi/file_pdf.png [deleted file]
res/drawable-ldpi/file_ppt.png [deleted file]
res/drawable-ldpi/ic_action_create_dir.png [deleted file]
res/drawable-ldpi/ic_action_download.png [deleted file]
res/drawable-ldpi/ic_action_refresh.png [deleted file]
res/drawable-ldpi/ic_action_refresh_black.png [deleted file]
res/drawable-ldpi/ic_action_settings.png [deleted file]
res/drawable-ldpi/ic_action_upload.png [deleted file]
res/drawable-ldpi/icon.png [deleted file]
res/drawable-ldpi/image_fail.png [deleted file]
res/drawable-ldpi/winter_holidays_icon.png [deleted file]
res/drawable-mdpi/file.png
res/drawable-mdpi/file_application.png [new file with mode: 0644]
res/drawable-mdpi/file_calendar.png [new file with mode: 0644]
res/drawable-mdpi/file_code.png [new file with mode: 0644]
res/drawable-mdpi/file_doc.png
res/drawable-mdpi/file_image.png
res/drawable-mdpi/file_movie.png
res/drawable-mdpi/file_pdf.png
res/drawable-mdpi/file_ppt.png
res/drawable-mdpi/file_sound.png
res/drawable-mdpi/file_text.png [new file with mode: 0644]
res/drawable-mdpi/file_vcard.png [new file with mode: 0644]
res/drawable-mdpi/file_xls.png
res/drawable-mdpi/file_zip.png
res/drawable-mdpi/folder_external.png [new file with mode: 0644]
res/drawable-mdpi/folder_public.png
res/drawable-mdpi/ic_menu_archive.png
res/drawable-mdpi/shared_with_me_folder.png
res/drawable-xhdpi/file.png
res/drawable-xhdpi/file_application.png [new file with mode: 0644]
res/drawable-xhdpi/file_calendar.png [new file with mode: 0644]
res/drawable-xhdpi/file_code.png [new file with mode: 0644]
res/drawable-xhdpi/file_doc.png
res/drawable-xhdpi/file_image.png
res/drawable-xhdpi/file_movie.png
res/drawable-xhdpi/file_pdf.png
res/drawable-xhdpi/file_ppt.png
res/drawable-xhdpi/file_sound.png
res/drawable-xhdpi/file_text.png [new file with mode: 0644]
res/drawable-xhdpi/file_vcard.png [new file with mode: 0644]
res/drawable-xhdpi/file_xls.png
res/drawable-xhdpi/file_zip.png
res/drawable-xhdpi/folder_external.png [new file with mode: 0644]
res/drawable-xhdpi/folder_public.png
res/drawable-xhdpi/ic_menu_archive.png
res/drawable-xhdpi/shared_with_me_folder.png
res/drawable-xxhdpi/file.png
res/drawable-xxhdpi/file_application.png [new file with mode: 0644]
res/drawable-xxhdpi/file_calendar.png [new file with mode: 0644]
res/drawable-xxhdpi/file_code.png [new file with mode: 0644]
res/drawable-xxhdpi/file_doc.png
res/drawable-xxhdpi/file_image.png
res/drawable-xxhdpi/file_movie.png
res/drawable-xxhdpi/file_pdf.png
res/drawable-xxhdpi/file_ppt.png
res/drawable-xxhdpi/file_sound.png
res/drawable-xxhdpi/file_text.png [new file with mode: 0644]
res/drawable-xxhdpi/file_vcard.png [new file with mode: 0644]
res/drawable-xxhdpi/file_xls.png
res/drawable-xxhdpi/file_zip.png
res/drawable-xxhdpi/folder_external.png [new file with mode: 0644]
res/drawable-xxhdpi/folder_public.png
res/drawable-xxhdpi/ic_menu_archive.png
res/drawable-xxhdpi/shared_with_me_folder.png
res/layout-land/account_setup.xml
res/layout/account_setup.xml
res/layout/file_actions.xml
res/layout/file_preview.xml
res/layout/list_item.xml
res/layout/text_file_preview.xml [new file with mode: 0644]
res/layout/uploader_layout.xml
res/menu/file_actions_menu.xml
res/values-af-rZA/strings.xml
res/values-az/strings.xml
res/values-bal/strings.xml [new file with mode: 0644]
res/values-bg-rBG/strings.xml
res/values-bn-rBD/strings.xml
res/values-ca/strings.xml
res/values-cs-rCZ/strings.xml
res/values-da/strings.xml
res/values-de-rDE/strings.xml
res/values-de/strings.xml
res/values-el/strings.xml
res/values-en-rGB/strings.xml
res/values-en-rUS/strings.xml [new file with mode: 0644]
res/values-eo/strings.xml
res/values-es-rAR/strings.xml
res/values-es-rES/strings.xml [new file with mode: 0644]
res/values-es/strings.xml
res/values-et-rEE/strings.xml
res/values-eu/strings.xml
res/values-fi-rFI/strings.xml
res/values-fr/strings.xml
res/values-gl/strings.xml
res/values-he/strings.xml
res/values-hi-rIN/strings.xml
res/values-id/strings.xml
res/values-is/strings.xml
res/values-it/strings.xml
res/values-ja-rJP/strings.xml
res/values-ko/strings.xml
res/values-la/strings.xml [new file with mode: 0644]
res/values-lb/strings.xml
res/values-mk/strings.xml
res/values-nb-rNO/strings.xml
res/values-nl/strings.xml
res/values-oc/strings.xml
res/values-pl/strings.xml
res/values-pt-rBR/strings.xml
res/values-pt-rPT/strings.xml
res/values-rm/strings.xml [new file with mode: 0644]
res/values-ro/strings.xml
res/values-ru/strings.xml
res/values-sk-rSK/strings.xml
res/values-sl/strings.xml
res/values-sr/strings.xml
res/values-sv/strings.xml
res/values-th-rTH/strings.xml
res/values-tr/strings.xml
res/values-uk/strings.xml
res/values-zh-rCN/strings.xml
res/values-zh-rHK/strings.xml
res/values-zh-rTW/strings.xml
res/values/strings.xml
src/com/owncloud/android/authentication/AuthenticatorActivity.java
src/com/owncloud/android/datamodel/FileDataStorageManager.java
src/com/owncloud/android/datamodel/OCFile.java
src/com/owncloud/android/datamodel/ThumbnailsCacheManager.java
src/com/owncloud/android/files/FileMenuFilter.java
src/com/owncloud/android/files/FileOperationsHelper.java
src/com/owncloud/android/operations/CopyFileOperation.java [new file with mode: 0644]
src/com/owncloud/android/providers/FileContentProvider.java
src/com/owncloud/android/services/OperationsService.java
src/com/owncloud/android/ui/activity/FileActivity.java
src/com/owncloud/android/ui/activity/FileDisplayActivity.java
src/com/owncloud/android/ui/activity/Uploader.java
src/com/owncloud/android/ui/adapter/FileListListAdapter.java
src/com/owncloud/android/ui/adapter/LocalFileListAdapter.java
src/com/owncloud/android/ui/dialog/FileActionsDialogFragment.java
src/com/owncloud/android/ui/fragment/ExtendedListFragment.java
src/com/owncloud/android/ui/fragment/FileDetailFragment.java
src/com/owncloud/android/ui/fragment/OCFileListFragment.java
src/com/owncloud/android/ui/preview/FileDownloadFragment.java
src/com/owncloud/android/ui/preview/PreviewImageFragment.java
src/com/owncloud/android/ui/preview/PreviewMediaFragment.java
src/com/owncloud/android/ui/preview/PreviewTextFragment.java [new file with mode: 0644]
src/com/owncloud/android/utils/DisplayUtils.java
src/com/owncloud/android/utils/ErrorMessageAdapter.java
src/com/owncloud/android/utils/FileStorageUtils.java
src/com/owncloud/android/utils/MimetypeIconUtil.java [new file with mode: 0644]

index 7ccbef0..882f3c2 100644 (file)
@@ -1,4 +1,3 @@
-
 [submodule "owncloud-android-library"]
        path = owncloud-android-library
        url = git://github.com/owncloud/android-library.git
index fc701a9..acb5f1d 100644 (file)
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 
+<?xml version="1.0" encoding="utf-8"?><!--
   ownCloud Android client application
 
   Copyright (C) 2012  Bartek Przybylski
@@ -18,8 +17,8 @@
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
  -->
 <manifest package="com.owncloud.android"
-    android:versionCode="10700200"
-    android:versionName="1.7.2" xmlns:android="http://schemas.android.com/apk/res/android">
+    android:versionCode="10800000"
+    android:versionName="1.8.0" xmlns:android="http://schemas.android.com/apk/res/android">
 
     <uses-permission android:name="android.permission.GET_ACCOUNTS" />
     <uses-permission android:name="android.permission.USE_CREDENTIALS" />
         android:minSdkVersion="14"
         android:targetSdkVersion="22" />
 
-    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" >
-    </uses-permission>
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
 
     <application
         android:name=".MainApp"
         android:icon="@drawable/icon"
         android:label="@string/app_name"
-        android:theme="@style/Theme.ownCloud"> 
+        android:theme="@style/Theme.ownCloud">
         <activity
             android:name=".ui.activity.FileDisplayActivity"
-            android:label="@string/app_name"
-            >
+            android:label="@string/app_name">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </activity>
-        <activity android:name=".ui.activity.UploadFilesActivity">
-        </activity>
-        <activity android:name=".ui.activity.Uploader" >
+        <activity android:name=".ui.activity.UploadFilesActivity"></activity>
+        <activity android:name=".ui.activity.Uploader">
             <intent-filter>
-                <action android:name="android.intent.action.SEND" >
-                </action>
+                <action android:name="android.intent.action.SEND"></action>
 
-                <category android:name="android.intent.category.DEFAULT" >
-                </category>
+                <category android:name="android.intent.category.DEFAULT"></category>
 
-                <data android:mimeType="*/*" >
-                </data>
+                <data android:mimeType="*/*"></data>
             </intent-filter>
             <intent-filter>
-                <action android:name="android.intent.action.SEND_MULTIPLE" >
-                </action>
+                <action android:name="android.intent.action.SEND_MULTIPLE"></action>
 
-                <category android:name="android.intent.category.DEFAULT" >
-                </category>
+                <category android:name="android.intent.category.DEFAULT"></category>
 
-                <data android:mimeType="*/*" >
-                </data>
+                <data android:mimeType="*/*"></data>
 
-                       </intent-filter>
+            </intent-filter>
         </activity>
         <activity
             android:name=".ui.activity.Preferences"
                        
         <activity      
             android:name=".ui.preview.PreviewVideoActivity"
-                       android:label="@string/app_name"
-                       android:theme="@style/Theme.ownCloud.Fullscreen" 
-                       >
-               </activity>        
+            android:label="@string/app_name"
+            android:theme="@style/Theme.ownCloud.Fullscreen"></activity>
 
         <service
             android:name=".authentication.AccountAuthenticatorService"
             android:exported="true">
-            <intent-filter  android:priority="100">
+            <intent-filter android:priority="100">
                 <action android:name="android.accounts.AccountAuthenticator" />
             </intent-filter>
 
         </service>
         <service
             android:name=".syncadapter.FileSyncService"
-            android:exported="true" 
-            >
+            android:exported="true">
             <intent-filter>
                 <action android:name="android.content.SyncAdapter" />
             </intent-filter>
             android:enabled="true"
             android:exported="false"
             android:label="@string/sync_string_files"
-            android:syncable="true" >
-        </provider>
+            android:syncable="true"></provider>
 
         <activity
             android:name=".authentication.AuthenticatorActivity"
             android:launchMode="singleTask">
             <intent-filter>
                 <action android:name="android.intent.action.VIEW" />
+
                 <category android:name="android.intent.category.DEFAULT" />
                 <category android:name="android.intent.category.BROWSABLE" />
+
                 <data android:scheme="@string/oauth2_redirect_scheme" />
             </intent-filter>
             <intent-filter>
         <service android:name=".files.services.FileDownloader" />
         <service android:name=".files.services.FileUploader" />
         <service android:name=".media.MediaService" />
-        
+
         <activity android:name=".ui.activity.PassCodeActivity" />
         <activity android:name=".ui.activity.ConflictsResolveActivity"/>
         <activity android:name=".ui.activity.GenericExplanationActivity"/>
             <intent-filter>
                 <!-- unofficially supported by many Android phones but not by HTC devices: -->
                 <action android:name="com.android.camera.NEW_PICTURE" />
-                <!-- officially supported since Android 4.0 (SDK 14, works even for HTC devices): --> 
+                <!-- officially supported since Android 4.0 (SDK 14, works even for HTC devices): -->
                 <action android:name="android.hardware.action.NEW_PICTURE" />
                 <data android:mimeType="image/*" />
             </intent-filter>
                 <data android:mimeType="video/*" />
             </intent-filter>
             <intent-filter>
-                <action android:name="android.net.conn.CONNECTIVITY_CHANGE"/>
+                <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
             </intent-filter>
         </receiver>
         <receiver android:name=".files.BootupBroadcastReceiver">
             <intent-filter>
-                <action android:name="android.intent.action.BOOT_COMPLETED"/>
+                <action android:name="android.intent.action.BOOT_COMPLETED" />
             </intent-filter>
         </receiver>
         <service android:name=".services.observer.FileObserverService"/>
                        android:label="@string/copy_link"
                        android:icon="@drawable/copy_link"/>
 
-        <activity 
+        <activity
                        android:name=".ui.activity.FolderPickerActivity"
                        android:label="@string/app_name"/>
 
-        <activity 
+        <activity
                        android:name=".ui.activity.UploadPathActivity"
                        android:label="@string/app_name"/>
         
index 6934155..099a445 100644 (file)
@@ -1,3 +1,21 @@
+## 1.8.0 (September 2015)
+- New MATERIAL DESIGN theme
+- Updated FILE TYPE ICONS
+- Preview TXT files within the app
+- COPY files & folders
+- Preview the full file/folder name from the long press menu
+- Set a file as FAVORITE (kept-in-sync) from the CONTEXT MENU
+- Updated CONFLICT RESOLUTION dialog (wording)
+- Updated background for images with TRANSPARENCY in GALLERY
+- Hidden files will not enforce list view instead of GRID VIEW (folders from Picasa & others)
+- Security:
+  + Updated network stack with security fixes (Jackrabbit 2.10.1)
+- Bugs fixed:
+  + Fixed crash when ETag is lost
+  + Passcode creation not restarted on device rotation
+  + Recovered share icon shown on folders 'shared with me'
+  + User name added to subject when sending a share link through e-mail (fixed on SAMLed apps)
+
 ## 1.7.2 (July 2015)
 - New navigation drawer
 - Improved Passcode
index 59a51ca..0f1bc8e 100644 (file)
--- a/SETUP.md
+++ b/SETUP.md
@@ -36,7 +36,7 @@ Next steps will assume you have a Github account and that you will get the code
 * Open a terminal and go on with the next steps in it.
 * Clone your forked repository: ```git clone git@github.com:YOURGITHUBNAME/android.git```.
 * Move to the project folder with ```cd android```.
-* Checkout the remote branch 'master' in your own local branch 'master': ```git checkout -b master remotes/origin/master```.
+* Checkout the remote branch 'master' in your own local branch 'master': ```git checkout master remotes/origin/master```.
 * Pull any changes from your remote branch 'master': ```git pull origin master```
 * Make official ownCloud repo known as upstream: ```git remote add upstream git@github.com:owncloud/android.git```
 * Make sure to get the latest changes from official android/master branch: ```git pull upstream master```
index 576eb82..a0db018 100644 (file)
@@ -58,12 +58,6 @@ android {
             abortOnError false
         }
     }
-
-
-    compileOptions {
-        sourceCompatibility JavaVersion.VERSION_1_7
-        targetCompatibility JavaVersion.VERSION_1_7
-    }
     
     productFlavors {
     }
diff --git a/doc/oCC2015_Android_workshop.odp b/doc/oCC2015_Android_workshop.odp
new file mode 100644 (file)
index 0000000..29ed242
Binary files /dev/null and b/doc/oCC2015_Android_workshop.odp differ
index c516391..766cb0a 100644 (file)
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.owncloud.android.workaround.accounts"
-    android:versionCode="0100024"
-    android:versionName="1.0.24" >
+    android:versionCode="0100025"
+    android:versionName="1.0.25" >
 
     <uses-sdk
         android:minSdkVersion="16"
index dbc8c32..5985ba9 160000 (submodule)
@@ -1 +1 @@
-Subproject commit dbc8c325d74f3f7e8da8236c5abe77a141ae4019
+Subproject commit 5985ba9a9fd9a208b2a09ee7809949874e0c3a97
index b8ee720..409d202 100644 (file)
Binary files a/res/drawable-hdpi/file.png and b/res/drawable-hdpi/file.png differ
diff --git a/res/drawable-hdpi/file_application.png b/res/drawable-hdpi/file_application.png
new file mode 100644 (file)
index 0000000..a2c71fa
Binary files /dev/null and b/res/drawable-hdpi/file_application.png differ
diff --git a/res/drawable-hdpi/file_calendar.png b/res/drawable-hdpi/file_calendar.png
new file mode 100644 (file)
index 0000000..54d4454
Binary files /dev/null and b/res/drawable-hdpi/file_calendar.png differ
diff --git a/res/drawable-hdpi/file_code.png b/res/drawable-hdpi/file_code.png
new file mode 100644 (file)
index 0000000..ac0fd1a
Binary files /dev/null and b/res/drawable-hdpi/file_code.png differ
index 119fc65..298ebbd 100644 (file)
Binary files a/res/drawable-hdpi/file_doc.png and b/res/drawable-hdpi/file_doc.png differ
index 610a5be..61eb88f 100644 (file)
Binary files a/res/drawable-hdpi/file_image.png and b/res/drawable-hdpi/file_image.png differ
index a621ffa..09520e4 100644 (file)
Binary files a/res/drawable-hdpi/file_movie.png and b/res/drawable-hdpi/file_movie.png differ
index bd45720..6af2ec2 100644 (file)
Binary files a/res/drawable-hdpi/file_pdf.png and b/res/drawable-hdpi/file_pdf.png differ
index 116f2ed..2927f96 100644 (file)
Binary files a/res/drawable-hdpi/file_ppt.png and b/res/drawable-hdpi/file_ppt.png differ
index 74865da..2d495b6 100644 (file)
Binary files a/res/drawable-hdpi/file_sound.png and b/res/drawable-hdpi/file_sound.png differ
diff --git a/res/drawable-hdpi/file_text.png b/res/drawable-hdpi/file_text.png
new file mode 100644 (file)
index 0000000..ec6b005
Binary files /dev/null and b/res/drawable-hdpi/file_text.png differ
diff --git a/res/drawable-hdpi/file_vcard.png b/res/drawable-hdpi/file_vcard.png
new file mode 100644 (file)
index 0000000..c257341
Binary files /dev/null and b/res/drawable-hdpi/file_vcard.png differ
index 02070a2..f2aaf84 100644 (file)
Binary files a/res/drawable-hdpi/file_xls.png and b/res/drawable-hdpi/file_xls.png differ
index faebd60..de292fb 100644 (file)
Binary files a/res/drawable-hdpi/file_zip.png and b/res/drawable-hdpi/file_zip.png differ
diff --git a/res/drawable-hdpi/folder_external.png b/res/drawable-hdpi/folder_external.png
new file mode 100644 (file)
index 0000000..29fa378
Binary files /dev/null and b/res/drawable-hdpi/folder_external.png differ
index eed6417..55dbdf9 100644 (file)
Binary files a/res/drawable-hdpi/folder_public.png and b/res/drawable-hdpi/folder_public.png differ
index 2b84203..e2359db 100644 (file)
Binary files a/res/drawable-hdpi/ic_menu_archive.png and b/res/drawable-hdpi/ic_menu_archive.png differ
index b26e978..d312561 100644 (file)
Binary files a/res/drawable-hdpi/shared_with_me_folder.png and b/res/drawable-hdpi/shared_with_me_folder.png differ
diff --git a/res/drawable-ldpi-v9/ic_action_download.png b/res/drawable-ldpi-v9/ic_action_download.png
deleted file mode 100644 (file)
index 41fe95a..0000000
Binary files a/res/drawable-ldpi-v9/ic_action_download.png and /dev/null differ
diff --git a/res/drawable-ldpi-v9/ic_action_refresh.png b/res/drawable-ldpi-v9/ic_action_refresh.png
deleted file mode 100644 (file)
index bd611e8..0000000
Binary files a/res/drawable-ldpi-v9/ic_action_refresh.png and /dev/null differ
diff --git a/res/drawable-ldpi-v9/ic_action_settings.png b/res/drawable-ldpi-v9/ic_action_settings.png
deleted file mode 100644 (file)
index e2c2d51..0000000
Binary files a/res/drawable-ldpi-v9/ic_action_settings.png and /dev/null differ
diff --git a/res/drawable-ldpi/common_error.png b/res/drawable-ldpi/common_error.png
deleted file mode 100644 (file)
index f1a804a..0000000
Binary files a/res/drawable-ldpi/common_error.png and /dev/null differ
diff --git a/res/drawable-ldpi/copy_link.png b/res/drawable-ldpi/copy_link.png
deleted file mode 100644 (file)
index 7384309..0000000
Binary files a/res/drawable-ldpi/copy_link.png and /dev/null differ
diff --git a/res/drawable-ldpi/file.png b/res/drawable-ldpi/file.png
deleted file mode 100644 (file)
index b669fdf..0000000
Binary files a/res/drawable-ldpi/file.png and /dev/null differ
diff --git a/res/drawable-ldpi/file_doc.png b/res/drawable-ldpi/file_doc.png
deleted file mode 100644 (file)
index 0ea07e3..0000000
Binary files a/res/drawable-ldpi/file_doc.png and /dev/null differ
diff --git a/res/drawable-ldpi/file_image.png b/res/drawable-ldpi/file_image.png
deleted file mode 100644 (file)
index 1bf2015..0000000
Binary files a/res/drawable-ldpi/file_image.png and /dev/null differ
diff --git a/res/drawable-ldpi/file_movie.png b/res/drawable-ldpi/file_movie.png
deleted file mode 100644 (file)
index e50c168..0000000
Binary files a/res/drawable-ldpi/file_movie.png and /dev/null differ
diff --git a/res/drawable-ldpi/file_pdf.png b/res/drawable-ldpi/file_pdf.png
deleted file mode 100644 (file)
index a05afdd..0000000
Binary files a/res/drawable-ldpi/file_pdf.png and /dev/null differ
diff --git a/res/drawable-ldpi/file_ppt.png b/res/drawable-ldpi/file_ppt.png
deleted file mode 100644 (file)
index 11a9cc9..0000000
Binary files a/res/drawable-ldpi/file_ppt.png and /dev/null differ
diff --git a/res/drawable-ldpi/ic_action_create_dir.png b/res/drawable-ldpi/ic_action_create_dir.png
deleted file mode 100644 (file)
index 8ed2dae..0000000
Binary files a/res/drawable-ldpi/ic_action_create_dir.png and /dev/null differ
diff --git a/res/drawable-ldpi/ic_action_download.png b/res/drawable-ldpi/ic_action_download.png
deleted file mode 100644 (file)
index 7293d6d..0000000
Binary files a/res/drawable-ldpi/ic_action_download.png and /dev/null differ
diff --git a/res/drawable-ldpi/ic_action_refresh.png b/res/drawable-ldpi/ic_action_refresh.png
deleted file mode 100644 (file)
index 63e70e1..0000000
Binary files a/res/drawable-ldpi/ic_action_refresh.png and /dev/null differ
diff --git a/res/drawable-ldpi/ic_action_refresh_black.png b/res/drawable-ldpi/ic_action_refresh_black.png
deleted file mode 100644 (file)
index 63e70e1..0000000
Binary files a/res/drawable-ldpi/ic_action_refresh_black.png and /dev/null differ
diff --git a/res/drawable-ldpi/ic_action_settings.png b/res/drawable-ldpi/ic_action_settings.png
deleted file mode 100644 (file)
index c290e59..0000000
Binary files a/res/drawable-ldpi/ic_action_settings.png and /dev/null differ
diff --git a/res/drawable-ldpi/ic_action_upload.png b/res/drawable-ldpi/ic_action_upload.png
deleted file mode 100644 (file)
index 2d4ba56..0000000
Binary files a/res/drawable-ldpi/ic_action_upload.png and /dev/null differ
diff --git a/res/drawable-ldpi/icon.png b/res/drawable-ldpi/icon.png
deleted file mode 100644 (file)
index 1bc470b..0000000
Binary files a/res/drawable-ldpi/icon.png and /dev/null differ
diff --git a/res/drawable-ldpi/image_fail.png b/res/drawable-ldpi/image_fail.png
deleted file mode 100644 (file)
index 77513ad..0000000
Binary files a/res/drawable-ldpi/image_fail.png and /dev/null differ
diff --git a/res/drawable-ldpi/winter_holidays_icon.png b/res/drawable-ldpi/winter_holidays_icon.png
deleted file mode 100644 (file)
index 9261d32..0000000
Binary files a/res/drawable-ldpi/winter_holidays_icon.png and /dev/null differ
index f988e57..dd3ebad 100644 (file)
Binary files a/res/drawable-mdpi/file.png and b/res/drawable-mdpi/file.png differ
diff --git a/res/drawable-mdpi/file_application.png b/res/drawable-mdpi/file_application.png
new file mode 100644 (file)
index 0000000..15fbfce
Binary files /dev/null and b/res/drawable-mdpi/file_application.png differ
diff --git a/res/drawable-mdpi/file_calendar.png b/res/drawable-mdpi/file_calendar.png
new file mode 100644 (file)
index 0000000..dbf3745
Binary files /dev/null and b/res/drawable-mdpi/file_calendar.png differ
diff --git a/res/drawable-mdpi/file_code.png b/res/drawable-mdpi/file_code.png
new file mode 100644 (file)
index 0000000..271f1a2
Binary files /dev/null and b/res/drawable-mdpi/file_code.png differ
index b48f73f..6c51d2d 100644 (file)
Binary files a/res/drawable-mdpi/file_doc.png and b/res/drawable-mdpi/file_doc.png differ
index f70eb95..1d767a5 100644 (file)
Binary files a/res/drawable-mdpi/file_image.png and b/res/drawable-mdpi/file_image.png differ
index 48090eb..638f8ed 100644 (file)
Binary files a/res/drawable-mdpi/file_movie.png and b/res/drawable-mdpi/file_movie.png differ
index a10127a..6292ff4 100644 (file)
Binary files a/res/drawable-mdpi/file_pdf.png and b/res/drawable-mdpi/file_pdf.png differ
index 9f3b34d..3a273b1 100644 (file)
Binary files a/res/drawable-mdpi/file_ppt.png and b/res/drawable-mdpi/file_ppt.png differ
index 6328e2e..d157087 100644 (file)
Binary files a/res/drawable-mdpi/file_sound.png and b/res/drawable-mdpi/file_sound.png differ
diff --git a/res/drawable-mdpi/file_text.png b/res/drawable-mdpi/file_text.png
new file mode 100644 (file)
index 0000000..b8dc090
Binary files /dev/null and b/res/drawable-mdpi/file_text.png differ
diff --git a/res/drawable-mdpi/file_vcard.png b/res/drawable-mdpi/file_vcard.png
new file mode 100644 (file)
index 0000000..e3d0e6b
Binary files /dev/null and b/res/drawable-mdpi/file_vcard.png differ
index 430db59..e4c6616 100644 (file)
Binary files a/res/drawable-mdpi/file_xls.png and b/res/drawable-mdpi/file_xls.png differ
index e587ecd..f64412d 100644 (file)
Binary files a/res/drawable-mdpi/file_zip.png and b/res/drawable-mdpi/file_zip.png differ
diff --git a/res/drawable-mdpi/folder_external.png b/res/drawable-mdpi/folder_external.png
new file mode 100644 (file)
index 0000000..4f961d1
Binary files /dev/null and b/res/drawable-mdpi/folder_external.png differ
index a63effe..09945b6 100644 (file)
Binary files a/res/drawable-mdpi/folder_public.png and b/res/drawable-mdpi/folder_public.png differ
index f21a11f..99529da 100644 (file)
Binary files a/res/drawable-mdpi/ic_menu_archive.png and b/res/drawable-mdpi/ic_menu_archive.png differ
index 0c83a32..ed8f860 100644 (file)
Binary files a/res/drawable-mdpi/shared_with_me_folder.png and b/res/drawable-mdpi/shared_with_me_folder.png differ
index d575f47..7764170 100644 (file)
Binary files a/res/drawable-xhdpi/file.png and b/res/drawable-xhdpi/file.png differ
diff --git a/res/drawable-xhdpi/file_application.png b/res/drawable-xhdpi/file_application.png
new file mode 100644 (file)
index 0000000..0b5247e
Binary files /dev/null and b/res/drawable-xhdpi/file_application.png differ
diff --git a/res/drawable-xhdpi/file_calendar.png b/res/drawable-xhdpi/file_calendar.png
new file mode 100644 (file)
index 0000000..0c93453
Binary files /dev/null and b/res/drawable-xhdpi/file_calendar.png differ
diff --git a/res/drawable-xhdpi/file_code.png b/res/drawable-xhdpi/file_code.png
new file mode 100644 (file)
index 0000000..fa2f3fb
Binary files /dev/null and b/res/drawable-xhdpi/file_code.png differ
index e0e2ba9..16cc0f4 100644 (file)
Binary files a/res/drawable-xhdpi/file_doc.png and b/res/drawable-xhdpi/file_doc.png differ
index 72a7a50..078ed8a 100644 (file)
Binary files a/res/drawable-xhdpi/file_image.png and b/res/drawable-xhdpi/file_image.png differ
index d0216d8..9bb6ddf 100644 (file)
Binary files a/res/drawable-xhdpi/file_movie.png and b/res/drawable-xhdpi/file_movie.png differ
index 0d44a50..f8cf9e4 100644 (file)
Binary files a/res/drawable-xhdpi/file_pdf.png and b/res/drawable-xhdpi/file_pdf.png differ
index c485c14..e712d08 100644 (file)
Binary files a/res/drawable-xhdpi/file_ppt.png and b/res/drawable-xhdpi/file_ppt.png differ
index e2736a6..f9814c9 100644 (file)
Binary files a/res/drawable-xhdpi/file_sound.png and b/res/drawable-xhdpi/file_sound.png differ
diff --git a/res/drawable-xhdpi/file_text.png b/res/drawable-xhdpi/file_text.png
new file mode 100644 (file)
index 0000000..bf7e9d7
Binary files /dev/null and b/res/drawable-xhdpi/file_text.png differ
diff --git a/res/drawable-xhdpi/file_vcard.png b/res/drawable-xhdpi/file_vcard.png
new file mode 100644 (file)
index 0000000..eb9f33c
Binary files /dev/null and b/res/drawable-xhdpi/file_vcard.png differ
index c1a25b9..b5c6ee1 100644 (file)
Binary files a/res/drawable-xhdpi/file_xls.png and b/res/drawable-xhdpi/file_xls.png differ
index 08ccee0..a5ee055 100644 (file)
Binary files a/res/drawable-xhdpi/file_zip.png and b/res/drawable-xhdpi/file_zip.png differ
diff --git a/res/drawable-xhdpi/folder_external.png b/res/drawable-xhdpi/folder_external.png
new file mode 100644 (file)
index 0000000..33909f7
Binary files /dev/null and b/res/drawable-xhdpi/folder_external.png differ
index 49e849d..4e35b7a 100644 (file)
Binary files a/res/drawable-xhdpi/folder_public.png and b/res/drawable-xhdpi/folder_public.png differ
index bf86cb3..a54161c 100644 (file)
Binary files a/res/drawable-xhdpi/ic_menu_archive.png and b/res/drawable-xhdpi/ic_menu_archive.png differ
index c5af0d7..1e6fb30 100644 (file)
Binary files a/res/drawable-xhdpi/shared_with_me_folder.png and b/res/drawable-xhdpi/shared_with_me_folder.png differ
index ddc9d6b..be54c42 100644 (file)
Binary files a/res/drawable-xxhdpi/file.png and b/res/drawable-xxhdpi/file.png differ
diff --git a/res/drawable-xxhdpi/file_application.png b/res/drawable-xxhdpi/file_application.png
new file mode 100644 (file)
index 0000000..fbe5deb
Binary files /dev/null and b/res/drawable-xxhdpi/file_application.png differ
diff --git a/res/drawable-xxhdpi/file_calendar.png b/res/drawable-xxhdpi/file_calendar.png
new file mode 100644 (file)
index 0000000..196094a
Binary files /dev/null and b/res/drawable-xxhdpi/file_calendar.png differ
diff --git a/res/drawable-xxhdpi/file_code.png b/res/drawable-xxhdpi/file_code.png
new file mode 100644 (file)
index 0000000..94540dc
Binary files /dev/null and b/res/drawable-xxhdpi/file_code.png differ
index 0c7caeb..6007b37 100644 (file)
Binary files a/res/drawable-xxhdpi/file_doc.png and b/res/drawable-xxhdpi/file_doc.png differ
index 239d4a7..671b6bf 100644 (file)
Binary files a/res/drawable-xxhdpi/file_image.png and b/res/drawable-xxhdpi/file_image.png differ
index f60eb71..28acf0e 100644 (file)
Binary files a/res/drawable-xxhdpi/file_movie.png and b/res/drawable-xxhdpi/file_movie.png differ
index d267059..b3d9274 100644 (file)
Binary files a/res/drawable-xxhdpi/file_pdf.png and b/res/drawable-xxhdpi/file_pdf.png differ
index 2923568..569feec 100644 (file)
Binary files a/res/drawable-xxhdpi/file_ppt.png and b/res/drawable-xxhdpi/file_ppt.png differ
index b364c3b..63b0d49 100644 (file)
Binary files a/res/drawable-xxhdpi/file_sound.png and b/res/drawable-xxhdpi/file_sound.png differ
diff --git a/res/drawable-xxhdpi/file_text.png b/res/drawable-xxhdpi/file_text.png
new file mode 100644 (file)
index 0000000..9101f46
Binary files /dev/null and b/res/drawable-xxhdpi/file_text.png differ
diff --git a/res/drawable-xxhdpi/file_vcard.png b/res/drawable-xxhdpi/file_vcard.png
new file mode 100644 (file)
index 0000000..28572cb
Binary files /dev/null and b/res/drawable-xxhdpi/file_vcard.png differ
index c800ae4..9e297ee 100644 (file)
Binary files a/res/drawable-xxhdpi/file_xls.png and b/res/drawable-xxhdpi/file_xls.png differ
index 2ce35ba..2535d7c 100644 (file)
Binary files a/res/drawable-xxhdpi/file_zip.png and b/res/drawable-xxhdpi/file_zip.png differ
diff --git a/res/drawable-xxhdpi/folder_external.png b/res/drawable-xxhdpi/folder_external.png
new file mode 100644 (file)
index 0000000..29347c5
Binary files /dev/null and b/res/drawable-xxhdpi/folder_external.png differ
index ea72b4d..b6755f3 100644 (file)
Binary files a/res/drawable-xxhdpi/folder_public.png and b/res/drawable-xxhdpi/folder_public.png differ
index 93ee2ad..81e9f7f 100644 (file)
Binary files a/res/drawable-xxhdpi/ic_menu_archive.png and b/res/drawable-xxhdpi/ic_menu_archive.png differ
index 23e23d8..d0d6ce8 100644 (file)
Binary files a/res/drawable-xxhdpi/shared_with_me_folder.png and b/res/drawable-xxhdpi/shared_with_me_folder.png differ
index 2fcc1d0..477011d 100644 (file)
                            android:gravity="center"\r
                            android:orientation="vertical"\r
                            android:padding="8dp" >\r
-                           \r
-                               <Button\r
-                                   android:id="@+id/centeredRefreshButton"\r
-                                   android:layout_width="wrap_content"\r
-                                   android:layout_height="wrap_content"\r
-                                   android:layout_gravity="center_horizontal"\r
+\r
+                               <android.support.v7.widget.AppCompatButton\r
+                                       android:id="@+id/centeredRefreshButton"\r
+                                       style="@style/ownCloud.Button"\r
+                                       android:layout_width="wrap_content"\r
+                                       android:layout_height="wrap_content"\r
+                                       android:layout_gravity="center_horizontal"\r
                                        android:layout_marginBottom="10dp"\r
-                                   android:text="@string/auth_check_server"\r
-                                   android:visibility="gone"\r
-                    android:contentDescription="@string/auth_check_server"/>\r
+                                       android:text="@string/auth_check_server"\r
+                                       android:visibility="gone"\r
+                                       android:contentDescription="@string/auth_check_server"/>\r
+\r
                                <TextView\r
                                    android:id="@+id/instructions_message"\r
                                    android:layout_width="wrap_content"\r
@@ -82,7 +84,7 @@
                                android:id="@+id/hostUrlFrame"\r
                                        android:layout_width="match_parent"\r
                                        android:layout_height="wrap_content"\r
-                                       android:layout_marginBottom="10dp"\r
+                                       android:layout_marginBottom="0dp"\r
                                >\r
                                        <EditText\r
                                                android:id="@+id/hostUrlInput"\r
                                        </EditText>\r
                                        <ImageButton\r
                                            android:id="@+id/embeddedRefreshButton"\r
-                                           android:layout_width="48dp"\r
-                                           android:layout_height="48dp"\r
+                                           android:layout_width="wrap_content"\r
+                                           android:layout_height="wrap_content"\r
                                            android:layout_gravity="center_vertical|right"\r
                                            android:layout_marginRight="5dp"\r
                                            android:padding="0dp"\r
                                            android:scaleType="fitCenter"\r
-                                           android:src="@drawable/ic_action_refresh_black"\r
+                                           android:src="@drawable/ic_action_refresh_grey"\r
                                android:onClick="onRefreshClick"\r
                                            android:visibility="gone"\r
                                                android:background="@android:color/transparent"\r
                                        android:textColor="@color/login_text_color"\r
                                        android:textColorHint="@color/login_text_hint_color"\r
                                        android:text="@string/auth_testing_connection"\r
+                                       android:minHeight="32dp"\r
                     android:contentDescription="@string/auth_testing_connection"/>\r
                             \r
                                <CheckBox\r
                <android.support.v7.widget.AppCompatButton\r
                    android:id="@+id/buttonOK"\r
                        android:theme="@style/Button.Primary"\r
+                       style="@style/Button.Primary"\r
                    android:layout_width="match_parent"\r
                    android:layout_height="wrap_content"\r
                    android:layout_gravity="center_horizontal"\r
index 0789c59..876d834 100644 (file)
@@ -40,6 +40,7 @@
             android:layout_height="wrap_content"\r
             android:layout_marginBottom="20dp"\r
             android:layout_marginTop="10dp"\r
+            android:background="@color/login_logo_background_color"\r
             android:src="@drawable/logo"\r
             android:contentDescription="@string/app_name"/>\r
 \r
             android:textColor="@color/login_text_color"\r
             android:textColorHint="@color/login_text_hint_color"\r
             android:text="@string/auth_testing_connection"\r
+            android:minHeight="32dp"\r
             android:contentDescription="@string/auth_testing_connection"/>\r
 \r
         <CheckBox\r
index abc42fb..c52c1f1 100644 (file)
@@ -3,12 +3,31 @@
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent"
-    android:layout_margin="@dimen/standard_margin">
+    android:layout_margin="@dimen/standard_margin"
+    android:orientation="vertical">
+
+    <TextView
+        android:id="@+id/file_actions_header"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:padding="@dimen/standard_padding"
+        android:textColor="@color/black"
+        android:visibility="gone"
+        />
+
+    <View
+        android:id="@+id/file_actions_header_divider"
+        android:layout_width="match_parent"
+        android:layout_height="2dp"
+        android:background="@color/owncloud_blue"
+        android:visibility="gone"
+        />
 
     <ListView
         android:id="@+id/file_actions_list"
         android:layout_width="match_parent"
-        android:layout_height="match_parent" >
-    </ListView>
+        android:layout_height="0dp"
+        android:layout_weight="1"
+        />
 
-</LinearLayout
\ No newline at end of file
+</LinearLayout >
\ No newline at end of file
index 2068224..f7a697a 100644 (file)
@@ -25,9 +25,9 @@
     android:layout_height="match_parent"
     android:background="@color/background_color"
     android:gravity="center"
-    tools:context=".ui.fragment.FilePreviewFragment" >
+    tools:context=".ui.fragment.FilePreviewFragment">
 
-    <FrameLayout 
+    <FrameLayout
         android:id="@+id/visual_area"
            android:layout_width="match_parent"
            android:layout_height="0dp"
index c66ff73..be0b94e 100644 (file)
@@ -48,7 +48,7 @@
                 android:layout_width="@dimen/file_icon_size"\r
                 android:layout_height="@dimen/file_icon_size"\r
                 android:layout_gravity="center_vertical"\r
-                android:layout_marginLeft="9dp"\r
+                android:layout_marginLeft="12dp"\r
                 android:src="@drawable/ic_menu_archive" />\r
 \r
             <ImageView\r
diff --git a/res/layout/text_file_preview.xml b/res/layout/text_file_preview.xml
new file mode 100644 (file)
index 0000000..b144875
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+  ownCloud Android client application
+
+  Copyright (C) 2012-2013  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/>.
+
+-->
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:fillViewport="true">
+
+    <TextView
+        android:id="@+id/text_preview"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginStart="8dp"
+        android:visibility="gone"/>
+</ScrollView>
\ No newline at end of file
index 2ba4a0b..79b077d 100644 (file)
            android:orientation="horizontal" >
 
                <android.support.v7.widget.AppCompatButton
-                   android:id="@+id/uploader_new_folder"
+                   android:id="@+id/uploader_cancel"
                        style="@style/ownCloud.Button"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="bottom"
                    android:layout_weight="1"
-                   android:text="@string/uploader_btn_new_folder_text" />
+                   android:text="@string/common_cancel" />
 
                <android.support.v7.widget.AppCompatButton
                    android:id="@+id/uploader_choose_folder"
index 9074b98..3e6f4cd 100644 (file)
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
   ownCloud Android client application
 
   Copyright (C) 2012  Bartek Przybylski
   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -->
-<menu  xmlns:android="http://schemas.android.com/apk/res/android">
-    
-       <item   android:id="@+id/action_share_file"                             android:title="@string/action_share_file"                       android:icon="@android:drawable/ic_menu_share"                                  android:orderInCategory="1" />
-       <item   android:id="@+id/action_unshare_file"               android:title="@string/action_unshare_file"                 android:icon="@android:drawable/ic_menu_share"                                  android:orderInCategory="1" />
-    <item      android:id="@+id/action_open_file_with"                 android:title="@string/actionbar_open_with"                     android:icon="@android:drawable/ic_menu_set_as"                                 android:orderInCategory="1" /> 
-       <item   android:id="@+id/action_download_file"                  android:title="@string/filedetails_download"            android:icon="@drawable/ic_action_download"                                             android:orderInCategory="1" />
-    <item      android:id="@+id/action_sync_file"                              android:title="@string/filedetails_sync_file"           android:icon="@drawable/ic_action_refresh"                                              android:orderInCategory="1" />
-       <item   android:id="@+id/action_cancel_download"                android:title="@string/common_cancel_download"          android:icon="@android:drawable/ic_menu_close_clear_cancel"             android:orderInCategory="1" />
-       <item   android:id="@+id/action_cancel_upload"                  android:title="@string/common_cancel_upload"            android:icon="@android:drawable/ic_menu_close_clear_cancel"             android:orderInCategory="1" />
-       <item   android:id="@+id/action_rename_file"                    android:title="@string/common_rename"                           android:icon="@android:drawable/ic_menu_edit"                                   android:orderInCategory="1" />
-    <item      android:id="@+id/action_move"                                   android:title="@string/actionbar_move"                          android:icon="@android:drawable/ic_menu_set_as"                                 android:orderInCategory="1" />
-    <item      android:id="@+id/action_remove_file"                    android:title="@string/common_remove"                           android:icon="@android:drawable/ic_menu_delete"                                 android:orderInCategory="1" />
-    <item      android:id="@+id/action_send_file"                              android:title="@string/actionbar_send_file"                     android:icon="@android:drawable/ic_menu_set_as"                                 android:orderInCategory="1" />
-    <item      android:id="@+id/action_favorite_file"                  android:title="@string/favorite"                        android:icon="@android:drawable/ic_menu_set_as"                                 android:orderInCategory="1" />
-    <item      android:id="@+id/action_unfavorite_file"                android:title="@string/unfavorite"                          android:icon="@android:drawable/ic_menu_set_as"                                     android:orderInCategory="1" />
-    <item      android:id="@+id/action_see_details"                    android:title="@string/actionbar_see_details"           android:icon="@android:drawable/ic_menu_info_details"                   android:orderInCategory="1" />
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item
+        android:id="@+id/action_share_file"
+        android:title="@string/action_share_file"
+        android:icon="@android:drawable/ic_menu_share"
+        android:orderInCategory="1" />
+    <item
+        android:id="@+id/action_unshare_file"
+        android:title="@string/action_unshare_file"
+        android:icon="@android:drawable/ic_menu_share"
+        android:orderInCategory="1" />
+    <item
+        android:id="@+id/action_open_file_with"
+        android:title="@string/actionbar_open_with"
+        android:icon="@android:drawable/ic_menu_set_as"
+        android:orderInCategory="1" />
+    <item
+        android:id="@+id/action_download_file"
+        android:title="@string/filedetails_download"
+        android:icon="@drawable/ic_action_download"
+        android:orderInCategory="1" />
+    <item
+        android:id="@+id/action_sync_file"
+        android:title="@string/filedetails_sync_file"
+        android:icon="@drawable/ic_action_refresh"
+        android:orderInCategory="1" />
+    <item
+        android:id="@+id/action_cancel_download"
+        android:title="@string/common_cancel_download"
+        android:icon="@android:drawable/ic_menu_close_clear_cancel"
+        android:orderInCategory="1" />
+    <item
+        android:id="@+id/action_cancel_upload"
+        android:title="@string/common_cancel_upload"
+        android:icon="@android:drawable/ic_menu_close_clear_cancel"
+        android:orderInCategory="1" />
+    <item
+        android:id="@+id/action_rename_file"
+        android:title="@string/common_rename"
+        android:icon="@android:drawable/ic_menu_edit"
+        android:orderInCategory="1" />
+    <item
+        android:id="@+id/action_move"
+        android:title="@string/actionbar_move"
+        android:icon="@android:drawable/ic_menu_set_as"
+        android:orderInCategory="1" />
+    <item
+        android:id="@+id/action_copy"
+        android:title="@android:string/copy"
+        android:icon="@android:drawable/ic_menu_set_as"
+        android:orderInCategory="1" />
+    <item
+        android:id="@+id/action_remove_file"
+        android:title="@string/common_remove"
+        android:icon="@android:drawable/ic_menu_delete"
+        android:orderInCategory="1" />
+    <item
+        android:id="@+id/action_send_file"
+        android:title="@string/actionbar_send_file"
+        android:icon="@android:drawable/ic_menu_set_as"
+        android:orderInCategory="1" />
+    <item
+        android:id="@+id/action_favorite_file"
+        android:title="@string/favorite"
+        android:icon="@android:drawable/ic_menu_set_as"
+        android:orderInCategory="1" />
+    <item
+        android:id="@+id/action_unfavorite_file"
+        android:title="@string/unfavorite"
+        android:icon="@android:drawable/ic_menu_set_as"
+        android:orderInCategory="1" />
+    <item
+        android:id="@+id/action_see_details"
+        android:title="@string/actionbar_see_details"
+        android:icon="@android:drawable/ic_menu_info_details"
+        android:orderInCategory="1" />
 
 </menu>
index 696f88e..7706aa7 100644 (file)
@@ -16,6 +16,7 @@
   <string name="common_ok">OK</string>
   <string name="common_cancel">Kanseleer</string>
   <string name="common_error">Fout</string>
+  <string name="activity_chooser_send_file_title">Stuur</string>
   <string name="empty"></string>
   <string name="folder_picker_choose_button_text">Kies</string>
 </resources>
index 4201692..ed93bc2 100644 (file)
@@ -269,7 +269,6 @@ inzibatçınızla əlaqə saxlayasınız.</string>
   <string name="downloader_download_file_not_found">Bu fayla serverdə artıq uzun müddətdir ki, çatmaq mümkün deyil</string>
   <string name="prefs_category_accounts">Hesablar</string>
   <string name="prefs_add_account">Hesab əlavə et</string>
-  <string name="auth_redirect_non_secure_connection_title">Təhlükəsiz qoşulma, təhlükəsiz olmayan istiqamətə yönlədirilmişdir</string>
   <string name="actionbar_logger">Jurnallar</string>
   <string name="log_send_history_button">Tarixçəni göndər</string>
   <string name="log_send_no_mail_app">Jurnalların ötürülməsi üçün proqram təminatı tapılmadı!</string>
@@ -285,6 +284,7 @@ inzibatçınızla əlaqə saxlayasınız.</string>
   <string name="move_file_invalid_overwrite">Fayl artıq mənsəb qovluğunda mövcuddur</string>
   <string name="move_file_error">Fayl və ya qovluğun köçürülməsi müddətində səhv baş verdi</string>
   <string name="forbidden_permissions_move">bu faylı köçürtmək</string>
+  <string name="copy_file_invalid_overwrite">Fayl artıq mənsəb qovluğunda mövcuddur</string>
   <string name="prefs_category_instant_uploading">Anında yükləmələr</string>
   <string name="prefs_category_security">Təhlükəsizlik</string>
   <string name="prefs_instant_video_upload_path_title">Video ünvanını yüklə</string>
diff --git a/res/values-bal/strings.xml b/res/values-bal/strings.xml
new file mode 100644 (file)
index 0000000..37e6152
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<resources>
+  <!--TODO re-enable when server-side folder size calculation is available   
+       <item>Biggest - Smallest</item>-->
+  <!--TODO re-enable when "Accounts" is available in Navigation Drawer-->
+  <!--<string name="drawer_item_accounts">Accounts</string>-->
+  <!--TODO re-enable when "On Device" is available
+    <string name="drawer_item_on_device">On device</string>-->
+  <string name="empty"></string>
+</resources>
index 03158dd..96334e4 100644 (file)
   <string name="move_file_invalid_overwrite">Файлът вече съществува в отдалечената папка.</string>
   <string name="move_file_error">Настъпи грешка при опита за преместване на този файл или папка.</string>
   <string name="forbidden_permissions_move">за да преместиш този файл</string>
+  <string name="copy_file_invalid_overwrite">Файлът вече съществува в отдалечената папка.</string>
   <string name="prefs_category_instant_uploading">Незабавно качване</string>
   <string name="prefs_category_security">Сигурност</string>
   <string name="prefs_instant_video_upload_path_title">Качване на видео път</string>
index 13cdb22..d5833d3 100644 (file)
   <string name="downloader_download_file_not_found">সার্ভারে এই ফাইলটি আর প্রাপ্তব্য নয়</string>
   <string name="prefs_category_accounts">একাউন্ট</string>
   <string name="prefs_add_account">একাউন্ট যোগ কর</string>
+  <string name="auth_redirect_non_secure_connection_title">নিরাপদ সংযোগকে একটি অনিরাপদ পথে দিকবদল করা হয়েছে</string>
   <string name="saml_authentication_wrong_pass">ভুল কুটশব্দ</string>
   <string name="actionbar_move">সরাও</string>
   <string name="file_list_empty_moving">এখানে কিছু নেই। একটি ফোল্ডার যোগ করতে পারেন!</string>
index 3c640d9..718efbf 100644 (file)
   <string name="downloader_download_file_not_found">El fitxer ja no està disponible en el servidor</string>
   <string name="prefs_category_accounts">Comptes</string>
   <string name="prefs_add_account">Afegeix compte</string>
+  <string name="auth_redirect_non_secure_connection_title">La connexió segura està essent redirigida a través d\'una ruta insegura</string>
   <string name="log_progress_dialog_text">Carregant dades...</string>
   <string name="saml_authentication_required_text">Es requereix autenticació</string>
   <string name="saml_authentication_wrong_pass">Contrasenya incorrecta</string>
index 718aa1e..f702afa 100644 (file)
@@ -290,7 +290,7 @@ správce systému.</string>
   <string name="downloader_download_file_not_found">Tento soubor již není dostupný na serveru</string>
   <string name="prefs_category_accounts">Účty</string>
   <string name="prefs_add_account">Přidat účet</string>
-  <string name="auth_redirect_non_secure_connection_title">Bezpečné spojení je přesměrováno na nezabezpečenou trasu.</string>
+  <string name="auth_redirect_non_secure_connection_title">Zabezpečené spojení je přesměrováváno nezabezpečenou trasou.</string>
   <string name="actionbar_logger">Logy</string>
   <string name="log_send_history_button">Odeslat historii</string>
   <string name="log_send_no_mail_app">Nebyla nalezena žádná aplikace pro odesílání logů. Nainstalujte poštovní aplikaci!</string>
@@ -306,6 +306,11 @@ správce systému.</string>
   <string name="move_file_invalid_overwrite">Soubor již v cílovém adresáři existuje</string>
   <string name="move_file_error">Při pokusu o přesun tohoto souboru či složky nastala chyba</string>
   <string name="forbidden_permissions_move">pro přesun tohoto souboru</string>
+  <string name="copy_file_not_found">Nelze zkopírpovat. Zkontrolujte prosím že soubor existuje</string>
+  <string name="copy_file_invalid_into_descendent">Není možné adresář zkopírovat do jeho vlastního podadresáře</string>
+  <string name="copy_file_invalid_overwrite">Soubor již v cílové složce existuje</string>
+  <string name="copy_file_error">Při pokusu o zkopírování tohoto souboru či složky došlo k chybě</string>
+  <string name="forbidden_permissions_copy">pro zkopírování tohoto souboru</string>
   <string name="prefs_category_instant_uploading">Okamžitá odesílání</string>
   <string name="prefs_category_security">Zabezpečení</string>
   <string name="prefs_instant_video_upload_path_title">Cesta pro nahrávání videí</string>
index 3e70097..80a6032 100644 (file)
   <string name="downloader_download_file_not_found">Filen er ikke længere tilgængelig på serveren</string>
   <string name="prefs_category_accounts">Konti</string>
   <string name="prefs_add_account">Tilføj konto</string>
-  <string name="auth_redirect_non_secure_connection_title">Sikker forbindelse videredirigeres til en usikker rute.</string>
+  <string name="auth_redirect_non_secure_connection_title">Sikker forbindelse videredirigeres gennem en usikker rute.</string>
   <string name="actionbar_logger">Logge</string>
   <string name="log_send_history_button">Send historik</string>
   <string name="log_send_no_mail_app">Der blev ikke fundet apps, der kan sende logge. Installér mail-app\'en!</string>
   <string name="move_file_invalid_overwrite">Filen findes allerede i destinationsmappen</string>
   <string name="move_file_error">Der opstod en fejl under forsøg på at flytte denne mappe eller fil</string>
   <string name="forbidden_permissions_move">til at flytte denne fil</string>
+  <string name="copy_file_not_found">Kunne ikke kopiere. Tjek venligst om filerne findes</string>
+  <string name="copy_file_invalid_into_descendent">Det er ikke muligt at kopiere en mappe til én af dens undermapper</string>
+  <string name="copy_file_invalid_overwrite">Filen findes allerede i destinationsmappen</string>
+  <string name="copy_file_error">Der opstod en fejl under forsøg på at kopiere denne fil eller mappe</string>
+  <string name="forbidden_permissions_copy">til at kopiere denne fil</string>
   <string name="prefs_category_instant_uploading">Øjeblikkelige uploads</string>
   <string name="prefs_category_security">Sikkerhed</string>
   <string name="prefs_instant_video_upload_path_title">Sti til videoupload</string>
index fa67888..7fe556b 100644 (file)
   <string name="move_file_invalid_overwrite">Die Datei ist bereits im Zielordner vorhanden</string>
   <string name="move_file_error">Es ist ein Fehler beim Verschieben dieser Datei oder dieses Ordners aufgetreten.</string>
   <string name="forbidden_permissions_move">um diese Datei zu verschieben</string>
+  <string name="copy_file_invalid_overwrite">Die Datei ist bereits im Zielordner vorhanden</string>
   <string name="prefs_category_instant_uploading">Sofortiges Hochladen</string>
   <string name="prefs_category_security">Sicherheit</string>
   <string name="prefs_instant_video_upload_path_title">Verzeichnis zum Hochladen der Videos</string>
index 0f7d614..8a34aeb 100644 (file)
   <string name="downloader_download_file_not_found">Diese Datei steht auf dem Server nicht mehr zur Verfügung</string>
   <string name="prefs_category_accounts">Konten</string>
   <string name="prefs_add_account">Konto hinzufügen</string>
-  <string name="auth_redirect_non_secure_connection_title">Die gesicherte Verbindung wird auf eine unsichere Route weitergeleitet.</string>
+  <string name="auth_redirect_non_secure_connection_title">Die gesicherte Verbindung wird durch eine ungesicherte Route geleitet.</string>
   <string name="actionbar_logger">Protokolle</string>
   <string name="log_send_history_button">Verlauf senden</string>
   <string name="log_send_no_mail_app">Keine App zum Versenden der Meldungen gefunden. Bitte installiere die Mail-App!</string>
   <string name="move_file_invalid_overwrite">Die Datei ist bereits im Zielordner vorhanden</string>
   <string name="move_file_error">Es ist ein Fehler beim Verschieben der Datei oder des Ordners aufgetreten.</string>
   <string name="forbidden_permissions_move">um diese Datei zu verschieben</string>
+  <string name="copy_file_invalid_overwrite">Die Datei existiert bereits im Zielverzeichnis</string>
   <string name="prefs_category_instant_uploading">Sofortiges Hochladen</string>
   <string name="prefs_category_security">Sicherheit</string>
   <string name="prefs_instant_video_upload_path_title">Verzeichnis zum Hochladen der Videos</string>
index d7ffc33..434d5fb 100644 (file)
   <string name="share_link_empty_password">Πρέπει να εισάγετε ένα κωδικό πρόσβασης.</string>
   <string name="activity_chooser_send_file_title">Αποστολή</string>
   <string name="copy_link">Αντιγραφή συνδέσμου</string>
-  <string name="clipboard_text_copied">Î\91νÏ\84ιγÏ\81αÏ\86θηκε στο πρόχειρο</string>
+  <string name="clipboard_text_copied">Î\91νÏ\84ιγÏ\81άÏ\86ηκε στο πρόχειρο</string>
   <string name="error_cant_bind_to_operations_service">Κρίσιμο σφάλμα: αδύνατη η εκτέλεση λειτουργειών</string>
   <string name="network_error_socket_exception">Ένα σφάλμα προέκυψε κατά τη σύνδεση με το διακομιστή.</string>
   <string name="network_error_socket_timeout_exception">Ένα σφάλμα προέκυψε κατά την αναμονή για το διακομιστή, η λειτουργία δεν ήταν επιτυχής</string>
   <string name="downloader_download_file_not_found">Αυτό το αρχείο δεν είναι πια διαθέσιμο στο διακομιστή</string>
   <string name="prefs_category_accounts">Λογαριασμοί</string>
   <string name="prefs_add_account">Προσθήκη λογαριασμού</string>
-  <string name="auth_redirect_non_secure_connection_title">Ασφαλής σύνδεση ανακατευθύνεται σε μια μη ασφαλή διαδρομή.</string>
+  <string name="auth_redirect_non_secure_connection_title">Ασφαλής σύνδεση ανακατευθύνεται μέσω μιας μη ασφαλούς διαδρομής.</string>
   <string name="actionbar_logger">Αρχεία καταγραφών</string>
   <string name="log_send_history_button">Αποστολή Ιστορικού</string>
   <string name="log_send_no_mail_app">Δεν εντοπίστηκε εφαρμογή αποστολής αναφορών συστήματος. Εγκαταστήστε την εφαρμογή Ηλ. Ταχυδρομείου!!</string>
   <string name="move_file_invalid_overwrite">Το αρχείο υπάρχει ήδη στο φάκελο προορισμού</string>
   <string name="move_file_error">Ένα σφάλμα προέκυψε κατά την προσπάθεια μετακίνησης αυτού του αρχείου ή φακέλου</string>
   <string name="forbidden_permissions_move">για μετακίνηση αυτού του αρχείου</string>
+  <string name="copy_file_not_found">Αδύνατη η αντιγραφή. Παρακαλώ ελέγξτε αν το αρχείο υπάρχει</string>
+  <string name="copy_file_invalid_into_descendent">Δεν είναι δυνατό να αντιγραφεί ο φάκελος σε παράγωγό του φάκελο</string>
+  <string name="copy_file_invalid_overwrite">Το αρχείο υπάρχει ήδη στο φάκελο προορισμού</string>
+  <string name="copy_file_error">Παρουσιάστηκε σφάλμα κατά την προσπάθεια αντιγραφής αυτού του αρχείου ή φακέλου</string>
+  <string name="forbidden_permissions_copy">για αντιγραφή αυτού του αρχείου</string>
   <string name="prefs_category_instant_uploading">Στιγμιαίες Μεταφορτώσεις</string>
   <string name="prefs_category_security">Ασφάλεια</string>
   <string name="prefs_instant_video_upload_path_title">Διαδρομή Μεταφόρτωσης Βίντεο</string>
index 486eb58..f0c7acd 100644 (file)
   <string name="downloader_download_file_not_found">The file is no longer available on the server</string>
   <string name="prefs_category_accounts">Accounts</string>
   <string name="prefs_add_account">Add account</string>
-  <string name="auth_redirect_non_secure_connection_title">Secure connection is redirected to an unsecured route.</string>
+  <string name="auth_redirect_non_secure_connection_title">Secure connection is redirected through an unsecured route.</string>
   <string name="actionbar_logger">Logs</string>
   <string name="log_send_history_button">Send History</string>
   <string name="log_send_no_mail_app">No app for sending logs found. Install mail app!</string>
   <string name="move_file_invalid_overwrite">The file exists already in the destination folder</string>
   <string name="move_file_error">An error occurred whilst trying to move this file or folder</string>
   <string name="forbidden_permissions_move">to move this file</string>
+  <string name="copy_file_invalid_overwrite">The file exists already in the destination folder</string>
   <string name="prefs_category_instant_uploading">Instant Uploads</string>
   <string name="prefs_category_security">Security</string>
   <string name="prefs_instant_video_upload_path_title">Upload Video Path</string>
diff --git a/res/values-en-rUS/strings.xml b/res/values-en-rUS/strings.xml
new file mode 100644 (file)
index 0000000..37e6152
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<resources>
+  <!--TODO re-enable when server-side folder size calculation is available   
+       <item>Biggest - Smallest</item>-->
+  <!--TODO re-enable when "Accounts" is available in Navigation Drawer-->
+  <!--<string name="drawer_item_accounts">Accounts</string>-->
+  <!--TODO re-enable when "On Device" is available
+    <string name="drawer_item_on_device">On device</string>-->
+  <string name="empty"></string>
+</resources>
index 4a91921..daf7c1f 100644 (file)
   <string name="actionbar_move">Movi</string>
   <string name="folder_picker_choose_button_text">Elekti</string>
   <string name="move_file_invalid_overwrite">La dosiero jam ekzistas en la cela dosierujo</string>
+  <string name="copy_file_invalid_overwrite">La dosiero jam ekzistas en la cela dosierujo</string>
   <string name="prefs_category_security">Sekuro</string>
   <string name="auth_host_address">Servila adreso</string>
 </resources>
index 5d91a8f..f159bce 100644 (file)
   <string name="downloader_download_file_not_found">El archivo no esta mas disponible en este Servidor</string>
   <string name="prefs_category_accounts">Cuentas</string>
   <string name="prefs_add_account">Añadir cuenta</string>
-  <string name="auth_redirect_non_secure_connection_title">Conexión segura redireccionada a una ruta insegura.</string>
   <string name="actionbar_logger">Registro</string>
   <string name="log_send_history_button">Enviar Historial</string>
   <string name="log_send_no_mail_app">Aplicación para enviar registros no encontrada. Instale una aplicación de correo!</string>
   <string name="move_file_invalid_overwrite">El archivo ya existe en la carpeta destino</string>
   <string name="move_file_error">Un error ocurrió intentando mover el archivo o carpeta</string>
   <string name="forbidden_permissions_move">para mover este archivo</string>
+  <string name="copy_file_invalid_overwrite">El archivo ya existe en la carpeta destino</string>
   <string name="prefs_category_instant_uploading">Subida Instantánea </string>
   <string name="prefs_category_security">Seguridad</string>
   <string name="prefs_instant_video_upload_path_title">Dirección de subida del video</string>
diff --git a/res/values-es-rES/strings.xml b/res/values-es-rES/strings.xml
new file mode 100644 (file)
index 0000000..37e6152
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<resources>
+  <!--TODO re-enable when server-side folder size calculation is available   
+       <item>Biggest - Smallest</item>-->
+  <!--TODO re-enable when "Accounts" is available in Navigation Drawer-->
+  <!--<string name="drawer_item_accounts">Accounts</string>-->
+  <!--TODO re-enable when "On Device" is available
+    <string name="drawer_item_on_device">On device</string>-->
+  <string name="empty"></string>
+</resources>
index cf25224..1796c4a 100644 (file)
   <string name="confirmation_remove_folder_alert">¿Realmente desea eliminar %1$s y todo su contenido?</string>
   <string name="confirmation_remove_local">Sólo local</string>
   <string name="confirmation_remove_folder_local">Sólo local</string>
+  <string name="confirmation_remove_remote">Desde el servidor</string>
+  <string name="confirmation_remove_remote_and_local">Remoto &amp; local</string>
   <string name="remove_success_msg">Borrado correctamente</string>
   <string name="remove_fail_msg">El borrado no pudo ser completado</string>
   <string name="rename_dialog_title">Introduzca un nombre nuevo</string>
   <string name="instant_video_upload_on_wifi">Subir vídeos sólo por WiFi</string>
   <string name="instant_upload_path">/SubidasInstantáneas</string>
   <string name="conflict_title">Conflicto con archivo</string>
-  <string name="conflict_message">¿Qué archivos desea mantener? Si selecciona ambas versiones, el archivo local tendrá un número añadido a su nombre.</string>
+  <string name="conflict_message">¿Cuáles archivos desea mantener? Si selecciona ambas versiones, el archivo local tendrá un número añadido a su nombre.</string>
   <string name="conflict_keep_both">Mantener ambos</string>
+  <string name="conflict_use_local_version">versión local</string>
+  <string name="conflict_use_server_version">versión del servidor</string>
   <string name="preview_image_description">Previsualización de imagen</string>
   <string name="preview_image_error_unknown_format">No se puede mostrar la imagen</string>
   <string name="error__upload__local_file_not_copied">%1$s se pudo copiar a la carpeta local %2$s</string>
   <string name="downloader_download_file_not_found">Este archivo ya no se encuentra en el servidor</string>
   <string name="prefs_category_accounts">Cuentas</string>
   <string name="prefs_add_account">Agregar cuenta</string>
-  <string name="auth_redirect_non_secure_connection_title">La conexión segura está siendo desviada por una ruta insegura.</string>
+  <string name="auth_redirect_non_secure_connection_title">La conexión segura está siendo redirigida por una ruta insegura.</string>
   <string name="actionbar_logger">Registros</string>
   <string name="log_send_history_button">Enviar historial</string>
   <string name="log_send_no_mail_app">No se ha encontrado una app para enviar logs. Instale la app mail!</string>
   <string name="move_file_invalid_overwrite">El archivo ya existe en la carpeta de destino</string>
   <string name="move_file_error">Hubo un error al tratar de mover este archivo o carpeta</string>
   <string name="forbidden_permissions_move">para mover este archivo</string>
+  <string name="copy_file_not_found">No se puede copiar. Revise si existe el archivo</string>
+  <string name="copy_file_invalid_into_descendent">No se puede copiar una carpeta dentro de una de sus subcarpetas.</string>
+  <string name="copy_file_invalid_overwrite">El fichero ya existe en el directorio de destino</string>
+  <string name="copy_file_error">Hubo un error al tratar de copiar este archivo o carpeta</string>
+  <string name="forbidden_permissions_copy">para copiar este archivo</string>
   <string name="prefs_category_instant_uploading">Subidas instantáneas</string>
   <string name="prefs_category_security">Seguridad</string>
   <string name="prefs_instant_video_upload_path_title">Guardar videos subidos en la carpeta:</string>
index 7c94bca..a4841a4 100644 (file)
@@ -206,6 +206,8 @@ Allpool on loend kohalikest failidest ning serveris asuvatest failidest %5$s, mi
   <string name="confirmation_remove_folder_alert">Kas sa tõesti soovid eemaldada %1$s ja selle sisu?</string>
   <string name="confirmation_remove_local">Ainult kohalik</string>
   <string name="confirmation_remove_folder_local">Ainult kohalik</string>
+  <string name="confirmation_remove_remote">Serverist</string>
+  <string name="confirmation_remove_remote_and_local">Kaugfail &amp; kohalik</string>
   <string name="remove_success_msg">Eemaldamine oli edukas</string>
   <string name="remove_fail_msg">Eemaldamine ebaõnnestus</string>
   <string name="rename_dialog_title">Sisesta uus nimi</string>
@@ -260,6 +262,8 @@ Allpool on loend kohalikest failidest ning serveris asuvatest failidest %5$s, mi
   <string name="conflict_title">Failikonflikt</string>
   <string name="conflict_message">Millist faili sa soovid säilitada? Kui valid mõlemad versioonid, siis lisatakse kohaliku faili nimele number.</string>
   <string name="conflict_keep_both">Säilita mõlemad</string>
+  <string name="conflict_use_local_version">kohalik versioon</string>
+  <string name="conflict_use_server_version">serveri versioon</string>
   <string name="preview_image_description">Pildi eelvaade</string>
   <string name="preview_image_error_unknown_format">Seda pilti ei saa näidata</string>
   <string name="error__upload__local_file_not_copied">%1$s ei suudetud kopeerida kohalikku kataloogi %2$s</string>
@@ -291,7 +295,7 @@ Allpool on loend kohalikest failidest ning serveris asuvatest failidest %5$s, mi
   <string name="downloader_download_file_not_found">Fail ei ole serveris enam kättesaadav</string>
   <string name="prefs_category_accounts">Kontod</string>
   <string name="prefs_add_account">Lisa konto</string>
-  <string name="auth_redirect_non_secure_connection_title">Turvaline ühendus suunatakse läbi turvamata ühenduse.</string>
+  <string name="auth_redirect_non_secure_connection_title">Turvalist ühendust suunatakse läbi turvamata ühenduse.</string>
   <string name="actionbar_logger">Logid</string>
   <string name="log_send_history_button">Saada ajalugu</string>
   <string name="log_send_no_mail_app">Logide saatmise rakendust ei leitud. Paigalda postirakendus!</string>
@@ -307,6 +311,11 @@ Allpool on loend kohalikest failidest ning serveris asuvatest failidest %5$s, mi
   <string name="move_file_invalid_overwrite">See fail on juba sihtkaustas olemas</string>
   <string name="move_file_error">Selle faili või kausta liigutamisel tekkis tõrge</string>
   <string name="forbidden_permissions_move">selle faili liigutamiseks</string>
+  <string name="copy_file_not_found">Kopeerimine ebaõnnestus. Palun kontrolli, kas fail on olemas</string>
+  <string name="copy_file_invalid_into_descendent">Kausta ei saa kopeerida tema enda alamkausta</string>
+  <string name="copy_file_invalid_overwrite">See fail on juba sihtkaustas olemas</string>
+  <string name="copy_file_error">Selle faili või kausta kopeerimisel tekkis tõrge</string>
+  <string name="forbidden_permissions_copy">et kopeerida seda faili</string>
   <string name="prefs_category_instant_uploading">Kohesed üleslaadimised</string>
   <string name="prefs_category_security">Turvalisus</string>
   <string name="prefs_instant_video_upload_path_title">Video üleslaadimise asukoht</string>
index 8c14aef..a532d2c 100644 (file)
@@ -259,7 +259,7 @@ Mesedez, baimendu berriz</string>
   <string name="downloader_download_file_not_found">Fitxategia jadanik ez dago eskuragarri zerbitzarian</string>
   <string name="prefs_category_accounts">Kontuak</string>
   <string name="prefs_add_account">Gehitu kontua</string>
-  <string name="auth_redirect_non_secure_connection_title">Konexio segurua birbideratu da segurua ez den bide batera.</string>
+  <string name="auth_redirect_non_secure_connection_title">Konexio segurua birbideratu da segurua ez den bide batetik.</string>
   <string name="actionbar_logger">Egunkariak</string>
   <string name="log_send_history_button">Bidali Historia</string>
   <string name="log_send_no_mail_app">Egunkariak bidaltzeko aplikaziorik ez da aurkitu. Instalatu posta aplikazioa!</string>
@@ -274,6 +274,7 @@ Mesedez, baimendu berriz</string>
   <string name="move_file_invalid_overwrite">Fitxategia dagoeneko existitzen da helburuko karpetan</string>
   <string name="move_file_error">Errore bat gertatu da fitxategi edo karpeta hau mugitzen saiatzerakoan</string>
   <string name="forbidden_permissions_move">fitxategi hau mugitzeko</string>
+  <string name="copy_file_invalid_overwrite">Fitxategia dagoeneko existitzen da helburuko karpetan</string>
   <string name="prefs_category_instant_uploading">Berehalako Igoerak</string>
   <string name="prefs_category_security">Segurtasuna</string>
   <string name="prefs_instant_video_upload_path_title">Bideo Igoera Bidea</string>
index f12292e..41d3937 100644 (file)
   <string name="move_file_not_found">Siirto ei onnistu. Tarkista, ettei tiedostoa ole jo olemassa</string>
   <string name="move_file_invalid_overwrite">Tiedosto on jo olemassa kohdekansiossa</string>
   <string name="move_file_error">Tämän tiedoston tai kansion siirtoa yrittäessä tapahtui virhe</string>
+  <string name="copy_file_not_found">Kopiointi epäonnistui. Tarkista onko tiedostoa olemassa</string>
+  <string name="copy_file_invalid_overwrite">Tiedosto on jo kohdekansiossa.</string>
+  <string name="copy_file_error">Tätä tiedostoa tai kansiota kopioitaessa tapahtui virhe</string>
   <string name="prefs_category_instant_uploading">Välittömät lähetykset</string>
   <string name="prefs_category_security">Tietoturva</string>
   <string name="shared_subject_header">jaettu</string>
index a502db5..4a4111b 100644 (file)
@@ -278,19 +278,19 @@ Ci-dessous la liste des fichiers locaux, et les fichiers distants dans %5$s auxq
   <string name="share_link_empty_password">Vous devez saisir un mot de passe</string>
   <string name="activity_chooser_send_file_title">Envoyer</string>
   <string name="copy_link">Copier le lien</string>
-  <string name="clipboard_text_copied">Copié dans le presse-papiers</string>
+  <string name="clipboard_text_copied">Copié dans le presse-papier</string>
   <string name="error_cant_bind_to_operations_service">Erreur critique : impossible de réaliser des opérations</string>
   <string name="network_error_socket_exception">Une erreur est survenue pendant la connexion au serveur.</string>
   <string name="network_error_socket_timeout_exception">Une erreur est survenue pendant l\'attente du serveur. L\'opération n\'a pas pu être effectuée</string>
   <string name="network_error_connect_timeout_exception">Une erreur est survenue pendant l\'attente du serveur. L\'opération n\'a pas pu être effectuée</string>
   <string name="network_host_not_available">L\'opération n\'a pas pu être terminée, le serveur n\'est pas disponible</string>
   <string name="empty"></string>
-  <string name="forbidden_permissions">Vous ne possédez pas les droits suffisants %s</string>
-  <string name="forbidden_permissions_rename">afin de renommer ce fichier</string>
-  <string name="forbidden_permissions_delete">afin d’effacer ce fichier</string>
+  <string name="forbidden_permissions">Vous n\'avez pas la permission %s</string>
+  <string name="forbidden_permissions_rename">de renommer ce fichier</string>
+  <string name="forbidden_permissions_delete">d’effacer ce fichier</string>
   <string name="share_link_forbidden_permissions">afin de partager ce fichier</string>
   <string name="unshare_link_forbidden_permissions">afin de ne plus partager ce fichier</string>
-  <string name="forbidden_permissions_create">afin de créer ce fichier</string>
+  <string name="forbidden_permissions_create">de créer ce fichier</string>
   <string name="uploader_upload_forbidden_permissions">afin d’importer dans ce répertoire</string>
   <string name="downloader_download_file_not_found">Ce fichier n’est plus disponible sur le serveur</string>
   <string name="prefs_category_accounts">Comptes</string>
@@ -311,6 +311,11 @@ Ci-dessous la liste des fichiers locaux, et les fichiers distants dans %5$s auxq
   <string name="move_file_invalid_overwrite">Le fichier existe déjà dans le dossier de destination</string>
   <string name="move_file_error">Une erreur est survenue lors de la tentative de déplacement de ce fichier ou dossier</string>
   <string name="forbidden_permissions_move">de déplacer ce fichier</string>
+  <string name="copy_file_not_found">Impossible de copier. Vérifiez que le fichier existe</string>
+  <string name="copy_file_invalid_into_descendent">Il n\'est pas possible de copier un dossier vers un de ses descendants</string>
+  <string name="copy_file_invalid_overwrite">Fichier déjà existant dans le dossier de destination</string>
+  <string name="copy_file_error">Une erreur est survenue lors de la copie de ce fichier ou dossier</string>
+  <string name="forbidden_permissions_copy">de copier ce fichier</string>
   <string name="prefs_category_instant_uploading">Téléversement immédiat</string>
   <string name="prefs_category_security">Sécurité</string>
   <string name="prefs_instant_video_upload_path_title">Répertoire de téléversement des vidéos</string>
index 18ae1a9..51aa4a4 100644 (file)
@@ -291,7 +291,7 @@ Descárgueo de aquí: %2$s</string>
   <string name="downloader_download_file_not_found">O ficheiro xa non está dispoñíbel no servidor</string>
   <string name="prefs_category_accounts">Contas</string>
   <string name="prefs_add_account">Engadir unha conta</string>
-  <string name="auth_redirect_non_secure_connection_title">A conexión segura está a ser redirixida a unha ruta non segura.</string>
+  <string name="auth_redirect_non_secure_connection_title">A conexión segura está a ser redirixida a través dunha ruta non segura.</string>
   <string name="actionbar_logger">Rexistros</string>
   <string name="log_send_history_button">Enviar o historial</string>
   <string name="log_send_no_mail_app">Non se atopou unha aplicación para enviar os rexistros. Instale unha aplicación de correo!</string>
@@ -307,6 +307,7 @@ Descárgueo de aquí: %2$s</string>
   <string name="move_file_invalid_overwrite">Este ficheiro xa existe no cartafol de destino</string>
   <string name="move_file_error">Produciuse un erro ao tentar mover este ficheiro ou cartafol.</string>
   <string name="forbidden_permissions_move">para mover este ficheiro</string>
+  <string name="copy_file_invalid_overwrite">Este ficheiro xa existe no cartafol de destino</string>
   <string name="prefs_category_instant_uploading">Envío instantáneo</string>
   <string name="prefs_category_security">Seguridade</string>
   <string name="prefs_instant_video_upload_path_title">Enviar a ruta do vídeo</string>
index f10f2d7..1a62cc2 100644 (file)
   <string name="downloader_download_file_not_found">הקובץ אינו זמין יותר על השרת</string>
   <string name="prefs_category_accounts">חשבונות</string>
   <string name="prefs_add_account">הוספת חשבון</string>
+  <string name="auth_redirect_non_secure_connection_title">חיבור מאובטח מנותב דרך נתיב לא מאובטח</string>
   <string name="folder_picker_choose_button_text">בחירה</string>
   <string name="prefs_category_security">אבטחה</string>
   <string name="auth_host_address">כתובת שרת</string>
index 56e55a1..37e6152 100644 (file)
@@ -1,4 +1,10 @@
 <?xml version='1.0' encoding='UTF-8'?>
 <resources>
+  <!--TODO re-enable when server-side folder size calculation is available   
+       <item>Biggest - Smallest</item>-->
+  <!--TODO re-enable when "Accounts" is available in Navigation Drawer-->
+  <!--<string name="drawer_item_accounts">Accounts</string>-->
+  <!--TODO re-enable when "On Device" is available
+    <string name="drawer_item_on_device">On device</string>-->
   <string name="empty"></string>
 </resources>
index a23b66e..76fa404 100644 (file)
   <string name="downloader_download_file_not_found">Berkas tidak lagi tersedia pada server</string>
   <string name="prefs_category_accounts">Akun</string>
   <string name="prefs_add_account">Tambah akun</string>
-  <string name="auth_redirect_non_secure_connection_title">Sambungan aman dialihkan ke rute yang tidak aman.</string>
+  <string name="auth_redirect_non_secure_connection_title">Sambungan aman dialihkan melalui rute yang tidak aman.</string>
   <string name="actionbar_logger">Log</string>
   <string name="log_send_history_button">Kirim Riwayat</string>
   <string name="log_send_no_mail_app">Tidak ada apl untuk mengirim log. Instal apl mail!</string>
   <string name="move_file_invalid_overwrite">Berkas sudah ada didalam folder tujuan</string>
   <string name="move_file_error">Terjadi kesalahan saat mencoba memindahkan berkas atau folder ini</string>
   <string name="forbidden_permissions_move">untuk memindahkan berkas ini</string>
+  <string name="copy_file_not_found">Tidak dapat menyalin. Silakan periksa apakah berkas ada</string>
+  <string name="copy_file_invalid_into_descendent">Tidak mungkin menyalin folder kedalam turunannya</string>
+  <string name="copy_file_invalid_overwrite">Berkas sudah ada didalam folder tujuan</string>
+  <string name="copy_file_error">Terjadi kesalahan ketika mencoba menyalin berkas atau folder ini</string>
+  <string name="forbidden_permissions_copy">untuk menyalin berkas ini</string>
   <string name="prefs_category_instant_uploading">Unggah Cepat</string>
   <string name="prefs_category_security">Keamanan</string>
   <string name="prefs_instant_video_upload_path_title">Unggah Lokasi Video</string>
index bfdd91b..2d50d6f 100644 (file)
@@ -20,6 +20,7 @@
   <string name="file_list_seconds_ago">sek.</string>
   <string name="file_list_empty">Ekkert hér. Settu eitthvað inn!</string>
   <string name="filedetails_download">Niðurhal</string>
+  <string name="action_share_file">Deila hlekk</string>
   <string name="common_yes">Já</string>
   <string name="common_no">Nei</string>
   <string name="common_ok">Í lagi</string>
@@ -32,6 +33,7 @@
   <string name="common_remove">Fjarlægja</string>
   <string name="activity_chooser_send_file_title">Senda</string>
   <string name="empty"></string>
+  <string name="actionbar_move">Færa</string>
   <string name="folder_picker_choose_button_text">Veldu</string>
   <string name="auth_host_address">Host nafn netþjóns</string>
 </resources>
index 09b89aa..874bbe6 100644 (file)
   <string name="downloader_download_file_not_found">Il file non è più disponibile sul server</string>
   <string name="prefs_category_accounts">Account</string>
   <string name="prefs_add_account">Aggiungi account</string>
-  <string name="auth_redirect_non_secure_connection_title">La connessione sicura è rediretta su un percorso non sicuro.</string>
+  <string name="auth_redirect_non_secure_connection_title">La connessione sicura è rediretta attraverso un percorso non sicuro.</string>
   <string name="actionbar_logger">Registri</string>
   <string name="log_send_history_button">Invia cronologia</string>
   <string name="log_send_no_mail_app">Non è stata trovata alcuna applicazione per l\'invio dei registri. Installa l\'applicazione mail!</string>
   <string name="move_file_invalid_overwrite">Il file esiste già nella cartella di destinazione</string>
   <string name="move_file_error">Si è verificato un errore durante il tentativo di spostare il file o la cartella</string>
   <string name="forbidden_permissions_move">per spostare questo file</string>
+  <string name="copy_file_not_found">Impossibile copiare. Assicurati che il file esista</string>
+  <string name="copy_file_invalid_into_descendent">Impossibile copiare una cartella in una cartella inferiore</string>
+  <string name="copy_file_invalid_overwrite">Il file esiste già nella cartella di destinazione</string>
+  <string name="copy_file_error">Si è verificato un errore durante il tentativo di copiare il file o la cartella</string>
+  <string name="forbidden_permissions_copy">per copiare questo file</string>
   <string name="prefs_category_instant_uploading">Caricamenti istantanei</string>
   <string name="prefs_category_security">Protezione</string>
   <string name="prefs_instant_video_upload_path_title">Percorso di caricamento video</string>
index c6f90c2..b51e644 100644 (file)
   <string name="downloader_download_file_not_found">ファイルはサーバー上で利用できません</string>
   <string name="prefs_category_accounts">アカウント</string>
   <string name="prefs_add_account">アカウントを追加</string>
-  <string name="auth_redirect_non_secure_connection_title">暗号化接続は非暗号化接続にリダイレクトされました。</string>
+  <string name="auth_redirect_non_secure_connection_title">暗号化されていない接続を経て、暗号化接続へリダイレクトされました。</string>
   <string name="actionbar_logger">ログ</string>
   <string name="log_send_history_button">ログを送信</string>
   <string name="log_send_no_mail_app">ログを送信するアプリが見つかりませんでした。メールアプリをインストールしてください。</string>
   <string name="move_file_invalid_overwrite">そのファイルは宛先フォルダーにすでに存在します。</string>
   <string name="move_file_error">このファイルまたはフォルダーを移動する際にエラーが発生しました</string>
   <string name="forbidden_permissions_move">このファイルを移動</string>
+  <string name="copy_file_invalid_overwrite">そのファイルは宛先フォルダーにすでに存在します。</string>
   <string name="prefs_category_instant_uploading">自動アップロード</string>
   <string name="prefs_category_security">セキュリティ</string>
   <string name="prefs_instant_video_upload_path_title">動画のアップロードパス</string>
index efc3c1a..d3a813a 100644 (file)
   <string name="downloader_download_file_not_found">이 파일을 서버에서 더 이상 사용할 수 없습니다</string>
   <string name="prefs_category_accounts">계정</string>
   <string name="prefs_add_account">계정 추가</string>
-  <string name="auth_redirect_non_secure_connection_title">보안 연결이 안전하지 않은 경로로 넘어갑니다.</string>
   <string name="actionbar_logger">로그</string>
   <string name="log_send_history_button">과거 기록 보내기</string>
   <string name="log_send_no_mail_app">로그를 보낼 앱이 없습니다. 메일 앱을 설치하십시오!</string>
   <string name="move_file_invalid_overwrite">파일이 이미 대상 폴더에 존재합니다</string>
   <string name="move_file_error">이 파일이나 폴더를 이동하는 중 오류가 발생하였습니다</string>
   <string name="forbidden_permissions_move">이 파일을 이동할</string>
+  <string name="copy_file_invalid_overwrite">파일이 이미 대상 폴더에 존재합니다</string>
   <string name="prefs_category_instant_uploading">즉시 업로드</string>
   <string name="prefs_category_security">보안</string>
   <string name="prefs_instant_video_upload_path_title">동영상 업로드 경로</string>
diff --git a/res/values-la/strings.xml b/res/values-la/strings.xml
new file mode 100644 (file)
index 0000000..37e6152
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<resources>
+  <!--TODO re-enable when server-side folder size calculation is available   
+       <item>Biggest - Smallest</item>-->
+  <!--TODO re-enable when "Accounts" is available in Navigation Drawer-->
+  <!--<string name="drawer_item_accounts">Accounts</string>-->
+  <!--TODO re-enable when "On Device" is available
+    <string name="drawer_item_on_device">On device</string>-->
+  <string name="empty"></string>
+</resources>
index 9946842..80ccbff 100644 (file)
   <string name="downloader_download_file_not_found">De Fichier ass net méi um Server disponibel</string>
   <string name="prefs_category_accounts">Konten</string>
   <string name="prefs_add_account">Kont dobäisetzen</string>
-  <string name="auth_redirect_non_secure_connection_title">Sécher Connectioun gëtt op eng onsécher Route ëmgeleet.</string>
   <string name="actionbar_logger">Protokoller</string>
   <string name="log_send_history_button">Historique schécken</string>
   <string name="log_send_no_mail_app">Keng App fonnt fir d\'Protokoller ze schécken. Installéier eng Mail-App!</string>
   <string name="move_file_invalid_overwrite">De Fichier existéiert schonn am Zildossier</string>
   <string name="move_file_error">Beim Réckele vun dësem Fichier oder Dossier ass e Feeler opgetrueden</string>
   <string name="forbidden_permissions_move">fir dëse Fichier ze réckelen</string>
+  <string name="copy_file_invalid_overwrite">De Fichier existéiert schonn am Zildossier</string>
   <string name="prefs_category_instant_uploading">Direkt eropgeluede Fichieren</string>
   <string name="prefs_category_security">Sécherheet</string>
   <string name="prefs_instant_video_upload_path_title">Pad fir d\'Eropluede vun de Videoen</string>
index 8c842a2..1c6f96f 100644 (file)
   <string name="downloader_download_file_not_found">Датотеката веќе не е достапна на серверот</string>
   <string name="prefs_category_accounts">Сметки</string>
   <string name="prefs_add_account">Додади сметка</string>
-  <string name="auth_redirect_non_secure_connection_title">Сигурната конекција е преусмерена на несигурна рута.</string>
   <string name="actionbar_logger">Логови</string>
   <string name="log_send_history_button">Прати историја</string>
   <string name="log_send_no_mail_app">Нема апликација за праќање на логови. Инсталирајте апликација за пошта!</string>
   <string name="move_file_invalid_overwrite">Датотеката веќе постои во целната папка</string>
   <string name="move_file_error">Се случи грешка кога пробував да ја преместам оваа датотека или папка</string>
   <string name="forbidden_permissions_move">да ја преместам оваа датотека</string>
+  <string name="copy_file_invalid_overwrite">Датотеката веќе постои во целната папка</string>
   <string name="prefs_category_instant_uploading">Инстант прикачувања</string>
   <string name="prefs_category_security">Безбедност</string>
   <string name="prefs_instant_video_upload_path_title">Прикачи патека на видео</string>
index cb99ece..bbf1061 100644 (file)
   <string name="confirmation_remove_folder_alert">Vil du virkelig fjerne %1$s inkludert innholdet?</string>
   <string name="confirmation_remove_local">Kun lokalt</string>
   <string name="confirmation_remove_folder_local">Kun lokalt</string>
+  <string name="confirmation_remove_remote">Fra server</string>
+  <string name="confirmation_remove_remote_and_local">Ekstern &amp; lokal</string>
   <string name="remove_success_msg">Fjerning var vellykket</string>
   <string name="remove_fail_msg">Fjerning mislyktes</string>
   <string name="rename_dialog_title">Skriv inn et nytt navn</string>
   <string name="instant_upload_on_wifi">Kun last opp bilder via WiFi</string>
   <string name="instant_video_upload_on_wifi">Last opp video kun via WiFi</string>
   <string name="instant_upload_path">/Direkteopplasting</string>
+  <string name="conflict_title">Filkonflikt</string>
+  <string name="conflict_message">Hvilke filer ønsker du å beholder? Hvis du velger begge versjonene, får den lokale filen lagt til et tall i navnet.</string>
   <string name="conflict_keep_both">Behold begge</string>
+  <string name="conflict_use_local_version">lokal versjon</string>
+  <string name="conflict_use_server_version">server-versjon</string>
   <string name="preview_image_description">Bildeforhåndsvisning</string>
   <string name="preview_image_error_unknown_format">Dette bildet kan ikke vises</string>
   <string name="error__upload__local_file_not_copied">%1$s kunne ikke kopieres til lokal mappe %2$s</string>
   <string name="downloader_download_file_not_found">Filen finnes ikke på serveren lenger</string>
   <string name="prefs_category_accounts">Kontoer</string>
   <string name="prefs_add_account">Legg til en konto</string>
-  <string name="auth_redirect_non_secure_connection_title">Sikker forbindelse er omdirigert til en usikker rute.</string>
+  <string name="auth_redirect_non_secure_connection_title">Sikker tilkobling videresendes gjennom en usikker rute.</string>
   <string name="actionbar_logger">Logger</string>
   <string name="log_send_history_button">Send historikk</string>
   <string name="log_send_no_mail_app">Ingen app for sending av logger funnet. Installer epost-app!</string>
   <string name="move_file_invalid_overwrite">Filen finnes allerede i målmappen</string>
   <string name="move_file_error">En feil oppstod ved flytting av denne filen eller mappen</string>
   <string name="forbidden_permissions_move">å flytte denne filen</string>
+  <string name="copy_file_not_found">Kan ikke kopiere. Sjekk om filen eksisterer</string>
+  <string name="copy_file_invalid_into_descendent">Det er ikke mulig å kopiere en mappe inn i sin egen undermappe</string>
+  <string name="copy_file_invalid_overwrite">Filen finnes allerede i målmappen</string>
+  <string name="copy_file_error">En feil oppstod ved kopiering av denne filen eller mappen</string>
+  <string name="forbidden_permissions_copy">å kopiere denne filen</string>
   <string name="prefs_category_instant_uploading">Umiddelbare opplastinger</string>
   <string name="prefs_category_security">Sikkerhet</string>
   <string name="prefs_instant_video_upload_path_title">Sti til video-opplasting</string>
   <string name="shared_subject_header">delte</string>
   <string name="with_you_subject_header">med deg</string>
   <string name="subject_token">%1$s delte \"%2$s\" med deg</string>
+  <string name="saml_subject_token">\"%1$s\" er blitt delt med deg</string>
   <string name="auth_refresh_button">Oppfrisk forbindelse</string>
   <string name="auth_host_address">Server-adresse</string>
   <string name="common_error_out_memory">Ikke nok minne</string>
index 8e1e5eb..88eef42 100644 (file)
@@ -294,7 +294,7 @@ Hieronder staan de lokale bestanden en de externe bestanden in %5$s waar ze naar
   <string name="downloader_download_file_not_found">Dit bestand is niet langer beschikbaar op de server</string>
   <string name="prefs_category_accounts">Accounts</string>
   <string name="prefs_add_account">Toevoegen account</string>
-  <string name="auth_redirect_non_secure_connection_title">De beveiligde verbinding is omgeleid naar een onveilige route.</string>
+  <string name="auth_redirect_non_secure_connection_title">De beveiligde verbinding is omgeleid via een onveilige route.</string>
   <string name="actionbar_logger">Logs</string>
   <string name="log_send_history_button">Verstuur geschiedenis</string>
   <string name="log_send_no_mail_app">Geen app voor versturen van logs gevonden. Installeer de mail app!</string>
@@ -310,6 +310,11 @@ Hieronder staan de lokale bestanden en de externe bestanden in %5$s waar ze naar
   <string name="move_file_invalid_overwrite">Het bestand bestaat al in de doelmap</string>
   <string name="move_file_error">Er trad een fout op bij uw poging dit bestand of deze map te verplaatsen</string>
   <string name="forbidden_permissions_move">om dit bestand te verplaatsen</string>
+  <string name="copy_file_not_found">Kan niet kopiëren. Ga na of het bestand wel bestaat</string>
+  <string name="copy_file_invalid_into_descendent">De map kan niet naar een onderliggende map worden gekopieerd</string>
+  <string name="copy_file_invalid_overwrite">Het bestand bestaat al in de doelmap</string>
+  <string name="copy_file_error">Er trad een fout op bij uw poging dit bestand of deze map te kopiëren</string>
+  <string name="forbidden_permissions_copy">om dit bestand te kopiëren</string>
   <string name="prefs_category_instant_uploading">Directe uploads</string>
   <string name="prefs_category_security">Beveiliging</string>
   <string name="prefs_instant_video_upload_path_title">Upload Video Pad</string>
index 3e17598..c50bc37 100644 (file)
 <?xml version='1.0' encoding='UTF-8'?>
 <resources>
+  <string name="about_android">%1$s Android App</string>
   <string name="about_version">version %1$s</string>
-  <string name="actionbar_upload">Amontcarga</string>
+  <string name="actionbar_sync">Actualizar lo compte</string>
+  <string name="actionbar_upload">Mandar</string>
+  <string name="actionbar_upload_from_apps">Contengut d\'autras aplicacions</string>
   <string name="actionbar_upload_files">Fichièrs</string>
-  <string name="actionbar_mkdir">Novèl dorsièr</string>
-  <string name="actionbar_settings">Configuracion</string>
+  <string name="actionbar_open_with">Dobrir amb</string>
+  <string name="actionbar_mkdir">Dorsièr novèl</string>
+  <string name="actionbar_settings">Paramètres</string>
+  <string name="actionbar_see_details">Detalhs</string>
   <string name="actionbar_send_file">Mandar</string>
+  <string name="actionbar_sort">Triar</string>
+  <string name="actionbar_sort_title">Triar</string>
+  <string-array name="actionbar_sortby">
+    <item>per òrdre alfabetic</item>
+    <item>del mai recent al pus ancian</item>
+  </string-array>
   <!--TODO re-enable when server-side folder size calculation is available   
        <item>Biggest - Smallest</item>-->
   <!--TODO re-enable when "Accounts" is available in Navigation Drawer-->
   <!--<string name="drawer_item_accounts">Accounts</string>-->
+  <string name="drawer_item_all_files">Totes los fichièrs</string>
   <!--TODO re-enable when "On Device" is available
     <string name="drawer_item_on_device">On device</string>-->
   <string name="drawer_item_settings">Paramètres</string>
-  <string name="drawer_open">Dubrís</string>
+  <string name="drawer_item_logs">Logs</string>
+  <string name="drawer_close">Tampar</string>
+  <string name="drawer_open">Dobrir</string>
   <string name="prefs_category_general">General</string>
-  <string name="prefs_category_more">Mai d\'aquò</string>
+  <string name="prefs_category_more">Mai</string>
   <string name="prefs_accounts">Comptes</string>
-  <string name="prefs_manage_accounts">Maneja comptes</string>
+  <string name="prefs_manage_accounts">Gestion dels comptes</string>
+  <string name="prefs_passcode">Còde de seguretat</string>
+  <string name="prefs_instant_upload">Mandadís immediat de las fòtos</string>
+  <string name="prefs_instant_upload_summary">Mandar immediatament las fòtos presas per la camèra</string>
+  <string name="prefs_instant_video_upload">Mandadís immediat de las vidèos</string>
+  <string name="prefs_instant_video_upload_summary">Mandar immediatament las vidèos presas per la camèra</string>
+  <string name="prefs_log_title">Activar los logs</string>
+  <string name="prefs_log_summary">Utilizat per enregistrar los problèmas dins los logs</string>
+  <string name="prefs_log_title_history">Istoric dels logs</string>
+  <string name="prefs_log_summary_history">Aquò aficha los logs enregistrats</string>
+  <string name="prefs_log_delete_history_button">Suprimir l\'istoric</string>
   <string name="prefs_help">Ajuda</string>
-  <string name="prefs_imprint">Mencions legalas</string>
-  <string name="auth_username">Nom d\'usancièr</string>
+  <string name="prefs_recommend">Recomandar a un amis</string>
+  <string name="prefs_feedback">Comentaris</string>
+  <string name="prefs_imprint">Mencions</string>
+  <string name="prefs_remember_last_share_location">Memorizar l\'emplaçament de partiment</string>
+  <string name="prefs_remember_last_upload_location_summary">Memorizar lo darrièr emplaçament de mandadís</string>
+  <string name="recommend_subject">Ensajatz %1$s sus vòstre smartphone !</string>
+  <string name="recommend_text">M\'agradariá de vos convidar a utilizar %1$s sus vòstre smartphone !
+Telecargatz-lo aicí : %2$s</string>
+  <string name="auth_check_server">Verificar lo servidor</string>
+  <string name="auth_host_url">Adreça del servidor https://…</string>
+  <string name="auth_username">Nom d\'utilizaire</string>
   <string name="auth_password">Senhal</string>
+  <string name="auth_register">Novèl dins %1$s ?</string>
   <string name="sync_string_files">Fichièrs</string>
-  <string name="setup_btn_connect">Connecta</string>
-  <string name="uploader_btn_upload_text">Amontcarga</string>
-  <string name="uploader_btn_new_folder_text">Novèl dorsièr</string>
-  <string name="uploader_wrn_no_account_title">Cap de compte trobat</string>
+  <string name="setup_btn_connect">Connectar</string>
+  <string name="uploader_btn_upload_text">Mandar</string>
+  <string name="uploader_btn_new_folder_text">Dorsièr novèl</string>
+  <string name="uploader_top_message">Seleccionar lo dorsièr de mandadís :</string>
+  <string name="uploader_wrn_no_account_title">Cap de compte es pas estat trobat</string>
+  <string name="uploader_wrn_no_account_text">Cap de compte %1$s es pas estat trobat. Començar per ne configurar un.</string>
   <string name="uploader_wrn_no_account_setup_btn_text">Configuracion</string>
-  <string name="uploader_wrn_no_account_quit_btn_text">Quita</string>
-  <string name="uploader_info_uploading">Al amontcargar</string>
-  <string name="file_list_seconds_ago">segonda a</string>
-  <string name="file_list_empty">Pas res dedins. Amontcarga qualquaren</string>
+  <string name="uploader_wrn_no_account_quit_btn_text">Quitar</string>
+  <string name="uploader_wrn_no_content_title">Pas res a mandar</string>
+  <string name="uploader_wrn_no_content_text">Cap de contengut pas recebut. Pas res a mandar.</string>
+  <string name="uploader_error_forbidden_content">%1$s es pas autorizat a accedir al contengut partejat</string>
+  <string name="uploader_info_uploading">Mandadís...</string>
+  <string name="file_list_seconds_ago">i a qualques segondas</string>
+  <string name="file_list_empty">I a pas res aicí ! Mandatz doncas quicòm :)</string>
+  <string name="file_list_loading">Cargament...</string>
+  <string name="local_file_list_empty">Cap de fichièr es pas present dins aqueste dorsièr.</string>
+  <string name="filedetails_select_file">Quichatz sus un fichièr per afichar las informacions suplementàrias</string>
   <string name="filedetails_size">Talha :</string>
   <string name="filedetails_type">Tipe :</string>
-  <string name="filedetails_created">Creat :</string>
-  <string name="filedetails_modified">Modificat :</string>
-  <string name="filedetails_download">Avalcarga</string>
-  <string name="action_share_file">Partiment per ligam</string>
+  <string name="filedetails_created">Creat lo :</string>
+  <string name="filedetails_modified">Modificat lo :</string>
+  <string name="filedetails_download">Telecargar</string>
+  <string name="filedetails_sync_file">Actualizar lo fichièr</string>
+  <string name="filedetails_renamed_in_upload_msg">Lo fichièr es estat renomenat en %s pendent lo mandadís</string>
+  <string name="list_layout">Afichatge en lista</string>
+  <string name="action_share_file">Partejar lo ligam</string>
+  <string name="action_unshare_file">Partejar pas mai aqueste ligam</string>
   <string name="common_yes">Òc</string>
   <string name="common_no">Non</string>
-  <string name="common_ok">D\'accòrdi</string>
-  <string name="common_cancel_upload"> Anulla l\'amontcargar</string>
-  <string name="common_cancel">Annula</string>
+  <string name="common_ok">D\'acòrdi</string>
+  <string name="common_cancel_download">Anullar lo telecargament</string>
+  <string name="common_cancel_upload">Anullar lo mandadís</string>
+  <string name="common_cancel">Anullar</string>
+  <string name="common_save_exit">Salvar &amp; Quitar</string>
   <string name="common_error">Error</string>
-  <string name="common_error_unknown">Error Desconeguda </string>
-  <string name="about_title">A prepaus</string>
-  <string name="change_password">Cambia lo senhal</string>
-  <string name="delete_account">Escafa lo compte</string>
-  <string name="create_account">Crea un compte</string>
-  <string name="upload_chooser_title">Avalcarga dempuèi ...</string>
+  <string name="common_loading">Cargament…</string>
+  <string name="common_error_unknown">Error desconeguda </string>
+  <string name="about_title">A prepaus de</string>
+  <string name="change_password">Cambiar de senhal</string>
+  <string name="delete_account">Suprimir aqueste compte</string>
+  <string name="create_account">Crear un compte</string>
+  <string name="upload_chooser_title">Mandar un fichièr dempuèi…</string>
   <string name="uploader_info_dirname">Nom del dorsièr</string>
-  <string name="uploader_upload_in_progress_ticker">Al avalcargar ...</string>
-  <string name="uploader_upload_succeeded_ticker">Capitada d\'avalcargar</string>
-  <string name="common_choose_account">Causís lo compte</string>
+  <string name="uploader_upload_in_progress_ticker">Mandadís…</string>
+  <string name="uploader_upload_in_progress_content">Mandadís del fichièr %2$s : %1$d%% efectuats</string>
+  <string name="uploader_upload_succeeded_ticker">Mandadís capitat</string>
+  <string name="uploader_upload_succeeded_content_single">Lo fichièr %1$s es estat mandat amb succès</string>
+  <string name="uploader_upload_failed_ticker">Fracàs del mandadís</string>
+  <string name="uploader_upload_failed_content_single">Lo mandadís de %1$s a fracassat</string>
+  <string name="uploader_upload_failed_credentials_error">Lo mandadís a fracassat, vos cal vos connectar tornamai</string>
+  <string name="downloader_download_in_progress_ticker">Telecargament en cors…</string>
+  <string name="downloader_download_in_progress_content">Telecargament en cors de %2$s, %1$d%% efectuats</string>
+  <string name="downloader_download_succeeded_ticker">Telecargament capitat</string>
+  <string name="downloader_download_succeeded_content">%1$s es estat telecargat amb succès</string>
+  <string name="downloader_download_failed_ticker">Lo telecargament a fracassat</string>
+  <string name="downloader_download_failed_content">Lo telecargament de %1$s a fracassat</string>
+  <string name="downloader_not_downloaded_yet">Pas encara telecargat</string>
+  <string name="downloader_download_failed_credentials_error">Lo telecargament a fracassat, vos cal vos connectar tornamai</string>
+  <string name="common_choose_account">Causissètz un compte</string>
+  <string name="sync_fail_ticker">La sincronizacion a fracassat</string>
+  <string name="sync_fail_ticker_unauthorized">Fracàs de la sincronizacion, vos cal vos reconnectar</string>
+  <string name="sync_fail_content">La sincronizacion de %1$s a pas pogut èsser acabada</string>
+  <string name="sync_fail_content_unauthorized">Senhal invalid per %1$s</string>
+  <string name="sync_conflicts_in_favourites_ticker">De conflictes son estats trobats</string>
+  <string name="sync_conflicts_in_favourites_content">%1$d fichièrs de gardar sincronizats an pas pogut èsser sincronizats</string>
+  <string name="sync_fail_in_favourites_ticker">La sincronizacion dels fichièrs a fracassat</string>
+  <string name="sync_fail_in_favourites_content">Lo contengut de %1$d fichièrs a pas pogut èsser sincronizat (%2$d conflictes)</string>
+  <string name="sync_foreign_files_forgotten_ticker">Certans fichièrs locals son estats doblidats</string>
+  <string name="sync_foreign_files_forgotten_content">%1$d fichièrs del dorsièr %2$s an pas pogut èsser copiats dins</string>
+  <string name="sync_foreign_files_forgotten_explanation">Dempuèi la version 1.3.16, los fichièrs mandats dempuèi aqueste aparelh son copiats dins lo dorsièr local %1$s per evitar una pèrda de donadas quand un meteis fichièr es sincronizat amb mantun compte.
+
+En rason d\'aquesta modificacion, totes los fichièrs mandats amb de versions anterioras d\'aquesta aplicacion son estats copiats dins lo dorsièr %2$s. Pasmens, una error a empachat l\'acabament d\'aquesta operacion pendent la sincronizacion del compte. Podètz siá daissar los fichièrs tals coma son e suprimir lo ligam cap a %3$s, siá desplaçar los fichièrs dins lo dorsièr %1$s e gardar lo ligam cap a %4$s.
+
+Çaijós la lista dels fichièrs locals, e los fichièrs distants dins %5$s als quals èran ligats.</string>
+  <string name="sync_current_folder_was_removed">Lo dorsièr %1$s existís pas mai</string>
+  <string name="foreign_files_move">Desplaçar tot</string>
+  <string name="foreign_files_success">Totes los fichièrs son estats desplaçats</string>
+  <string name="foreign_files_fail">Certans fichièrs an pas pogut èsser desplaçats</string>
+  <string name="foreign_files_local_text">Local : %1$s</string>
+  <string name="foreign_files_remote_text">Distant : %1$s</string>
+  <string name="upload_query_move_foreign_files">I a pas pro de plaça disponibla per copiar los fichièrs seleccionats dins lo dorsièr %1$s. Volètz los desplaçar a la plaça ?</string>
+  <string name="pass_code_enter_pass_code">Sasissètz vòstre còde de seguretat</string>
+  <string name="pass_code_configure_your_pass_code">Sasissètz vòstre còde de seguretat</string>
+  <string name="pass_code_configure_your_pass_code_explanation">Lo còde de seguretat serà demandat a cada dobertura de l\'aplicacion</string>
+  <string name="pass_code_reenter_your_pass_code">Sasissètz tornamai vòstre còde de seguretat</string>
+  <string name="pass_code_remove_your_pass_code">Suprimir vòstre còde de seguretat</string>
+  <string name="pass_code_mismatch">Los còdes de seguretat son pas identics</string>
+  <string name="pass_code_wrong">Còde de seguretat incorrècte</string>
+  <string name="pass_code_removed">Còde de seguretat suprimit</string>
+  <string name="pass_code_stored">Còde de seguretat enregistrat</string>
+  <string name="media_notif_ticker">%1$s lector de musica</string>
+  <string name="media_state_playing">%1$s (lectura)</string>
+  <string name="media_state_loading">%1$s (cargament)</string>
+  <string name="media_event_done">Lectura de %1$s acabada</string>
+  <string name="media_err_nothing_to_play">Fichièr mèdia introbable </string>
+  <string name="media_err_no_account">Cap de compte es pas estat trobat</string>
+  <string name="media_err_not_in_owncloud">Lo fichièr es pas dins un compte valid</string>
+  <string name="media_err_unsupported">Lo codec d\'aqueste mèdia es pas pres en carga </string>
+  <string name="media_err_io">Lo fichièr mèdia pòt pas èsser legit</string>
+  <string name="media_err_malformed">Lo fichièr mèdia es pas corrèctament encodat</string>
+  <string name="media_err_timeout">Relambi depassat per la lectura del tròç</string>
+  <string name="media_err_invalid_progressive_playback">Lo fichièr mèdia pòt pas èsser difusat</string>
+  <string name="media_err_unknown">Lo fichièr mèdia pòt pas èsser jogat amb lo lector estandard</string>
+  <string name="media_err_security_ex">Error de seguretat a la lectura de %1$s</string>
+  <string name="media_err_io_ex">Error de lectura de fichièr a la lectura de %1$s</string>
+  <string name="media_err_unexpected">Error imprevista a la lectura de %1$s </string>
+  <string name="media_rewind_description">Boton de rembobinatge</string>
+  <string name="media_play_pause_description">Boton de lectura o de pausa</string>
+  <string name="media_forward_description">Boton d\'avança rapida</string>
+  <string name="auth_getting_authorization">Demanda d\'autorizacion…</string>
+  <string name="auth_trying_to_login">Temptativa de connexion…</string>
+  <string name="auth_no_net_conn_title">Pas de connexion ret</string>
+  <string name="auth_nossl_plain_ok_title">Connexion securizada pas disponibla</string>
+  <string name="auth_connection_established">Connexion establida</string>
+  <string name="auth_testing_connection">Tèst de connexion</string>
+  <string name="auth_not_configured_title">Configuracion del servidor erronèa</string>
+  <string name="auth_account_not_new">Un compte pels meteisses utilizaire e servidor existís ja sus aqueste aparelh</string>
+  <string name="auth_account_not_the_same">L\'utilizaire entrat correspond pas a l\'utilizaire d\'aqueste compte</string>
+  <string name="auth_unknown_error_title">Una error desconeguda s\'es produsida.</string>
+  <string name="auth_unknown_host_title">Impossible de trobar l\'òste</string>
+  <string name="auth_incorrect_path_title">Cap d\'instància del servidor es pas estada trobada</string>
+  <string name="auth_timeout_title">Lo servidor a pres tròp de temps a respondre</string>
+  <string name="auth_incorrect_address_title">Adreça invalida</string>
+  <string name="auth_ssl_general_error_title">Fracàs de l\'inicializacion SSL</string>
+  <string name="auth_ssl_unverified_server_title">Impossible de verificar l\'identitat del servidor SSL</string>
+  <string name="auth_bad_oc_version_title">La version del servidor es pas reconeguda</string>
+  <string name="auth_wrong_connection_title">Impossible d\'establir la connexion</string>
+  <string name="auth_secure_connection">Connexion securizada establida</string>
+  <string name="auth_unauthorized">Nom d\'utilizaire o senhal incorrècte</string>
+  <string name="auth_oauth_error">Fracàs d\'autorizacion</string>
+  <string name="auth_oauth_error_access_denied">Accès refusat pel servidor d\'autorizacion</string>
+  <string name="auth_wtf_reenter_URL">Estat imprevist ; sasissètz tornamai l\'URL del servidor</string>
+  <string name="auth_expired_oauth_token_toast">Vòstra autorizacion a expirat. Mercé de vos autentificar tornamai</string>
+  <string name="auth_expired_basic_auth_toast">Sasissètz lo senhal corrent</string>
+  <string name="auth_expired_saml_sso_token_toast">Vòstra session a expirat. Mercé de vos reconnectar</string>
+  <string name="auth_connecting_auth_server">Connexion al servidor d\'autentificacion…</string>
+  <string name="auth_unsupported_auth_method">Lo servidor pren pas en carga pas aqueste metòde d\'autentificacion</string>
+  <string name="auth_unsupported_multiaccount">%1$s pren pas en carga los comptes multiples</string>
+  <string name="auth_fail_get_user_name">Vòstre servidor a tornat un identificant d\'utilizaire incorrècte. Prenètz contacte amb vòstre administrator
+</string>
+  <string name="auth_can_not_auth_against_server">Impossible de s\'autentificar sus aqueste servidor</string>
+  <string name="auth_account_does_not_exist">Lo compte existís pas encara sus aqueste periferic</string>
   <string name="favorite">Apondre als favorits</string>
-  <string name="common_rename">Torna nomenar</string>
+  <string name="unfavorite">Suprimir dels favorits</string>
+  <string name="common_rename">Renomenar</string>
   <string name="common_remove">Suprimir</string>
+  <string name="confirmation_remove_alert">Sètz segur que volètz suprimir %1$s ?</string>
+  <string name="confirmation_remove_folder_alert">Sètz segur que volètz suprimir %1$s e son contengut ?</string>
+  <string name="confirmation_remove_local">Local solament</string>
+  <string name="confirmation_remove_folder_local">Local solament</string>
+  <string name="confirmation_remove_remote">Dempuèi lo servidor</string>
+  <string name="confirmation_remove_remote_and_local">Distant &amp; local</string>
+  <string name="remove_success_msg">Supression efectuada amb succès</string>
+  <string name="remove_fail_msg">Supression impossibla</string>
+  <string name="rename_dialog_title">Entratz un nom novèl</string>
+  <string name="rename_local_fail_msg">La version locala pòt pas èsser renomenada, reensajatz amb un nom diferent</string>
+  <string name="rename_server_fail_msg">Cambiament de nom impossible</string>
+  <string name="sync_file_fail_msg">Lo fichièr distant a pas pogut èsser verificat</string>
+  <string name="sync_file_nothing_to_do_msg">Lo contengut del fichièr es ja sincronizat</string>
+  <string name="create_dir_fail_msg">Lo dorsièr a pas pogut èsser creat</string>
+  <string name="filename_forbidden_characters">Caractèrs interdiches : / \\ &lt; &gt; : \" | ? *</string>
+  <string name="filename_forbidden_charaters_from_server">Lo nom de fichièr conten al mens un caractèr invalid</string>
+  <string name="filename_empty">Lo nom del fichièr pòt pas èsser void</string>
+  <string name="wait_a_moment">Pacientatz</string>
+  <string name="filedisplay_unexpected_bad_get_content">Problèma imprevist. Ensajatz una autra aplicacion per la seleccion del fichièr</string>
+  <string name="filedisplay_no_file_selected">Cap de fichièr pas seleccionat</string>
+  <string name="activity_chooser_title">Mandar lo ligam cap a…</string>
+  <string name="wait_for_tmp_copy_from_private_storage">Còpia del fichièr dempuèi l\'emmagazinatge privat</string>
+  <string name="oauth_check_onoff">Connexion amb oAuth2</string>
+  <string name="oauth_login_connection">Connexion al servidor oAuth2…</string>
+  <string name="ssl_validator_header">L\'identitat del site pòt pas èsser verificada</string>
+  <string name="ssl_validator_reason_cert_not_trusted">- Lo certificat del servidor es pas segur</string>
+  <string name="ssl_validator_reason_cert_expired">- Lo certificat del servidor a expirat</string>
+  <string name="ssl_validator_reason_cert_not_yet_valid">- Lo certificat del servidor es pas encara valid</string>
+  <string name="ssl_validator_reason_hostname_not_verified">- L\'URL correspond pas al nom d\'òste del certificat</string>
+  <string name="ssl_validator_question">Vos volètz fisaz d\'aqueste certificat malgrat tot ?</string>
+  <string name="ssl_validator_not_saved">Impossible de salvar lo certificat</string>
+  <string name="ssl_validator_btn_details_see">Detalhs</string>
+  <string name="ssl_validator_btn_details_hide">Amagar</string>
+  <string name="ssl_validator_label_subject">Desliurat a :</string>
+  <string name="ssl_validator_label_issuer">Desliurat per :</string>
+  <string name="ssl_validator_label_CN">Nom d\'usatge :</string>
+  <string name="ssl_validator_label_O">Organizacion :</string>
+  <string name="ssl_validator_label_OU">Unitat organizacionala :</string>
   <string name="ssl_validator_label_C">País :</string>
+  <string name="ssl_validator_label_ST">Region :</string>
+  <string name="ssl_validator_label_L">Localizacion :</string>
+  <string name="ssl_validator_label_validity">Validitat :</string>
+  <string name="ssl_validator_label_validity_from">Del :</string>
+  <string name="ssl_validator_label_validity_to">Al :</string>
+  <string name="ssl_validator_label_signature">Signatura :</string>
+  <string name="ssl_validator_label_signature_algorithm">Algoritme :</string>
+  <string name="ssl_validator_null_cert">Impossible d\'afichar lo certificat.</string>
+  <string name="ssl_validator_no_info_about_error">- Pas cap d\'informacion sus l\'error</string>
+  <string name="placeholder_sentence">Aquò es un espaci reservat</string>
+  <string name="placeholder_filename">placeholder.txt</string>
+  <string name="placeholder_filetype">Imatge PNG</string>
+  <string name="placeholder_filesize">389 Ko</string>
+  <string name="placeholder_timestamp">18/05/2012 12:23</string>
+  <string name="placeholder_media_time">12:23:45</string>
+  <string name="instant_upload_on_wifi">Mandar los imatges via una connexion WiFi unicament</string>
+  <string name="instant_video_upload_on_wifi">Mandar las vidèos via una connexion WiFi unicament</string>
+  <string name="instant_upload_path">/InstantUpload</string>
+  <string name="conflict_title">Conflicte de fichièrs</string>
+  <string name="conflict_message">Quin(s) fichièr(s) volètz gardar ? Se seleccionatz los dos, una chifra serà aponduda al nom del fichièr local.</string>
+  <string name="conflict_keep_both">Gardar las doas versions</string>
+  <string name="conflict_use_local_version">version locala</string>
+  <string name="conflict_use_server_version">version servidor</string>
+  <string name="preview_image_description">Previsualizacion de l\'imatge</string>
+  <string name="preview_image_error_unknown_format">Aqueste imatge pòt pas èsser afichada</string>
+  <string name="error__upload__local_file_not_copied">%1$s a pas pogut èsser copiat dins lo dorsièr local %2$s</string>
+  <string name="prefs_instant_upload_path_title">Repertòri de mandadís</string>
+  <string name="share_link_no_support_share_api">O planhèm, lo partiment es pas disponible sus vòstre servidor. Contactatz vòstre administrator.</string>
+  <string name="share_link_file_no_exist">Impossible de partejar. Verificatz que lo fichièr es plan present</string>
+  <string name="share_link_file_error">Una error s\'es produsida al moment de la tentative de partiment d\'aqueste fichièr o repertòri</string>
+  <string name="unshare_link_file_no_exist">Impossible de suprimir lo partiment. Verificatz que lo fichièr es ben present</string>
+  <string name="unshare_link_file_error">Una error s\'es produsida al moment de la temptativa d’anullacion del partiment d\'aqueste fichièr o repertòri</string>
+  <string name="share_link_password_title">Sasissètz un senhal</string>
+  <string name="share_link_empty_password">Vos cal sasir un senhal</string>
   <string name="activity_chooser_send_file_title">Mandar</string>
+  <string name="copy_link">Copiar lo ligam</string>
   <string name="clipboard_text_copied">Copiat dins lo quichapapièrs</string>
+  <string name="error_cant_bind_to_operations_service">Error critica : impossible de realizar d\'operacions</string>
+  <string name="network_error_socket_exception">Una error s\'es produsida pendent la connexion al servidor.</string>
+  <string name="network_error_socket_timeout_exception">Una error s\'es produsida pendent l\'espèra del servidor. L\'operacion a pas pogut èsser efectuada</string>
+  <string name="network_error_connect_timeout_exception">Una error s\'es produsida pendent l\'espèra del servidor. L\'operacion a pas pogut èsser efectuada</string>
+  <string name="network_host_not_available">L\'operacion a pas pogut èsser acabada, lo servidor es pas disponible</string>
   <string name="empty"></string>
+  <string name="forbidden_permissions">Avètz pas la permission %s</string>
+  <string name="forbidden_permissions_rename">de renomenar aqueste fichièr</string>
+  <string name="forbidden_permissions_delete">d’escafar aqueste fichièr</string>
+  <string name="share_link_forbidden_permissions">per fin de partejar aqueste fichièr</string>
+  <string name="unshare_link_forbidden_permissions">per fin de partejar pas mai aqueste fichièr</string>
+  <string name="forbidden_permissions_create">de crear aqueste fichièr</string>
+  <string name="uploader_upload_forbidden_permissions">per fin d’importar dins aqueste repertòri</string>
+  <string name="downloader_download_file_not_found">Aqueste fichièr es pas mai disponible sul servidor</string>
   <string name="prefs_category_accounts">Comptes</string>
+  <string name="prefs_add_account">Apondre un compte</string>
+  <string name="auth_redirect_non_secure_connection_title">La connexion securizada es redirigida cap a una rota non-securizada.</string>
+  <string name="actionbar_logger">Jornals</string>
+  <string name="log_send_history_button">Mandar l\'istoric</string>
+  <string name="log_send_no_mail_app">Cap d\'aplicacion pas trobada pel mandadís de jornals. Installar una aplicacion de corrièl !</string>
+  <string name="log_send_mail_subject">Jornals de l\'aplicacion Android %1$s</string>
+  <string name="log_progress_dialog_text">Cargament de las donadas…</string>
   <string name="saml_authentication_required_text">Autentificacion requesida</string>
   <string name="saml_authentication_wrong_pass">Senhal incorrècte</string>
-  <string name="folder_picker_choose_button_text">Causís</string>
+  <string name="actionbar_move">Desplaçar</string>
+  <string name="file_list_empty_moving">I a pas res aicí. Podètz apondre un dorsièr !</string>
+  <string name="folder_picker_choose_button_text">Causir</string>
+  <string name="move_file_not_found">Impossible de desplaçar. Verificatz que lo fichièr existís</string>
+  <string name="move_file_invalid_into_descendent">Es pas possible de desplaçar un dorsièr cap a un de sos descendents</string>
+  <string name="move_file_invalid_overwrite">Lo fichièr existís ja dins lo dorsièr de destinacion</string>
+  <string name="move_file_error">Una error s\'es produsida al moment de la temptativa de desplaçament d\'aqueste fichièr o dorsièr</string>
+  <string name="forbidden_permissions_move">de desplaçar aqueste fichièr</string>
+  <string name="copy_file_not_found">Impossible de copiar. Verificatz que lo fichièr existís</string>
+  <string name="copy_file_invalid_into_descendent">Es pas possible de copiar un dorsièr cap a un de sos descendents</string>
+  <string name="copy_file_invalid_overwrite">Fichièr ja existent dins lo dorsièr de destinacion</string>
+  <string name="copy_file_error">Una error s\'es produsida al moment de la còpia d\'aqueste fichièr o dorsièr</string>
+  <string name="forbidden_permissions_copy">de copiar aqueste fichièr</string>
+  <string name="prefs_category_instant_uploading">Mandadís immediat</string>
+  <string name="prefs_category_security">Seguretat</string>
+  <string name="prefs_instant_video_upload_path_title">Repertòri de mandadís de las vidèos</string>
+  <string name="download_folder_failed_content">Lo telecargament del dorsièr %1$s a pas pogut èsser acabat</string>
+  <string name="shared_subject_header">a partejat</string>
+  <string name="with_you_subject_header">amb vos</string>
+  <string name="subject_token">%1$s a partejat \"%2$s\" amb vos</string>
+  <string name="saml_subject_token">\"%1$s\" es estat partejat amb vos</string>
+  <string name="auth_refresh_button">Actualizar la connexion</string>
   <string name="auth_host_address">Adreça del servidor</string>
+  <string name="common_error_out_memory">Memòria insufisenta</string>
   <string name="username">Nom d\'utilizaire</string>
+  <string name="file_list__footer__folder">1 dorsièr</string>
+  <string name="file_list__footer__folders">%1$d dorsièrs</string>
+  <string name="file_list__footer__file">1 fichièr</string>
+  <string name="file_list__footer__file_and_folder">1 fichièr, 1 dorsièr</string>
+  <string name="file_list__footer__file_and_folders">1 fichièr, %1$d dorsièrs</string>
+  <string name="file_list__footer__files">%1$d fichièrs</string>
+  <string name="file_list__footer__files_and_folder">%1$d fichièrs, 1 dorsièr</string>
+  <string name="file_list__footer__files_and_folders">%1$d fichièrs, %2$d dorsièrs</string>
 </resources>
index 869c16e..95168bd 100644 (file)
        <item>Biggest - Smallest</item>-->
   <!--TODO re-enable when "Accounts" is available in Navigation Drawer-->
   <!--<string name="drawer_item_accounts">Accounts</string>-->
+  <string name="drawer_item_all_files">Wszystkie pliki</string>
   <!--TODO re-enable when "On Device" is available
     <string name="drawer_item_on_device">On device</string>-->
+  <string name="drawer_item_settings">Ustawienia</string>
+  <string name="drawer_item_logs">Logi</string>
+  <string name="drawer_close">Zamknij</string>
   <string name="drawer_open">Otwórz</string>
   <string name="prefs_category_general">Ogólne</string>
   <string name="prefs_category_more">Więcej</string>
@@ -66,6 +70,7 @@
   <string name="uploader_info_uploading">Wysyłanie</string>
   <string name="file_list_seconds_ago">sekund temu</string>
   <string name="file_list_empty">Pusto. Wyślij coś!</string>
+  <string name="file_list_loading">Wczytywanie...</string>
   <string name="local_file_list_empty">Nie ma plików w tym folderze.</string>
   <string name="filedetails_select_file">Dotknij plik aby wyświetlić dodatkowe informacje</string>
   <string name="filedetails_size">Rozmiar:</string>
   <string name="confirmation_remove_folder_alert">Czy naprawdę chcesz usunąć %1$s i jego zawartość?</string>
   <string name="confirmation_remove_local">Tylko lokalnie</string>
   <string name="confirmation_remove_folder_local">Tylko lokalnie</string>
+  <string name="confirmation_remove_remote">Z serwera</string>
   <string name="remove_success_msg">Usunięto</string>
   <string name="remove_fail_msg">Nie można usunąć</string>
   <string name="rename_dialog_title">Wprowadź nową nazwę</string>
   <string name="instant_upload_on_wifi">Wysyłaj zdjęcia tylko przez WiFi</string>
   <string name="instant_video_upload_on_wifi">Aktualizuj filmy tylko przez WiFi</string>
   <string name="instant_upload_path">/InstantUpload</string>
+  <string name="conflict_title">Konflikt pliku</string>
   <string name="conflict_keep_both">Zatrzymaj oba</string>
+  <string name="conflict_use_local_version">lokalna wersja</string>
+  <string name="conflict_use_server_version">wersja zdalna</string>
   <string name="preview_image_description">Podgląd</string>
   <string name="preview_image_error_unknown_format">Ten obrazek nie może zostać wyświetlony</string>
   <string name="error__upload__local_file_not_copied">%1$s nie może zostać skopiowany do lokalnego folderu %2$s</string>
   <string name="move_file_invalid_overwrite">Plik istnieje już w folderze docelowym</string>
   <string name="move_file_error">Pojawił się błąd podczas próby przeniesienia tego pliku lub folderu</string>
   <string name="forbidden_permissions_move">aby przenieść ten plik</string>
+  <string name="copy_file_invalid_overwrite">Plik istnieje już w folderze docelowym</string>
   <string name="prefs_category_instant_uploading">Automatyczne wysyłanie</string>
   <string name="prefs_category_security">Bezpieczeństwo</string>
   <string name="prefs_instant_video_upload_path_title">Katalog wysyłania dla wideo</string>
   <string name="download_folder_failed_content">Pobieranie %1$s katalogu nie może zostać ukończone</string>
+  <string name="shared_subject_header">udostępniony</string>
+  <string name="with_you_subject_header">z tobą</string>
   <string name="auth_refresh_button">Odśwież połączenie</string>
   <string name="auth_host_address">Adres Serwera</string>
   <string name="common_error_out_memory">Brak wystarczającej pamięci</string>
+  <string name="username">Użytkownik</string>
+  <string name="file_list__footer__folder">1 folder</string>
+  <string name="file_list__footer__folders">%1$d folderów</string>
+  <string name="file_list__footer__file">1 plik</string>
+  <string name="file_list__footer__file_and_folder">1 plik , 1 folder</string>
 </resources>
index 013757c..8102092 100644 (file)
   <string name="share_link_password_title">Digite uma senha</string>
   <string name="share_link_empty_password">Você deve digitar uma senha</string>
   <string name="activity_chooser_send_file_title">Enviar</string>
-  <string name="copy_link">Copiar link</string>
+  <string name="copy_link">Copiar link</string>
   <string name="clipboard_text_copied">Copiado para área de transferência</string>
   <string name="error_cant_bind_to_operations_service">Erro crítico: não pode executar operações</string>
   <string name="network_error_socket_exception">Ocorreu um erro durante a conexão com o servidor.</string>
   <string name="downloader_download_file_not_found">Este arquivo não mais está disponível neste servidor</string>
   <string name="prefs_category_accounts">Contas</string>
   <string name="prefs_add_account">Adicionar uma conta</string>
-  <string name="auth_redirect_non_secure_connection_title">Conexão segura esta redirecionada para uma rota não segura.</string>
+  <string name="auth_redirect_non_secure_connection_title">A conexão segura está redirecionada através de uma rota insegura.</string>
   <string name="actionbar_logger">Logs</string>
   <string name="log_send_history_button">Enviar Histórico</string>
   <string name="log_send_no_mail_app">Não foi encontrado nenhum app para envio de logs. Instale o mail app!</string>
   <string name="move_file_invalid_overwrite">O arquivo já existe na pasta de destino</string>
   <string name="move_file_error">Ocorreu um erro ao tentar mover este arquivo ou pasta</string>
   <string name="forbidden_permissions_move">mover este arquivo</string>
+  <string name="copy_file_not_found">Não é possível copiar. Por favor verifique se o arquivo existe</string>
+  <string name="copy_file_invalid_into_descendent">Não é possível copiar uma pasta em uma descendente</string>
+  <string name="copy_file_invalid_overwrite">O arquivo já existe na pasta de destino</string>
+  <string name="copy_file_error">Ocorreu um erro ao tentar copiar este arquivo ou pasta</string>
+  <string name="forbidden_permissions_copy">para copiar este arquivo</string>
   <string name="prefs_category_instant_uploading">Envios Instantâneos</string>
   <string name="prefs_category_security">Segurança</string>
   <string name="prefs_instant_video_upload_path_title">Enviar o Caminho do Vídeo</string>
index 83c1f5d..628b53a 100644 (file)
   <string name="confirmation_remove_folder_alert">Deseja realmente remover %1$s e o seu conteúdo?</string>
   <string name="confirmation_remove_local">Apenas localmente</string>
   <string name="confirmation_remove_folder_local">Apenas localmente</string>
+  <string name="confirmation_remove_remote">Do servidor</string>
+  <string name="confirmation_remove_remote_and_local">Remoto &amp; local</string>
   <string name="remove_success_msg">Removido com sucesso</string>
   <string name="remove_fail_msg">Não foi possível remover</string>
   <string name="rename_dialog_title">Introduza um novo nome</string>
   <string name="conflict_title">Conflito de ficheiro</string>
   <string name="conflict_message">Quais os ficheiros que pretende manter? Se selecionar ambas as versões, o ficheiro local irá ter um número adicionado ao seu nome.</string>
   <string name="conflict_keep_both">Manter ambos</string>
+  <string name="conflict_use_local_version">versão local</string>
+  <string name="conflict_use_server_version">versão servidor</string>
   <string name="preview_image_description">Pré-Visualizar imagem</string>
   <string name="preview_image_error_unknown_format">Esta imagem não pode ser mostrada</string>
   <string name="error__upload__local_file_not_copied">Não foi possível copiar %1$s para a pasta local %2$s</string>
   <string name="downloader_download_file_not_found">O ficheiro não está mais disponível no servidor</string>
   <string name="prefs_category_accounts">Contas</string>
   <string name="prefs_add_account">Adicionar conta</string>
-  <string name="auth_redirect_non_secure_connection_title">Ligação segura é redireccionada para um caminho inseguro.</string>
+  <string name="auth_redirect_non_secure_connection_title">Uma ligação segura foi redireccionada por uma rota insegura.</string>
   <string name="actionbar_logger">Registos de Alterações</string>
   <string name="log_send_history_button">Enviar Histórico</string>
   <string name="log_send_no_mail_app">Não foi encontrado o aplicativo para envio de registos . Instale app e-mail!</string>
   <string name="move_file_invalid_overwrite">O ficheiro já existe na pasta de destino</string>
   <string name="move_file_error">Ocorreu um ocorreu quando tentava mover este ficheiro ou pasta</string>
   <string name="forbidden_permissions_move">para mover este ficheiro</string>
+  <string name="copy_file_not_found">Não é possível copiar. Por favor, verifique se o ficheiro existe</string>
+  <string name="copy_file_invalid_into_descendent">Não é possível copiar esta pasta para a descendente</string>
+  <string name="copy_file_invalid_overwrite">O ficheiro já existe na pasta de destino</string>
+  <string name="copy_file_error">Ocorreu um ocorreu quando tentava copiar este ficheiro ou pasta</string>
+  <string name="forbidden_permissions_copy">para copiar este ficheiro</string>
   <string name="prefs_category_instant_uploading">Envios Instantâneos</string>
   <string name="prefs_category_security">Segurança</string>
   <string name="prefs_instant_video_upload_path_title">Envio do Caminho do Vídeo</string>
diff --git a/res/values-rm/strings.xml b/res/values-rm/strings.xml
new file mode 100644 (file)
index 0000000..37e6152
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<resources>
+  <!--TODO re-enable when server-side folder size calculation is available   
+       <item>Biggest - Smallest</item>-->
+  <!--TODO re-enable when "Accounts" is available in Navigation Drawer-->
+  <!--<string name="drawer_item_accounts">Accounts</string>-->
+  <!--TODO re-enable when "On Device" is available
+    <string name="drawer_item_on_device">On device</string>-->
+  <string name="empty"></string>
+</resources>
index e026c33..e539924 100644 (file)
   <string name="auth_can_not_auth_against_server">Nu se poate autentifica cu acest server</string>
   <string name="auth_account_does_not_exist">Contul nu există încă în dispozitiv</string>
   <string name="favorite">Favorit</string>
+  <string name="unfavorite">Defavoritați</string>
   <string name="common_rename">Redenumește</string>
   <string name="common_remove">Elimină</string>
   <string name="confirmation_remove_alert">Doriti sigur sa stergeti %1$s?</string>
   <string name="confirmation_remove_folder_alert">Sigur vrei să elimini %1$s și conținutul său?</string>
   <string name="confirmation_remove_local">Doar local</string>
   <string name="confirmation_remove_folder_local">Doar local</string>
+  <string name="confirmation_remove_remote">De pe server</string>
+  <string name="confirmation_remove_remote_and_local">Ambele</string>
   <string name="remove_success_msg">Eliminat cu succes</string>
   <string name="remove_fail_msg">Eliminarea nu a reușit</string>
   <string name="rename_dialog_title">Introduceţi un nou nume</string>
   <string name="instant_upload_on_wifi">Încarcă poze doar prin WiFi</string>
   <string name="instant_video_upload_on_wifi">Încarcă videoclipuri doar via WiFi</string>
   <string name="instant_upload_path">/Încărcare instantă</string>
+  <string name="conflict_title">Conflict de fișiere</string>
+  <string name="conflict_message">Care fișiere doriți să păstrați? Dacă selectați „ambele”, fișierului local i se va adăuga un număr numelui său.</string>
   <string name="conflict_keep_both">Pastreaza amandoua</string>
+  <string name="conflict_use_local_version">versiunea locală</string>
+  <string name="conflict_use_server_version">versiunea de pe server</string>
   <string name="preview_image_description">Previzualizare imagine</string>
   <string name="preview_image_error_unknown_format">Aceasta imagine nu poate fi arătată</string>
   <string name="error__upload__local_file_not_copied">%1$s nu a putut fi copiat in dosarul local %2$s </string>
   <string name="unshare_link_file_error">A apărut o eroare în timp ce încerca să departajeze sau unshare acest fișier sau folder</string>
   <string name="share_link_password_title">Introduceţi parola</string>
   <string name="share_link_empty_password">Trebuie să introduci o parolă</string>
-  <string name="activity_chooser_send_file_title">Expediază</string>
+  <string name="activity_chooser_send_file_title">Trimite</string>
   <string name="copy_link">Link copiat</string>
   <string name="clipboard_text_copied">Copiat în clipboard</string>
   <string name="error_cant_bind_to_operations_service">Eroare critică: nu se pot executa operațiunile</string>
   <string name="downloader_download_file_not_found">Fișierul nu mai este disponibil pe server</string>
   <string name="prefs_category_accounts">Conturi</string>
   <string name="prefs_add_account">Adaugă cont</string>
-  <string name="auth_redirect_non_secure_connection_title">Conexiunea securizată este redirecționată către un traseu neasigurat.</string>
   <string name="actionbar_logger">Înregistrări</string>
   <string name="log_send_history_button">Trimite Istoria</string>
   <string name="log_send_no_mail_app">App-ul de trimitere a inregistrărilor nu a fost găsit. Instalează mail app-ul!</string>
   <string name="move_file_invalid_overwrite">Fișierul există deja în dosarul de destinație</string>
   <string name="move_file_error">O eroare apare la transferarea acestui fișier sau dosar</string>
   <string name="forbidden_permissions_move">pentru a muta acest fișier</string>
+  <string name="copy_file_invalid_overwrite">Fișierul există deja în dosarul de destinație</string>
   <string name="prefs_category_instant_uploading">Încărcări instante</string>
   <string name="prefs_category_security">Securitate</string>
   <string name="prefs_instant_video_upload_path_title">Calea de încărcare Video</string>
   <string name="shared_subject_header">partajat</string>
   <string name="with_you_subject_header">cu tine</string>
   <string name="subject_token">%1$s a partajat fișierul \"%2$s\" cu tine</string>
+  <string name="saml_subject_token">„%1$s” a fost partajat cu dumneavoastră</string>
   <string name="auth_refresh_button">Reîmprospătează conexiunea</string>
   <string name="auth_host_address">Adresa server-ului</string>
   <string name="common_error_out_memory">Memorie insuficientă </string>
index fdad0be..5e4e3e3 100644 (file)
   <string name="downloader_download_file_not_found">Этот файл больше недоступен на сервере</string>
   <string name="prefs_category_accounts">Учётные записи</string>
   <string name="prefs_add_account">Добавить учетную запись</string>
-  <string name="auth_redirect_non_secure_connection_title">Ð\97аÑ\89иÑ\89Ñ\91нное Ñ\81оединение Ð¿ÐµÑ\80енапÑ\80авлено Ð¿Ð¾ Ð½ÐµÐ±ÐµÐ·Ð¾Ð¿Ð°Ñ\81номÑ\83 Ð¼Ð°Ñ\80Ñ\88Ñ\80Ñ\83Ñ\82Ñ\83</string>
+  <string name="auth_redirect_non_secure_connection_title">Ð\91езопаÑ\81ное Ñ\81оединение Ð¿ÐµÑ\80енапÑ\80авлено Ñ\87еÑ\80ез Ð½ÐµÐ±ÐµÐ·Ð¾Ð¿Ð°Ñ\81нÑ\8bй Ð¼Ð°Ñ\80Ñ\88Ñ\80Ñ\83Ñ\82.</string>
   <string name="actionbar_logger">Журналы</string>
   <string name="log_send_history_button">История Отправлений</string>
   <string name="log_send_no_mail_app">Приложение для отправки журнала не найдено. Установите почтовое приложение!</string>
   <string name="move_file_invalid_overwrite">Файл уже существует в каталоге назначения</string>
   <string name="move_file_error">Произошла ошибка при попытке перемещения этого файла или каталога</string>
   <string name="forbidden_permissions_move">для перемещения этого файла</string>
+  <string name="copy_file_invalid_overwrite">Файл уже существует в каталоге назначения</string>
   <string name="prefs_category_instant_uploading">Мгновенные загрузки</string>
   <string name="prefs_category_security">Безопасность</string>
   <string name="prefs_instant_video_upload_path_title">Путь для загрузки Видео</string>
index 7cc28c2..66ac426 100644 (file)
@@ -32,6 +32,7 @@
   <string name="prefs_category_more">Viac</string>
   <string name="prefs_accounts">Účty</string>
   <string name="prefs_manage_accounts">Správa účtov</string>
+  <string name="prefs_passcode">Heslo</string>
   <string name="prefs_instant_upload">Okamžité nahratie obrázka</string>
   <string name="prefs_instant_upload_summary">Okamžite nahrať obrázok zaznamenaný fotoaparátom</string>
   <string name="prefs_instant_video_upload">Okamžité nahranie videa</string>
@@ -69,6 +70,7 @@
   <string name="uploader_info_uploading">Nahrávanie</string>
   <string name="file_list_seconds_ago">pred sekundami</string>
   <string name="file_list_empty">Žiadny súbor. Nahrajte niečo!</string>
+  <string name="file_list_loading">Načítavam...</string>
   <string name="local_file_list_empty">V tomto priečinku nie sú žiadne súbory.</string>
   <string name="filedetails_select_file">Viac informácií získate kliknutím na súbor.</string>
   <string name="filedetails_size">Veľkosť:</string>
@@ -78,6 +80,7 @@
   <string name="filedetails_download">Stiahnuť</string>
   <string name="filedetails_sync_file">Obnoviť súbor</string>
   <string name="filedetails_renamed_in_upload_msg">Súbor bol premenovaný na %1$s počas nahrávania</string>
+  <string name="list_layout">Rozvrhnutie zoznamu</string>
   <string name="action_share_file">Zdieľať linku</string>
   <string name="action_unshare_file">Zrušiť zdieľanie odkazu</string>
   <string name="common_yes">Áno</string>
   <string name="upload_query_move_foreign_files">Nie je dostatok miesta na skopírovanie vybraných súborov do priečinka %1$s. Želáte si ich namiesto toho presunúť?</string>
   <string name="pass_code_enter_pass_code">Prosím, vložte svoje heslo:</string>
   <string name="pass_code_configure_your_pass_code">Vložte svoje heslo</string>
+  <string name="pass_code_configure_your_pass_code_explanation">Heslo bude nutné zadať vždy po štarte aplikácie</string>
   <string name="pass_code_reenter_your_pass_code">Prosím, vložte znovu svoje heslo:</string>
   <string name="pass_code_remove_your_pass_code">Zmazať svoje heslo</string>
+  <string name="pass_code_mismatch">Heslá sa nezhodujú</string>
+  <string name="pass_code_wrong">Nesprávne heslo</string>
   <string name="pass_code_removed">Bezpečnostný kód odstránený</string>
   <string name="pass_code_stored">Bezpečnostný kód uložený</string>
   <string name="media_notif_ticker">Prehrávač hudby %1$s</string>
   <string name="confirmation_remove_folder_alert">Naozaj chcete odstrániť %1$s a jeho obsah?</string>
   <string name="confirmation_remove_local">Iba lokálne</string>
   <string name="confirmation_remove_folder_local">Iba lokálne</string>
+  <string name="confirmation_remove_remote">Zo servera</string>
+  <string name="confirmation_remove_remote_and_local">Vzdialene aj lokálne</string>
   <string name="remove_success_msg">Úspešne odstránené</string>
   <string name="remove_fail_msg">Odstránenie zlyhalo</string>
   <string name="rename_dialog_title">Zadajte nové meno</string>
   <string name="sync_file_nothing_to_do_msg">Obsah súboru je zosynchronizovaný</string>
   <string name="create_dir_fail_msg">Priečinok nie je možné vytvoriť</string>
   <string name="filename_forbidden_characters">Zakázané znaky: / \\ &lt; &gt; : \" | ? *</string>
+  <string name="filename_forbidden_charaters_from_server">Názov súboru obsahuje nevhodný znak</string>
   <string name="filename_empty">Názov súboru nemôže byť prázdny</string>
   <string name="wait_a_moment">Počkať chvíľu</string>
   <string name="filedisplay_unexpected_bad_get_content">Neočakávaný problém; skúste vybrať súbor inou aplikáciou</string>
   <string name="filedisplay_no_file_selected">Nebol vybraný súbor</string>
   <string name="activity_chooser_title">Odošli link do ...</string>
+  <string name="wait_for_tmp_copy_from_private_storage">Kopírovanie súboru z privátneho úložiska</string>
   <string name="oauth_check_onoff">Prihlásiť sa z oAuth2</string>
   <string name="oauth_login_connection">Pripájam sa na oAuth2 server…</string>
   <string name="ssl_validator_header">Identitu stránky nemožno overiť</string>
   <string name="instant_upload_on_wifi">Odoslať fotografie iba cez WiFi</string>
   <string name="instant_video_upload_on_wifi">Nahrávať videá len cez WiFi</string>
   <string name="instant_upload_path">/InstantUpload</string>
+  <string name="conflict_title">Konflikt súborov</string>
+  <string name="conflict_message">Ktoré súbory si prajate ponachať? Pokiaľ to budú obe verzie, lokálnej pribudne k názvu číslo.</string>
   <string name="conflict_keep_both">Ponechať oba</string>
+  <string name="conflict_use_local_version">lokálnu verziu</string>
+  <string name="conflict_use_server_version">serverovú verziu</string>
   <string name="preview_image_description">Ukážka obrazu</string>
   <string name="preview_image_error_unknown_format">Obrázok nemožno zobraziť</string>
   <string name="error__upload__local_file_not_copied">%1$s nemožno skopírovať do lokálneho priečinka %2$s</string>
   <string name="downloader_download_file_not_found">Súbor už na serveri nie je dostupný</string>
   <string name="prefs_category_accounts">Účty</string>
   <string name="prefs_add_account">Pridať účet</string>
-  <string name="auth_redirect_non_secure_connection_title">Zabezpečené pripojenie je presmerované na nezabezpečenú trasu.</string>
+  <string name="auth_redirect_non_secure_connection_title">Zabezpečené spojenie je presmerované nezabezpečenou cestou.</string>
   <string name="actionbar_logger">Logy</string>
   <string name="log_send_history_button">Odoslať históriu</string>
   <string name="log_send_no_mail_app">Nebola nájdená aplikácia pre odosielanie log protokolov. Nainštalujte si mailovú aplikáciu!</string>
   <string name="move_file_invalid_overwrite">Súbor už v cieľovom priečinku existuje</string>
   <string name="move_file_error">Pri pokuse o presun tohoto súboru alebo priečinka nastala chyba</string>
   <string name="forbidden_permissions_move">pre presun tohoto súboru</string>
+  <string name="copy_file_not_found">Nemožno kopírovať. Overte či súbor ešte existuje</string>
+  <string name="copy_file_invalid_into_descendent">Nemožno kopírovať priečinok do jeho podpriečinka</string>
+  <string name="copy_file_invalid_overwrite">Súbor už v cieľovom priečinku existuje</string>
+  <string name="copy_file_error">Počas kopírovania súboru alebo zložky sa vyskytla chyba</string>
+  <string name="forbidden_permissions_copy">kopírovať súbor</string>
   <string name="prefs_category_instant_uploading">Okamžité nahratie</string>
   <string name="prefs_category_security">Zabezpečenie</string>
   <string name="prefs_instant_video_upload_path_title">Cesta pre nahrávanie videí</string>
   <string name="shared_subject_header">zdieľané</string>
   <string name="with_you_subject_header">s vami</string>
   <string name="subject_token">%1$s vám zdieľal \"%2$s\"</string>
+  <string name="saml_subject_token">\"%1$s\" bol s vami nazdieľaný</string>
   <string name="auth_refresh_button">Obnoviť pripojenie</string>
   <string name="auth_host_address">Adresa servera</string>
   <string name="common_error_out_memory">Nedostatok pamäte</string>
   <string name="username">Používateľské meno</string>
+  <string name="file_list__footer__folder">1 priečinok</string>
+  <string name="file_list__footer__folders">%1$d prieč.</string>
+  <string name="file_list__footer__file">1 súbor</string>
+  <string name="file_list__footer__file_and_folder">1 súbor, 1 priečinok</string>
+  <string name="file_list__footer__file_and_folders">1 súbor, %1$d prieč.</string>
+  <string name="file_list__footer__files">%1$d súb.</string>
+  <string name="file_list__footer__files_and_folder">%1$d súb., 1 priečinok</string>
+  <string name="file_list__footer__files_and_folders">%1$d súb., %2$d prieč.</string>
 </resources>
index b601b68..e58ba5b 100644 (file)
   <string name="confirmation_remove_folder_alert">Ali res želite odstraniti %1$s skupaj s celotno vsebino?</string>
   <string name="confirmation_remove_local">Le krajevno</string>
   <string name="confirmation_remove_folder_local">Le krajevno</string>
+  <string name="confirmation_remove_remote">S strežnika</string>
+  <string name="confirmation_remove_remote_and_local">Oddaljeno &amp; krajevno</string>
   <string name="remove_success_msg">Odstranitev je uspešno končana</string>
   <string name="remove_fail_msg">Odstranjevanje je spodletelo</string>
   <string name="rename_dialog_title">Vnesite novo ime</string>
   <string name="instant_upload_on_wifi">Pošiljaj slike le preko povezav Wi-Fi</string>
   <string name="instant_video_upload_on_wifi">Pošlji posnetke le preko povezave Wi-Fi</string>
   <string name="instant_upload_path">/Poslano</string>
+  <string name="conflict_title">Neskladje datotek</string>
+  <string name="conflict_message">Katere datoteke želite ohraniti? Če izberete obe različici, bo krajevni datoteki dodatna k imenu še številka.</string>
   <string name="conflict_keep_both">Ohrani obe</string>
+  <string name="conflict_use_local_version">krajevna različica</string>
+  <string name="conflict_use_server_version">različica strežnika</string>
   <string name="preview_image_description">Predogled slike</string>
   <string name="preview_image_error_unknown_format">Te slike ni mogoče prikazati</string>
   <string name="error__upload__local_file_not_copied">Datoteke %1$s ni mogoče kopirati v krajevno mapo %2$s</string>
   <string name="move_file_invalid_overwrite">Datoteka v ciljni mapi že obstaja.</string>
   <string name="move_file_error">Prišlo je do napake med premikanjem datoteke v mapo</string>
   <string name="forbidden_permissions_move">med premikanjem datoteke</string>
+  <string name="copy_file_invalid_overwrite">Datoteka v ciljni mapi že obstaja.</string>
   <string name="prefs_category_instant_uploading">Takojšnje pošiljanje v oblak</string>
   <string name="prefs_category_security">Varnost</string>
   <string name="prefs_instant_video_upload_path_title">Pot videa za pošiljanje</string>
   <string name="shared_subject_header">v souporabi</string>
   <string name="with_you_subject_header">z vami</string>
   <string name="subject_token">Uporabnik %1$s je omogočil souporabo \"%2$s\" z vami</string>
+  <string name="saml_subject_token">\"%1$s\" je oddan v souporabo z vami</string>
   <string name="auth_refresh_button">Osveži povezavo</string>
   <string name="auth_host_address">Naslov strežnika</string>
   <string name="common_error_out_memory">Ni dovolj pomnilnika</string>
index 01dfce6..4ed5508 100644 (file)
   <string name="downloader_download_file_not_found">Фајл није више доступан на серверу</string>
   <string name="prefs_category_accounts">Налози</string>
   <string name="prefs_add_account">Додај налог</string>
-  <string name="auth_redirect_non_secure_connection_title">Безбедна веза је преусмерена на небезбедну руту</string>
   <string name="actionbar_logger">Записници</string>
   <string name="log_send_history_button">Историјат слања</string>
   <string name="log_send_no_mail_app">Нема начина за слање записника. Инсталирајте апликацију е-поште!</string>
   <string name="move_file_invalid_overwrite">Фајл већ постоји у одредишној фасцикли</string>
   <string name="move_file_error">Дошло је до грешке при премештању фајла или фасцикле</string>
   <string name="forbidden_permissions_move">да преместите овај фајл</string>
+  <string name="copy_file_invalid_overwrite">Фајл већ постоји у одредишној фасцикли</string>
   <string name="prefs_category_instant_uploading">Тренутна отпремања</string>
   <string name="prefs_category_security">Безбедност</string>
   <string name="prefs_instant_video_upload_path_title">Путања отпремања видеа</string>
index 98de6de..5a6cdba 100644 (file)
   <string name="downloader_download_file_not_found">Filen är inte längre tillgänglig på servern</string>
   <string name="prefs_category_accounts">Konton</string>
   <string name="prefs_add_account">Lägg till konto</string>
-  <string name="auth_redirect_non_secure_connection_title">Säker anslutning är omdirigerad till en osäker väg.</string>
   <string name="actionbar_logger">Loggar</string>
   <string name="log_send_history_button">Skickat historik</string>
   <string name="log_send_no_mail_app">Ingen app för att skicka loggar hittades. Installera mail appen!</string>
   <string name="move_file_invalid_overwrite">Filen existerar redan i destinationsmappen</string>
   <string name="move_file_error">Ett fel uppstod vid försök att flytta denna fil eller mapp</string>
   <string name="forbidden_permissions_move">att flytta den här filen</string>
+  <string name="copy_file_invalid_overwrite">Filen existerar redan i destinationsmappen</string>
   <string name="prefs_category_instant_uploading">Direktuppladning</string>
   <string name="prefs_category_security">Säkerhet</string>
   <string name="prefs_instant_video_upload_path_title">Uppladdnings-sökväg för video</string>
index c13c48e..92fa673 100644 (file)
   <string name="downloader_download_file_not_found">ไฟล์ไม่พร้อมใช้งานบนเซิร์ฟเวอร์</string>
   <string name="prefs_category_accounts">บัญชี</string>
   <string name="prefs_add_account">เพิ่มบัญชี</string>
-  <string name="auth_redirect_non_secure_connection_title">à¸\81ารà¹\80à¸\8aืà¹\88อมà¸\95à¹\88อà¸\97ีà¹\88à¸\9bลอà¸\94ภัยà¸\96ูà¸\81à¹\80à¸\9bลีà¹\88ยà¸\99à¹\80สà¹\89à¸\99à¸\97าà¸\87à¹\84à¸\9bยัà¸\87à¹\80สà¹\89à¸\99à¸\97าà¸\87ที่ไม่ปลอดภัย</string>
+  <string name="auth_redirect_non_secure_connection_title">à¹\80à¸\8aืà¹\88อมà¸\95à¹\88อà¸\97ีà¹\88à¸\9bลอà¸\94ภัยà¸\96ูà¸\81à¹\80à¸\9bลีà¹\88ยà¸\99à¹\80สà¹\89à¸\99à¸\97าà¸\87à¸\9cà¹\88าà¸\99à¹\80ราà¹\80à¸\95อรà¹\8cที่ไม่ปลอดภัย</string>
   <string name="actionbar_logger">บันทึก</string>
   <string name="log_send_history_button">ส่งประวัติ</string>
   <string name="log_send_no_mail_app">ไม่พบการส่งบันทึกของแอพฯ ติดตั้งแอพฯเมล!</string>
   <string name="move_file_invalid_overwrite">มีไฟล์อยู่แล้วในโฟลเดอร์ปลายทาง</string>
   <string name="move_file_error">เกิดข้อผิดพลาดขณะพยายามที่จะย้ายไฟล์หรือโฟลเดอร์นี้</string>
   <string name="forbidden_permissions_move">เพื่อย้ายไฟล์นี้</string>
+  <string name="copy_file_not_found">ไม่สามารถคัดลอก กรุณาตรวจสอบว่ามีไฟล์นั้นอยู่</string>
+  <string name="copy_file_invalid_into_descendent">มันเป็นไปไม่ได้ที่จะคัดลอกลงในโฟลเดอร์โฟลเดอร์ย่อย</string>
+  <string name="copy_file_invalid_overwrite">มีไฟล์อยู่แล้วในโฟลเดอร์ปลายทาง</string>
+  <string name="copy_file_error">เกิดข้อผิดพลาดขณะพยายามคัดลอกไฟล์หรือโฟลเดอร์นี้</string>
+  <string name="forbidden_permissions_copy">เพื่อคัดลอกไฟล์นี้</string>
   <string name="prefs_category_instant_uploading">อัพโหลดทันที</string>
   <string name="prefs_category_security">ความปลอดภัย</string>
   <string name="prefs_instant_video_upload_path_title">อัพโหลดเส้นทางวิดีโอ</string>
index a987961..d682fe6 100644 (file)
   <string name="confirmation_remove_folder_alert">Gerçekten %1$s ve içeriğini kaldırmak istediğinizden emin misiniz?</string>
   <string name="confirmation_remove_local">Sadece yerel</string>
   <string name="confirmation_remove_folder_local">Sadece yerel</string>
+  <string name="confirmation_remove_remote">Sunucudan</string>
+  <string name="confirmation_remove_remote_and_local">Uzak ve yerel</string>
   <string name="remove_success_msg">Kaldırma başarılı</string>
   <string name="remove_fail_msg">Kaldırma başarısız</string>
   <string name="rename_dialog_title">Yeni bir isim girin</string>
   <string name="instant_upload_on_wifi">Fotoğrafları sadece kablosuzda (WiFi) yükle</string>
   <string name="instant_video_upload_on_wifi">Videoları sadece kablosuzda (WiFi) yükle</string>
   <string name="instant_upload_path">/AnındaYükle</string>
+  <string name="conflict_title">Dosya çakışması</string>
+  <string name="conflict_message">Hangi dosyaları saklamak istiyorsunuz? Her ikisini de saklamayı seçerseniz yerel dosyanın adına bir sayı eklenecek.</string>
   <string name="conflict_keep_both">İkisini de koru</string>
+  <string name="conflict_use_local_version">yerel sürüm</string>
+  <string name="conflict_use_server_version">sunucu sürümü</string>
   <string name="preview_image_description">Resim önizleme</string>
   <string name="preview_image_error_unknown_format">Bu resim gösterilemiyor</string>
   <string name="error__upload__local_file_not_copied">%1$s, %2$s yerel klasörüne kopyalanamadı</string>
   <string name="downloader_download_file_not_found">Bu dosya artık sunucuda mevcut değil</string>
   <string name="prefs_category_accounts">Hesaplar</string>
   <string name="prefs_add_account">Hesap ekle</string>
-  <string name="auth_redirect_non_secure_connection_title">Güvenli bağlantı, güvenli olmayan bir rotaya yönlendirildi.</string>
+  <string name="auth_redirect_non_secure_connection_title">Güvenli bağlantı, güvenli olmayan bir rotaya yönlendiriliyor.</string>
   <string name="actionbar_logger">Günlükler</string>
   <string name="log_send_history_button">Geçmişi Gönder</string>
   <string name="log_send_no_mail_app">Kayıtları göndermek için uygulama bulunamadı. E-posta uygulamasını yükleyin!</string>
   <string name="move_file_invalid_overwrite">Dosya zaten hedef klasörde mevcut</string>
   <string name="move_file_error">Bu dosya veya klasörü taşımaya çalışılırken bir hata oluştu</string>
   <string name="forbidden_permissions_move">bu dosyayı taşımak için</string>
+  <string name="copy_file_invalid_overwrite">Dosya zaten hedef klasörde mevcut</string>
   <string name="prefs_category_instant_uploading">Anında Yüklemeler</string>
   <string name="prefs_category_security">Güvenlik</string>
   <string name="prefs_instant_video_upload_path_title">Video Yükleme Yolu</string>
   <string name="shared_subject_header">sizinle</string>
   <string name="with_you_subject_header">paylaştı</string>
   <string name="subject_token">%1$s, sizinle \"%2$s\" paylaşımını yaptı</string>
+  <string name="saml_subject_token">\"%1$s\" sizinle paylaşıldı</string>
   <string name="auth_refresh_button">Bağlantıyı yenile</string>
   <string name="auth_host_address">Sunucu adresi</string>
   <string name="common_error_out_memory">Yeterli hafıza yok</string>
index d036312..c3bd6a0 100644 (file)
   <string name="move_file_invalid_overwrite">Файл вже існує в теці призначення</string>
   <string name="move_file_error">Виникла помилка при спробі перемістити файл або теку</string>
   <string name="forbidden_permissions_move">перемістити цей файл</string>
+  <string name="copy_file_invalid_overwrite">Файл вже існує в теці призначення</string>
   <string name="prefs_category_instant_uploading">Миттєво завантаження</string>
   <string name="prefs_category_security">Безпека</string>
   <string name="prefs_instant_video_upload_path_title">Шлях завантаження відео</string>
index fc58f95..ca8e51a 100644 (file)
   <string name="confirmation_remove_folder_alert">您确定要删除 %1$s 及其内容吗?</string>
   <string name="confirmation_remove_local">仅本地</string>
   <string name="confirmation_remove_folder_local">仅本地</string>
+  <string name="confirmation_remove_remote">来自服务器</string>
+  <string name="confirmation_remove_remote_and_local">远程 &amp; 本地</string>
   <string name="remove_success_msg">成功删除</string>
   <string name="remove_fail_msg">无法完成删除</string>
   <string name="rename_dialog_title">请输出新的名字</string>
   <string name="conflict_title">文件冲突</string>
   <string name="conflict_message">您想要保留哪个文件?如果您同时选中了两个版本,本地的文件的文件名将被加上一个数字</string>
   <string name="conflict_keep_both">保留两者</string>
+  <string name="conflict_use_local_version">本地版本</string>
+  <string name="conflict_use_server_version">服务器版本</string>
   <string name="preview_image_description">图片预览</string>
   <string name="preview_image_error_unknown_format">无法显示图片</string>
   <string name="error__upload__local_file_not_copied">无法复制 %1$s 到本地目录 %2$s</string>
   <string name="downloader_download_file_not_found">该文件在服务器上不可用</string>
   <string name="prefs_category_accounts">账号</string>
   <string name="prefs_add_account">添加账号</string>
-  <string name="auth_redirect_non_secure_connection_title">安全连接被重定向到非安全路径.</string>
+  <string name="auth_redirect_non_secure_connection_title">安全连接是通过一个非安全路由定向的。</string>
   <string name="actionbar_logger">日志</string>
   <string name="log_send_history_button">发送历史</string>
   <string name="log_send_no_mail_app">未找到可以发送日志的程序。请安装 mail!</string>
   <string name="move_file_invalid_overwrite">该文件已经存在在目标文件夹</string>
   <string name="move_file_error">尝试移动该文件或文件夹时发生错误</string>
   <string name="forbidden_permissions_move">移动该文件</string>
+  <string name="copy_file_invalid_overwrite">该文件已经存在在目标文件夹</string>
   <string name="prefs_category_instant_uploading">即时上传</string>
   <string name="prefs_category_security">安全</string>
   <string name="prefs_instant_video_upload_path_title">视频上传路径</string>
index 21b43f1..7810b88 100644 (file)
@@ -72,7 +72,7 @@
   <string name="placeholder_filesize">389 KB</string>
   <string name="placeholder_timestamp">2012/05/18 12:23 PM</string>
   <string name="placeholder_media_time">12:23:45</string>
-  <string name="activity_chooser_send_file_title">送</string>
+  <string name="activity_chooser_send_file_title">送</string>
   <string name="copy_link">複製連結</string>
   <string name="empty"></string>
   <string name="prefs_category_accounts">帳號</string>
index 69701a5..db564b1 100644 (file)
   <string name="downloader_download_file_not_found">這個檔案已經不存在於伺服器中</string>
   <string name="prefs_category_accounts">帳號</string>
   <string name="prefs_add_account">新增帳號</string>
-  <string name="auth_redirect_non_secure_connection_title">安全連線被轉向到一個非安全的連線</string>
   <string name="actionbar_logger">紀錄</string>
   <string name="log_send_history_button">傳送歷史記錄</string>
   <string name="log_send_no_mail_app">找不到可以傳送記錄的電子郵件程式. 請安裝電子郵件軟體!</string>
   <string name="move_file_invalid_overwrite">這個檔案已經存在於目的目錄中</string>
   <string name="move_file_error">在移動檔案或目錄時發生了錯誤</string>
   <string name="forbidden_permissions_move">移動這個檔案</string>
+  <string name="copy_file_invalid_overwrite">這個檔案已經存在於目的目錄中</string>
   <string name="prefs_category_instant_uploading">即時上傳</string>
   <string name="prefs_category_security">安全性</string>
   <string name="prefs_instant_video_upload_path_title">影片上傳路徑</string>
index cc3587d..8f1aec2 100644 (file)
     <string name="sync_fail_ticker_unauthorized">Synchronization failed, you need to relogin</string>
     <string name="sync_fail_content">Synchronization of %1$s could not be completed</string>
     <string name="sync_fail_content_unauthorized">Invalid password for %1$s</string>
-       <string name="sync_conflicts_in_favourites_ticker">Conflicts found</string>
-       <string name="sync_conflicts_in_favourites_content">%1$d kept-in-sync files could not be sync\'ed</string>
+    <string name="sync_conflicts_in_favourites_ticker">Conflicts found</string>
+    <string name="sync_conflicts_in_favourites_content">%1$d kept-in-sync files could not be sync\'ed</string>
     <string name="sync_fail_in_favourites_ticker">Kept-in-sync files failed</string>
     <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 %2$s folder could not be copied into</string>
     <string name="sync_foreign_files_forgotten_explanation">As of version 1.3.16, files uploaded from this device are copied into the local %1$s folder to prevent data loss when a single file is synced with multiple accounts.\n\nDue to this change, all files uploaded in previous versions of this app were copied into the %2$s folder. However, an error prevented the completion of this operation during account synchronization. You may either leave the file(s) as is and remove the link to %3$s, or move the file(s) into the %1$s folder and retain the link to %4$s.\n\nListed below are the local file(s), and the remote file(s) in %5$s they were linked to.</string>
-       <string name="sync_current_folder_was_removed">Folder %1$s does not exist anymore</string>    
+    <string name="sync_current_folder_was_removed">Folder %1$s does not exist anymore</string>
     <string name="foreign_files_move">"Move all"</string>
     <string name="foreign_files_success">"All files were moved"</string>
     <string name="foreign_files_fail">"Some files could not be moved"</string>
     <string name="media_state_loading">"%1$s (loading)"</string>
     <string name="media_event_done">"%1$s playback finished"</string>
     <string name="media_err_nothing_to_play">No media file found</string>
-       <string name="media_err_no_account">No account provided</string>
-       <string name="media_err_not_in_owncloud">File not in a valid account</string>
-       <string name="media_err_unsupported">Unsupported media codec</string>
-       <string name="media_err_io">Media file could not be read</string>
-       <string name="media_err_malformed">Media file not correctly encoded</string>
-       <string name="media_err_timeout">Timed out while trying to play</string>
-       <string name="media_err_invalid_progressive_playback">Media file cannot be streamed</string>
-       <string name="media_err_unknown">Media file cannot be played with the stock media player</string>
-       <string name="media_err_security_ex">Security error trying to play %1$s</string>
-       <string name="media_err_io_ex">Input error trying to play %1$s</string>
-       <string name="media_err_unexpected">Unexpected error trying to play %1$s</string>
-       <string name="media_rewind_description">Rewind button</string>
-       <string name="media_play_pause_description">Play or pause button</string>
-       <string name="media_forward_description">Fast forward button</string>
+    <string name="media_err_no_account">No account provided</string>
+    <string name="media_err_not_in_owncloud">File not in a valid account</string>
+    <string name="media_err_unsupported">Unsupported media codec</string>
+    <string name="media_err_io">Media file could not be read</string>
+    <string name="media_err_malformed">Media file not correctly encoded</string>
+    <string name="media_err_timeout">Timed out while trying to play</string>
+    <string name="media_err_invalid_progressive_playback">Media file cannot be streamed</string>
+    <string name="media_err_unknown">Media file cannot be played with the stock media player</string>
+    <string name="media_err_security_ex">Security error trying to play %1$s</string>
+    <string name="media_err_io_ex">Input error trying to play %1$s</string>
+    <string name="media_err_unexpected">Unexpected error trying to play %1$s</string>
+    <string name="media_rewind_description">Rewind button</string>
+    <string name="media_play_pause_description">Play or pause button</string>
+    <string name="media_forward_description">Fast forward button</string>
 
        <string name="auth_getting_authorization">Getting authorization&#8230;</string>
        <string name="auth_trying_to_login">Trying to login&#8230;</string>
     <string name="ssl_validator_label_L">Location:</string>
     <string name="ssl_validator_label_validity">Validity:</string>
     <string name="ssl_validator_label_validity_from">From:</string>
-       <string name="ssl_validator_label_validity_to">To:</string>
-       <string name="ssl_validator_label_signature">Signature:</string>
-       <string name="ssl_validator_label_signature_algorithm">Algorithm:</string>
-       <string name="ssl_validator_null_cert">The certificate could not be shown.</string>
-       <string name="ssl_validator_no_info_about_error">- No information about the error</string>
-                       
+    <string name="ssl_validator_label_validity_to">To:</string>
+    <string name="ssl_validator_label_signature">Signature:</string>
+    <string name="ssl_validator_label_signature_algorithm">Algorithm:</string>
+    <string name="ssl_validator_null_cert">The certificate could not be shown.</string>
+    <string name="ssl_validator_no_info_about_error">- No information about the error</string>
+
     <string name="placeholder_sentence">This is a placeholder</string>
     <string name="placeholder_filename">placeholder.txt</string>
     <string name="placeholder_filetype">PNG Image</string>
     <string name="placeholder_filesize">389 KB</string>
     <string name="placeholder_timestamp">2012/05/18 12:23 PM</string>
     <string name="placeholder_media_time">12:23:45</string>
-    
+
     <string name="instant_upload_on_wifi">Upload pictures via WiFi only</string>
     <string name="instant_video_upload_on_wifi">Upload videos via WiFi only</string>
     <string name="instant_upload_path">/InstantUpload</string>
     
     <string name="preview_image_description">Image preview</string>
     <string name="preview_image_error_unknown_format">This image cannot be shown</string>
-    
+
     <string name="error__upload__local_file_not_copied">%1$s could not be copied to %2$s local folder</string>
     <string name="prefs_instant_upload_path_title">Upload Path</string>
 
     <string name="share_link_password_title">Enter a password</string>
     <string name="share_link_empty_password">You must enter a password</string>
 
-       <string name="activity_chooser_send_file_title">Send</string>
+    <string name="activity_chooser_send_file_title">Send</string>
+
+    <string name="copy_link">Copy link</string>
+    <string name="clipboard_text_copied">Copied to clipboard</string>
 
-       <string name="copy_link">Copy link</string>
-       <string name="clipboard_text_copied">Copied to clipboard</string>
+    <string name="error_cant_bind_to_operations_service">Critical error: cannot perform operations</string>
 
-       <string name="error_cant_bind_to_operations_service">Critical error: cannot perform operations</string>
-       
-       <string name="network_error_socket_exception">An error occurred while connecting with the server.</string>
-       <string name="network_error_socket_timeout_exception">An error occurred while waiting for the server, the operation couldn\'t have been done</string>
-       <string name="network_error_connect_timeout_exception">An error occurred while waiting for the server, the operation couldn\'t have been done</string>
-       <string name="network_host_not_available">The operation couldn\'t be completed, server is unavailable</string>
+    <string name="network_error_socket_exception">An error occurred while connecting with the server.</string>
+    <string name="network_error_socket_timeout_exception">An error occurred while waiting for the server, the operation couldn\'t have been done</string>
+    <string name="network_error_connect_timeout_exception">An error occurred while waiting for the server, the operation couldn\'t have been done</string>
+    <string name="network_host_not_available">The operation couldn\'t be completed, server is unavailable</string>
+    <string name="empty" />
 
-       <string name="empty" />
-       
-       <string name="forbidden_permissions">You do not have permission %s</string>
-       <string name="forbidden_permissions_rename">to rename this file</string>
-       <string name="forbidden_permissions_delete">to delete this file</string>
-       <string name="share_link_forbidden_permissions">to share this file</string>
-       <string name="unshare_link_forbidden_permissions">to unshare this file</string>
-       <string name="forbidden_permissions_create">to create the file</string>
-       <string name="uploader_upload_forbidden_permissions">to upload in this folder</string>
-       <string name="downloader_download_file_not_found">The file is no longer available on the server</string>
+    <string name="forbidden_permissions">You do not have permission %s</string>
+    <string name="forbidden_permissions_rename">to rename this file</string>
+    <string name="forbidden_permissions_delete">to delete this file</string>
+    <string name="share_link_forbidden_permissions">to share this file</string>
+    <string name="unshare_link_forbidden_permissions">to unshare this file</string>
+    <string name="forbidden_permissions_create">to create the file</string>
+    <string name="uploader_upload_forbidden_permissions">to upload in this folder</string>
+    <string name="downloader_download_file_not_found">The file is no longer available on the server</string>
 
-       <string name="prefs_category_accounts">Accounts</string>
-       <string name="prefs_add_account">Add account</string>
-       <string name="auth_redirect_non_secure_connection_title">Secure connection is redirected to an unsecured route.</string>
+    <string name="prefs_category_accounts">Accounts</string>
+    <string name="prefs_add_account">Add account</string>
+    <string name="auth_redirect_non_secure_connection_title">Secure connection is redirected through an unsecured route.</string>
 
        <string name="actionbar_logger">Logs</string>
        <string name="log_send_history_button">Send History</string>
        <string name="file_list_empty_moving">Nothing in here. You can add a folder!</string>
        <string name="folder_picker_choose_button_text">Choose</string>
 
-       <string name="move_file_not_found">Unable to move. Please check whether the file exists</string>
-       <string name="move_file_invalid_into_descendent">It is not possible to move a folder into a descendant</string>
-       <string name="move_file_invalid_overwrite">The file exists already in the destination folder</string>
-       <string name="move_file_error">An error occurred while trying to move this file or folder</string>
-       <string name="forbidden_permissions_move">to move this file</string>
+    <string name="move_file_not_found">Unable to move. Please check whether the file exists</string>
+    <string name="move_file_invalid_into_descendent">It is not possible to move a folder into a descendant</string>
+    <string name="move_file_invalid_overwrite">The file exists already in the destination folder</string>
+    <string name="move_file_error">An error occurred while trying to move this file or folder</string>
+    <string name="forbidden_permissions_move">to move this file</string>
+
+
+    <string name="copy_file_not_found">Unable to copy. Please check whether the file exists</string>
+    <string name="copy_file_invalid_into_descendent">It is not possible to copy a folder into a descendant</string>
+    <string name="copy_file_invalid_overwrite">The file exists already in the destination folder</string>
+    <string name="copy_file_error">An error occurred while trying to copy this file or folder</string>
+    <string name="forbidden_permissions_copy">to copy this file</string>
 
-       <string name="prefs_category_instant_uploading">Instant Uploads</string>
+    <string name="prefs_category_instant_uploading">Instant Uploads</string>
        <string name="prefs_category_security">Security</string>
 
        <string name="prefs_instant_video_upload_path_title">Upload Video Path</string>
index 47985ce..02ab3c7 100644 (file)
@@ -1373,6 +1373,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
     public void onAuthenticatorTaskCallback(RemoteOperationResult result) {\r
         mWaitingForOpId = Long.MAX_VALUE;\r
         dismissDialog(WAIT_DIALOG_TAG);\r
+        mAsyncTask = null;\r
 \r
         if (result.isSuccess()) {\r
             Log_OC.d(TAG, "Successful access - time to save the account");\r
index c5fc94d..29a11c4 100644 (file)
@@ -50,6 +50,12 @@ import com.owncloud.android.lib.resources.shares.OCShare;
 import com.owncloud.android.lib.resources.shares.ShareType;
 import com.owncloud.android.utils.FileStorageUtils;
 
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
 public class FileDataStorageManager {
 
     public static final int ROOT_PARENT_ID = 0;
@@ -60,7 +66,7 @@ public class FileDataStorageManager {
 
     private static String TAG = FileDataStorageManager.class.getSimpleName();
 
-    
+
     public FileDataStorageManager(Account account, ContentResolver cr) {
         mContentProviderClient = null;
         mContentResolver = cr;
@@ -73,7 +79,7 @@ public class FileDataStorageManager {
         mAccount = account;
     }
 
-    
+
     public void setAccount(Account account) {
         mAccount = account;
     }
@@ -97,7 +103,7 @@ public class FileDataStorageManager {
     public ContentProviderClient getContentProviderClient() {
         return mContentProviderClient;
     }
-    
+
 
     public OCFile getFileByPath(String path) {
         Cursor c = getCursorForValue(ProviderTableMeta.FILE_PATH, path);
@@ -141,7 +147,7 @@ public class FileDataStorageManager {
         return fileExists(ProviderTableMeta.FILE_PATH, path);
     }
 
-    
+
     public Vector<OCFile> getFolderContent(OCFile f/*, boolean onlyOnDevice*/) {
         if (f != null && f.isFolder() && f.getFileId() != -1) {
             // TODO Enable when "On Device" is recovered ?
@@ -151,8 +157,8 @@ public class FileDataStorageManager {
             return new Vector<OCFile>();
         }
     }
-    
-    
+
+
     public Vector<OCFile> getFolderImages(OCFile folder/*, boolean onlyOnDevice*/) {
         Vector<OCFile> ret = new Vector<OCFile>(); 
         if (folder != null) {
@@ -183,7 +189,7 @@ public class FileDataStorageManager {
         cv.put(ProviderTableMeta.FILE_CONTENT_TYPE, file.getMimetype());
         cv.put(ProviderTableMeta.FILE_NAME, file.getFileName());
         //if (file.getParentId() != DataStorageManager.ROOT_PARENT_ID)
-            cv.put(ProviderTableMeta.FILE_PARENT, file.getParentId());
+        cv.put(ProviderTableMeta.FILE_PARENT, file.getParentId());
         cv.put(ProviderTableMeta.FILE_PATH, file.getRemotePath());
         if (!file.isFolder())
             cv.put(ProviderTableMeta.FILE_STORAGE_PATH, file.getStoragePath());
@@ -200,8 +206,7 @@ public class FileDataStorageManager {
         cv.put(ProviderTableMeta.FILE_IS_DOWNLOADING, file.isDownloading());
         
         boolean sameRemotePath = fileExists(file.getRemotePath());
-        if (sameRemotePath ||
-                fileExists(file.getFileId())        ) {  // for renamed files
+        if (sameRemotePath ||                fileExists(file.getFileId())) {           // for renamed files; no more delete and create
 
             OCFile oldFile = null;
             if (sameRemotePath) {
@@ -215,12 +220,12 @@ public class FileDataStorageManager {
             if (getContentResolver() != null) {
                 getContentResolver().update(ProviderTableMeta.CONTENT_URI, cv,
                         ProviderTableMeta._ID + "=?",
-                        new String[] { String.valueOf(file.getFileId()) });
+                        new String[]{String.valueOf(file.getFileId())});
             } else {
                 try {
                     getContentProviderClient().update(ProviderTableMeta.CONTENT_URI,
                             cv, ProviderTableMeta._ID + "=?",
-                            new String[] { String.valueOf(file.getFileId()) });
+                            new String[]{String.valueOf(file.getFileId())});
                 } catch (RemoteException e) {
                     Log_OC.e(TAG,
                             "Fail to insert insert file to database "
@@ -246,7 +251,7 @@ public class FileDataStorageManager {
                 long new_id = Long.parseLong(result_uri.getPathSegments()
                         .get(1));
                 file.setFileId(new_id);
-            }            
+            }
         }
 
 //        if (file.isFolder()) {
@@ -254,17 +259,17 @@ public class FileDataStorageManager {
 //        } else {
 //            updateFolderSize(file.getParentId());
 //        }
-        
+
         return overriden;
     }
 
 
     /**
      * Inserts or updates the list of files contained in a given folder.
-     * 
+     * <p/>
      * CALLER IS THE RESPONSIBLE FOR GRANTING RIGHT UPDATE OF INFORMATION, NOT THIS METHOD.
      * HERE ONLY DATA CONSISTENCY SHOULD BE GRANTED
-     *  
+     *
      * @param folder
      * @param updatedFiles
      * @param filesToRemove
@@ -314,9 +319,9 @@ public class FileDataStorageManager {
                 // updating an existing file
                 operations.add(ContentProviderOperation.newUpdate(ProviderTableMeta.CONTENT_URI).
                         withValues(cv).
-                        withSelection(  ProviderTableMeta._ID + "=?", 
-                                new String[] { String.valueOf(file.getFileId()) })
-                                .build());
+                        withSelection(ProviderTableMeta._ID + "=?",
+                                new String[]{String.valueOf(file.getFileId())})
+                        .build());
 
             } else {
                 // adding a new file
@@ -324,9 +329,9 @@ public class FileDataStorageManager {
                         withValues(cv).build());
             }
         }
-        
+
         // prepare operations to remove files in the given folder
-        String where = ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?" + " AND " + 
+        String where = ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?" + " AND " +
                 ProviderTableMeta.FILE_PATH + "=?";
         String [] whereArgs = null;
         for (OCFile file : filesToRemove) {
@@ -351,7 +356,7 @@ public class FileDataStorageManager {
                                     ProviderTableMeta.CONTENT_URI_FILE, file.getFileId()
                             )
                     ).withSelection(where, whereArgs).build());
-                    
+
                     if (file.isDown()) {
                         String path = file.getStoragePath();
                         new File(path).delete();
@@ -360,7 +365,7 @@ public class FileDataStorageManager {
                 }
             }
         }
-        
+
         // update metadata of folder
         ContentValues cv = new ContentValues();
         cv.put(ProviderTableMeta.FILE_MODIFIED, folder.getModificationTimestamp());
@@ -383,12 +388,12 @@ public class FileDataStorageManager {
         cv.put(ProviderTableMeta.FILE_PUBLIC_LINK, folder.getPublicLink());
         cv.put(ProviderTableMeta.FILE_PERMISSIONS, folder.getPermissions());
         cv.put(ProviderTableMeta.FILE_REMOTE_ID, folder.getRemoteId());
-        
+
         operations.add(ContentProviderOperation.newUpdate(ProviderTableMeta.CONTENT_URI).
                 withValues(cv).
-                withSelection(  ProviderTableMeta._ID + "=?", 
-                        new String[] { String.valueOf(folder.getFileId()) })
-                        .build());
+                withSelection(ProviderTableMeta._ID + "=?",
+                        new String[]{String.valueOf(folder.getFileId())})
+                .build());
 
         // apply operations in batch
         ContentProviderResult[] results = null;
@@ -413,7 +418,7 @@ public class FileDataStorageManager {
             long newId;
             Iterator<OCFile> filesIt = updatedFiles.iterator();
             OCFile file = null;
-            for (int i=0; i<results.length; i++) {
+            for (int i = 0; i < results.length; i++) {
                 if (filesIt.hasNext()) {
                     file = filesIt.next();
                 } else {
@@ -428,9 +433,9 @@ public class FileDataStorageManager {
                 }
             }
         }
-        
+
         //updateFolderSize(folder.getFileId());
-        
+
     }
 
 
@@ -464,23 +469,20 @@ public class FileDataStorageManager {
 //            Log_OC.e(TAG,  "not updating size for folder " + id);
 //        }
 //    }
-    
+
 
     public boolean removeFile(OCFile file, boolean removeDBData, boolean removeLocalCopy) {
         boolean success = true;
         if (file != null) {
             if (file.isFolder()) {
                 success = removeFolder(file, removeDBData, removeLocalCopy);
-                
+
             } else {
                 if (removeDBData) {
-                    Uri file_uri = ContentUris.withAppendedId(
-                        ProviderTableMeta.CONTENT_URI_FILE, 
-                        file.getFileId()
-                    );
-                    String where = ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?" + " AND " + 
-                            ProviderTableMeta.FILE_PATH + "=?";
-                    String [] whereArgs = new String[]{mAccount.name, file.getRemotePath()};
+                    //Uri file_uri = Uri.withAppendedPath(ProviderTableMeta.CONTENT_URI_FILE, ""+file.getFileId());
+                    Uri file_uri = ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_FILE, file.getFileId());
+                    String where = ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?" + " AND " + ProviderTableMeta.FILE_PATH + "=?";
+                    String[] whereArgs = new String[]{mAccount.name, file.getRemotePath()};
                     int deleted = 0;
                     if (getContentProviderClient() != null) {
                         try {
@@ -491,7 +493,7 @@ public class FileDataStorageManager {
                     } else {
                         deleted = getContentResolver().delete(file_uri, where, whereArgs);
                     }
-                    success &= (deleted > 0); 
+                    success &= (deleted > 0);
                 }
                 String localPath = file.getStoragePath();
                 if (removeLocalCopy && file.isDown() && localPath != null && success) {
@@ -509,12 +511,12 @@ public class FileDataStorageManager {
         }
         return success;
     }
-    
+
 
     public boolean removeFolder(OCFile folder, boolean removeDBData, boolean removeLocalContent) {
         boolean success = true;
         if (folder != null && folder.isFolder()) {
-            if (removeDBData &&  folder.getFileId() != -1) {
+            if (removeDBData && folder.getFileId() != -1) {
                 success = removeFolderInDb(folder);
             }
             if (removeLocalContent && success) {
@@ -525,7 +527,7 @@ public class FileDataStorageManager {
     }
 
     private boolean removeFolderInDb(OCFile folder) {
-        Uri folder_uri = Uri.withAppendedPath(ProviderTableMeta.CONTENT_URI_DIR, "" + 
+        Uri folder_uri = Uri.withAppendedPath(ProviderTableMeta.CONTENT_URI_DIR, "" +
                 folder.getFileId());   // URI for recursive deletion
         String where = ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?" + " AND " + 
                 ProviderTableMeta.FILE_PATH + "=?";
@@ -538,7 +540,7 @@ public class FileDataStorageManager {
                 e.printStackTrace();
             }
         } else {
-            deleted = getContentResolver().delete(folder_uri, where, whereArgs); 
+            deleted = getContentResolver().delete(folder_uri, where, whereArgs);
         }
         return deleted > 0;
     }
@@ -597,54 +599,54 @@ public class FileDataStorageManager {
     
     /**
      * Updates database and file system for a file or folder that was moved to a different location.
-     * 
+     *
      * TODO explore better (faster) implementations
      * TODO throw exceptions up !
      */
     public void moveLocalFile(OCFile file, String targetPath, String targetParentPath) {
 
         if (file != null && file.fileExists() && !OCFile.ROOT_PATH.equals(file.getFileName())) {
-            
+
             OCFile targetParent = getFileByPath(targetParentPath);
             if (targetParent == null) {
                 throw new IllegalStateException("Parent folder of the target path does not exist!!");
             }
-            
+
             /// 1. get all the descendants of the moved element in a single QUERY
             Cursor c = null;
             if (getContentProviderClient() != null) {
                 try {
                     c = getContentProviderClient().query(
-                        ProviderTableMeta.CONTENT_URI, 
-                        null,
-                        ProviderTableMeta.FILE_ACCOUNT_OWNER + "=? AND " + 
-                                ProviderTableMeta.FILE_PATH + " LIKE ? ",
-                        new String[] { 
-                                mAccount.name, 
-                                file.getRemotePath() + "%"  
-                        }, 
-                        ProviderTableMeta.FILE_PATH + " ASC "
+                            ProviderTableMeta.CONTENT_URI,
+                            null,
+                            ProviderTableMeta.FILE_ACCOUNT_OWNER + "=? AND " +
+                                    ProviderTableMeta.FILE_PATH + " LIKE ? ",
+                            new String[]{
+                                    mAccount.name,
+                                    file.getRemotePath() + "%"
+                            },
+                            ProviderTableMeta.FILE_PATH + " ASC "
                     );
                 } catch (RemoteException e) {
                     Log_OC.e(TAG, e.getMessage());
                 }
-                
+
             } else {
                 c = getContentResolver().query(
-                    ProviderTableMeta.CONTENT_URI, 
-                    null,
-                    ProviderTableMeta.FILE_ACCOUNT_OWNER + "=? AND " + 
-                            ProviderTableMeta.FILE_PATH + " LIKE ? ",
-                    new String[] { 
-                            mAccount.name, 
-                            file.getRemotePath() + "%"  
-                    }, 
-                    ProviderTableMeta.FILE_PATH + " ASC "
+                        ProviderTableMeta.CONTENT_URI,
+                        null,
+                        ProviderTableMeta.FILE_ACCOUNT_OWNER + "=? AND " +
+                                ProviderTableMeta.FILE_PATH + " LIKE ? ",
+                        new String[]{
+                                mAccount.name,
+                                file.getRemotePath() + "%"
+                        },
+                        ProviderTableMeta.FILE_PATH + " ASC "
                 );
             }
 
             /// 2. prepare a batch of update operations to change all the descendants
-            ArrayList<ContentProviderOperation> operations = 
+            ArrayList<ContentProviderOperation> operations =
                     new ArrayList<ContentProviderOperation>(c.getCount());
             String defaultSavePath = FileStorageUtils.getSavePath(mAccount.name);
             List<String> originalPathsToTriggerMediaScan = new ArrayList<String>();
@@ -656,13 +658,13 @@ public class FileDataStorageManager {
                     ContentValues cv = new ContentValues(); // keep construction in the loop
                     OCFile child = createFileInstance(c);
                     cv.put(
-                        ProviderTableMeta.FILE_PATH, 
-                        targetPath + child.getRemotePath().substring(lengthOfOldPath)
+                            ProviderTableMeta.FILE_PATH,
+                            targetPath + child.getRemotePath().substring(lengthOfOldPath)
                     );
-                    if (child.getStoragePath() != null && 
+                    if (child.getStoragePath() != null &&
                             child.getStoragePath().startsWith(defaultSavePath)) {
                         // update link to downloaded content - but local move is not done here!
-                        String targetLocalPath = defaultSavePath + targetPath + 
+                        String targetLocalPath = defaultSavePath + targetPath +
                                 child.getStoragePath().substring(lengthOfOldStoragePath);
                         
                         cv.put(ProviderTableMeta.FILE_STORAGE_PATH, targetLocalPath);
@@ -675,17 +677,17 @@ public class FileDataStorageManager {
                         cv.put(
                                 ProviderTableMeta.FILE_PARENT,
                                 targetParent.getFileId()
-                            );
+                        );
                     }
                     operations.add(
-                        ContentProviderOperation.newUpdate(ProviderTableMeta.CONTENT_URI).
-                            withValues(cv).
-                            withSelection(  
-                                    ProviderTableMeta._ID + "=?", 
-                                    new String[] { String.valueOf(child.getFileId()) }
+                            ContentProviderOperation.newUpdate(ProviderTableMeta.CONTENT_URI).
+                                    withValues(cv).
+                                    withSelection(
+                                            ProviderTableMeta._ID + "=?",
+                                            new String[]{String.valueOf(child.getFileId())}
                                     )
-                            .build());
-                    
+                                    .build());
+
                 } while (c.moveToNext());
             }
             c.close();
@@ -730,9 +732,60 @@ public class FileDataStorageManager {
                 }
             }
         }
-        
+
     }
-    
+
+    public void copyLocalFile(OCFile file, String targetPath) {
+
+        if (file != null && file.fileExists() && !OCFile.ROOT_PATH.equals(file.getFileName())) {
+            String localPath = FileStorageUtils.getDefaultSavePathFor(mAccount.name, file);
+            File localFile = new File(localPath);
+            boolean copied = false;
+            String defaultSavePath = FileStorageUtils.getSavePath(mAccount.name);
+            if (localFile.exists()) {
+                File targetFile = new File(defaultSavePath + targetPath);
+                File targetFolder = targetFile.getParentFile();
+                if (!targetFolder.exists()) {
+                    targetFolder.mkdirs();
+                }
+                copied = copyFile(localFile, targetFile);
+            }
+            Log_OC.d(TAG, "Local file COPIED : " + copied);
+        }
+    }
+
+    private boolean copyFile(File src, File target) {
+        boolean ret = true;
+
+        InputStream in = null;
+        OutputStream out = null;
+
+        try {
+            in = new FileInputStream(src);
+            out = new FileOutputStream(target);
+            byte[] buf = new byte[1024];
+            int len;
+            while ((len = in.read(buf)) > 0) {
+                out.write(buf, 0, len);
+            }
+        } catch (IOException ex) {
+            ret = false;
+        } finally {
+            if (in != null) try {
+                in.close();
+            } catch (IOException e) {
+                e.printStackTrace(System.err);
+            }
+            if (out != null) try {
+                out.close();
+            } catch (IOException e) {
+                e.printStackTrace(System.err);
+            }
+        }
+
+        return ret;
+    }
+
     
     private Vector<OCFile> getFolderContent(long parentId/*, boolean onlyOnDevice*/) {
 
@@ -745,17 +798,17 @@ public class FileDataStorageManager {
 
         if (getContentProviderClient() != null) {
             try {
-                c = getContentProviderClient().query(req_uri, null, 
-                        ProviderTableMeta.FILE_PARENT + "=?" ,
-                        new String[] { String.valueOf(parentId)}, null);
+                c = getContentProviderClient().query(req_uri, null,
+                        ProviderTableMeta.FILE_PARENT + "=?",
+                        new String[]{String.valueOf(parentId)}, null);
             } catch (RemoteException e) {
                 Log_OC.e(TAG, e.getMessage());
                 return ret;
             }
         } else {
-            c = getContentResolver().query(req_uri, null, 
-                    ProviderTableMeta.FILE_PARENT + "=?" ,
-                    new String[] { String.valueOf(parentId)}, null);
+            c = getContentResolver().query(req_uri, null,
+                    ProviderTableMeta.FILE_PARENT + "=?",
+                    new String[]{String.valueOf(parentId)}, null);
         }
 
         if (c.moveToFirst()) {
@@ -774,8 +827,8 @@ public class FileDataStorageManager {
 
         return ret;
     }
-    
-    
+
+
     private OCFile createRootDir() {
         OCFile file = new OCFile(OCFile.ROOT_PATH);
         file.setMimetype("DIR");
@@ -793,7 +846,7 @@ public class FileDataStorageManager {
                             cmp_key + "=? AND "
                                     + ProviderTableMeta.FILE_ACCOUNT_OWNER
                                     + "=?",
-                                    new String[] { value, mAccount.name }, null);
+                            new String[]{value, mAccount.name}, null);
         } else {
             try {
                 c = getContentProviderClient().query(
@@ -801,7 +854,7 @@ public class FileDataStorageManager {
                         null,
                         cmp_key + "=? AND "
                                 + ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?",
-                                new String[] { value, mAccount.name }, null);
+                        new String[]{value, mAccount.name}, null);
             } catch (RemoteException e) {
                 Log_OC.e(TAG,
                         "Couldn't determine file existance, assuming non existance: "
@@ -823,14 +876,14 @@ public class FileDataStorageManager {
                             key + "=? AND "
                                     + ProviderTableMeta.FILE_ACCOUNT_OWNER
                                     + "=?",
-                                    new String[] { value, mAccount.name }, null);
+                            new String[]{value, mAccount.name}, null);
         } else {
             try {
                 c = getContentProviderClient().query(
                         ProviderTableMeta.CONTENT_URI,
                         null,
                         key + "=? AND " + ProviderTableMeta.FILE_ACCOUNT_OWNER
-                        + "=?", new String[] { value, mAccount.name },
+                                + "=?", new String[]{value, mAccount.name},
                         null);
             } catch (RemoteException e) {
                 Log_OC.e(TAG, "Could not get file details: " + e.getMessage());
@@ -839,7 +892,7 @@ public class FileDataStorageManager {
         }
         return c;
     }
-    
+
 
     private OCFile createFileInstance(Cursor c) {
         OCFile file = null;
@@ -893,10 +946,11 @@ public class FileDataStorageManager {
         }
         return file;
     }
-    
+
     /**
      * Returns if the file/folder is shared by link or not
-     * @param path  Path of the file/folder
+     *
+     * @param path Path of the file/folder
      * @return
      */
     public boolean isShareByLink(String path) {
@@ -908,10 +962,11 @@ public class FileDataStorageManager {
         c.close();
         return file.isShareByLink();
     }
-    
+
     /**
      * Returns the public link of the file/folder
-     * @param path  Path of the file/folder
+     *
+     * @param path Path of the file/folder
      * @return
      */
     public String getPublicLink(String path) {
@@ -923,8 +978,8 @@ public class FileDataStorageManager {
         c.close();
         return file.getPublicLink();
     }
-    
-    
+
+
     // Methods for Shares
     public boolean saveShare(OCShare share) {
         boolean overriden = false;
@@ -946,19 +1001,18 @@ public class FileDataStorageManager {
         cv.put(ProviderTableMeta.OCSHARES_USER_ID, share.getUserId());
         cv.put(ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED, share.getIdRemoteShared());
         cv.put(ProviderTableMeta.OCSHARES_ACCOUNT_OWNER, mAccount.name);
-        
-        if (shareExists(share.getIdRemoteShared())) {   // for renamed files
 
+        if (shareExists(share.getIdRemoteShared())) {           // for renamed files; no more delete and create
             overriden = true;
             if (getContentResolver() != null) {
                 getContentResolver().update(ProviderTableMeta.CONTENT_URI_SHARE, cv,
                         ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED + "=?",
-                        new String[] { String.valueOf(share.getIdRemoteShared()) });
+                        new String[]{String.valueOf(share.getIdRemoteShared())});
             } else {
                 try {
                     getContentProviderClient().update(ProviderTableMeta.CONTENT_URI_SHARE,
                             cv, ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED + "=?",
-                            new String[] { String.valueOf(share.getIdRemoteShared()) });
+                            new String[]{String.valueOf(share.getIdRemoteShared())});
                 } catch (RemoteException e) {
                     Log_OC.e(TAG,
                             "Fail to insert insert file to database "
@@ -984,7 +1038,7 @@ public class FileDataStorageManager {
                 long new_id = Long.parseLong(result_uri.getPathSegments()
                         .get(1));
                 share.setId(new_id);
-            }            
+            }
         }
 
         return overriden;
@@ -1000,7 +1054,7 @@ public class FileDataStorageManager {
                     ProviderTableMeta.OCSHARES_PATH + "=? AND "
                             + ProviderTableMeta.OCSHARES_SHARE_TYPE + "=? AND "
                             + ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?",
-                    new String[] { path, Integer.toString(type.getValue()), mAccount.name },
+                    new String[]{path, Integer.toString(type.getValue()), mAccount.name},
                     null);
         } else {
             try {
@@ -1010,7 +1064,7 @@ public class FileDataStorageManager {
                         ProviderTableMeta.OCSHARES_PATH + "=? AND "
                                 + ProviderTableMeta.OCSHARES_SHARE_TYPE + "=? AND "
                                 + ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?",
-                        new String[] { path, Integer.toString(type.getValue()), mAccount.name }, 
+                        new String[]{path, Integer.toString(type.getValue()), mAccount.name},
                         null);
 
             } catch (RemoteException e) {
@@ -1025,7 +1079,7 @@ public class FileDataStorageManager {
         c.close();
         return share;
     }
-    
+
     private OCShare createShareInstance(Cursor c) {
         OCShare share = null;
         if (c != null) {
@@ -1047,12 +1101,9 @@ public class FileDataStorageManager {
             share.setSharedWithDisplayName(c.getString(c
                     .getColumnIndex(ProviderTableMeta.OCSHARES_SHARE_WITH_DISPLAY_NAME)));
             share.setIsFolder(c.getInt(
-                    c.getColumnIndex(ProviderTableMeta.OCSHARES_IS_DIRECTORY)) == 1 ? true : false);
+                    c.getColumnIndex(ProviderTableMeta.OCSHARES_IS_DIRECTORY)) == 1);
             share.setUserId(c.getLong(c.getColumnIndex(ProviderTableMeta.OCSHARES_USER_ID)));
-            share.setIdRemoteShared(
-                c.getLong(c.getColumnIndex(ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED))
-            );
-                    
+            share.setIdRemoteShared(c.getLong(c.getColumnIndex(ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED)));
         }
         return share;
     }
@@ -1066,7 +1117,7 @@ public class FileDataStorageManager {
                             cmp_key + "=? AND "
                                     + ProviderTableMeta.OCSHARES_ACCOUNT_OWNER
                                     + "=?",
-                                    new String[] { value, mAccount.name }, null);
+                            new String[]{value, mAccount.name}, null);
         } else {
             try {
                 c = getContentProviderClient().query(
@@ -1074,7 +1125,7 @@ public class FileDataStorageManager {
                         null,
                         cmp_key + "=? AND "
                                 + ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?",
-                                new String[] { value, mAccount.name }, null);
+                        new String[]{value, mAccount.name}, null);
             } catch (RemoteException e) {
                 Log_OC.e(TAG,
                         "Couldn't determine file existance, assuming non existance: "
@@ -1086,7 +1137,7 @@ public class FileDataStorageManager {
         c.close();
         return retval;
     }
-    
+
     private boolean shareExists(long remoteId) {
         return shareExists(ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED, String.valueOf(remoteId));
     }
@@ -1096,17 +1147,14 @@ public class FileDataStorageManager {
         cv.put(ProviderTableMeta.FILE_SHARE_BY_LINK, false);
         cv.put(ProviderTableMeta.FILE_PUBLIC_LINK, "");
         String where = ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?";
-        String [] whereArgs = new String[]{mAccount.name};
-        
+        String[] whereArgs = new String[]{mAccount.name};
+
         if (getContentResolver() != null) {
             getContentResolver().update(ProviderTableMeta.CONTENT_URI, cv, where, whereArgs);
 
         } else {
             try {
-                getContentProviderClient().update(
-                        ProviderTableMeta.CONTENT_URI, cv, where, whereArgs
-                );
-                
+                getContentProviderClient().update(ProviderTableMeta.CONTENT_URI, cv, where, whereArgs);
             } catch (RemoteException e) {
                 Log_OC.e(TAG, "Exception in cleanSharedFiles" + e.getMessage());
             }
@@ -1117,7 +1165,7 @@ public class FileDataStorageManager {
         ContentValues cv = new ContentValues();
         cv.put(ProviderTableMeta.FILE_SHARE_BY_LINK, false);
         cv.put(ProviderTableMeta.FILE_PUBLIC_LINK, "");
-        String where = ProviderTableMeta.FILE_ACCOUNT_OWNER + "=? AND " + 
+        String where = ProviderTableMeta.FILE_ACCOUNT_OWNER + "=? AND " +
                 ProviderTableMeta.FILE_PARENT + "=?";
         String [] whereArgs = new String[] { mAccount.name , String.valueOf(folder.getFileId()) };
         
@@ -1126,10 +1174,7 @@ public class FileDataStorageManager {
 
         } else {
             try {
-                getContentProviderClient().update(
-                        ProviderTableMeta.CONTENT_URI, cv, where, whereArgs
-                );
-                
+                getContentProviderClient().update(ProviderTableMeta.CONTENT_URI, cv, where, whereArgs);
             } catch (RemoteException e) {
                 Log_OC.e(TAG, "Exception in cleanSharedFilesInFolder " + e.getMessage());
             }
@@ -1138,23 +1183,20 @@ public class FileDataStorageManager {
 
     private void cleanShares() {
         String where = ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?";
-        String [] whereArgs = new String[]{mAccount.name};
-        
+        String[] whereArgs = new String[]{mAccount.name};
+
         if (getContentResolver() != null) {
             getContentResolver().delete(ProviderTableMeta.CONTENT_URI_SHARE, where, whereArgs);
 
         } else {
             try {
-                getContentProviderClient().delete(
-                        ProviderTableMeta.CONTENT_URI_SHARE, where, whereArgs
-                );
-                
+                getContentProviderClient().delete(ProviderTableMeta.CONTENT_URI_SHARE, where, whereArgs);
             } catch (RemoteException e) {
                 Log_OC.e(TAG, "Exception in cleanShares" + e.getMessage());
             }
         }
     }
-    
+
     public void saveShares(Collection<OCShare> shares) {
         cleanShares();
         if (shares != null) {
@@ -1187,13 +1229,9 @@ public class FileDataStorageManager {
                     operations.add(
                             ContentProviderOperation.newUpdate(ProviderTableMeta.CONTENT_URI_SHARE).
                             withValues(cv).
-                            withSelection(
-                                    ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED + "=?", 
-                                    new String[] { String.valueOf(share.getIdRemoteShared()) }
-                            ).
-                            build()
-                    );
-
+                            withSelection(ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED + "=?",
+                                    new String[]{String.valueOf(share.getIdRemoteShared())})
+                            .build());
                 } else {
                     // adding a new file
                     operations.add(
@@ -1203,7 +1241,7 @@ public class FileDataStorageManager {
                     );
                 }
             }
-            
+
             // apply operations in batch
             if (operations.size() > 0) {
                 @SuppressWarnings("unused")
@@ -1212,28 +1250,25 @@ public class FileDataStorageManager {
                         " operations to FileContentProvider");
                 try {
                     if (getContentResolver() != null) {
-                        results = getContentResolver().applyBatch(
-                                MainApp.getAuthority(), operations
-                        );
-    
+                        results = getContentResolver().applyBatch(MainApp.getAuthority(), operations);
                     } else {
                         results = getContentProviderClient().applyBatch(operations);
                     }
-    
+
                 } catch (OperationApplicationException e) {
                     Log_OC.e(TAG, "Exception in batch of operations " + e.getMessage());
-    
+
                 } catch (RemoteException e) {
                     Log_OC.e(TAG, "Exception in batch of operations  " + e.getMessage());
                 }
             }
         }
-        
+
     }
-    
+
     public void updateSharedFiles(Collection<OCFile> sharedFiles) {
         cleanSharedFiles();
-        
+
         if (sharedFiles != null) {
             ArrayList<ContentProviderOperation> operations = 
                     new ArrayList<ContentProviderOperation>(sharedFiles.size());
@@ -1282,11 +1317,9 @@ public class FileDataStorageManager {
                     operations.add(
                             ContentProviderOperation.newUpdate(ProviderTableMeta.CONTENT_URI).
                             withValues(cv).
-                            withSelection(
-                                    ProviderTableMeta._ID + "=?", 
-                                    new String[] { String.valueOf(file.getFileId()) }
-                            ).build()
-                    );
+                            withSelection(ProviderTableMeta._ID + "=?",
+                                    new String[]{String.valueOf(file.getFileId())})
+                            .build());
 
                 } else {
                     // adding a new file
@@ -1297,7 +1330,7 @@ public class FileDataStorageManager {
                     );
                 }
             }
-            
+
             // apply operations in batch
             if (operations.size() > 0) {
                 @SuppressWarnings("unused")
@@ -1306,28 +1339,25 @@ public class FileDataStorageManager {
                         " operations to FileContentProvider");
                 try {
                     if (getContentResolver() != null) {
-                        results = getContentResolver().applyBatch(
-                                MainApp.getAuthority(), operations
-                        );
-    
+                        results = getContentResolver().applyBatch(MainApp.getAuthority(), operations);
                     } else {
                         results = getContentProviderClient().applyBatch(operations);
                     }
-    
+
                 } catch (OperationApplicationException e) {
                     Log_OC.e(TAG, "Exception in batch of operations " + e.getMessage());
-    
+
                 } catch (RemoteException e) {
                     Log_OC.e(TAG, "Exception in batch of operations  " + e.getMessage());
                 }
             }
         }
-        
-    } 
-    
-    public void removeShare(OCShare share){
+
+    }
+
+    public void removeShare(OCShare share) {
         Uri share_uri = ProviderTableMeta.CONTENT_URI_SHARE;
-        String where = ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?" + " AND " + 
+        String where = ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?" + " AND " +
                 ProviderTableMeta.FILE_PATH + "=?";
         String [] whereArgs = new String[]{mAccount.name, share.getPath()};
         if (getContentProviderClient() != null) {
@@ -1337,10 +1367,10 @@ public class FileDataStorageManager {
                 e.printStackTrace();
             }
         } else {
-            getContentResolver().delete(share_uri, where, whereArgs); 
+            getContentResolver().delete(share_uri, where, whereArgs);
         }
     }
-    
+
     public void saveSharesDB(ArrayList<OCShare> shares) {
         saveShares(shares);
 
@@ -1351,7 +1381,7 @@ public class FileDataStorageManager {
             String path = share.getPath();
             if (share.isFolder()) {
                 path = path + FileUtils.PATH_SEPARATOR;
-            }           
+            }
 
             // Update OCFile with data from share: ShareByLink  and publicLink
             OCFile file = getFileByPath(path);
@@ -1360,18 +1390,18 @@ public class FileDataStorageManager {
                     file.setShareByLink(true);
                     sharedFiles.add(file);
                 }
-            } 
+            }
         }
-        
+
         updateSharedFiles(sharedFiles);
     }
 
-    
+
     public void saveSharesInFolder(ArrayList<OCShare> shares, OCFile folder) {
         cleanSharedFilesInFolder(folder);
         ArrayList<ContentProviderOperation> operations = new ArrayList<ContentProviderOperation>();
         operations = prepareRemoveSharesInFolder(folder, operations);
-        
+
         if (shares != null) {
             // prepare operations to insert or update files to save in the given folder
             for (OCShare share : shares) {
@@ -1415,7 +1445,7 @@ public class FileDataStorageManager {
                 //}
             }
         }
-            
+
         // apply operations in batch
         if (operations.size() > 0) {
             @SuppressWarnings("unused")
@@ -1437,13 +1467,13 @@ public class FileDataStorageManager {
             }
         }
         //}
-        
+
     }
 
     private ArrayList<ContentProviderOperation> prepareRemoveSharesInFolder(
             OCFile folder, ArrayList<ContentProviderOperation> preparedOperations) {
         if (folder != null) {
-            String where = ProviderTableMeta.OCSHARES_PATH + "=?" + " AND " 
+            String where = ProviderTableMeta.OCSHARES_PATH + "=?" + " AND "
                     + ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?";
             String [] whereArgs = new String[]{ "", mAccount.name };
 
index 2aa5dbc..4baf1ea 100644 (file)
@@ -22,9 +22,9 @@ package com.owncloud.android.datamodel;
 
 import android.os.Parcel;
 import android.os.Parcelable;
+import android.webkit.MimeTypeMap;
 
 import com.owncloud.android.lib.common.utils.Log_OC;
-import com.owncloud.android.utils.FileStorageUtils;
 
 import java.io.File;
 
@@ -289,11 +289,13 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
     /**
      * Sets the name of the file
      * <p/>
-     * Does nothing if the new name is null, empty or includes "/" ; or if the file is the root directory
+     * Does nothing if the new name is null, empty or includes "/" ; or if the file is the root
+     * directory
      */
     public void setFileName(String name) {
         Log_OC.d(TAG, "OCFile name changin from " + mRemotePath);
-        if (name != null && name.length() > 0 && !name.contains(PATH_SEPARATOR) && !mRemotePath.equals(ROOT_PATH)) {
+        if (name != null && name.length() > 0 && !name.contains(PATH_SEPARATOR) &&
+                !mRemotePath.equals(ROOT_PATH)) {
             String parent = (new File(getRemotePath())).getParent();
             parent = (parent.endsWith(PATH_SEPARATOR)) ? parent : parent + PATH_SEPARATOR;
             mRemotePath = parent + name;
@@ -454,7 +456,7 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
 
     @Override
     public int describeContents() {
-        return ((Object) this).hashCode();
+        return super.hashCode();
     }
 
     @Override
@@ -483,8 +485,11 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
 
     @Override
     public String toString() {
-        String asString = "[id=%s, name=%s, mime=%s, downloaded=%s, local=%s, remote=%s, parentId=%s, favorite=%s etag=%s]";
-        asString = String.format(asString, Long.valueOf(mId), getFileName(), mMimeType, isDown(), mLocalPath, mRemotePath, Long.valueOf(mParentId), Boolean.valueOf(mFavorite), mEtag);
+        String asString = "[id=%s, name=%s, mime=%s, downloaded=%s, local=%s, remote=%s, " +
+                "parentId=%s, favorite=%s etag=%s]";
+        asString = String.format(asString, Long.valueOf(mId), getFileName(), mMimeType, isDown(),
+                mLocalPath, mRemotePath, Long.valueOf(mParentId), Boolean.valueOf(mFavorite),
+                mEtag);
         return asString;
     }
 
@@ -540,7 +545,26 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
      */
     public boolean isImage() {
         return ((mMimeType != null && mMimeType.startsWith("image/")) ||
-                FileStorageUtils.getMimeTypeFromName(mRemotePath).startsWith("image/"));
+                getMimeTypeFromName().startsWith("image/"));
+    }
+
+    /**
+     * @return 'True' if the file is simple text (e.g. not application-dependent, like .doc or .docx)
+     */
+    public boolean isText() {
+        return ((mMimeType != null && mMimeType.startsWith("text/")) ||
+                getMimeTypeFromName().startsWith("text/"));
+    }
+
+    public String getMimeTypeFromName() {
+        String extension = "";
+        int pos = mRemotePath.lastIndexOf('.');
+        if (pos >= 0) {
+            extension = mRemotePath.substring(pos + 1);
+        }
+        String result = MimeTypeMap.getSingleton().
+                getMimeTypeFromExtension(extension.toLowerCase());
+        return (result != null) ? result : "";
     }
 
     /**
index 362106e..f0ecf76 100644 (file)
@@ -34,8 +34,8 @@ import android.graphics.Bitmap;
 import android.graphics.Bitmap.CompressFormat;
 import android.graphics.BitmapFactory;
 import android.graphics.Canvas;
-import android.graphics.Shader;
 import android.graphics.drawable.BitmapDrawable;
+import android.graphics.drawable.ColorDrawable;
 import android.graphics.drawable.Drawable;
 import android.media.ThumbnailUtils;
 import android.net.Uri;
@@ -74,8 +74,8 @@ public class ThumbnailsCacheManager {
 
     public static Bitmap mDefaultImg = 
             BitmapFactory.decodeResource(
-                    MainApp.getAppContext().getResources(), 
-                    DisplayUtils.getFileTypeIconId("image/png", "default.png")
+                    MainApp.getAppContext().getResources(),
+                    R.drawable.file_image
             );
 
     
@@ -195,10 +195,6 @@ public class ThumbnailsCacheManager {
         }
 
         protected void onPostExecute(Bitmap bitmap){
-            if (isCancelled()) {
-                bitmap = null;
-            }
-
             if (bitmap != null) {
                 final ImageView imageView = mImageViewReference.get();
                 final ThumbnailGenerationTask bitmapWorkerTask = getBitmapWorkerTask(imageView);
@@ -290,9 +286,6 @@ public class ThumbnailsCacheManager {
                                 GetMethod get = new GetMethod(uri);
                                 int status = mClient.executeMethod(get);
                                 if (status == HttpStatus.SC_OK) {
-//                                    byte[] bytes = get.getResponseBody();
-//                                    Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0,
-//                                            bytes.length);
                                     InputStream inputStream = get.getResponseBodyAsStream();
                                     Bitmap bitmap = BitmapFactory.decodeStream(inputStream);
                                     thumbnail = ThumbnailUtils.extractThumbnail(bitmap, px, px);
@@ -326,16 +319,9 @@ public class ThumbnailsCacheManager {
                     px,
                     Bitmap.Config.ARGB_8888);
             Canvas c = new Canvas(resultBitmap);
-            Bitmap checker = BitmapFactory.decodeResource(MainApp.getAppContext().getResources(),
-                                                          R.drawable.checker_16_16);
-
-            BitmapDrawable background;
-            background = new BitmapDrawable(MainApp.getAppContext().getResources(), checker);
-
-            background.setBounds(0, 0, px, px);
-            background.setTileModeXY(Shader.TileMode.REPEAT, Shader.TileMode.REPEAT);
-            background.draw(c);
 
+            c.drawColor(MainApp.getAppContext().getResources().
+                    getColor(R.color.background_color));
             c.drawBitmap(bitmap, 0, 0, null);
 
             return resultBitmap;
@@ -375,6 +361,7 @@ public class ThumbnailsCacheManager {
             if (bitmapData == null || bitmapData != file) {
                 // Cancel previous task
                 bitmapWorkerTask.cancel(true);
+                Log_OC.v(TAG, "Cancelled generation of thumbnail for a reused imageView");
             } else {
                 // The same work is already in progress
                 return false;
index 2c2754c..f7fee62 100644 (file)
@@ -39,7 +39,7 @@ import com.owncloud.android.services.OperationsService.OperationsServiceBinder;
 import com.owncloud.android.ui.activity.ComponentsGetter;
 
 /**
- * Filters out the file actions available in a given {@link Menu} for a given {@link OCFile} 
+ * Filters out the file actions available in a given {@link Menu} for a given {@link OCFile}
  * according to the current state of the latest. 
  */
 public class FileMenuFilter {
@@ -48,10 +48,10 @@ public class FileMenuFilter {
     private ComponentsGetter mComponentsGetter;
     private Account mAccount;
     private Context mContext;
-    
+
     /**
      * Constructor
-     * 
+     *
      * @param targetFile        {@link OCFile} target of the action to filter in the {@link Menu}.
      * @param account           ownCloud {@link Account} holding targetFile.
      * @param cg                Accessor to app components, needed to access the
@@ -64,20 +64,20 @@ public class FileMenuFilter {
         mComponentsGetter = cg;
         mContext = context;
     }
-    
-    
+
+
     /**
      * Filters out the file actions available in the passed {@link Menu} taken into account
      * the state of the {@link OCFile} held by the filter.
-     *  
+     *
      * @param menu              Options or context menu to filter.
      */
     public void filter(Menu menu) {
-        List<Integer> toShow = new ArrayList<Integer>();  
-        List<Integer> toHide = new ArrayList<Integer>();    
-        
+        List<Integer> toShow = new ArrayList<Integer>();
+        List<Integer> toHide = new ArrayList<Integer>();
+
         filter(toShow, toHide);
-        
+
         MenuItem item = null;
         for (int i : toShow) {
             item = menu.findItem(i);
@@ -86,7 +86,7 @@ public class FileMenuFilter {
                 item.setEnabled(true);
             }
         }
-        
+
         for (int i : toHide) {
             item = menu.findItem(i);
             if (item != null) {
@@ -99,10 +99,10 @@ public class FileMenuFilter {
 
     /**
      * Performs the real filtering, to be applied in the {@link Menu} by the caller methods.
-     * 
+     *
      * Decides what actions must be shown and hidden.
-     *  
-     * @param toShow            List to save the options that must be shown in the menu. 
+     *
+     * @param toShow            List to save the options that must be shown in the menu.
      * @param toHide            List to save the options that must be shown in the menu.
      */
     private void filter(List<Integer> toShow, List <Integer> toHide) {
@@ -116,71 +116,72 @@ public class FileMenuFilter {
             FileUploaderBinder uploaderBinder = mComponentsGetter.getFileUploaderBinder();
             uploading = (uploaderBinder != null && uploaderBinder.isUploading(mAccount, mFile));
         }
-        
+
         /// decision is taken for each possible action on a file in the menu
-        
+
         // DOWNLOAD 
         if (mFile == null || mFile.isDown() || downloading || uploading) {
             toHide.add(R.id.action_download_file);
-            
+
         } else {
             toShow.add(R.id.action_download_file);
         }
-        
+
         // RENAME
         if (mFile == null || downloading || uploading) {
             toHide.add(R.id.action_rename_file);
-            
+
         } else {
             toShow.add(R.id.action_rename_file);
         }
 
-        // MOVE
+        // MOVE & COPY
         if (mFile == null || downloading || uploading) {
             toHide.add(R.id.action_move);
-
+            toHide.add(R.id.action_copy);
         } else {
             toShow.add(R.id.action_move);
+            toShow.add(R.id.action_copy);
         }
-        
+
         // REMOVE
         if (mFile == null || downloading || uploading) {
             toHide.add(R.id.action_remove_file);
-            
+
         } else {
             toShow.add(R.id.action_remove_file);
         }
-        
+
         // OPEN WITH (different to preview!)
         if (mFile == null || mFile.isFolder() || !mFile.isDown() || downloading || uploading) {
             toHide.add(R.id.action_open_file_with);
-            
+
         } else {
             toShow.add(R.id.action_open_file_with);
         }
-        
-        
+
+
         // CANCEL DOWNLOAD
         if (mFile == null || !downloading) {
             toHide.add(R.id.action_cancel_download);
         } else {
             toShow.add(R.id.action_cancel_download);
         }
-        
+
         // CANCEL UPLOAD
         if (mFile == null || !uploading || mFile.isFolder()) {
             toHide.add(R.id.action_cancel_upload);
         } else {
             toShow.add(R.id.action_cancel_upload);
         }
-        
+
         // SYNC FILE CONTENTS
         if (mFile == null || mFile.isFolder() || !mFile.isDown() || downloading || uploading) {
             toHide.add(R.id.action_sync_file);
         } else {
             toShow.add(R.id.action_sync_file);
         }
-        
+
         // SHARE FILE 
         // TODO add check on SHARE available on server side?
         boolean shareAllowed = (mContext != null  &&
@@ -190,7 +191,7 @@ public class FileMenuFilter {
         } else {
             toShow.add(R.id.action_share_file);
         }
-        
+
         // UNSHARE FILE  
         // TODO add check on SHARE available on server side?
         if ( !shareAllowed || (mFile == null || !mFile.isShareByLink())) {
@@ -205,7 +206,7 @@ public class FileMenuFilter {
         } else {
             toShow.add(R.id.action_see_details);
         }
-        
+
         // SEND
         boolean sendAllowed = (mContext != null &&
                 mContext.getString(R.string.send_files_to_other_apps).equalsIgnoreCase("on"));
index ddee205..2237028 100644 (file)
@@ -21,8 +21,6 @@
 
 package com.owncloud.android.files;
 
-import org.apache.http.protocol.HTTP;
-
 import android.accounts.Account;
 import android.content.Intent;
 import android.net.Uri;
@@ -35,7 +33,6 @@ import com.owncloud.android.authentication.AccountUtils;
 import com.owncloud.android.datamodel.OCFile;
 import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
 import com.owncloud.android.files.services.FileUploader.FileUploaderBinder;
-
 import com.owncloud.android.lib.common.network.WebdavUtils;
 import com.owncloud.android.lib.common.utils.Log_OC;
 import com.owncloud.android.lib.resources.status.OwnCloudVersion;
@@ -44,20 +41,22 @@ import com.owncloud.android.services.observer.FileObserverService;
 import com.owncloud.android.ui.activity.FileActivity;
 import com.owncloud.android.ui.dialog.ShareLinkToDialog;
 
+import org.apache.http.protocol.HTTP;
+
 /**
  *
  */
 public class FileOperationsHelper {
 
     private static final String TAG = FileOperationsHelper.class.getName();
-    
-    private static final String FTAG_CHOOSER_DIALOG = "CHOOSER_DIALOG"; 
+
+    private static final String FTAG_CHOOSER_DIALOG = "CHOOSER_DIALOG";
 
     protected FileActivity mFileActivity = null;
 
     /// Identifier of operation in progress which result shouldn't be lost 
     private long mWaitingForOpId = Long.MAX_VALUE;
-    
+
     public FileOperationsHelper(FileActivity fileActivity) {
         mFileActivity = fileActivity;
     }
@@ -67,7 +66,7 @@ public class FileOperationsHelper {
         if (file != null) {
             String storagePath = file.getStoragePath();
             String encodedStoragePath = WebdavUtils.encodePath(storagePath);
-            
+
             Intent intentForSavedMimeType = new Intent(Intent.ACTION_VIEW);
             intentForSavedMimeType.setDataAndType(Uri.parse("file://"+ encodedStoragePath), file.getMimetype());
             intentForSavedMimeType.setFlags(
@@ -94,29 +93,29 @@ public class FileOperationsHelper {
             } else {
                 chooserIntent = Intent.createChooser(intentForSavedMimeType, mFileActivity.getString(R.string.actionbar_open_with));
             }
-            
+
             mFileActivity.startActivity(chooserIntent);
-            
+
         } else {
             Log_OC.wtf(TAG, "Trying to open a NULL OCFile");
         }
     }
-    
-    
+
+
     public void shareFileWithLink(OCFile file) {
-        
+
         if (isSharedSupported()) {
             if (file != null) {
                 String link = "https://fake.url";
                 Intent intent = createShareWithLinkIntent(link);
-                String[] packagesToExclude = new String[] { mFileActivity.getPackageName() };
+                String[] packagesToExclude = new String[]{mFileActivity.getPackageName()};
                 DialogFragment chooserDialog = ShareLinkToDialog.newInstance(intent, packagesToExclude, file);
                 chooserDialog.show(mFileActivity.getSupportFragmentManager(), FTAG_CHOOSER_DIALOG);
-                
+
             } else {
                 Log_OC.wtf(TAG, "Trying to share a NULL OCFile");
             }
-            
+
         } else {
             // Show a Message
             Toast t = Toast.makeText(
@@ -125,13 +124,13 @@ public class FileOperationsHelper {
             t.show();
         }
     }
-    
-    
+
+
     public void shareFileWithLinkToApp(OCFile file, String password, Intent sendIntent) {
         
         if (file != null) {
             mFileActivity.showLoadingDialog();
-            
+
             Intent service = new Intent(mFileActivity, OperationsService.class);
             service.setAction(OperationsService.ACTION_CREATE_SHARE);
             service.putExtra(OperationsService.EXTRA_ACCOUNT, mFileActivity.getAccount());
@@ -144,18 +143,18 @@ public class FileOperationsHelper {
             Log_OC.wtf(TAG, "Trying to open a NULL OCFile");
         }
     }
-    
-    
+
+
     private Intent createShareWithLinkIntent(String link) {
         Intent intentToShareLink = new Intent(Intent.ACTION_SEND);
         intentToShareLink.putExtra(Intent.EXTRA_TEXT, link);
         intentToShareLink.setType(HTTP.PLAIN_TEXT_TYPE);
-        return intentToShareLink; 
+        return intentToShareLink;
     }
-    
-    
+
+
     /**
-     *  @return 'True' if the server supports the Share API
+     * @return 'True' if the server supports the Share API
      */
     public boolean isSharedSupported() {
         if (mFileActivity.getAccount() != null) {
@@ -164,10 +163,10 @@ public class FileOperationsHelper {
         }
         return false;
     }
-    
-    
+
+
     public void unshareFileWithLink(OCFile file) {
-        
+
         if (isSharedSupported()) {
             // Unshare the file
             Intent service = new Intent(mFileActivity, OperationsService.class);
@@ -177,15 +176,15 @@ public class FileOperationsHelper {
             mWaitingForOpId = mFileActivity.getOperationsServiceBinder().queueNewOperation(service);
             
             mFileActivity.showLoadingDialog();
-            
+
         } else {
             // Show a Message
             Toast t = Toast.makeText(mFileActivity, mFileActivity.getString(R.string.share_link_no_support_share_api), Toast.LENGTH_LONG);
             t.show();
-            
+
         }
     }
-    
+
     public void sendDownloadedFile(OCFile file) {
         if (file != null) {
             String storagePath = file.getStoragePath();
@@ -197,7 +196,7 @@ public class FileOperationsHelper {
             sendIntent.putExtra(Intent.ACTION_SEND, true);      // Send Action
 
             // Show dialog, without the own app
-            String[] packagesToExclude = new String[] { mFileActivity.getPackageName() };
+            String[] packagesToExclude = new String[]{mFileActivity.getPackageName()};
             DialogFragment chooserDialog = ShareLinkToDialog.newInstance(sendIntent, packagesToExclude, file);
             chooserDialog.show(mFileActivity.getSupportFragmentManager(), FTAG_CHOOSER_DIALOG);
 
@@ -205,10 +204,10 @@ public class FileOperationsHelper {
             Log_OC.wtf(TAG, "Trying to send a NULL OCFile");
         }
     }
-    
-    
+
+
     public void syncFile(OCFile file) {
-        
+
         if (!file.isFolder()){
             Intent intent = new Intent(mFileActivity, OperationsService.class);
             intent.setAction(OperationsService.ACTION_SYNC_FILE);
@@ -269,8 +268,8 @@ public class FileOperationsHelper {
         
         mFileActivity.showLoadingDialog();
     }
-    
-    
+
+
     public void createFolder(String remotePath, boolean createFullPath) {
         // Create Folder
         Intent service = new Intent(mFileActivity, OperationsService.class);
@@ -317,8 +316,9 @@ public class FileOperationsHelper {
 
     /**
      * Start move file operation
-     * @param newfile           File where it is going to be moved
-     * @param currentFile       File with the previous info
+     *
+     * @param newfile     File where it is going to be moved
+     * @param currentFile File with the previous info
      */
     public void moveFile(OCFile newfile, OCFile currentFile) {
         // Move files
@@ -332,6 +332,23 @@ public class FileOperationsHelper {
         mFileActivity.showLoadingDialog();
     }
 
+    /**
+     * Start copy file operation
+     *
+     * @param newfile     File where it is going to be moved
+     * @param currentFile File with the previous info
+     */
+    public void copyFile(OCFile newfile, OCFile currentFile) {
+        // Copy files
+        Intent service = new Intent(mFileActivity, OperationsService.class);
+        service.setAction(OperationsService.ACTION_COPY_FILE);
+        service.putExtra(OperationsService.EXTRA_NEW_PARENT_PATH, newfile.getRemotePath());
+        service.putExtra(OperationsService.EXTRA_REMOTE_PATH, currentFile.getRemotePath());
+        service.putExtra(OperationsService.EXTRA_ACCOUNT, mFileActivity.getAccount());
+        mWaitingForOpId = mFileActivity.getOperationsServiceBinder().queueNewOperation(service);
+
+        mFileActivity.showLoadingDialog();
+    }
 
     public long getOpIdWaitingFor() {
         return mWaitingForOpId;
@@ -341,7 +358,7 @@ public class FileOperationsHelper {
     public void setOpIdWaitingFor(long waitingForOpId) {
         mWaitingForOpId = waitingForOpId;
     }
-    
+
     /**
      *  @return 'True' if the server doesn't need to check forbidden characters
      */
diff --git a/src/com/owncloud/android/operations/CopyFileOperation.java b/src/com/owncloud/android/operations/CopyFileOperation.java
new file mode 100644 (file)
index 0000000..77a9a07
--- /dev/null
@@ -0,0 +1,103 @@
+/* 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.operations;
+
+import android.accounts.Account;
+import android.content.Context;
+
+import com.owncloud.android.datamodel.OCFile;
+import com.owncloud.android.lib.common.OwnCloudClient;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult;
+import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.lib.resources.files.CopyRemoteFileOperation;
+import com.owncloud.android.operations.common.SyncOperation;
+
+
+/**
+ * Operation copying an {@link OCFile} to a different folder.
+ *
+ * @author David A. Velasco
+ */
+public class CopyFileOperation extends SyncOperation {
+
+    //private static final String TAG = MoveFileOperation.class.getSimpleName();
+
+    private String mSrcPath;
+    private String mTargetParentPath;
+
+    private OCFile mFile;
+
+
+    /**
+     * Constructor
+     *
+     * @param srcPath          Remote path of the {@link OCFile} to move.
+     * @param targetParentPath Path to the folder where the file will be copied into.
+     * @param account          OwnCloud account containing both the file and the target folder
+     */
+    public CopyFileOperation(String srcPath, String targetParentPath, Account account) {
+        mSrcPath = srcPath;
+        mTargetParentPath = targetParentPath;
+        if (!mTargetParentPath.endsWith(OCFile.PATH_SEPARATOR)) {
+            mTargetParentPath += OCFile.PATH_SEPARATOR;
+        }
+
+        mFile = null;
+    }
+
+    /**
+     * Performs the operation.
+     *
+     * @param client Client object to communicate with the remote ownCloud server.
+     */
+    @Override
+    protected RemoteOperationResult run(OwnCloudClient client) {
+        RemoteOperationResult result;
+
+        /// 1. check copy validity
+        if (mTargetParentPath.startsWith(mSrcPath)) {
+            return new RemoteOperationResult(ResultCode.INVALID_COPY_INTO_DESCENDANT);
+        }
+        mFile = getStorageManager().getFileByPath(mSrcPath);
+        if (mFile == null) {
+            return new RemoteOperationResult(ResultCode.FILE_NOT_FOUND);
+        }
+
+        /// 2. remote copy
+        String targetPath = mTargetParentPath + mFile.getFileName();
+        if (mFile.isFolder()) {
+            targetPath += OCFile.PATH_SEPARATOR;
+        }
+        CopyRemoteFileOperation operation = new CopyRemoteFileOperation(
+                mSrcPath,
+                targetPath,
+                false
+        );
+        result = operation.execute(client);
+
+        /// 3. local copy
+        if (result.isSuccess()) {
+            getStorageManager().copyLocalFile(mFile, targetPath);
+        }
+        // TODO handle ResultCode.PARTIAL_COPY_DONE in client Activity, for the moment
+
+        return result;
+    }
+
+
+}
index a4e50ce..70cd897 100644 (file)
@@ -178,6 +178,7 @@ public class FileContentProvider extends ContentProvider {
             if (c != null && c.moveToFirst()) {
                 remoteId = c.getString(c.getColumnIndex(ProviderTableMeta.FILE_REMOTE_ID));
                 //ThumbnailsCacheManager.removeFileFromCache(remoteId);
+                c.close();
             }
             Log_OC.d(TAG, "Removing FILE " + remoteId);
 
@@ -187,11 +188,6 @@ public class FileContentProvider extends ContentProvider {
                             + uri.getPathSegments().get(1)
                             + (!TextUtils.isEmpty(where) ? " AND (" + where
                                     + ")" : ""), whereArgs);
-            /* just for log
-            if (c!=null) {
-                c.close();
-            }
-            */
             break;
         case DIRECTORY:
             // deletion of folder is recursive
@@ -306,6 +302,9 @@ public class FileContentProvider extends ContentProvider {
             // ugly patch; serious refactorization is needed to reduce work in
             // FileDataStorageManager and bring it to FileContentProvider
             if (doubleCheck == null || !doubleCheck.moveToFirst()) {
+                if (doubleCheck != null) {
+                    doubleCheck.close();
+                }
                 long rowId = db.insert(ProviderTableMeta.FILE_TABLE_NAME, null, values);
                 if (rowId > 0) {
                     Uri insertedFileUri =
@@ -341,6 +340,9 @@ public class FileContentProvider extends ContentProvider {
             // ugly patch; serious refactorization is needed to reduce work in
             // FileDataStorageManager and bring it to FileContentProvider
             if (doubleCheckShare == null || !doubleCheckShare.moveToFirst()) {
+                if (doubleCheckShare != null) {
+                    doubleCheckShare.close();
+                }
                 long rowId = db.insert(ProviderTableMeta.OCSHARES_TABLE_NAME, null, values);
                 if (rowId >0) {
                     insertedShareUri =
index 2514c4d..099bd08 100644 (file)
 
 package com.owncloud.android.services;
 
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.ConcurrentMap;
+import android.accounts.Account;
+import android.accounts.AccountsException;
+import android.accounts.AuthenticatorException;
+import android.accounts.OperationCanceledException;
+import android.app.Service;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Binder;
+import android.os.Handler;
+import android.os.HandlerThread;
+import android.os.IBinder;
+import android.os.Looper;
+import android.os.Message;
+import android.os.Process;
+import android.util.Pair;
 
 import com.owncloud.android.MainApp;
 import com.owncloud.android.R;
@@ -42,7 +52,7 @@ import com.owncloud.android.lib.common.utils.Log_OC;
 import com.owncloud.android.lib.resources.shares.ShareType;
 import com.owncloud.android.lib.resources.status.OwnCloudVersion;
 import com.owncloud.android.lib.resources.users.GetRemoteUserNameOperation;
-import com.owncloud.android.operations.common.SyncOperation;
+import com.owncloud.android.operations.CopyFileOperation;
 import com.owncloud.android.operations.CreateFolderOperation;
 import com.owncloud.android.operations.CreateShareOperation;
 import com.owncloud.android.operations.GetServerInfoOperation;
@@ -53,28 +63,18 @@ import com.owncloud.android.operations.RenameFileOperation;
 import com.owncloud.android.operations.SynchronizeFileOperation;
 import com.owncloud.android.operations.SynchronizeFolderOperation;
 import com.owncloud.android.operations.UnshareLinkOperation;
+import com.owncloud.android.operations.common.SyncOperation;
 
-import android.accounts.Account;
-import android.accounts.AccountManager;
-import android.accounts.AccountsException;
-import android.accounts.AuthenticatorException;
-import android.accounts.OperationCanceledException;
-import android.app.Service;
-import android.content.Intent;
-import android.net.Uri;
-import android.os.Binder;
-import android.os.Handler;
-import android.os.HandlerThread;
-import android.os.IBinder;
-import android.os.Looper;
-import android.os.Message;
-import android.os.Process;
-import android.util.Pair;
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.concurrent.ConcurrentMap;
 
 public class OperationsService extends Service {
-    
+
     private static final String TAG = OperationsService.class.getSimpleName();
-    
+
     public static final String EXTRA_ACCOUNT = "ACCOUNT";
     public static final String EXTRA_SERVER_URL = "SERVER_URL";
     public static final String EXTRA_OAUTH2_QUERY_PARAMETERS = "OAUTH2_QUERY_PARAMETERS";
@@ -90,7 +90,7 @@ public class OperationsService extends Service {
     public static final String EXTRA_PASSWORD_SHARE = "PASSWORD_SHARE";
 
     public static final String EXTRA_COOKIE = "COOKIE";
-    
+
     public static final String ACTION_CREATE_SHARE = "CREATE_SHARE";
     public static final String ACTION_UNSHARE = "UNSHARE";
     public static final String ACTION_GET_SERVER_INFO = "GET_SERVER_INFO";
@@ -102,22 +102,24 @@ public class OperationsService extends Service {
     public static final String ACTION_SYNC_FILE = "SYNC_FILE";
     public static final String ACTION_SYNC_FOLDER = "SYNC_FOLDER";//for the moment, just to download
     public static final String ACTION_MOVE_FILE = "MOVE_FILE";
-    
+    public static final String ACTION_COPY_FILE = "COPY_FILE";
+
     public static final String ACTION_OPERATION_ADDED = OperationsService.class.getName() +
             ".OPERATION_ADDED";
     public static final String ACTION_OPERATION_FINISHED = OperationsService.class.getName() +
             ".OPERATION_FINISHED";
 
 
-    private ConcurrentMap<Integer, Pair<RemoteOperation, RemoteOperationResult>> 
-        mUndispatchedFinishedOperations =
+
+    private ConcurrentMap<Integer, Pair<RemoteOperation, RemoteOperationResult>>
+            mUndispatchedFinishedOperations =
             new ConcurrentHashMap<Integer, Pair<RemoteOperation, RemoteOperationResult>>();
-    
+
     private static class Target {
         public Uri mServerUrl = null;
         public Account mAccount = null;
         public String mCookie = null;
-        
+
         public Target(Account account, Uri serverUrl, String cookie) {
             mAccount = account;
             mServerUrl = serverUrl;
@@ -151,11 +153,11 @@ public class OperationsService extends Service {
         mSyncFolderHandler = new SyncFolderHandler(thread.getLooper(), this);
     }
 
-    
+
     /**
      * Entry point to add a new operation to the queue of operations.
-     * 
-     * New operations are added calling to startService(), resulting in a call to this method. 
+     * <p/>
+     * New operations are added calling to startService(), resulting in a call to this method.
      * This ensures the service will keep on working although the caller activity goes away.
      */
     @Override
@@ -200,8 +202,8 @@ public class OperationsService extends Service {
         // Saving cookies
         try {
             OwnCloudClientManagerFactory.getDefaultSingleton().
-                saveAllClients(this, MainApp.getAccountType());
-            
+                    saveAllClients(this, MainApp.getAccountType());
+
             // TODO - get rid of these exceptions
         } catch (AccountNotFoundException e) {
             e.printStackTrace();
@@ -212,7 +214,7 @@ public class OperationsService extends Service {
         } catch (IOException e) {
             e.printStackTrace();
         }
-        
+
         mUndispatchedFinishedOperations.clear();
 
         mOperationsBinder = null;
@@ -227,8 +229,8 @@ public class OperationsService extends Service {
     }
 
     /**
-     * Provides a binder object that clients can use to perform actions on the queue of operations, 
-     * except the addition of new operations. 
+     * Provides a binder object that clients can use to perform actions on the queue of operations,
+     * except the addition of new operations.
      */
     @Override
     public IBinder onBind(Intent intent) {
@@ -236,7 +238,7 @@ public class OperationsService extends Service {
         return mOperationsBinder;
     }
 
-    
+
     /**
      * Called when ALL the bound clients were unbound.
      */
@@ -248,20 +250,20 @@ public class OperationsService extends Service {
 
 
     /**
-     *  Binder to let client components to perform actions on the queue of operations.
-     * 
-     *  It provides by itself the available operations.
+     * Binder to let client components to perform actions on the queue of operations.
+     * <p/>
+     * It provides by itself the available operations.
      */
     public class OperationsServiceBinder extends Binder /* implements OnRemoteOperationListener */ {
-        
-        /** 
+
+        /**
          * Map of listeners that will be reported about the end of operations from a
          * {@link OperationsServiceBinder} instance
          */
-        private ConcurrentMap<OnRemoteOperationListener, Handler> mBoundListeners = 
+        private final ConcurrentMap<OnRemoteOperationListener, Handler> mBoundListeners =
                 new ConcurrentHashMap<OnRemoteOperationListener, Handler>();
-        
-        private ServiceHandler mServiceHandler = null;   
+
+        private ServiceHandler mServiceHandler = null;
 
         public OperationsServiceBinder(ServiceHandler serviceHandler) {
             mServiceHandler = serviceHandler;
@@ -280,15 +282,15 @@ public class OperationsService extends Service {
 
 
         public void clearListeners() {
-            
+
             mBoundListeners.clear();
         }
 
-        
+
         /**
          * Adds a listener interested in being reported about the end of operations.
-         * 
-         * @param listener          Object to notify about the end of operations.    
+         *
+         * @param listener          Object to notify about the end of operations.
          * @param callbackHandler   {@link Handler} to access the listener without
          *                                         breaking Android threading protection.
          */
@@ -298,15 +300,15 @@ public class OperationsService extends Service {
                 mBoundListeners.put(listener, callbackHandler);
             }
         }
-        
-        
+
+
         /**
          * Removes a listener from the list of objects interested in the being reported about
          * the end of operations.
          * 
          * @param listener      Object to notify about progress of transfer.    
          */
-        public void removeOperationListener (OnRemoteOperationListener listener) {
+        public void removeOperationListener(OnRemoteOperationListener listener) {
             synchronized (mBoundListeners) {
                 mBoundListeners.remove(listener);
             }
@@ -314,8 +316,8 @@ public class OperationsService extends Service {
 
 
         /**
-         * TODO - IMPORTANT: update implementation when more operations are moved into the service 
-         * 
+         * TODO - IMPORTANT: update implementation when more operations are moved into the service
+         *
          * @return  'True' when an operation that enforces the user to wait for completion is
          *          in process.
          */
@@ -343,8 +345,8 @@ public class OperationsService extends Service {
                 return Long.MAX_VALUE;
             }
         }
-        
-        
+
+
         public boolean dispatchResultIfFinished(int operationId,
                                                 OnRemoteOperationListener listener) {
             Pair<RemoteOperation, RemoteOperationResult> undispatched = 
@@ -378,8 +380,8 @@ public class OperationsService extends Service {
 
 
     /**
-     * Operations worker. Performs the pending operations in the order they were requested. 
-     * 
+     * Operations worker. Performs the pending operations in the order they were requested.
+     *
      * Created with the Looper of a new thread, started in {@link OperationsService#onCreate()}. 
      */
     private static class ServiceHandler extends Handler {
@@ -388,8 +390,8 @@ public class OperationsService extends Service {
         
         
         OperationsService mService;
-        
-        
+
+
         private ConcurrentLinkedQueue<Pair<Target, RemoteOperation>> mPendingOperations =
                 new ConcurrentLinkedQueue<Pair<Target, RemoteOperation>>();
         private RemoteOperation mCurrentOperation = null;
@@ -412,7 +414,7 @@ public class OperationsService extends Service {
             Log_OC.d(TAG, "Stopping after command with id " + msg.arg1);
             mService.stopSelf(msg.arg1);
         }
-        
+
         
         /**
          * Performs the next operation in the queue
@@ -475,7 +477,7 @@ public class OperationsService extends Service {
                     } else {
                         result = mCurrentOperation.execute(mOwnCloudClient);
                     }
-                    
+
                 } catch (AccountsException e) {
                     if (mLastTarget.mAccount == null) {
                         Log_OC.e(TAG, "Error while trying to get authorization for a NULL account",
@@ -515,9 +517,9 @@ public class OperationsService extends Service {
         }
 
 
-        
+
     }
-    
+
 
     /**
      * Creates a new operation, as described by operationIntent.
@@ -535,7 +537,7 @@ public class OperationsService extends Service {
             if (!operationIntent.hasExtra(EXTRA_ACCOUNT) && 
                     !operationIntent.hasExtra(EXTRA_SERVER_URL)) {
                 Log_OC.e(TAG, "Not enough information provided in intent");
-                
+
             } else {
                 Account account = operationIntent.getParcelableExtra(EXTRA_ACCOUNT);
                 String serverUrl = operationIntent.getStringExtra(EXTRA_SERVER_URL);
@@ -556,7 +558,7 @@ public class OperationsService extends Service {
                                 ShareType.PUBLIC_LINK,
                                 "", false, password, 1, sendIntent);
                     }
-                    
+
                 } else if (action.equals(ACTION_UNSHARE)) {  // Unshare file
                     String remotePath = operationIntent.getStringExtra(EXTRA_REMOTE_PATH);
                     if (remotePath.length() > 0) {
@@ -568,7 +570,7 @@ public class OperationsService extends Service {
                 } else if (action.equals(ACTION_GET_SERVER_INFO)) { 
                     // check OC server and get basic information from it
                     operation = new GetServerInfoOperation(serverUrl, OperationsService.this);
-                    
+
                 } else if (action.equals(ACTION_OAUTH2_GET_ACCESS_TOKEN)) {
                     /// GET ACCESS TOKEN to the OAuth server
                     String oauth2QueryParameters =
@@ -578,7 +580,7 @@ public class OperationsService extends Service {
                             getString(R.string.oauth2_redirect_uri),       
                             getString(R.string.oauth2_grant_type),
                             oauth2QueryParameters);
-                    
+
                 } else if (action.equals(ACTION_GET_USER_NAME)) {
                     // Get User Name
                     operation = new GetRemoteUserNameOperation();
@@ -602,7 +604,7 @@ public class OperationsService extends Service {
                     boolean createFullPath = operationIntent.getBooleanExtra(EXTRA_CREATE_FULL_PATH,
                             true);
                     operation = new CreateFolderOperation(remotePath, createFullPath);
-                    
+
                 } else if (action.equals(ACTION_SYNC_FILE)) {
                     // Sync file
                     String remotePath = operationIntent.getStringExtra(EXTRA_REMOTE_PATH);
@@ -626,9 +628,14 @@ public class OperationsService extends Service {
                     // Move file/folder
                     String remotePath = operationIntent.getStringExtra(EXTRA_REMOTE_PATH);
                     String newParentPath = operationIntent.getStringExtra(EXTRA_NEW_PARENT_PATH);
-                    operation = new MoveFileOperation(remotePath,newParentPath,account);
+                    operation = new MoveFileOperation(remotePath, newParentPath, account);
+
+                } else if (action.equals(ACTION_COPY_FILE)) {
+                    // Copy file/folder
+                    String remotePath = operationIntent.getStringExtra(EXTRA_REMOTE_PATH);
+                    String newParentPath = operationIntent.getStringExtra(EXTRA_NEW_PARENT_PATH);
+                    operation = new CopyFileOperation(remotePath, newParentPath, account);
                 }
-                
             }
                 
         } catch (IllegalArgumentException e) {
@@ -642,11 +649,11 @@ public class OperationsService extends Service {
             return null;
         }
     }
-    
+
 
     /**
      * Sends a broadcast when a new operation is added to the queue.
-     * 
+     *
      * Local broadcasts are only delivered to activities in the same process, but can't be
      * done sticky :\
      * 
@@ -656,43 +663,43 @@ public class OperationsService extends Service {
     private void sendBroadcastNewOperation(Target target, RemoteOperation operation) {
         Intent intent = new Intent(ACTION_OPERATION_ADDED);
         if (target.mAccount != null) {
-            intent.putExtra(EXTRA_ACCOUNT, target.mAccount);    
+            intent.putExtra(EXTRA_ACCOUNT, target.mAccount);
         } else {
-            intent.putExtra(EXTRA_SERVER_URL, target.mServerUrl);    
+            intent.putExtra(EXTRA_SERVER_URL, target.mServerUrl);
         }
         //LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(this);
         //lbm.sendBroadcast(intent);
         sendStickyBroadcast(intent);
     }
 
-    
+
     // TODO - maybe add a notification for real start of operations
-    
+
     /**
      * Sends a LOCAL broadcast when an operations finishes in order to the interested activities c
      * an update their view
      * 
      * Local broadcasts are only delivered to activities in the same process.
-     * 
-     * @param target            Account or URL pointing to an OC server.
-     * @param operation         Finished operation.
-     * @param result            Result of the operation.
+     *
+     * @param target    Account or URL pointing to an OC server.
+     * @param operation Finished operation.
+     * @param result    Result of the operation.
      */
     private void sendBroadcastOperationFinished(Target target, RemoteOperation operation,
                                                 RemoteOperationResult result) {
         Intent intent = new Intent(ACTION_OPERATION_FINISHED);
         intent.putExtra(EXTRA_RESULT, result);
         if (target.mAccount != null) {
-            intent.putExtra(EXTRA_ACCOUNT, target.mAccount);    
+            intent.putExtra(EXTRA_ACCOUNT, target.mAccount);
         } else {
-            intent.putExtra(EXTRA_SERVER_URL, target.mServerUrl);    
+            intent.putExtra(EXTRA_SERVER_URL, target.mServerUrl);
         }
         //LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(this);
         //lbm.sendBroadcast(intent);
         sendStickyBroadcast(intent);
     }
 
-    
+
     /**
      * Notifies the currently subscribed listeners about the end of an operation.
      *
@@ -720,9 +727,9 @@ public class OperationsService extends Service {
         }
         if (count == 0) {
             //mOperationResults.put(operation.hashCode(), result);
-            Pair<RemoteOperation, RemoteOperationResult> undispatched = 
+            Pair<RemoteOperation, RemoteOperationResult> undispatched =
                     new Pair<RemoteOperation, RemoteOperationResult>(operation, result);
-            mUndispatchedFinishedOperations.put(operation.hashCode(), undispatched);
+            mUndispatchedFinishedOperations.put(((Runnable) operation).hashCode(), undispatched);
         }
         Log_OC.d(TAG, "Called " + count + " listeners");
     }
index f1508c2..1c21cab 100644 (file)
@@ -510,7 +510,7 @@ public class FileActivity extends AppCompatActivity
      */
     private void swapToDefaultAccount() {
         // default to the most recently used account
-        Account newAccount  = AccountUtils.getCurrentOwnCloudAccount(getApplicationContext());
+        Account newAccount = AccountUtils.getCurrentOwnCloudAccount(getApplicationContext());
         if (newAccount == null) {
             /// no account available: force account creation
             createFirstAccount();
@@ -602,7 +602,7 @@ public class FileActivity extends AppCompatActivity
     }
 
     /**
-     * @return  'True' when the Activity is finishing to enforce the setup of a new account.
+     * @return 'True' when the Activity is finishing to enforce the setup of a new account.
      */
     protected boolean isRedirectingToSetupAccount() {
         return mRedirectingToSetupAccount;
@@ -752,6 +752,7 @@ public class FileActivity extends AppCompatActivity
     }
 
 
+
     private void onCreateShareOperationFinish(CreateShareOperation operation,
                                               RemoteOperationResult result) {
         dismissLoadingDialog();
@@ -857,7 +858,7 @@ public class FileActivity extends AppCompatActivity
     /**
      * Dismiss loading dialog
      */
-    public void dismissLoadingDialog(){
+    public void dismissLoadingDialog() {
         Fragment frag = getSupportFragmentManager().findFragmentByTag(DIALOG_WAIT_TAG);
         if (frag != null) {
             LoadingDialog loading = (LoadingDialog) frag;
index 9c1d066..20bcdce 100644 (file)
@@ -77,6 +77,7 @@ import com.owncloud.android.lib.common.operations.RemoteOperation;
 import com.owncloud.android.lib.common.operations.RemoteOperationResult;
 import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
 import com.owncloud.android.lib.common.utils.Log_OC;
+import com.owncloud.android.operations.CopyFileOperation;
 import com.owncloud.android.operations.CreateFolderOperation;
 import com.owncloud.android.operations.CreateShareOperation;
 import com.owncloud.android.operations.MoveFileOperation;
@@ -98,6 +99,7 @@ import com.owncloud.android.ui.fragment.OCFileListFragment;
 import com.owncloud.android.ui.preview.PreviewImageActivity;
 import com.owncloud.android.ui.preview.PreviewImageFragment;
 import com.owncloud.android.ui.preview.PreviewMediaFragment;
+import com.owncloud.android.ui.preview.PreviewTextFragment;
 import com.owncloud.android.ui.preview.PreviewVideoActivity;
 import com.owncloud.android.utils.DisplayUtils;
 import com.owncloud.android.utils.ErrorMessageAdapter;
@@ -106,7 +108,6 @@ import com.owncloud.android.utils.UriUtils;
 
 import java.io.File;
 
-
 /**
  * Displays, what files the user has available in his ownCloud.
  */
@@ -115,6 +116,8 @@ public class FileDisplayActivity extends HookActivity
         implements FileFragment.ContainerActivity,
         OnSslUntrustedCertListener, OnEnforceableRefreshListener {
 
+
+
     private SyncBroadcastReceiver mSyncBroadcastReceiver;
     private UploadFinishReceiver mUploadFinishReceiver;
     private DownloadFinishReceiver mDownloadFinishReceiver;
@@ -134,6 +137,7 @@ public class FileDisplayActivity extends HookActivity
     public static final int ACTION_SELECT_CONTENT_FROM_APPS = 1;
     public static final int ACTION_SELECT_MULTIPLE_FILES = 2;
     public static final int ACTION_MOVE_FILES = 3;
+    public static final int ACTION_COPY_FILES = 4;
 
     private static final String TAG = FileDisplayActivity.class.getSimpleName();
 
@@ -141,7 +145,7 @@ public class FileDisplayActivity extends HookActivity
     private static final String TAG_SECOND_FRAGMENT = "SECOND_FRAGMENT";
 
     private OCFile mWaitingToPreview;
-    
+
     private boolean mSyncInProgress = false;
 
     private static String DIALOG_UNTRUSTED_CERT = "DIALOG_UNTRUSTED_CERT";
@@ -164,7 +168,7 @@ public class FileDisplayActivity extends HookActivity
             Intent initObserversIntent = FileObserverService.makeInitIntent(this);
             startService(initObserversIntent);
         }
-        
+
         /// Load of saved instance state
         if(savedInstanceState != null) {
             mWaitingToPreview = (OCFile) savedInstanceState.getParcelable(
@@ -172,18 +176,17 @@ public class FileDisplayActivity extends HookActivity
             mSyncInProgress = savedInstanceState.getBoolean(KEY_SYNC_IN_PROGRESS);
             mWaitingToSend = (OCFile) savedInstanceState.getParcelable(
                     FileDisplayActivity.KEY_WAITING_TO_SEND);
-           
         } else {
             mWaitingToPreview = null;
             mSyncInProgress = false;
             mWaitingToSend = null;
-        }        
+        }
 
         /// USER INTERFACE
 
         // Inflate and set the layout view
         setContentView(R.layout.files);
-        
+
         // Navigation Drawer
         initDrawer();
 
@@ -210,7 +213,7 @@ public class FileDisplayActivity extends HookActivity
 
         mProgressBar.setIndeterminate(mSyncInProgress);
         // always AFTER setContentView(...) ; to work around bug in its implementation
-        
+
         setBackgroundText();
 
         Log_OC.v(TAG, "onCreate() end");
@@ -231,8 +234,8 @@ public class FileDisplayActivity extends HookActivity
     }
 
     /**
-     *  Called when the ownCloud {@link Account} associated to the Activity was just updated.
-     */ 
+     * Called when the ownCloud {@link Account} associated to the Activity was just updated.
+     */
     @Override
     protected void onAccountSet(boolean stateWasRecovered) {
         super.onAccountSet(stateWasRecovered);
@@ -276,7 +279,7 @@ public class FileDisplayActivity extends HookActivity
                 if (file.isFolder()) {
                     startSyncFolderOperation(file, false);
                 }
-                
+
             } else {
                 updateFragmentsVisibility(!file.isFolder());
                 updateActionBarTitleAndHomeButton(file.isFolder() ? null : file);
@@ -284,36 +287,38 @@ public class FileDisplayActivity extends HookActivity
         }
     }
 
-
     private void createMinFragments() {
         OCFileListFragment listOfFiles = new OCFileListFragment();
         FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
         transaction.add(R.id.left_fragment_container, listOfFiles, TAG_LIST_OF_FILES);
         transaction.commit();
     }
-    
+
     private void initFragmentsWithFile() {
         if (getAccount() != null && getFile() != null) {
             /// First fragment
-            OCFileListFragment listOfFiles = getListOfFilesFragment(); 
+            OCFileListFragment listOfFiles = getListOfFilesFragment();
             if (listOfFiles != null) {
                 listOfFiles.listDirectory(getCurrentDir());
                 // TODO Enable when "On Device" is recovered
                 // listOfFiles.listDirectory(getCurrentDir(), MainApp.getOnlyOnDevice());
+
             } else {
                 Log_OC.e(TAG, "Still have a chance to lose the initializacion of list fragment >(");
             }
-            
+
             /// Second fragment
-            OCFile file = getFile(); 
+            OCFile file = getFile();
             Fragment secondFragment = chooseInitialSecondFragment(file);
             if (secondFragment != null) {
                 setSecondFragment(secondFragment);
                 updateFragmentsVisibility(true);
                 updateActionBarTitleAndHomeButton(file);
-                
+
             } else {
                 cleanSecondFragment();
+                if (file.isDown() && PreviewTextFragment.canBePreviewed(file))
+                    startTextPreview(file);
             }
 
         } else {
@@ -330,7 +335,7 @@ public class FileDisplayActivity extends HookActivity
     private Fragment chooseInitialSecondFragment(OCFile file) {
         Fragment secondFragment = null;
         if (file != null && !file.isFolder()) {
-            if (file.isDown() && PreviewMediaFragment.canBePreviewed(file) 
+            if (file.isDown() && PreviewMediaFragment.canBePreviewed(file)
                     && file.getLastSyncDateForProperties() > 0  // temporal fix
                     ) {
                 int startPlaybackPosition =
@@ -340,9 +345,11 @@ public class FileDisplayActivity extends HookActivity
                 secondFragment = new PreviewMediaFragment(file, getAccount(),
                         startPlaybackPosition, autoplay);
 
+            } else if (file.isDown() && PreviewTextFragment.canBePreviewed(file)) {
+                secondFragment = null;
             } else {
-                secondFragment = FileDetailFragment.newInstance(file, getAccount());
-            }
+            secondFragment = FileDetailFragment.newInstance(file, getAccount());
+        }
         }
         return secondFragment;
     }
@@ -351,10 +358,10 @@ public class FileDisplayActivity extends HookActivity
     /**
      * Replaces the second fragment managed by the activity with the received as
      * a parameter.
-     * 
-     * Assumes never will be more than two fragments managed at the same time. 
-     * 
-     * @param fragment      New second Fragment to set.
+     * <p/>
+     * Assumes never will be more than two fragments managed at the same time.
+     *
+     * @param fragment New second Fragment to set.
      */
     private void setSecondFragment(Fragment fragment) {
         FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
@@ -395,7 +402,7 @@ public class FileDisplayActivity extends HookActivity
         Fragment listOfFiles = getSupportFragmentManager().findFragmentByTag(
                 FileDisplayActivity.TAG_LIST_OF_FILES);
         if (listOfFiles != null) {
-            return (OCFileListFragment)listOfFiles;
+            return (OCFileListFragment) listOfFiles;
         }
         Log_OC.wtf(TAG, "Access to unexisting list of files fragment!!");
         return null;
@@ -405,7 +412,7 @@ public class FileDisplayActivity extends HookActivity
         Fragment second = getSupportFragmentManager().findFragmentByTag(
                 FileDisplayActivity.TAG_SECOND_FRAGMENT);
         if (second != null) {
-            return (FileFragment)second;
+            return (FileFragment) second;
         }
         return null;
     }
@@ -459,6 +466,9 @@ public class FileDisplayActivity extends HookActivity
                         if (PreviewMediaFragment.canBePreviewed(mWaitingToPreview)) {
                             startMediaPreview(mWaitingToPreview, 0, true);
                             detailsFragmentChanged = true;
+                        } else if (PreviewTextFragment.canBePreviewed(mWaitingToPreview)) {
+                            startTextPreview(mWaitingToPreview);
+                            detailsFragmentChanged = true;
                         } else {
                             getFileOperationsHelper().openFile(mWaitingToPreview);
                         }
@@ -501,6 +511,7 @@ public class FileDisplayActivity extends HookActivity
                 dialog.show(getSupportFragmentManager(), DIALOG_CREATE_FOLDER);
                 break;
             }
+
             case R.id.action_sync_account: {
                 startSynchronization();
                 break;
@@ -509,7 +520,6 @@ public class FileDisplayActivity extends HookActivity
                 UploadSourceDialogFragment dialog =
                         UploadSourceDialogFragment.newInstance(getAccount());
                 dialog.show(getSupportFragmentManager(), DIALOG_UPLOAD_SOURCE);
-
                 break;
             }
             case android.R.id.home: {
@@ -617,17 +627,30 @@ public class FileDisplayActivity extends HookActivity
             requestMultipleUpload(data, resultCode);
 
         } else if (requestCode == ACTION_MOVE_FILES && resultCode == RESULT_OK){
+            final Intent fData = data;
+            final int fResultCode = resultCode;
+            getHandler().postDelayed(
+                    new Runnable() {
+                        @Override
+                        public void run() {
+                            requestMoveOperation(fData, fResultCode);
+                        }
+                    },
+                    DELAY_TO_REQUEST_OPERATION_ON_ACTIVITY_RESULTS
+            );
+
+        } else if (requestCode == ACTION_COPY_FILES && resultCode == RESULT_OK) {
 
             final Intent fData = data;
-            final int fResultCode = resultCode; 
+            final int fResultCode = resultCode;
             getHandler().postDelayed(
-                new Runnable() {
-                    @Override
-                    public void run() {
-                        requestMoveOperation(fData, fResultCode);
-                    }
-                }, 
-                DELAY_TO_REQUEST_OPERATION_ON_ACTIVITY_RESULTS
+                    new Runnable() {
+                        @Override
+                        public void run() {
+                            requestCopyOperation(fData, fResultCode);
+                        }
+                    },
+                    DELAY_TO_REQUEST_OPERATION_ON_ACTIVITY_RESULTS
             );
 
         } else {
@@ -735,9 +758,9 @@ public class FileDisplayActivity extends HookActivity
 
     /**
      * Request the operation for moving the file/folder from one path to another
-     * 
-     * @param data              Intent received
-     * @param resultCode        Result code received
+     *
+     * @param data       Intent received
+     * @param resultCode Result code received
      */
     private void requestMoveOperation(Intent data, int resultCode) {
         OCFile folderToMoveAt = (OCFile) data.getParcelableExtra(FolderPickerActivity.EXTRA_FOLDER);
@@ -745,6 +768,18 @@ public class FileDisplayActivity extends HookActivity
         getFileOperationsHelper().moveFile(folderToMoveAt, targetFile);
     }
 
+    /**
+     * Request the operation for copying the file/folder from one path to another
+     *
+     * @param data       Intent received
+     * @param resultCode Result code received
+     */
+    private void requestCopyOperation(Intent data, int resultCode) {
+        OCFile folderToMoveAt = data.getParcelableExtra(FolderPickerActivity.EXTRA_FOLDER);
+        OCFile targetFile = data.getParcelableExtra(FolderPickerActivity.EXTRA_FILE);
+        getFileOperationsHelper().copyFile(folderToMoveAt, targetFile);
+    }
+
     @Override
     public void onBackPressed() {
         if (!isDrawerOpen()){
@@ -782,18 +817,15 @@ public class FileDisplayActivity extends HookActivity
 
         Log_OC.v(TAG, "onSaveInstanceState() end");
     }
-    
 
 
     @Override
     protected void onResume() {
         Log_OC.v(TAG, "onResume() start");
         super.onResume();
-
         // refresh Navigation Drawer account list
         mNavigationDrawerAdapter.updateAccountList();
 
-
         // refresh list of files
         refreshListOfFilesFragment();
 
@@ -819,8 +851,9 @@ public class FileDisplayActivity extends HookActivity
         downloadIntentFilter.addAction(FileDownloader.getDownloadFinishMessage());
         mDownloadFinishReceiver = new DownloadFinishReceiver();
         registerReceiver(mDownloadFinishReceiver, downloadIntentFilter);
-        
+
         Log_OC.v(TAG, "onResume() end");
+
     }
 
 
@@ -840,7 +873,7 @@ public class FileDisplayActivity extends HookActivity
             unregisterReceiver(mDownloadFinishReceiver);
             mDownloadFinishReceiver = null;
         }
-        
+
         super.onPause();
         Log_OC.v(TAG, "onPause() end");
     }
@@ -864,12 +897,12 @@ public class FileDisplayActivity extends HookActivity
                                 FileSyncAdapter.EXTRA_RESULT);
                 boolean sameAccount = (getAccount() != null &&
                         accountName.equals(getAccount().name) && getStorageManager() != null);
-    
+
                 if (sameAccount) {
-                    
+
                     if (FileSyncAdapter.EVENT_FULL_SYNC_START.equals(event)) {
                         mSyncInProgress = true;
-                        
+
                     } else {
                         OCFile currentFile = (getFile() == null) ? null :
                                 getStorageManager().getFileByPath(getFile().getRemotePath());
@@ -885,8 +918,9 @@ public class FileDisplayActivity extends HookActivity
                                                    synchFolderRemotePath),
                                             Toast.LENGTH_LONG)
                                 .show();
+
                             browseToRoot();
-                            
+
                         } else {
                             if (currentFile == null && !getFile().isFolder()) {
                                 // currently selected file was removed in the server, and now we
@@ -907,19 +941,19 @@ public class FileDisplayActivity extends HookActivity
                             }
                             setFile(currentFile);
                         }
-                        
+
                         mSyncInProgress = (!FileSyncAdapter.EVENT_FULL_SYNC_END.equals(event) &&
                                 !RefreshFolderOperation.EVENT_SINGLE_FOLDER_SHARES_SYNCED
                                         .equals(event));
                                 
                         if (RefreshFolderOperation.EVENT_SINGLE_FOLDER_CONTENTS_SYNCED.
-                                    equals(event) &&
-                                /// TODO refactor and make common
-                                synchResult != null && !synchResult.isSuccess() &&  
-                                (synchResult.getCode() == ResultCode.UNAUTHORIZED   || 
-                                    synchResult.isIdPRedirection()                  ||
-                                    (synchResult.isException() && synchResult.getException() 
-                                            instanceof AuthenticatorException))) {
+                                    equals(event) &&/// TODO refactor and make common
+
+                                synchResult != null && !synchResult.isSuccess() &&
+                                (synchResult.getCode() == ResultCode.UNAUTHORIZED ||
+                                        synchResult.isIdPRedirection() ||
+                                        (synchResult.isException() && synchResult.getException()
+                                                instanceof AuthenticatorException))) {
 
 
                             try {
@@ -928,7 +962,6 @@ public class FileDisplayActivity extends HookActivity
                                         new OwnCloudAccount(getAccount(), context);
                                 client = (OwnCloudClientManagerFactory.getDefaultSingleton().
                                         removeClientFor(ocAccount));
-
                                 if (client != null) {
                                     OwnCloudCredentials cred = client.getCredentials();
                                     if (cred != null) {
@@ -959,9 +992,9 @@ public class FileDisplayActivity extends HookActivity
                     /*|| mRefreshSharesInProgress*/ //);
 
                     setBackgroundText();
-                        
+
                 }
-                
+
                 if (synchResult != null) {
                     if (synchResult.getCode().equals(
                             RemoteOperationResult.ResultCode.SSL_RECOVERABLE_PEER_UNVERIFIED)) {
@@ -975,7 +1008,7 @@ public class FileDisplayActivity extends HookActivity
             }
         }
     }
-    
+
     /**
      * Show a text message on screen view for notifying user if content is
      * loading or folder is empty
@@ -1000,7 +1033,8 @@ public class FileDisplayActivity extends HookActivity
     private class UploadFinishReceiver extends BroadcastReceiver {
         /**
          * Once the file upload has finished -> update view
-         *  @author David A. Velasco
+         *
+         * @author David A. Velasco
          * {@link BroadcastReceiver} to enable upload feedback in UI
          */
         @Override
@@ -1010,23 +1044,23 @@ public class FileDisplayActivity extends HookActivity
                 String accountName = intent.getStringExtra(FileUploader.ACCOUNT_NAME);
                 boolean sameAccount = getAccount() != null && accountName.equals(getAccount().name);
                 OCFile currentDir = getCurrentDir();
-                boolean isDescendant = (currentDir != null) && (uploadedRemotePath != null) && 
+                boolean isDescendant = (currentDir != null) && (uploadedRemotePath != null) &&
                         (uploadedRemotePath.startsWith(currentDir.getRemotePath()));
-                
+
                 if (sameAccount && isDescendant) {
                     refreshListOfFilesFragment();
                 }
-                
+
                 boolean uploadWasFine = intent.getBooleanExtra(FileUploader.EXTRA_UPLOAD_RESULT,
                         false);
                 boolean renamedInUpload = getFile().getRemotePath().
                         equals(intent.getStringExtra(FileUploader.EXTRA_OLD_REMOTE_PATH));
-                boolean sameFile = getFile().getRemotePath().equals(uploadedRemotePath) || 
+                boolean sameFile = getFile().getRemotePath().equals(uploadedRemotePath) ||
                         renamedInUpload;
                 FileFragment details = getSecondFragment();
-                boolean detailFragmentIsShown = (details != null && 
+                boolean detailFragmentIsShown = (details != null &&
                         details instanceof FileDetailFragment);
-                
+
                 if (sameAccount && sameFile && detailFragmentIsShown) {
                     if (uploadWasFine) {
                         setFile(getStorageManager().getFileByPath(uploadedRemotePath));
@@ -1034,23 +1068,28 @@ public class FileDisplayActivity extends HookActivity
                     if (renamedInUpload) {
                         String newName = (new File(uploadedRemotePath)).getName();
                         Toast msg = Toast.makeText(
-                                context, 
+                                context,
                                 String.format(
-                                        getString(R.string.filedetails_renamed_in_upload_msg), 
-                                        newName), 
+                                        getString(R.string.filedetails_renamed_in_upload_msg),
+                                        newName),
                                 Toast.LENGTH_LONG);
                         msg.show();
                     }
                     if (uploadWasFine || getFile().fileExists()) {
-                        ((FileDetailFragment)details).updateFileDetails(false, true);
+                        ((FileDetailFragment) details).updateFileDetails(false, true);
                     } else {
                         cleanSecondFragment();
                     }
-                    
-                    // Force the preview if the file is an image
-                    if (uploadWasFine && PreviewImageFragment.canBePreviewed(getFile())) {
-                        startImagePreview(getFile());
-                    } // TODO what about other kind of previews?
+
+                    // Force the preview if the file is an image or text file
+                    if (uploadWasFine) {
+                        OCFile ocFile = getFile();
+                        if (PreviewImageFragment.canBePreviewed(ocFile))
+                            startImagePreview(getFile());
+                        else if (PreviewTextFragment.canBePreviewed(ocFile))
+                            startTextPreview(ocFile);
+                        // TODO what about other kind of previews?
+                    }
                 }
 
                 mProgressBar.setIndeterminate(false);
@@ -1059,15 +1098,15 @@ public class FileDisplayActivity extends HookActivity
                     removeStickyBroadcast(intent);
                 }
             }
-            
+
         }
-        
+
     }
 
 
     /**
      * Class waiting for broadcast events from the {@link FileDownloader} service.
-     * 
+     *
      * Updates the UI when a download is started or finished, provided that it is relevant for the
      * current folder.
      */
@@ -1095,15 +1134,15 @@ public class FileDisplayActivity extends HookActivity
                             intent.getBooleanExtra(FileDownloader.EXTRA_DOWNLOAD_RESULT, false)
                     );
                 }
-    
+
                 if (mWaitingToSend != null) {
                     mWaitingToSend =
                             getStorageManager().getFileByPath(mWaitingToSend.getRemotePath());
-                    if (mWaitingToSend.isDown()) { 
+                    if (mWaitingToSend.isDown()) {
                         sendDownloadedFile();
                     }
                 }
-            
+
             } finally {
                 if (intent != null) {
                     removeStickyBroadcast(intent);
@@ -1134,10 +1173,10 @@ public class FileDisplayActivity extends HookActivity
                     accountName.equals(getAccount().name));
         }
     }
-    
-    
+
+
     public void browseToRoot() {
-        OCFileListFragment listOfFiles = getListOfFilesFragment(); 
+        OCFileListFragment listOfFiles = getListOfFilesFragment();
         if (listOfFiles != null) {  // should never be null, indeed
             OCFile root = getStorageManager().getFileByPath(OCFile.ROOT_PATH);
             listOfFiles.listDirectory(root);
@@ -1147,13 +1186,12 @@ public class FileDisplayActivity extends HookActivity
             startSyncFolderOperation(root, false);
         }
         cleanSecondFragment();
-
     }
 
 
     /**
      * {@inheritDoc}
-     * 
+     * <p/>
      * Updates action bar and second fragment, if in dual pane mode.
      */
     @Override
@@ -1165,10 +1203,10 @@ public class FileDisplayActivity extends HookActivity
     }
 
     /**
-     * Shows the information of the {@link OCFile} received as a 
+     * Shows the information of the {@link OCFile} received as a
      * parameter in the second fragment.
-     * 
-     * @param file          {@link OCFile} whose details will be shown
+     *
+     * @param file {@link OCFile} whose details will be shown
      */
     @Override
     public void showDetails(OCFile file) {
@@ -1196,7 +1234,9 @@ public class FileDisplayActivity extends HookActivity
         return new ListServiceConnection();
     }
 
-    /** Defines callbacks for service binding, passed to bindService() */
+    /**
+     * Defines callbacks for service binding, passed to bindService()
+     */
     private class ListServiceConnection implements ServiceConnection {
 
         @Override
@@ -1213,7 +1253,7 @@ public class FileDisplayActivity extends HookActivity
                         if (!mWaitingToPreview.isDown()) {
                             requestForDownload();
                         }
-                }
+                    }
 
             } else if (component.equals(new ComponentName(FileDisplayActivity.this,
                     FileUploader.class))) {
@@ -1224,7 +1264,7 @@ public class FileDisplayActivity extends HookActivity
             }
             // a new chance to get the mDownloadBinder through
             // getFileDownloadBinder() - THIS IS A MESS
-            OCFileListFragment listOfFiles = getListOfFilesFragment(); 
+            OCFileListFragment listOfFiles = getListOfFilesFragment();
             if (listOfFiles != null) {
                 listOfFiles.listDirectory();
                 // TODO Enable when "On Device" is recovered ?
@@ -1232,7 +1272,7 @@ public class FileDisplayActivity extends HookActivity
             }
             FileFragment secondFragment = getSecondFragment();
             if (secondFragment != null && secondFragment instanceof FileDetailFragment) {
-                FileDetailFragment detailFragment = (FileDetailFragment)secondFragment;
+                FileDetailFragment detailFragment = (FileDetailFragment) secondFragment;
                 detailFragment.listenForTransferProgress();
                 detailFragment.updateFileDetails(false, false);
             }
@@ -1250,7 +1290,7 @@ public class FileDisplayActivity extends HookActivity
                 mUploaderBinder = null;
             }
         }
-    };    
+    }
 
     @Override
     public void onSavedCertificate() {
@@ -1274,39 +1314,40 @@ public class FileDisplayActivity extends HookActivity
     /**
      * Updates the view associated to the activity after the finish of some operation over files
      * in the current account.
-     * 
-     * @param operation     Removal operation performed.
-     * @param result        Result of the removal.
+     *
+     * @param operation Removal operation performed.
+     * @param result    Result of the removal.
      */
     @Override
     public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result) {
         super.onRemoteOperationFinish(operation, result);
-        
+
         if (operation instanceof RemoveFileOperation) {
             onRemoveFileOperationFinish((RemoveFileOperation) operation, result);
 
         } else if (operation instanceof RenameFileOperation) {
-            onRenameFileOperationFinish((RenameFileOperation)operation, result);
+            onRenameFileOperationFinish((RenameFileOperation) operation, result);
 
         } else if (operation instanceof SynchronizeFileOperation) {
-            onSynchronizeFileOperationFinish((SynchronizeFileOperation)operation, result);
+            onSynchronizeFileOperationFinish((SynchronizeFileOperation) operation, result);
 
         } else if (operation instanceof CreateFolderOperation) {
-            onCreateFolderOperationFinish((CreateFolderOperation)operation, result);
-            
+            onCreateFolderOperationFinish((CreateFolderOperation) operation, result);
+
         } else if (operation instanceof CreateShareOperation) {
             onCreateShareOperationFinish((CreateShareOperation) operation, result);
-            
+
         } else if (operation instanceof UnshareLinkOperation) {
-            onUnshareLinkOperationFinish((UnshareLinkOperation)operation, result);
-        
+            onUnshareLinkOperationFinish((UnshareLinkOperation) operation, result);
+
         } else if (operation instanceof MoveFileOperation) {
-            onMoveFileOperationFinish((MoveFileOperation)operation, result);
+            onMoveFileOperationFinish((MoveFileOperation) operation, result);
+
+        } else if (operation instanceof CopyFileOperation) {
+            onCopyFileOperationFinish((CopyFileOperation) operation, result);
         }
-        
-    }
 
-    
+    }
     private void onCreateShareOperationFinish(CreateShareOperation operation,
                                               RemoteOperationResult result) {
         if (result.isSuccess()) {
@@ -1315,36 +1356,38 @@ public class FileDisplayActivity extends HookActivity
         }
     }
 
-    
     private void onUnshareLinkOperationFinish(UnshareLinkOperation operation,
                                               RemoteOperationResult result) {
         if (result.isSuccess()) {
             refreshShowDetails();
             refreshListOfFilesFragment();
-            
+
         } else if (result.getCode() == ResultCode.SHARE_NOT_FOUND) {
             cleanSecondFragment();
             refreshListOfFilesFragment();
         }
     }
-    
+
     private void refreshShowDetails() {
         FileFragment details = getSecondFragment();
         if (details != null) {
             OCFile file = details.getFile();
             if (file != null) {
-                file = getStorageManager().getFileByPath(file.getRemotePath()); 
+                file = getStorageManager().getFileByPath(file.getRemotePath());
                 if (details instanceof PreviewMediaFragment) {
                     // Refresh  OCFile of the fragment
                     ((PreviewMediaFragment) details).updateFile(file);
+                } else if (details instanceof PreviewTextFragment) {
+                    // Refresh  OCFile of the fragment
+                    ((PreviewTextFragment) details).updateFile(file);
                 } else {
                     showDetails(file);
-                } 
+                }
             }
             invalidateOptionsMenu();
-        } 
+        }
     }
-    
+
     /**
      * Updates the view associated to the activity after the finish of an operation trying to
      * remove a file.
@@ -1355,23 +1398,23 @@ public class FileDisplayActivity extends HookActivity
     private void onRemoveFileOperationFinish(RemoveFileOperation operation,
                                              RemoteOperationResult result) {
         dismissLoadingDialog();
-        
+
         Toast msg = Toast.makeText(this,
                 ErrorMessageAdapter.getErrorCauseMessage(result, operation, getResources()),
-                Toast.LENGTH_LONG); 
+                Toast.LENGTH_LONG);
         msg.show();
-        
+
         if (result.isSuccess()) {
             OCFile removedFile = operation.getFile();
             FileFragment second = getSecondFragment();
             if (second != null && removedFile.equals(second.getFile())) {
                 if (second instanceof PreviewMediaFragment) {
-                    ((PreviewMediaFragment)second).stopPreview(true);
+                    ((PreviewMediaFragment) second).stopPreview(true);
                 }
                 setFile(getStorageManager().getFileById(removedFile.getParentId()));
                 cleanSecondFragment();
             }
-            if (getStorageManager().getFileById(removedFile.getParentId()).equals(getCurrentDir())) {
+            if (getStorageManager().getFileById(removedFile.getParentId()).equals(getCurrentDir())){
                 refreshListOfFilesFragment();
             }
             invalidateOptionsMenu();
@@ -1382,14 +1425,14 @@ public class FileDisplayActivity extends HookActivity
             }
         }
     }
-    
-    
+
+
     /**
-     * Updates the view associated to the activity after the finish of an operation trying to move a 
+     * Updates the view associated to the activity after the finish of an operation trying to move a
      * file.
-     * 
-     * @param operation     Move operation performed.
-     * @param result        Result of the move operation.
+     *
+     * @param operation Move operation performed.
+     * @param result    Result of the move operation.
      */
     private void onMoveFileOperationFinish(MoveFileOperation operation,
                                            RemoteOperationResult result) {
@@ -1399,17 +1442,41 @@ public class FileDisplayActivity extends HookActivity
         } else {
             dismissLoadingDialog();
             try {
-                Toast msg = Toast.makeText(FileDisplayActivity.this, 
-                        ErrorMessageAdapter.getErrorCauseMessage(result, operation, getResources()), 
-                        Toast.LENGTH_LONG); 
+                Toast msg = Toast.makeText(FileDisplayActivity.this,
+                        ErrorMessageAdapter.getErrorCauseMessage(result, operation, getResources()),
+                        Toast.LENGTH_LONG);
                 msg.show();
 
             } catch (NotFoundException e) {
-                Log_OC.e(TAG, "Error while trying to show fail message " , e);
+                Log_OC.e(TAG, "Error while trying to show fail message ", e);
             }
         }
     }
 
+    /**
+     * Updates the view associated to the activity after the finish of an operation trying to copy a
+     * file.
+     *
+     * @param operation Copy operation performed.
+     * @param result    Result of the copy operation.
+     */
+    private void onCopyFileOperationFinish(CopyFileOperation operation, RemoteOperationResult result) {
+        if (result.isSuccess()) {
+            dismissLoadingDialog();
+            refreshListOfFilesFragment();
+        } else {
+            dismissLoadingDialog();
+            try {
+                Toast msg = Toast.makeText(FileDisplayActivity.this,
+                        ErrorMessageAdapter.getErrorCauseMessage(result, operation, getResources()),
+                        Toast.LENGTH_LONG);
+                msg.show();
+
+            } catch (NotFoundException e) {
+                Log_OC.e(TAG, "Error while trying to show fail message ", e);
+            }
+        }
+    }
 
     /**
      * Updates the view associated to the activity after the finish of an operation trying to rename
@@ -1434,14 +1501,22 @@ public class FileDisplayActivity extends HookActivity
                         renamedFile.equals(details.getFile())) {
                     ((PreviewMediaFragment) details).updateFile(renamedFile);
                     if (PreviewMediaFragment.canBePreviewed(renamedFile)) {
-                        int position = ((PreviewMediaFragment)details).getPosition();
+                        int position = ((PreviewMediaFragment) details).getPosition();
                         startMediaPreview(renamedFile, position, true);
                     } else {
                         getFileOperationsHelper().openFile(renamedFile);
                     }
+                } else if (details instanceof PreviewTextFragment &&
+                        renamedFile.equals(details.getFile())) {
+                    ((PreviewTextFragment) details).updateFile(renamedFile);
+                    if (PreviewTextFragment.canBePreviewed(renamedFile)) {
+                        startTextPreview(renamedFile);
+                    } else {
+                        getFileOperationsHelper().openFile(renamedFile);
+                    }
                 }
             }
-            
+
             if (getStorageManager().getFileById(renamedFile.getParentId()).equals(getCurrentDir())){
                 refreshListOfFilesFragment();
             }
@@ -1449,9 +1524,9 @@ public class FileDisplayActivity extends HookActivity
         } else {
             Toast msg = Toast.makeText(this,
                     ErrorMessageAdapter.getErrorCauseMessage(result, operation, getResources()),
-                    Toast.LENGTH_LONG); 
+                    Toast.LENGTH_LONG);
             msg.show();
-            
+
             if (result.isSslRecoverableException()) {
                 mLastSslUntrustedServerResult = result;
                 showUntrustedCertDialog(mLastSslUntrustedServerResult);
@@ -1485,18 +1560,18 @@ public class FileDisplayActivity extends HookActivity
         } else {
             dismissLoadingDialog();
             try {
-                Toast msg = Toast.makeText(FileDisplayActivity.this, 
-                        ErrorMessageAdapter.getErrorCauseMessage(result, operation, getResources()), 
-                        Toast.LENGTH_LONG); 
+                Toast msg = Toast.makeText(FileDisplayActivity.this,
+                        ErrorMessageAdapter.getErrorCauseMessage(result, operation, getResources()),
+                        Toast.LENGTH_LONG);
                 msg.show();
 
             } catch (NotFoundException e) {
-                Log_OC.e(TAG, "Error while trying to show fail message " , e);
+                Log_OC.e(TAG, "Error while trying to show fail message ", e);
             }
         }
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -1507,16 +1582,16 @@ public class FileDisplayActivity extends HookActivity
         if (details != null && details instanceof FileDetailFragment &&
                 file.equals(details.getFile()) ) {
             if (downloading || uploading) {
-                ((FileDetailFragment)details).updateFileDetails(file, getAccount());
+                ((FileDetailFragment) details).updateFileDetails(file, getAccount());
             } else {
                 if (!file.fileExists()) {
                     cleanSecondFragment();
                 } else {
-                    ((FileDetailFragment)details).updateFileDetails(false, true);
+                    ((FileDetailFragment) details).updateFileDetails(false, true);
                 }
             }
         }
-            
+
     }
 
 
@@ -1545,12 +1620,12 @@ public class FileDisplayActivity extends HookActivity
         }
         return null;
     }
-    
+
     public void startSyncFolderOperation(OCFile folder, boolean ignoreETag) {
-        long currentSyncTime = System.currentTimeMillis(); 
-        
+        long currentSyncTime = System.currentTimeMillis();
+
         mSyncInProgress = true;
-                
+
         // perform folder synchronization
         RemoteOperation synchFolderOp = new RefreshFolderOperation( folder,
                 currentSyncTime,
@@ -1562,13 +1637,14 @@ public class FileDisplayActivity extends HookActivity
                 getApplicationContext()
         );
         synchFolderOp.execute(getAccount(), MainApp.getAppContext(), this, null, null);
+
         mProgressBar.setIndeterminate(true);
 
         setBackgroundText();
     }
 
     /**
-     * Show untrusted cert dialog 
+     * Show untrusted cert dialog
      */
     public void showUntrustedCertDialog(RemoteOperationResult result) {
         // Show a dialog with the certificate info
@@ -1578,7 +1654,7 @@ public class FileDisplayActivity extends HookActivity
         FragmentTransaction ft = fm.beginTransaction();
         dialog.show(ft, DIALOG_UNTRUSTED_CERT);
     }
-    
+
     private void requestForDownload(OCFile file) {
         Account account = getAccount();
         if (!mDownloaderBinder.isDownloading(account, mWaitingToPreview)) {
@@ -1588,43 +1664,42 @@ public class FileDisplayActivity extends HookActivity
             startService(i);
         }
     }
-    
-    private void sendDownloadedFile(){
+
+    private void sendDownloadedFile() {
         getFileOperationsHelper().sendDownloadedFile(mWaitingToSend);
         mWaitingToSend = null;
     }
 
-    
+
     /**
      * Requests the download of the received {@link OCFile} , updates the UI
      * to monitor the download progress and prepares the activity to send the file
      * when the download finishes.
-     * 
-     * @param file          {@link OCFile} to download and preview.
+     *
+     * @param file {@link OCFile} to download and preview.
      */
     public void startDownloadForSending(OCFile file) {
         mWaitingToSend = file;
         requestForDownload(mWaitingToSend);
-        boolean hasSecondFragment = (getSecondFragment()!= null);
+        boolean hasSecondFragment = (getSecondFragment() != null);
         updateFragmentsVisibility(hasSecondFragment);
     }
-    
+
     /**
      * Opens the image gallery showing the image {@link OCFile} received as parameter.
-     * 
-     * @param file                      Image {@link OCFile} to show.
+     *
+     * @param file Image {@link OCFile} to show.
      */
     public void startImagePreview(OCFile file) {
         Intent showDetailsIntent = new Intent(this, PreviewImageActivity.class);
         showDetailsIntent.putExtra(EXTRA_FILE, file);
         showDetailsIntent.putExtra(EXTRA_ACCOUNT, getAccount());
         startActivity(showDetailsIntent);
-        
     }
 
     /**
      * Stars the preview of an already down media {@link OCFile}.
-     * 
+     *
      * @param file                      Media {@link OCFile} to preview.
      * @param startPlaybackPosition     Media position where the playback will be started,
      *                                  in milliseconds.
@@ -1641,11 +1716,28 @@ public class FileDisplayActivity extends HookActivity
     }
 
     /**
+     * Stars the preview of a text file {@link OCFile}.
+     *
+     * @param file Text {@link OCFile} to preview.
+     */
+    public void startTextPreview(OCFile file) {
+        Bundle args = new Bundle();
+        args.putParcelable(EXTRA_FILE, file);
+        args.putParcelable(EXTRA_ACCOUNT, getAccount());
+        Fragment textPreviewFragment = Fragment.instantiate(getApplicationContext(),
+                PreviewTextFragment.class.getName(), args);
+        setSecondFragment(textPreviewFragment);
+        updateFragmentsVisibility(true);
+        //updateNavigationElementsInActionBar(file);
+        setFile(file);
+    }
+
+    /**
      * Requests the download of the received {@link OCFile} , updates the UI
      * to monitor the download progress and prepares the activity to preview
      * or open the file when the download finishes.
-     * 
-     * @param file          {@link OCFile} to download and preview.
+     *
+     * @param file {@link OCFile} to download and preview.
      */
     public void startDownloadForPreview(OCFile file) {
         Fragment detailFragment = FileDetailFragment.newInstance(file, getAccount());
@@ -1660,7 +1752,7 @@ public class FileDisplayActivity extends HookActivity
 
     public void cancelTransference(OCFile file) {
         getFileOperationsHelper().cancelTransference(file);
-        if (mWaitingToPreview != null && 
+        if (mWaitingToPreview != null &&
                 mWaitingToPreview.getRemotePath().equals(file.getRemotePath())) {
             mWaitingToPreview = null;
         }
@@ -1693,15 +1785,15 @@ public class FileDisplayActivity extends HookActivity
         }
     }
 
-    private void sortByDate(boolean ascending){
+    private void sortByDate(boolean ascending) {
         getListOfFilesFragment().sortByDate(ascending);
     }
 
-    private void sortBySize(boolean ascending){
+    private void sortBySize(boolean ascending) {
         getListOfFilesFragment().sortBySize(ascending);
     }
 
-    private void sortByName(boolean ascending){
+    private void sortByName(boolean ascending) {
         getListOfFilesFragment().sortByName(ascending);
     }
 
index 7bea4bb..d221bc9 100644 (file)
@@ -57,6 +57,8 @@ import android.support.v4.app.Fragment;
 import android.support.v4.app.FragmentManager;
 import android.support.v4.app.FragmentTransaction;
 import android.support.v7.app.ActionBar;
+import android.view.Menu;
+import android.view.MenuInflater;
 import android.view.MenuItem;
 import android.view.View;
 import android.widget.AdapterView;
@@ -361,9 +363,8 @@ public class Uploader extends FileActivity
 
             break;
             
-        case R.id.uploader_new_folder:
-            CreateFolderDialogFragment dialog = CreateFolderDialogFragment.newInstance(mFile);
-            dialog.show(getSupportFragmentManager(), "createdirdialog");
+        case R.id.uploader_cancel:
+            finish();
             break;
             
             
@@ -437,7 +438,7 @@ public class Uploader extends FileActivity
             Button btnChooseFolder = (Button) findViewById(R.id.uploader_choose_folder);
             btnChooseFolder.setOnClickListener(this);
             
-            Button btnNewFolder = (Button) findViewById(R.id.uploader_new_folder);
+            Button btnNewFolder = (Button) findViewById(R.id.uploader_cancel);
             btnNewFolder.setOnClickListener(this);
             
             mListView.setOnItemClickListener(this);
@@ -653,11 +654,26 @@ public class Uploader extends FileActivity
         }
     }
 
+    @Override
+    public boolean onCreateOptionsMenu(Menu menu) {
+        MenuInflater inflater = getMenuInflater();
+        inflater.inflate(R.menu.main_menu, menu);
+        menu.findItem(R.id.action_upload).setVisible(false);
+        menu.findItem(R.id.action_sort).setVisible(false);
+        menu.findItem(R.id.action_sync_account).setVisible(false);
+        return true;
+    }
     
     @Override
     public boolean onOptionsItemSelected(MenuItem item) {
         boolean retval = true;
         switch (item.getItemId()) {
+            case R.id.action_create_dir:
+                CreateFolderDialogFragment dialog = CreateFolderDialogFragment.newInstance(mFile);
+                dialog.show(
+                        getSupportFragmentManager(),
+                        CreateFolderDialogFragment.CREATE_FOLDER_FRAGMENT);
+                break;
             case android.R.id.home:
                 if((mParents.size() > 1)) {
                     onBackPressed();
index 321a9e0..5e94e0f 100644 (file)
@@ -4,6 +4,7 @@
  *   @author Bartek Przybylski\r
  *   @author Tobias Kaminsky\r
  *   @author David A. Velasco\r
+ *   @author masensio\r
  *   Copyright (C) 2011  Bartek Przybylski\r
  *   Copyright (C) 2015 ownCloud Inc.\r
  *\r
@@ -30,7 +31,6 @@ import android.accounts.Account;
 import android.content.Context;\r
 import android.content.SharedPreferences;\r
 import android.graphics.Bitmap;\r
-import android.graphics.drawable.Drawable;\r
 import android.os.Build;\r
 import android.preference.PreferenceManager;\r
 import android.text.format.DateUtils;\r
@@ -55,6 +55,7 @@ import com.owncloud.android.services.OperationsService.OperationsServiceBinder;
 import com.owncloud.android.ui.activity.ComponentsGetter;\r
 import com.owncloud.android.utils.DisplayUtils;\r
 import com.owncloud.android.utils.FileStorageUtils;\r
+import com.owncloud.android.utils.MimetypeIconUtil;\r
 \r
 \r
 /**\r
@@ -322,34 +323,22 @@ public class FileListListAdapter extends BaseAdapter implements ListAdapter {
                         }\r
                     }\r
 \r
-                    if (file.getMimetype().equalsIgnoreCase("image/png")){\r
-                        Drawable backrepeat = mContext.getResources().\r
-                                              getDrawable(R.drawable.backrepeat);\r
-                        fileIcon.setBackground(backrepeat);\r
-                    } else {\r
-                        fileIcon.setBackground(null);\r
+                    if (file.getMimetype().equalsIgnoreCase("image/png")) {\r
+                        fileIcon.setBackgroundColor(mContext.getResources()\r
+                                .getColor(R.color.background_color));\r
                     }\r
 \r
+\r
                 } else {\r
-                    fileIcon.setImageResource(DisplayUtils.getFileTypeIconId(file.getMimetype(),\r
+                    fileIcon.setImageResource(MimetypeIconUtil.getFileTypeIconId(file.getMimetype(),\r
                             file.getFileName()));\r
                 }\r
 \r
             } else {\r
                 // Folder\r
-                fileIcon.setBackground(null);\r
-\r
-                if (checkIfFileIsSharedWithMe(file)) {\r
-                    fileIcon.setImageResource(R.drawable.shared_with_me_folder);\r
-                } else if (file.isShareByLink()) {\r
-                    // If folder is sharedByLink, icon folder must be changed to\r
-                    // folder-public one\r
-                    fileIcon.setImageResource(R.drawable.folder_public);\r
-                } else {\r
-                    fileIcon.setImageResource(\r
-                            DisplayUtils.getFileTypeIconId(file.getMimetype(), file.getFileName())\r
-                    );\r
-                }\r
+                fileIcon.setImageResource(\r
+                        MimetypeIconUtil.getFolderTypeIconId(\r
+                                checkIfFileIsSharedWithMe(file), file.isShareByLink()));\r
             }\r
         }\r
 \r
index 287c5b9..60675f4 100644 (file)
@@ -37,15 +37,19 @@ import android.widget.TextView;
 
 import com.owncloud.android.R;
 import com.owncloud.android.datamodel.ThumbnailsCacheManager;
+import com.owncloud.android.lib.common.utils.Log_OC;
 import com.owncloud.android.utils.BitmapUtils;
 import com.owncloud.android.utils.DisplayUtils;
+import com.owncloud.android.utils.MimetypeIconUtil;
 
 /**
  * This Adapter populates a ListView with all files and directories contained
  * in a local directory
  */
 public class LocalFileListAdapter extends BaseAdapter implements ListAdapter {
-    
+
+    private static final String TAG = LocalFileListAdapter.class.getSimpleName();
+
     private Context mContext;
     private File mDirectory;
     private File[] mFiles = null;
@@ -103,6 +107,12 @@ public class LocalFileListAdapter extends BaseAdapter implements ListAdapter {
             fileName.setText(name);
             
             ImageView fileIcon = (ImageView) view.findViewById(R.id.thumbnail);
+
+            /** Cancellation needs do be checked and done before changing the drawable in fileIcon, or
+             * {@link ThumbnailsCacheManager#cancelPotentialWork} will NEVER cancel any task.
+             **/
+            boolean allowedToCreateNewThumbnail = (ThumbnailsCacheManager.cancelPotentialWork(file, fileIcon));
+
             if (!file.isDirectory()) {
                 fileIcon.setImageResource(R.drawable.file);
             } else {
@@ -142,7 +152,7 @@ public class LocalFileListAdapter extends BaseAdapter implements ListAdapter {
                     } else {
 
                         // generate new Thumbnail
-                        if (ThumbnailsCacheManager.cancelPotentialWork(file, fileIcon)) {
+                        if (allowedToCreateNewThumbnail) {
                             final ThumbnailsCacheManager.ThumbnailGenerationTask task =
                                     new ThumbnailsCacheManager.ThumbnailGenerationTask(fileIcon);
                             if (thumbnail == null) {
@@ -156,10 +166,12 @@ public class LocalFileListAdapter extends BaseAdapter implements ListAdapter {
                                        );
                             fileIcon.setImageDrawable(asyncDrawable);
                             task.execute(file);
-                        }
+                            Log_OC.v(TAG, "Executing task to generate a new thumbnail");
+
+                        } // else, already being generated, don't restart it
                     }
                 } else {
-                    fileIcon.setImageResource(DisplayUtils.getFileTypeIconId(null, file.getName()));
+                    fileIcon.setImageResource(MimetypeIconUtil.getFileTypeIconId(null, file.getName()));
                 }  
 
             } else {
index cf75cc2..79eb52d 100644 (file)
@@ -12,6 +12,7 @@ import android.widget.AdapterView;
 import android.widget.AdapterView.OnItemClickListener;
 import android.widget.ArrayAdapter;
 import android.widget.ListView;
+import android.widget.TextView;
 
 import com.owncloud.android.R;
 import com.owncloud.android.ui.dialog.parcel.MenuItemParcelable;
@@ -27,6 +28,7 @@ public class FileActionsDialogFragment extends DialogFragment implements
         OnItemClickListener {
     private static final String ARG_ITEM_LIST = "ITEM_LIST";
     private static final String ARG_FILE_POSITION = "FILE_POSITION";
+    private static final String ARG_FILE_NAME = "FILE_NAME";
     public static final String FTAG_FILE_ACTIONS = "FILE_ACTIONS_FRAGMENT";
 
     private List<MenuItemParcelable> mMenuItems;
@@ -48,7 +50,7 @@ public class FileActionsDialogFragment extends DialogFragment implements
      * @param menu menu to be display.
      * @return Dialog ready to show.
      */
-    public static FileActionsDialogFragment newInstance(Menu menu, int filePosition) {
+    public static FileActionsDialogFragment newInstance(Menu menu, int filePosition, String fileName) {
         FileActionsDialogFragment fragment = new FileActionsDialogFragment();
         Bundle args = new Bundle();
 
@@ -57,6 +59,7 @@ public class FileActionsDialogFragment extends DialogFragment implements
 
         args.putParcelable(ARG_ITEM_LIST, menuParcelable);
         args.putInt(ARG_FILE_POSITION, filePosition);
+        args.putCharSequence(ARG_FILE_NAME, fileName);
 
         fragment.setArguments(args);
         return fragment;
@@ -80,7 +83,16 @@ public class FileActionsDialogFragment extends DialogFragment implements
         View view = inflater.inflate(R.layout.file_actions, null, false);
         mListView = (ListView) view.findViewById(R.id.file_actions_list);
 
-        getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
+        CharSequence title =  getArguments().getCharSequence(ARG_FILE_NAME);
+        if(title != null && title.length() > 0) {
+            TextView header = (TextView)view.findViewById(R.id.file_actions_header);
+            header.setText(title);
+            header.setVisibility(View.VISIBLE);
+            view.findViewById(R.id.file_actions_header_divider).setVisibility(View.VISIBLE);
+        } else {
+            getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
+        }
+
         return view;
     }
 
index 937a50d..24015d0 100644 (file)
@@ -71,8 +71,8 @@ public class ExtendedListFragment extends Fragment
     private ArrayList<Integer> mTops;
     private int mHeightCell = 0;
 
-    private OnEnforceableRefreshListener mOnRefreshListener = null;
-    
+    private SwipeRefreshLayout.OnRefreshListener mOnRefreshListener = null;
+
     protected AbsListView mCurrentListView;
     private ExtendedListView mListView;
     private View mListFooterView;
@@ -352,7 +352,7 @@ public class ExtendedListFragment extends Fragment
         mRefreshEmptyLayout.setRefreshing(false);
 
         if (mOnRefreshListener != null) {
-            mOnRefreshListener.onRefresh(ignoreETag);
+            mOnRefreshListener.onRefresh();
         }
     }
 
index 68ee677..d4b1ffd 100644 (file)
  */
 package com.owncloud.android.ui.fragment;
 
-import java.lang.ref.WeakReference;
-
 import android.accounts.Account;
-import android.content.Intent;
 import android.os.Bundle;
 import android.view.LayoutInflater;
 import android.view.Menu;
@@ -46,12 +43,14 @@ import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
 import com.owncloud.android.files.services.FileUploader.FileUploaderBinder;
 import com.owncloud.android.lib.common.network.OnDatatransferProgressListener;
 import com.owncloud.android.lib.common.utils.Log_OC;
-import com.owncloud.android.services.observer.FileObserverService;
 import com.owncloud.android.ui.activity.FileActivity;
 import com.owncloud.android.ui.activity.FileDisplayActivity;
 import com.owncloud.android.ui.dialog.RemoveFileDialogFragment;
 import com.owncloud.android.ui.dialog.RenameFileDialogFragment;
 import com.owncloud.android.utils.DisplayUtils;
+import com.owncloud.android.utils.MimetypeIconUtil;
+
+import java.lang.ref.WeakReference;
 
 
 /**
@@ -62,9 +61,9 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
     private int mLayout;
     private View mView;
     private Account mAccount;
-    
+
     public ProgressListener mProgressListener;
-    
+
     private static final String TAG = FileDetailFragment.class.getSimpleName();
     public static final String FTAG_CONFIRMATION = "REMOVE_CONFIRMATION_FRAGMENT";
     public static final String FTAG_RENAME_FILE = "RENAME_FILE_FRAGMENT";
@@ -103,14 +102,14 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
         mLayout = R.layout.file_details_empty;
         mProgressListener = null;
     }
-    
+
 
     @Override
     public void onActivityCreated(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setHasOptionsMenu(true);
     }
-    
+
 
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container,
@@ -120,14 +119,14 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
         mAccount = getArguments().getParcelable(ARG_ACCOUNT);
 
         if (savedInstanceState != null) {
-            setFile((OCFile)savedInstanceState.getParcelable(FileActivity.EXTRA_FILE));
+            setFile((OCFile) savedInstanceState.getParcelable(FileActivity.EXTRA_FILE));
             mAccount = savedInstanceState.getParcelable(FileActivity.EXTRA_ACCOUNT);
         }
-        
-        if(getFile() != null && mAccount != null) {
+
+        if (getFile() != null && mAccount != null) {
             mLayout = R.layout.file_details_fragment;
         }
-        
+
         mView = inflater.inflate(mLayout, null);
         
         if (mLayout == R.layout.file_details_fragment) {
@@ -154,20 +153,20 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
         super.onStart();
         listenForTransferProgress();
     }
-    
+
     @Override
     public void onStop() {
         leaveTransferProgress();
         super.onStop();
     }
 
-    
+
     @Override
     public View getView() {
         return super.getView() == null ? mView : super.getView();
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -175,16 +174,16 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
     public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
         super.onCreateOptionsMenu(menu, inflater);
         inflater.inflate(R.menu.file_actions_menu, menu);
-   }
+    }
+
 
-    
     /**
      * {@inheritDoc}
      */
     @Override
-    public void onPrepareOptionsMenu (Menu menu) {
+    public void onPrepareOptionsMenu(Menu menu) {
         super.onPrepareOptionsMenu(menu);
-        
+
         if (mContainerActivity.getStorageManager() != null) {
             FileMenuFilter mf = new FileMenuFilter(
                 getFile(),
@@ -194,7 +193,7 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
             );
             mf.filter(menu);
         }
-        
+
         // additional restriction for this fragment 
         MenuItem item = menu.findItem(R.id.action_see_details);
         if (item != null) {
@@ -208,9 +207,16 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
             item.setVisible(false);
             item.setEnabled(false);
         }
+
+        // additional restriction for this fragment
+        item = menu.findItem(R.id.action_copy);
+        if (item != null) {
+            item.setVisible(false);
+            item.setEnabled(false);
+        }
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -241,10 +247,10 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
             }
             case R.id.action_cancel_download:
             case R.id.action_cancel_upload: {
-                ((FileDisplayActivity)mContainerActivity).cancelTransference(getFile());
+                ((FileDisplayActivity) mContainerActivity).cancelTransference(getFile());
                 return true;
             }
-            case R.id.action_download_file: 
+            case R.id.action_download_file:
             case R.id.action_sync_file: {
                 mContainerActivity.getFileOperationsHelper().syncFile(getFile());
                 return true;
@@ -253,9 +259,10 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
                 // Obtain the file
                 if (!getFile().isDown()) {  // Download the file                    
                     Log_OC.d(TAG, getFile().getRemotePath() + " : File must be downloaded");
-                    ((FileDisplayActivity)mContainerActivity).startDownloadForSending(getFile());
-                    
-                } else {
+                    ((FileDisplayActivity) mContainerActivity).startDownloadForSending(getFile());
+
+                }
+                else {
                     mContainerActivity.getFileOperationsHelper().sendDownloadedFile(getFile());
                 }
                 return true;
@@ -282,7 +289,7 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
                 break;
             }
             case R.id.fdCancelBtn: {
-                ((FileDisplayActivity)mContainerActivity).cancelTransference(getFile());
+                ((FileDisplayActivity) mContainerActivity).cancelTransference(getFile());
                 break;
             }
             default:
@@ -293,17 +300,17 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
 
     /**
      * Check if the fragment was created with an empty layout. An empty fragment can't show file details, must be replaced.
-     * 
-     * @return  True when the fragment was created with the empty layout.
+     *
+     * @return True when the fragment was created with the empty layout.
      */
     public boolean isEmpty() {
         return (mLayout == R.layout.file_details_empty || getFile() == null || mAccount == null);
     }
 
-    
+
     /**
      * Use this method to signal this Activity that it shall update its view.
-     * 
+     *
      * @param file : An {@link OCFile}
      */
     public void updateFileDetails(OCFile file, Account ocAccount) {
@@ -314,14 +321,13 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
 
     /**
      * Updates the view with all relevant details about that file.
+     * <p/>
+     * TODO Remove parameter when the transferring state of files is kept in database.
      *
-     * TODO Remove parameter when the transferring state of files is kept in database. 
-     * 
-     * @param transferring      Flag signaling if the file should be considered as downloading or uploading, 
-     *                          although {@link FileDownloaderBinder#isDownloading(Account, OCFile)}  and 
-     *                          {@link FileUploaderBinder#isUploading(Account, OCFile)} return false.
-     *                          
-     * @param refresh           If 'true', try to refresh the whole file from the database
+     * @param transferring Flag signaling if the file should be considered as downloading or uploading,
+     *                     although {@link FileDownloaderBinder#isDownloading(Account, OCFile)}  and
+     *                     {@link FileUploaderBinder#isUploading(Account, OCFile)} return false.
+     * @param refresh      If 'true', try to refresh the whole file from the database
      */
     public void updateFileDetails(boolean transferring, boolean refresh) {
         if (readyToShow()) {
@@ -330,7 +336,7 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
                 setFile(storageManager.getFileByPath(getFile().getRemotePath()));
             }
             OCFile file = getFile();
-            
+
             // set file details
             setFilename(file.getFileName());
             setFiletype(file.getMimetype(), file.getFileName());
@@ -349,7 +355,7 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
                     (uploaderBinder != null && uploaderBinder.isUploading(mAccount, file))
                     ) {
                 setButtonsForTransferring();
-                
+
             } else if (file.isDown()) {
                 
                 setButtonsForDown();
@@ -362,25 +368,27 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
         }
         getView().invalidate();
     }
-    
+
     /**
      * Checks if the fragment is ready to show details of a OCFile
-     *  
-     * @return  'True' when the fragment is ready to show details of a file
+     *
+     * @return 'True' when the fragment is ready to show details of a file
      */
     private boolean readyToShow() {
-        return (getFile() != null && mAccount != null && mLayout == R.layout.file_details_fragment);        
+        return (getFile() != null && mAccount != null && mLayout == R.layout.file_details_fragment);
     }
 
 
     /**
      * Updates the filename in view
+     *
      * @param filename to set
      */
     private void setFilename(String filename) {
         TextView tv = (TextView) getView().findViewById(R.id.fdFilename);
-        if (tv != null)
+        if (tv != null) {
             tv.setText(filename);
+        }
     }
 
     /**
@@ -396,31 +404,34 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
         }
         ImageView iv = (ImageView) getView().findViewById(R.id.fdIcon);
         if (iv != null) {
-            iv.setImageResource(DisplayUtils.getFileTypeIconId(mimetype, filename));
+            iv.setImageResource(MimetypeIconUtil.getFileTypeIconId(mimetype, filename));
         }
     }
 
     /**
      * Updates the file size in view
+     *
      * @param filesize in bytes to set
      */
     private void setFilesize(long filesize) {
         TextView tv = (TextView) getView().findViewById(R.id.fdSize);
-        if (tv != null)
+        if (tv != null) {
             tv.setText(DisplayUtils.bytesToHumanReadable(filesize));
+        }
     }
-    
+
     /**
      * Updates the time that the file was last modified
+     *
      * @param milliseconds Unix time to set
      */
-    private void setTimeModified(long milliseconds){
+    private void setTimeModified(long milliseconds) {
         TextView tv = (TextView) getView().findViewById(R.id.fdModified);
-        if(tv != null){
+        if (tv != null) {
             tv.setText(DisplayUtils.unixTimeToHumanReadable(milliseconds));
         }
     }
-    
+
     /**
      * Enables or disables buttons for a file being downloaded
      */
@@ -431,21 +442,24 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
             
             // show the progress bar for the transfer
             getView().findViewById(R.id.fdProgressBlock).setVisibility(View.VISIBLE);
-            TextView progressText = (TextView)getView().findViewById(R.id.fdProgressText);
+            TextView progressText = (TextView) getView().findViewById(R.id.fdProgressText);
             progressText.setVisibility(View.VISIBLE);
             FileDownloaderBinder downloaderBinder = mContainerActivity.getFileDownloaderBinder();
             FileUploaderBinder uploaderBinder = mContainerActivity.getFileUploaderBinder();
             //if (getFile().isDownloading()) {
             if (downloaderBinder != null && downloaderBinder.isDownloading(mAccount, getFile())) {
                 progressText.setText(R.string.downloader_download_in_progress_ticker);
-            } else if (uploaderBinder != null && uploaderBinder.isUploading(mAccount, getFile())) {
-                progressText.setText(R.string.uploader_upload_in_progress_ticker);
+            }
+            else {
+                if (uploaderBinder != null && uploaderBinder.isUploading(mAccount, getFile())) {
+                    progressText.setText(R.string.uploader_upload_in_progress_ticker);
+                }
             }
         }
     }
 
     /**
-     * Enables or disables buttons for a file locally available 
+     * Enables or disables buttons for a file locally available
      */
     private void setButtonsForDown() {
         if (!isEmpty()) {
@@ -453,13 +467,13 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
             
             // hides the progress bar
             getView().findViewById(R.id.fdProgressBlock).setVisibility(View.GONE);
-            TextView progressText = (TextView)getView().findViewById(R.id.fdProgressText);
+            TextView progressText = (TextView) getView().findViewById(R.id.fdProgressText);
             progressText.setVisibility(View.GONE);
         }
     }
 
     /**
-     * Enables or disables buttons for a file not locally available 
+     * Enables or disables buttons for a file not locally available
      */
     private void setButtonsForRemote() {
         if (!isEmpty()) {
@@ -467,11 +481,11 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
             
             // hides the progress bar
             getView().findViewById(R.id.fdProgressBlock).setVisibility(View.GONE);
-            TextView progressText = (TextView)getView().findViewById(R.id.fdProgressText);
+            TextView progressText = (TextView) getView().findViewById(R.id.fdProgressText);
             progressText.setVisibility(View.GONE);
         }
     }
-    
+
 
     public void listenForTransferProgress() {
         if (mProgressListener != null) {
@@ -485,8 +499,8 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
             }
         }
     }
-    
-    
+
+
     public void leaveTransferProgress() {
         if (mProgressListener != null) {
             if (mContainerActivity.getFileDownloaderBinder() != null) {
@@ -501,7 +515,6 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
     }
 
 
-    
     /**
      * Helper class responsible for updating the progress bar shown for file uploading or
      * downloading
@@ -509,11 +522,11 @@ public class FileDetailFragment extends FileFragment implements OnClickListener
     private class ProgressListener implements OnDatatransferProgressListener {
         int mLastPercent = 0;
         WeakReference<ProgressBar> mProgressBar = null;
-        
+
         ProgressListener(ProgressBar progressBar) {
             mProgressBar = new WeakReference<ProgressBar>(progressBar);
         }
-        
+
         @Override
         public void onTransferProgress(long progressRate, long totalTransferredSoFar,
                                        long totalToTransfer, String filename) {
index 5ec5c52..02bd845 100644 (file)
@@ -22,8 +22,6 @@
  */
 package com.owncloud.android.ui.fragment;
 
-import java.io.File;
-
 import android.app.Activity;
 import android.content.Intent;
 import android.os.Bundle;
@@ -55,12 +53,14 @@ import com.owncloud.android.ui.dialog.RemoveFileDialogFragment;
 import com.owncloud.android.ui.dialog.RenameFileDialogFragment;
 import com.owncloud.android.ui.preview.PreviewImageFragment;
 import com.owncloud.android.ui.preview.PreviewMediaFragment;
-import com.owncloud.android.utils.DialogMenuItem;
 import com.owncloud.android.utils.FileStorageUtils;
+import com.owncloud.android.ui.preview.PreviewTextFragment;
+
+import java.io.File;
 
 /**
  * A Fragment that lists all files and folders in a given path.
- * 
+ *
  * TODO refactor to get rid of direct dependency on FileDisplayActivity
  */
 public class OCFileListFragment extends ExtendedListFragment implements FileActionsDialogFragment.FileActionsDialogFragmentListener {
@@ -69,14 +69,14 @@ public class OCFileListFragment extends ExtendedListFragment implements FileActi
 
     private static final String MY_PACKAGE = OCFileListFragment.class.getPackage() != null ?
             OCFileListFragment.class.getPackage().getName() : "com.owncloud.android.ui.fragment";
-            
+
     public final static String ARG_JUST_FOLDERS = MY_PACKAGE + ".JUST_FOLDERS";
     public final static String ARG_ALLOW_CONTEXTUAL_ACTIONS = MY_PACKAGE + ".ALLOW_CONTEXTUAL";
-            
+
     private static final String KEY_FILE = MY_PACKAGE + ".extra.FILE";
 
     private FileFragment.ContainerActivity mContainerActivity;
-   
+
     private OCFile mFile = null;
     private FileListListAdapter mAdapter;
     private boolean mJustFolders;
@@ -94,21 +94,21 @@ public class OCFileListFragment extends ExtendedListFragment implements FileActi
         Log_OC.e(TAG, "onAttach");
         try {
             mContainerActivity = (FileFragment.ContainerActivity) activity;
-            
+
         } catch (ClassCastException e) {
-            throw new ClassCastException(activity.toString() + " must implement " + 
+            throw new ClassCastException(activity.toString() + " must implement " +
                     FileFragment.ContainerActivity.class.getSimpleName());
         }
         try {
             setOnRefreshListener((OnEnforceableRefreshListener) activity);
             
         } catch (ClassCastException e) {
-            throw new ClassCastException(activity.toString() + " must implement " + 
+            throw new ClassCastException(activity.toString() + " must implement " +
                     SwipeRefreshLayout.OnRefreshListener.class.getSimpleName());
         }
     }
 
-    
+
     @Override
     public void onDetach() {
         setOnRefreshListener(null);
@@ -140,7 +140,7 @@ public class OCFileListFragment extends ExtendedListFragment implements FileActi
                 mJustFolders,
                 getActivity(),
                 mContainerActivity
-                );
+        );
         setListAdapter(mAdapter);
 
         registerLongClickListener();
@@ -193,7 +193,7 @@ public class OCFileListFragment extends ExtendedListFragment implements FileActi
                 }
             }
 
-            FileActionsDialogFragment dialog = FileActionsDialogFragment.newInstance(menu, fileIndex);
+            FileActionsDialogFragment dialog = FileActionsDialogFragment.newInstance(menu, fileIndex, targetFile.getFileName());
             dialog.setTargetFragment(this, 0);
             dialog.show(getFragmentManager(), FileActionsDialogFragment.FTAG_FILE_ACTIONS);
         }
@@ -203,31 +203,31 @@ public class OCFileListFragment extends ExtendedListFragment implements FileActi
      * Saves the current listed folder.
      */
     @Override
-    public void onSaveInstanceState (Bundle outState) {
+    public void onSaveInstanceState(Bundle outState) {
         super.onSaveInstanceState(outState);
         outState.putParcelable(KEY_FILE, mFile);
     }
-    
+
     /**
      * Call this, when the user presses the up button.
-     * 
+     *
      * Tries to move up the current folder one level. If the parent folder was removed from the
      * database, it continues browsing up until finding an existing folders.
-     * 
+     * <p/>
      * return       Count of folder levels browsed up.
      */
     public int onBrowseUp() {
         OCFile parentDir = null;
         int moveCount = 0;
-        
-        if(mFile != null){
+
+        if (mFile != null) {
             FileDataStorageManager storageManager = mContainerActivity.getStorageManager();
-            
+
             String parentPath = null;
             if (mFile.getParentId() != FileDataStorageManager.ROOT_PARENT_ID) {
                 parentPath = new File(mFile.getRemotePath()).getParent();
-                parentPath = parentPath.endsWith(OCFile.PATH_SEPARATOR) ? parentPath : 
-                       parentPath + OCFile.PATH_SEPARATOR;
+                parentPath = parentPath.endsWith(OCFile.PATH_SEPARATOR) ? parentPath :
+                        parentPath + OCFile.PATH_SEPARATOR;
                 parentDir = storageManager.getFileByPath(parentPath);
                 moveCount++;
             } else {
@@ -235,8 +235,8 @@ public class OCFileListFragment extends ExtendedListFragment implements FileActi
             }
             while (parentDir == null) {
                 parentPath = new File(parentPath).getParent();
-                parentPath = parentPath.endsWith(OCFile.PATH_SEPARATOR) ? parentPath : 
-                       parentPath + OCFile.PATH_SEPARATOR;
+                parentPath = parentPath.endsWith(OCFile.PATH_SEPARATOR) ? parentPath :
+                        parentPath + OCFile.PATH_SEPARATOR;
                 parentDir = storageManager.getFileByPath(parentPath);
                 moveCount++;
             }   // exit is granted because storageManager.getFileByPath("/") never returns null
@@ -246,20 +246,20 @@ public class OCFileListFragment extends ExtendedListFragment implements FileActi
             listDirectory(mFile /*, MainApp.getOnlyOnDevice()*/);
 
             onRefresh(false);
-            
+
             // restore index and top position
             restoreIndexAndTopPosition();
-            
+
         }   // else - should never happen now
-   
+
         return moveCount;
     }
-    
+
     @Override
     public void onItemClick(AdapterView<?> l, View v, int position, long id) {
         OCFile file = (OCFile) mAdapter.getItem(position);
         if (file != null) {
-            if (file.isFolder()) { 
+            if (file.isFolder()) {
                 // update state and view of this fragment
                 // TODO Enable when "On Device" is recovered ?
                 listDirectory(file/*, MainApp.getOnlyOnDevice()*/);
@@ -267,48 +267,49 @@ public class OCFileListFragment extends ExtendedListFragment implements FileActi
                 mContainerActivity.onBrowsedDownTo(file);
                 // save index and top position
                 saveIndexAndTopPosition(position);
-                
+
             } else { /// Click on a file
                 if (PreviewImageFragment.canBePreviewed(file)) {
                     // preview image - it handles the download, if needed
                     ((FileDisplayActivity)mContainerActivity).startImagePreview(file);
-                    
+                } else if (PreviewTextFragment.canBePreviewed(file)){
+                    ((FileDisplayActivity)mContainerActivity).startTextPreview(file);
                 } else if (file.isDown()) {
                     if (PreviewMediaFragment.canBePreviewed(file)) {
                         // media preview
-                        ((FileDisplayActivity)mContainerActivity).startMediaPreview(file, 0, true);
+                        ((FileDisplayActivity) mContainerActivity).startMediaPreview(file, 0, true);
                     } else {
                         mContainerActivity.getFileOperationsHelper().openFile(file);
                     }
-                    
+
                 } else {
                     // automatic download, preview on finish
-                    ((FileDisplayActivity)mContainerActivity).startDownloadForPreview(file);
+                    ((FileDisplayActivity) mContainerActivity).startDownloadForPreview(file);
                 }
-                    
+
             }
-            
+
         } else {
             Log_OC.d(TAG, "Null object in ListAdapter!!");
         }
-        
+
     }
-    
+
     /**
      * {@inheritDoc}
      */
     @Override
-    public void onCreateContextMenu (
+    public void onCreateContextMenu(
             ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
         Bundle args = getArguments();
-        boolean allowContextualActions = 
-                (args == null) ? true : args.getBoolean(ARG_ALLOW_CONTEXTUAL_ACTIONS, true); 
+        boolean allowContextualActions =
+                (args == null) ? true : args.getBoolean(ARG_ALLOW_CONTEXTUAL_ACTIONS, true);
         if (allowContextualActions) {
             MenuInflater inflater = getActivity().getMenuInflater();
             inflater.inflate(R.menu.file_actions_menu, menu);
             AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
             OCFile targetFile = (OCFile) mAdapter.getItem(info.position);
-            
+
             if (mContainerActivity.getStorageManager() != null) {
                 FileMenuFilter mf = new FileMenuFilter(
                     targetFile,
@@ -403,6 +404,13 @@ public class OCFileListFragment extends ExtendedListFragment implements FileActi
                 mContainerActivity.getFileOperationsHelper().toggleFavorite(mTargetFile, false);
                 return true;
             }
+            case R.id.action_copy:
+                Intent action = new Intent(getActivity(), FolderPickerActivity.class);
+
+                // Pass mTargetFile that contains info of selected file/folder
+                action.putExtra(FolderPickerActivity.EXTRA_FILE, mTargetFile);
+                getActivity().startActivityForResult(action, FileDisplayActivity.ACTION_COPY_FILES);
+                return true;
             default:
                 return false;
         }
@@ -426,12 +434,13 @@ public class OCFileListFragment extends ExtendedListFragment implements FileActi
     /**
      * Use this to query the {@link OCFile} that is currently
      * being displayed by this fragment
+     *
      * @return The currently viewed OCFile
      */
-    public OCFile getCurrentFile(){
+    public OCFile getCurrentFile() {
         return mFile;
     }
-    
+
     /**
      * Calls {@link OCFileListFragment#listDirectory(OCFile)} with a null parameter
      */
@@ -445,12 +454,12 @@ public class OCFileListFragment extends ExtendedListFragment implements FileActi
         // TODO Enable when "On Device" is recovered ?
         listDirectory(getCurrentFile()/*, MainApp.getOnlyOnDevice()*/);
     }
-    
+
     /**
      * Lists the given directory on the view. When the input parameter is null,
      * it will either refresh the last known directory. list the root
      * if there never was a directory.
-     * 
+     *
      * @param directory File to be listed
      */
     public void listDirectory(OCFile directory/*, boolean onlyOnDevice*/) {
@@ -458,18 +467,18 @@ public class OCFileListFragment extends ExtendedListFragment implements FileActi
         if (storageManager != null) {
 
             // Check input parameters for null
-            if(directory == null){
-                if(mFile != null){
+            if (directory == null) {
+                if (mFile != null) {
                     directory = mFile;
                 } else {
                     directory = storageManager.getFileByPath("/");
                     if (directory == null) return; // no files, wait for sync
                 }
             }
-        
-        
+
+
             // If that's not a directory -> List its parent
-            if(!directory.isFolder()){
+            if (!directory.isFolder()) {
                 Log_OC.w(TAG, "You see, that is not a directory -> " + directory.toString());
                 directory = storageManager.getFileById(directory.getParentId());
             }
index dd78a03..e63b324 100644 (file)
@@ -59,9 +59,9 @@ public class FileDownloadFragment extends FileFragment implements OnClickListene
 
     public ProgressListener mProgressListener;
     private boolean mListening;
-    
+
     private static final String TAG = FileDownloadFragment.class.getSimpleName();
-    
+
     private boolean mIgnoreFirstSavedState;
     private boolean mError;
 
@@ -118,19 +118,20 @@ public class FileDownloadFragment extends FileFragment implements OnClickListene
         mIgnoreFirstSavedState = args.getBoolean(ARG_IGNORE_FIRST);
         mAccount = args.getParcelable(ARG_ACCOUNT);
     }
-    
+
 
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container,
-            Bundle savedInstanceState) {
+                             Bundle savedInstanceState) {
         super.onCreateView(inflater, container, savedInstanceState);
-        
+
         if (savedInstanceState != null) {
             if (!mIgnoreFirstSavedState) {
-                setFile((OCFile)savedInstanceState.getParcelable(FileDownloadFragment.EXTRA_FILE));
+                setFile((OCFile) savedInstanceState.getParcelable(FileDownloadFragment.EXTRA_FILE));
                 mAccount = savedInstanceState.getParcelable(FileDownloadFragment.EXTRA_ACCOUNT);
                 mError = savedInstanceState.getBoolean(FileDownloadFragment.EXTRA_ERROR);
-            } else {
+            }
+            else {
                 mIgnoreFirstSavedState = false;
             }
         }
@@ -140,7 +141,7 @@ public class FileDownloadFragment extends FileFragment implements OnClickListene
         ProgressBar progressBar = (ProgressBar)mView.findViewById(R.id.progressBar);
         DisplayUtils.colorPreLollipopHorizontalProgressBar(progressBar);
         mProgressListener = new ProgressListener(progressBar);
-        
+
         (mView.findViewById(R.id.cancelBtn)).setOnClickListener(this);
         
         (mView.findViewById(R.id.fileDownloadLL)).setOnClickListener(new OnClickListener() {
@@ -152,13 +153,14 @@ public class FileDownloadFragment extends FileFragment implements OnClickListene
 
         if (mError) {
             setButtonsForRemote();
-        } else {
+        }
+        else {
             setButtonsForTransferring();
         }
-        
+
         return mView;
     }
-    
+
 
     @Override
     public void onSaveInstanceState(Bundle outState) {
@@ -173,7 +175,7 @@ public class FileDownloadFragment extends FileFragment implements OnClickListene
         super.onStart();
         listenForTransferProgress();
     }
-    
+
     @Override
     public void onResume() {
         super.onResume();
@@ -185,19 +187,19 @@ public class FileDownloadFragment extends FileFragment implements OnClickListene
         super.onPause();
     }
 
-    
+
     @Override
     public void onStop() {
         leaveTransferProgress();
         super.onStop();
     }
-    
+
     @Override
     public void onDestroy() {
         super.onDestroy();
     }
-    
-    
+
+
     @Override
     public View getView() {
         if (!mListening) {
@@ -206,7 +208,7 @@ public class FileDownloadFragment extends FileFragment implements OnClickListene
         return super.getView() == null ? mView : super.getView();
     }
 
-    
+
     @Override
     public void onClick(View v) {
         switch (v.getId()) {
@@ -220,53 +222,52 @@ public class FileDownloadFragment extends FileFragment implements OnClickListene
         }
     }
 
-    
+
     /**
      * Enables or disables buttons for a file being downloaded
      */
     private void setButtonsForTransferring() {
         getView().findViewById(R.id.cancelBtn).setVisibility(View.VISIBLE);
-    
+
         // show the progress bar for the transfer
         getView().findViewById(R.id.progressBar).setVisibility(View.VISIBLE);
-        TextView progressText = (TextView)getView().findViewById(R.id.progressText);
+        TextView progressText = (TextView) getView().findViewById(R.id.progressText);
         progressText.setText(R.string.downloader_download_in_progress_ticker);
         progressText.setVisibility(View.VISIBLE);
-                
+
         // hides the error icon
         getView().findViewById(R.id.errorText).setVisibility(View.GONE);
         getView().findViewById(R.id.error_image).setVisibility(View.GONE);
     }
-    
 
     /**
-     * Enables or disables buttons for a file locally available 
+     * Enables or disables buttons for a file locally available
      */
     private void setButtonsForDown() {
         getView().findViewById(R.id.cancelBtn).setVisibility(View.GONE);
-    
+
         // hides the progress bar
         getView().findViewById(R.id.progressBar).setVisibility(View.GONE);
-        
+
         // updates the text message
-        TextView progressText = (TextView)getView().findViewById(R.id.progressText);
+        TextView progressText = (TextView) getView().findViewById(R.id.progressText);
         progressText.setText(R.string.common_loading);
         progressText.setVisibility(View.VISIBLE);
-        
+
         // hides the error icon
         getView().findViewById(R.id.errorText).setVisibility(View.GONE);
         getView().findViewById(R.id.error_image).setVisibility(View.GONE);
     }
 
-    
+
     /**
-     * Enables or disables buttons for a file not locally available 
-     * 
+     * Enables or disables buttons for a file not locally available
+     * <p/>
      * Currently, this is only used when a download was failed
      */
     private void setButtonsForRemote() {
         getView().findViewById(R.id.cancelBtn).setVisibility(View.GONE);
-        
+
         // hides the progress bar and message
         getView().findViewById(R.id.progressBar).setVisibility(View.GONE);
         getView().findViewById(R.id.progressText).setVisibility(View.GONE);
@@ -275,7 +276,7 @@ public class FileDownloadFragment extends FileFragment implements OnClickListene
         getView().findViewById(R.id.errorText).setVisibility(View.VISIBLE);
         getView().findViewById(R.id.error_image).setVisibility(View.VISIBLE);
     }
-    
+
 
     public void listenForTransferProgress() {
         if (mProgressListener != null && !mListening) {
@@ -288,8 +289,8 @@ public class FileDownloadFragment extends FileFragment implements OnClickListene
             }
         }
     }
-    
-    
+
+
     public void leaveTransferProgress() {
         if (mProgressListener != null) {
             if (mContainerActivity.getFileDownloaderBinder() != null) {
@@ -308,11 +309,11 @@ public class FileDownloadFragment extends FileFragment implements OnClickListene
     private class ProgressListener implements OnDatatransferProgressListener {
         int mLastPercent = 0;
         WeakReference<ProgressBar> mProgressBar = null;
-        
+
         ProgressListener(ProgressBar progressBar) {
             mProgressBar = new WeakReference<ProgressBar>(progressBar);
         }
-        
+
         @Override
         public void onTransferProgress(
                 long progressRate, long totalTransferredSoFar, long totalToTransfer, String filename
@@ -333,8 +334,9 @@ public class FileDownloadFragment extends FileFragment implements OnClickListene
 
     public void setError(boolean error) {
         mError = error;
-    };
-    
+    }
+
+    ;
 
 
 }
index 6ce592a..e61e335 100644 (file)
@@ -75,11 +75,11 @@ public class PreviewImageFragment extends FileFragment {
     private ProgressBar mProgressWheel;
 
     public Bitmap mBitmap = null;
-    
+
     private static final String TAG = PreviewImageFragment.class.getSimpleName();
 
     private boolean mIgnoreFirstSavedState;
-    
+
     private LoadBitmapTask mLoadBitmapTask = null;
 
 
@@ -106,7 +106,7 @@ public class PreviewImageFragment extends FileFragment {
         return frag;
     }
 
-    
+
     
     /**
      *  Creates an empty fragment for image previews.
@@ -120,8 +120,8 @@ public class PreviewImageFragment extends FileFragment {
     public PreviewImageFragment() {
         mIgnoreFirstSavedState = false;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
@@ -136,14 +136,14 @@ public class PreviewImageFragment extends FileFragment {
         mIgnoreFirstSavedState = args.getBoolean(ARG_IGNORE_FIRST);
         setHasOptionsMenu(true);
     }
-    
+
 
     /**
      * {@inheritDoc}
      */
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container,
-            Bundle savedInstanceState) {
+                             Bundle savedInstanceState) {
         super.onCreateView(inflater, container, savedInstanceState);
         View view = inflater.inflate(R.layout.preview_image_fragment, container, false);
         mImageView = (TouchImageViewCustom) view.findViewById(R.id.image);
@@ -183,7 +183,7 @@ public class PreviewImageFragment extends FileFragment {
             throw new IllegalStateException("There is no local file to preview");
         }
     }
-        
+
 
     /**
      * {@inheritDoc}
@@ -193,7 +193,7 @@ public class PreviewImageFragment extends FileFragment {
         super.onSaveInstanceState(outState);
         outState.putParcelable(PreviewImageFragment.EXTRA_FILE, getFile());
     }
-    
+
 
     @Override
     public void onStart() {
@@ -205,8 +205,8 @@ public class PreviewImageFragment extends FileFragment {
             mLoadBitmapTask.execute(getFile());
         }
     }
-    
-    
+
+
     @Override
     public void onStop() {
         Log_OC.d(TAG, "onStop starts");
@@ -216,7 +216,7 @@ public class PreviewImageFragment extends FileFragment {
         }
         super.onStop();
     }
-    
+
     /**
      * {@inheritDoc}
      */
@@ -232,11 +232,11 @@ public class PreviewImageFragment extends FileFragment {
     @Override
     public void onPrepareOptionsMenu(Menu menu) {
         super.onPrepareOptionsMenu(menu);
-        
+
         if (mContainerActivity.getStorageManager() != null) {
             // Update the file
             setFile(mContainerActivity.getStorageManager().getFileById(getFile().getFileId()));
-            
+
             FileMenuFilter mf = new FileMenuFilter(
                 getFile(),
                 mContainerActivity.getStorageManager().getAccount(),
@@ -245,7 +245,7 @@ public class PreviewImageFragment extends FileFragment {
             );
             mf.filter(menu);
         }
-        
+
         // additional restriction for this fragment 
         // TODO allow renaming in PreviewImageFragment
         MenuItem item = menu.findItem(R.id.action_rename_file);
@@ -253,7 +253,7 @@ public class PreviewImageFragment extends FileFragment {
             item.setVisible(false);
             item.setEnabled(false);
         }
-        
+
         // additional restriction for this fragment 
         // TODO allow refresh file in PreviewImageFragment
         item = menu.findItem(R.id.action_sync_file);
@@ -268,11 +268,17 @@ public class PreviewImageFragment extends FileFragment {
             item.setVisible(false);
             item.setEnabled(false);
         }
-        
+
+        // additional restriction for this fragment
+        item = menu.findItem(R.id.action_copy);
+        if (item != null) {
+            item.setVisible(false);
+            item.setEnabled(false);
+        }
+
     }
 
-    
-    
+
     /**
      * {@inheritDoc}
      */
@@ -320,10 +326,10 @@ public class PreviewImageFragment extends FileFragment {
                 return false;
         }
     }
-    
+
 
     private void seeDetails() {
-        mContainerActivity.showDetails(getFile());        
+        mContainerActivity.showDetails(getFile());
     }
 
 
@@ -350,7 +356,7 @@ public class PreviewImageFragment extends FileFragment {
         super.onDestroy();
     }
 
-    
+
     /**
      * Opens the previewed image with an external application.
      */
@@ -358,7 +364,7 @@ public class PreviewImageFragment extends FileFragment {
         mContainerActivity.getFileOperationsHelper().openFile(getFile());
         finish();
     }
-    
+
     
     private class LoadBitmapTask extends AsyncTask<OCFile, Void, LoadImage> {
 
@@ -378,7 +384,7 @@ public class PreviewImageFragment extends FileFragment {
          */
         private final WeakReference<TextView> mMessageViewRef;
 
-        
+
         /**
          * Weak reference to the target {@link ProgressBar} shown while the load is in progress.
          * 
@@ -387,17 +393,17 @@ public class PreviewImageFragment extends FileFragment {
          */
         private final WeakReference<ProgressBar> mProgressWheelRef;
 
-        
+
         /**
-         * Error message to show when a load fails 
+         * Error message to show when a load fails
          */
         private int mErrorMessageId;
-        
-        
+
+
         /**
          * Constructor.
-         * 
-         * @param imageView     Target {@link ImageView} where the bitmap will be loaded into.
+         *
+         * @param imageView Target {@link ImageView} where the bitmap will be loaded into.
          */
         public LoadBitmapTask(ImageViewCustom imageView, TextView messageView,
                               ProgressBar progressWheel) {
@@ -405,7 +411,7 @@ public class PreviewImageFragment extends FileFragment {
             mMessageViewRef = new WeakReference<TextView>(messageView);
             mProgressWheelRef = new WeakReference<ProgressBar>(progressWheel);
         }
-        
+
         @Override
         protected LoadImage doInBackground(OCFile... params) {
             Bitmap result = null;
@@ -456,20 +462,21 @@ public class PreviewImageFragment extends FileFragment {
 
             } catch (NoSuchFieldError e) {
                 mErrorMessageId = R.string.common_error_unknown;
-                Log_OC.e(TAG, "Error from access to unexisting field despite protection; file " 
-                                + storagePath, e);
-                    
+                Log_OC.e(TAG, "Error from access to unexisting field despite protection; file "
+                        + storagePath, e);
+
             } catch (Throwable t) {
                 mErrorMessageId = R.string.common_error_unknown;
                 Log_OC.e(TAG, "Unexpected error loading " + getFile().getStoragePath(), t);
-                
+
             }
+
             return new LoadImage(result, ocFile);
         }
-        
+
         @Override
         protected void onCancelled(LoadImage result) {
-            if (result.bitmap != null) {
+            if (result != null && result.bitmap != null) {
                 result.bitmap.recycle();
             }
         }
@@ -479,7 +486,8 @@ public class PreviewImageFragment extends FileFragment {
             hideProgressWheel();
             if (result.bitmap != null) {
                 showLoadedImage(result);
-            } else {
+            }
+            else {
                 showErrorMessage();
             }
             if (result.bitmap != null && mBitmap != result.bitmap)  {
@@ -487,7 +495,7 @@ public class PreviewImageFragment extends FileFragment {
                 result.bitmap.recycle();
             }
         }
-        
+
         @SuppressLint("InlinedApi")
         private void showLoadedImage(LoadImage result) {
             final ImageViewCustom imageView = mImageViewRef.get();
@@ -511,7 +519,7 @@ public class PreviewImageFragment extends FileFragment {
                 messageView.setVisibility(View.GONE);
             } // else , silently finish, the fragment was destroyed
         }
-        
+
         private void showErrorMessage() {
             final ImageView imageView = mImageViewRef.get();
             if (imageView != null) {
@@ -525,14 +533,14 @@ public class PreviewImageFragment extends FileFragment {
                 messageView.setVisibility(View.VISIBLE);
             } // else , silently finish, the fragment was destroyed
         }
-        
+
         private void hideProgressWheel() {
             final ProgressBar progressWheel = mProgressWheelRef.get();
             if (progressWheel != null) {
                 progressWheel.setVisibility(View.GONE);
             }
         }
-        
+
     }
 
     /**
@@ -546,7 +554,7 @@ public class PreviewImageFragment extends FileFragment {
         return (file != null && file.isImage());
     }
 
-    
+
     /**
      * Finishes the preview
      */
@@ -554,7 +562,7 @@ public class PreviewImageFragment extends FileFragment {
         Activity container = getActivity();
         container.finish();
     }
-    
+
     public TouchImageViewCustom getImageView() {
         return mImageView;
     }
index b197a85..0dbb1a3 100644 (file)
@@ -49,7 +49,6 @@ import android.view.View;
 import android.view.View.OnTouchListener;
 import android.view.ViewGroup;
 import android.widget.ImageView;
-import android.widget.LinearLayout;
 import android.widget.Toast;
 import android.widget.VideoView;
 
@@ -68,7 +67,7 @@ import com.owncloud.android.ui.fragment.FileFragment;
 
 /**
  * This fragment shows a preview of a downloaded media file (audio or video).
- * 
+ *
  * Trying to get an instance with NULL {@link OCFile} or ownCloud {@link Account} values will
  * produce an {@link IllegalStateException}.
  * 
@@ -88,46 +87,46 @@ public class PreviewMediaFragment extends FileFragment implements
     private ImageView mImagePreview;
     private VideoView mVideoPreview;
     private int mSavedPlaybackPosition;
-    
+
     private MediaServiceBinder mMediaServiceBinder = null;
     private MediaControlView mMediaController = null;
     private MediaServiceConnection mMediaServiceConnection = null;
     private VideoHelper mVideoHelper;
     private boolean mAutoplay;
     public boolean mPrepared;
-    
+
     private static final String TAG = PreviewMediaFragment.class.getSimpleName();
 
-    
+
     /**
      * Creates a fragment to preview a file.
-     * 
+     * <p/>
      * When 'fileToDetail' or 'ocAccount' are null
-     * 
-     * @param fileToDetail      An {@link OCFile} to preview in the fragment
-     * @param ocAccount         An ownCloud account; needed to start downloads
+     *
+     * @param fileToDetail An {@link OCFile} to preview in the fragment
+     * @param ocAccount    An ownCloud account; needed to start downloads
      */
     public PreviewMediaFragment(
-            OCFile fileToDetail, 
-            Account ocAccount, 
-            int startPlaybackPosition, 
+            OCFile fileToDetail,
+            Account ocAccount,
+            int startPlaybackPosition,
             boolean autoplay) {
-        
+
         super(fileToDetail);
         mAccount = ocAccount;
         mSavedPlaybackPosition = startPlaybackPosition;
         mAutoplay = autoplay;
     }
-    
-    
+
+
     /**
-     *  Creates an empty fragment for previews.
-     * 
-     *  MUST BE KEPT: the system uses it when tries to reinstantiate a fragment automatically 
-     *  (for instance, when the device is turned a aside).
-     * 
-     *  DO NOT CALL IT: an {@link OCFile} and {@link Account} must be provided for a successful 
-     *  construction 
+     * Creates an empty fragment for previews.
+     * <p/>
+     * MUST BE KEPT: the system uses it when tries to reinstantiate a fragment automatically
+     * (for instance, when the device is turned a aside).
+     * <p/>
+     * DO NOT CALL IT: an {@link OCFile} and {@link Account} must be provided for a successful
+     * construction
      */
     public PreviewMediaFragment() {
         super();
@@ -135,8 +134,8 @@ public class PreviewMediaFragment extends FileFragment implements
         mSavedPlaybackPosition = 0;
         mAutoplay = true;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
@@ -145,29 +144,29 @@ public class PreviewMediaFragment extends FileFragment implements
         super.onCreate(savedInstanceState);
         setHasOptionsMenu(true);
     }
-    
+
 
     /**
      * {@inheritDoc}
      */
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container,
-            Bundle savedInstanceState) {
+                             Bundle savedInstanceState) {
         super.onCreateView(inflater, container, savedInstanceState);
         Log_OC.e(TAG, "onCreateView");
 
-        
+
         mView = inflater.inflate(R.layout.file_preview, container, false);
-        
-        mImagePreview = (ImageView)mView.findViewById(R.id.image_preview);
-        mVideoPreview = (VideoView)mView.findViewById(R.id.video_preview);
+
+        mImagePreview = (ImageView) mView.findViewById(R.id.image_preview);
+        mVideoPreview = (VideoView) mView.findViewById(R.id.video_preview);
         mVideoPreview.setOnTouchListener(this);
-        
-        mMediaController = (MediaControlView)mView.findViewById(R.id.media_controller);
-        
+
+        mMediaController = (MediaControlView) mView.findViewById(R.id.media_controller);
+
         return mView;
     }
-    
+
 
     /**
      * {@inheritDoc}
@@ -188,29 +187,31 @@ public class PreviewMediaFragment extends FileFragment implements
             if (!file.isDown()) {
                 throw new IllegalStateException("There is no local file to preview");
             }
-            
-        } else {
-            file = (OCFile)savedInstanceState.getParcelable(PreviewMediaFragment.EXTRA_FILE);
+
+        }
+        else {
+            file = (OCFile) savedInstanceState.getParcelable(PreviewMediaFragment.EXTRA_FILE);
             setFile(file);
             mAccount = savedInstanceState.getParcelable(PreviewMediaFragment.EXTRA_ACCOUNT);
-            mSavedPlaybackPosition = 
+            mSavedPlaybackPosition =
                     savedInstanceState.getInt(PreviewMediaFragment.EXTRA_PLAY_POSITION);
             mAutoplay = savedInstanceState.getBoolean(PreviewMediaFragment.EXTRA_PLAYING);
-            
+
         }
         if (file != null && file.isDown()) {
             if (file.isVideo()) {
                 mVideoPreview.setVisibility(View.VISIBLE);
                 mImagePreview.setVisibility(View.GONE);
                 prepareVideo();
-            
-            } else {
+
+            }
+            else {
                 mVideoPreview.setVisibility(View.GONE);
                 mImagePreview.setVisibility(View.VISIBLE);
                 extractAndSetCoverArt(file);
             }
         }
-        
+
     }
 
     /**
@@ -244,24 +245,25 @@ public class PreviewMediaFragment extends FileFragment implements
     public void onSaveInstanceState(Bundle outState) {
         super.onSaveInstanceState(outState);
         Log_OC.e(TAG, "onSaveInstanceState");
-        
+
         outState.putParcelable(PreviewMediaFragment.EXTRA_FILE, getFile());
         outState.putParcelable(PreviewMediaFragment.EXTRA_ACCOUNT, mAccount);
-        
+
         if (getFile().isVideo()) {
             mSavedPlaybackPosition = mVideoPreview.getCurrentPosition();
             mAutoplay = mVideoPreview.isPlaying();
-            outState.putInt(PreviewMediaFragment.EXTRA_PLAY_POSITION , mSavedPlaybackPosition);
-            outState.putBoolean(PreviewMediaFragment.EXTRA_PLAYING , mAutoplay);
-        } else {
+            outState.putInt(PreviewMediaFragment.EXTRA_PLAY_POSITION, mSavedPlaybackPosition);
+            outState.putBoolean(PreviewMediaFragment.EXTRA_PLAYING, mAutoplay);
+        }
+        else {
             outState.putInt(
-                    PreviewMediaFragment.EXTRA_PLAY_POSITION , 
+                    PreviewMediaFragment.EXTRA_PLAY_POSITION,
                     mMediaServiceBinder.getCurrentPosition());
             outState.putBoolean(
-                    PreviewMediaFragment.EXTRA_PLAYING , mMediaServiceBinder.isPlaying());
+                    PreviewMediaFragment.EXTRA_PLAYING, mMediaServiceBinder.isPlaying());
         }
     }
-    
+
 
     @Override
     public void onStart() {
@@ -270,17 +272,20 @@ public class PreviewMediaFragment extends FileFragment implements
 
         OCFile file = getFile();
         if (file != null && file.isDown()) {
-           if (file.isAudio()) {
-               bindMediaService();
-               
-           } else if (file.isVideo()) {
-               stopAudio();
-               playVideo(); 
-           }
+            if (file.isAudio()) {
+                bindMediaService();
+
+            }
+            else {
+                if (file.isVideo()) {
+                    stopAudio();
+                    playVideo();
+                }
+            }
         }
     }
-    
-    
+
+
     private void stopAudio() {
         Intent i = new Intent(getActivity(), MediaService.class);
         i.setAction(MediaService.ACTION_STOP_ALL);
@@ -304,7 +309,7 @@ public class PreviewMediaFragment extends FileFragment implements
     @Override
     public void onPrepareOptionsMenu(Menu menu) {
         super.onPrepareOptionsMenu(menu);
-        
+
         if (mContainerActivity.getStorageManager() != null) {
             FileMenuFilter mf = new FileMenuFilter(
                 getFile(),
@@ -329,9 +334,16 @@ public class PreviewMediaFragment extends FileFragment implements
             item.setVisible(false);
             item.setEnabled(false);
         }
+
+        // additional restriction for this fragment
+        item = menu.findItem(R.id.action_copy);
+        if (item != null) {
+            item.setVisible(false);
+            item.setEnabled(false);
+        }
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
@@ -381,26 +393,26 @@ public class PreviewMediaFragment extends FileFragment implements
                 return false;
         }
     }
-    
 
 
     /**
      * Update the file of the fragment with file value
+     *
      * @param file
      */
-    public void updateFile(OCFile file){
+    public void updateFile(OCFile file) {
         setFile(file);
     }
-    
+
     private void sendFile() {
         stopPreview(false);
         mContainerActivity.getFileOperationsHelper().sendDownloadedFile(getFile());
-        
+
     }
 
     private void seeDetails() {
         stopPreview(false);
-        mContainerActivity.showDetails(getFile());        
+        mContainerActivity.showDetails(getFile());
     }
 
 
@@ -411,77 +423,80 @@ public class PreviewMediaFragment extends FileFragment implements
         mVideoPreview.setOnCompletionListener(mVideoHelper);
         mVideoPreview.setOnErrorListener(mVideoHelper);
     }
-    
+
     @SuppressWarnings("static-access")
     private void playVideo() {
         // create and prepare control panel for the user
         mMediaController.setMediaPlayer(mVideoPreview);
-        
+
         // load the video file in the video player ; 
         // when done, VideoHelper#onPrepared() will be called
         Uri uri = Uri.parse(getFile().getStoragePath());
         mVideoPreview.setVideoPath(uri.encode(getFile().getStoragePath()));
     }
-    
+
 
     private class VideoHelper implements OnCompletionListener, OnPreparedListener, OnErrorListener {
-        
-        /** 
+
+        /**
          * Called when the file is ready to be played.
-         * 
+         * <p/>
          * Just starts the playback.
-         * 
+         *
          * @param   vp    {@link MediaPlayer} instance performing the playback.
          */
         @Override
         public void onPrepared(MediaPlayer vp) {
             Log_OC.e(TAG, "onPrepared");
             mVideoPreview.seekTo(mSavedPlaybackPosition);
-            if (mAutoplay) { 
+            if (mAutoplay) {
                 mVideoPreview.start();
             }
             mMediaController.setEnabled(true);
             mMediaController.updatePausePlay();
             mPrepared = true;
         }
-        
-        
+
+
         /**
          * Called when the file is finished playing.
-         *  
+         * <p/>
          * Finishes the activity.
-         * 
-         * @param   mp    {@link MediaPlayer} instance performing the playback.
+         *
+         * @param mp {@link MediaPlayer} instance performing the playback.
          */
         @Override
-        public void onCompletion(MediaPlayer  mp) {
+        public void onCompletion(MediaPlayer mp) {
             Log_OC.e(TAG, "completed");
             if (mp != null) {
                 mVideoPreview.seekTo(0);
                 // next lines are necessary to work around undesired video loops
                 if (Build.VERSION.SDK_INT == Build.VERSION_CODES.GINGERBREAD) {
-                    mVideoPreview.pause();   
-                    
-                } else if (Build.VERSION.SDK_INT == Build.VERSION_CODES.GINGERBREAD_MR1) {
-                    // mVideePreview.pause() is not enough
-                    
-                    mMediaController.setEnabled(false);
-                    mVideoPreview.stopPlayback();
-                    mAutoplay = false;
-                    mSavedPlaybackPosition = 0;
-                    mVideoPreview.setVideoPath(getFile().getStoragePath());
+                    mVideoPreview.pause();
+
+                }
+                else {
+                    if (Build.VERSION.SDK_INT == Build.VERSION_CODES.GINGERBREAD_MR1) {
+                        // mVideePreview.pause() is not enough
+
+                        mMediaController.setEnabled(false);
+                        mVideoPreview.stopPlayback();
+                        mAutoplay = false;
+                        mSavedPlaybackPosition = 0;
+                        mVideoPreview.setVideoPath(getFile().getStoragePath());
+                    }
                 }
             } // else : called from onError()
             mMediaController.updatePausePlay();
         }
-        
-        
+
+
         /**
          * Called when an error in playback occurs.
-         * 
-         * @param   mp      {@link MediaPlayer} instance performing the playback.
-         * @param   what    Type of error
-         * @param   extra   Extra code specific to the error
+         *
+         * @param mp    {@link MediaPlayer} instance performing the playback.
+         * @param what  Type of error
+         * @param extra Extra code specific to the error
          */
         @Override
         public boolean onError(MediaPlayer mp, int what, int extra) {
@@ -502,28 +517,28 @@ public class PreviewMediaFragment extends FileFragment implements
             }
             return true;
         }
-        
+
     }
 
-    
+
     @Override
     public void onPause() {
         Log_OC.e(TAG, "onPause");
         super.onPause();
     }
-    
+
     @Override
     public void onResume() {
         super.onResume();
         Log_OC.e(TAG, "onResume");
     }
-    
+
     @Override
     public void onDestroy() {
         Log_OC.e(TAG, "onDestroy");
         super.onDestroy();
     }
-    
+
     @Override
     public void onStop() {
         Log_OC.e(TAG, "onStop");
@@ -538,10 +553,10 @@ public class PreviewMediaFragment extends FileFragment implements
             mMediaServiceConnection = null;
             mMediaServiceBinder = null;
         }
-        
+
         super.onStop();
     }
-    
+
     @Override
     public boolean onTouch(View v, MotionEvent event) {
         if (event.getAction() == MotionEvent.ACTION_DOWN && v == mVideoPreview) {
@@ -554,7 +569,7 @@ public class PreviewMediaFragment extends FileFragment implements
         return false;
     }
 
-    
+
     private void startFullScreenVideo() {
         Intent i = new Intent(getActivity(), PreviewVideoActivity.class);
         i.putExtra(FileActivity.EXTRA_ACCOUNT, mAccount);
@@ -566,29 +581,30 @@ public class PreviewMediaFragment extends FileFragment implements
     }
 
     @Override
-    public void onConfigurationChanged (Configuration newConfig) {
+    public void onConfigurationChanged(Configuration newConfig) {
         Log_OC.e(TAG, "onConfigurationChanged " + this);
     }
-    
+
     @Override
-    public void onActivityResult (int requestCode, int resultCode, Intent data) {
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
         Log_OC.e(TAG, "onActivityResult " + this);
         super.onActivityResult(requestCode, resultCode, data);
         if (resultCode == Activity.RESULT_OK) {
             mSavedPlaybackPosition = data.getExtras().getInt(
                     PreviewVideoActivity.EXTRA_START_POSITION);
-            mAutoplay = data.getExtras().getBoolean(PreviewVideoActivity.EXTRA_AUTOPLAY); 
+            mAutoplay = data.getExtras().getBoolean(PreviewVideoActivity.EXTRA_AUTOPLAY);
         }
     }
-    
+
 
     private void playAudio() {
         OCFile file = getFile();
         if (!mMediaServiceBinder.isPlaying(file)) {
             Log_OC.d(TAG, "starting playback of " + file.getStoragePath());
             mMediaServiceBinder.start(mAccount, file, mAutoplay, mSavedPlaybackPosition);
-            
-        } else {
+
+        }
+        else {
             if (!mMediaServiceBinder.isPlaying() && mAutoplay) {
                 mMediaServiceBinder.start();
                 mMediaController.updatePausePlay();
@@ -625,7 +641,8 @@ public class PreviewMediaFragment extends FileFragment implements
 
                         Log_OC.d(TAG, "Successfully bound to MediaService, MediaController ready");
 
-                    } else {
+                    }
+                    else {
                         Log_OC.e(TAG, "Unexpected response from MediaService while binding");
                     }
                 }
@@ -647,7 +664,8 @@ public class PreviewMediaFragment extends FileFragment implements
                 Log_OC.e(TAG, "Media service suddenly disconnected");
                 if (mMediaController != null) {
                     mMediaController.setMediaPlayer(null);
-                } else {
+                }
+                else {
                     Toast.makeText(
                             getActivity(),
                             "No media controller to release when disconnected from media service", 
@@ -657,9 +675,8 @@ public class PreviewMediaFragment extends FileFragment implements
                 mMediaServiceConnection = null;
             }
         }
-    }    
+    }
 
-    
 
     /**
      * Opens the previewed file with an external application.
@@ -669,31 +686,33 @@ public class PreviewMediaFragment extends FileFragment implements
         mContainerActivity.getFileOperationsHelper().openFile(getFile());
         finish();
     }
-    
+
     /**
      * Helper method to test if an {@link OCFile} can be passed to a {@link PreviewMediaFragment}
-     *  to be previewed.
-     * 
-     * @param file      File to test if can be previewed.
-     * @return          'True' if the file can be handled by the fragment.
+     * to be previewed.
+     *
+     * @param file File to test if can be previewed.
+     * @return 'True' if the file can be handled by the fragment.
      */
     public static boolean canBePreviewed(OCFile file) {
         return (file != null && (file.isAudio() || file.isVideo()));
     }
-    
+
 
     public void stopPreview(boolean stopAudio) {
         OCFile file = getFile();
         if (file.isAudio() && stopAudio) {
             mMediaServiceBinder.pause();
-            
-        } else if (file.isVideo()) {
-            mVideoPreview.stopPlayback();
+
+        }
+        else {
+            if (file.isVideo()) {
+                mVideoPreview.stopPlayback();
+            }
         }
     }
 
 
-
     /**
      * Finishes the preview
      */
@@ -709,12 +728,12 @@ public class PreviewMediaFragment extends FileFragment implements
         Log_OC.e(TAG, "getting position: " + mSavedPlaybackPosition);
         return mSavedPlaybackPosition;
     }
-    
+
     public boolean isPlaying() {
         if (mPrepared) {
             mAutoplay = mVideoPreview.isPlaying();
         }
         return mAutoplay;
     }
-    
+
 }
diff --git a/src/com/owncloud/android/ui/preview/PreviewTextFragment.java b/src/com/owncloud/android/ui/preview/PreviewTextFragment.java
new file mode 100644 (file)
index 0000000..6595bf7
--- /dev/null
@@ -0,0 +1,419 @@
+package com.owncloud.android.ui.preview;
+
+import android.accounts.Account;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentTransaction;
+import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import com.owncloud.android.R;
+import com.owncloud.android.datamodel.OCFile;
+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.dialog.ConfirmationDialogFragment;
+import com.owncloud.android.ui.dialog.LoadingDialog;
+import com.owncloud.android.ui.dialog.RemoveFileDialogFragment;
+import com.owncloud.android.ui.fragment.FileFragment;
+
+import java.io.BufferedWriter;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.lang.ref.WeakReference;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Scanner;
+
+public class PreviewTextFragment extends FileFragment {
+    private static final String EXTRA_FILE = "FILE";
+    private static final String EXTRA_ACCOUNT = "ACCOUNT";
+    private static final String TAG = PreviewTextFragment.class.getSimpleName();
+
+    private Account mAccount;
+    private TextView mTextPreview;
+    private TextLoadAsyncTask mTextLoadTask;
+
+    /**
+     * Creates an empty fragment for previews.
+     * <p/>
+     * MUST BE KEPT: the system uses it when tries to reinstantiate a fragment automatically
+     * (for instance, when the device is turned a aside).
+     * <p/>
+     * DO NOT CALL IT: an {@link OCFile} and {@link Account} must be provided for a successful
+     * construction
+     */
+    public PreviewTextFragment() {
+        super();
+        mAccount = null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public View onCreateView(LayoutInflater inflater, ViewGroup container,
+                             Bundle savedInstanceState) {
+        super.onCreateView(inflater, container, savedInstanceState);
+        Log_OC.e(TAG, "onCreateView");
+
+
+        View ret = inflater.inflate(R.layout.text_file_preview, container, false);
+
+        mTextPreview = (TextView) ret.findViewById(R.id.text_preview);
+
+        return ret;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        OCFile file = getFile();
+
+        Bundle args = getArguments();
+
+        if (file == null) {
+            file = args.getParcelable(FileDisplayActivity.EXTRA_FILE);
+        }
+
+        if (mAccount == null) {
+            mAccount = args.getParcelable(FileDisplayActivity.EXTRA_ACCOUNT);
+        }
+
+        if (savedInstanceState == null) {
+            if (file == null) {
+                throw new IllegalStateException("Instanced with a NULL OCFile");
+            }
+            if (mAccount == null) {
+                throw new IllegalStateException("Instanced with a NULL ownCloud Account");
+            }
+        } else {
+            file = savedInstanceState.getParcelable(EXTRA_FILE);
+            mAccount = savedInstanceState.getParcelable(EXTRA_ACCOUNT);
+        }
+        setFile(file);
+        setHasOptionsMenu(true);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void onSaveInstanceState(Bundle outState) {
+        super.onSaveInstanceState(outState);
+        outState.putParcelable(PreviewTextFragment.EXTRA_FILE, getFile());
+        outState.putParcelable(PreviewTextFragment.EXTRA_ACCOUNT, mAccount);
+    }
+
+    @Override
+    public void onStart() {
+        super.onStart();
+        Log_OC.e(TAG, "onStart");
+
+        loadAndShowTextPreview();
+    }
+
+    private void loadAndShowTextPreview() {
+        mTextLoadTask = new TextLoadAsyncTask(new WeakReference<TextView>(mTextPreview));
+        mTextLoadTask.execute(getFile().getStoragePath());
+    }
+
+
+    /**
+     * Reads the file to preview and shows its contents. Too critical to be anonymous.
+     */
+    private class TextLoadAsyncTask extends AsyncTask<Object, Void, StringWriter> {
+        private final String DIALOG_WAIT_TAG = "DIALOG_WAIT";
+        private final WeakReference<TextView> mTextViewReference;
+
+        private TextLoadAsyncTask(WeakReference<TextView> textView) {
+            mTextViewReference = textView;
+        }
+
+
+        @Override
+        protected void onPreExecute() {
+            showLoadingDialog();
+        }
+
+        @Override
+        protected StringWriter doInBackground(java.lang.Object... params) {
+            if (params.length != 1) {
+                throw new IllegalArgumentException("The parameter to " + TextLoadAsyncTask.class.getName() + " must be (1) the file location");
+            }
+            final String location = (String) params[0];
+
+            FileInputStream inputStream = null;
+            Scanner sc = null;
+            StringWriter source = new StringWriter();
+            BufferedWriter bufferedWriter = new BufferedWriter(source);
+            try {
+                inputStream = new FileInputStream(location);
+                sc = new Scanner(inputStream);
+                while (sc.hasNextLine()) {
+                    bufferedWriter.append(sc.nextLine());
+                    if (sc.hasNextLine()) bufferedWriter.append("\n");
+                }
+                bufferedWriter.close();
+                IOException exc = sc.ioException();
+                if (exc != null) throw exc;
+            } catch (IOException e) {
+                Log_OC.e(TAG, e.getMessage(), e);
+                finish();
+            } finally {
+                if (inputStream != null) {
+                    try {
+                        inputStream.close();
+                    } catch (IOException e) {
+                        Log_OC.e(TAG, e.getMessage(), e);
+                        finish();
+                    }
+                }
+                if (sc != null) {
+                    sc.close();
+                }
+            }
+            return source;
+        }
+
+        @Override
+        protected void onPostExecute(final StringWriter stringWriter) {
+            final TextView textView = mTextViewReference.get();
+
+            if (textView != null) {
+                textView.setText(new String(stringWriter.getBuffer()));
+                textView.setVisibility(View.VISIBLE);
+            }
+
+            dismissLoadingDialog();
+        }
+
+        /**
+         * Show loading dialog
+         */
+        public void showLoadingDialog() {
+            // only once
+            Fragment frag = getActivity().getSupportFragmentManager().findFragmentByTag(DIALOG_WAIT_TAG);
+            LoadingDialog loading = null;
+            if (frag == null) {
+                // Construct dialog
+                loading = new LoadingDialog(getResources().getString(R.string.wait_a_moment));
+                FragmentManager fm = getActivity().getSupportFragmentManager();
+                FragmentTransaction ft = fm.beginTransaction();
+                loading.show(ft, DIALOG_WAIT_TAG);
+            } else {
+                loading = (LoadingDialog) frag;
+                loading.setShowsDialog(true);
+            }
+
+        }
+
+        /**
+         * Dismiss loading dialog
+         */
+        public void dismissLoadingDialog() {
+            final Fragment frag = getActivity().getSupportFragmentManager().findFragmentByTag(DIALOG_WAIT_TAG);
+            if (frag != null) {
+                LoadingDialog loading = (LoadingDialog) frag;
+                loading.dismiss();
+            }
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+        super.onCreateOptionsMenu(menu, inflater);
+        inflater.inflate(R.menu.file_actions_menu, menu);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void onPrepareOptionsMenu(Menu menu) {
+        super.onPrepareOptionsMenu(menu);
+
+        if (mContainerActivity.getStorageManager() != null) {
+            FileMenuFilter mf = new FileMenuFilter(
+                    getFile(),
+                    mContainerActivity.getStorageManager().getAccount(),
+                    mContainerActivity,
+                    getActivity()
+            );
+            mf.filter(menu);
+        }
+
+        // additional restriction for this fragment
+        MenuItem item = menu.findItem(R.id.action_rename_file);
+        if (item != null) {
+            item.setVisible(false);
+            item.setEnabled(false);
+        }
+
+        // additional restriction for this fragment
+        item = menu.findItem(R.id.action_move);
+        if (item != null) {
+            item.setVisible(false);
+            item.setEnabled(false);
+        }
+
+        // this one doesn't make sense since the file has to be down in order to be previewed
+        item = menu.findItem(R.id.action_download_file);
+        if (item != null) {
+            item.setVisible(false);
+            item.setEnabled(false);
+        }
+
+        item = menu.findItem(R.id.action_sync_file);
+        if (item != null) {
+            item.setVisible(false);
+            item.setEnabled(false);
+        }
+
+        item = menu.findItem(R.id.action_sync_account);
+        if (item != null) {
+            item.setVisible(false);
+            item.setEnabled(false);
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        switch (item.getItemId()) {
+            case R.id.action_share_file: {
+                mContainerActivity.getFileOperationsHelper().shareFileWithLink(getFile());
+                return true;
+            }
+            case R.id.action_unshare_file: {
+                mContainerActivity.getFileOperationsHelper().unshareFileWithLink(getFile());
+                return true;
+            }
+            case R.id.action_open_file_with: {
+                openFile();
+                return true;
+            }
+            case R.id.action_remove_file: {
+                RemoveFileDialogFragment dialog = RemoveFileDialogFragment.newInstance(getFile());
+                dialog.show(getFragmentManager(), ConfirmationDialogFragment.FTAG_CONFIRMATION);
+                return true;
+            }
+            case R.id.action_see_details: {
+                seeDetails();
+                return true;
+            }
+            case R.id.action_send_file: {
+                sendFile();
+                return true;
+            }
+            case R.id.action_sync_file: {
+                mContainerActivity.getFileOperationsHelper().syncFile(getFile());
+                return true;
+            }
+
+            default:
+                return false;
+        }
+    }
+
+    /**
+     * Update the file of the fragment with file value
+     *
+     * @param file The new file to set
+     */
+    public void updateFile(OCFile file) {
+        setFile(file);
+    }
+
+    private void sendFile() {
+        mContainerActivity.getFileOperationsHelper().sendDownloadedFile(getFile());
+    }
+
+    private void seeDetails() {
+        mContainerActivity.showDetails(getFile());
+    }
+
+    @Override
+    public void onPause() {
+        Log_OC.e(TAG, "onPause");
+        super.onPause();
+    }
+
+    @Override
+    public void onResume() {
+        super.onResume();
+        Log_OC.e(TAG, "onResume");
+    }
+
+    @Override
+    public void onDestroy() {
+        Log_OC.e(TAG, "onDestroy");
+        super.onDestroy();
+    }
+
+    @Override
+    public void onStop() {
+        super.onStop();
+        Log_OC.e(TAG, "onStop");
+        if (mTextLoadTask != null)
+            mTextLoadTask.cancel(Boolean.TRUE);
+    }
+
+    /**
+     * Opens the previewed file with an external application.
+     */
+    private void openFile() {
+        mContainerActivity.getFileOperationsHelper().openFile(getFile());
+        finish();
+    }
+
+    /**
+     * Helper method to test if an {@link OCFile} can be passed to a {@link PreviewTextFragment} to be previewed.
+     *
+     * @param file File to test if can be previewed.
+     * @return 'True' if the file can be handled by the fragment.
+     */
+    public static boolean canBePreviewed(OCFile file) {
+        final List<String> unsupportedTypes = new LinkedList<String>();
+        unsupportedTypes.add("text/richtext");
+        unsupportedTypes.add("text/rtf");
+        unsupportedTypes.add("text/vnd.abc");
+        unsupportedTypes.add("text/vnd.fmi.flexstor");
+        unsupportedTypes.add("text/vnd.rn-realtext");
+        unsupportedTypes.add("text/vnd.wap.wml");
+        unsupportedTypes.add("text/vnd.wap.wmlscript");
+        return (file != null && file.isDown() && file.isText() &&
+                !unsupportedTypes.contains(file.getMimetype()) &&
+                !unsupportedTypes.contains(file.getMimeTypeFromName())
+        );
+    }
+
+    /**
+     * Finishes the preview
+     */
+    private void finish() {
+        getActivity().runOnUiThread(new Runnable() {
+            @Override
+            public void run() {
+                getActivity().onBackPressed();
+            }
+        });
+    }
+}
index 3ae36e4..8a281e9 100644 (file)
 \r
 package com.owncloud.android.utils;\r
 \r
-import java.net.IDN;\r
-import java.text.DateFormat;\r
-import java.util.Arrays;\r
-import java.util.Calendar;\r
-import java.util.Date;\r
-import java.util.HashMap;\r
-import java.util.HashSet;\r
-import java.util.Set;\r
-import java.util.Vector;\r
-\r
 import android.annotation.TargetApi;\r
 import android.app.Activity;\r
 import android.content.Context;\r
-import android.graphics.Color;\r
 import android.graphics.Point;\r
 import android.graphics.PorterDuff;\r
 import android.os.Build;\r
 import android.text.format.DateUtils;\r
 import android.view.Display;\r
-import android.webkit.MimeTypeMap;\r
 import android.widget.ProgressBar;\r
 import android.widget.SeekBar;\r
 \r
@@ -49,73 +37,39 @@ import com.owncloud.android.MainApp;
 import com.owncloud.android.R;\r
 import com.owncloud.android.datamodel.OCFile;\r
 \r
+import java.net.IDN;\r
+import java.text.DateFormat;\r
+import java.util.Calendar;\r
+import java.util.Date;\r
+import java.util.HashMap;\r
+import java.util.Map;\r
+\r
 /**\r
  * A helper class for some string operations.\r
  */\r
 public class DisplayUtils {\r
     \r
     private static final String OWNCLOUD_APP_NAME = "ownCloud";\r
-\r
-    //private static String TAG = DisplayUtils.class.getSimpleName(); \r
     \r
     private static final String[] sizeSuffixes = { "B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB" };\r
 \r
-    private static HashMap<String, String> mimeType2HUmanReadable;\r
+    private static Map<String, String> mimeType2HumanReadable;\r
+\r
     static {\r
-        mimeType2HUmanReadable = new HashMap<String, String>();\r
+        mimeType2HumanReadable = new HashMap<String, String>();\r
         // images\r
-        mimeType2HUmanReadable.put("image/jpeg", "JPEG image");\r
-        mimeType2HUmanReadable.put("image/jpg", "JPEG image");\r
-        mimeType2HUmanReadable.put("image/png", "PNG image");\r
-        mimeType2HUmanReadable.put("image/bmp", "Bitmap image");\r
-        mimeType2HUmanReadable.put("image/gif", "GIF image");\r
-        mimeType2HUmanReadable.put("image/svg+xml", "JPEG image");\r
-        mimeType2HUmanReadable.put("image/tiff", "TIFF image");\r
+        mimeType2HumanReadable.put("image/jpeg", "JPEG image");\r
+        mimeType2HumanReadable.put("image/jpg", "JPEG image");\r
+        mimeType2HumanReadable.put("image/png", "PNG image");\r
+        mimeType2HumanReadable.put("image/bmp", "Bitmap image");\r
+        mimeType2HumanReadable.put("image/gif", "GIF image");\r
+        mimeType2HumanReadable.put("image/svg+xml", "JPEG image");\r
+        mimeType2HumanReadable.put("image/tiff", "TIFF image");\r
         // music\r
-        mimeType2HUmanReadable.put("audio/mpeg", "MP3 music file");\r
-        mimeType2HUmanReadable.put("application/ogg", "OGG music file");\r
-\r
+        mimeType2HumanReadable.put("audio/mpeg", "MP3 music file");\r
+        mimeType2HumanReadable.put("application/ogg", "OGG music file");\r
     }\r
 \r
-    private static final String TYPE_APPLICATION = "application";\r
-    private static final String TYPE_AUDIO = "audio";\r
-    private static final String TYPE_IMAGE = "image";\r
-    private static final String TYPE_TXT = "text";\r
-    private static final String TYPE_VIDEO = "video";\r
-    \r
-    private static final String SUBTYPE_PDF = "pdf";\r
-    private static final String SUBTYPE_XML = "xml";\r
-    private static final String[] SUBTYPES_DOCUMENT = { \r
-        "msword",\r
-        "vnd.openxmlformats-officedocument.wordprocessingml.document",\r
-        "vnd.oasis.opendocument.text",\r
-        "rtf",\r
-        "javascript"\r
-    };\r
-    private static Set<String> SUBTYPES_DOCUMENT_SET = new HashSet<String>(Arrays.asList(SUBTYPES_DOCUMENT));\r
-    private static final String[] SUBTYPES_SPREADSHEET = {\r
-        "msexcel",\r
-        "vnd.ms-excel",\r
-        "vnd.openxmlformats-officedocument.spreadsheetml.sheet",\r
-        "vnd.oasis.opendocument.spreadsheet"\r
-    };\r
-    private static Set<String> SUBTYPES_SPREADSHEET_SET = new HashSet<String>(Arrays.asList(SUBTYPES_SPREADSHEET));\r
-    private static final String[] SUBTYPES_PRESENTATION = { \r
-        "mspowerpoint",\r
-        "vnd.ms-powerpoint",\r
-        "vnd.openxmlformats-officedocument.presentationml.presentation",\r
-        "vnd.oasis.opendocument.presentation"\r
-    };\r
-    private static Set<String> SUBTYPES_PRESENTATION_SET = new HashSet<String>(Arrays.asList(SUBTYPES_PRESENTATION));\r
-    private static final String[] SUBTYPES_COMPRESSED = {"x-tar", "x-gzip", "zip"};\r
-    private static final Set<String> SUBTYPES_COMPRESSED_SET = new HashSet<String>(Arrays.asList(SUBTYPES_COMPRESSED));\r
-    private static final String SUBTYPE_OCTET_STREAM = "octet-stream";\r
-    private static final String EXTENSION_RAR = "rar";\r
-    private static final String EXTENSION_RTF = "rtf";\r
-    private static final String EXTENSION_3GP = "3gp";\r
-    private static final String EXTENSION_PY = "py";\r
-    private static final String EXTENSION_JS = "js";\r
-    \r
     /**\r
      * Converts the file size in bytes to human readable output.\r
      * \r
@@ -141,100 +95,14 @@ public class DisplayUtils {
      * @return A human friendly version of the MIME type\r
      */\r
     public static String convertMIMEtoPrettyPrint(String mimetype) {\r
-        if (mimeType2HUmanReadable.containsKey(mimetype)) {\r
-            return mimeType2HUmanReadable.get(mimetype);\r
+        if (mimeType2HumanReadable.containsKey(mimetype)) {\r
+            return mimeType2HumanReadable.get(mimetype);\r
         }\r
         if (mimetype.split("/").length >= 2)\r
             return mimetype.split("/")[1].toUpperCase() + " file";\r
         return "Unknown type";\r
     }\r
-    \r
-    \r
-    /**\r
-     * Returns the resource identifier of an image to use as icon associated to a known MIME type.\r
-     * \r
-     * @param mimetype      MIME type string; if NULL, the method tries to guess it from the extension in filename\r
-     * @param filename      Name, with extension.\r
-     * @return              Identifier of an image resource.\r
-     */\r
-    public static int getFileTypeIconId(String mimetype, String filename) {\r
-\r
-        if (mimetype == null) {\r
-            String fileExtension = getExtension(filename);\r
-            mimetype = MimeTypeMap.getSingleton().getMimeTypeFromExtension(fileExtension);\r
-            if (mimetype == null) {\r
-                mimetype = TYPE_APPLICATION + "/" + SUBTYPE_OCTET_STREAM;\r
-            }\r
-        } \r
-            \r
-        if ("DIR".equals(mimetype)) {\r
-            return R.drawable.ic_menu_archive;\r
-\r
-        } else {\r
-            String [] parts = mimetype.split("/");\r
-            String type = parts[0];\r
-            String subtype = (parts.length > 1) ? parts[1] : "";\r
-            \r
-            if(TYPE_TXT.equals(type)) {\r
-                return R.drawable.file_doc;\r
-    \r
-            } else if(TYPE_IMAGE.equals(type)) {\r
-                return R.drawable.file_image;\r
-                \r
-            } else if(TYPE_VIDEO.equals(type)) {\r
-                return R.drawable.file_movie;\r
-                \r
-            } else if(TYPE_AUDIO.equals(type)) {  \r
-                return R.drawable.file_sound;\r
-                \r
-            } else if(TYPE_APPLICATION.equals(type)) {\r
-                \r
-                if (SUBTYPE_PDF.equals(subtype)) {\r
-                    return R.drawable.file_pdf;\r
-                    \r
-                } else if (SUBTYPE_XML.equals(subtype)) {\r
-                    return R.drawable.file_doc;\r
-\r
-                } else if (SUBTYPES_DOCUMENT_SET.contains(subtype)) {\r
-                    return R.drawable.file_doc;\r
-\r
-                } else if (SUBTYPES_SPREADSHEET_SET.contains(subtype)) {\r
-                    return R.drawable.file_xls;\r
-\r
-                } else if (SUBTYPES_PRESENTATION_SET.contains(subtype)) {\r
-                    return R.drawable.file_ppt;\r
 \r
-                } else if (SUBTYPES_COMPRESSED_SET.contains(subtype)) {\r
-                    return R.drawable.file_zip;\r
-\r
-                } else if (SUBTYPE_OCTET_STREAM.equals(subtype) ) {\r
-                    if (getExtension(filename).equalsIgnoreCase(EXTENSION_RAR)) {\r
-                        return R.drawable.file_zip;\r
-                        \r
-                    } else if (getExtension(filename).equalsIgnoreCase(EXTENSION_RTF)) {\r
-                        return R.drawable.file_doc;\r
-                        \r
-                    } else if (getExtension(filename).equalsIgnoreCase(EXTENSION_3GP)) {\r
-                        return R.drawable.file_movie;\r
-                     \r
-                    } else if ( getExtension(filename).equalsIgnoreCase(EXTENSION_PY) ||\r
-                                getExtension(filename).equalsIgnoreCase(EXTENSION_JS)) {\r
-                        return R.drawable.file_doc;\r
-                    } \r
-                } \r
-            }\r
-        }\r
-\r
-        // default icon\r
-        return R.drawable.file;\r
-    }\r
-\r
-    \r
-    private static String getExtension(String filename) {\r
-        String extension = filename.substring(filename.lastIndexOf(".") + 1).toLowerCase();\r
-        return extension;\r
-    }\r
-    \r
     /**\r
      * Converts Unix time to human readable format\r
      * @param milliseconds that have passed since 01/01/1970\r
@@ -246,7 +114,6 @@ public class DisplayUtils {
         return df.format(date);\r
     }\r
     \r
-    \r
     public static int getSeasonalIconId() {\r
         if (Calendar.getInstance().get(Calendar.DAY_OF_YEAR) >= 354 &&\r
                 MainApp.getAppContext().getString(R.string.app_name).equals(OWNCLOUD_APP_NAME)) {\r
index 75736e5..b80cc57 100644 (file)
 
 package com.owncloud.android.utils;
 
-import java.io.File;
-import java.net.SocketTimeoutException;
-
-import org.apache.commons.httpclient.ConnectTimeoutException;
-
 import android.content.res.Resources;
 
 import com.owncloud.android.R;
 import com.owncloud.android.lib.common.operations.RemoteOperation;
 import com.owncloud.android.lib.common.operations.RemoteOperationResult;
 import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.operations.CopyFileOperation;
 import com.owncloud.android.operations.CreateFolderOperation;
 import com.owncloud.android.operations.CreateShareOperation;
 import com.owncloud.android.operations.DownloadFileOperation;
@@ -43,6 +39,11 @@ import com.owncloud.android.operations.SynchronizeFolderOperation;
 import com.owncloud.android.operations.UnshareLinkOperation;
 import com.owncloud.android.operations.UploadFileOperation;
 
+import org.apache.commons.httpclient.ConnectTimeoutException;
+
+import java.io.File;
+import java.net.SocketTimeoutException;
+
 /**
  * Class to choose proper error messages to show to the user depending on the results of operations,
  * always following the same policy
@@ -51,16 +52,16 @@ import com.owncloud.android.operations.UploadFileOperation;
 public class ErrorMessageAdapter {
 
     public ErrorMessageAdapter() {
-        
+
     }
 
     public static String getErrorCauseMessage(RemoteOperationResult result,
                                               RemoteOperation operation, Resources res) {
         
         String message = null;
-        
+
         if (operation instanceof UploadFileOperation) {
-            
+
             if (result.isSuccess()) {
                 message = String.format(
                         res.getString(R.string.uploader_upload_succeeded_content_single),
@@ -76,7 +77,7 @@ public class ErrorMessageAdapter {
                 } else if (result.getCode() == ResultCode.QUOTA_EXCEEDED) {
                     message = res.getString(R.string.failed_upload_quota_exceeded_text);
                     */
-                    
+
                 } else if (result.getCode() == ResultCode.FORBIDDEN) {
                     message = String.format(res.getString(R.string.forbidden_permissions),
                             res.getString(R.string.uploader_upload_forbidden_permissions));
@@ -90,14 +91,14 @@ public class ErrorMessageAdapter {
                             ((UploadFileOperation) operation).getFileName());
                 }
             }
-            
+
         } else if (operation instanceof DownloadFileOperation) {
-            
+
             if (result.isSuccess()) {
                 message = String.format(
                         res.getString(R.string.downloader_download_succeeded_content),
                         new File(((DownloadFileOperation) operation).getSavePath()).getName());
-                
+
             } else {
                 if (result.getCode() == ResultCode.FILE_NOT_FOUND) {
                     message = res.getString(R.string.downloader_download_file_not_found);
@@ -108,11 +109,11 @@ public class ErrorMessageAdapter {
                             ((DownloadFileOperation) operation).getSavePath()).getName());
                 }
             }
-            
+
         } else if (operation instanceof RemoveFileOperation) {
             if (result.isSuccess()) {
                 message = res.getString(R.string.remove_success_msg);
-                
+
             } else {
                 if (result.getCode().equals(ResultCode.FORBIDDEN)) {
                     // Error --> No permissions
@@ -120,7 +121,7 @@ public class ErrorMessageAdapter {
                             res.getString(R.string.forbidden_permissions_delete));
                 } else if (isNetworkError(result.getCode())) {
                     message = getErrorMessage(result, res);
-                    
+
                 } else {
                     message = res.getString(R.string.remove_fail_msg);
                 }
@@ -140,19 +141,19 @@ public class ErrorMessageAdapter {
 
             } else if (isNetworkError(result.getCode())) {
                 message = getErrorMessage(result, res);
-                
+
             } else if (result.getCode() == ResultCode.INVALID_CHARACTER_DETECT_IN_SERVER) {
                 message = res.getString(R.string.filename_forbidden_charaters_from_server);
 
             } else {
-                message = res.getString(R.string.rename_server_fail_msg); 
+                message = res.getString(R.string.rename_server_fail_msg);
             }
-            
+
         } else if (operation instanceof SynchronizeFileOperation) {
             if (!((SynchronizeFileOperation) operation).transferWasRequested()) {
                 message = res.getString(R.string.sync_file_nothing_to_do_msg);
             }
-            
+
         } else if (operation instanceof CreateFolderOperation) {
             if (result.getCode() == ResultCode.INVALID_CHARACTER_IN_NAME) {
                 message = res.getString(R.string.filename_forbidden_characters);
@@ -163,7 +164,7 @@ public class ErrorMessageAdapter {
 
             } else if (isNetworkError(result.getCode())) {
                 message = getErrorMessage(result, res);
-                
+
             } else if (result.getCode() == ResultCode.INVALID_CHARACTER_DETECT_IN_SERVER) {
                 message = res.getString(R.string.filename_forbidden_charaters_from_server);
             } else {
@@ -172,7 +173,7 @@ public class ErrorMessageAdapter {
         } else if (operation instanceof CreateShareOperation) {        
             if (result.getCode() == ResultCode.SHARE_NOT_FOUND)  {      // Error --> SHARE_NOT_FOUND
                 message = res.getString(R.string.share_link_file_no_exist);
-                
+
             } else if (result.getCode() == ResultCode.SHARE_FORBIDDEN) {
                 // Error --> No permissions
                 message = String.format(res.getString(R.string.forbidden_permissions),
@@ -180,17 +181,17 @@ public class ErrorMessageAdapter {
 
             } else if (isNetworkError(result.getCode())) {
                 message = getErrorMessage(result, res);
-                
+
             } else {    // Generic error
                 // Show a Message, operation finished without success
                 message = res.getString(R.string.share_link_file_error);
             }
-            
+
         } else if (operation instanceof UnshareLinkOperation) {
-        
+
             if (result.getCode() == ResultCode.SHARE_NOT_FOUND)  {      // Error --> SHARE_NOT_FOUND
                 message = res.getString(R.string.unshare_link_file_no_exist);
-                
+
             } else if (result.getCode() == ResultCode.SHARE_FORBIDDEN) {
                 // Error --> No permissions
                 message = String.format(res.getString(R.string.forbidden_permissions),
@@ -198,17 +199,18 @@ public class ErrorMessageAdapter {
 
             } else if (isNetworkError(result.getCode())) {
                 message = getErrorMessage(result, res);
-                
+
             } else {    // Generic error
                 // Show a Message, operation finished without success
                 message = res.getString(R.string.unshare_link_file_error);
             }
         } else if (operation instanceof MoveFileOperation) {
 
-            if (result.getCode() == ResultCode.FILE_NOT_FOUND) {
+            if(isNetworkError(result.getCode())){
+                message = getErrorMessage(result, res);
+            } else if (result.getCode() == ResultCode.FILE_NOT_FOUND) {
                 message = res.getString(R.string.move_file_not_found);
-                
-            } else if (result.getCode() == ResultCode.INVALID_MOVE_INTO_DESCENDANT)  {
+            } else if (result.getCode() == ResultCode.INVALID_MOVE_INTO_DESCENDANT) {
                 message = res.getString(R.string.move_file_invalid_into_descendent);
 
             } else if (result.getCode() == ResultCode.INVALID_OVERWRITE) {
@@ -240,44 +242,62 @@ public class ErrorMessageAdapter {
                             folderPathName);
                 }
             }
+        } else if (operation instanceof CopyFileOperation) {
+            if(isNetworkError(result.getCode())){
+                message = getErrorMessage(result, res);
+            } else if (result.getCode() == ResultCode.FILE_NOT_FOUND) {
+                message = res.getString(R.string.copy_file_not_found);
+            } else if (result.getCode() == ResultCode.INVALID_COPY_INTO_DESCENDANT) {
+                message = res.getString(R.string.copy_file_invalid_into_descendent);
+
+            } else if (result.getCode() == ResultCode.INVALID_OVERWRITE) {
+                message = res.getString(R.string.copy_file_invalid_overwrite);
+
+            } else if (result.getCode() == ResultCode.FORBIDDEN) {
+                message = String.format(res.getString(R.string.forbidden_permissions),
+                        res.getString(R.string.forbidden_permissions_copy));
+
+            } else {    // Generic error
+                // Show a Message, operation finished without success
+                message = res.getString(R.string.copy_file_error);
+            }
         }
-        
+
         return message;
     }
-    
-    private static String getErrorMessage(RemoteOperationResult result , Resources res) {
-        
+
+    private static String getErrorMessage(RemoteOperationResult result, Resources res) {
+
         String message = null;
-        
+
         if (!result.isSuccess()) {
-            
+
             if (result.getCode() == ResultCode.WRONG_CONNECTION) {
                 message = res.getString(R.string.network_error_socket_exception);
-                
+
             } else if (result.getCode() == ResultCode.TIMEOUT) {
                 message = res.getString(R.string.network_error_socket_exception);
-                
+
                 if (result.getException() instanceof SocketTimeoutException) {
                     message = res.getString(R.string.network_error_socket_timeout_exception);
-                } else if(result.getException() instanceof ConnectTimeoutException) {
+                } else if (result.getException() instanceof ConnectTimeoutException) {
                     message = res.getString(R.string.network_error_connect_timeout_exception);
-                } 
-                
+                }
+
             } else if (result.getCode() == ResultCode.HOST_NOT_AVAILABLE) {
                 message = res.getString(R.string.network_host_not_available);
             }
         }
-        
+
         return message;
     }
-    
+
     private static boolean isNetworkError(RemoteOperationResult.ResultCode code) {
-        if (code == ResultCode.WRONG_CONNECTION || 
-                code == ResultCode.TIMEOUT || 
+        if (code == ResultCode.WRONG_CONNECTION ||
+                code == ResultCode.TIMEOUT ||
                 code == ResultCode.HOST_NOT_AVAILABLE) {
             return true;
-        }
-        else
+        } else
             return false;
     }
 }
index 2b6d68b..3983771 100644 (file)
@@ -46,12 +46,12 @@ import android.webkit.MimeTypeMap;
  * Static methods to help in access to local file system.
  */
 public class FileStorageUtils {
-    public static Integer mSortOrder;
-    public static Boolean mSortAscending;
     public static final Integer SORT_NAME = 0;
     public static final Integer SORT_DATE = 1;
     public static final Integer SORT_SIZE = 2;
-  
+    public static Integer mSortOrder = SORT_NAME;
+    public static Boolean mSortAscending = true;
+
     
     //private static final String LOG_TAG = "FileStorageUtils";
 
diff --git a/src/com/owncloud/android/utils/MimetypeIconUtil.java b/src/com/owncloud/android/utils/MimetypeIconUtil.java
new file mode 100644 (file)
index 0000000..bd8c5d9
--- /dev/null
@@ -0,0 +1,428 @@
+package com.owncloud.android.utils;
+
+import android.webkit.MimeTypeMap;
+
+import com.owncloud.android.R;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>Helper class for detecting the right icon for a file or folder,
+ * based on its mime type and file extension.</p>
+ *
+ * This class maintains all the necessary mappings fot these detections.<br/>
+ * In order to add further mappings, there are up to three look up maps that need further values:
+ * <ol>
+ *     <li>
+ *         {@link MimetypeIconUtil#FILE_EXTENSION_TO_MIMETYPE_MAPPING}<br/>
+ *         to add a new file extension to mime type mapping
+ *     </li>
+ *     <li>
+ *         {@link MimetypeIconUtil#MIMETYPE_TO_ICON_MAPPING}<br/>
+ *         to add a new mapping of a mime type to an icon mapping
+ *     </li>
+ *     <li>
+ *         {@link MimetypeIconUtil#MAINMIMETYPE_TO_ICON_MAPPING}<br/>
+ *         to add a new mapping for the main part of a mime type.
+ *         This is a list of fallback mappings in case there is no mapping for the complete mime type
+ *     </li>
+ * </ol>
+ */
+public class MimetypeIconUtil {
+    /** Mapping: icon for mime type */
+    private static final Map<String, Integer> MIMETYPE_TO_ICON_MAPPING = new HashMap<String, Integer>();
+    /** Mapping: icon for main mime type (first part of a mime type declaration). */
+    private static final Map<String, Integer> MAINMIMETYPE_TO_ICON_MAPPING = new HashMap<String, Integer>();
+    /** Mapping: mime type for file extension. */
+    private static final Map<String, List<String>> FILE_EXTENSION_TO_MIMETYPE_MAPPING =
+            new HashMap<String, List<String>>();
+
+    static {
+        populateFileExtensionMimeTypeMapping();
+        populateMimeTypeIconMapping();
+        populateMainMimeTypeMapping();
+    }
+
+    /**
+     * Returns the resource identifier of an image to use as icon associated to a known MIME type.
+     *
+     * @param mimetype MIME type string; if NULL, the method tries to guess it from the extension in filename
+     * @param filename Name, with extension.
+     * @return Identifier of an image resource.
+     */
+    public static int getFileTypeIconId(String mimetype, String filename) {
+        List<String> possibleMimeTypes;
+        if (mimetype == null) {
+            possibleMimeTypes = determineMimeTypesByFilename(filename);
+        } else {
+            possibleMimeTypes = Collections.singletonList(mimetype);
+        }
+
+        return determineIconIdByMimeTypeList(possibleMimeTypes);
+    }
+
+    /**
+     * Returns the resource identifier of an image to use as icon associated to a type of folder.
+     *
+     * @param isSharedWithUser flag if the folder is shared with the user
+     * @param isShareByLink flag if the folder is shared by link
+     * @return Identifier of an image resource.
+     */
+    public static int getFolderTypeIconId(boolean isSharedWithUser, boolean isShareByLink) {
+        if (isSharedWithUser) {
+            return R.drawable.shared_with_me_folder;
+        } else if (isShareByLink) {
+            return R.drawable.folder_public;
+        }
+
+        return R.drawable.ic_menu_archive;
+    }
+
+    /**
+     * determines the icon based on the mime type.
+     *
+     * @param mimetypes the mimetypes
+     * @return the icon id, R.drawable.file if the mime type could not be matched at all or was {@code null}
+     */
+    private static int determineIconIdByMimeTypeList(List<String> mimetypes) {
+        // no mime type leads to file
+        if (mimetypes == null || mimetypes.size() < 1) {
+            return R.drawable.file;
+        } else {
+
+            // search for full mime type mapping
+            for (String mimetype : mimetypes) {
+                Integer iconId = MIMETYPE_TO_ICON_MAPPING.get(mimetype);
+
+                if (iconId != null) {
+                    return iconId;
+                }
+            }
+
+            // fallback to main mime type part mapping
+            for (String mimetype : mimetypes) {
+                String mainMimetypePart = mimetype.split("/")[0];
+
+                Integer iconId = MAINMIMETYPE_TO_ICON_MAPPING.get(mainMimetypePart);
+                if (iconId != null) {
+                    return iconId;
+                }
+            }
+        }
+
+        // no match found at all, falling back to file
+        return R.drawable.file;
+    }
+
+    /**
+     * determines the list of possible mime types for the given file, based on its extension.
+     *
+     * @param filename the file name
+     * @return list of possible mime types (ordered), empty list in case no mime types found
+     */
+    private static List<String> determineMimeTypesByFilename(String filename) {
+        String fileExtension = getExtension(filename);
+
+        // try detecting the mimetype based on the web app logic equivalent
+        List<String> mimeTypeList = FILE_EXTENSION_TO_MIMETYPE_MAPPING.get(fileExtension);
+        if (mimeTypeList != null && mimeTypeList.size() > 0) {
+            return mimeTypeList;
+        } else {
+            // try detecting the mime type via android itself
+            String mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(fileExtension);
+            if (mimeType != null) {
+                return Collections.singletonList(mimeType);
+            } else {
+                return new ArrayList<String>();
+            }
+        }
+    }
+
+    /**
+     * provides the file extension of a given filename.
+     *
+     * @param filename the filename
+     * @return the file extension
+     */
+    private static String getExtension(String filename) {
+        String extension = filename.substring(filename.lastIndexOf(".") + 1).toLowerCase();
+        return extension;
+    }
+
+    /**
+     * populates the mapping list:  full mime type --> icon.
+     */
+    private static void populateMimeTypeIconMapping() {
+        MIMETYPE_TO_ICON_MAPPING.put("application/coreldraw", R.drawable.file_image);
+        MIMETYPE_TO_ICON_MAPPING.put("application/epub+zip", R.drawable.file_text);
+        MIMETYPE_TO_ICON_MAPPING.put("application/font-sfnt", R.drawable.file_image);
+        MIMETYPE_TO_ICON_MAPPING.put("application/font-woff", R.drawable.file_image);
+        MIMETYPE_TO_ICON_MAPPING.put("application/illustrator", R.drawable.file_image);
+        MIMETYPE_TO_ICON_MAPPING.put("application/javascript", R.drawable.file_code);
+        MIMETYPE_TO_ICON_MAPPING.put("application/json", R.drawable.file_code);
+        MIMETYPE_TO_ICON_MAPPING.put("application/msaccess", R.drawable.file);
+        MIMETYPE_TO_ICON_MAPPING.put("application/msexcel", R.drawable.file_xls);
+        MIMETYPE_TO_ICON_MAPPING.put("application/mspowerpoint", R.drawable.file_ppt);
+        MIMETYPE_TO_ICON_MAPPING.put("application/msword", R.drawable.file_doc);
+        MIMETYPE_TO_ICON_MAPPING.put("application/octet-stream", R.drawable.file);
+        MIMETYPE_TO_ICON_MAPPING.put("application/postscript", R.drawable.file_image);
+        MIMETYPE_TO_ICON_MAPPING.put("application/pdf", R.drawable.file_pdf);
+        MIMETYPE_TO_ICON_MAPPING.put("application/rss+xml", R.drawable.file_code);
+        MIMETYPE_TO_ICON_MAPPING.put("application/rtf", R.drawable.file);
+        MIMETYPE_TO_ICON_MAPPING.put("application/vnd.android.package-archive", R.drawable.file_zip);
+        MIMETYPE_TO_ICON_MAPPING.put("application/vnd.ms-excel", R.drawable.file_xls);
+        MIMETYPE_TO_ICON_MAPPING.put("application/vnd.ms-excel.addin.macroEnabled.12", R.drawable.file_xls);
+        MIMETYPE_TO_ICON_MAPPING.put("application/vnd.ms-excel.sheet.binary.macroEnabled.12", R.drawable.file_xls);
+        MIMETYPE_TO_ICON_MAPPING.put("application/vnd.ms-excel.sheet.macroEnabled.12", R.drawable.file_xls);
+        MIMETYPE_TO_ICON_MAPPING.put("application/vnd.ms-excel.template.macroEnabled.12", R.drawable.file_xls);
+        MIMETYPE_TO_ICON_MAPPING.put("application/vnd.ms-fontobject", R.drawable.file_image);
+        MIMETYPE_TO_ICON_MAPPING.put("application/vnd.ms-powerpoint", R.drawable.file_ppt);
+        MIMETYPE_TO_ICON_MAPPING.put("application/vnd.ms-powerpoint.addin.macroEnabled.12", R.drawable.file_ppt);
+        MIMETYPE_TO_ICON_MAPPING.put("application/vnd.ms-powerpoint.presentation.macroEnabled.12", R.drawable.file_ppt);
+        MIMETYPE_TO_ICON_MAPPING.put("application/vnd.ms-powerpoint.slideshow.macroEnabled.12", R.drawable.file_ppt);
+        MIMETYPE_TO_ICON_MAPPING.put("application/vnd.ms-powerpoint.template.macroEnabled.12", R.drawable.file_ppt);
+        MIMETYPE_TO_ICON_MAPPING.put("application/vnd.ms-word.document.macroEnabled.12", R.drawable.file_doc);
+        MIMETYPE_TO_ICON_MAPPING.put("application/vnd.ms-word.template.macroEnabled.12", R.drawable.file_doc);
+        MIMETYPE_TO_ICON_MAPPING.put("application/vnd.oasis.opendocument.presentation", R.drawable.file_ppt);
+        MIMETYPE_TO_ICON_MAPPING.put("application/vnd.oasis.opendocument.presentation-template", R.drawable.file_ppt);
+        MIMETYPE_TO_ICON_MAPPING.put("application/vnd.oasis.opendocument.spreadsheet", R.drawable.file_xls);
+        MIMETYPE_TO_ICON_MAPPING.put("application/vnd.oasis.opendocument.spreadsheet-template", R.drawable.file_xls);
+        MIMETYPE_TO_ICON_MAPPING.put("application/vnd.oasis.opendocument.text", R.drawable.file_doc);
+        MIMETYPE_TO_ICON_MAPPING.put("application/vnd.oasis.opendocument.text-master", R.drawable.file_doc);
+        MIMETYPE_TO_ICON_MAPPING.put("application/vnd.oasis.opendocument.text-template", R.drawable.file_doc);
+        MIMETYPE_TO_ICON_MAPPING.put("application/vnd.oasis.opendocument.text-web", R.drawable.file_doc);
+        MIMETYPE_TO_ICON_MAPPING.put("application/vnd.openxmlformats-officedocument.presentationml.presentation", R.drawable.file_ppt);
+        MIMETYPE_TO_ICON_MAPPING.put("application/vnd.openxmlformats-officedocument.presentationml.slideshow", R.drawable.file_ppt);
+        MIMETYPE_TO_ICON_MAPPING.put("application/vnd.openxmlformats-officedocument.presentationml.template", R.drawable.file_ppt);
+        MIMETYPE_TO_ICON_MAPPING.put("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", R.drawable.file_xls);
+        MIMETYPE_TO_ICON_MAPPING.put("application/vnd.openxmlformats-officedocument.spreadsheetml.template", R.drawable.file_xls);
+        MIMETYPE_TO_ICON_MAPPING.put("application/vnd.openxmlformats-officedocument.wordprocessingml.document", R.drawable.file_doc);
+        MIMETYPE_TO_ICON_MAPPING.put("application/vnd.openxmlformats-officedocument.wordprocessingml.template", R.drawable.file_doc);
+        MIMETYPE_TO_ICON_MAPPING.put("application/x-7z-compressed", R.drawable.file_zip);
+        MIMETYPE_TO_ICON_MAPPING.put("application/x-bin", R.drawable.file_application);
+        MIMETYPE_TO_ICON_MAPPING.put("application/x-cbr", R.drawable.file_text);
+        MIMETYPE_TO_ICON_MAPPING.put("application/x-compressed", R.drawable.file_zip);
+        MIMETYPE_TO_ICON_MAPPING.put("application/x-dcraw", R.drawable.file_image);
+        MIMETYPE_TO_ICON_MAPPING.put("application/x-deb", R.drawable.file_zip);
+        MIMETYPE_TO_ICON_MAPPING.put("application/x-font", R.drawable.file_image);
+        MIMETYPE_TO_ICON_MAPPING.put("application/x-gimp", R.drawable.file_image);
+        MIMETYPE_TO_ICON_MAPPING.put("application/x-gzip", R.drawable.file_zip);
+        MIMETYPE_TO_ICON_MAPPING.put("application/x-ms-dos-executable", R.drawable.file_application);
+        MIMETYPE_TO_ICON_MAPPING.put("application/x-msi", R.drawable.file_application);
+        MIMETYPE_TO_ICON_MAPPING.put("application/x-iwork-numbers-sffnumbers", R.drawable.file_xls);
+        MIMETYPE_TO_ICON_MAPPING.put("application/x-iwork-keynote-sffkey", R.drawable.file_ppt);
+        MIMETYPE_TO_ICON_MAPPING.put("application/x-iwork-pages-sffpages", R.drawable.file_doc);
+        MIMETYPE_TO_ICON_MAPPING.put("application/x-perl", R.drawable.file_code);
+        MIMETYPE_TO_ICON_MAPPING.put("application/x-photoshop", R.drawable.file_image);
+        MIMETYPE_TO_ICON_MAPPING.put("application/x-php", R.drawable.file_code);
+        MIMETYPE_TO_ICON_MAPPING.put("application/x-rar-compressed", R.drawable.file_zip);
+        MIMETYPE_TO_ICON_MAPPING.put("application/x-shockwave-flash", R.drawable.file_application);
+        MIMETYPE_TO_ICON_MAPPING.put("application/x-tar", R.drawable.file_zip);
+        MIMETYPE_TO_ICON_MAPPING.put("application/x-tex", R.drawable.file_text);
+        MIMETYPE_TO_ICON_MAPPING.put("application/xml", R.drawable.file_text);
+        MIMETYPE_TO_ICON_MAPPING.put("application/yaml", R.drawable.file_code);
+        MIMETYPE_TO_ICON_MAPPING.put("application/zip", R.drawable.file_zip);
+        MIMETYPE_TO_ICON_MAPPING.put("database", R.drawable.file);
+        MIMETYPE_TO_ICON_MAPPING.put("httpd/unix-directory", R.drawable.ic_menu_archive);
+        MIMETYPE_TO_ICON_MAPPING.put("image/svg+xml", R.drawable.file_image);
+        MIMETYPE_TO_ICON_MAPPING.put("image/vector", R.drawable.file_image);
+        MIMETYPE_TO_ICON_MAPPING.put("text/calendar", R.drawable.file_calendar);
+        MIMETYPE_TO_ICON_MAPPING.put("text/css", R.drawable.file_code);
+        MIMETYPE_TO_ICON_MAPPING.put("text/csv", R.drawable.file_xls);
+        MIMETYPE_TO_ICON_MAPPING.put("text/html", R.drawable.file_code);
+        MIMETYPE_TO_ICON_MAPPING.put("text/vcard", R.drawable.file_vcard);
+        MIMETYPE_TO_ICON_MAPPING.put("text/x-c", R.drawable.file_code);
+        MIMETYPE_TO_ICON_MAPPING.put("text/x-c++src", R.drawable.file_code);
+        MIMETYPE_TO_ICON_MAPPING.put("text/x-h", R.drawable.file_code);
+        MIMETYPE_TO_ICON_MAPPING.put("text/x-python", R.drawable.file_code);
+        MIMETYPE_TO_ICON_MAPPING.put("text/x-shellscript", R.drawable.file_code);
+        MIMETYPE_TO_ICON_MAPPING.put("web", R.drawable.file_code);
+        MIMETYPE_TO_ICON_MAPPING.put("DIR", R.drawable.ic_menu_archive);
+    }
+
+    /**
+     * populates the mapping list: main mime type --> icon.
+     */
+    private static void populateMainMimeTypeMapping() {
+        MAINMIMETYPE_TO_ICON_MAPPING.put("audio", R.drawable.file_sound);
+        MAINMIMETYPE_TO_ICON_MAPPING.put("database", R.drawable.file);
+        MAINMIMETYPE_TO_ICON_MAPPING.put("httpd", R.drawable.file_zip);
+        MAINMIMETYPE_TO_ICON_MAPPING.put("image", R.drawable.file_image);
+        MAINMIMETYPE_TO_ICON_MAPPING.put("text", R.drawable.file_text);
+        MAINMIMETYPE_TO_ICON_MAPPING.put("video", R.drawable.file_movie);
+        MAINMIMETYPE_TO_ICON_MAPPING.put("web", R.drawable.file_code);
+    }
+
+    /**
+     * populates the mapping list: file extension --> mime type.
+     */
+    private static void populateFileExtensionMimeTypeMapping() {
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("3gp", Collections.singletonList("video/3gpp"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("7z", Collections.singletonList("application/x-7z-compressed"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("accdb", Collections.singletonList("application/msaccess"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("ai", Collections.singletonList("application/illustrator"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("apk", Collections.singletonList("application/vnd.android.package-archive"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("arw", Collections.singletonList("image/x-dcraw"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("avi", Collections.singletonList("video/x-msvideo"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("bash", Collections.singletonList("text/x-shellscript"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("blend", Collections.singletonList("application/x-blender"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("bin", Collections.singletonList("application/x-bin"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("bmp", Collections.singletonList("image/bmp"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("bpg", Collections.singletonList("image/bpg"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("cb7", Collections.singletonList("application/x-cbr"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("cba", Collections.singletonList("application/x-cbr"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("cbr", Collections.singletonList("application/x-cbr"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("cbt", Collections.singletonList("application/x-cbr"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("cbtc", Collections.singletonList("application/x-cbr"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("cbz", Collections.singletonList("application/x-cbr"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("cc", Collections.singletonList("text/x-c"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("cdr", Collections.singletonList("application/coreldraw"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("cnf", Collections.singletonList("text/plain"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("conf", Collections.singletonList("text/plain"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("cpp", Collections.singletonList("text/x-c++src"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("cr2", Collections.singletonList("image/x-dcraw"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("css", Collections.singletonList("text/css"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("csv", Collections.singletonList("text/csv"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("cvbdl", Collections.singletonList("application/x-cbr"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("c", Collections.singletonList("text/x-c"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("c++", Collections.singletonList("text/x-c++src"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("dcr", Collections.singletonList("image/x-dcraw"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("deb", Collections.singletonList("application/x-deb"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("dng", Collections.singletonList("image/x-dcraw"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("doc", Collections.singletonList("application/msword"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("docm", Collections.singletonList("application/vnd.ms-word.document.macroEnabled.12"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("docx", Collections.singletonList("application/vnd.openxmlformats-officedocument.wordprocessingml.document"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("dot", Collections.singletonList("application/msword"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("dotx", Collections.singletonList("application/vnd.openxmlformats-officedocument.wordprocessingml.template"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("dv", Collections.singletonList("video/dv"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("eot", Collections.singletonList("application/vnd.ms-fontobject"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("epub", Collections.singletonList("application/epub+zip"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("eps", Collections.singletonList("application/postscript"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("erf", Collections.singletonList("image/x-dcraw"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("exe", Collections.singletonList("application/x-ms-dos-executable"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("flac", Collections.singletonList("audio/flac"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("flv", Collections.singletonList("video/x-flv"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("gif", Collections.singletonList("image/gif"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("gz", Collections.singletonList("application/x-gzip"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("gzip", Collections.singletonList("application/x-gzip"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("h", Collections.singletonList("text/x-h"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("hh", Collections.singletonList("text/x-h"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("html", Arrays.asList("text/html", "text/plain"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("htm", Arrays.asList("text/html", "text/plain"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("ical", Collections.singletonList("text/calendar"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("ics", Collections.singletonList("text/calendar"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("iiq", Collections.singletonList("image/x-dcraw"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("impress", Collections.singletonList("text/impress"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("jpeg", Collections.singletonList("image/jpeg"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("jpg", Collections.singletonList("image/jpeg"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("jps", Collections.singletonList("image/jpeg"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("js", Arrays.asList("application/javascript", "text/plain"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("json", Arrays.asList("application/json", "text/plain"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("k25", Collections.singletonList("image/x-dcraw"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("kdc", Collections.singletonList("image/x-dcraw"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("key", Collections.singletonList("application/x-iwork-keynote-sffkey"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("keynote", Collections.singletonList("application/x-iwork-keynote-sffkey"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("kra", Collections.singletonList("application/x-krita"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("m2t", Collections.singletonList("video/mp2t"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("m4v", Collections.singletonList("video/mp4"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("markdown", Collections.singletonList("text/markdown"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("mdown", Collections.singletonList("text/markdown"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("md", Collections.singletonList("text/markdown"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("mdb", Collections.singletonList("application/msaccess"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("mdwn", Collections.singletonList("text/markdown"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("mkd", Collections.singletonList("text/markdown"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("mef", Collections.singletonList("image/x-dcraw"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("mkv", Collections.singletonList("video/x-matroska"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("mobi", Collections.singletonList("application/x-mobipocket-ebook"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("mov", Collections.singletonList("video/quicktime"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("mp3", Collections.singletonList("audio/mpeg"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("mp4", Collections.singletonList("video/mp4"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("mpeg", Collections.singletonList("video/mpeg"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("mpg", Collections.singletonList("video/mpeg"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("mpo", Collections.singletonList("image/jpeg"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("msi", Collections.singletonList("application/x-msi"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("mts", Collections.singletonList("video/MP2T"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("mt2s", Collections.singletonList("video/MP2T"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("nef", Collections.singletonList("image/x-dcraw"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("numbers", Collections.singletonList("application/x-iwork-numbers-sffnumbers"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("odf", Collections.singletonList("application/vnd.oasis.opendocument.formula"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("odg", Collections.singletonList("application/vnd.oasis.opendocument.graphics"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("odp", Collections.singletonList("application/vnd.oasis.opendocument.presentation"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("ods", Collections.singletonList("application/vnd.oasis.opendocument.spreadsheet"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("odt", Collections.singletonList("application/vnd.oasis.opendocument.text"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("oga", Collections.singletonList("audio/ogg"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("ogg", Collections.singletonList("audio/ogg"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("ogv", Collections.singletonList("video/ogg"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("opus", Collections.singletonList("audio/ogg"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("orf", Collections.singletonList("image/x-dcraw"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("otf", Collections.singletonList("application/font-sfnt"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("pages", Collections.singletonList("application/x-iwork-pages-sffpages"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("pdf", Collections.singletonList("application/pdf"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("pfb", Collections.singletonList("application/x-font"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("pef", Collections.singletonList("image/x-dcraw"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("php", Collections.singletonList("application/x-php"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("pl", Collections.singletonList("application/x-perl"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("png", Collections.singletonList("image/png"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("pot", Collections.singletonList("application/vnd.ms-powerpoint"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("potm", Collections.singletonList("application/vnd.ms-powerpoint.template.macroEnabled.12"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("potx", Collections.singletonList("application/vnd.openxmlformats-officedocument.presentationml.template"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("ppa", Collections.singletonList("application/vnd.ms-powerpoint"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("ppam", Collections.singletonList("application/vnd.ms-powerpoint.addin.macroEnabled.12"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("pps", Collections.singletonList("application/vnd.ms-powerpoint"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("ppsm", Collections.singletonList("application/vnd.ms-powerpoint.slideshow.macroEnabled.12"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("ppsx", Collections.singletonList("application/vnd.openxmlformats-officedocument.presentationml.slideshow"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("ppt", Collections.singletonList("application/vnd.ms-powerpoint"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("pptm", Collections.singletonList("application/vnd.ms-powerpoint.presentation.macroEnabled.12"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("pptx", Collections.singletonList("application/vnd.openxmlformats-officedocument.presentationml.presentation"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("ps", Collections.singletonList("application/postscript"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("psd", Collections.singletonList("application/x-photoshop"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("py", Collections.singletonList("text/x-python"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("raf", Collections.singletonList("image/x-dcraw"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("rar", Collections.singletonList("application/x-rar-compressed"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("reveal", Collections.singletonList("text/reveal"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("rtf", Collections.singletonList("application/rtf"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("rw2", Collections.singletonList("image/x-dcraw"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("sgf", Collections.singletonList("application/sgf"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("sh-lib", Collections.singletonList("text/x-shellscript"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("sh", Collections.singletonList("text/x-shellscript"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("srf", Collections.singletonList("image/x-dcraw"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("sr2", Collections.singletonList("image/x-dcraw"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("svg", Arrays.asList("image/svg+xml", "text/plain"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("swf", Arrays.asList("application/x-shockwave-flash", "application/octet-stream"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("tar", Collections.singletonList("application/x-tar"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("gz", Collections.singletonList("application/x-compressed"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("tex", Collections.singletonList("application/x-tex"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("tgz", Collections.singletonList("application/x-compressed"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("tiff", Collections.singletonList("image/tiff"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("tif", Collections.singletonList("image/tiff"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("ttf", Collections.singletonList("application/font-sfnt"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("txt", Collections.singletonList("text/plain"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("vcard", Collections.singletonList("text/vcard"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("vcf", Collections.singletonList("text/vcard"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("vob", Collections.singletonList("video/dvd"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("wav", Collections.singletonList("audio/wav"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("webm", Collections.singletonList("video/webm"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("woff", Collections.singletonList("application/font-woff"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("wmv", Collections.singletonList("video/x-ms-wmv"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("xcf", Collections.singletonList("application/x-gimp"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("xla", Collections.singletonList("application/vnd.ms-excel"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("xlam", Collections.singletonList("application/vnd.ms-excel.addin.macroEnabled.12"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("xls", Collections.singletonList("application/vnd.ms-excel"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("xlsb", Collections.singletonList("application/vnd.ms-excel.sheet.binary.macroEnabled.12"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("xlsm", Collections.singletonList("application/vnd.ms-excel.sheet.macroEnabled.12"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("xlsx", Collections.singletonList("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("xlt", Collections.singletonList("application/vnd.ms-excel"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("xltm", Collections.singletonList("application/vnd.ms-excel.template.macroEnabled.12"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("xltx", Collections.singletonList("application/vnd.openxmlformats-officedocument.spreadsheetml.template"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("xml", Arrays.asList("application/xml", "text/plain"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("xrf", Collections.singletonList("image/x-dcraw"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("yaml", Arrays.asList("application/yaml", "text/plain"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("yml", Arrays.asList("application/yaml", "text/plain"));
+        FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("zip", Collections.singletonList("application/zip"));
+    }
+}