along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<manifest package="com.owncloud.android"
- android:versionCode="10500800"
- android:versionName="1.5.8" xmlns:android="http://schemas.android.com/apk/res/android">
+ android:versionCode="10600100"
+ android:versionName="1.6.1" 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" />
<?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="0100017"
- android:versionName="1.0.17" >
+ android:versionCode="0100019"
+ android:versionName="1.0.19" >
<uses-sdk
android:minSdkVersion="16"
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/fileDownloadLL"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_centerInParent="true"
/>
- <com.ortiz.touch.TouchImageView
+ <com.owncloud.android.utils.TouchImageViewCustom
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orderInCategory="2"
android:showAsAction="never"
android:title="@string/actionbar_logger"/>
+ <item
+ android:id="@+id/action_sort"
+ android:icon="@android:drawable/ic_menu_sort_alphabetically"
+ android:orderInCategory="2"
+ android:showAsAction="never"
+ android:title="@string/actionbar_sort"/>
<!-- <item android:id="@+id/search" android:title="@string/actionbar_search" android:icon="@drawable/ic_action_search"></item> -->
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<string name="actionbar_settings">Instellings</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_help">Hulp</string>
<string name="auth_username">Gebruikersnaam</string>
<string name="auth_password">Wagwoord</string>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="empty"></string>
</resources>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="empty"></string>
</resources>
<string name="actionbar_settings">إعدادات</string>
<string name="actionbar_see_details">تفاصيل</string>
<string name="actionbar_send_file">أرسل</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">عام</string>
<string name="prefs_category_more">المزيد</string>
<string name="prefs_accounts">حسابات</string>
<string name="prefs_category_accounts">حسابات</string>
<string name="saml_authentication_wrong_pass">كلمة مرور خاطئة</string>
<string name="move_choose_button_text">اختيار</string>
+ <string name="prefs_category_security">الأمان</string>
</resources>
<string name="actionbar_settings">Quraşdırmalar</string>
<string name="actionbar_see_details">Detallar</string>
<string name="actionbar_send_file">Göndər</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Ümumi</string>
<string name="prefs_category_more">Daha da</string>
<string name="prefs_accounts">Hesablar</string>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<string name="actionbar_settings">Налады</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="common_yes">Так</string>
<string name="common_no">Не</string>
<string name="common_ok">Добра</string>
<string name="actionbar_settings">Настройки</string>
<string name="actionbar_see_details">Детайли</string>
<string name="actionbar_send_file">Изпращане</string>
+ <string name="actionbar_sort">Сортиране</string>
+ <string name="actionbar_sort_title">Сортирай по</string>
+ <string-array name="actionbar_sortby">
+ <item>А-Я</item>
+ <item>Нови - Стари</item>
+ </string-array>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Общи</string>
<string name="prefs_category_more">Още</string>
<string name="prefs_accounts">Профили</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="prefs_instant_upload_path_title">Местоположение на качване</string>
<string name="share_link_no_support_share_api">За съжаление споделянето не е включено на сървъра ви.
Моля, свържете се с администратора.</string>
<string name="share_link_file_no_exist">Неуспешен опит за споделяне. Моля, провери дали файла съществува.</string>
<string name="move_file_invalid_overwrite">Файлът вече съществува в отдалечената папка.</string>
<string name="move_file_error">Настъпи грешка при опита за преместване на този файл или папка.</string>
<string name="forbidden_permissions_move">за да преместиш този файл</string>
+ <string name="prefs_category_instant_uploading">Незабавно качване</string>
+ <string name="prefs_category_security">Сигурност</string>
</resources>
<string name="actionbar_settings">নিয়ামকসমূহ</string>
<string name="actionbar_see_details">বিস্তারিত</string>
<string name="actionbar_send_file">পাঠাও</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">সাধারণ</string>
<string name="prefs_category_more">বেশী</string>
<string name="prefs_accounts">একাউন্ট</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="saml_authentication_wrong_pass">ভুল কুটশব্দ</string>
<string name="actionbar_move">সরাও</string>
<string name="file_list_empty_moving">এখানে কিছু নেই। একটি ফোল্ডার যোগ করতে পারেন!</string>
<string name="move_choose_button_text">বেছে নিন</string>
<string name="move_file_not_found">সরাতে ব্যার্থ হলো। ফাইলটি রয়েছে কিনা দেখুন।</string>
+ <string name="prefs_category_security">নিরাপত্তা</string>
</resources>
<string name="actionbar_upload_files">ফাইলস</string>
<string name="actionbar_mkdir">নতুন ফোল্ডার</string>
<string name="actionbar_settings">সেটিংস</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_imprint">অঙ্কিত করা</string>
<string name="auth_username">ইউজারনেম</string>
<string name="sync_string_files">ফাইলস</string>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<string name="actionbar_mkdir">Nova fascikla</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="empty"></string>
</resources>
<string name="actionbar_settings">Configuració</string>
<string name="actionbar_see_details">Detalls</string>
<string name="actionbar_send_file">Envia</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">General</string>
<string name="prefs_category_more">Més</string>
<string name="prefs_accounts">Comptes</string>
<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="saml_authentication_required_text">Es requereix autenticació</string>
<string name="saml_authentication_wrong_pass">Contrasenya incorrecta</string>
<string name="move_choose_button_text">Escull</string>
+ <string name="prefs_category_security">Seguretat</string>
</resources>
<string name="actionbar_settings">Nastavení</string>
<string name="actionbar_see_details">Podrobnosti</string>
<string name="actionbar_send_file">Odeslat</string>
+ <string name="actionbar_sort">Seřadit</string>
+ <string name="actionbar_sort_title">Seřadit podle</string>
+ <string-array name="actionbar_sortby">
+ <item>A-Z</item>
+ <item>Nejnovější - nejstarší</item>
+ </string-array>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Obecné</string>
<string name="prefs_category_more">Více</string>
<string name="prefs_accounts">Účty</string>
<string name="prefs_manage_accounts">Spravovat účty</string>
- <string name="prefs_pincode">PIN aplikace</string>
+ <string name="prefs_pincode">PIN do aplikace</string>
<string name="prefs_pincode_summary">Chraňte svého klienta</string>
- <string name="prefs_instant_upload">Okamžité nahrání obrázků</string>
+ <string name="prefs_instant_upload">Okamžité nahrávání obrázků</string>
<string name="prefs_instant_upload_summary">Okamžitě nahrávat vytvořené fotografie</string>
<string name="prefs_instant_video_upload">Okamžité nahrávání videa</string>
<string name="prefs_instant_video_upload_summary">Okamžitě odesílat nahrané video</string>
<string name="prefs_log_summary_history">Zobrazuje zaznamenané logy</string>
<string name="prefs_log_delete_history_button">Smazat historii</string>
<string name="prefs_help">Nápověda</string>
- <string name="prefs_recommend">DoporuÄ\8dit pÅ\99Ãteli</string>
+ <string name="prefs_recommend">DoporuÄ\8dit pÅ\99átelům</string>
<string name="prefs_feedback">Odezva</string>
<string name="prefs_imprint">Imprint</string>
<string name="recommend_subject">Zkuste %1$s na vašem smartphonu!</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">Odesílat obrázky pouze skrze WiFi</string>
+ <string name="instant_upload_on_wifi">Odesílat obrázky pouze přes WiFi</string>
<string name="instant_video_upload_on_wifi">Nahrávat videa pouze přes WiFi</string>
<string name="instant_upload_path">/InstantUpload</string>
<string name="conflict_title">Konflikt při aktualizaci</string>
<string name="preview_image_description">Náhled obrázku</string>
<string name="preview_image_error_unknown_format">Obrázek nelze zobrazit</string>
<string name="error__upload__local_file_not_copied">%1$s nelze zkopírovat do místního adresáře %2$s</string>
+ <string name="prefs_instant_upload_path_title">Cesta pro nahrání</string>
<string name="share_link_no_support_share_api">Je nám líto, ale sdílení není na vašem serveru povoleno. Kontaktujte svého
administrátora.</string>
<string name="share_link_file_no_exist">Nelze sdílet. Zkontrolujte prosím že soubor existuje</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">Zabezpečené spojení je přesměrováváno nezabezpečenou trasou.</string>
+ <string name="auth_redirect_non_secure_connection_title">Bezpečné spojení je přesměrováno na nezabezpečenou trasu.</string>
<string name="actionbar_logger">Logy</string>
<string name="log_send_history_button">Odeslat historii</string>
<string name="log_mail_subject">Logy aplikace ownCloud pro Android</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="prefs_category_instant_uploading">Okamžitá odesílání</string>
+ <string name="prefs_category_security">Zabezpečení</string>
</resources>
<string name="actionbar_upload_files">Ffeiliau</string>
<string name="actionbar_settings">Gosodiadau</string>
<string name="actionbar_send_file">Anfon</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Cyffredinol</string>
<string name="prefs_accounts">Cyfrifon</string>
<string name="prefs_manage_accounts">Rheoli Cyfrifon</string>
<string name="actionbar_settings">Indstillinger</string>
<string name="actionbar_see_details">Detaljer</string>
<string name="actionbar_send_file">Send</string>
+ <string name="actionbar_sort">Sortér</string>
+ <string name="actionbar_sort_title">Sortér efter</string>
+ <string-array name="actionbar_sortby">
+ <item>A-Å</item>
+ <item>Nyeste - ældste</item>
+ </string-array>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Generel</string>
<string name="prefs_category_more">Mere</string>
<string name="prefs_accounts">Konti</string>
<string name="preview_image_description">Forhåndsvisning af billede</string>
<string name="preview_image_error_unknown_format">Dette billede kan ikke vises</string>
<string name="error__upload__local_file_not_copied">%1$s kunne ikke kopieres til %2$s lokale mappe</string>
+ <string name="prefs_instant_upload_path_title">Sti til upload</string>
<string name="share_link_no_support_share_api">Beklager, deling er ikke slået til på din server. Kontakt venligst din administrator.</string>
<string name="share_link_file_no_exist">Kan ikke dele. Tjek venligst om filen findes.</string>
<string name="share_link_file_error">Der opstod en fejl ved deling af denne fil eller mappe</string>
<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 gennem en usikker rute.</string>
+ <string name="auth_redirect_non_secure_connection_title">Sikker forbindelse videredirigeres til en usikker rute.</string>
<string name="actionbar_logger">Logge</string>
<string name="log_send_history_button">Send historik</string>
<string name="log_mail_subject">App-logregistreringer for ownCloud Android</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="prefs_category_instant_uploading">Øjeblikkelige uploads</string>
+ <string name="prefs_category_security">Sikkerhed</string>
</resources>
<resources>
<string name="actionbar_upload_files">Dateien</string>
<string name="actionbar_settings">Einstellungen</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Allgemein</string>
<string name="prefs_help">Hilfe</string>
<string name="auth_password">Passwort</string>
<string name="actionbar_settings">Einstellungen</string>
<string name="actionbar_see_details">Details</string>
<string name="actionbar_send_file">Senden</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Allgemein</string>
<string name="prefs_category_more">Mehr</string>
<string name="prefs_accounts">Konten</string>
<string name="empty"></string>
<string name="prefs_category_accounts">Konten</string>
<string name="move_choose_button_text">Auswählen</string>
+ <string name="prefs_category_security">Sicherheit</string>
</resources>
<string name="actionbar_settings">Einstellungen</string>
<string name="actionbar_see_details">Details</string>
<string name="actionbar_send_file">Senden</string>
+ <string name="actionbar_sort">Sortieren</string>
+ <string name="actionbar_sort_title">Sortieren nach</string>
+ <string-array name="actionbar_sortby">
+ <item>A-Z</item>
+ <item>Neueste - Älteste</item>
+ </string-array>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Allgemein</string>
<string name="prefs_category_more">Mehr</string>
<string name="prefs_accounts">Konten</string>
<string name="preview_image_description">Bildvorschau</string>
<string name="preview_image_error_unknown_format">Dieses Bild kann nicht angezeigt werden</string>
<string name="error__upload__local_file_not_copied">%1$s konnte nicht in den lokalen %2$s Ordner kopiert werden</string>
+ <string name="prefs_instant_upload_path_title">Pfad hochladen</string>
<string name="share_link_no_support_share_api">Entschuldigung, Freigaben sind auf Ihrem Server nicht aktiviert. Bitte kontaktieren Sie Ihren
⇥⇥Administrator.</string>
<string name="share_link_file_no_exist">Teilen nicht möglich. Prüfen Sie, dass die Datei existiert</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 dieser Datei oder dieses Ordners aufgetreten.</string>
<string name="forbidden_permissions_move">um diese Datei zu verschieben</string>
+ <string name="prefs_category_instant_uploading">Sofortiges Hochladen</string>
+ <string name="prefs_category_security">Sicherheit</string>
</resources>
<string name="actionbar_settings">Einstellungen</string>
<string name="actionbar_see_details">Details</string>
<string name="actionbar_send_file">Senden</string>
+ <string name="actionbar_sort">Sortieren</string>
+ <string name="actionbar_sort_title">Sortieren nach</string>
+ <string-array name="actionbar_sortby">
+ <item>A-Z</item>
+ <item>Neueste - Älteste</item>
+ </string-array>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Allgemein</string>
<string name="prefs_category_more">Mehr</string>
<string name="prefs_accounts">Konten</string>
<string name="preview_image_description">Bildvorschau</string>
<string name="preview_image_error_unknown_format">Dieses Bild kann nicht angezeigt werden</string>
<string name="error__upload__local_file_not_copied">%1$s konnte nicht in den lokalen %2$s Ordner kopiert werden</string>
+ <string name="prefs_instant_upload_path_title">Pfad hochladen</string>
<string name="share_link_no_support_share_api">Entschuldigung, Freigaben sind auf Deinem Server nicht aktiviert. Bitte kontaktiere Deinen
⇥⇥Administrator.</string>
<string name="share_link_file_no_exist">Teilen nicht möglich. Prüfe, dass die Datei existiert</string>
<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 durch eine ungesicherte Route geleitet.</string>
+ <string name="auth_redirect_non_secure_connection_title">Die gesicherte Verbindung wird auf eine unsichere Route weitergeleitet.</string>
<string name="actionbar_logger">Protokolle</string>
<string name="log_send_history_button">Verlauf senden</string>
<string name="log_mail_subject">Protokolle der ownCloud-Android-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="prefs_category_instant_uploading">Sofortiges Hochladen</string>
+ <string name="prefs_category_security">Sicherheit</string>
</resources>
<string name="actionbar_settings">Ρυθμίσεις</string>
<string name="actionbar_see_details">Λεπτομέρειες</string>
<string name="actionbar_send_file">Αποστολή</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Γενικά</string>
<string name="prefs_category_more">Περισσότερα</string>
<string name="prefs_accounts">Λογαριασμοί</string>
<string name="sync_fail_in_favourites_content">Τα περιεχόμενα των %1$d αρχείων δεν μπόρεσαν να συγχρονιστούν (%2$d διενέξεις)</string>
<string name="sync_foreign_files_forgotten_ticker">Ορισμένα τοπικά αρχεία ξεχάστηκαν</string>
<string name="sync_foreign_files_forgotten_content">%1$d αρχεία από τον %2$s χώρο αποθήκευσης δεν ήταν δυνατό να αντιγραφούν σε</string>
+ <string name="sync_foreign_files_forgotten_explanation">Από την έκδοση 1.3.16, τα αρχεία που μεταφορτώθηκαν από αυτήν τη συσκευή αντιγράφηκαν στον τοπικό φάκελο %1$s για να αποτραπεί η απώλεια δεδομένων όταν ένα αρχείο είναι συγχρονισμένο με πολλαπλούς λογαριασμούς. \n\nΛόγω αυτής της αλλαγής, όλα τα αρχεία που μεταφορτώθηκαν με προηγούμενες εκδόσεις αυτής της εφαρμογής αντιγράφηκαν στον φάκελο %2$s. Ωστόσο, ένα σφάλμα εμπόδισε την ολοκλήρωση αυτής της λειτουργίας κατά το συγχρονισμό του λογαριασμού. Μπορείτε είτε να αφήσετε το(α) αρχείο(α) όπως είναι και να καταργήσετε τη σύνδεση με το %3$s ή να μετακινήσετε τα αρχεία στο φάκελο %1$s και να διατηρήσετε τη σύνδεση με το %4$s. \n\nΑπαριθμημένα πιο κάτω είναι τα τοπικά αρχεία(ο) και τα απομακρυσμένα αρχεία(ο) στο %5$s με τα οποία συνδέονταν.</string>
<string name="sync_current_folder_was_removed">Ο φάκελος %1$s δεν υπάρχει πια</string>
<string name="foreign_files_move">Μετακίνηση όλων</string>
<string name="foreign_files_success">Όλα τα αρχεία μετακινήθηκαν</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="prefs_instant_upload_path_title">Διαδρομή Μεταφόρτωσης</string>
<string name="share_link_no_support_share_api">Λυπούμαστε, ο διαμοιρασμός δεν επιτρέπεται στο διακομιστή σας. Παρακαλούμε επικοινωνείστε με το
διαχειριστή σας.</string>
+ <string name="share_link_file_no_exist">Αδύνατη η κοινή χρήση. Παρακαλώ ελέγξτε αν ο φάκελος υπάρχει</string>
<string name="share_link_file_error">Ένα σφάλμα προέκυψε κατά την προσπάθεια διαμοιρασμού αυτού του αρχείου ή φακέλου</string>
+ <string name="unshare_link_file_no_exist">Αδύνατη η διακοπή κοινής χρήσης. Παρακαλώ ελέγξτε αν ο φάκελος υπάρχει</string>
<string name="unshare_link_file_error">Ένα σφάλμα προέκυψε κατά τη διάρκεια ακύρωσης διαμοιρασμού αυτού του αρχείου ή φακέλου</string>
<string name="activity_chooser_send_file_title">Αποστολή</string>
<string name="copy_link">Αντιγραφή συνδέσμου</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_mail_subject">αρχεία καταγραφής της εφαρμογής ownCloud Android</string>
<string name="log_progress_dialog_text">Φόρτωση δεδομένων....</string>
<string name="saml_authentication_required_text">Απαιτείται πιστοποίηση</string>
<string name="saml_authentication_wrong_pass">Εσφαλμένο συνθηματικό</string>
<string name="actionbar_move">Μετακίνηση</string>
+ <string name="file_list_empty_moving">Δεν υπάρχει τίποτα εδώ. Μπορείτε να προσθέσετε ένα φάκελο!</string>
<string name="move_choose_button_text">Επιλέξτε</string>
+ <string name="move_file_not_found">Αδύνατη η μετακίνηση. Παρακαλώ ελέγξτε αν ο φάκελος υπάρχει</string>
+ <string name="move_file_invalid_into_descendent">Δεν είναι δυνατό να μετακινηθεί ο φάκελος σε έναν απογονικό</string>
<string name="move_file_invalid_overwrite">Το αρχείο υπάρχει ήδη στο φάκελο προορισμού</string>
+ <string name="move_file_error">Ένα σφάλμα προέκυψε κατά την προσπάθεια μετακίνησης αυτού του αρχείου ή φακέλου</string>
<string name="forbidden_permissions_move">για μετακίνηση αυτού του αρχείου</string>
+ <string name="prefs_category_instant_uploading">Στιγμιαίες Μεταφορτώσεις</string>
+ <string name="prefs_category_security">Ασφάλεια</string>
</resources>
<string name="actionbar_settings">Settings</string>
<string name="actionbar_see_details">Details</string>
<string name="actionbar_send_file">Send</string>
+ <string name="actionbar_sort">Sort</string>
+ <string name="actionbar_sort_title">Sort by</string>
+ <string-array name="actionbar_sortby">
+ <item>A-Z</item>
+ <item>Newest - Oldest</item>
+ </string-array>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">General</string>
<string name="prefs_category_more">More</string>
<string name="prefs_accounts">Accounts</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_no_support_share_api">Sorry, sharing is not enabled on your server. Please contact your
administrator.</string>
<string name="share_link_file_no_exist">Unable to share. Please check whether the file exists</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 through an unsecured route.</string>
+ <string name="auth_redirect_non_secure_connection_title">Secure connection is redirected to an unsecured route.</string>
<string name="actionbar_logger">Logs</string>
<string name="log_send_history_button">Send History</string>
<string name="log_mail_subject">ownCloud Android app logs</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="prefs_category_instant_uploading">Instant Uploads</string>
+ <string name="prefs_category_security">Security</string>
</resources>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="empty"></string>
</resources>
<string name="actionbar_settings">Agordo</string>
<string name="actionbar_see_details">Detaloj</string>
<string name="actionbar_send_file">Sendi</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Ĝeneralo</string>
<string name="prefs_category_more">Pli</string>
<string name="prefs_accounts">Kontoj</string>
<string name="saml_authentication_required_text">Aŭtentiĝo nepras</string>
<string name="saml_authentication_wrong_pass">Malĝusta pasvorto</string>
<string name="move_choose_button_text">Elekti</string>
+ <string name="prefs_category_security">Sekuro</string>
</resources>
<string name="actionbar_settings">Configuración</string>
<string name="actionbar_see_details">Detalles</string>
<string name="actionbar_send_file">Mandar</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">General</string>
<string name="prefs_category_more">Más</string>
<string name="prefs_accounts">Cuentas</string>
<string name="saml_authentication_required_text">Autentificación requerida</string>
<string name="saml_authentication_wrong_pass">Clave incorrecta</string>
<string name="move_choose_button_text">Elegir</string>
+ <string name="prefs_category_security">Seguridad</string>
</resources>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="empty"></string>
</resources>
<string name="actionbar_mkdir">Nuevo directorio</string>
<string name="actionbar_settings">Configuración</string>
<string name="actionbar_see_details">detalles</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">General</string>
<string name="prefs_accounts">Cuentas</string>
<string name="prefs_manage_accounts">Administrar Cuentas</string>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="empty"></string>
</resources>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="empty"></string>
</resources>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="empty"></string>
</resources>
<string name="actionbar_settings">Ajustes</string>
<string name="actionbar_see_details">Detalles</string>
<string name="actionbar_send_file">Enviar</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">General</string>
<string name="prefs_category_more">Más</string>
<string name="prefs_accounts">Cuentas</string>
<string name="prefs_category_accounts">Cuentas</string>
<string name="saml_authentication_wrong_pass">Contraseña incorrecta</string>
<string name="move_choose_button_text">Seleccionar</string>
+ <string name="prefs_category_security">Seguridad</string>
</resources>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="empty"></string>
</resources>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<string name="actionbar_upload_files">Archivos</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="sync_string_files">Archivos</string>
<string name="empty"></string>
</resources>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="empty"></string>
</resources>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="empty"></string>
</resources>
<string name="actionbar_settings">Configuración</string>
<string name="actionbar_see_details">Detalles</string>
<string name="actionbar_send_file">Enviar</string>
+ <string name="actionbar_sort">Ordenar</string>
+ <string name="actionbar_sort_title">Ordenar por</string>
+ <string-array name="actionbar_sortby">
+ <item>A-Z</item>
+ <item>Más nuevo - Más viejo</item>
+ </string-array>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">General</string>
<string name="prefs_category_more">Más</string>
<string name="prefs_accounts">Cuentas</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="prefs_instant_upload_path_title">Ruta de subida</string>
<string name="share_link_no_support_share_api">La función Compartir no está activada en su servidor. Contacte a su
administrador.</string>
<string name="share_link_file_no_exist">No se puede compartir. Revise si el archivo existe</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 redirigida por una ruta insegura.</string>
+ <string name="auth_redirect_non_secure_connection_title">La conexión segura está siendo desviada por una ruta insegura.</string>
<string name="actionbar_logger">Logs</string>
<string name="log_send_history_button">Enviar historial</string>
<string name="log_mail_subject">Logs de las apps ownCloud Android</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="prefs_category_instant_uploading">Subidas instantáneas</string>
+ <string name="prefs_category_security">Seguridad</string>
</resources>
<string name="actionbar_settings">Seaded</string>
<string name="actionbar_see_details">Üksikasjad</string>
<string name="actionbar_send_file">Saada</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Üldine</string>
<string name="prefs_category_more">Rohkem</string>
<string name="prefs_accounts">Kontod</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>
+ <string name="prefs_instant_upload_path_title">Üleslaadimise rada</string>
<string name="share_link_no_support_share_api">Vabandust, server ei toeta jagamist. Palun kontakteeru
⇥⇥administraatoriga.</string>
<string name="share_link_file_no_exist">Jagamine ebaõnnestus. Palun kontrolli, kas fail on olemas</string>
<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">Turvalist ühendust suunatakse läbi turvamata ühenduse.</string>
+ <string name="auth_redirect_non_secure_connection_title">Turvaline ühendus suunatakse läbi turvamata ühenduse.</string>
<string name="actionbar_logger">Logid</string>
<string name="log_send_history_button">Saada ajalugu</string>
<string name="log_mail_subject">ownCloud Android rakenduse logid</string>
<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="prefs_category_instant_uploading">Kohesed üleslaadimised</string>
+ <string name="prefs_category_security">Turvalisus</string>
</resources>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="filedetails_download">Deskargatu</string>
<string name="common_cancel">Ezeztatu</string>
<string name="empty"></string>
<string name="actionbar_settings">Ezarpenak</string>
<string name="actionbar_see_details">Xehetasunak</string>
<string name="actionbar_send_file">Bidali</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Orokorra</string>
<string name="prefs_category_more">Gehiago</string>
<string name="prefs_accounts">Kontuak</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 batetik.</string>
<string name="saml_authentication_required_text">Autentikazioa beharrezkoa</string>
<string name="saml_authentication_wrong_pass">Pasahitz okerra</string>
<string name="move_choose_button_text">Aukeratu</string>
+ <string name="prefs_category_security">Segurtasuna</string>
</resources>
<string name="actionbar_settings">تنظیمات</string>
<string name="actionbar_see_details">جزئیات</string>
<string name="actionbar_send_file">ارسال</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">عمومی</string>
<string name="prefs_category_more">بیشتر</string>
<string name="prefs_accounts">حسابها</string>
<string name="saml_authentication_required_text">احراز هویت مورد نیاز است</string>
<string name="saml_authentication_wrong_pass">رمز عبور اشتباه است</string>
<string name="move_choose_button_text">انتخاب کردن</string>
+ <string name="prefs_category_security">امنیت</string>
</resources>
<string name="actionbar_settings">Asetukset</string>
<string name="actionbar_see_details">Tiedot</string>
<string name="actionbar_send_file">Lähetä</string>
+ <string name="actionbar_sort">Lajittele</string>
+ <string name="actionbar_sort_title">Lajittelujärjestys</string>
+ <string-array name="actionbar_sortby">
+ <item>A-Ö</item>
+ <item>Uusimmasta vanhimpaan</item>
+ </string-array>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Yleiset</string>
<string name="prefs_category_more">Enemmän</string>
<string name="prefs_accounts">Tilit</string>
<string name="conflict_dont_upload">Älä lähetä</string>
<string name="preview_image_description">Kuvan esikatselu</string>
<string name="preview_image_error_unknown_format">Tätä kuvaa ei voi näyttää</string>
+ <string name="prefs_instant_upload_path_title">Lähetyspolku</string>
<string name="share_link_no_support_share_api">Jakaminen ei ole käytössä palvelimellasi. Ota yhteys
ylläpitäjään.</string>
<string name="share_link_file_error">Virhe tiedoston tai kansion jakamista yrittäessä</string>
<string name="downloader_download_file_not_found">Tämä tiedosto ei ole enää palvelimella käytettävissä</string>
<string name="prefs_category_accounts">Tilit</string>
<string name="prefs_add_account">Lisää tili</string>
- <string name="auth_redirect_non_secure_connection_title">Salattu yhteys on ohjattu uudelleen salaamatonta reittiä pitkin.</string>
<string name="actionbar_logger">Lokit</string>
<string name="log_send_history_button">Lähetä historia</string>
<string name="log_mail_subject">ownCloudin Android-sovelluksen lokit</string>
<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="prefs_category_instant_uploading">Välittömät lähetykset</string>
+ <string name="prefs_category_security">Tietoturva</string>
</resources>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="empty"></string>
</resources>
<string name="about_version">version %1$s</string>
<string name="actionbar_sync">Actualiser le compte</string>
<string name="actionbar_upload">Téléverser</string>
- <string name="actionbar_upload_from_apps">Contenu d\'une autre application</string>
+ <string name="actionbar_upload_from_apps">Contenu d\'autres applications</string>
<string name="actionbar_upload_files">Fichiers</string>
<string name="actionbar_open_with">Ouvrir avec</string>
<string name="actionbar_mkdir">Nouveau dossier</string>
<string name="actionbar_settings">Paramètres</string>
<string name="actionbar_see_details">Détails</string>
<string name="actionbar_send_file">Envoyer</string>
+ <string name="actionbar_sort">Trier</string>
+ <string name="actionbar_sort_title">Trier par</string>
+ <string-array name="actionbar_sortby">
+ <item>A-Z</item>
+ <item>Plus récent - Plus ancien</item>
+ </string-array>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Général</string>
<string name="prefs_category_more">Plus</string>
<string name="prefs_accounts">Comptes</string>
<string name="auth_wrong_connection_title">Impossible d\'établir la connexion</string>
<string name="auth_secure_connection">Connexion sécurisée établie</string>
<string name="auth_unauthorized">Nom d\'utilisateur ou mot de passe incorrect</string>
- <string name="auth_oauth_error">Echec d\'autorisation</string>
+ <string name="auth_oauth_error">Échec d\'autorisation</string>
<string name="auth_oauth_error_access_denied">Accès refusé par le serveur d\'autorisation</string>
<string name="auth_wtf_reenter_URL">État inattendu ; veuillez entrer à nouveau l\'URL du serveur</string>
<string name="auth_expired_oauth_token_toast">Votre autorisation a expiré. Merci de vous authentifier à nouveau</string>
<string name="preview_image_description">Prévisualisation de l\'image</string>
<string name="preview_image_error_unknown_format">Cette image ne peut pas être affichée</string>
<string name="error__upload__local_file_not_copied">%1$s n\'a pas pu être copié dans le dossier local %2$s</string>
+ <string name="prefs_instant_upload_path_title">Chemin d\'accès pour le téléversement</string>
<string name="share_link_no_support_share_api">Désolé, le partage n\'est pas disponible sur votre serveur. Contactez votre administrateur, s\'il vous plait.</string>
<string name="share_link_file_no_exist">Impossible de partager. Vérifiez que le fichier est bien présent</string>
<string name="share_link_file_error">Une erreur est survenue lors de la tentative de partage de ce fichier ou 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>
<string name="prefs_add_account">Ajouter un compte</string>
- <string name="auth_redirect_non_secure_connection_title">Le connexion sécurisée est redirigée vers une route non-sécurisée.</string>
+ <string name="auth_redirect_non_secure_connection_title">La connexion sécurisée est redirigée via une route non-sécurisée.</string>
<string name="actionbar_logger">Journaux</string>
<string name="log_send_history_button">Envoyer l\'historique</string>
<string name="log_mail_subject">Journaux de l\'application Android ownCloud</string>
<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="prefs_category_instant_uploading">Téléchargements instantanés</string>
+ <string name="prefs_category_security">Sécurité</string>
</resources>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="empty"></string>
</resources>
<string name="actionbar_settings">Preferencias</string>
<string name="actionbar_see_details">Detalles</string>
<string name="actionbar_send_file">Enviar</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Xeral</string>
<string name="prefs_category_more">Máis</string>
<string name="prefs_accounts">Contas</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 través dunha ruta non segura.</string>
<string name="saml_authentication_required_text">Requírese autenticación</string>
<string name="saml_authentication_wrong_pass">Contrasinal incorrecto</string>
<string name="actionbar_move">Mover</string>
<string name="move_choose_button_text">Escoller</string>
+ <string name="prefs_category_security">Seguranza</string>
</resources>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="empty"></string>
</resources>
<string name="actionbar_settings">הגדרות</string>
<string name="actionbar_see_details">פרטים</string>
<string name="actionbar_send_file">שליחה</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">כללי</string>
<string name="prefs_category_more">יותר</string>
<string name="prefs_accounts">חשבונות</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="move_choose_button_text">בחירה</string>
+ <string name="prefs_category_security">אבטחה</string>
</resources>
<string name="actionbar_settings">सेटिंग्स</string>
<string name="actionbar_see_details">विवरण </string>
<string name="actionbar_send_file">भेजें</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">सामान्य </string>
<string name="prefs_category_more">और अधिक</string>
<string name="prefs_accounts">खाते </string>
<string name="actionbar_mkdir">Nova mapa</string>
<string name="actionbar_settings">Postavke</string>
<string name="actionbar_send_file">Pošaljite</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Općenito</string>
<string name="prefs_category_more">više</string>
<string name="prefs_accounts">Korisnićki računi</string>
<string name="saml_authentication_required_text">Potrebna autentikacija</string>
<string name="saml_authentication_wrong_pass">Pogrešna lozinka</string>
<string name="move_choose_button_text">Izaberi</string>
+ <string name="prefs_category_security">Sigurnost</string>
</resources>
<string name="actionbar_settings">Beállítások</string>
<string name="actionbar_see_details">Részletek</string>
<string name="actionbar_send_file">Küldjük el</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Általános</string>
<string name="prefs_category_more">Több</string>
<string name="prefs_accounts">Fiókok</string>
<string name="saml_authentication_required_text">Felhasználóazonosítás szükséges</string>
<string name="saml_authentication_wrong_pass">Hibás jelszó</string>
<string name="move_choose_button_text">Válasszon</string>
+ <string name="prefs_category_security">Biztonság</string>
</resources>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="filedetails_download">Բեռնել</string>
<string name="empty"></string>
</resources>
<string name="actionbar_mkdir">Nove dossier</string>
<string name="actionbar_settings">Configurationes</string>
<string name="actionbar_send_file">Invia</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">General</string>
<string name="prefs_category_more">Plus</string>
<string name="prefs_help">Adjuta</string>
<string name="actionbar_upload">Unggah</string>
<string name="actionbar_upload_from_apps">Konten dari apl lain</string>
<string name="actionbar_upload_files">Berkas</string>
- <string name="actionbar_open_with">Bukan dengan</string>
+ <string name="actionbar_open_with">Buka dengan</string>
<string name="actionbar_mkdir">Folder baru</string>
- <string name="actionbar_settings">pengaturan</string>
+ <string name="actionbar_settings">Pengaturan</string>
<string name="actionbar_see_details">Rincian</string>
<string name="actionbar_send_file">Kirim</string>
- <string name="prefs_category_general">umum</string>
+ <string name="actionbar_sort">Urutkan</string>
+ <string name="actionbar_sort_title">Urutan</string>
+ <string-array name="actionbar_sortby">
+ <item>A-Z</item>
+ <item>Terbaru - Terlawas</item>
+ </string-array>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
+ <string name="prefs_category_general">Umum</string>
<string name="prefs_category_more">Lainnya</string>
<string name="prefs_accounts">Akun</string>
<string name="prefs_manage_accounts">Kelola Akun</string>
<string name="prefs_pincode">PIN Apl</string>
<string name="prefs_pincode_summary">Lindungi klien Anda</string>
+ <string name="prefs_instant_upload">Unggah gambar cepat</string>
+ <string name="prefs_instant_upload_summary">Unggah gambar yang diambil kamera dengan cepat</string>
+ <string name="prefs_instant_video_upload">Unggah video cepat</string>
+ <string name="prefs_instant_video_upload_summary">Unggah video yang direkam kamera dengan cepat</string>
<string name="prefs_log_title">Aktifkan Pencatatan</string>
<string name="prefs_log_summary">Ini digunakan untuk mencatat masalah</string>
<string name="prefs_log_title_history">Riwayat Catatan</string>
<string name="prefs_help">Bantuan</string>
<string name="prefs_recommend">Rekomendasikan ke teman</string>
<string name="prefs_feedback">Umpan balik</string>
- <string name="prefs_imprint">Imprint</string>
- <string name="recommend_subject">Coba %1$s pada smartphone Anda!</string>
+ <string name="prefs_imprint">Jejak</string>
+ <string name="recommend_subject">Cobalah %1$s pada ponsel cerdas Anda!</string>
+ <string name="recommend_text">Saya ingin mengajak Anda untuk menggunakan %1$s di ponsel cerdas Anda!\nUnduh gratis disini: %2$s</string>
<string name="auth_check_server">Periksa Server</string>
<string name="auth_host_url">Alamat server https://…</string>
<string name="auth_username">Nama Pengguna</string>
<string name="sync_string_files">Berkas</string>
<string name="setup_btn_connect">Sambungkan</string>
<string name="uploader_btn_upload_text">Unggah</string>
+ <string name="uploader_top_message">Pilih folder unggah:</string>
<string name="uploader_wrn_no_account_title">Tidak ada akun yang ditemukan</string>
<string name="uploader_wrn_no_account_text">Belum ada akun %1$s pada perangkat Anda. Silahkan buat akun terlebih dahulu.</string>
<string name="uploader_wrn_no_account_setup_btn_text">Pengaturan</string>
<string name="uploader_error_forbidden_content">%1$s tidak diizinkan mengakses konten berbagi</string>
<string name="uploader_info_uploading">Mengunggah</string>
<string name="file_list_empty">Tidak ada apa-apa di sini. Unggah sesuatu!</string>
+ <string name="file_list_loading">Memuat...</string>
+ <string name="local_file_list_empty">Tidak ada satupun berkas dalam folder ini.</string>
<string name="filedetails_select_file">Sentuh pada berkas untuk menampilkan informasi tambahan</string>
<string name="filedetails_size">Ukuran:</string>
<string name="filedetails_type">Tipe:</string>
<string name="filedetails_sync_file">Segarkan berkas</string>
<string name="filedetails_renamed_in_upload_msg">Berkas diubah namanya menjadi %1$s saat pengunggahan</string>
<string name="action_share_file">Bagikan tautan</string>
+ <string name="action_unshare_file">Batal bagikan tautan</string>
<string name="common_yes">Ya</string>
<string name="common_no">Tidak</string>
<string name="common_ok">Oke</string>
<string name="uploader_upload_succeeded_content_single">%1$s berhasil diunggah</string>
<string name="uploader_upload_failed_ticker">Gagal mengunggah</string>
<string name="uploader_upload_failed_content_single">Unggah %1$s tidak selesai</string>
+ <string name="uploader_upload_failed_credentials_error">Unggah gagal, Anda perlu masuk ulang</string>
<string name="downloader_download_in_progress_ticker">Mengunduh...</string>
<string name="downloader_download_in_progress_content">%1$d%% Mengunduh %2$s</string>
<string name="downloader_download_succeeded_ticker">Berhasil mengunduh</string>
<string name="downloader_download_failed_ticker">Gagal Mengunduh</string>
<string name="downloader_download_failed_content">Mengunduh %1$s tidak selesai</string>
<string name="downloader_not_downloaded_yet">Belum diunduh</string>
+ <string name="downloader_download_failed_credentials_error">Gagal mengunduh, Anda perlu masuk kembali</string>
<string name="common_choose_account">Pilih akun</string>
<string name="sync_fail_ticker">Sinkronisasi gagal</string>
+ <string name="sync_fail_ticker_unauthorized">Sinkronisasi gagal, Anda perlu masuk kembali</string>
<string name="sync_fail_content">Sinkronisasi %1$s tidak selesai</string>
<string name="sync_fail_content_unauthorized">Sandi salah untuk %1$s</string>
<string name="sync_conflicts_in_favourites_ticker">Konflik ditemukan</string>
+ <string name="sync_conflicts_in_favourites_content">%1$d berkas kept-in-sync tidak dapat disinkronkan</string>
+ <string name="sync_fail_in_favourites_ticker">Berkas kept-in-sync gagal</string>
<string name="sync_fail_in_favourites_content">Konten berkas %1$d tidak dapat disinkronasikan (%2$d konflik)</string>
<string name="sync_foreign_files_forgotten_ticker">Beberapa berkas lokal terlupakan</string>
+ <string name="sync_foreign_files_forgotten_content">%1$d berkas diluar folder %2$s tidak dapat disalin kedalamnya</string>
+ <string name="sync_foreign_files_forgotten_explanation">Sejak versi 1.3.16, berkas-berkas yang diunggah dari piranti ini akan disalin kedalam folder %1$s lokal untuk mencagah kehilangan data ketika berkas tunggal disinkronkan dengan akun lebih dari satu.\n\nAkibat perubahan ini, semua berkas yang diunggah di versi aplikasi sebelumnya disalin kedalam folder %2$s. Namun, sebuah kesalahan mencegah penyelesaian operasi ini saat sinkronisasi berlangsung akun. Anda boleh meninggalkan berkas seperti ini dan menghapus tautan ke %3$s atau memindahkan berkas kedalam folder %1$s dan membiarkan tautan ke %4$s.\n\nYang tampak dibawah adalah berkas lokal, dan berkas remote didalam %5$s yang dihubungkan dengannya.</string>
<string name="sync_current_folder_was_removed">Folder %1$s tidak ada lagi</string>
<string name="foreign_files_move">Pindahkan semua</string>
<string name="foreign_files_success">Semua berkas sudah dipindahkan</string>
<string name="foreign_files_fail">Beberapa berkas tidak dapat dipindahkan</string>
<string name="foreign_files_local_text">Lokal: %1$s</string>
<string name="foreign_files_remote_text">Jauh: %1$s</string>
+ <string name="upload_query_move_foreign_files">Ruang tidak cukup untuk menyalin berkas terpilih kedalam folder %1$s. Apakah Anda ingin memindahkannya saja?</string>
<string name="pincode_enter_pin_code">Silakan masukkan PIN Apl</string>
<string name="pincode_configure_your_pin">Masukkan PIN Apl</string>
<string name="pincode_configure_your_pin_explanation">PIN akan selalu diminta setiap kali apl dijalankan</string>
<string name="media_notif_ticker">Pemutar musik %1$s</string>
<string name="media_state_playing">%1$s (dimainkan)</string>
<string name="media_state_loading">%1$s (sedang dimuat)</string>
+ <string name="media_event_done">%1$s pemutaran selesai</string>
<string name="media_err_nothing_to_play">Tidak ditemukan berkas media</string>
<string name="media_err_no_account">Tidak ada akun yang diberikan</string>
<string name="media_err_not_in_owncloud">Brkas tidak didalam akun yang sah</string>
<string name="media_rewind_description">Tombol mundur</string>
<string name="media_play_pause_description">Tombol main dan jeda</string>
<string name="media_forward_description">Tombol maju</string>
+ <string name="auth_getting_authorization">Mendapatkan otorisasi...</string>
<string name="auth_trying_to_login">Mencoba untuk masuk...</string>
<string name="auth_no_net_conn_title">Tidak ada koneksi internet</string>
<string name="auth_nossl_plain_ok_title">Sambungan aman tidak tersedia</string>
<string name="auth_connecting_auth_server">Menyambungkan ke server otentikasi...</string>
<string name="auth_unsupported_auth_method">Server tidak mendukung medote otentikasi ini</string>
<string name="auth_unsupported_multiaccount">%1$s tidak mendukung banyak akun </string>
+ <string name="auth_fail_get_user_name">Server Anda tidak membalas id pengguna dengan banar, Sialakn hubungi Administrator
+ </string>
+ <string name="auth_can_not_auth_against_server">Tidak dapat mengotentikasi pada server ini</string>
<string name="fd_keep_in_sync">Biarkan berkas tetap terbaru</string>
<string name="common_rename">Ubah nama</string>
<string name="common_remove">Hapus</string>
+ <string name="confirmation_remove_alert">Apakah Anda yakin ingin menghapus %1$s?</string>
+ <string name="confirmation_remove_folder_alert">Apakah Anda yakin ingin menghapus %1$s dan isinya?</string>
<string name="confirmation_remove_local">Lokal saja</string>
<string name="confirmation_remove_folder_local">Konten lokal saja</string>
<string name="confirmation_remove_remote">Hapus dari server</string>
<string name="rename_server_fail_msg">Mengubah nama tidak selesai</string>
<string name="sync_file_fail_msg">Berkas jauh tidak dapat diperiksa</string>
<string name="sync_file_nothing_to_do_msg">Isi berkas sudah diselaraskan</string>
+ <string name="create_dir_fail_msg">Folder tidak dapat dibuat</string>
<string name="filename_forbidden_characters">Karakter yang dilarang: / \\ < > : \" | ? *</string>
- <string name="wait_a_moment">Tunggu sejenak</string>
+ <string name="filename_empty">Nama berkas tidak boleh kosong</string>
+ <string name="wait_a_moment">Tunggu sebentar</string>
<string name="filedisplay_unexpected_bad_get_content">Masalah tidak terduga, silahkan pilih berkas dari apl yang berbeda</string>
<string name="filedisplay_no_file_selected">Tidak ada berkas yang terpilih</string>
+ <string name="activity_chooser_title">Kirim taukan ke</string>
<string name="oauth_check_onoff">Masuk dengan oAuth2</string>
<string name="oauth_login_connection">Menyambungkan ke server oAuth2...</string>
<string name="ssl_validator_header">Identitas situs tidak dapat diverfikasi</string>
<string name="ssl_validator_label_validity_to">Untuk:</string>
<string name="ssl_validator_label_signature">Tanda tangan:</string>
<string name="ssl_validator_label_signature_algorithm">Algoritma:</string>
+ <string name="ssl_validator_null_cert">Sertifikat tidak dapat ditampilkan.</string>
+ <string name="ssl_validator_no_info_about_error">- Tidak ada informasi tantang terror</string>
<string name="placeholder_sentence">Ini adalah placeholder</string>
<string name="placeholder_filename">placeholder.txt</string>
<string name="placeholder_filetype">Gambar PNG</string>
<string name="placeholder_timestamp">18/05/2012 12:23 PM</string>
<string name="placeholder_media_time">12:23:45</string>
<string name="instant_upload_on_wifi">Hanya unggah gambar via WiFi</string>
+ <string name="instant_video_upload_on_wifi">Hanya unggah video via WiFi</string>
<string name="instant_upload_path">/UnggahInstan</string>
<string name="conflict_title">Perbarui benturan</string>
<string name="conflict_message">Berkas jauh %s tidak sinkron dengan berkas lokal. Melanjutkan akan menggantikan konten berkas di server.</string>
<string name="conflict_overwrite">Timpa</string>
<string name="conflict_dont_upload">Jangan mengunggah</string>
<string name="preview_image_description">Pratilik gambar</string>
+ <string name="preview_image_error_unknown_format">Gambar ini tidak dapat ditampilkan</string>
+ <string name="error__upload__local_file_not_copied">%1$s tidak dapat disalin ke folder lokal %2$s</string>
+ <string name="prefs_instant_upload_path_title">Jalur Lokasi Unggah</string>
+ <string name="share_link_no_support_share_api">Maaf, berbagi tidak diaktifkan pada server Anda. Silakan hubungi
+ administrator Anda.</string>
+ <string name="share_link_file_no_exist">Tidak dapat berbagi. Mohon periksa apakah berkas ada</string>
+ <string name="share_link_file_error">Terjadi kesalahan saat mencoba membagikan berkas atau folder ini</string>
+ <string name="unshare_link_file_no_exist">Tidak dapat menghapus berbagi. Mohon periksa apakah berkas ada</string>
+ <string name="unshare_link_file_error">Terjadi kesalahan saat mencoba menghapus berbagi berkas dan folder ini</string>
<string name="activity_chooser_send_file_title">Kirim</string>
+ <string name="copy_link">Salin tautan</string>
+ <string name="clipboard_text_copied">Disalin ke papan klip</string>
+ <string name="error_cant_bind_to_operations_service">Kesalahan fatal: tidak dapat melakukan operasi</string>
+ <string name="network_error_socket_exception">Terjadi kesalahan saat menghubungkan dengan server.</string>
+ <string name="network_error_socket_timeout_exception">Terjadi kesalahan saat menunggu balasan server, operasi tidak dapat diselesaikan</string>
+ <string name="network_error_connect_timeout_exception">Terjadi kesalahan saat menunggu balasan server, operasi tidak dapat diselesaikan</string>
+ <string name="network_host_not_available">Operasi tidak dapat diselesaikan, server tidak tersedia</string>
<string name="empty"></string>
+ <string name="forbidden_permissions">Anda tidak memiliki izin %s</string>
+ <string name="forbidden_permissions_rename">untuk mengubah nama berkas ini</string>
+ <string name="forbidden_permissions_delete">untuk menghapus berkas ini</string>
+ <string name="share_link_forbidden_permissions">untuk membagikan berkas ini</string>
+ <string name="unshare_link_forbidden_permissions">untuk batal membagikan berkas ini</string>
+ <string name="forbidden_permissions_create">untuk membuat berkas</string>
+ <string name="uploader_upload_forbidden_permissions">untuk mengunggah kedalam folder ini</string>
+ <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="actionbar_logger">Log</string>
+ <string name="log_send_history_button">Kirim Riwayat</string>
+ <string name="log_mail_subject">Log apl ownCloud Android</string>
+ <string name="log_progress_dialog_text">Memuat data...</string>
<string name="saml_authentication_required_text">Diperlukan otentikasi</string>
<string name="saml_authentication_wrong_pass">Sandi salah</string>
+ <string name="actionbar_move">Pindah</string>
+ <string name="file_list_empty_moving">Tdak ada apapun disini. Anda dapat menambahkan sebuah folder!</string>
<string name="move_choose_button_text">Pilih</string>
+ <string name="move_file_not_found">Tidak dapat memindahkan. Silakan periksa apakah berkas ada</string>
+ <string name="move_file_invalid_into_descendent">Tidak mungkin untuk memindahkan folder kedalam turunannya</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="prefs_category_instant_uploading">Unggah Cepat</string>
+ <string name="prefs_category_security">Keamanan</string>
</resources>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="empty"></string>
</resources>
<string name="actionbar_upload_files">Skrár</string>
<string name="actionbar_settings">Stillingar</string>
<string name="actionbar_send_file">Senda</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_more">Meira</string>
<string name="prefs_help">Hjálp</string>
<string name="auth_username">Notendanafn</string>
<string name="actionbar_settings">Impostazioni</string>
<string name="actionbar_see_details">Dettagli</string>
<string name="actionbar_send_file">Invia</string>
+ <string name="actionbar_sort">Ordina</string>
+ <string name="actionbar_sort_title">Ordina per</string>
+ <string-array name="actionbar_sortby">
+ <item>A-Z</item>
+ <item>Più recente - Più datato</item>
+ </string-array>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Generale</string>
<string name="prefs_category_more">Altro</string>
<string name="prefs_accounts">Account</string>
<string name="preview_image_description">Anteprima dell\'immagine</string>
<string name="preview_image_error_unknown_format">Questa immagine non può essere mostrata</string>
<string name="error__upload__local_file_not_copied">%1$s non può essere copiato nella cartella locale %2$s</string>
+ <string name="prefs_instant_upload_path_title">Percorso di caricamento</string>
<string name="share_link_no_support_share_api">Spiacenti, la condivisione non è abilitata sul tuo server. Contatta il tuo
amministratore.</string>
<string name="share_link_file_no_exist">Impossibile condividere. Assicurati che il file esista</string>
<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 attraverso un percorso non sicuro.</string>
+ <string name="auth_redirect_non_secure_connection_title">La connessione sicura è rediretta su un percorso non sicuro.</string>
<string name="actionbar_logger">Registri</string>
<string name="log_send_history_button">Invia cronologia</string>
<string name="log_mail_subject">Registri applicazione ownCloud Android</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="prefs_category_instant_uploading">Caricamenti istantanei</string>
+ <string name="prefs_category_security">Protezione</string>
</resources>
<string name="actionbar_settings">設定</string>
<string name="actionbar_see_details">詳細</string>
<string name="actionbar_send_file">送信</string>
+ <string name="actionbar_sort">ソート</string>
+ <string name="actionbar_sort_title">ソート: </string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">一般</string>
<string name="prefs_category_more">もっと見る</string>
<string name="prefs_accounts">アカウント</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="actionbar_logger">ログ</string>
<string name="log_send_history_button">ログを送信</string>
<string name="log_mail_subject">ownCloud Android アプリログ</string>
<string name="move_file_invalid_overwrite">そのファイルは、宛先フォルダに既に存在しています。</string>
<string name="move_file_error">このファイルまたはフォルダーを移動する際にエラーが発生しました</string>
<string name="forbidden_permissions_move">このファイルを移動</string>
+ <string name="prefs_category_security">セキュリティ</string>
</resources>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="filedetails_download">Njipuk</string>
<string name="empty"></string>
</resources>
<string name="actionbar_mkdir">ახალი ფოლდერი</string>
<string name="actionbar_settings">პარამეტრები</string>
<string name="actionbar_send_file">გაგზავნა</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">ზოგადი</string>
<string name="prefs_category_more">უფრო მეტი</string>
<string name="prefs_accounts">ანგარიში</string>
<string name="empty"></string>
<string name="prefs_category_accounts">ანგარიში</string>
<string name="move_choose_button_text">არჩევა</string>
+ <string name="prefs_category_security">უსაფრთხოება</string>
</resources>
<string name="actionbar_settings">ការកំណត់</string>
<string name="actionbar_see_details">ព័ត៌មានលម្អិត</string>
<string name="actionbar_send_file">ផ្ញើ</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">ទូទៅ</string>
<string name="prefs_category_more">ច្រើនទៀត</string>
<string name="prefs_accounts">គណនី</string>
<string name="prefs_category_accounts">គណនី</string>
<string name="saml_authentication_wrong_pass">ខុសពាក្យសម្ងាត់</string>
<string name="move_choose_button_text">ជ្រើស</string>
+ <string name="prefs_category_security">សុវត្ថិភាព</string>
</resources>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="empty"></string>
</resources>
<string name="actionbar_settings">설정</string>
<string name="actionbar_see_details">세부내용</string>
<string name="actionbar_send_file">보내기</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">일반</string>
<string name="prefs_category_more">더 중요함</string>
<string name="prefs_accounts">계정</string>
<string name="saml_authentication_required_text">인증 필요함</string>
<string name="saml_authentication_wrong_pass">잘못된 암호</string>
<string name="move_choose_button_text">선택</string>
+ <string name="prefs_category_security">보안</string>
</resources>
<string name="actionbar_upload">بارکردن</string>
<string name="actionbar_upload_files">پهڕگەکان</string>
<string name="actionbar_settings">دهستكاری</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">گشتی</string>
<string name="prefs_accounts">هەژمارەکان</string>
<string name="prefs_help">یارمەتی</string>
<string name="actionbar_settings">Astellungen</string>
<string name="actionbar_see_details">Detailer</string>
<string name="actionbar_send_file">Schécken</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Allgemeng</string>
<string name="prefs_category_more">Méi</string>
<string name="prefs_accounts">Accounten</string>
<string name="actionbar_settings">Nustatymai</string>
<string name="actionbar_see_details">Informacija</string>
<string name="actionbar_send_file">Siųsti</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Bendras</string>
<string name="prefs_category_more">Daugiau</string>
<string name="prefs_accounts">Paskyros</string>
<string name="prefs_category_accounts">Paskyros</string>
<string name="saml_authentication_wrong_pass">Neteisingas slaptažodis</string>
<string name="move_choose_button_text">Pasirinkite</string>
+ <string name="prefs_category_security">Saugumas</string>
</resources>
<string name="actionbar_mkdir">Jauna mape</string>
<string name="actionbar_settings">Iestatījumi</string>
<string name="actionbar_send_file">Sūtīt</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Vispārīgi</string>
<string name="prefs_category_more">Vairāk</string>
<string name="prefs_accounts">Konti</string>
<string name="empty"></string>
<string name="prefs_category_accounts">Konti</string>
<string name="move_choose_button_text">Izvēlieties</string>
+ <string name="prefs_category_security">Drošība</string>
</resources>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="empty"></string>
</resources>
<string name="actionbar_settings">Параметри</string>
<string name="actionbar_see_details">Детали:</string>
<string name="actionbar_send_file">Прати</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Општо</string>
<string name="prefs_category_more">Повеќе</string>
<string name="prefs_accounts">Сметки</string>
<string name="saml_authentication_required_text">Потребна е автентификација</string>
<string name="saml_authentication_wrong_pass">Погрешна лозинка</string>
<string name="move_choose_button_text">Избери</string>
+ <string name="prefs_category_security">Безбедност</string>
</resources>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<string name="actionbar_upload_files">ഫയലുകൾ</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="sync_string_files">ഫയലുകൾ</string>
<string name="empty"></string>
</resources>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="empty"></string>
</resources>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="empty"></string>
</resources>
<string name="actionbar_upload">Muat naik</string>
<string name="actionbar_upload_files">Fail-fail</string>
<string name="actionbar_settings">Set</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Umum</string>
<string name="prefs_category_more">Lanjutan</string>
<string name="prefs_accounts">Akaun</string>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="empty"></string>
</resources>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<string name="actionbar_upload_files">ဖိုင်များ</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_help">အကူအညီ</string>
<string name="auth_username">သုံးစွဲသူအမည်</string>
<string name="auth_password">စကားဝှက်</string>
<string name="actionbar_settings">Innstillinger</string>
<string name="actionbar_see_details">Detaljer</string>
<string name="actionbar_send_file">Send</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Generelt</string>
<string name="prefs_category_more">Mer</string>
<string name="prefs_accounts">Kontoer</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 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_mail_subject">logger for ownCloud Android 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="prefs_category_security">Sikkerhet</string>
</resources>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="empty"></string>
</resources>
<string name="actionbar_settings">Instellingen</string>
<string name="actionbar_see_details">Details</string>
<string name="actionbar_send_file">Versturen</string>
+ <string name="actionbar_sort">Sorteren</string>
+ <string name="actionbar_sort_title">Sorteer op</string>
+ <string-array name="actionbar_sortby">
+ <item>A-Z</item>
+ <item>Nieuwste - Oudste</item>
+ </string-array>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Algemeen</string>
<string name="prefs_category_more">Meer</string>
<string name="prefs_accounts">Accounts</string>
<string name="preview_image_description">Afbeelding voorbeeld</string>
<string name="preview_image_error_unknown_format">Deze afbeelding kan niet worden getoond</string>
<string name="error__upload__local_file_not_copied">%1$s kon niet worden gekopieerd naar de %2$s lokale map</string>
+ <string name="prefs_instant_upload_path_title">Upload pad</string>
<string name="share_link_no_support_share_api">Sorry, delen is niet mogelijk op uw server. Neem contact op met uw
beheerder.</string>
<string name="share_link_file_no_exist">Kan dit niet delen. Controleer of dit bestand wel bestaat.</string>
<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 via een onveilige route.</string>
+ <string name="auth_redirect_non_secure_connection_title">De beveiligde verbinding is omgeleid naar een onveilige route.</string>
<string name="actionbar_logger">Logs</string>
<string name="log_send_history_button">Verstuur geschiedenis</string>
<string name="log_mail_subject">ownCloud Android app logs</string>
<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="prefs_category_instant_uploading">Directe uploads</string>
+ <string name="prefs_category_security">Beveiliging</string>
</resources>
<string name="actionbar_settings">Innstillingar</string>
<string name="actionbar_see_details">Detaljar</string>
<string name="actionbar_send_file">Send</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Generelt</string>
<string name="prefs_category_more">Meir</string>
<string name="prefs_accounts">Kontoar</string>
<string name="prefs_category_accounts">Kontoar</string>
<string name="saml_authentication_wrong_pass">Feil passord</string>
<string name="move_choose_button_text">Vel</string>
+ <string name="prefs_category_security">Tryggleik</string>
</resources>
<string name="actionbar_upload">Amontcarga</string>
<string name="actionbar_upload_files">Fichièrs</string>
<string name="actionbar_settings">Configuracion</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">General</string>
<string name="prefs_category_more">Mai d\'aquò</string>
<string name="prefs_accounts">Comptes</string>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="empty"></string>
</resources>
<string name="actionbar_settings">ਸੈਟਿੰਗ</string>
<string name="actionbar_see_details">ਵੇਰਵ</string>
<string name="actionbar_send_file">ਭੇਜੋ</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">ਆਮ</string>
<string name="prefs_accounts">ਅਕਾਊਂਟ</string>
<string name="prefs_log_title">ਲਾਗ ਰੱਖਣਾ ਚਾਲੂ</string>
<string name="actionbar_settings">Ustawienia</string>
<string name="actionbar_see_details">Szczegóły</string>
<string name="actionbar_send_file">Wyślij</string>
+ <string name="actionbar_sort">Sortuj</string>
+ <string name="actionbar_sort_title">Sortuj według</string>
+ <string-array name="actionbar_sortby">
+ <item>A-Z</item>
+ <item>Nowsze - Starsze</item>
+ </string-array>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Ogólne</string>
<string name="prefs_category_more">Więcej</string>
<string name="prefs_accounts">Konta</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="prefs_instant_upload_path_title">Katalog wysyłania </string>
<string name="share_link_no_support_share_api">Przepraszamy, ale współdzielenie nie jest włączone na Twoim serwerze. Proszę skontaktuj się z
administratorem.</string>
<string name="share_link_file_no_exist">Nie można udostępnić. Proszę sprawdzić, czy plik istnieje</string>
<string name="auth_redirect_non_secure_connection_title">Bezpieczne połączenie jest przekierowywane przez niezabezpieczone trasy.</string>
<string name="actionbar_logger">Logi</string>
<string name="log_send_history_button">Wyślij historię</string>
+ <string name="log_mail_subject">Logi aplikacji ownCloud Android</string>
<string name="log_progress_dialog_text">Ładuję dane...</string>
<string name="saml_authentication_required_text">Wymagana autoryzacja</string>
<string name="saml_authentication_wrong_pass">Złe hasło</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="prefs_category_instant_uploading">Automatyczne wysyłanie</string>
+ <string name="prefs_category_security">Bezpieczeństwo</string>
</resources>
<string name="actionbar_settings">Configurações</string>
<string name="actionbar_see_details">Detalhes</string>
<string name="actionbar_send_file">Enviar</string>
+ <string name="actionbar_sort">Classificar</string>
+ <string name="actionbar_sort_title">Classificar por</string>
+ <string-array name="actionbar_sortby">
+ <item>A-Z</item>
+ <item>Mais Recente - Mais Antigo</item>
+ </string-array>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Geral</string>
<string name="prefs_category_more">Mais</string>
<string name="prefs_accounts">Contas</string>
<string name="preview_image_description">Pré-visualização da 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">%1$s não pôde ser copiado para pasta local %2$s</string>
+ <string name="prefs_instant_upload_path_title">Enviar Caminho</string>
<string name="share_link_no_support_share_api">Desculpe, o compartilhamento não está habilitado em seu servidor. Entre em contato com seu
⇥⇥ administrador.</string>
<string name="share_link_file_no_exist">Não é possível compartilhar. Por favor verifique se o arquivo existe</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">A conexão segura está redirecionada através de uma rota insegura.</string>
+ <string name="auth_redirect_non_secure_connection_title">Conexão segura esta redirecionada para uma rota não segura.</string>
<string name="actionbar_logger">Logs</string>
<string name="log_send_history_button">Enviar Histórico</string>
<string name="log_mail_subject">Logs do aplicativo ownCloud Android</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="prefs_category_instant_uploading">Envios Instantâneos</string>
+ <string name="prefs_category_security">Segurança</string>
</resources>
<string name="actionbar_settings">Definições</string>
<string name="actionbar_see_details">Detalhes</string>
<string name="actionbar_send_file">Enviar</string>
+ <string name="actionbar_sort">Ordenar</string>
+ <string name="actionbar_sort_title">Ordenar por</string>
+ <string-array name="actionbar_sortby">
+ <item>A-Z</item>
+ <item>Mais Recente - Mais Antigo</item>
+ </string-array>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Geral</string>
<string name="prefs_category_more">Mais</string>
<string name="prefs_accounts">Contas</string>
<string name="prefs_feedback">Resposta</string>
<string name="prefs_imprint">Imprint</string>
<string name="recommend_subject">Experimente %1$s no seu smartphone!</string>
+ <string name="recommend_text">Quero convidar-te a usares %1$s no teu smartphone!\nFaz download aqui: %2$s</string>
<string name="auth_check_server">Verificar Servidor</string>
<string name="auth_host_url">Endereço do servidor https://..</string>
<string name="auth_username">Nome de Utilizador</string>
<string name="preview_image_description">Pré-Visualização da 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="prefs_instant_upload_path_title">Caminho de Upload</string>
<string name="share_link_no_support_share_api">Lamentamos mas não é possível partilhar através do seu servidor. Por favor contacte o seu administrador.</string>
<string name="share_link_file_no_exist">Não é possivel partilhar. Por favor verifique se o ficheiro existe</string>
<string name="share_link_file_error">Ocorreu um erro enquanto tentava partilhar este ficheiro ou pasta</string>
+ <string name="unshare_link_file_no_exist">Não é possível retirar a partilha. Verifique se o ficheiro existe</string>
<string name="unshare_link_file_error">Ocorreu um erro enquanto retirava a partilha deste ficheiro ou pasta</string>
<string name="activity_chooser_send_file_title">Enviar</string>
<string name="copy_link">Copiar ligação</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">Uma ligação segura foi redireccionada por uma rota insegura.</string>
+ <string name="auth_redirect_non_secure_connection_title">Ligação segura é redireccionada para um caminho inseguro.</string>
+ <string name="actionbar_logger">Logs</string>
<string name="log_send_history_button">Enviar Histórico</string>
+ <string name="log_mail_subject">Logs da app ownCloud Android</string>
<string name="log_progress_dialog_text">A carregar os dados...</string>
<string name="saml_authentication_required_text">Autenticação necessária</string>
<string name="saml_authentication_wrong_pass">Password errada</string>
<string name="actionbar_move">Mover</string>
<string name="file_list_empty_moving">Não está aqui nada. Pode adicionar uma pasta!</string>
<string name="move_choose_button_text">Escolha</string>
+ <string name="move_file_not_found">Não é possível mover. Verifique se o ficheiro existe</string>
+ <string name="move_file_invalid_into_descendent">Não é possível mover esta pasta deste modo</string>
<string name="move_file_invalid_overwrite">O ficheiro já existe na pasta de destino</string>
+ <string name="move_file_error">Um erro ocorreu ao tentar mover este ficheiro ou pasta</string>
<string name="forbidden_permissions_move">para mover este ficheiro</string>
+ <string name="prefs_category_instant_uploading">Uploads Instantâneos</string>
+ <string name="prefs_category_security">Segurança</string>
</resources>
<string name="actionbar_settings">Setări</string>
<string name="actionbar_see_details">Detalii</string>
<string name="actionbar_send_file">Expediază</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">General</string>
<string name="prefs_category_more">Mai mult</string>
<string name="prefs_accounts">Conturi</string>
<string name="prefs_category_accounts">Conturi</string>
<string name="saml_authentication_wrong_pass">Parolă greșită</string>
<string name="move_choose_button_text">Alege</string>
+ <string name="prefs_category_security">Securitate</string>
</resources>
<string name="actionbar_settings">Настройки</string>
<string name="actionbar_see_details">Подробно</string>
<string name="actionbar_send_file">Отправить</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Основные</string>
<string name="prefs_category_more">Больше</string>
<string name="prefs_accounts">Учётные записи</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="actionbar_logger">Журналы</string>
<string name="log_send_history_button">История Отправлений</string>
<string name="log_mail_subject">Журналы Андроид-приложения ownCloud</string>
<string name="move_file_invalid_overwrite">Файл уже существует в папке назначения</string>
<string name="move_file_error">Произошла ошибка при попытке перемещения этого файла или папки</string>
<string name="forbidden_permissions_move">переместить этот файл</string>
+ <string name="prefs_category_security">Безопасность</string>
</resources>
<string name="actionbar_upload">උඩුගත කිරීම</string>
<string name="actionbar_upload_files">ගොනු</string>
<string name="actionbar_settings">සිටුවම්</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">සාමාන්යයෙන්</string>
<string name="prefs_category_more">වැඩි</string>
<string name="prefs_accounts">ගිණුම්</string>
<string name="actionbar_settings">Nastavenia</string>
<string name="actionbar_see_details">Podrobnosti</string>
<string name="actionbar_send_file">Odoslať</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Všeobecné</string>
<string name="prefs_category_more">Viac</string>
<string name="prefs_accounts">Účty</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é spojenie je presmerované nezabezpečenou cestou.</string>
<string name="saml_authentication_required_text">Vyžaduje sa overenie</string>
<string name="saml_authentication_wrong_pass">Nesprávne heslo</string>
<string name="actionbar_move">Presunúť</string>
<string name="move_choose_button_text">Vybrať</string>
+ <string name="prefs_category_security">Zabezpečenie</string>
</resources>
<string name="actionbar_settings">Nastavitve</string>
<string name="actionbar_see_details">Podrobnosti</string>
<string name="actionbar_send_file">Pošlji</string>
+ <string name="actionbar_sort">Razvrsti</string>
+ <string name="actionbar_sort_title">Razvrsti po</string>
+ <string-array name="actionbar_sortby">
+ <item>Naraščajoče A – Z</item>
+ <item>Novejše – Starejše</item>
+ </string-array>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Splošno</string>
<string name="prefs_category_more">Več</string>
<string name="prefs_accounts">Računi</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="prefs_instant_upload_path_title">Pot za pošiljanje</string>
<string name="share_link_no_support_share_api">Souporaba je na strežniku onemogočena. Možnost lahko spreminjajo le
uporabniki s skrbniškimi dovoljenji.</string>
<string name="share_link_file_no_exist">Souporaba ni mogoča. Preverite, ali datoteka obstaja.</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="prefs_category_instant_uploading">Takojšnje pošiljanje v oblak</string>
+ <string name="prefs_category_security">Varnost</string>
</resources>
<string name="actionbar_mkdir">Dosje e\'re</string>
<string name="actionbar_settings">Parametrat</string>
<string name="actionbar_send_file">Dërgo</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Përgjithshme</string>
<string name="prefs_category_more">Më tepër</string>
<string name="prefs_accounts">Llogarit</string>
<string name="prefs_category_accounts">Llogarit</string>
<string name="saml_authentication_wrong_pass">Fjalëkalim i gabuar</string>
<string name="move_choose_button_text">Zgjidh</string>
+ <string name="prefs_category_security">Siguria</string>
</resources>
<string name="actionbar_settings">Podešavanja</string>
<string name="actionbar_see_details">Detaljnije</string>
<string name="actionbar_send_file">Pošalji</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Opšte</string>
<string name="prefs_accounts">Nalozi</string>
<string name="prefs_manage_accounts">Upravljaj nalozima</string>
<string name="actionbar_upload_files">Датотеке</string>
<string name="actionbar_settings">Поставке</string>
<string name="actionbar_send_file">Пошаљи</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Опште</string>
<string name="prefs_category_more">Више</string>
<string name="prefs_accounts">Налози</string>
<string name="empty"></string>
<string name="prefs_category_accounts">Налози</string>
<string name="move_choose_button_text">Одабери</string>
+ <string name="prefs_category_security">Безбедност</string>
</resources>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="empty"></string>
</resources>
<string name="actionbar_settings">Inställningar</string>
<string name="actionbar_see_details">Detaljer</string>
<string name="actionbar_send_file">Skicka</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Allmänt</string>
<string name="prefs_category_more">Mer</string>
<string name="prefs_accounts">Konton</string>
<string name="prefs_recommend">Rekommendera till en vän</string>
<string name="prefs_feedback">Feedback</string>
<string name="prefs_imprint">Imprint</string>
- <string name="recommend_subject">Försök %1$s på din smarttelefon!</string>
- <string name="recommend_text">Jag skulle vilja bjuda in dig till att använda %1$s på din smartphone!\nLadda ner här: %2$s</string>
+ <string name="recommend_subject">Prova %1$s på din smartphone!</string>
+ <string name="recommend_text">Jag skullje vilja bjuda in dig till att prova %1$s på din smartphone!\nLadda ner appen från Google Play här: %2$s</string>
<string name="auth_check_server">Kontrollera Server</string>
<string name="auth_host_url">Serveradress https://...</string>
<string name="auth_username">Användarnamn</string>
<string name="move_choose_button_text">Välj</string>
<string name="move_file_not_found">Gick inte att flytta. Vänligen kontrollera att filen existerar</string>
<string name="forbidden_permissions_move">att flytta den här filen</string>
+ <string name="prefs_category_security">Säkerhet</string>
</resources>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="empty"></string>
</resources>
<string name="actionbar_settings">அமைப்புகள்</string>
<string name="actionbar_see_details">விவரங்கள்</string>
<string name="actionbar_send_file">அனுப்பவும்</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">பொது</string>
<string name="prefs_category_more">மேலும்</string>
<string name="prefs_accounts">கணக்குகள்</string>
<string name="actionbar_upload_files">கோப்புகள்</string>
<string name="actionbar_settings">அமைப்புகள்</string>
<string name="actionbar_see_details">விவரங்கள்</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">பொதுவான</string>
<string name="prefs_category_more">மேலதிக</string>
<string name="prefs_accounts">கணக்குகள்</string>
<string name="actionbar_mkdir">కొత్త సంచయం</string>
<string name="actionbar_settings">అమరికలు</string>
<string name="actionbar_send_file">పంపించు</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_more">మరిన్ని</string>
<string name="prefs_help">సహాయం</string>
<string name="auth_username">వాడుకరి పేరు</string>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="empty"></string>
</resources>
<string name="actionbar_settings">ตั้งค่า</string>
<string name="actionbar_see_details">รายละเอียด</string>
<string name="actionbar_send_file">ส่ง</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">ทั่วไป</string>
<string name="prefs_category_more">มาก</string>
<string name="prefs_accounts">บัญชี</string>
<string name="actionbar_settings">Ayarlar</string>
<string name="actionbar_see_details">Ayrıntılar</string>
<string name="actionbar_send_file">Gönder</string>
+ <string name="actionbar_sort">Sırala</string>
+ <string name="actionbar_sort_title">Şuna göre sırala</string>
+ <string-array name="actionbar_sortby">
+ <item>A-Z</item>
+ <item>Yeniden - Eskiye</item>
+ </string-array>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Genel</string>
<string name="prefs_category_more">Daha fazla</string>
<string name="prefs_accounts">Hesaplar</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="prefs_instant_upload_path_title">Yükleme Yolu</string>
<string name="share_link_no_support_share_api">Üzgünüz, paylaşım sunucunuzda etkin değil. Lütfen yöneticinizle
iletişime geçin.</string>
<string name="share_link_file_no_exist">Paylaşma başarısız. Lütfen dosyanın mevcut olup olmadığını denetleyin</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önlendiriliyor.</string>
+ <string name="auth_redirect_non_secure_connection_title">Güvenli bağlantı, güvenli olmayan bir rotaya yönlendirildi.</string>
<string name="actionbar_logger">Günlükler</string>
<string name="log_send_history_button">Geçmişi Gönder</string>
<string name="log_mail_subject">ownCloud Android uygulama kayıtları</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="prefs_category_instant_uploading">Anında Yüklemeler</string>
+ <string name="prefs_category_security">Güvenlik</string>
</resources>
<string name="actionbar_mkdir">يېڭى قىسقۇچ</string>
<string name="actionbar_settings">تەڭشەكلەر</string>
<string name="actionbar_send_file">يوللا</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">ئادەتتىكى</string>
<string name="prefs_category_more">تېخىمۇ كۆپ</string>
<string name="prefs_accounts">ھېساباتلار</string>
<string name="activity_chooser_send_file_title">يوللا</string>
<string name="empty"></string>
<string name="prefs_category_accounts">ھېساباتلار</string>
+ <string name="prefs_category_security">بىخەتەرلىك</string>
</resources>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
+ <string name="about_android">%1$s Android App</string>
+ <string name="about_version">версія %1$s</string>
+ <string name="actionbar_sync">Оновити account</string>
<string name="actionbar_upload">Відвантажити</string>
<string name="actionbar_upload_from_apps">Вміст із інших програм</string>
<string name="actionbar_upload_files">Файли</string>
+ <string name="actionbar_open_with">Відкрити за допомогою</string>
<string name="actionbar_mkdir">Нова тека</string>
<string name="actionbar_settings">Налаштування</string>
<string name="actionbar_see_details">Деталі</string>
<string name="actionbar_send_file">Надіслати</string>
+ <string name="actionbar_sort">Сортувати</string>
+ <string name="actionbar_sort_title">Сортувати за</string>
+ <string-array name="actionbar_sortby">
+ <item>А-Я</item>
+ <item>Новіші-Старіші</item>
+ </string-array>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Основне</string>
<string name="prefs_category_more">Більше</string>
<string name="prefs_accounts">Облікові записи</string>
<string name="prefs_manage_accounts">Управління обліковими записами</string>
<string name="prefs_pincode">App програмний PIN</string>
<string name="prefs_pincode_summary">Захист Вашог App клієнта</string>
+ <string name="prefs_instant_upload">Миттєві зображення</string>
+ <string name="prefs_instant_upload_summary">Миттєві зображення з камери</string>
+ <string name="prefs_instant_video_upload">Миттєві відео</string>
+ <string name="prefs_instant_video_upload_summary">Миттєві відео з камери</string>
+ <string name="prefs_log_title">Ввімкнути журнал</string>
+ <string name="prefs_log_summary">Використовується для реєстрації помилок</string>
+ <string name="prefs_log_title_history">Журнал</string>
+ <string name="prefs_log_summary_history">Тут показані записи журналу</string>
+ <string name="prefs_log_delete_history_button">Видалити історію записів</string>
<string name="prefs_help">Допомога</string>
+ <string name="prefs_recommend">Порадити товаришу</string>
<string name="prefs_feedback">Зворотній зв\'язок</string>
<string name="prefs_imprint">Відбиток</string>
+ <string name="recommend_subject">Спробуйте %1$s на своєму смартфоні!</string>
+ <string name="recommend_text">Пропоную вам користуватися %1$s на вашому смартфоні!\nЗавантажити можна за посиланням: %2$s</string>
+ <string name="auth_check_server">Перевірити сервер</string>
+ <string name="auth_host_url">Адреса серверу https://…</string>
<string name="auth_username">Ім\'я користувача</string>
<string name="auth_password">Пароль</string>
+ <string name="auth_register">Вперше в %1$s?</string>
<string name="sync_string_files">Файли</string>
<string name="setup_btn_connect">З\'єднати</string>
<string name="uploader_btn_upload_text">Відвантажити</string>
+ <string name="uploader_top_message">Оберіть теку для завантаження:</string>
<string name="uploader_wrn_no_account_title">Не знайдено облікового запису</string>
<string name="uploader_wrn_no_account_text">На Вашому пристрої відсутні облікові записи %1$s. Будь ласка, спочатку створіть запис.</string>
<string name="uploader_wrn_no_account_setup_btn_text">Налаштування</string>
<string name="uploader_error_forbidden_content">%1$s не може отримати доступ до спільного контенту</string>
<string name="uploader_info_uploading">Завантаження</string>
<string name="file_list_empty">Тут нічого немає. Відвантажте що-небудь!</string>
+ <string name="file_list_loading">Завантаження...</string>
+ <string name="local_file_list_empty">В цій теці немає файлів.</string>
<string name="filedetails_select_file">Натисніть на файлі для відображення додаткової інформації</string>
<string name="filedetails_size">Розмір:</string>
<string name="filedetails_type">Тип:</string>
<string name="filedetails_created">Створено:</string>
<string name="filedetails_modified">Змінено:</string>
<string name="filedetails_download">Завантажити</string>
+ <string name="filedetails_sync_file">Оновити файл</string>
<string name="filedetails_renamed_in_upload_msg">Файл був переіменований в %1$s протягом вивантаження</string>
<string name="action_share_file">Опублікувати посилання</string>
+ <string name="action_unshare_file">Видалити посилання</string>
<string name="common_yes">Так</string>
<string name="common_no">Ні</string>
<string name="common_ok">OK</string>
<string name="common_cancel">Відмінити</string>
<string name="common_save_exit">Зберегти & Вихід</string>
<string name="common_error">Помилка</string>
+ <string name="common_loading">Завантаження...</string>
<string name="common_error_unknown">Невідома помилка</string>
<string name="about_title">Про</string>
<string name="change_password">Змінити пароль</string>
<string name="uploader_upload_succeeded_content_single">%1$s було успішно завантажено</string>
<string name="uploader_upload_failed_ticker">Помилка завантаження</string>
<string name="uploader_upload_failed_content_single">Завантаження %1$s не може завершитись</string>
+ <string name="uploader_upload_failed_credentials_error">Завантажити не вдалося, необхідно повторити вхід</string>
<string name="downloader_download_in_progress_ticker">Зкачування …</string>
<string name="downloader_download_in_progress_content">%1$d%% Зкачування %2$s</string>
<string name="downloader_download_succeeded_ticker">Успішно зкачано</string>
<string name="downloader_download_succeeded_content">%1$s успішно завантажено</string>
<string name="downloader_download_failed_ticker">Завантаження не вдалося</string>
<string name="downloader_download_failed_content">Завантаження %1$s не вдається завершити</string>
+ <string name="downloader_not_downloaded_yet">Ще не завантажене</string>
+ <string name="downloader_download_failed_credentials_error">Зберегти не вдалося, необхідно повторити вхід</string>
<string name="common_choose_account">Оберіть обліковий запис</string>
<string name="sync_fail_ticker">Помилка синхронізації</string>
+ <string name="sync_fail_ticker_unauthorized">Синхронізація не вдалася, необхідно повторити вхід</string>
<string name="sync_fail_content">Синхронізація %1$s не вдалась</string>
+ <string name="sync_fail_content_unauthorized">Невірний пароль для %1$s</string>
<string name="sync_conflicts_in_favourites_ticker">Конфліктів знайдено</string>
<string name="sync_conflicts_in_favourites_content">%1$d файли, які мають бути синхронізованими не можуть синхронізуватися</string>
<string name="sync_fail_in_favourites_ticker">Синхронізувати файли не вдалося</string>
<string name="sync_fail_in_favourites_content">Зміст %1$d файлів не може бути синхронізований (%2$d конфліктів)</string>
<string name="sync_foreign_files_forgotten_ticker">Деякі локальні файли були забуті</string>
+ <string name="sync_foreign_files_forgotten_content">Неможливо скопіювати %1$d файли з теки %2$s</string>
+ <string name="sync_foreign_files_forgotten_explanation">\"Починаючи з версії 1.3.16, файли, завантажені з цього пристрою копіюються в локальну теку %1$s для запобігання втрати даних під час синхронізації одного файлу з кількома обліковими записами.\n\nТому всі файли, завантажені в попередніх версіях цього додатку були скопійовані в теку %2$s. Однак, під час синхронізації сталася помилка. Ви можете залишити файл(и) як є та видалити посилання на %3$s, або перемістити файл(и) в директорію %1$s і зберегти посилання на %4$s.\n\nНижче наведені локальні та віддалені файли у %5$s з якою вони були пов\'язані.</string>
+ <string name="sync_current_folder_was_removed">Тека %1$s білше не існує</string>
<string name="foreign_files_move">Перемістити все</string>
<string name="foreign_files_success">Всі файли були переміщені</string>
<string name="foreign_files_fail">Деякі файли не можуть бути переміщені</string>
<string name="foreign_files_local_text">Локально: %1$s</string>
<string name="foreign_files_remote_text">Віддалено: %1$s</string>
+ <string name="upload_query_move_foreign_files">Недостатньо місця для копіювання обраних файлів у теку %1$s. Чи бажаєте ви перемістити їх замість копіювання?</string>
<string name="pincode_enter_pin_code">Будь ласка, введіть свій програмний PIN</string>
<string name="pincode_configure_your_pin">Введіть програмний PIN</string>
<string name="pincode_configure_your_pin_explanation">PIN необхідно буде вводити щоразу при запуску цієї програми</string>
<string name="pincode_wrong">Не вірний App програмний PIN</string>
<string name="pincode_removed">App програмний PIN видалено</string>
<string name="pincode_stored">App програмний PIN збережено</string>
+ <string name="media_notif_ticker">%1$s музичний плеєр</string>
+ <string name="media_state_playing">%1$s (відтворення)</string>
+ <string name="media_state_loading">%1$s (завантаження)</string>
+ <string name="media_event_done">%1$s відтворення завершене</string>
+ <string name="media_err_nothing_to_play">Медіа-файлів не знайдено</string>
+ <string name="media_err_no_account">Обліковий запис не налаштований</string>
+ <string name="media_err_not_in_owncloud">Файл в невірному обліковому записі</string>
+ <string name="media_err_unsupported">Кодек не підтримується</string>
+ <string name="media_err_io">Медіа-файл не читається</string>
+ <string name="media_err_malformed">Медіа-файл невірно закодований</string>
+ <string name="media_err_timeout">Вийшов час на спробу відтворення</string>
+ <string name="media_err_invalid_progressive_playback">Неможливо потоком відтворити файл</string>
+ <string name="media_err_unknown">Медіа-файл неможливо відтворити вбудованим програвачем</string>
+ <string name="media_err_security_ex">Помилка безпеки при відтворені %1$s</string>
+ <string name="media_err_io_ex">Помилка вводу при відтворені %1$s</string>
+ <string name="media_err_unexpected">Несподівана помилка при відтворені %1$s</string>
+ <string name="media_rewind_description">Перемтка назад</string>
+ <string name="media_play_pause_description">Відтворення або пауза</string>
+ <string name="media_forward_description">Перемотка вперед</string>
+ <string name="auth_getting_authorization">Виконується вхід...</string>
<string name="auth_trying_to_login">Спроба входу…</string>
<string name="auth_no_net_conn_title">Відсутнє підключення до мережі</string>
<string name="auth_nossl_plain_ok_title">Безпечне з\'єднання не доступне.</string>
<string name="auth_connection_established">З\'єднання встановлено</string>
<string name="auth_testing_connection">Перевірка з\'єднання…</string>
<string name="auth_not_configured_title">Не вірні налаштування сервер </string>
+ <string name="auth_account_not_new">Такий обліковий запис вже існує на пристрої</string>
+ <string name="auth_account_not_the_same">Введений користувач не відповідає обліковому запису</string>
<string name="auth_unknown_error_title">Виникла невідома помилка!</string>
<string name="auth_unknown_host_title">Не вдалося знайти хост</string>
<string name="auth_incorrect_path_title">Не знайдено примірник сервер</string>
<string name="auth_timeout_title">Сервер занадто довго не відповідає</string>
<string name="auth_incorrect_address_title">Пошкоджений URL</string>
<string name="auth_ssl_general_error_title">Помилка SSL ініціалізації</string>
+ <string name="auth_ssl_unverified_server_title">Неможливо перевірити SSL-сертифікат сервера</string>
<string name="auth_bad_oc_version_title">Не вдалося визначити версію сервер серверу</string>
<string name="auth_wrong_connection_title">Не вдалося встановити з\'єднання</string>
<string name="auth_secure_connection">Встановлено захищене з\'єднання</string>
+ <string name="auth_unauthorized">Невірне ім\'я користувача або пароль</string>
+ <string name="auth_oauth_error">Невдала авторизація</string>
+ <string name="auth_oauth_error_access_denied">Доступ заборонений сервером авторизації</string>
+ <string name="auth_wtf_reenter_URL">Несподівана відповідь; будь ласка, введіть адресу сервера знову</string>
+ <string name="auth_expired_oauth_token_toast">Час авторизації минув. Будь ласка, увійдіть знову</string>
+ <string name="auth_expired_basic_auth_toast">Будь ласка, введіть пароль</string>
+ <string name="auth_expired_saml_sso_token_toast">Час сесії минув. Будь ласка, підключіться знов</string>
+ <string name="auth_connecting_auth_server">Підключення до серверу аутентифікації...</string>
+ <string name="auth_unsupported_auth_method">Сервер не підтримує обраний метод аутентифікації</string>
+ <string name="auth_unsupported_multiaccount">%1$s не підтримує одночасно декілька облікових записів</string>
+ <string name="auth_fail_get_user_name">Ваш сервер не повертає коректний ідентифікатор користувача, будь ласка зверніться до адміністратора
+⇥</string>
+ <string name="auth_can_not_auth_against_server">Аутентифікація на цьому сервері неможлива</string>
<string name="fd_keep_in_sync">Оновлювати файл</string>
<string name="common_rename">Перейменувати</string>
<string name="common_remove">Видалити</string>
+ <string name="confirmation_remove_alert">Ви дійсно бажаєте видалити %1$s?</string>
+ <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="rename_server_fail_msg">Перейменування не вдалося</string>
<string name="sync_file_fail_msg">Неможливо перевірити віддалений файл</string>
<string name="sync_file_nothing_to_do_msg">Зміст файлу вже синхронізовано</string>
+ <string name="create_dir_fail_msg">Не вдалося створити теку</string>
+ <string name="filename_forbidden_characters">Заборонені символи: / \\ < > : \" | ? *</string>
+ <string name="filename_empty"> Ім\'я файлу не може бути порожнім.</string>
<string name="wait_a_moment">Зачекайте хвилинку</string>
<string name="filedisplay_unexpected_bad_get_content">Несподівані проблеми ; будь ласка, спробуйте використати іншу програму для вибору файлу</string>
<string name="filedisplay_no_file_selected">Не обрано файл</string>
+ <string name="activity_chooser_title">Надіслати посилання...</string>
+ <string name="oauth_check_onoff">Увійти через oAuth2</string>
+ <string name="oauth_login_connection">Підключення до серверу oAuth2...</string>
<string name="ssl_validator_header">Не вдалося перевірити ідентифікацію сайта</string>
<string name="ssl_validator_reason_cert_not_trusted">- Не довірений сертифікат серверу</string>
<string name="ssl_validator_reason_cert_expired">- Сертифікат серверу втратив чинність</string>
<string name="ssl_validator_label_validity_to">До:</string>
<string name="ssl_validator_label_signature">Підпис:</string>
<string name="ssl_validator_label_signature_algorithm">Алгоритм:</string>
+ <string name="ssl_validator_null_cert">Не вдалося показати сертифікат.</string>
+ <string name="ssl_validator_no_info_about_error">- Інформація про помилку відсутня</string>
<string name="placeholder_sentence">Це заповнювач</string>
+ <string name="placeholder_filename">placeholder.txt</string>
+ <string name="placeholder_filetype">PNG зображення</string>
+ <string name="placeholder_filesize">389 КБ</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">Завантажувати зображення тільки через WiFi</string>
+ <string name="instant_video_upload_on_wifi">Завантажувати відео тільки через WiFi</string>
<string name="instant_upload_path">/InstantUpload</string>
<string name="conflict_title">Конфлікт оновлення</string>
<string name="conflict_message">Віддалений файл %s не синхронізовано з локальним. Продовження процедури замінить вміст файлу на сервері.</string>
<string name="conflict_keep_both">Залишити обидва</string>
<string name="conflict_overwrite">Замінити</string>
<string name="conflict_dont_upload">Не завантажувати</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="prefs_instant_upload_path_title">Завантажити шлях</string>
+ <string name="share_link_no_support_share_api">На жаль, обмін не включений на вашому сервері. Будь ласка, зв\'яжіться з вашим адмінистратором.</string>
+ <string name="share_link_file_no_exist">Неможливо поділитися. Будь ласка, перевірте, чи існує файл</string>
+ <string name="share_link_file_error">Виникла помилка при спробі поділитися файлом або текою</string>
+ <string name="unshare_link_file_no_exist">Неможливо заборонити доступ. Будь ласка, перевірте, чи існує файл</string>
+ <string name="unshare_link_file_error">Виникла помилка при спробі заборонити доступ до файлу або теки</string>
<string name="activity_chooser_send_file_title">Надіслати</string>
+ <string name="copy_link">Копіювати посилання</string>
<string name="clipboard_text_copied">Скопійовано в буфер обміну</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="network_error_connect_timeout_exception">Під час очікування на сервер виникла помилка, операцію неможливо завершити</string>
+ <string name="network_host_not_available">Неможливо завершити операцію, сервер недоступний</string>
<string name="empty"></string>
+ <string name="forbidden_permissions">У вас немає повноважень %s</string>
+ <string name="forbidden_permissions_rename">на перейменування цього файла</string>
+ <string name="forbidden_permissions_delete">на видалення цього файла</string>
+ <string name="share_link_forbidden_permissions">для надання доступу до файла</string>
+ <string name="unshare_link_forbidden_permissions">для закриття доступу до файла</string>
+ <string name="forbidden_permissions_create">для створення файла</string>
+ <string name="uploader_upload_forbidden_permissions">для завантаження в цю теку</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="actionbar_logger">Журнали</string>
+ <string name="log_send_history_button">Надіслати історію</string>
+ <string name="log_mail_subject">Журнали Android-додатка ownCloud</string>
+ <string name="log_progress_dialog_text">Завантаження даних...</string>
+ <string name="saml_authentication_required_text">Потрібна аутентифікація</string>
+ <string name="saml_authentication_wrong_pass">Невірний пароль</string>
+ <string name="actionbar_move">Перемістити</string>
+ <string name="file_list_empty_moving">Тут нічого немає. Ви можете додати теку!</string>
<string name="move_choose_button_text">Обрати</string>
+ <string name="move_file_not_found">Неможливо перемістити. Будь ласка, перевірте, чи існує файл</string>
+ <string name="move_file_invalid_into_descendent">Неможливо перемістити теку до теки-нащадка</string>
+ <string name="move_file_invalid_overwrite">Файл вже існує в теці призначення</string>
+ <string name="move_file_error">Виникла помилка при спробі перемістити файл або теку</string>
+ <string name="forbidden_permissions_move">перемістити цей файл</string>
+ <string name="prefs_category_instant_uploading">Миттєво завантаження</string>
+ <string name="prefs_category_security">Безпека</string>
</resources>
<resources>
<string name="actionbar_settings">سیٹینگز</string>
<string name="actionbar_send_file">بھجیں</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_more">مزید</string>
<string name="prefs_help">مدد</string>
<string name="auth_username">یوزر نیم</string>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="empty"></string>
</resources>
<string name="actionbar_settings">Cài đặt</string>
<string name="actionbar_see_details">Chi tiết</string>
<string name="actionbar_send_file">Gởi</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Tổng hợp</string>
<string name="prefs_category_more">hơn</string>
<string name="prefs_accounts">Tài khoản</string>
<string name="actionbar_settings">设置</string>
<string name="actionbar_see_details">详细信息</string>
<string name="actionbar_send_file">发送</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">常规</string>
<string name="prefs_category_more">更多</string>
<string name="prefs_accounts">账号</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="actionbar_logger">日志</string>
<string name="log_send_history_button">发送历史</string>
<string name="log_mail_subject">ownCloud安卓客户端日志</string>
<string name="move_file_invalid_overwrite">该文件已经存在在目标文件夹</string>
<string name="move_file_error">尝试移动该文件或文件夹时发生错误</string>
<string name="forbidden_permissions_move">移动该文件</string>
+ <string name="prefs_category_security">安全</string>
</resources>
<string name="actionbar_mkdir">新資料夾</string>
<string name="actionbar_settings">設定</string>
<string name="actionbar_send_file">傳送</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">一般</string>
<string name="prefs_category_more">更多</string>
<string name="prefs_accounts">帳號</string>
<string name="actionbar_settings">設定</string>
<string name="actionbar_see_details">詳細資料</string>
<string name="actionbar_send_file">寄出</string>
+ <!--TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item>-->
<string name="prefs_category_general">一般</string>
<string name="prefs_category_more">更多</string>
<string name="prefs_accounts">帳號</string>
<string name="prefs_feedback">反饋</string>
<string name="prefs_imprint">法律聲明</string>
<string name="recommend_subject">在您的手機中試用%1$s!</string>
+ <string name="recommend_text">我想邀請您在您的手機上使用 %1$s ! 可以由這兒下載: %2$s</string>
<string name="auth_check_server">檢查伺服器</string>
<string name="auth_host_url">伺服器位址 https://...</string>
<string name="auth_username">使用者名稱</string>
<string name="uploader_error_forbidden_content">%1$s 並沒有被允許存取分享的內容</string>
<string name="uploader_info_uploading">上傳中</string>
<string name="file_list_empty">這裡還沒有東西,上傳一些吧!</string>
+ <string name="file_list_loading">載入中…</string>
+ <string name="local_file_list_empty">這個目錄中沒有任何檔案.</string>
<string name="filedetails_select_file">在檔案上輕觸來顯示更多資訊。</string>
<string name="filedetails_size">容量:</string>
<string name="filedetails_type">類型:</string>
<string name="downloader_download_failed_credentials_error">下傳失敗, 您需要重新登入</string>
<string name="common_choose_account">選擇帳號</string>
<string name="sync_fail_ticker">同步失敗</string>
+ <string name="sync_fail_ticker_unauthorized">同步作業失敗, 您需要重新登入</string>
<string name="sync_fail_content">同步 %1$s 未完成</string>
<string name="sync_fail_content_unauthorized">無效的密碼 %1$s</string>
<string name="sync_conflicts_in_favourites_ticker">出現衝突</string>
<string name="sync_fail_in_favourites_content">%1$d 未被同步 (%2$d 衝突)</string>
<string name="sync_foreign_files_forgotten_ticker">有些本地端的檔案已遺失</string>
<string name="sync_foreign_files_forgotten_content">%1$d 檔案超過 %2$s 資料夾可能不能複製進去</string>
+ <string name="sync_foreign_files_forgotten_explanation">在 1.3.16 版之前, 檔案上傳時會先複製到本地的 %1$s 目錄以避免在多帳戶內同步造成遺失.\n\n由於這個改變, 所以在之前版本上傳的檔案被複製到 %2$s 目錄中. 為了避免同步發生問題. 你可以保留那些檔案並刪除連結 %3$s, 或搬移檔案到 %1$s 目錄並取得連結到 %4$s.\n\n下面列表是本地檔案, 與被連結遠端檔案 %5$s.</string>
<string name="sync_current_folder_was_removed">資料夾 %1$s 不存在</string>
<string name="foreign_files_move">移動全部</string>
<string name="foreign_files_success">所有文件已被移動</string>
<string name="foreign_files_fail">部份文件無法被移動</string>
<string name="foreign_files_local_text">本地: %1$s</string>
<string name="foreign_files_remote_text">遠端: %1$s</string>
+ <string name="upload_query_move_foreign_files">無足夠的空間可以複製檔案到 %1$s 目錄. 是否使用移動的方式來處理? </string>
<string name="pincode_enter_pin_code">請輸入您的 App 密碼</string>
<string name="pincode_configure_your_pin">輸入您的 App 密碼</string>
<string name="pincode_configure_your_pin_explanation">這個密碼在你每次啟動這程式時都會被要求輸入</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="prefs_instant_upload_path_title">上傳目錄</string>
<string name="share_link_no_support_share_api">很抱歉, 您的伺服器並未開啟分享的功能. 請聯絡您的
伺服器管理員.</string>
+ <string name="share_link_file_no_exist">無法分享這個檔案或目錄. 請檢查它們是否存在</string>
<string name="share_link_file_error">在分享檔案或目錄時發生了錯誤</string>
+ <string name="unshare_link_file_no_exist">無法取消分享這個檔案或目錄. 請檢查它們是否存在</string>
<string name="unshare_link_file_error">在取消分享檔案或目錄時發生了錯誤</string>
<string name="activity_chooser_send_file_title">寄出</string>
<string name="copy_link">複製連結</string>
<string name="network_error_connect_timeout_exception">在等待伺服器回應時發生了錯誤, 這個操作將無法被完成</string>
<string name="network_host_not_available">這個操作無法完成, 無法使用伺服器</string>
<string name="empty"></string>
+ <string name="forbidden_permissions">您沒有權限 %s</string>
+ <string name="forbidden_permissions_rename">重新命名檔案</string>
+ <string name="forbidden_permissions_delete">刪除檔案</string>
+ <string name="share_link_forbidden_permissions">分享檔案</string>
+ <string name="unshare_link_forbidden_permissions">取消分享檔案</string>
+ <string name="forbidden_permissions_create">建立檔案</string>
+ <string name="uploader_upload_forbidden_permissions">上傳這個目錄</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="actionbar_logger">紀錄</string>
+ <string name="log_send_history_button">傳送歷史記錄</string>
+ <string name="log_mail_subject">ownCloud Android 應用程式記錄</string>
+ <string name="log_progress_dialog_text">資料載入中...</string>
<string name="saml_authentication_required_text">必須驗證</string>
<string name="saml_authentication_wrong_pass">密碼錯誤</string>
+ <string name="actionbar_move">移動</string>
+ <string name="file_list_empty_moving">找不到任何檔案. 你可以新增一個目錄!</string>
<string name="move_choose_button_text">選擇</string>
+ <string name="move_file_not_found">無法搬移. 請檢查該檔案是否存在</string>
+ <string name="move_file_invalid_into_descendent">把一個目錄搬移到其底下的子目錄是不可能的</string>
+ <string name="move_file_invalid_overwrite">這個檔案已經存在於目的目錄中</string>
+ <string name="move_file_error">在移動檔案或目錄時發生了錯誤</string>
+ <string name="forbidden_permissions_move">移動這個檔案</string>
+ <string name="prefs_category_instant_uploading">即時上傳</string>
+ <string name="prefs_category_security">安全性</string>
</resources>
<string name="actionbar_settings">Settings</string>
<string name="actionbar_see_details">Details</string>
<string name="actionbar_send_file">Send</string>
+ <string name="actionbar_sort">Sort</string>
+ <string name="actionbar_sort_title">Sort by</string>
+ <string-array name="actionbar_sortby">
+ <item>A-Z</item>
+ <item>Newest - Oldest</item>
+ <!-- TODO re-enable when server-side folder size calculation is available
+ <item>Biggest - Smallest</item> -->
+ </string-array>
<string name="prefs_category_general">General</string>
<string name="prefs_category_more">More</string>
<string name="prefs_accounts">Accounts</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_no_support_share_api">Sorry, sharing is not enabled on your server. Please contact your
administrator.</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="auth_redirect_non_secure_connection_title">Secure connection is redirected to an unsecured route.</string>
<string name="actionbar_logger">Logs</string>
<string name="log_send_history_button">Send History</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="prefs_category_instant_uploading">Instant Uploads</string>
+ <string name="prefs_category_security">Security</string>
+
</resources>
<PreferenceCategory android:title="@string/prefs_category_accounts" android:key="accounts_category">
</PreferenceCategory>
- <PreferenceCategory android:title="@string/prefs_category_general">
- <!-- ListPreference
- android:key="select_oc_account"
- android:title="@string/prefs_select_oc_account"
- android:summary="@string/prefs_summary_select_oc_account"
- / -->
- <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:title="@string/prefs_pincode" android:key="set_pincode"
+ <PreferenceCategory android:title="@string/prefs_category_security">
+ <!-- ListPreference
+ android:key="select_oc_account"
+ android:title="@string/prefs_select_oc_account"
+ android:summary="@string/prefs_summary_select_oc_account"
+ / -->
+ <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:title="@string/prefs_pincode" android:key="set_pincode"
android:summary="@string/prefs_pincode_summary"/>
- <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:key="instant_uploading"
- android:title="@string/prefs_instant_upload"
- android:summary="@string/prefs_instant_upload_summary"/>
- <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:dependency="instant_uploading"
- android:disableDependentsState="true"
- android:title="@string/instant_upload_on_wifi"
- android:key="instant_upload_on_wifi"/>
- <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:key="instant_video_uploading"
- android:title="@string/prefs_instant_video_upload"
- android:summary="@string/prefs_instant_video_upload_summary"/>
- <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:dependency="instant_video_uploading"
- android:disableDependentsState="true"
- android:title="@string/instant_video_upload_on_wifi"
- android:key="instant_video_upload_on_wifi"/>
- <!-- DISABLED FOR RELEASE UNTIL FIXED
- CheckBoxPreference android:key="log_to_file"
- android:title="@string/prefs_log_title"
- android:summary="@string/prefs_log_summary"/>
- <Preference android:key="log_history"
- android:title="@string/prefs_log_title_history"
- android:summary="@string/prefs_log_summary_history"/ -->
+ </PreferenceCategory>
+
+ <PreferenceCategory android:title="@string/prefs_category_instant_uploading">
+ <EditTextPreference android:title="@string/prefs_instant_upload_path_title"
+ android:defaultValue="@string/instant_upload_path"
+ android:key="instant_upload_path"/>
+ <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:key="instant_uploading"
+ android:title="@string/prefs_instant_upload"
+ android:summary="@string/prefs_instant_upload_summary"/>
+ <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:dependency="instant_uploading"
+ android:disableDependentsState="true"
+ android:title="@string/instant_upload_on_wifi"
+ android:key="instant_upload_on_wifi"/>
+ <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:key="instant_video_uploading"
+ android:title="@string/prefs_instant_video_upload"
+ android:summary="@string/prefs_instant_video_upload_summary"/>
+ <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:dependency="instant_video_uploading"
+ android:disableDependentsState="true"
+ android:title="@string/instant_video_upload_on_wifi"
+ android:key="instant_video_upload_on_wifi"/>
+ <!-- DISABLED FOR RELEASE UNTIL FIXED
+ CheckBoxPreference android:key="log_to_file"
+ android:title="@string/prefs_log_title"
+ android:summary="@string/prefs_log_summary"/>
+ <Preference android:key="log_history"
+ android:title="@string/prefs_log_title_history"
+ android:summary="@string/prefs_log_summary_history"/ -->
</PreferenceCategory>
</PreferenceCategory>
-</PreferenceScreen>
\ No newline at end of file
+</PreferenceScreen>
#!/bin/bash
-
-#Repository
-ActionBarSherlockRepo="https://github.com/JakeWharton/ActionBarSherlock.git"
-
-#Directory for actionbarsherlock
-DIRECTORY="actionbarsherlock"
-
-#Commit for version 4.2 of actionbar sherlock
-COMMIT="90939dc3925ffaaa0de269bbbe1b35e274968ea1"
-
-
-function initDefault {
- git submodule init
- git submodule update
- android update lib-project -p owncloud-android-library
- android update project -p .
- android update project -p oc_jb_workaround
- android update test-project -p tests -m ..
-}
-
-function initForAnt {
- #If the directory exists the script has already been executed
- if [ ! -d "$DIRECTORY" ]; then
-
- #Gets the owncloud-android-library
- git submodule init
- git submodule update
-
- #Clones the actionbarsherlock and checks-out the right release (4.2.0)
- git clone $ActionBarSherlockRepo $DIRECTORY
- cd $DIRECTORY
- git checkout $COMMIT
- cd ../
-
- #As default it updates the ant scripts
- android update project -p "$DIRECTORY"/library -n ActionBarSherlock --target android-19
- android update lib-project -p owncloud-android-library
- android update project -p .
- android update project -p oc_jb_workaround
- cp third_party/android-support-library/android-support-v4.jar actionbarsherlock/library/libs/android-support-v4.jar
- android update test-project -p tests -m ..
- fi
-}
-
-#No args
-if [ $# -lt 1 ]; then
- echo "No args found"
- echo "Usage : $0 [gradle | maven | ant]"
- exit
-fi
-
-#checking args
-case "$1" in
-
- "ant")
- echo "Creating Ant environment"
- initForAnt
- ;;
-
- "gradle") echo "Creating gradle environment"
- initDefault
- ;;
-
- "maven") echo "Creating maven environment"
- initDefault
- ;;
-
- *) echo "Argument not recognized"
- echo "Usage : $0 [gradle | maven | ant]"
- ;;
-esac
-
-exit
+git submodule init
+git submodule update
+android update project -p actionbarsherlock/library -n ActionBarSherlock
+android update lib-project -p owncloud-android-library
+android update project -p .
+android update project -p oc_jb_workaround
+cp third_party/android-support-library/android-support-v4.jar actionbarsherlock/library/libs/android-support-v4.jar
+android update test-project -p tests -m ..
import android.app.Application;
import android.content.Context;
+import com.owncloud.android.datamodel.ThumbnailsCacheManager;
import com.owncloud.android.lib.common.OwnCloudClientManagerFactory;
import com.owncloud.android.lib.common.OwnCloudClientManagerFactory.Policy;
import com.owncloud.android.lib.common.utils.Log_OC;
OwnCloudClientManagerFactory.setDefaultPolicy(Policy.ALWAYS_NEW_CLIENT);
}
+ // initialise thumbnails cache on background thread
+ new ThumbnailsCacheManager.InitDiskCacheTask().execute();
+
if (BuildConfig.DEBUG) {
String dataFolder = getDataFolder();
import com.owncloud.android.ui.dialog.SamlWebViewDialog;\r
import com.owncloud.android.ui.dialog.SslUntrustedCertDialog;\r
import com.owncloud.android.ui.dialog.SslUntrustedCertDialog.OnSslUntrustedCertListener;\r
+import com.owncloud.android.utils.DisplayUtils;\r
\r
/**\r
* This Activity is used to add an ownCloud account to the App\r
if (mAccount != null) {\r
boolean oAuthRequired = \r
(mAccountMgr.getUserData(mAccount, Constants.KEY_SUPPORTS_OAUTH2) != null);\r
- boolean samlWebSsoRequired = \r
- (mAccountMgr.getUserData(mAccount, Constants.KEY_SUPPORTS_SAML_WEB_SSO) != null);\r
+ boolean samlWebSsoRequired = ( \r
+ mAccountMgr.getUserData(\r
+ mAccount, Constants.KEY_SUPPORTS_SAML_WEB_SSO\r
+ ) != null\r
+ );\r
mAuthTokenType = chooseAuthTokenType(oAuthRequired, samlWebSsoRequired);\r
\r
} else {\r
boolean oAuthSupported = AUTH_ON.equals(getString(R.string.auth_method_oauth2));\r
- boolean samlWebSsoSupported = AUTH_ON.equals(getString(R.string.auth_method_saml_web_sso));\r
+ boolean samlWebSsoSupported = \r
+ AUTH_ON.equals(getString(R.string.auth_method_saml_web_sso));\r
mAuthTokenType = chooseAuthTokenType(oAuthSupported, samlWebSsoSupported);\r
}\r
}\r
if (savedInstanceState == null) {\r
if (mAccount != null) {\r
mServerInfo.mBaseUrl = mAccountMgr.getUserData(mAccount, Constants.KEY_OC_BASE_URL);\r
- mServerInfo.mIsSslConn = mServerInfo.mBaseUrl.startsWith("https://"); // TODO do this in a setter for mBaseUrl\r
+ // TODO do next in a setter for mBaseUrl\r
+ mServerInfo.mIsSslConn = mServerInfo.mBaseUrl.startsWith("https://"); \r
String ocVersion = mAccountMgr.getUserData(mAccount, Constants.KEY_OC_VERSION);\r
if (ocVersion != null) {\r
mServerInfo.mVersion = new OwnCloudVersion(ocVersion);\r
\r
/// step 2 - set properties of UI elements (text, visibility, enabled...)\r
mHostUrlInput = (EditText) findViewById(R.id.hostUrlInput);\r
- mHostUrlInput.setText(mServerInfo.mBaseUrl);\r
+ // Convert IDN to Unicode\r
+ mHostUrlInput.setText(DisplayUtils.convertIdn(mServerInfo.mBaseUrl, false));\r
if (mAction != ACTION_CREATE) {\r
/// lock things that should not change\r
mHostUrlInput.setEnabled(false);\r
@Override\r
public boolean onTouch(View view, MotionEvent event) {\r
if (event.getAction() == MotionEvent.ACTION_DOWN) {\r
- if (AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).equals(mAuthTokenType) &&\r
- mHostUrlInput.hasFocus()) {\r
+ if (\r
+ AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(\r
+ MainApp.getAccountType()\r
+ ).equals(mAuthTokenType) &&\r
+ mHostUrlInput.hasFocus()\r
+ ) {\r
checkOcServer();\r
}\r
}\r
/**\r
* Saves relevant state before {@link #onPause()}\r
* \r
- * Do NOT save {@link #mNewCapturedUriFromOAuth2Redirection}; it keeps a temporal flag, intended to defer the \r
- * processing of the redirection caught in {@link #onNewIntent(Intent)} until {@link #onResume()} \r
+ * Do NOT save {@link #mNewCapturedUriFromOAuth2Redirection}; it keeps a temporal flag, \r
+ * intended to defer the processing of the redirection caught in \r
+ * {@link #onNewIntent(Intent)} until {@link #onResume()} \r
* \r
* See {@link #loadSavedInstanceState(Bundle)}\r
*/\r
\r
\r
/**\r
- * The redirection triggered by the OAuth authentication server as response to the GET AUTHORIZATION request\r
- * is caught here.\r
+ * The redirection triggered by the OAuth authentication server as response to the \r
+ * GET AUTHORIZATION request is caught here.\r
* \r
- * To make this possible, this activity needs to be qualified with android:launchMode = "singleTask" in the\r
- * AndroidManifest.xml file.\r
+ * To make this possible, this activity needs to be qualified with android:launchMode = \r
+ * "singleTask" in the AndroidManifest.xml file.\r
*/\r
@Override\r
protected void onNewIntent (Intent intent) {\r
\r
\r
/**\r
- * The redirection triggered by the OAuth authentication server as response to the GET AUTHORIZATION, and \r
- * deferred in {@link #onNewIntent(Intent)}, is processed here.\r
+ * The redirection triggered by the OAuth authentication server as response to the \r
+ * GET AUTHORIZATION, and deferred in {@link #onNewIntent(Intent)}, is processed here.\r
*/\r
@Override\r
protected void onResume() {\r
showRefreshButton(false);\r
\r
if (uri.length() != 0) {\r
+ // Handle internationalized domain names\r
+ uri = DisplayUtils.convertIdn(uri, true);\r
mServerStatusText = R.string.auth_testing_connection;\r
mServerStatusIcon = R.drawable.progress_small;\r
showServerStatus();\r
\r
Intent getServerInfoIntent = new Intent();\r
getServerInfoIntent.setAction(OperationsService.ACTION_GET_SERVER_INFO);\r
- getServerInfoIntent.putExtra(OperationsService.EXTRA_SERVER_URL, uri);\r
+ getServerInfoIntent.putExtra(\r
+ OperationsService.EXTRA_SERVER_URL, \r
+ normalizeUrlSuffix(uri)\r
+ );\r
if (mOperationsServiceBinder != null) {\r
mWaitingForOpId = mOperationsServiceBinder.newOperation(getServerInfoIntent);\r
} else {\r
}\r
\r
private boolean isPasswordVisible() {\r
- return ((mPasswordInput.getInputType() & InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD) == InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);\r
+ return ((mPasswordInput.getInputType() & InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD) == \r
+ InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);\r
}\r
\r
private void hidePasswordButton() {\r
}\r
\r
private void showPassword() {\r
- mPasswordInput.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);\r
+ mPasswordInput.setInputType(\r
+ InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD\r
+ );\r
showViewPasswordButton();\r
}\r
\r
private void hidePassword() {\r
- mPasswordInput.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);\r
+ mPasswordInput.setInputType(\r
+ InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD\r
+ );\r
showViewPasswordButton();\r
}\r
\r
return;\r
}\r
\r
- if (AccountTypeUtils.getAuthTokenTypeAccessToken(MainApp.getAccountType()).equals(mAuthTokenType)) {\r
+ if (AccountTypeUtils.getAuthTokenTypeAccessToken(MainApp.getAccountType()).\r
+ equals(mAuthTokenType)) {\r
+ \r
startOauthorization();\r
- } else if (AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).equals(mAuthTokenType)) { \r
+ } else if (AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).\r
+ equals(mAuthTokenType)) {\r
+ \r
startSamlBasedFederatedSingleSignOnAuthorization();\r
} else {\r
checkBasicAuthorization();\r
// GET AUTHORIZATION request\r
Uri uri = Uri.parse(mOAuthAuthEndpointText.getText().toString().trim());\r
Uri.Builder uriBuilder = uri.buildUpon();\r
- uriBuilder.appendQueryParameter(OAuth2Constants.KEY_RESPONSE_TYPE, getString(R.string.oauth2_response_type));\r
- uriBuilder.appendQueryParameter(OAuth2Constants.KEY_REDIRECT_URI, getString(R.string.oauth2_redirect_uri)); \r
- uriBuilder.appendQueryParameter(OAuth2Constants.KEY_CLIENT_ID, getString(R.string.oauth2_client_id));\r
- uriBuilder.appendQueryParameter(OAuth2Constants.KEY_SCOPE, getString(R.string.oauth2_scope));\r
+ uriBuilder.appendQueryParameter(\r
+ OAuth2Constants.KEY_RESPONSE_TYPE, getString(R.string.oauth2_response_type)\r
+ );\r
+ uriBuilder.appendQueryParameter(\r
+ OAuth2Constants.KEY_REDIRECT_URI, getString(R.string.oauth2_redirect_uri)\r
+ ); \r
+ uriBuilder.appendQueryParameter(\r
+ OAuth2Constants.KEY_CLIENT_ID, getString(R.string.oauth2_client_id)\r
+ );\r
+ uriBuilder.appendQueryParameter(\r
+ OAuth2Constants.KEY_SCOPE, getString(R.string.oauth2_scope)\r
+ );\r
uri = uriBuilder.build();\r
Log_OC.d(TAG, "Starting browser to view " + uri.toString());\r
Intent i = new Intent(Intent.ACTION_VIEW, uri);\r
\r
} else if (operation instanceof ExistenceCheckRemoteOperation) {\r
//Log_OC.wtf(TAG, "received detection response through callback" );\r
- if (AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).equals(mAuthTokenType)) {\r
+ if (AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).\r
+ equals(mAuthTokenType)) {\r
onSamlBasedFederatedSingleSignOnAuthorizationStart(result);\r
\r
} else {\r
url = "http://" + url;\r
}\r
}\r
- \r
- url = trimUrlWebdav(url);\r
-\r
- if (url.endsWith("/")) {\r
- url = url.substring(0, url.length() - 1);\r
- }\r
-\r
+ \r
+ url = normalizeUrlSuffix(url);\r
}\r
return (url != null ? url : "");\r
}\r
+ \r
+ \r
+ private String normalizeUrlSuffix(String url) {\r
+ if (url.endsWith("/")) {\r
+ url = url.substring(0, url.length() - 1);\r
+ }\r
+ url = trimUrlWebdav(url);\r
+ return url;\r
+ }\r
\r
\r
// TODO remove, if possible\r
@SuppressWarnings("unchecked")\r
Map<String, String> tokens = (Map<String, String>)(result.getData().get(0));\r
mAuthToken = tokens.get(OAuth2Constants.KEY_ACCESS_TOKEN);\r
- //mAuthToken = ((OAuth2GetAccessToken)operation).getResultTokenMap().get(OAuth2Constants.KEY_ACCESS_TOKEN);\r
Log_OC.d(TAG, "Got ACCESS TOKEN: " + mAuthToken);\r
\r
accessRootFolderRemoteOperation("", "");\r
showRefreshButton(true);\r
mOkButton.setEnabled(false);\r
\r
- // very special case (TODO: move to a common place for all the remote operations) (dangerous here?)\r
+ // very special case (TODO: move to a common place for all the remote operations)\r
if (result.getCode() == ResultCode.SSL_RECOVERABLE_PEER_UNVERIFIED) {\r
showUntrustedCertDialog(result);\r
}\r
\r
\r
/**\r
- * Sets the proper response to get that the Account Authenticator that started this activity saves \r
- * a new authorization token for mAccount.\r
+ * Sets the proper response to get that the Account Authenticator that started this activity \r
+ * saves a new authorization token for mAccount.\r
*/\r
private void updateToken() {\r
Bundle response = new Bundle();\r
response.putString(AccountManager.KEY_ACCOUNT_NAME, mAccount.name);\r
response.putString(AccountManager.KEY_ACCOUNT_TYPE, mAccount.type);\r
\r
- if (AccountTypeUtils.getAuthTokenTypeAccessToken(MainApp.getAccountType()).equals(mAuthTokenType)) { \r
+ if (AccountTypeUtils.getAuthTokenTypeAccessToken(MainApp.getAccountType()).\r
+ equals(mAuthTokenType)) { \r
response.putString(AccountManager.KEY_AUTHTOKEN, mAuthToken);\r
- // the next line is necessary; by now, notifications are calling directly to the AuthenticatorActivity to update, without AccountManager intervention\r
+ // the next line is necessary, notifications are calling directly to the \r
+ // AuthenticatorActivity to update, without AccountManager intervention\r
mAccountMgr.setAuthToken(mAccount, mAuthTokenType, mAuthToken);\r
\r
- } else if (AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).equals(mAuthTokenType)) {\r
+ } else if (AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).\r
+ equals(mAuthTokenType)) {\r
\r
response.putString(AccountManager.KEY_AUTHTOKEN, mAuthToken);\r
- // the next line is necessary; by now, notifications are calling directly to the AuthenticatorActivity to update, without AccountManager intervention\r
+ // the next line is necessary; by now, notifications are calling directly to the \r
+ // AuthenticatorActivity to update, without AccountManager intervention\r
mAccountMgr.setAuthToken(mAccount, mAuthTokenType, mAuthToken);\r
\r
} else {\r
*/\r
private boolean createAccount() {\r
/// create and save new ownCloud account\r
- boolean isOAuth = AccountTypeUtils.getAuthTokenTypeAccessToken(MainApp.getAccountType()).equals(mAuthTokenType);\r
- boolean isSaml = AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).equals(mAuthTokenType);\r
+ boolean isOAuth = AccountTypeUtils.\r
+ getAuthTokenTypeAccessToken(MainApp.getAccountType()).equals(mAuthTokenType);\r
+ boolean isSaml = AccountTypeUtils.\r
+ getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).equals(mAuthTokenType);\r
\r
Uri uri = Uri.parse(mServerInfo.mBaseUrl);\r
String username = mUsernameInput.getText().toString().trim();\r
mAccount = newAccount;\r
\r
if (isOAuth || isSaml) {\r
- mAccountMgr.addAccountExplicitly(mAccount, "", null); // with external authorizations, the password is never input in the app\r
+ // with external authorizations, the password is never input in the app\r
+ mAccountMgr.addAccountExplicitly(mAccount, "", null); \r
} else {\r
- mAccountMgr.addAccountExplicitly(mAccount, mPasswordInput.getText().toString(), null);\r
+ mAccountMgr.addAccountExplicitly(\r
+ mAccount, mPasswordInput.getText().toString(), null\r
+ );\r
}\r
\r
/// add the new account as default in preferences, if there is none already\r
}\r
\r
/// prepare result to return to the Authenticator\r
- // TODO check again what the Authenticator makes with it; probably has the same effect as addAccountExplicitly, but it's not well done\r
+ // TODO check again what the Authenticator makes with it; probably has the same \r
+ // effect as addAccountExplicitly, but it's not well done\r
final Intent intent = new Intent(); \r
intent.putExtra(AccountManager.KEY_ACCOUNT_TYPE, MainApp.getAccountType());\r
intent.putExtra(AccountManager.KEY_ACCOUNT_NAME, mAccount.name);\r
if (isOAuth || isSaml) {\r
mAccountMgr.setAuthToken(mAccount, mAuthTokenType, mAuthToken);\r
}\r
- /// add user data to the new account; TODO probably can be done in the last parameter addAccountExplicitly, or in KEY_USERDATA
- mAccountMgr.setUserData(mAccount, Constants.KEY_OC_VERSION, mServerInfo.mVersion.getVersion());\r
- mAccountMgr.setUserData(mAccount, Constants.KEY_OC_BASE_URL, mServerInfo.mBaseUrl);\r
+ /// add user data to the new account; TODO probably can be done in the last parameter \r
+ // addAccountExplicitly, or in KEY_USERDATA
+ mAccountMgr.setUserData(\r
+ mAccount, Constants.KEY_OC_VERSION, mServerInfo.mVersion.getVersion()\r
+ );\r
+ mAccountMgr.setUserData(\r
+ mAccount, Constants.KEY_OC_BASE_URL, mServerInfo.mBaseUrl\r
+ );\r
if (isSaml) {\r
mAccountMgr.setUserData(mAccount, Constants.KEY_SUPPORTS_SAML_WEB_SSO, "TRUE"); \r
* @param view 'Account register' button\r
*/\r
public void onRegisterClick(View view) {\r
- Intent register = new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.welcome_link_url)));\r
+ Intent register = new Intent(\r
+ Intent.ACTION_VIEW, Uri.parse(getString(R.string.welcome_link_url))\r
+ );\r
setResult(RESULT_CANCELED);\r
startActivity(register);\r
}\r
/**\r
* Called when the 'action' button in an IME is pressed ('enter' in software keyboard).\r
* \r
- * Used to trigger the authentication check when the user presses 'enter' after writing the password, \r
- * or to throw the server test when the only field on screen is the URL input field.\r
+ * Used to trigger the authentication check when the user presses 'enter' after writing the \r
+ * password, or to throw the server test when the only field on screen is the URL input field.\r
*/\r
@Override\r
public boolean onEditorAction(TextView inputField, int actionId, KeyEvent event) {\r
- if (actionId == EditorInfo.IME_ACTION_DONE && inputField != null && inputField.equals(mPasswordInput)) {\r
+ if (actionId == EditorInfo.IME_ACTION_DONE && inputField != null && \r
+ inputField.equals(mPasswordInput)) {\r
if (mOkButton.isEnabled()) {\r
mOkButton.performClick();\r
}\r
\r
- } else if (actionId == EditorInfo.IME_ACTION_NEXT && inputField != null && inputField.equals(mHostUrlInput)) {\r
- if (AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).equals(mAuthTokenType)) {\r
+ } else if (actionId == EditorInfo.IME_ACTION_NEXT && inputField != null && \r
+ inputField.equals(mHostUrlInput)) {\r
+ if (AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).\r
+ equals(mAuthTokenType)) {\r
checkOcServer();\r
}\r
}\r
final int x = (int) event.getX();\r
final int y = (int) event.getY();\r
final Rect bounds = rightDrawable.getBounds();\r
- if (x >= (view.getRight() - bounds.width() - fuzz) && x <= (view.getRight() - view.getPaddingRight() + fuzz)\r
- && y >= (view.getPaddingTop() - fuzz) && y <= (view.getHeight() - view.getPaddingBottom()) + fuzz) {\r
+ if ( x >= (view.getRight() - bounds.width() - fuzz) && \r
+ x <= (view.getRight() - view.getPaddingRight() + fuzz) && \r
+ y >= (view.getPaddingTop() - fuzz) &&\r
+ y <= (view.getHeight() - view.getPaddingBottom()) + fuzz) {\r
\r
return onDrawableTouch(event);\r
}\r
\r
@Override\r
public boolean onTouchEvent(MotionEvent event) {\r
- if (AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).equals(mAuthTokenType) &&\r
+ if (AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).\r
+ equals(mAuthTokenType) &&\r
mHostUrlInput.hasFocus() && event.getAction() == MotionEvent.ACTION_DOWN) {\r
checkOcServer();\r
}\r
/**\r
* Show untrusted cert dialog \r
*/\r
- public void showUntrustedCertDialog(X509Certificate x509Certificate, SslError error, SslErrorHandler handler) {\r
+ public void showUntrustedCertDialog(\r
+ X509Certificate x509Certificate, SslError error, SslErrorHandler handler\r
+ ) {\r
// Show a dialog with the certificate info\r
SslUntrustedCertDialog dialog = null;\r
if (x509Certificate == null) {\r
dialog = SslUntrustedCertDialog.newInstanceForEmptySslError(error, handler);\r
} else {\r
- dialog = SslUntrustedCertDialog.newInstanceForFullSslError(x509Certificate, error, handler);\r
+ dialog = SslUntrustedCertDialog.\r
+ newInstanceForFullSslError(x509Certificate, error, handler);\r
}\r
FragmentManager fm = getSupportFragmentManager();\r
FragmentTransaction ft = fm.beginTransaction();\r
*/\r
private void showUntrustedCertDialog(RemoteOperationResult result) {\r
// Show a dialog with the certificate info\r
- SslUntrustedCertDialog dialog = SslUntrustedCertDialog.newInstanceForFullSslError((CertificateCombinedException)result.getException());\r
+ SslUntrustedCertDialog dialog = SslUntrustedCertDialog.\r
+ newInstanceForFullSslError((CertificateCombinedException)result.getException());\r
FragmentManager fm = getSupportFragmentManager();\r
FragmentTransaction ft = fm.beginTransaction();\r
ft.addToBackStack(null);\r
public void onSavedCertificate() {\r
Fragment fd = getSupportFragmentManager().findFragmentByTag(SAML_DIALOG_TAG);\r
if (fd == null) {\r
- // if SAML dialog is not shown, the SslDialog was shown due to an SSL error in the server check\r
+ // if SAML dialog is not shown, \r
+ // the SslDialog was shown due to an SSL error in the server check\r
checkOcServer();\r
}\r
}\r
\r
@Override\r
public void onServiceConnected(ComponentName component, IBinder service) {\r
- if (component.equals(new ComponentName(AuthenticatorActivity.this, OperationsService.class))) {\r
+ if (component.equals(\r
+ new ComponentName(AuthenticatorActivity.this, OperationsService.class)\r
+ )) {\r
//Log_OC.wtf(TAG, "Operations service connected");\r
mOperationsServiceBinder = (OperationsServiceBinder) service;\r
\r
\r
@Override\r
public void onServiceDisconnected(ComponentName component) {\r
- if (component.equals(new ComponentName(AuthenticatorActivity.this, OperationsService.class))) {\r
+ if (component.equals(\r
+ new ComponentName(AuthenticatorActivity.this, OperationsService.class)\r
+ )) {\r
Log_OC.e(TAG, "Operations service crashed");\r
mOperationsServiceBinder = null;\r
}\r
public void createAuthenticationDialog(WebView webView, HttpAuthHandler handler) {\r
\r
// Show a dialog with the certificate info\r
- CredentialsDialogFragment dialog = CredentialsDialogFragment.newInstanceForCredentials(webView, handler);\r
+ CredentialsDialogFragment dialog = \r
+ CredentialsDialogFragment.newInstanceForCredentials(webView, handler);\r
FragmentManager fm = getSupportFragmentManager();\r
FragmentTransaction ft = fm.beginTransaction();\r
ft.addToBackStack(null);\r
dialog.show(ft, CREDENTIALS_DIALOG_TAG);\r
\r
if (!mIsFirstAuthAttempt) {\r
- Toast.makeText(getApplicationContext(), getText(R.string.saml_authentication_wrong_pass), Toast.LENGTH_LONG).show();\r
+ Toast.makeText(\r
+ getApplicationContext(), \r
+ getText(R.string.saml_authentication_wrong_pass), \r
+ Toast.LENGTH_LONG\r
+ ).show();\r
} else {\r
mIsFirstAuthAttempt = false;\r
}\r
public Vector<OCFile> getFolderImages(OCFile folder) {
Vector<OCFile> ret = new Vector<OCFile>();
if (folder != null) {
- // TODO better implementation, filtering in the access to database (if possible) instead of here
+ // TODO better implementation, filtering in the access to database instead of here
Vector<OCFile> tmp = getFolderContent(folder);
OCFile current = null;
for (int i=0; i<tmp.size(); i++) {
boolean overriden = false;
ContentValues cv = new ContentValues();
cv.put(ProviderTableMeta.FILE_MODIFIED, file.getModificationTimestamp());
- cv.put(ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA, file.getModificationTimestampAtLastSyncForData());
+ cv.put(
+ ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA,
+ file.getModificationTimestampAtLastSyncForData()
+ );
cv.put(ProviderTableMeta.FILE_CREATION, file.getCreationTimestamp());
cv.put(ProviderTableMeta.FILE_CONTENT_LENGTH, file.getFileLength());
cv.put(ProviderTableMeta.FILE_CONTENT_TYPE, file.getMimetype());
boolean sameRemotePath = fileExists(file.getRemotePath());
if (sameRemotePath ||
- fileExists(file.getFileId()) ) { // for renamed files; no more delete and create
+ fileExists(file.getFileId()) ) { // for renamed files
OCFile oldFile = null;
if (sameRemotePath) {
* @param files
* @param removeNotUpdated
*/
- public void saveFolder(OCFile folder, Collection<OCFile> updatedFiles, Collection<OCFile> filesToRemove) {
+ public void saveFolder(
+ OCFile folder, Collection<OCFile> updatedFiles, Collection<OCFile> filesToRemove
+ ) {
- Log_OC.d(TAG, "Saving folder " + folder.getRemotePath() + " with " + updatedFiles.size() + " children and " + filesToRemove.size() + " files to remove");
+ Log_OC.d(TAG, "Saving folder " + folder.getRemotePath() + " with " + updatedFiles.size()
+ + " children and " + filesToRemove.size() + " files to remove");
- ArrayList<ContentProviderOperation> operations = new ArrayList<ContentProviderOperation>(updatedFiles.size());
+ ArrayList<ContentProviderOperation> operations =
+ new ArrayList<ContentProviderOperation>(updatedFiles.size());
// prepare operations to insert or update files to save in the given folder
for (OCFile file : updatedFiles) {
ContentValues cv = new ContentValues();
cv.put(ProviderTableMeta.FILE_MODIFIED, file.getModificationTimestamp());
- cv.put(ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA, file.getModificationTimestampAtLastSyncForData());
+ cv.put(
+ ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA,
+ file.getModificationTimestampAtLastSyncForData()
+ );
cv.put(ProviderTableMeta.FILE_CREATION, file.getCreationTimestamp());
cv.put(ProviderTableMeta.FILE_CONTENT_LENGTH, file.getFileLength());
cv.put(ProviderTableMeta.FILE_CONTENT_TYPE, file.getMimetype());
} else {
// adding a new file
- operations.add(ContentProviderOperation.newInsert(ProviderTableMeta.CONTENT_URI).withValues(cv).build());
+ operations.add(ContentProviderOperation.newInsert(ProviderTableMeta.CONTENT_URI).
+ withValues(cv).build());
}
}
// prepare operations to remove files in the given folder
- String where = ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?" + " AND " + ProviderTableMeta.FILE_PATH + "=?";
+ String where = ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?" + " AND " +
+ ProviderTableMeta.FILE_PATH + "=?";
String [] whereArgs = null;
for (OCFile file : filesToRemove) {
if (file.getParentId() == folder.getFileId()) {
whereArgs = new String[]{mAccount.name, file.getRemotePath()};
//Uri.withAppendedPath(ProviderTableMeta.CONTENT_URI_FILE, "" + file.getFileId());
if (file.isFolder()) {
- operations.add(ContentProviderOperation
- .newDelete(ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_DIR, file.getFileId())).withSelection(where, whereArgs)
- .build());
- // TODO remove local folder
+ operations.add(ContentProviderOperation.newDelete(
+ ContentUris.withAppendedId(
+ ProviderTableMeta.CONTENT_URI_DIR, file.getFileId()
+ )
+ ).withSelection(where, whereArgs).build());
+
+ File localFolder =
+ new File(FileStorageUtils.getDefaultSavePathFor(mAccount.name, file));
+ if (localFolder.exists()) {
+ removeLocalFolder(localFolder);
+ }
} else {
- operations.add(ContentProviderOperation
- .newDelete(ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_FILE, file.getFileId())).withSelection(where, whereArgs)
- .build());
+ operations.add(ContentProviderOperation.newDelete(
+ ContentUris.withAppendedId(
+ ProviderTableMeta.CONTENT_URI_FILE, file.getFileId()
+ )
+ ).withSelection(where, whereArgs).build());
+
if (file.isDown()) {
new File(file.getStoragePath()).delete();
- // TODO move the deletion of local contents after success of deletions
}
}
}
// update metadata of folder
ContentValues cv = new ContentValues();
cv.put(ProviderTableMeta.FILE_MODIFIED, folder.getModificationTimestamp());
- cv.put(ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA, folder.getModificationTimestampAtLastSyncForData());
+ cv.put(
+ ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA,
+ folder.getModificationTimestampAtLastSyncForData()
+ );
cv.put(ProviderTableMeta.FILE_CREATION, folder.getCreationTimestamp());
- cv.put(ProviderTableMeta.FILE_CONTENT_LENGTH, 0); // FileContentProvider calculates the right size
+ cv.put(ProviderTableMeta.FILE_CONTENT_LENGTH, 0);
cv.put(ProviderTableMeta.FILE_CONTENT_TYPE, folder.getMimetype());
cv.put(ProviderTableMeta.FILE_NAME, folder.getFileName());
cv.put(ProviderTableMeta.FILE_PARENT, folder.getParentId());
// Log_OC.d(TAG, "Updating size of " + id);
// if (getContentResolver() != null) {
// getContentResolver().update(ProviderTableMeta.CONTENT_URI_DIR,
-// new ContentValues(), // won't be used, but cannot be null; crashes in KLP
+// new ContentValues(),
+ // won't be used, but cannot be null; crashes in KLP
// ProviderTableMeta._ID + "=?",
// new String[] { String.valueOf(id) });
// } else {
// try {
// getContentProviderClient().update(ProviderTableMeta.CONTENT_URI_DIR,
-// new ContentValues(), // won't be used, but cannot be null; crashes in KLP
+// new ContentValues(),
+ // won't be used, but cannot be null; crashes in KLP
// ProviderTableMeta._ID + "=?",
// new String[] { String.valueOf(id) });
//
// } catch (RemoteException e) {
-// Log_OC.e(TAG, "Exception in update of folder size through compatibility patch " + e.getMessage());
+// Log_OC.e(
+// TAG, "Exception in update of folder size through compatibility patch " + e.getMessage());
// }
// }
// } else {
} else {
if (removeDBData) {
- //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 + "=?";
+ 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) {
}
private boolean removeFolderInDb(OCFile folder) {
- 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 + "=?";
+ 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 + "=?";
String [] whereArgs = new String[]{mAccount.name, folder.getRemotePath()};
int deleted = 0;
if (getContentProviderClient() != null) {
public void moveFolder(OCFile folder, String newPath) {
// TODO check newPath
- if (folder != null && folder.isFolder() && folder.fileExists() && !OCFile.ROOT_PATH.equals(folder.getFileName())) {
+ if ( folder != null && folder.isFolder() &&
+ folder.fileExists() && !OCFile.ROOT_PATH.equals(folder.getFileName())
+ ) {
/// 1. get all the descendants of 'dir' in a single QUERY (including 'dir')
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, folder.getRemotePath() + "%" }, ProviderTableMeta.FILE_PATH + " ASC ");
+ c = getContentProviderClient().query (
+ ProviderTableMeta.CONTENT_URI,
+ null,
+ ProviderTableMeta.FILE_ACCOUNT_OWNER + "=? AND " +
+ ProviderTableMeta.FILE_PATH + " LIKE ? ",
+ new String[] { mAccount.name, folder.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, folder.getRemotePath() + "%" }, ProviderTableMeta.FILE_PATH + " ASC ");
+ c = getContentResolver().query (
+ ProviderTableMeta.CONTENT_URI,
+ null,
+ ProviderTableMeta.FILE_ACCOUNT_OWNER + "=? AND " +
+ ProviderTableMeta.FILE_PATH + " LIKE ? ",
+ new String[] { mAccount.name, folder.getRemotePath() + "%" },
+ ProviderTableMeta.FILE_PATH + " ASC "
+ );
}
/// 2. prepare a batch of update operations to change all the descendants
- ArrayList<ContentProviderOperation> operations = new ArrayList<ContentProviderOperation>(c.getCount());
+ ArrayList<ContentProviderOperation> operations =
+ new ArrayList<ContentProviderOperation>(c.getCount());
int lengthOfOldPath = folder.getRemotePath().length();
String defaultSavePath = FileStorageUtils.getSavePath(mAccount.name);
int lengthOfOldStoragePath = defaultSavePath.length() + lengthOfOldPath;
if (c.moveToFirst()) {
do {
- ContentValues cv = new ContentValues(); // don't take the constructor out of the loop and clear the object
+ ContentValues cv = new ContentValues(); // keep the constructor in the loop
OCFile child = createFileInstance(c);
- cv.put(ProviderTableMeta.FILE_PATH, newPath + child.getRemotePath().substring(lengthOfOldPath));
- if (child.getStoragePath() != null && child.getStoragePath().startsWith(defaultSavePath)) {
- cv.put(ProviderTableMeta.FILE_STORAGE_PATH, defaultSavePath + newPath + child.getStoragePath().substring(lengthOfOldStoragePath));
+ cv.put(
+ ProviderTableMeta.FILE_PATH,
+ newPath + child.getRemotePath().substring(lengthOfOldPath)
+ );
+ if ( child.getStoragePath() != null &&
+ child.getStoragePath().startsWith(defaultSavePath) ) {
+ cv.put(
+ ProviderTableMeta.FILE_STORAGE_PATH,
+ defaultSavePath + newPath +
+ child.getStoragePath().substring(lengthOfOldStoragePath)
+ );
}
- operations.add(ContentProviderOperation.newUpdate(ProviderTableMeta.CONTENT_URI).
+ operations.add(
+ ContentProviderOperation.
+ newUpdate(ProviderTableMeta.CONTENT_URI).
withValues(cv).
- withSelection( ProviderTableMeta._ID + "=?",
- new String[] { String.valueOf(child.getFileId()) })
- .build());
+ withSelection(
+ ProviderTableMeta._ID + "=?",
+ new String[] { String.valueOf(child.getFileId()) }
+ ).
+ build()
+ );
} while (c.moveToNext());
}
c.close();
}
} catch (OperationApplicationException e) {
- Log_OC.e(TAG, "Fail to update descendants of " + folder.getFileId() + " in database", e);
+ Log_OC.e(TAG, "Fail to update descendants of " +
+ folder.getFileId() + " in database", e);
} catch (RemoteException e) {
- Log_OC.e(TAG, "Fail to update desendants of " + folder.getFileId() + " in database", e);
+ Log_OC.e(TAG, "Fail to update desendants of " +
+ folder.getFileId() + " in database", e);
}
}
file.setStoragePath(c.getString(c
.getColumnIndex(ProviderTableMeta.FILE_STORAGE_PATH)));
if (file.getStoragePath() == null) {
- // try to find existing file and bind it with current account; - with the current update of SynchronizeFolderOperation, this won't be necessary anymore after a full synchronization of the account
+ // try to find existing file and bind it with current account;
+ // with the current update of SynchronizeFolderOperation, this won't be
+ // necessary anymore after a full synchronization of the account
File f = new File(FileStorageUtils.getDefaultSavePathFor(mAccount.name, file));
if (f.exists()) {
file.setStoragePath(f.getAbsolutePath());
cv.put(ProviderTableMeta.OCSHARES_SHARED_DATE, share.getSharedDate());
cv.put(ProviderTableMeta.OCSHARES_EXPIRATION_DATE, share.getExpirationDate());
cv.put(ProviderTableMeta.OCSHARES_TOKEN, share.getToken());
- cv.put(ProviderTableMeta.OCSHARES_SHARE_WITH_DISPLAY_NAME, share.getSharedWithDisplayName());
+ cv.put(
+ ProviderTableMeta.OCSHARES_SHARE_WITH_DISPLAY_NAME,
+ share.getSharedWithDisplayName()
+ );
cv.put(ProviderTableMeta.OCSHARES_IS_DIRECTORY, share.isFolder() ? 1 : 0);
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; no more delete and create
+ if (shareExists(share.getIdRemoteShared())) { // for renamed files
overriden = true;
if (getContentResolver() != null) {
share.setIsFolder(c.getInt(
c.getColumnIndex(ProviderTableMeta.OCSHARES_IS_DIRECTORY)) == 1 ? true : false);
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;
} 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());
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 " + ProviderTableMeta.FILE_PARENT + "=?";
+ String where = ProviderTableMeta.FILE_ACCOUNT_OWNER + "=? AND " +
+ ProviderTableMeta.FILE_PARENT + "=?";
String [] whereArgs = new String[] { mAccount.name , String.valueOf(folder.getFileId()) };
if (getContentResolver() != null) {
} 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());
} 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) {
- ArrayList<ContentProviderOperation> operations = new ArrayList<ContentProviderOperation>(shares.size());
+ ArrayList<ContentProviderOperation> operations =
+ new ArrayList<ContentProviderOperation>(shares.size());
// prepare operations to insert or update files to save in the given folder
for (OCShare share : shares) {
cv.put(ProviderTableMeta.OCSHARES_SHARED_DATE, share.getSharedDate());
cv.put(ProviderTableMeta.OCSHARES_EXPIRATION_DATE, share.getExpirationDate());
cv.put(ProviderTableMeta.OCSHARES_TOKEN, share.getToken());
- cv.put(ProviderTableMeta.OCSHARES_SHARE_WITH_DISPLAY_NAME, share.getSharedWithDisplayName());
+ cv.put(
+ ProviderTableMeta.OCSHARES_SHARE_WITH_DISPLAY_NAME,
+ share.getSharedWithDisplayName()
+ );
cv.put(ProviderTableMeta.OCSHARES_IS_DIRECTORY, share.isFolder() ? 1 : 0);
cv.put(ProviderTableMeta.OCSHARES_USER_ID, share.getUserId());
cv.put(ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED, share.getIdRemoteShared());
if (shareExists(share.getIdRemoteShared())) {
// updating an existing file
- operations.add(ContentProviderOperation.newUpdate(ProviderTableMeta.CONTENT_URI_SHARE).
+ 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(ContentProviderOperation.newInsert(ProviderTableMeta.CONTENT_URI_SHARE).withValues(cv).build());
+ operations.add(
+ ContentProviderOperation.newInsert(ProviderTableMeta.CONTENT_URI_SHARE).
+ withValues(cv).
+ build()
+ );
}
}
if (operations.size() > 0) {
@SuppressWarnings("unused")
ContentProviderResult[] results = null;
- Log_OC.d(TAG, "Sending " + operations.size() + " operations to FileContentProvider");
+ Log_OC.d(TAG, "Sending " + operations.size() +
+ " operations to FileContentProvider");
try {
if (getContentResolver() != null) {
- results = getContentResolver().applyBatch(MainApp.getAuthority(), operations);
+ results = getContentResolver().applyBatch(
+ MainApp.getAuthority(), operations
+ );
} else {
results = getContentProviderClient().applyBatch(operations);
cleanSharedFiles();
if (sharedFiles != null) {
- ArrayList<ContentProviderOperation> operations = new ArrayList<ContentProviderOperation>(sharedFiles.size());
+ ArrayList<ContentProviderOperation> operations =
+ new ArrayList<ContentProviderOperation>(sharedFiles.size());
// prepare operations to insert or update files to save in the given folder
for (OCFile file : sharedFiles) {
ContentValues cv = new ContentValues();
cv.put(ProviderTableMeta.FILE_MODIFIED, file.getModificationTimestamp());
- cv.put(ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA, file.getModificationTimestampAtLastSyncForData());
+ cv.put(
+ ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA,
+ file.getModificationTimestampAtLastSyncForData()
+ );
cv.put(ProviderTableMeta.FILE_CREATION, file.getCreationTimestamp());
cv.put(ProviderTableMeta.FILE_CONTENT_LENGTH, file.getFileLength());
cv.put(ProviderTableMeta.FILE_CONTENT_TYPE, file.getMimetype());
}
cv.put(ProviderTableMeta.FILE_ACCOUNT_OWNER, mAccount.name);
cv.put(ProviderTableMeta.FILE_LAST_SYNC_DATE, file.getLastSyncDateForProperties());
- cv.put(ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA, file.getLastSyncDateForData());
+ cv.put(
+ ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA,
+ file.getLastSyncDateForData()
+ );
cv.put(ProviderTableMeta.FILE_KEEP_IN_SYNC, file.keepInSync() ? 1 : 0);
cv.put(ProviderTableMeta.FILE_ETAG, file.getEtag());
cv.put(ProviderTableMeta.FILE_SHARE_BY_LINK, file.isShareByLink() ? 1 : 0);
cv.put(ProviderTableMeta.FILE_PUBLIC_LINK, file.getPublicLink());
cv.put(ProviderTableMeta.FILE_PERMISSIONS, file.getPermissions());
cv.put(ProviderTableMeta.FILE_REMOTE_ID, file.getRemoteId());
- cv.put(ProviderTableMeta.FILE_UPDATE_THUMBNAIL, file.needsUpdateThumbnail() ? 1 : 0);
+ cv.put(
+ ProviderTableMeta.FILE_UPDATE_THUMBNAIL,
+ file.needsUpdateThumbnail() ? 1 : 0
+ );
boolean existsByPath = fileExists(file.getRemotePath());
if (existsByPath || fileExists(file.getFileId())) {
// updating an existing file
- operations.add(ContentProviderOperation.newUpdate(ProviderTableMeta.CONTENT_URI).
+ 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
- operations.add(ContentProviderOperation.newInsert(ProviderTableMeta.CONTENT_URI).withValues(cv).build());
+ operations.add(
+ ContentProviderOperation.newInsert(ProviderTableMeta.CONTENT_URI).
+ withValues(cv).
+ build()
+ );
}
}
if (operations.size() > 0) {
@SuppressWarnings("unused")
ContentProviderResult[] results = null;
- Log_OC.d(TAG, "Sending " + operations.size() + " operations to FileContentProvider");
+ Log_OC.d(TAG, "Sending " + operations.size() +
+ " operations to FileContentProvider");
try {
if (getContentResolver() != null) {
- results = getContentResolver().applyBatch(MainApp.getAuthority(), operations);
+ results = getContentResolver().applyBatch(
+ MainApp.getAuthority(), operations
+ );
} else {
results = getContentProviderClient().applyBatch(operations);
public void removeShare(OCShare share){
Uri share_uri = ProviderTableMeta.CONTENT_URI_SHARE;
- String where = ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?" + " AND " + ProviderTableMeta.FILE_PATH + "=?";
+ String where = ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?" + " AND " +
+ ProviderTableMeta.FILE_PATH + "=?";
String [] whereArgs = new String[]{mAccount.name, share.getPath()};
if (getContentProviderClient() != null) {
try {
cv.put(ProviderTableMeta.OCSHARES_SHARED_DATE, share.getSharedDate());
cv.put(ProviderTableMeta.OCSHARES_EXPIRATION_DATE, share.getExpirationDate());
cv.put(ProviderTableMeta.OCSHARES_TOKEN, share.getToken());
- cv.put(ProviderTableMeta.OCSHARES_SHARE_WITH_DISPLAY_NAME, share.getSharedWithDisplayName());
+ cv.put(
+ ProviderTableMeta.OCSHARES_SHARE_WITH_DISPLAY_NAME,
+ share.getSharedWithDisplayName()
+ );
cv.put(ProviderTableMeta.OCSHARES_IS_DIRECTORY, share.isFolder() ? 1 : 0);
cv.put(ProviderTableMeta.OCSHARES_USER_ID, share.getUserId());
cv.put(ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED, share.getIdRemoteShared());
/*
if (shareExists(share.getIdRemoteShared())) {
// updating an existing share resource
- operations.add(ContentProviderOperation.newUpdate(ProviderTableMeta.CONTENT_URI_SHARE).
+ operations.add(
+ ContentProviderOperation.newUpdate(ProviderTableMeta.CONTENT_URI_SHARE).
withValues(cv).
withSelection( ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED + "=?",
new String[] { String.valueOf(share.getIdRemoteShared()) })
} else {
*/
// adding a new share resource
- operations.add(ContentProviderOperation.newInsert(ProviderTableMeta.CONTENT_URI_SHARE).withValues(cv).build());
+ operations.add(
+ ContentProviderOperation.newInsert(ProviderTableMeta.CONTENT_URI_SHARE).
+ withValues(cv).
+ build()
+ );
//}
}
}
}
- private ArrayList<ContentProviderOperation> prepareRemoveSharesInFolder(OCFile folder, ArrayList<ContentProviderOperation> preparedOperations) {
+ private ArrayList<ContentProviderOperation> prepareRemoveSharesInFolder(
+ OCFile folder, ArrayList<ContentProviderOperation> preparedOperations
+ ) {
if (folder != null) {
- String where = ProviderTableMeta.OCSHARES_PATH + "=?" + " AND " + ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?";
+ String where = ProviderTableMeta.OCSHARES_PATH + "=?" + " AND "
+ + ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?";
String [] whereArgs = new String[]{ "", mAccount.name };
Vector<OCFile> files = getFolderContent(folder);
for (OCFile file : files) {
whereArgs[0] = file.getRemotePath();
- preparedOperations.add(ContentProviderOperation.newDelete(ProviderTableMeta.CONTENT_URI_SHARE)
- .withSelection(where, whereArgs)
- .build());
+ preparedOperations.add(
+ ContentProviderOperation.newDelete(ProviderTableMeta.CONTENT_URI_SHARE).
+ withSelection(where, whereArgs).
+ build()
+ );
}
}
return preparedOperations;
import java.io.File;
import com.owncloud.android.lib.common.utils.Log_OC;
-
+import third_parties.daveKoeller.AlphanumComparator;
import android.os.Parcel;
import android.os.Parcelable;
} else if (another.isFolder()) {
return 1;
}
- return getRemotePath().toLowerCase().compareTo(another.getRemotePath().toLowerCase());
+ return new AlphanumComparator().compare(this, another);
}
@Override
--- /dev/null
+/* 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.datamodel;
+
+import java.io.File;
+import java.lang.ref.WeakReference;
+
+import android.content.res.Resources;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.graphics.Bitmap.CompressFormat;
+import android.graphics.drawable.BitmapDrawable;
+import android.graphics.drawable.Drawable;
+import android.media.ThumbnailUtils;
+import android.os.AsyncTask;
+import android.util.TypedValue;
+import android.widget.ImageView;
+
+import com.owncloud.android.MainApp;
+import com.owncloud.android.lib.common.utils.Log_OC;
+import com.owncloud.android.ui.adapter.DiskLruImageCache;
+import com.owncloud.android.utils.BitmapUtils;
+import com.owncloud.android.utils.DisplayUtils;
+
+/**
+ * Manager for concurrent access to thumbnails cache.
+ *
+ * @author Tobias Kaminsky
+ * @author David A. Velasco
+ */
+public class ThumbnailsCacheManager {
+
+ private static final String TAG = ThumbnailsCacheManager.class.getSimpleName();
+
+ private static final String CACHE_FOLDER = "thumbnailCache";
+
+ private static final Object mThumbnailsDiskCacheLock = new Object();
+ private static DiskLruImageCache mThumbnailCache = null;
+ private static boolean mThumbnailCacheStarting = true;
+
+ private static final int DISK_CACHE_SIZE = 1024 * 1024 * 10; // 10MB
+ private static final CompressFormat mCompressFormat = CompressFormat.JPEG;
+ private static final int mCompressQuality = 70;
+
+ public static Bitmap mDefaultImg =
+ BitmapFactory.decodeResource(
+ MainApp.getAppContext().getResources(),
+ DisplayUtils.getResourceId("image/png", "default.png")
+ );
+
+
+ public static class InitDiskCacheTask extends AsyncTask<File, Void, Void> {
+ @Override
+ protected Void doInBackground(File... params) {
+ synchronized (mThumbnailsDiskCacheLock) {
+ mThumbnailCacheStarting = true;
+ if (mThumbnailCache == null) {
+ try {
+ // Check if media is mounted or storage is built-in, if so,
+ // try and use external cache dir; otherwise use internal cache dir
+ final String cachePath =
+ MainApp.getAppContext().getExternalCacheDir().getPath() +
+ File.separator + CACHE_FOLDER;
+ Log_OC.d(TAG, "create dir: " + cachePath);
+ final File diskCacheDir = new File(cachePath);
+ mThumbnailCache = new DiskLruImageCache(
+ diskCacheDir,
+ DISK_CACHE_SIZE,
+ mCompressFormat,
+ mCompressQuality
+ );
+ } catch (Exception e) {
+ Log_OC.d(TAG, "Thumbnail cache could not be opened ", e);
+ mThumbnailCache = null;
+ }
+ }
+ mThumbnailCacheStarting = false; // Finished initialization
+ mThumbnailsDiskCacheLock.notifyAll(); // Wake any waiting threads
+ }
+ return null;
+ }
+ }
+
+
+ public static void addBitmapToCache(String key, Bitmap bitmap) {
+ synchronized (mThumbnailsDiskCacheLock) {
+ if (mThumbnailCache != null) {
+ mThumbnailCache.put(key, bitmap);
+ }
+ }
+ }
+
+
+ public static Bitmap getBitmapFromDiskCache(String key) {
+ synchronized (mThumbnailsDiskCacheLock) {
+ // Wait while disk cache is started from background thread
+ while (mThumbnailCacheStarting) {
+ try {
+ mThumbnailsDiskCacheLock.wait();
+ } catch (InterruptedException e) {}
+ }
+ if (mThumbnailCache != null) {
+ return (Bitmap) mThumbnailCache.getBitmap(key);
+ }
+ }
+ return null;
+ }
+
+
+ public static boolean cancelPotentialWork(OCFile file, ImageView imageView) {
+ final ThumbnailGenerationTask bitmapWorkerTask = getBitmapWorkerTask(imageView);
+
+ if (bitmapWorkerTask != null) {
+ final OCFile bitmapData = bitmapWorkerTask.mFile;
+ // If bitmapData is not yet set or it differs from the new data
+ if (bitmapData == null || bitmapData != file) {
+ // Cancel previous task
+ bitmapWorkerTask.cancel(true);
+ } else {
+ // The same work is already in progress
+ return false;
+ }
+ }
+ // No task associated with the ImageView, or an existing task was cancelled
+ return true;
+ }
+
+ public static ThumbnailGenerationTask getBitmapWorkerTask(ImageView imageView) {
+ if (imageView != null) {
+ final Drawable drawable = imageView.getDrawable();
+ if (drawable instanceof AsyncDrawable) {
+ final AsyncDrawable asyncDrawable = (AsyncDrawable) drawable;
+ return asyncDrawable.getBitmapWorkerTask();
+ }
+ }
+ return null;
+ }
+
+ public static class ThumbnailGenerationTask extends AsyncTask<OCFile, Void, Bitmap> {
+ private final WeakReference<ImageView> mImageViewReference;
+ private OCFile mFile;
+ private FileDataStorageManager mStorageManager;
+
+ public ThumbnailGenerationTask(ImageView imageView, FileDataStorageManager storageManager) {
+ // Use a WeakReference to ensure the ImageView can be garbage collected
+ mImageViewReference = new WeakReference<ImageView>(imageView);
+ if (storageManager == null)
+ throw new IllegalArgumentException("storageManager must not be NULL");
+ mStorageManager = storageManager;
+ }
+
+ // Decode image in background.
+ @Override
+ protected Bitmap doInBackground(OCFile... params) {
+ Bitmap thumbnail = null;
+
+ try {
+ mFile = params[0];
+ final String imageKey = String.valueOf(mFile.getRemoteId());
+
+ // Check disk cache in background thread
+ thumbnail = getBitmapFromDiskCache(imageKey);
+
+ // Not found in disk cache
+ if (thumbnail == null || mFile.needsUpdateThumbnail()) {
+ // Converts dp to pixel
+ Resources r = MainApp.getAppContext().getResources();
+ int px = (int) Math.round(TypedValue.applyDimension(
+ TypedValue.COMPLEX_UNIT_DIP, 150, r.getDisplayMetrics()
+ ));
+
+ if (mFile.isDown()){
+ Bitmap bitmap = BitmapUtils.decodeSampledBitmapFromFile(
+ mFile.getStoragePath(), px, px);
+
+ if (bitmap != null) {
+ thumbnail = ThumbnailUtils.extractThumbnail(bitmap, px, px);
+
+ // Add thumbnail to cache
+ addBitmapToCache(imageKey, thumbnail);
+
+ mFile.setNeedsUpdateThumbnail(false);
+ mStorageManager.saveFile(mFile);
+ }
+
+ }
+ }
+
+ } catch (Throwable t) {
+ // the app should never break due to a problem with thumbnails
+ Log_OC.e(TAG, "Generation of thumbnail for " + mFile + " failed", t);
+ if (t instanceof OutOfMemoryError) {
+ System.gc();
+ }
+ }
+
+ return thumbnail;
+ }
+
+ protected void onPostExecute(Bitmap bitmap){
+ if (isCancelled()) {
+ bitmap = null;
+ }
+
+ if (mImageViewReference != null && bitmap != null) {
+ final ImageView imageView = mImageViewReference.get();
+ final ThumbnailGenerationTask bitmapWorkerTask =
+ getBitmapWorkerTask(imageView);
+ if (this == bitmapWorkerTask && imageView != null) {
+ if (imageView.getTag().equals(mFile.getFileId())) {
+ imageView.setImageBitmap(bitmap);
+ }
+ }
+ }
+ }
+ }
+
+
+ public static class AsyncDrawable extends BitmapDrawable {
+ private final WeakReference<ThumbnailGenerationTask> bitmapWorkerTaskReference;
+
+ public AsyncDrawable(
+ Resources res, Bitmap bitmap, ThumbnailGenerationTask bitmapWorkerTask
+ ) {
+
+ super(res, bitmap);
+ bitmapWorkerTaskReference =
+ new WeakReference<ThumbnailGenerationTask>(bitmapWorkerTask);
+ }
+
+ public ThumbnailGenerationTask getBitmapWorkerTask() {
+ return bitmapWorkerTaskReference.get();
+ }
+ }
+
+
+ /**
+ * Remove from cache the remoteId passed
+ * @param fileRemoteId: remote id of mFile passed
+ */
+ public static void removeFileFromCache(String fileRemoteId){
+ synchronized (mThumbnailsDiskCacheLock) {
+ if (mThumbnailCache != null) {
+ mThumbnailCache.removeKey(fileRemoteId);
+ }
+ mThumbnailsDiskCacheLock.notifyAll(); // Wake any waiting threads
+ }
+ }
+
+}
file.setMimetype(mCurrentDownload.getMimeType());
file.setStoragePath(mCurrentDownload.getSavePath());
file.setFileLength((new File(mCurrentDownload.getSavePath()).length()));
+ file.setRemoteId(mCurrentDownload.getFile().getRemoteId());
mStorageManager.saveFile(file);
}
// coincidence; nothing else is needed, the storagePath is right
// in the instance returned by mCurrentUpload.getFile()
}
-
+ file.setNeedsUpdateThumbnail(true);
mStorageManager.saveFile(file);
}
file.setModificationTimestamp(remoteFile.getModifiedTimestamp());
file.setModificationTimestampAtLastSyncForData(remoteFile.getModifiedTimestamp());
// file.setEtag(remoteFile.getEtag()); // TODO Etag, where available
+ file.setRemoteId(remoteFile.getRemoteId());
}
private OCFile obtainNewOCFileToUpload(String remotePath, String localPath, String mimeType,
}
}
-
/**
* Save new directory in local database
*/
public void saveFolderInDB() {
- OCFile newDir = new OCFile(mRemotePath);
- newDir.setMimetype("DIR");
- long parentId = getStorageManager().getFileByPath(FileStorageUtils.getParentPath(mRemotePath)).getFileId();
- newDir.setParentId(parentId);
- newDir.setModificationTimestamp(System.currentTimeMillis());
- getStorageManager().saveFile(newDir);
+ if (mCreateFullPath && getStorageManager().
+ getFileByPath(FileStorageUtils.getParentPath(mRemotePath)) == null){// When parent
+ // of remote path
+ // is not created
+ String[] subFolders = mRemotePath.split("/");
+ String composedRemotePath = "/";
- Log_OC.d(TAG, "Create directory " + mRemotePath + " in Database");
+ // For each antecesor folders create them recursively
+ for (int i=0; i<subFolders.length; i++) {
+ String subFolder = subFolders[i];
+ if (!subFolder.isEmpty()) {
+ composedRemotePath = composedRemotePath + subFolder + "/";
+ mRemotePath = composedRemotePath;
+ saveFolderInDB();
+ }
+ }
+ } else { // Create directory on DB
+ OCFile newDir = new OCFile(mRemotePath);
+ newDir.setMimetype("DIR");
+ long parentId = getStorageManager().
+ getFileByPath(FileStorageUtils.getParentPath(mRemotePath)).getFileId();
+ newDir.setParentId(parentId);
+ newDir.setModificationTimestamp(System.currentTimeMillis());
+ getStorageManager().saveFile(newDir);
+ Log_OC.d(TAG, "Create directory " + mRemotePath + " in Database");
+ }
}
-
-
}
result = new RemoteOperationResult(ResultCode.OK);
} else if (serverChanged) {
+ mLocalFile.setRemoteId(mServerFile.getRemoteId());
+
if (mSyncFileContents) {
requestForDownload(mLocalFile); // local, not server; we won't to keep the value of keepInSync!
// the update of local data will be done later by the FileUploader service when the upload finishes
private static final String TAG = SynchronizeFolderOperation.class.getSimpleName();
- public static final String EVENT_SINGLE_FOLDER_CONTENTS_SYNCED = SynchronizeFolderOperation.class.getName() + ".EVENT_SINGLE_FOLDER_CONTENTS_SYNCED";
- public static final String EVENT_SINGLE_FOLDER_SHARES_SYNCED = SynchronizeFolderOperation.class.getName() + ".EVENT_SINGLE_FOLDER_SHARES_SYNCED";
+ public static final String EVENT_SINGLE_FOLDER_CONTENTS_SYNCED =
+ SynchronizeFolderOperation.class.getName() + ".EVENT_SINGLE_FOLDER_CONTENTS_SYNCED";
+ public static final String EVENT_SINGLE_FOLDER_SHARES_SYNCED =
+ SynchronizeFolderOperation.class.getName() + ".EVENT_SINGLE_FOLDER_SHARES_SYNCED";
/** Time stamp for the synchronization process in progress */
private long mCurrentSyncTime;
/** Counter of failed operations in synchronization of kept-in-sync files */
private int mFailsInFavouritesFound;
- /** Map of remote and local paths to files that where locally stored in a location out of the ownCloud folder and couldn't be copied automatically into it */
+ /**
+ * Map of remote and local paths to files that where locally stored in a location
+ * out of the ownCloud folder and couldn't be copied automatically into it
+ **/
private Map<String, String> mForgottenLocalFiles;
/** 'True' means that this operation is part of a full account synchronization */
private boolean mSyncFullAccount;
- /** 'True' means that Share resources bound to the files into the folder should be refreshed also */
+ /** 'True' means that Share resources bound to the files into should be refreshed also */
private boolean mIsShareSupported;
- /** 'True' means that the remote folder changed from last synchronization and should be fetched */
+ /** 'True' means that the remote folder changed and should be fetched */
private boolean mRemoteFolderChanged;
/** 'True' means that Etag will be ignored */
/**
* Creates a new instance of {@link SynchronizeFolderOperation}.
*
- * @param remoteFolderPath Remote folder to synchronize.
+ * @param folder Folder to synchronize.
* @param currentSyncTime Time stamp for the synchronization process in progress.
- * @param localFolderId Identifier in the local database of the folder to synchronize.
- * @param updateFolderProperties 'True' means that the properties of the folder should be updated also, not just its content.
- * @param syncFullAccount 'True' means that this operation is part of a full account synchronization.
+ * @param syncFullAccount 'True' means that this operation is part of a full account
+ * synchronization.
+ * @param isShareSupported 'True' means that the server supports the sharing API.
+ * @param ignoreEtag 'True' means that the content of the remote folder should
+ * be fetched and updated even though the 'eTag' did not
+ * change.
* @param dataStorageManager Interface with the local database.
* @param account ownCloud account where the folder is located.
* @param context Application context.
}
/**
- * Returns the list of files and folders contained in the synchronized folder, if called after synchronization is complete.
+ * Returns the list of files and folders contained in the synchronized folder,
+ * if called after synchronization is complete.
*
* @return List of files and folders contained in the synchronized folder.
*/
}
if (!mSyncFullAccount) {
- sendLocalBroadcast(EVENT_SINGLE_FOLDER_CONTENTS_SYNCED, mLocalFolder.getRemotePath(), result);
+ sendLocalBroadcast(
+ EVENT_SINGLE_FOLDER_CONTENTS_SYNCED, mLocalFolder.getRemotePath(), result
+ );
}
if (result.isSuccess() && mIsShareSupported && !mSyncFullAccount) {
}
if (!mSyncFullAccount) {
- sendLocalBroadcast(EVENT_SINGLE_FOLDER_SHARES_SYNCED, mLocalFolder.getRemotePath(), result);
+ sendLocalBroadcast(
+ EVENT_SINGLE_FOLDER_SHARES_SYNCED, mLocalFolder.getRemotePath(), result
+ );
}
return result;
if (!mIgnoreETag) {
// check if remote and local folder are different
- mRemoteFolderChanged = !(remoteFolder.getEtag().equalsIgnoreCase(mLocalFolder.getEtag()));
+ mRemoteFolderChanged =
+ !(remoteFolder.getEtag().equalsIgnoreCase(mLocalFolder.getEtag()));
}
result = new RemoteOperationResult(ResultCode.OK);
- Log_OC.i(TAG, "Checked " + mAccount.name + remotePath + " : " + (mRemoteFolderChanged ? "changed" : "not changed"));
+ Log_OC.i(TAG, "Checked " + mAccount.name + remotePath + " : " +
+ (mRemoteFolderChanged ? "changed" : "not changed"));
} else {
// check failed
removeLocalFolder();
}
if (result.isException()) {
- Log_OC.e(TAG, "Checked " + mAccount.name + remotePath + " : " + result.getLogMessage(), result.getException());
+ Log_OC.e(TAG, "Checked " + mAccount.name + remotePath + " : " +
+ result.getLogMessage(), result.getException());
} else {
- Log_OC.e(TAG, "Checked " + mAccount.name + remotePath + " : " + result.getLogMessage());
+ Log_OC.e(TAG, "Checked " + mAccount.name + remotePath + " : " +
+ result.getLogMessage());
}
}
if (result.isSuccess()) {
synchronizeData(result.getData(), client);
if (mConflictsFound > 0 || mFailsInFavouritesFound > 0) {
- result = new RemoteOperationResult(ResultCode.SYNC_CONFLICT); // should be different result, but will do the job
+ result = new RemoteOperationResult(ResultCode.SYNC_CONFLICT);
+ // should be a different result code, but will do the job
}
} else {
if (result.getCode() == ResultCode.FILE_NOT_FOUND)
private void removeLocalFolder() {
if (mStorageManager.fileExists(mLocalFolder.getFileId())) {
String currentSavePath = FileStorageUtils.getSavePath(mAccount.name);
- mStorageManager.removeFolder(mLocalFolder, true, (mLocalFolder.isDown() && mLocalFolder.getStoragePath().startsWith(currentSavePath)));
+ mStorageManager.removeFolder(
+ mLocalFolder,
+ true,
+ ( mLocalFolder.isDown() &&
+ mLocalFolder.getStoragePath().startsWith(currentSavePath)
+ )
+ );
}
}
*
* @param client Client instance to the remote server where the data were
* retrieved.
- * @return 'True' when any change was made in the local data, 'false' otherwise.
+ * @return 'True' when any change was made in the local data, 'false' otherwise
*/
private void synchronizeData(ArrayList<Object> folderAndFiles, OwnCloudClient client) {
// get 'fresh data' from the database
remoteFolder.setParentId(mLocalFolder.getParentId());
remoteFolder.setFileId(mLocalFolder.getFileId());
- Log_OC.d(TAG, "Remote folder " + mLocalFolder.getRemotePath() + " changed - starting update of local data ");
+ Log_OC.d(TAG, "Remote folder " + mLocalFolder.getRemotePath()
+ + " changed - starting update of local data ");
List<OCFile> updatedFiles = new Vector<OCFile>(folderAndFiles.size() - 1);
List<SynchronizeFileOperation> filesToSyncContents = new Vector<SynchronizeFileOperation>();
remoteFile.setParentId(mLocalFolder.getFileId());
/// retrieve local data for the read file
- //localFile = mStorageManager.getFileByPath(remoteFile.getRemotePath());
+ // localFile = mStorageManager.getFileByPath(remoteFile.getRemotePath());
localFile = localFilesMap.remove(remoteFile.getRemotePath());
- /// add to the remoteFile (the new one) data about LOCAL STATE (not existing in the server side)
+ /// add to the remoteFile (the new one) data about LOCAL STATE (not existing in server)
remoteFile.setLastSyncDateForProperties(mCurrentSyncTime);
if (localFile != null) {
// some properties of local state are kept unmodified
remoteFile.setFileId(localFile.getFileId());
remoteFile.setKeepInSync(localFile.keepInSync());
remoteFile.setLastSyncDateForData(localFile.getLastSyncDateForData());
- remoteFile.setModificationTimestampAtLastSyncForData(localFile.getModificationTimestampAtLastSyncForData());
+ remoteFile.setModificationTimestampAtLastSyncForData(
+ localFile.getModificationTimestampAtLastSyncForData()
+ );
remoteFile.setStoragePath(localFile.getStoragePath());
- remoteFile.setEtag(localFile.getEtag()); // eTag will not be updated unless contents are synchronized (Synchronize[File|Folder]Operation with remoteFile as parameter)
+ // eTag will not be updated unless contents are synchronized
+ // (Synchronize[File|Folder]Operation with remoteFile as parameter)
+ remoteFile.setEtag(localFile.getEtag());
if (remoteFile.isFolder()) {
- remoteFile.setFileLength(localFile.getFileLength()); // TODO move operations about size of folders to FileContentProvider
+ remoteFile.setFileLength(localFile.getFileLength());
+ // TODO move operations about size of folders to FileContentProvider
}
remoteFile.setPublicLink(localFile.getPublicLink());
remoteFile.setShareByLink(localFile.isShareByLink());
} else {
- remoteFile.setEtag(""); // remote eTag will not be updated unless contents are synchronized (Synchronize[File|Folder]Operation with remoteFile as parameter)
+ // remote eTag will not be updated unless contents are synchronized
+ // (Synchronize[File|Folder]Operation with remoteFile as parameter)
+ remoteFile.setEtag("");
}
/// check and fix, if needed, local storage path
- checkAndFixForeignStoragePath(remoteFile); // fixing old policy - now local files must be copied into the ownCloud local folder
+ checkAndFixForeignStoragePath(remoteFile); // policy - local files are COPIED
+ // into the ownCloud local folder;
searchForLocalFileInDefaultPath(remoteFile); // legacy
/// prepare content synchronization for kept-in-sync files
updatedFiles.add(remoteFile);
}
- // save updated contents in local database; all at once, trying to get a best performance in database update (not a big deal, indeed)
+ // save updated contents in local database
mStorageManager.saveFolder(remoteFolder, updatedFiles, localFilesMap.values());
// request for the synchronization of file contents AFTER saving current remote properties
}
/**
- * Performs a list of synchronization operations, determining if a download or upload is needed or
- * if exists conflict due to changes both in local and remote contents of the each file.
+ * Performs a list of synchronization operations, determining if a download or upload is needed
+ * or if exists conflict due to changes both in local and remote contents of the each file.
*
- * If download or upload is needed, request the operation to the corresponding service and goes on.
+ * If download or upload is needed, request the operation to the corresponding service and goes
+ * on.
*
* @param filesToSyncContents Synchronization operations to execute.
* @param client Interface to the remote ownCloud server.
*/
- private void startContentSynchronizations(List<SynchronizeFileOperation> filesToSyncContents, OwnCloudClient client) {
+ private void startContentSynchronizations(
+ List<SynchronizeFileOperation> filesToSyncContents, OwnCloudClient client
+ ) {
RemoteOperationResult contentsResult = null;
for (SynchronizeFileOperation op: filesToSyncContents) {
- contentsResult = op.execute(mStorageManager, mContext); // returns without waiting for upload or download finishes
+ contentsResult = op.execute(mStorageManager, mContext); // async
if (!contentsResult.isSuccess()) {
if (contentsResult.getCode() == ResultCode.SYNC_CONFLICT) {
mConflictsFound++;
} else {
mFailsInFavouritesFound++;
if (contentsResult.getException() != null) {
- Log_OC.e(TAG, "Error while synchronizing favourites : " + contentsResult.getLogMessage(), contentsResult.getException());
+ Log_OC.e(TAG, "Error while synchronizing favourites : "
+ + contentsResult.getLogMessage(), contentsResult.getException());
} else {
- Log_OC.e(TAG, "Error while synchronizing favourites : " + contentsResult.getLogMessage());
+ Log_OC.e(TAG, "Error while synchronizing favourites : "
+ + contentsResult.getLogMessage());
}
}
} // won't let these fails break the synchronization process
/**
- * Checks the storage path of the OCFile received as parameter. If it's out of the local ownCloud folder,
- * tries to copy the file inside it.
+ * Checks the storage path of the OCFile received as parameter.
+ * If it's out of the local ownCloud folder, tries to copy the file inside it.
*
- * If the copy fails, the link to the local file is nullified. The account of forgotten files is kept in
- * {@link #mForgottenLocalFiles}
+ * If the copy fails, the link to the local file is nullified. The account of forgotten
+ * files is kept in {@link #mForgottenLocalFiles}
*)
* @param file File to check and fix.
*/
File expectedParent = expectedFile.getParentFile();
expectedParent.mkdirs();
if (!expectedParent.isDirectory()) {
- throw new IOException("Unexpected error: parent directory could not be created");
+ throw new IOException(
+ "Unexpected error: parent directory could not be created"
+ );
}
expectedFile.createNewFile();
if (!expectedFile.isFile()) {
try {
if (in != null) in.close();
} catch (Exception e) {
- Log_OC.d(TAG, "Weird exception while closing input stream for " + storagePath + " (ignoring)", e);
+ Log_OC.d(TAG, "Weird exception while closing input stream for "
+ + storagePath + " (ignoring)", e);
}
try {
if (out != null) out.close();
} catch (Exception e) {
- Log_OC.d(TAG, "Weird exception while closing output stream for " + expectedPath + " (ignoring)", e);
+ Log_OC.d(TAG, "Weird exception while closing output stream for "
+ + expectedPath + " (ignoring)", e);
}
}
}
RemoteOperationResult result = null;
// remote request
- GetRemoteSharesForFileOperation operation = new GetRemoteSharesForFileOperation(mLocalFolder.getRemotePath(), false, true);
+ GetRemoteSharesForFileOperation operation =
+ new GetRemoteSharesForFileOperation(mLocalFolder.getRemotePath(), false, true);
result = operation.execute(client);
if (result.isSuccess()) {
/**
- * Sends a message to any application component interested in the progress of the synchronization.
+ * Sends a message to any application component interested in the progress
+ * of the synchronization.
*
* @param event
- * @param dirRemotePath Remote path of a folder that was just synchronized (with or without success)
+ * @param dirRemotePath Remote path of a folder that was just synchronized
+ * (with or without success)
* @param result
*/
- private void sendLocalBroadcast(String event, String dirRemotePath, RemoteOperationResult result) {
+ private void sendLocalBroadcast(
+ String event, String dirRemotePath, RemoteOperationResult result
+ ) {
Log_OC.d(TAG, "Send broadcast " + event);
Intent intent = new Intent(event);
intent.putExtra(FileSyncAdapter.EXTRA_ACCOUNT_NAME, mAccount.name);
import java.util.HashMap;
import com.owncloud.android.R;
+import com.owncloud.android.datamodel.ThumbnailsCacheManager;
import com.owncloud.android.db.ProviderMeta;
import com.owncloud.android.db.ProviderMeta.ProviderTableMeta;
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.shares.ShareType;
-
-
import android.content.ContentProvider;
import android.content.ContentProviderOperation;
import android.content.ContentProviderResult;
int count = 0;
switch (mUriMatcher.match(uri)) {
case SINGLE_FILE:
- /*Cursor c = query(db, uri, null, where, whereArgs, null);
- String remotePath = "(unexisting)";
+ Cursor c = query(db, uri, null, where, whereArgs, null);
+ String remoteId = "";
if (c != null && c.moveToFirst()) {
- remotePath = c.getString(c.getColumnIndex(ProviderTableMeta.FILE_PATH));
+ remoteId = c.getString(c.getColumnIndex(ProviderTableMeta.FILE_REMOTE_ID));
+ //ThumbnailsCacheManager.removeFileFromCache(remoteId);
}
- Log_OC.d(TAG, "Removing FILE " + remotePath);
- */
+ Log_OC.d(TAG, "Removing FILE " + remoteId);
+
count = db.delete(ProviderTableMeta.FILE_TABLE_NAME,
ProviderTableMeta._ID
+ "="
Cursor children = query(uri, null, null, null, null);
if (children != null && children.moveToFirst()) {
long childId;
- boolean isDir;
+ boolean isDir;
//String remotePath;
while (!children.isAfterLast()) {
childId = children.getLong(children.getColumnIndex(ProviderTableMeta._ID));
- isDir = "DIR".equals(children.getString(children.getColumnIndex(ProviderTableMeta.FILE_CONTENT_TYPE)));
+ isDir = "DIR".equals(children.getString(
+ children.getColumnIndex(ProviderTableMeta.FILE_CONTENT_TYPE)
+ ));
//remotePath = children.getString(children.getColumnIndex(ProviderTableMeta.FILE_PATH));
if (isDir) {
- count += delete(db, ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_DIR, childId), null, null);
+ count += delete(
+ db,
+ ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_DIR, childId),
+ null,
+ null
+ );
} else {
- count += delete(db, ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_FILE, childId), null, null);
+ count += delete(
+ db,
+ ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_FILE, childId),
+ null,
+ null
+ );
}
children.moveToNext();
}
}
return count;
}
-
@Override
public String getType(Uri uri) {
@Override
public Uri insert(Uri uri, ContentValues values) {
- //Log_OC.d(TAG, "Inserting " + values.getAsString(ProviderTableMeta.FILE_PATH) + " at provider " + this);
Uri newUri = null;
SQLiteDatabase db = mDbHelper.getWritableDatabase();
db.beginTransaction();
case SINGLE_FILE:
String remotePath = values.getAsString(ProviderTableMeta.FILE_PATH);
String accountName = values.getAsString(ProviderTableMeta.FILE_ACCOUNT_OWNER);
- String[] projection = new String[] {ProviderTableMeta._ID, ProviderTableMeta.FILE_PATH, ProviderTableMeta.FILE_ACCOUNT_OWNER };
- String where = ProviderTableMeta.FILE_PATH + "=? AND " + ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?";
+ String[] projection = new String[] {
+ ProviderTableMeta._ID, ProviderTableMeta.FILE_PATH,
+ ProviderTableMeta.FILE_ACCOUNT_OWNER
+ };
+ String where = ProviderTableMeta.FILE_PATH + "=? AND " +
+ ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?";
String[] whereArgs = new String[] {remotePath, accountName};
Cursor doubleCheck = query(db, uri, projection, where, whereArgs, null);
- if (doubleCheck == null || !doubleCheck.moveToFirst()) { // ugly patch; serious refactorization is needed to reduce work in FileDataStorageManager and bring it to FileContentProvider
+ // ugly patch; serious refactorization is needed to reduce work in
+ // FileDataStorageManager and bring it to FileContentProvider
+ if (doubleCheck == null || !doubleCheck.moveToFirst()) {
long rowId = db.insert(ProviderTableMeta.FILE_TABLE_NAME, null, values);
if (rowId > 0) {
- Uri insertedFileUri = ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_FILE, rowId);
- //Log_OC.d(TAG, "Inserted " + values.getAsString(ProviderTableMeta.FILE_PATH) + " at provider " + this);
+ Uri insertedFileUri =
+ ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_FILE, rowId);
return insertedFileUri;
} else {
- //Log_OC.d(TAG, "Error while inserting " + values.getAsString(ProviderTableMeta.FILE_PATH) + " at provider " + this);
throw new SQLException("ERROR " + uri);
}
} else {
// file is already inserted; race condition, let's avoid a duplicated entry
- Uri insertedFileUri = ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_FILE, doubleCheck.getLong(doubleCheck.getColumnIndex(ProviderTableMeta._ID)));
+ Uri insertedFileUri = ContentUris.withAppendedId(
+ ProviderTableMeta.CONTENT_URI_FILE,
+ doubleCheck.getLong(doubleCheck.getColumnIndex(ProviderTableMeta._ID))
+ );
doubleCheck.close();
return insertedFileUri;
case SHARES:
String path = values.getAsString(ProviderTableMeta.OCSHARES_PATH);
String accountNameShare= values.getAsString(ProviderTableMeta.OCSHARES_ACCOUNT_OWNER);
- String[] projectionShare = new String[] {ProviderTableMeta._ID, ProviderTableMeta.OCSHARES_PATH, ProviderTableMeta.OCSHARES_ACCOUNT_OWNER };
- String whereShare = ProviderTableMeta.OCSHARES_PATH + "=? AND " + ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?";
+ String[] projectionShare = new String[] {
+ ProviderTableMeta._ID, ProviderTableMeta.OCSHARES_PATH,
+ ProviderTableMeta.OCSHARES_ACCOUNT_OWNER
+ };
+ String whereShare = ProviderTableMeta.OCSHARES_PATH + "=? AND " +
+ ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?";
String[] whereArgsShare = new String[] {path, accountNameShare};
Uri insertedShareUri = null;
- Cursor doubleCheckShare = query(db, uri, projectionShare, whereShare, whereArgsShare, null);
- if (doubleCheckShare == null || !doubleCheckShare.moveToFirst()) { // ugly patch; serious refactorization is needed to reduce work in FileDataStorageManager and bring it to FileContentProvider
+ Cursor doubleCheckShare =
+ query(db, uri, projectionShare, whereShare, whereArgsShare, null);
+ // ugly patch; serious refactorization is needed to reduce work in
+ // FileDataStorageManager and bring it to FileContentProvider
+ if (doubleCheckShare == null || !doubleCheckShare.moveToFirst()) {
long rowId = db.insert(ProviderTableMeta.OCSHARES_TABLE_NAME, null, values);
if (rowId >0) {
- insertedShareUri = ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_SHARE, rowId);
+ insertedShareUri =
+ ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_SHARE, rowId);
} else {
throw new SQLException("ERROR " + uri);
}
} else {
// file is already inserted; race condition, let's avoid a duplicated entry
- insertedShareUri = ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_SHARE, doubleCheckShare.getLong(doubleCheckShare.getColumnIndex(ProviderTableMeta._ID)));
+ insertedShareUri = ContentUris.withAppendedId(
+ ProviderTableMeta.CONTENT_URI_SHARE,
+ doubleCheckShare.getLong(
+ doubleCheckShare.getColumnIndex(ProviderTableMeta._ID)
+ )
+ );
doubleCheckShare.close();
}
updateFilesTableAccordingToShareInsertion(db, uri, values);
}
- private void updateFilesTableAccordingToShareInsertion(SQLiteDatabase db, Uri uri, ContentValues shareValues) {
+ private void updateFilesTableAccordingToShareInsertion(
+ SQLiteDatabase db, Uri uri, ContentValues shareValues
+ ) {
ContentValues fileValues = new ContentValues();
- fileValues.put(ProviderTableMeta.FILE_SHARE_BY_LINK,
- ShareType.PUBLIC_LINK.getValue() == shareValues.getAsInteger(ProviderTableMeta.OCSHARES_SHARE_TYPE)? 1 : 0);
- String whereShare = ProviderTableMeta.FILE_PATH + "=? AND " + ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?";
+ fileValues.put(
+ ProviderTableMeta.FILE_SHARE_BY_LINK,
+ ShareType.PUBLIC_LINK.getValue() ==
+ shareValues.getAsInteger(ProviderTableMeta.OCSHARES_SHARE_TYPE)? 1 : 0
+ );
+ String whereShare = ProviderTableMeta.FILE_PATH + "=? AND " +
+ ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?";
String[] whereArgsShare = new String[] {
shareValues.getAsString(ProviderTableMeta.OCSHARES_PATH),
shareValues.getAsString(ProviderTableMeta.OCSHARES_ACCOUNT_OWNER)
@Override
- public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
+ public Cursor query(
+ Uri uri,
+ String[] projection,
+ String selection,
+ String[] selectionArgs,
+ String sortOrder
+ ) {
+
Cursor result = null;
SQLiteDatabase db = mDbHelper.getReadableDatabase();
db.beginTransaction();
return result;
}
- private Cursor query(SQLiteDatabase db, Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
+ private Cursor query(
+ SQLiteDatabase db,
+ Uri uri,
+ String[] projection,
+ String selection,
+ String[] selectionArgs,
+ String sortOrder
+ ) {
+
SQLiteQueryBuilder sqlQuery = new SQLiteQueryBuilder();
sqlQuery.setTables(ProviderTableMeta.FILE_TABLE_NAME);
@Override
public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
- //Log_OC.d(TAG, "Updating " + values.getAsString(ProviderTableMeta.FILE_PATH) + " at provider " + this);
int count = 0;
SQLiteDatabase db = mDbHelper.getWritableDatabase();
db.beginTransaction();
- private int update(SQLiteDatabase db, Uri uri, ContentValues values, String selection, String[] selectionArgs) {
+ private int update(
+ SQLiteDatabase db,
+ Uri uri,
+ ContentValues values,
+ String selection,
+ String[] selectionArgs
+ ) {
switch (mUriMatcher.match(uri)) {
case DIRECTORY:
return 0; //updateFolderSize(db, selectionArgs[0]);
case SHARES:
- return db.update(ProviderTableMeta.OCSHARES_TABLE_NAME, values, selection, selectionArgs);
+ return db.update(
+ ProviderTableMeta.OCSHARES_TABLE_NAME, values, selection, selectionArgs
+ );
default:
- return db.update(ProviderTableMeta.FILE_TABLE_NAME, values, selection, selectionArgs);
+ return db.update(
+ ProviderTableMeta.FILE_TABLE_NAME, values, selection, selectionArgs
+ );
}
}
*/
@Override
- public ContentProviderResult[] applyBatch (ArrayList<ContentProviderOperation> operations) throws OperationApplicationException {
- Log_OC.d("FileContentProvider", "applying batch in provider " + this + " (temporary: " + isTemporary() + ")" );
+ public ContentProviderResult[] applyBatch (ArrayList<ContentProviderOperation> operations)
+ throws OperationApplicationException {
+ Log_OC.d("FileContentProvider", "applying batch in provider " + this +
+ " (temporary: " + isTemporary() + ")" );
ContentProviderResult[] results = new ContentProviderResult[operations.size()];
int i=0;
db.beginTransaction();
try {
db.execSQL("ALTER TABLE " + ProviderTableMeta.FILE_TABLE_NAME +
- " ADD COLUMN " + ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA + " INTEGER " +
- " DEFAULT 0");
+ " ADD COLUMN " + ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA +
+ " INTEGER " + " DEFAULT 0");
// assume there are not local changes pending to upload
db.execSQL("UPDATE " + ProviderTableMeta.FILE_TABLE_NAME +
- " SET " + ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA + " = " + System.currentTimeMillis() +
+ " SET " + ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA + " = "
+ + System.currentTimeMillis() +
" WHERE " + ProviderTableMeta.FILE_STORAGE_PATH + " IS NOT NULL");
upgraded = true;
db.beginTransaction();
try {
db .execSQL("ALTER TABLE " + ProviderTableMeta.FILE_TABLE_NAME +
- " ADD COLUMN " + ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA + " INTEGER " +
- " DEFAULT 0");
+ " ADD COLUMN " + ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA +
+ " INTEGER " + " DEFAULT 0");
db.execSQL("UPDATE " + ProviderTableMeta.FILE_TABLE_NAME +
- " SET " + ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA + " = " + ProviderTableMeta.FILE_MODIFIED +
+ " SET " + ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA + " = " +
+ ProviderTableMeta.FILE_MODIFIED +
" WHERE " + ProviderTableMeta.FILE_STORAGE_PATH + " IS NOT NULL");
upgraded = true;
}
}
if (!upgraded)
- Log_OC.i("SQL", "OUT of the ADD in onUpgrade; oldVersion == " + oldVersion + ", newVersion == " + newVersion);
+ Log_OC.i("SQL", "OUT of the ADD in onUpgrade; oldVersion == " + oldVersion +
+ ", newVersion == " + newVersion);
if (oldVersion < 5 && newVersion >= 5) {
Log_OC.i("SQL", "Entering in the #4 ADD in onUpgrade");
}
}
if (!upgraded)
- Log_OC.i("SQL", "OUT of the ADD in onUpgrade; oldVersion == " + oldVersion + ", newVersion == " + newVersion);
+ Log_OC.i("SQL", "OUT of the ADD in onUpgrade; oldVersion == " + oldVersion +
+ ", newVersion == " + newVersion);
if (oldVersion < 6 && newVersion >= 6) {
Log_OC.i("SQL", "Entering in the #5 ADD in onUpgrade");
}
}
if (!upgraded)
- Log_OC.i("SQL", "OUT of the ADD in onUpgrade; oldVersion == " + oldVersion + ", newVersion == " + newVersion);
+ Log_OC.i("SQL", "OUT of the ADD in onUpgrade; oldVersion == " + oldVersion +
+ ", newVersion == " + newVersion);
if (oldVersion < 7 && newVersion >= 7) {
Log_OC.i("SQL", "Entering in the #7 ADD in onUpgrade");
}
}
if (!upgraded)
- Log_OC.i("SQL", "OUT of the ADD in onUpgrade; oldVersion == " + oldVersion + ", newVersion == " + newVersion);
+ Log_OC.i("SQL", "OUT of the ADD in onUpgrade; oldVersion == " + oldVersion +
+ ", newVersion == " + newVersion);
if (oldVersion < 8 && newVersion >= 8) {
Log_OC.i("SQL", "Entering in the #8 ADD in onUpgrade");
}
}
if (!upgraded)
- Log_OC.i("SQL", "OUT of the ADD in onUpgrade; oldVersion == " + oldVersion + ", newVersion == " + newVersion);
+ Log_OC.i("SQL", "OUT of the ADD in onUpgrade; oldVersion == " + oldVersion +
+ ", newVersion == " + newVersion);
}
}
mCurrentSyncTime,
true,
mIsShareSupported,
- true,
+ false,
getStorageManager(),
getAccount(),
getContext()
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
-import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import com.owncloud.android.operations.UnshareLinkOperation;
import com.owncloud.android.services.observer.FileObserverService;
import com.owncloud.android.syncadapter.FileSyncAdapter;
+import com.owncloud.android.ui.adapter.FileListListAdapter;
import com.owncloud.android.ui.dialog.CreateFolderDialogFragment;
import com.owncloud.android.ui.dialog.SslUntrustedCertDialog;
import com.owncloud.android.ui.dialog.SslUntrustedCertDialog.OnSslUntrustedCertListener;
private String DIALOG_UNTRUSTED_CERT;
private OCFile mWaitingToSend;
-
+
@Override
protected void onCreate(Bundle savedInstanceState) {
Log_OC.d(TAG, "onCreate() start");
}
break;
}
+ case R.id.action_sort: {
+ SharedPreferences appPreferences = PreferenceManager
+ .getDefaultSharedPreferences(this);
+
+ // Read sorting order, default to sort by name ascending
+ Integer sortOrder = appPreferences
+ .getInt("sortOrder", FileListListAdapter.SORT_NAME);
+
+ AlertDialog.Builder builder = new AlertDialog.Builder(this);
+ builder.setTitle(R.string.actionbar_sort_title)
+ .setSingleChoiceItems(R.array.actionbar_sortby, sortOrder , new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+
+ switch (which){
+ case 0:
+ sortByName(true);
+ break;
+ case 1:
+ sortByDate(false);
+ break;
+
+// TODO re-enable when server-side folder size calculation is available
+// case 2:
+// sortBySize(false);
+// break;
+ }
+
+ dialog.dismiss();
+
+ }
+ });
+ builder.create().show();
+ break;
+ }
default:
retval = super.onOptionsItemSelected(item);
}
}
}
}
+
+ private void sortByDate(boolean ascending){
+ getListOfFilesFragment().sortByDate(ascending);
+ }
+
+ private void sortBySize(boolean ascending){
+ getListOfFilesFragment().sortBySize(ascending);
+ }
+
+ private void sortByName(boolean ascending){
+ getListOfFilesFragment().sortByName(ascending);
+ }
}
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
-import android.support.v4.widget.SwipeRefreshLayout;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import com.owncloud.android.lib.common.utils.Log_OC;
public class MoveActivity extends HookActivity implements FileFragment.ContainerActivity,
- OnClickListener, SwipeRefreshLayout.OnRefreshListener {
+ OnClickListener, OnEnforceableRefreshListener {
public static final String EXTRA_CURRENT_FOLDER = UploadFilesActivity.class.getCanonicalName() + ".EXTRA_CURRENT_FOLDER";
public static final String EXTRA_TARGET_FILE = UploadFilesActivity.class.getCanonicalName() + "EXTRA_TARGET_FILE";
}
-
@Override
public void onRefresh() {
+ refreshList(true);
+ }
+
+ @Override
+ public void onRefresh(boolean enforced) {
+ refreshList(enforced);
+ }
+
+ private void refreshList(boolean ignoreETag) {
OCFileListFragment listOfFiles = getListOfFilesFragment();
if (listOfFiles != null) {
OCFile folder = listOfFiles.getCurrentFile();
if (folder != null) {
- startSyncFolderOperation(folder, true);
+ startSyncFolderOperation(folder, ignoreETag);
}
}
}
-
}
private final Handler mHandler = new Handler();
private String mAccountName;
private boolean mShowContextMenu = false;
+ private String mUploadPath;
@SuppressWarnings("deprecation")
actionBar.setIcon(DisplayUtils.getSeasonalIconId());
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitle(R.string.actionbar_settings);
-
+
+ loadInstantUploadPath();
+
// Load the accounts category for adding the list of accounts
mAccountsPrefCategory = (PreferenceCategory) findPreference("accounts_category");
if (obj != null && obj instanceof LongClickableCheckBoxPreference) {
mShowContextMenu = true;
- mAccountName = obj.toString();
+ mAccountName = ((LongClickableCheckBoxPreference) obj).getKey();
Preferences.this.openContextMenu(listView);
preferenceCategory.removePreference(pImprint);
}
}
+
+ Preference pInstantUploadPathApp = (Preference) findPreference("instant_upload_path");
+
+ pInstantUploadPathApp.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
+ @Override
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ mUploadPath = updateInstantUploadPath(newValue.toString());
+ return true;
+ }
+ });
/* About App */
pAboutApp = (Preference) findPreference("about_app");
}
@Override
+ protected void onPause() {
+ saveInstantUploadPathOnPreferences();
+ super.onPause();
+ }
+
+ @Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
// Filter for only showing contextual menu when long press on the
for (Account a : accounts) {
LongClickableCheckBoxPreference accountPreference = new LongClickableCheckBoxPreference(this);
accountPreference.setKey(a.name);
- accountPreference.setTitle(a.name);
+ // Handle internationalized domain names
+ accountPreference.setTitle(DisplayUtils.convertIdn(a.name, false));
mAccountsPrefCategory.addPreference(accountPreference);
// Check the current account that is being used
}
+ /**
+ * Update the upload path checking that it is a correct path
+ * @param uploadPath: path write by user
+ * @return String: uploadPath
+ */
+ private String updateInstantUploadPath(String uploadPath) {
+ String slashString = "/";
+
+ // If slashes are duplicated, replace them for only one slash
+ uploadPath = uploadPath.replaceAll("/+", slashString);
+
+ // Remove last slash from path
+ if (uploadPath.length() > 0 && uploadPath.charAt(uploadPath.length()-1) == slashString.charAt(0)) {
+ uploadPath = uploadPath.substring(0, uploadPath.length()-1);
+ }
+
+ if (uploadPath.isEmpty()) { // Set default instant upload path
+ uploadPath = getString(R.string.instant_upload_path);
+ }else {
+ if (!uploadPath.startsWith(slashString)) { // Add initial slash on path if necessary
+ uploadPath = slashString.concat(uploadPath);
+ }
+ }
+ return uploadPath;
+ }
+
+ /**
+ * Load upload path set on preferences
+ */
+ private void loadInstantUploadPath() {
+ SharedPreferences appPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
+ mUploadPath = appPrefs.getString("instant_upload_path", getString(R.string.instant_upload_path));
+ }
+
+ /**
+ * Save the "Instant Upload Path" on preferences
+ */
+ private void saveInstantUploadPathOnPreferences() {
+ SharedPreferences appPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
+ SharedPreferences.Editor editor = appPrefs.edit();
+ editor.putString("instant_upload_path", mUploadPath);
+ editor.commit();
+ }
}
+/* 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.ui.adapter;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
import android.graphics.BitmapFactory;
-import android.util.Log;
import com.jakewharton.disklrucache.DiskLruCache;
import com.owncloud.android.BuildConfig;
private static final int CACHE_VERSION = 1;
private static final int VALUE_COUNT = 1;
private static final int IO_BUFFER_SIZE = 8 * 1024;
- private static final Pattern CAPITAL_LETTERS = Pattern.compile("[A-Z]");
-
- private StringBuffer mValidKeyBuffer = new StringBuffer(64);
- private StringBuffer mConversionBuffer = new StringBuffer(2).append('_');
- private static final String TAG = "DiskLruImageCache";
+ private static final String TAG = DiskLruImageCache.class.getSimpleName();
+
+ //public DiskLruImageCache( Context context,String uniqueName, int diskCacheSize,
+ public DiskLruImageCache(
+ File diskCacheDir, int diskCacheSize, CompressFormat compressFormat, int quality
+ ) throws IOException {
- public DiskLruImageCache( Context context,String uniqueName, int diskCacheSize,
- CompressFormat compressFormat, int quality ) throws IOException {
- final File diskCacheDir = getDiskCacheDir(context, uniqueName );
mDiskCache = DiskLruCache.open(
diskCacheDir, CACHE_VERSION, VALUE_COUNT, diskCacheSize
);
}
}
- private File getDiskCacheDir(Context context, String uniqueName) {
-
- // Check if media is mounted or storage is built-in, if so, try and use external cache dir
- // otherwise use internal cache dir
- final String cachePath = context.getExternalCacheDir().getPath();
-
- Log_OC.d(TAG, "create dir: " + cachePath + File.separator + uniqueName);
-
- return new File(cachePath + File.separator + uniqueName);
- }
-
public void put( String key, Bitmap data ) {
DiskLruCache.Editor editor = null;
mDiskCache.flush();
editor.commit();
if ( BuildConfig.DEBUG ) {
- Log.d( "cache_test_DISK_", "image put on disk cache " + validKey );
+ Log_OC.d( "cache_test_DISK_", "image put on disk cache " + validKey );
}
} else {
editor.abort();
if ( BuildConfig.DEBUG ) {
- Log.d( "cache_test_DISK_", "ERROR on: image put on disk cache " + validKey );
+ Log_OC.d( "cache_test_DISK_", "ERROR on: image put on disk cache " + validKey );
}
}
} catch (IOException e) {
if ( BuildConfig.DEBUG ) {
- Log.d( "cache_test_DISK_", "ERROR on: image put on disk cache " + validKey );
+ Log_OC.d( "cache_test_DISK_", "ERROR on: image put on disk cache " + validKey );
}
try {
if ( editor != null ) {
}
if ( BuildConfig.DEBUG ) {
- Log.d("cache_test_DISK_", bitmap == null ? "not found" : "image read from disk " + validKey);
+ Log_OC.d("cache_test_DISK_", bitmap == null ?
+ "not found" : "image read from disk " + validKey);
}
return bitmap;
public void clearCache() {
if ( BuildConfig.DEBUG ) {
- Log.d( "cache_test_DISK_", "disk cache CLEARED");
+ Log_OC.d( "cache_test_DISK_", "disk cache CLEARED");
}
try {
mDiskCache.delete();
}
private String convertToValidKey(String key) {
- Matcher capitalLettersMatcher = CAPITAL_LETTERS.matcher(key);
- mValidKeyBuffer.delete(0, mValidKeyBuffer.length());
- mConversionBuffer.delete(1, mConversionBuffer.length());
-
- while (capitalLettersMatcher.find()) {
- mConversionBuffer.replace(1, 2, capitalLettersMatcher.group(0).toLowerCase());
- capitalLettersMatcher.appendReplacement(mValidKeyBuffer, mConversionBuffer.toString());
- }
- capitalLettersMatcher.appendTail(mValidKeyBuffer);
- return mValidKeyBuffer.toString();
+ return Integer.toString(key.hashCode());
}
+ /**
+ * Remove passed key from cache
+ * @param key
+ */
+ public void removeKey( String key ) {
+ String validKey = convertToValidKey(key);
+ try {
+ mDiskCache.remove(validKey);
+ Log_OC.d(TAG, "removeKey from cache: " + validKey);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
}
\ No newline at end of file
*/\r
package com.owncloud.android.ui.adapter;\r
\r
+
import java.io.File;\r
-import java.lang.ref.WeakReference;\r
+import java.util.Collections;\r
+import java.util.Comparator;\r
import java.util.Vector;\r
\r
+import third_parties.daveKoeller.AlphanumComparator;\r
import android.accounts.Account;\r
import android.content.Context;\r
-import android.content.res.Resources;\r
+import android.content.SharedPreferences;\r
import android.graphics.Bitmap;\r
-import android.graphics.Bitmap.CompressFormat;\r
-import android.graphics.BitmapFactory;\r
-import android.graphics.drawable.BitmapDrawable;\r
-import android.graphics.drawable.Drawable;\r
-import android.media.ThumbnailUtils;\r
-import android.os.AsyncTask;\r
-import android.util.TypedValue;\r
+import android.preference.PreferenceManager;\r
import android.view.LayoutInflater;\r
import android.view.View;\r
import android.view.ViewGroup;\r
import com.owncloud.android.authentication.AccountUtils;\r
import com.owncloud.android.datamodel.FileDataStorageManager;\r
import com.owncloud.android.datamodel.OCFile;\r
+import com.owncloud.android.datamodel.ThumbnailsCacheManager;\r
+import com.owncloud.android.datamodel.ThumbnailsCacheManager.AsyncDrawable;\r
import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;\r
import com.owncloud.android.files.services.FileUploader.FileUploaderBinder;\r
-import com.owncloud.android.lib.common.utils.Log_OC;\r
import com.owncloud.android.ui.activity.ComponentsGetter;\r
-import com.owncloud.android.utils.BitmapUtils;\r
import com.owncloud.android.utils.DisplayUtils;\r
-\r
+import com.owncloud.android.utils.FileStorageUtils;\r
+
\r
/**\r
* This Adapter populates a ListView with all files and folders in an ownCloud\r
* @author Tobias Kaminsky\r
* @author David A. Velasco\r
*/\r
-public class FileListListAdapter extends BaseAdapter implements ListAdapter {\r
+public class FileListListAdapter extends BaseAdapter implements ListAdapter {
private final static String PERMISSION_SHARED_WITH_ME = "S";\r
\r
- private static final String TAG = FileListListAdapter.class.getSimpleName();\r
-\r
private Context mContext;\r
private OCFile mFile = null;\r
private Vector<OCFile> mFiles = null;\r
private FileDataStorageManager mStorageManager;
private Account mAccount;
private ComponentsGetter mTransferServiceGetter;\r
+ private Integer mSortOrder;\r
+ public static final Integer SORT_NAME = 0;\r
+ public static final Integer SORT_DATE = 1;\r
+ public static final Integer SORT_SIZE = 2;\r
+ private Boolean mSortAscending;\r
+ private SharedPreferences mAppPreferences;\r
\r
- private final Object thumbnailDiskCacheLock = new Object();\r
- private DiskLruImageCache mThumbnailCache;\r
- private boolean mThumbnailCacheStarting = true;\r
- private static final int DISK_CACHE_SIZE = 1024 * 1024 * 10; // 10MB\r
- private static final CompressFormat mCompressFormat = CompressFormat.JPEG;\r
- private static final int mCompressQuality = 70;\r
- private Bitmap defaultImg;\r
- \r
public FileListListAdapter(\r
boolean justFolders, \r
Context context, \r
mJustFolders = justFolders;\r
mContext = context;\r
mAccount = AccountUtils.getCurrentOwnCloudAccount(mContext);\r
- mTransferServiceGetter = transferServiceGetter;\r
- defaultImg = BitmapFactory.decodeResource(mContext.getResources(), \r
- DisplayUtils.getResourceId("image/png", "default.png"));\r
+ mTransferServiceGetter = transferServiceGetter;
\r
- // Initialise disk cache on background thread\r
- new InitDiskCacheTask().execute();\r
- }\r
- \r
- class InitDiskCacheTask extends AsyncTask<File, Void, Void> {\r
- @Override\r
- protected Void doInBackground(File... params) {\r
- synchronized (thumbnailDiskCacheLock) {\r
- try {\r
- mThumbnailCache = new DiskLruImageCache(mContext, "thumbnailCache", \r
- DISK_CACHE_SIZE, mCompressFormat, mCompressQuality);\r
- } catch (Exception e) {\r
- Log_OC.d(TAG, "Thumbnail cache could not be opened ", e);\r
- mThumbnailCache = null;\r
- }\r
- mThumbnailCacheStarting = false; // Finished initialization\r
- thumbnailDiskCacheLock.notifyAll(); // Wake any waiting threads\r
- }\r
- return null;\r
- }\r
- }\r
- \r
- static class AsyncDrawable extends BitmapDrawable {\r
- private final WeakReference<ThumbnailGenerationTask> bitmapWorkerTaskReference;\r
-\r
- public AsyncDrawable(Resources res, Bitmap bitmap,\r
- ThumbnailGenerationTask bitmapWorkerTask) {\r
- super(res, bitmap);\r
- bitmapWorkerTaskReference =\r
- new WeakReference<ThumbnailGenerationTask>(bitmapWorkerTask);\r
- }\r
-\r
- public ThumbnailGenerationTask getBitmapWorkerTask() {\r
- return bitmapWorkerTaskReference.get();\r
- }\r
- }\r
-\r
- class ThumbnailGenerationTask extends AsyncTask<OCFile, Void, Bitmap> {\r
- private final WeakReference<ImageView> imageViewReference;\r
- private OCFile file;\r
-\r
+ mAppPreferences = PreferenceManager\r
+ .getDefaultSharedPreferences(mContext);\r
\r
- public ThumbnailGenerationTask(ImageView imageView) {\r
- // Use a WeakReference to ensure the ImageView can be garbage collected\r
- imageViewReference = new WeakReference<ImageView>(imageView);\r
- }\r
-\r
- // Decode image in background.\r
- @Override\r
- protected Bitmap doInBackground(OCFile... params) {\r
- Bitmap thumbnail = null;\r
- \r
- try {\r
- file = params[0];\r
- final String imageKey = String.valueOf(file.getRemoteId());\r
- \r
- // Check disk cache in background thread\r
- thumbnail = getBitmapFromDiskCache(imageKey);\r
- \r
- // Not found in disk cache\r
- if (thumbnail == null || file.needsUpdateThumbnail()) { \r
- // Converts dp to pixel\r
- Resources r = mContext.getResources();\r
- int px = (int) Math.round(TypedValue.applyDimension(\r
- TypedValue.COMPLEX_UNIT_DIP, 150, r.getDisplayMetrics()\r
- ));\r
- \r
- if (file.isDown()){\r
- Bitmap bitmap = BitmapUtils.decodeSampledBitmapFromFile(\r
- file.getStoragePath(), px, px);\r
- \r
- if (bitmap != null) {\r
- thumbnail = ThumbnailUtils.extractThumbnail(bitmap, px, px);\r
- \r
- // Add thumbnail to cache\r
- addBitmapToCache(imageKey, thumbnail);\r
-\r
- file.setNeedsUpdateThumbnail(false);\r
- mStorageManager.saveFile(file);\r
- }\r
- \r
- }\r
- }\r
- \r
- } catch (Throwable t) {\r
- // the app should never break due to a problem with thumbnails\r
- Log_OC.e(TAG, "Generation of thumbnail for " + file + " failed", t);\r
- if (t instanceof OutOfMemoryError) {\r
- System.gc();\r
- }\r
- }\r
- \r
- return thumbnail;\r
- }\r
+ // Read sorting order, default to sort by name ascending\r
+ mSortOrder = mAppPreferences\r
+ .getInt("sortOrder", 0);\r
+ mSortAscending = mAppPreferences.getBoolean("sortAscending", true);
\r
- protected void onPostExecute(Bitmap bitmap){\r
- if (isCancelled()) {\r
- bitmap = null;\r
- }\r
-\r
- if (imageViewReference != null && bitmap != null) {\r
- final ImageView imageView = imageViewReference.get();\r
- final ThumbnailGenerationTask bitmapWorkerTask =\r
- getBitmapWorkerTask(imageView);\r
- if (this == bitmapWorkerTask && imageView != null) {\r
- imageView.setImageBitmap(bitmap);\r
- }\r
- }\r
- }\r
- }\r
- \r
- public void addBitmapToCache(String key, Bitmap bitmap) {\r
- synchronized (thumbnailDiskCacheLock) {\r
- if (mThumbnailCache != null) {\r
- mThumbnailCache.put(key, bitmap);\r
- }\r
- }\r
+ // initialise thumbnails cache on background thread\r
+ new ThumbnailsCacheManager.InitDiskCacheTask().execute();\r
}\r
-\r
- public Bitmap getBitmapFromDiskCache(String key) {\r
- synchronized (thumbnailDiskCacheLock) {\r
- // Wait while disk cache is started from background thread\r
- while (mThumbnailCacheStarting) {\r
- try {\r
- thumbnailDiskCacheLock.wait();\r
- } catch (InterruptedException e) {}\r
- }\r
- if (mThumbnailCache != null) {\r
- return (Bitmap) mThumbnailCache.getBitmap(key);\r
- }\r
- }\r
- return null;\r
- }
-\r
+
@Override\r
public boolean areAllItemsEnabled() {\r
return true;\r
\r
fileName.setText(name);\r
ImageView fileIcon = (ImageView) view.findViewById(R.id.imageView1);\r
+ fileIcon.setTag(file.getFileId());\r
ImageView sharedIconV = (ImageView) view.findViewById(R.id.sharedIcon);\r
ImageView sharedWithMeIconV = (ImageView) view.findViewById(R.id.sharedWithMeIcon);\r
sharedWithMeIconV.setVisibility(View.GONE);\r
} \r
\r
// get Thumbnail if file is image\r
- if (file.isImage()){\r
+ if (file.isImage() && file.getRemoteId() != null){\r
// Thumbnail in Cache?\r
- Bitmap thumbnail = getBitmapFromDiskCache(String.valueOf(file.getRemoteId()));\r
+ Bitmap thumbnail = ThumbnailsCacheManager.getBitmapFromDiskCache(\r
+ String.valueOf(file.getRemoteId())\r
+ );\r
if (thumbnail != null && !file.needsUpdateThumbnail()){\r
fileIcon.setImageBitmap(thumbnail);\r
} else {\r
// generate new Thumbnail\r
- if (cancelPotentialWork(file, fileIcon)) {\r
- final ThumbnailGenerationTask task = \r
- new ThumbnailGenerationTask(fileIcon);\r
- final AsyncDrawable asyncDrawable =\r
- new AsyncDrawable(mContext.getResources(), defaultImg, task);\r
+ if (ThumbnailsCacheManager.cancelPotentialWork(file, fileIcon)) {\r
+ final ThumbnailsCacheManager.ThumbnailGenerationTask task = \r
+ new ThumbnailsCacheManager.ThumbnailGenerationTask(\r
+ fileIcon, mStorageManager\r
+ );\r
+ if (thumbnail == null) {\r
+ thumbnail = ThumbnailsCacheManager.mDefaultImg;\r
+ }\r
+ final AsyncDrawable asyncDrawable = new AsyncDrawable(\r
+ mContext.getResources(), \r
+ thumbnail, \r
+ task\r
+ );\r
fileIcon.setImageDrawable(asyncDrawable);\r
task.execute(file);\r
}\r
}\r
} \r
else {\r
- fileSizeV.setVisibility(View.INVISIBLE);\r
- //fileSizeV.setText(DisplayUtils.bytesToHumanReadable(file.getFileLength()));\r
+ // TODO Re-enable when server supports folder-size calculation\r
+// if (FileStorageUtils.getDefaultSavePathFor(mAccount.name, file) != null){\r
+// fileSizeV.setVisibility(View.VISIBLE);\r
+// fileSizeV.setText(getFolderSizeHuman(FileStorageUtils.getDefaultSavePathFor(mAccount.name, file)));\r
+// } else {\r
+ fileSizeV.setVisibility(View.INVISIBLE);\r
+// }\r
+
lastModV.setVisibility(View.VISIBLE);\r
lastModV.setText(\r
DisplayUtils.unixTimeToHumanReadable(file.getModificationTimestamp())\r
\r
return view;\r
}\r
- \r
- public static boolean cancelPotentialWork(OCFile file, ImageView imageView) {\r
- final ThumbnailGenerationTask bitmapWorkerTask = getBitmapWorkerTask(imageView);\r
+
+ /**\r
+ * Local Folder size in human readable format\r
+ * \r
+ * @param path\r
+ * String\r
+ * @return Size in human readable format\r
+ */\r
+ private String getFolderSizeHuman(String path) {\r
\r
- if (bitmapWorkerTask != null) {\r
- final OCFile bitmapData = bitmapWorkerTask.file;\r
- // If bitmapData is not yet set or it differs from the new data\r
- if (bitmapData == null || bitmapData != file) {\r
- // Cancel previous task\r
- bitmapWorkerTask.cancel(true);\r
- } else {\r
- // The same work is already in progress\r
- return false;\r
- }\r
+ File dir = new File(path);\r
+\r
+ if (dir.exists()) {\r
+ long bytes = getFolderSize(dir);\r
+ return DisplayUtils.bytesToHumanReadable(bytes);\r
}\r
- // No task associated with the ImageView, or an existing task was cancelled\r
- return true;\r
+\r
+ return "0 B";\r
}\r
- \r
- private static ThumbnailGenerationTask getBitmapWorkerTask(ImageView imageView) {\r
- if (imageView != null) {\r
- final Drawable drawable = imageView.getDrawable();\r
- if (drawable instanceof AsyncDrawable) {\r
- final AsyncDrawable asyncDrawable = (AsyncDrawable) drawable;\r
- return asyncDrawable.getBitmapWorkerTask();\r
- }\r
- }\r
- return null;\r
- }\r
\r
+ /**\r
+ * Local Folder size\r
+ * @param dir File\r
+ * @return Size in bytes\r
+ */\r
+ private long getFolderSize(File dir) {\r
+ if (dir.exists()) {\r
+ long result = 0;\r
+ File[] fileList = dir.listFiles();\r
+ for(int i = 0; i < fileList.length; i++) {\r
+ if(fileList[i].isDirectory()) {\r
+ result += getFolderSize(fileList[i]);\r
+ } else {\r
+ result += fileList[i].length();\r
+ }\r
+ }\r
+ return result;\r
+ }\r
+ return 0;\r
+ }
+
@Override\r
public int getViewTypeCount() {\r
return 1;\r
} else {\r
mFiles = null;\r
}\r
+\r
+ sortDirectory();\r
+ }\r
+ \r
+ /**\r
+ * Sorts all filenames, regarding last user decision \r
+ */\r
+ private void sortDirectory(){\r
+ switch (mSortOrder){\r
+ case 0:\r
+ sortByName(mSortAscending);\r
+ break;\r
+ case 1:\r
+ sortByDate(mSortAscending);\r
+ break;\r
+ case 2: \r
+ sortBySize(mSortAscending);\r
+ break;\r
+ }\r
+ \r
notifyDataSetChanged();\r
}\r
\r
&& file.getPermissions() != null \r
&& file.getPermissions().contains(PERMISSION_SHARED_WITH_ME));\r
}\r
+\r
+ /**\r
+ * Sorts list by Date\r
+ * @param sortAscending true: ascending, false: descending\r
+ */\r
+ private void sortByDate(boolean sortAscending){\r
+ final Integer val;\r
+ if (sortAscending){\r
+ val = 1;\r
+ } else {\r
+ val = -1;\r
+ }\r
+ \r
+ Collections.sort(mFiles, new Comparator<OCFile>() {\r
+ public int compare(OCFile o1, OCFile o2) {\r
+ if (o1.isFolder() && o2.isFolder()) {\r
+ Long obj1 = o1.getModificationTimestamp();\r
+ return val * obj1.compareTo(o2.getModificationTimestamp());\r
+ }\r
+ else if (o1.isFolder()) {\r
+ return -1;\r
+ } else if (o2.isFolder()) {\r
+ return 1;\r
+ } else if (o1.getModificationTimestamp() == 0 || o2.getModificationTimestamp() == 0){\r
+ return 0;\r
+ } else {\r
+ Long obj1 = o1.getModificationTimestamp();\r
+ return val * obj1.compareTo(o2.getModificationTimestamp());\r
+ }\r
+ }\r
+ });\r
+ }\r
+\r
+ /**\r
+ * Sorts list by Size\r
+ * @param sortAscending true: ascending, false: descending\r
+ */\r
+ private void sortBySize(boolean sortAscending){\r
+ final Integer val;\r
+ if (sortAscending){\r
+ val = 1;\r
+ } else {\r
+ val = -1;\r
+ }\r
+ \r
+ Collections.sort(mFiles, new Comparator<OCFile>() {\r
+ public int compare(OCFile o1, OCFile o2) {\r
+ if (o1.isFolder() && o2.isFolder()) {\r
+ Long obj1 = getFolderSize(new File(FileStorageUtils.getDefaultSavePathFor(mAccount.name, o1)));\r
+ return val * obj1.compareTo(getFolderSize(new File(FileStorageUtils.getDefaultSavePathFor(mAccount.name, o2))));\r
+ }\r
+ else if (o1.isFolder()) {\r
+ return -1;\r
+ } else if (o2.isFolder()) {\r
+ return 1;\r
+ } else if (o1.getFileLength() == 0 || o2.getFileLength() == 0){\r
+ return 0;\r
+ } else {\r
+ Long obj1 = o1.getFileLength();\r
+ return val * obj1.compareTo(o2.getFileLength());\r
+ }\r
+ }\r
+ });\r
+ }\r
+\r
+ /**\r
+ * Sorts list by Name\r
+ * @param sortAscending true: ascending, false: descending\r
+ */\r
+ private void sortByName(boolean sortAscending){\r
+ final Integer val;\r
+ if (sortAscending){\r
+ val = 1;\r
+ } else {\r
+ val = -1;\r
+ }\r
+\r
+ Collections.sort(mFiles, new Comparator<OCFile>() {\r
+ public int compare(OCFile o1, OCFile o2) {\r
+ if (o1.isFolder() && o2.isFolder()) {\r
+ return val * o1.getRemotePath().toLowerCase().compareTo(o2.getRemotePath().toLowerCase());\r
+ } else if (o1.isFolder()) {\r
+ return -1;\r
+ } else if (o2.isFolder()) {\r
+ return 1;\r
+ }\r
+ return val * new AlphanumComparator().compare(o1, o2);\r
+ }\r
+ });\r
+ }\r
+\r
+ public void setSortOrder(Integer order, boolean ascending) {\r
+ SharedPreferences.Editor editor = mAppPreferences.edit();\r
+ editor.putInt("sortOrder", order);\r
+ editor.putBoolean("sortAscending", ascending);\r
+ editor.commit();\r
+ \r
+ mSortOrder = order;\r
+ mSortAscending = ascending;\r
+ \r
+ sortDirectory();\r
+ }
}\r
mFile = directory;
}
}
+
+ public void sortByName(boolean descending) {
+ mAdapter.setSortOrder(FileListListAdapter.SORT_NAME, descending);
+ }
+
+ public void sortByDate(boolean descending) {
+ mAdapter.setSortOrder(FileListListAdapter.SORT_DATE, descending);
+ }
+
+ public void sortBySize(boolean descending) {
+ mAdapter.setSortOrder(FileListListAdapter.SORT_SIZE, descending);
+ }
}
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageButton;
+import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
((ImageButton)mView.findViewById(R.id.cancelBtn)).setOnClickListener(this);
+ ((LinearLayout)mView.findViewById(R.id.fileDownloadLL)).setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ ((PreviewImageActivity) getActivity()).toggleFullScreen();
+ }
+ });
+
if (mError) {
setButtonsForRemote();
} else {
--- /dev/null
+package com.owncloud.android.ui.preview;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.Canvas;
+import android.os.Build;
+import android.util.AttributeSet;
+import android.view.View;
+import android.widget.ImageView;
+
+import com.owncloud.android.lib.common.utils.Log_OC;
+
+public class ImageViewCustom extends ImageView {
+
+ private static final boolean IS_ICS_OR_HIGHER = Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH;
+
+ private Bitmap mBitmap;
+
+
+ public ImageViewCustom(Context context) {
+ super(context);
+ }
+
+ public ImageViewCustom(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ public ImageViewCustom(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ }
+
+ @SuppressLint("NewApi")
+ @Override
+ protected void onDraw(Canvas canvas) {
+
+ if(IS_ICS_OR_HIGHER && checkIfMaximumBitmapExceed(canvas)) {
+ // Set layer type to software one for avoiding exceed
+ // and problems in visualization
+ setLayerType(View.LAYER_TYPE_SOFTWARE, null);
+ }
+
+ super.onDraw(canvas);
+ }
+
+ /**
+ * Checks if current bitmaps exceed the maximum OpenGL texture size limit
+ * @param bitmap
+ * @return boolean
+ */
+ @SuppressLint("NewApi")
+ private boolean checkIfMaximumBitmapExceed(Canvas canvas) {
+ Log_OC.d("OC", "Canvas maximum: " + canvas.getMaximumBitmapWidth() + " - " + canvas.getMaximumBitmapHeight());
+ if (mBitmap!= null && (mBitmap.getWidth() > canvas.getMaximumBitmapWidth()
+ || mBitmap.getHeight() > canvas.getMaximumBitmapHeight())) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Set current bitmap
+ * @param bitmap
+ */
+ public void setBitmap (Bitmap bitmap) {
+ mBitmap = bitmap;
+ }
+
+}
*/
package com.owncloud.android.ui.preview;
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FilterInputStream;
+import java.io.IOException;
+import java.io.InputStream;
import java.lang.ref.WeakReference;
import android.accounts.Account;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuInflater;
import com.actionbarsherlock.view.MenuItem;
-import com.ortiz.touch.TouchImageView;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.FileMenuFilter;
import com.owncloud.android.ui.dialog.ConfirmationDialogFragment;
import com.owncloud.android.ui.dialog.RemoveFileDialogFragment;
import com.owncloud.android.ui.fragment.FileFragment;
+import com.owncloud.android.utils.TouchImageViewCustom;
+
/**
* @author David A. Velasco
*/
public class PreviewImageFragment extends FileFragment {
+
public static final String EXTRA_FILE = "FILE";
public static final String EXTRA_ACCOUNT = "ACCOUNT";
private View mView;
private Account mAccount;
- private TouchImageView mImageView;
+ private TouchImageViewCustom mImageView;
private TextView mMessageView;
private ProgressBar mProgressWheel;
Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
mView = inflater.inflate(R.layout.preview_image_fragment, container, false);
- mImageView = (TouchImageView) mView.findViewById(R.id.image);
+ mImageView = (TouchImageViewCustom) mView.findViewById(R.id.image);
mImageView.setVisibility(View.GONE);
mImageView.setOnClickListener(new OnClickListener() {
@Override
public void onDestroy() {
if (mBitmap != null) {
mBitmap.recycle();
+ System.gc();
}
super.onDestroy();
}
*
* Using a weak reference will avoid memory leaks if the target ImageView is retired from memory before the load finishes.
*/
- private final WeakReference<ImageView> mImageViewRef;
+ private final WeakReference<ImageViewCustom> mImageViewRef;
/**
* Weak reference to the target {@link TextView} where error messages will be written.
*
* @param imageView Target {@link ImageView} where the bitmap will be loaded into.
*/
- public BitmapLoader(ImageView imageView, TextView messageView, ProgressBar progressWheel) {
- mImageViewRef = new WeakReference<ImageView>(imageView);
+ public BitmapLoader(ImageViewCustom imageView, TextView messageView, ProgressBar progressWheel) {
+ mImageViewRef = new WeakReference<ImageViewCustom>(imageView);
mMessageViewRef = new WeakReference<TextView>(messageView);
mProgressWheelRef = new WeakReference<ProgressBar>(progressWheel);
}
- @SuppressWarnings("deprecation")
- @SuppressLint({ "NewApi", "NewApi", "NewApi" }) // to avoid Lint errors since Android SDK r20
- @Override
+ @Override
protected Bitmap doInBackground(String... params) {
Bitmap result = null;
if (params.length != 1) return result;
String storagePath = params[0];
try {
- // set desired options that will affect the size of the bitmap
- BitmapFactory.Options options = new Options();
- options.inScaled = true;
- options.inPurgeable = true;
- if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.GINGERBREAD_MR1) {
- options.inPreferQualityOverSpeed = false;
- }
- if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
- options.inMutable = false;
- }
- // make a false load of the bitmap - just to be able to read outWidth, outHeight and outMimeType
- options.inJustDecodeBounds = true;
- BitmapFactory.decodeFile(storagePath, options);
-
- int width = options.outWidth;
- int height = options.outHeight;
- int scale = 1;
-
- Display display = getActivity().getWindowManager().getDefaultDisplay();
- Point size = new Point();
- int screenWidth;
- int screenHeight;
- if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB_MR2) {
- display.getSize(size);
- screenWidth = size.x;
- screenHeight = size.y;
- } else {
- screenWidth = display.getWidth();
- screenHeight = display.getHeight();
- }
- if (width > screenWidth) {
- // second try to scale down the image , this time depending upon the screen size
- scale = (int) Math.floor((float)width / screenWidth);
- }
- if (height > screenHeight) {
- scale = Math.max(scale, (int) Math.floor((float)height / screenHeight));
- }
- options.inSampleSize = scale;
+ File picture = new File(storagePath);
- // really load the bitmap
- options.inJustDecodeBounds = false; // the next decodeFile call will be real
- result = BitmapFactory.decodeFile(storagePath, options);
- //Log_OC.d(TAG, "Image loaded - width: " + options.outWidth + ", loaded height: " + options.outHeight);
+ if (picture != null) {
+ //Decode file into a bitmap in real size for being able to make zoom on the image
+ result = BitmapFactory.decodeStream(new FlushedInputStream
+ (new BufferedInputStream(new FileInputStream(picture))));
+ }
if (result == null) {
mErrorMessageId = R.string.preview_image_error_unknown_format;
}
} catch (OutOfMemoryError e) {
- mErrorMessageId = R.string.preview_image_error_unknown_format;
Log_OC.e(TAG, "Out of memory occured for file " + storagePath, e);
+
+ // If out of memory error when loading image, try to load it scaled
+ result = loadScaledImage(storagePath);
+
+ if (result == null) {
+ mErrorMessageId = R.string.preview_image_error_unknown_format;
+ Log_OC.e(TAG, "File could not be loaded as a bitmap: " + storagePath);
+ }
} catch (NoSuchFieldError e) {
mErrorMessageId = R.string.common_error_unknown;
showErrorMessage();
}
}
-
+
+ @SuppressLint("InlinedApi")
private void showLoadedImage(Bitmap result) {
if (mImageViewRef != null) {
- final ImageView imageView = mImageViewRef.get();
+ final ImageViewCustom imageView = mImageViewRef.get();
if (imageView != null) {
+ imageView.setBitmap(result);
imageView.setImageBitmap(result);
imageView.setVisibility(View.VISIBLE);
mBitmap = result;
container.finish();
}
- public TouchImageView getImageView() {
+ public TouchImageViewCustom getImageView() {
return mImageView;
}
-
+
+ static class FlushedInputStream extends FilterInputStream {
+ public FlushedInputStream(InputStream inputStream) {
+ super(inputStream);
+ }
+
+ @Override
+ public long skip(long n) throws IOException {
+ long totalBytesSkipped = 0L;
+ while (totalBytesSkipped < n) {
+ long bytesSkipped = in.skip(n - totalBytesSkipped);
+ if (bytesSkipped == 0L) {
+ int byteValue = read();
+ if (byteValue < 0) {
+ break; // we reached EOF
+ } else {
+ bytesSkipped = 1; // we read one byte
+ }
+ }
+ totalBytesSkipped += bytesSkipped;
+ }
+ return totalBytesSkipped;
+ }
+ }
+
+ /**
+ * Load image scaled
+ * @param storagePath: path of the image
+ * @return Bitmap
+ */
+ @SuppressWarnings("deprecation")
+ private Bitmap loadScaledImage(String storagePath) {
+
+ Log_OC.d(TAG, "Loading image scaled");
+
+ // set desired options that will affect the size of the bitmap
+ BitmapFactory.Options options = new Options();
+ options.inScaled = true;
+ options.inPurgeable = true;
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.GINGERBREAD_MR1) {
+ options.inPreferQualityOverSpeed = false;
+ }
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
+ options.inMutable = false;
+ }
+ // make a false load of the bitmap - just to be able to read outWidth, outHeight and outMimeType
+ options.inJustDecodeBounds = true;
+ BitmapFactory.decodeFile(storagePath, options);
+
+ int width = options.outWidth;
+ int height = options.outHeight;
+ int scale = 1;
+
+ Display display = getActivity().getWindowManager().getDefaultDisplay();
+ Point size = new Point();
+ int screenWidth;
+ int screenHeight;
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB_MR2) {
+ display.getSize(size);
+ screenWidth = size.x;
+ screenHeight = size.y;
+ } else {
+ screenWidth = display.getWidth();
+ screenHeight = display.getHeight();
+ }
+
+ if (width > screenWidth) {
+ // second try to scale down the image , this time depending upon the screen size
+ scale = (int) Math.floor((float)width / screenWidth);
+ }
+ if (height > screenHeight) {
+ scale = Math.max(scale, (int) Math.floor((float)height / screenHeight));
+ }
+ options.inSampleSize = scale;
+
+ // really load the bitmap
+ options.inJustDecodeBounds = false; // the next decodeFile call will be real
+ return BitmapFactory.decodeFile(storagePath, options);
+
+ }
}
import android.media.MediaPlayer.OnCompletionListener;
import android.media.MediaPlayer.OnErrorListener;
import android.media.MediaPlayer.OnPreparedListener;
+import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.IBinder;
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
- mVideoPreview.setVideoPath(getFile().getStoragePath());
+ Uri uri = Uri.parse(getFile().getStoragePath());
+ mVideoPreview.setVideoPath(uri.encode(getFile().getStoragePath()));
}
\r
package com.owncloud.android.utils;\r
\r
+import java.net.IDN;\r
import java.util.Arrays;\r
import java.util.Calendar;\r
import java.util.Date;\r
import java.util.HashSet;\r
import java.util.Set;\r
\r
+import android.annotation.TargetApi;\r
+import android.os.Build;\r
+\r
import com.owncloud.android.R;\r
\r
/**\r
return R.drawable.icon;\r
}\r
}\r
+ \r
+ /**\r
+ * Converts an internationalized domain name (IDN) in an URL to and from ASCII/Unicode.\r
+ * @param url the URL where the domain name should be converted\r
+ * @param toASCII if true converts from Unicode to ASCII, if false converts from ASCII to Unicode\r
+ * @return the URL containing the converted domain name\r
+ */\r
+ @TargetApi(Build.VERSION_CODES.GINGERBREAD)\r
+ public static String convertIdn(String url, boolean toASCII) {\r
+ \r
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {\r
+ // Find host name after '//' or '@'\r
+ int hostStart = 0;\r
+ if (url.indexOf("//") != -1) {\r
+ hostStart = url.indexOf("//") + "//".length();\r
+ } else if (url.indexOf("@") != -1) {\r
+ hostStart = url.indexOf("@") + "@".length();\r
+ }\r
+ \r
+ int hostEnd = url.substring(hostStart).indexOf("/");\r
+ // Handle URL which doesn't have a path (path is implicitly '/')\r
+ hostEnd = (hostEnd == -1 ? url.length() : hostStart + hostEnd);\r
+ \r
+ String host = url.substring(hostStart, hostEnd);\r
+ host = (toASCII ? IDN.toASCII(host) : IDN.toUnicode(host));\r
+ \r
+ return url.substring(0, hostStart) + host + url.substring(hostEnd);\r
+ } else {\r
+ return url;\r
+ }\r
+ }\r
}\r
import android.annotation.SuppressLint;
import android.content.Context;
+import android.content.SharedPreferences;
+import android.preference.PreferenceManager;
import android.net.Uri;
import android.os.Environment;
import android.os.StatFs;
}
public static String getInstantUploadFilePath(Context context, String fileName) {
- String uploadPath = context.getString(R.string.instant_upload_path);
+ SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context);
+ String uploadPathdef = context.getString(R.string.instant_upload_path);
+ String uploadPath = pref.getString("instant_upload_path", uploadPathdef);
String value = uploadPath + OCFile.PATH_SEPARATOR + (fileName == null ? "" : fileName);
return value;
}
return file;
}
-}
\ No newline at end of file
+}
--- /dev/null
+/*
+ * TouchImageView.java
+ * By: Michael Ortiz
+ * Updated By: Patrick Lackemacher
+ * Updated By: Babay88
+ * Updated By: @ipsilondev
+ * Updated By: hank-cp
+ * Updated By: singpolyma
+ * -------------------
+ * Extends Android ImageView to include pinch zooming, panning, fling and double tap zoom.
+ */
+
+package com.owncloud.android.utils;
+
+import com.owncloud.android.ui.preview.ImageViewCustom;
+
+import android.annotation.TargetApi;
+import android.content.Context;
+import android.content.res.Configuration;
+import android.graphics.Bitmap;
+import android.graphics.Canvas;
+import android.graphics.Matrix;
+import android.graphics.PointF;
+import android.graphics.RectF;
+import android.graphics.drawable.Drawable;
+import android.net.Uri;
+import android.os.Build;
+import android.os.Build.VERSION;
+import android.os.Build.VERSION_CODES;
+import android.os.Bundle;
+import android.os.Parcelable;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.GestureDetector;
+import android.view.MotionEvent;
+import android.view.ScaleGestureDetector;
+import android.view.View;
+import android.view.animation.AccelerateDecelerateInterpolator;
+import android.widget.OverScroller;
+import android.widget.Scroller;
+
+public class TouchImageViewCustom extends ImageViewCustom {
+ private static final String DEBUG = "DEBUG";
+
+ //
+ // SuperMin and SuperMax multipliers. Determine how much the image can be
+ // zoomed below or above the zoom boundaries, before animating back to the
+ // min/max zoom boundary.
+ //
+ private static final float SUPER_MIN_MULTIPLIER = .75f;
+ private static final float SUPER_MAX_MULTIPLIER = 1.25f;
+
+ //
+ // Scale of image ranges from minScale to maxScale, where minScale == 1
+ // when the image is stretched to fit view.
+ //
+ private float normalizedScale;
+
+ //
+ // Matrix applied to image. MSCALE_X and MSCALE_Y should always be equal.
+ // MTRANS_X and MTRANS_Y are the other values used. prevMatrix is the matrix
+ // saved prior to the screen rotating.
+ //
+ private Matrix matrix, prevMatrix;
+
+ private static enum State { NONE, DRAG, ZOOM, FLING, ANIMATE_ZOOM };
+ private State state;
+
+ private float minScale;
+ private float maxScale;
+ private float superMinScale;
+ private float superMaxScale;
+ private float[] m;
+
+ private Context context;
+ private Fling fling;
+
+ private ScaleType mScaleType;
+
+ private boolean imageRenderedAtLeastOnce;
+ private boolean onDrawReady;
+
+ private ZoomVariables delayedZoomVariables;
+
+ //
+ // Size of view and previous view size (ie before rotation)
+ //
+ private int viewWidth, viewHeight, prevViewWidth, prevViewHeight;
+
+ //
+ // Size of image when it is stretched to fit view. Before and After rotation.
+ //
+ private float matchViewWidth, matchViewHeight, prevMatchViewWidth, prevMatchViewHeight;
+
+ private ScaleGestureDetector mScaleDetector;
+ private GestureDetector mGestureDetector;
+ private GestureDetector.OnDoubleTapListener doubleTapListener = null;
+ private OnTouchListener userTouchListener = null;
+ private OnTouchImageViewListener touchImageViewListener = null;
+
+ public TouchImageViewCustom(Context context) {
+ super(context);
+ sharedConstructing(context);
+ }
+
+ public TouchImageViewCustom(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ sharedConstructing(context);
+ }
+
+ public TouchImageViewCustom(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ sharedConstructing(context);
+ }
+
+ private void sharedConstructing(Context context) {
+ super.setClickable(true);
+ this.context = context;
+ mScaleDetector = new ScaleGestureDetector(context, new ScaleListener());
+ mGestureDetector = new GestureDetector(context, new GestureListener());
+ matrix = new Matrix();
+ prevMatrix = new Matrix();
+ m = new float[9];
+ normalizedScale = 1;
+ if (mScaleType == null) {
+ mScaleType = ScaleType.FIT_CENTER;
+ }
+ minScale = 1;
+ maxScale = 3;
+ superMinScale = SUPER_MIN_MULTIPLIER * minScale;
+ superMaxScale = SUPER_MAX_MULTIPLIER * maxScale;
+ setImageMatrix(matrix);
+ setScaleType(ScaleType.MATRIX);
+ setState(State.NONE);
+ onDrawReady = false;
+ super.setOnTouchListener(new PrivateOnTouchListener());
+ }
+
+ @Override
+ public void setOnTouchListener(View.OnTouchListener l) {
+ userTouchListener = l;
+ }
+
+ public void setOnTouchImageViewListener(OnTouchImageViewListener l) {
+ touchImageViewListener = l;
+ }
+
+ public void setOnDoubleTapListener(GestureDetector.OnDoubleTapListener l) {
+ doubleTapListener = l;
+ }
+
+ @Override
+ public void setImageResource(int resId) {
+ super.setImageResource(resId);
+ savePreviousImageValues();
+ fitImageToView();
+ }
+
+ @Override
+ public void setImageBitmap(Bitmap bm) {
+ super.setImageBitmap(bm);
+ savePreviousImageValues();
+ fitImageToView();
+ }
+
+ @Override
+ public void setImageDrawable(Drawable drawable) {
+ super.setImageDrawable(drawable);
+ savePreviousImageValues();
+ fitImageToView();
+ }
+
+ @Override
+ public void setImageURI(Uri uri) {
+ super.setImageURI(uri);
+ savePreviousImageValues();
+ fitImageToView();
+ }
+
+ @Override
+ public void setScaleType(ScaleType type) {
+ if (type == ScaleType.FIT_START || type == ScaleType.FIT_END) {
+ throw new UnsupportedOperationException("TouchImageView does not support FIT_START or FIT_END");
+ }
+ if (type == ScaleType.MATRIX) {
+ super.setScaleType(ScaleType.MATRIX);
+
+ } else {
+ mScaleType = type;
+ if (onDrawReady) {
+ //
+ // If the image is already rendered, scaleType has been called programmatically
+ // and the TouchImageView should be updated with the new scaleType.
+ //
+ setZoom(this);
+ }
+ }
+ }
+
+ @Override
+ public ScaleType getScaleType() {
+ return mScaleType;
+ }
+
+ /**
+ * Returns false if image is in initial, unzoomed state. False, otherwise.
+ * @return true if image is zoomed
+ */
+ public boolean isZoomed() {
+ return normalizedScale != 1;
+ }
+
+ /**
+ * Return a Rect representing the zoomed image.
+ * @return rect representing zoomed image
+ */
+ public RectF getZoomedRect() {
+ if (mScaleType == ScaleType.FIT_XY) {
+ throw new UnsupportedOperationException("getZoomedRect() not supported with FIT_XY");
+ }
+ PointF topLeft = transformCoordTouchToBitmap(0, 0, true);
+ PointF bottomRight = transformCoordTouchToBitmap(viewWidth, viewHeight, true);
+
+ float w = getDrawable().getIntrinsicWidth();
+ float h = getDrawable().getIntrinsicHeight();
+ return new RectF(topLeft.x / w, topLeft.y / h, bottomRight.x / w, bottomRight.y / h);
+ }
+
+ /**
+ * Save the current matrix and view dimensions
+ * in the prevMatrix and prevView variables.
+ */
+ private void savePreviousImageValues() {
+ if (matrix != null && viewHeight != 0 && viewWidth != 0) {
+ matrix.getValues(m);
+ prevMatrix.setValues(m);
+ prevMatchViewHeight = matchViewHeight;
+ prevMatchViewWidth = matchViewWidth;
+ prevViewHeight = viewHeight;
+ prevViewWidth = viewWidth;
+ }
+ }
+
+ @Override
+ public Parcelable onSaveInstanceState() {
+ Bundle bundle = new Bundle();
+ bundle.putParcelable("instanceState", super.onSaveInstanceState());
+ bundle.putFloat("saveScale", normalizedScale);
+ bundle.putFloat("matchViewHeight", matchViewHeight);
+ bundle.putFloat("matchViewWidth", matchViewWidth);
+ bundle.putInt("viewWidth", viewWidth);
+ bundle.putInt("viewHeight", viewHeight);
+ matrix.getValues(m);
+ bundle.putFloatArray("matrix", m);
+ bundle.putBoolean("imageRendered", imageRenderedAtLeastOnce);
+ return bundle;
+ }
+
+ @Override
+ public void onRestoreInstanceState(Parcelable state) {
+ if (state instanceof Bundle) {
+ Bundle bundle = (Bundle) state;
+ normalizedScale = bundle.getFloat("saveScale");
+ m = bundle.getFloatArray("matrix");
+ prevMatrix.setValues(m);
+ prevMatchViewHeight = bundle.getFloat("matchViewHeight");
+ prevMatchViewWidth = bundle.getFloat("matchViewWidth");
+ prevViewHeight = bundle.getInt("viewHeight");
+ prevViewWidth = bundle.getInt("viewWidth");
+ imageRenderedAtLeastOnce = bundle.getBoolean("imageRendered");
+ super.onRestoreInstanceState(bundle.getParcelable("instanceState"));
+ return;
+ }
+
+ super.onRestoreInstanceState(state);
+ }
+
+ @Override
+ protected void onDraw(Canvas canvas) {
+ onDrawReady = true;
+ imageRenderedAtLeastOnce = true;
+ if (delayedZoomVariables != null) {
+ setZoom(delayedZoomVariables.scale, delayedZoomVariables.focusX, delayedZoomVariables.focusY, delayedZoomVariables.scaleType);
+ delayedZoomVariables = null;
+ }
+ super.onDraw(canvas);
+ }
+
+ @Override
+ public void onConfigurationChanged(Configuration newConfig) {
+ super.onConfigurationChanged(newConfig);
+ savePreviousImageValues();
+ }
+
+ /**
+ * Get the max zoom multiplier.
+ * @return max zoom multiplier.
+ */
+ public float getMaxZoom() {
+ return maxScale;
+ }
+
+ /**
+ * Set the max zoom multiplier. Default value: 3.
+ * @param max max zoom multiplier.
+ */
+ public void setMaxZoom(float max) {
+ maxScale = max;
+ superMaxScale = SUPER_MAX_MULTIPLIER * maxScale;
+ }
+
+ /**
+ * Get the min zoom multiplier.
+ * @return min zoom multiplier.
+ */
+ public float getMinZoom() {
+ return minScale;
+ }
+
+ /**
+ * Get the current zoom. This is the zoom relative to the initial
+ * scale, not the original resource.
+ * @return current zoom multiplier.
+ */
+ public float getCurrentZoom() {
+ return normalizedScale;
+ }
+
+ /**
+ * Set the min zoom multiplier. Default value: 1.
+ * @param min min zoom multiplier.
+ */
+ public void setMinZoom(float min) {
+ minScale = min;
+ superMinScale = SUPER_MIN_MULTIPLIER * minScale;
+ }
+
+ /**
+ * Reset zoom and translation to initial state.
+ */
+ public void resetZoom() {
+ normalizedScale = 1;
+ fitImageToView();
+ }
+
+ /**
+ * Set zoom to the specified scale. Image will be centered by default.
+ * @param scale
+ */
+ public void setZoom(float scale) {
+ setZoom(scale, 0.5f, 0.5f);
+ }
+
+ /**
+ * Set zoom to the specified scale. Image will be centered around the point
+ * (focusX, focusY). These floats range from 0 to 1 and denote the focus point
+ * as a fraction from the left and top of the view. For example, the top left
+ * corner of the image would be (0, 0). And the bottom right corner would be (1, 1).
+ * @param scale
+ * @param focusX
+ * @param focusY
+ */
+ public void setZoom(float scale, float focusX, float focusY) {
+ setZoom(scale, focusX, focusY, mScaleType);
+ }
+
+ /**
+ * Set zoom to the specified scale. Image will be centered around the point
+ * (focusX, focusY). These floats range from 0 to 1 and denote the focus point
+ * as a fraction from the left and top of the view. For example, the top left
+ * corner of the image would be (0, 0). And the bottom right corner would be (1, 1).
+ * @param scale
+ * @param focusX
+ * @param focusY
+ * @param scaleType
+ */
+ public void setZoom(float scale, float focusX, float focusY, ScaleType scaleType) {
+ //
+ // setZoom can be called before the image is on the screen, but at this point,
+ // image and view sizes have not yet been calculated in onMeasure. Thus, we should
+ // delay calling setZoom until the view has been measured.
+ //
+ if (!onDrawReady) {
+ delayedZoomVariables = new ZoomVariables(scale, focusX, focusY, scaleType);
+ return;
+ }
+
+ if (scaleType != mScaleType) {
+ setScaleType(scaleType);
+ }
+ resetZoom();
+ scaleImage(scale, viewWidth / 2, viewHeight / 2, true);
+ matrix.getValues(m);
+ m[Matrix.MTRANS_X] = -((focusX * getImageWidth()) - (viewWidth * 0.5f));
+ m[Matrix.MTRANS_Y] = -((focusY * getImageHeight()) - (viewHeight * 0.5f));
+ matrix.setValues(m);
+ fixTrans();
+ setImageMatrix(matrix);
+ }
+
+ /**
+ * Set zoom parameters equal to another TouchImageView. Including scale, position,
+ * and ScaleType.
+ * @param TouchImageView
+ */
+ public void setZoom(TouchImageViewCustom img) {
+ PointF center = img.getScrollPosition();
+ setZoom(img.getCurrentZoom(), center.x, center.y, img.getScaleType());
+ }
+
+ /**
+ * Return the point at the center of the zoomed image. The PointF coordinates range
+ * in value between 0 and 1 and the focus point is denoted as a fraction from the left
+ * and top of the view. For example, the top left corner of the image would be (0, 0).
+ * And the bottom right corner would be (1, 1).
+ * @return PointF representing the scroll position of the zoomed image.
+ */
+ public PointF getScrollPosition() {
+ Drawable drawable = getDrawable();
+ if (drawable == null) {
+ return null;
+ }
+ int drawableWidth = drawable.getIntrinsicWidth();
+ int drawableHeight = drawable.getIntrinsicHeight();
+
+ PointF point = transformCoordTouchToBitmap(viewWidth / 2, viewHeight / 2, true);
+ point.x /= drawableWidth;
+ point.y /= drawableHeight;
+ return point;
+ }
+
+ /**
+ * Set the focus point of the zoomed image. The focus points are denoted as a fraction from the
+ * left and top of the view. The focus points can range in value between 0 and 1.
+ * @param focusX
+ * @param focusY
+ */
+ public void setScrollPosition(float focusX, float focusY) {
+ setZoom(normalizedScale, focusX, focusY);
+ }
+
+ /**
+ * Performs boundary checking and fixes the image matrix if it
+ * is out of bounds.
+ */
+ private void fixTrans() {
+ matrix.getValues(m);
+ float transX = m[Matrix.MTRANS_X];
+ float transY = m[Matrix.MTRANS_Y];
+
+ float fixTransX = getFixTrans(transX, viewWidth, getImageWidth());
+ float fixTransY = getFixTrans(transY, viewHeight, getImageHeight());
+
+ if (fixTransX != 0 || fixTransY != 0) {
+ matrix.postTranslate(fixTransX, fixTransY);
+ }
+ }
+
+ /**
+ * When transitioning from zooming from focus to zoom from center (or vice versa)
+ * the image can become unaligned within the view. This is apparent when zooming
+ * quickly. When the content size is less than the view size, the content will often
+ * be centered incorrectly within the view. fixScaleTrans first calls fixTrans() and
+ * then makes sure the image is centered correctly within the view.
+ */
+ private void fixScaleTrans() {
+ fixTrans();
+ matrix.getValues(m);
+ if (getImageWidth() < viewWidth) {
+ m[Matrix.MTRANS_X] = (viewWidth - getImageWidth()) / 2;
+ }
+
+ if (getImageHeight() < viewHeight) {
+ m[Matrix.MTRANS_Y] = (viewHeight - getImageHeight()) / 2;
+ }
+ matrix.setValues(m);
+ }
+
+ private float getFixTrans(float trans, float viewSize, float contentSize) {
+ float minTrans, maxTrans;
+
+ if (contentSize <= viewSize) {
+ minTrans = 0;
+ maxTrans = viewSize - contentSize;
+
+ } else {
+ minTrans = viewSize - contentSize;
+ maxTrans = 0;
+ }
+
+ if (trans < minTrans)
+ return -trans + minTrans;
+ if (trans > maxTrans)
+ return -trans + maxTrans;
+ return 0;
+ }
+
+ private float getFixDragTrans(float delta, float viewSize, float contentSize) {
+ if (contentSize <= viewSize) {
+ return 0;
+ }
+ return delta;
+ }
+
+ private float getImageWidth() {
+ return matchViewWidth * normalizedScale;
+ }
+
+ private float getImageHeight() {
+ return matchViewHeight * normalizedScale;
+ }
+
+ @Override
+ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+ Drawable drawable = getDrawable();
+ if (drawable == null || drawable.getIntrinsicWidth() == 0 || drawable.getIntrinsicHeight() == 0) {
+ setMeasuredDimension(0, 0);
+ return;
+ }
+
+ int drawableWidth = drawable.getIntrinsicWidth();
+ int drawableHeight = drawable.getIntrinsicHeight();
+ int widthSize = MeasureSpec.getSize(widthMeasureSpec);
+ int widthMode = MeasureSpec.getMode(widthMeasureSpec);
+ int heightSize = MeasureSpec.getSize(heightMeasureSpec);
+ int heightMode = MeasureSpec.getMode(heightMeasureSpec);
+ viewWidth = setViewSize(widthMode, widthSize, drawableWidth);
+ viewHeight = setViewSize(heightMode, heightSize, drawableHeight);
+
+ //
+ // Set view dimensions
+ //
+ setMeasuredDimension(viewWidth, viewHeight);
+
+ //
+ // Fit content within view
+ //
+ fitImageToView();
+ }
+
+ /**
+ * If the normalizedScale is equal to 1, then the image is made to fit the screen. Otherwise,
+ * it is made to fit the screen according to the dimensions of the previous image matrix. This
+ * allows the image to maintain its zoom after rotation.
+ */
+ private void fitImageToView() {
+ Drawable drawable = getDrawable();
+ if (drawable == null || drawable.getIntrinsicWidth() == 0 || drawable.getIntrinsicHeight() == 0) {
+ return;
+ }
+ if (matrix == null || prevMatrix == null) {
+ return;
+ }
+
+ int drawableWidth = drawable.getIntrinsicWidth();
+ int drawableHeight = drawable.getIntrinsicHeight();
+
+ //
+ // Scale image for view
+ //
+ float scaleX = (float) viewWidth / drawableWidth;
+ float scaleY = (float) viewHeight / drawableHeight;
+
+ switch (mScaleType) {
+ case CENTER:
+ scaleX = scaleY = 1;
+ break;
+
+ case CENTER_CROP:
+ scaleX = scaleY = Math.max(scaleX, scaleY);
+ break;
+
+ case CENTER_INSIDE:
+ scaleX = scaleY = Math.min(1, Math.min(scaleX, scaleY));
+
+ case FIT_CENTER:
+ scaleX = scaleY = Math.min(scaleX, scaleY);
+ break;
+
+ case FIT_XY:
+ break;
+
+ default:
+ //
+ // FIT_START and FIT_END not supported
+ //
+ throw new UnsupportedOperationException("TouchImageView does not support FIT_START or FIT_END");
+
+ }
+
+ //
+ // Center the image
+ //
+ float redundantXSpace = viewWidth - (scaleX * drawableWidth);
+ float redundantYSpace = viewHeight - (scaleY * drawableHeight);
+ matchViewWidth = viewWidth - redundantXSpace;
+ matchViewHeight = viewHeight - redundantYSpace;
+ if (!isZoomed() && !imageRenderedAtLeastOnce) {
+ //
+ // Stretch and center image to fit view
+ //
+ matrix.setScale(scaleX, scaleY);
+ matrix.postTranslate(redundantXSpace / 2, redundantYSpace / 2);
+ normalizedScale = 1;
+
+ } else {
+ //
+ // These values should never be 0 or we will set viewWidth and viewHeight
+ // to NaN in translateMatrixAfterRotate. To avoid this, call savePreviousImageValues
+ // to set them equal to the current values.
+ //
+ if (prevMatchViewWidth == 0 || prevMatchViewHeight == 0) {
+ savePreviousImageValues();
+ }
+
+ prevMatrix.getValues(m);
+
+ //
+ // Rescale Matrix after rotation
+ //
+ m[Matrix.MSCALE_X] = matchViewWidth / drawableWidth * normalizedScale;
+ m[Matrix.MSCALE_Y] = matchViewHeight / drawableHeight * normalizedScale;
+
+ //
+ // TransX and TransY from previous matrix
+ //
+ float transX = m[Matrix.MTRANS_X];
+ float transY = m[Matrix.MTRANS_Y];
+
+ //
+ // Width
+ //
+ float prevActualWidth = prevMatchViewWidth * normalizedScale;
+ float actualWidth = getImageWidth();
+ translateMatrixAfterRotate(Matrix.MTRANS_X, transX, prevActualWidth, actualWidth, prevViewWidth, viewWidth, drawableWidth);
+
+ //
+ // Height
+ //
+ float prevActualHeight = prevMatchViewHeight * normalizedScale;
+ float actualHeight = getImageHeight();
+ translateMatrixAfterRotate(Matrix.MTRANS_Y, transY, prevActualHeight, actualHeight, prevViewHeight, viewHeight, drawableHeight);
+
+ //
+ // Set the matrix to the adjusted scale and translate values.
+ //
+ matrix.setValues(m);
+ }
+ fixTrans();
+ setImageMatrix(matrix);
+ }
+
+ /**
+ * Set view dimensions based on layout params
+ *
+ * @param mode
+ * @param size
+ * @param drawableWidth
+ * @return
+ */
+ private int setViewSize(int mode, int size, int drawableWidth) {
+ int viewSize;
+ switch (mode) {
+ case MeasureSpec.EXACTLY:
+ viewSize = size;
+ break;
+
+ case MeasureSpec.AT_MOST:
+ viewSize = Math.min(drawableWidth, size);
+ break;
+
+ case MeasureSpec.UNSPECIFIED:
+ viewSize = drawableWidth;
+ break;
+
+ default:
+ viewSize = size;
+ break;
+ }
+ return viewSize;
+ }
+
+ /**
+ * After rotating, the matrix needs to be translated. This function finds the area of image
+ * which was previously centered and adjusts translations so that is again the center, post-rotation.
+ *
+ * @param axis Matrix.MTRANS_X or Matrix.MTRANS_Y
+ * @param trans the value of trans in that axis before the rotation
+ * @param prevImageSize the width/height of the image before the rotation
+ * @param imageSize width/height of the image after rotation
+ * @param prevViewSize width/height of view before rotation
+ * @param viewSize width/height of view after rotation
+ * @param drawableSize width/height of drawable
+ */
+ private void translateMatrixAfterRotate(int axis, float trans, float prevImageSize, float imageSize, int prevViewSize, int viewSize, int drawableSize) {
+ if (imageSize < viewSize) {
+ //
+ // The width/height of image is less than the view's width/height. Center it.
+ //
+ m[axis] = (viewSize - (drawableSize * m[Matrix.MSCALE_X])) * 0.5f;
+
+ } else if (trans > 0) {
+ //
+ // The image is larger than the view, but was not before rotation. Center it.
+ //
+ m[axis] = -((imageSize - viewSize) * 0.5f);
+
+ } else {
+ //
+ // Find the area of the image which was previously centered in the view. Determine its distance
+ // from the left/top side of the view as a fraction of the entire image's width/height. Use that percentage
+ // to calculate the trans in the new view width/height.
+ //
+ float percentage = (Math.abs(trans) + (0.5f * prevViewSize)) / prevImageSize;
+ m[axis] = -((percentage * imageSize) - (viewSize * 0.5f));
+ }
+ }
+
+ private void setState(State state) {
+ this.state = state;
+ }
+
+ public boolean canScrollHorizontallyFroyo(int direction) {
+ return canScrollHorizontally(direction);
+ }
+
+ @Override
+ public boolean canScrollHorizontally(int direction) {
+ matrix.getValues(m);
+ float x = m[Matrix.MTRANS_X];
+
+ if (getImageWidth() < viewWidth) {
+ return false;
+
+ } else if (x >= -1 && direction < 0) {
+ return false;
+
+ } else if (Math.abs(x) + viewWidth + 1 >= getImageWidth() && direction > 0) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Gesture Listener detects a single click or long click and passes that on
+ * to the view's listener.
+ * @author Ortiz
+ *
+ */
+ private class GestureListener extends GestureDetector.SimpleOnGestureListener {
+
+ @Override
+ public boolean onSingleTapConfirmed(MotionEvent e)
+ {
+ if(doubleTapListener != null) {
+ return doubleTapListener.onSingleTapConfirmed(e);
+ }
+ return performClick();
+ }
+
+ @Override
+ public void onLongPress(MotionEvent e)
+ {
+ performLongClick();
+ }
+
+ @Override
+ public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY)
+ {
+ if (fling != null) {
+ //
+ // If a previous fling is still active, it should be cancelled so that two flings
+ // are not run simultaenously.
+ //
+ fling.cancelFling();
+ }
+ fling = new Fling((int) velocityX, (int) velocityY);
+ compatPostOnAnimation(fling);
+ return super.onFling(e1, e2, velocityX, velocityY);
+ }
+
+ @Override
+ public boolean onDoubleTap(MotionEvent e) {
+ boolean consumed = false;
+ if(doubleTapListener != null) {
+ consumed = doubleTapListener.onDoubleTap(e);
+ }
+ if (state == State.NONE) {
+ float targetZoom = (normalizedScale == minScale) ? maxScale : minScale;
+ DoubleTapZoom doubleTap = new DoubleTapZoom(targetZoom, e.getX(), e.getY(), false);
+ compatPostOnAnimation(doubleTap);
+ consumed = true;
+ }
+ return consumed;
+ }
+
+ @Override
+ public boolean onDoubleTapEvent(MotionEvent e) {
+ if(doubleTapListener != null) {
+ return doubleTapListener.onDoubleTapEvent(e);
+ }
+ return false;
+ }
+ }
+
+ public interface OnTouchImageViewListener {
+ public void onMove();
+ }
+
+ /**
+ * Responsible for all touch events. Handles the heavy lifting of drag and also sends
+ * touch events to Scale Detector and Gesture Detector.
+ * @author Ortiz
+ *
+ */
+ private class PrivateOnTouchListener implements OnTouchListener {
+
+ //
+ // Remember last point position for dragging
+ //
+ private PointF last = new PointF();
+
+ @Override
+ public boolean onTouch(View v, MotionEvent event) {
+ mScaleDetector.onTouchEvent(event);
+ mGestureDetector.onTouchEvent(event);
+ PointF curr = new PointF(event.getX(), event.getY());
+
+ if (state == State.NONE || state == State.DRAG || state == State.FLING) {
+ switch (event.getAction()) {
+ case MotionEvent.ACTION_DOWN:
+ last.set(curr);
+ if (fling != null)
+ fling.cancelFling();
+ setState(State.DRAG);
+ break;
+
+ case MotionEvent.ACTION_MOVE:
+ if (state == State.DRAG) {
+ float deltaX = curr.x - last.x;
+ float deltaY = curr.y - last.y;
+ float fixTransX = getFixDragTrans(deltaX, viewWidth, getImageWidth());
+ float fixTransY = getFixDragTrans(deltaY, viewHeight, getImageHeight());
+ matrix.postTranslate(fixTransX, fixTransY);
+ fixTrans();
+ last.set(curr.x, curr.y);
+ }
+ break;
+
+ case MotionEvent.ACTION_UP:
+ case MotionEvent.ACTION_POINTER_UP:
+ setState(State.NONE);
+ break;
+ }
+ }
+
+ setImageMatrix(matrix);
+
+ //
+ // User-defined OnTouchListener
+ //
+ if(userTouchListener != null) {
+ userTouchListener.onTouch(v, event);
+ }
+
+ //
+ // OnTouchImageViewListener is set: TouchImageView dragged by user.
+ //
+ if (touchImageViewListener != null) {
+ touchImageViewListener.onMove();
+ }
+
+ //
+ // indicate event was handled
+ //
+ return true;
+ }
+ }
+
+ /**
+ * ScaleListener detects user two finger scaling and scales image.
+ * @author Ortiz
+ *
+ */
+ private class ScaleListener extends ScaleGestureDetector.SimpleOnScaleGestureListener {
+ @Override
+ public boolean onScaleBegin(ScaleGestureDetector detector) {
+ setState(State.ZOOM);
+ return true;
+ }
+
+ @Override
+ public boolean onScale(ScaleGestureDetector detector) {
+ scaleImage(detector.getScaleFactor(), detector.getFocusX(), detector.getFocusY(), true);
+
+ //
+ // OnTouchImageViewListener is set: TouchImageView pinch zoomed by user.
+ //
+ if (touchImageViewListener != null) {
+ touchImageViewListener.onMove();
+ }
+ return true;
+ }
+
+ @Override
+ public void onScaleEnd(ScaleGestureDetector detector) {
+ super.onScaleEnd(detector);
+ setState(State.NONE);
+ boolean animateToZoomBoundary = false;
+ float targetZoom = normalizedScale;
+ if (normalizedScale > maxScale) {
+ targetZoom = maxScale;
+ animateToZoomBoundary = true;
+
+ } else if (normalizedScale < minScale) {
+ targetZoom = minScale;
+ animateToZoomBoundary = true;
+ }
+
+ if (animateToZoomBoundary) {
+ DoubleTapZoom doubleTap = new DoubleTapZoom(targetZoom, viewWidth / 2, viewHeight / 2, true);
+ compatPostOnAnimation(doubleTap);
+ }
+ }
+ }
+
+ private void scaleImage(double deltaScale, float focusX, float focusY, boolean stretchImageToSuper) {
+
+ float lowerScale, upperScale;
+ if (stretchImageToSuper) {
+ lowerScale = superMinScale;
+ upperScale = superMaxScale;
+
+ } else {
+ lowerScale = minScale;
+ upperScale = maxScale;
+ }
+
+ float origScale = normalizedScale;
+ normalizedScale *= deltaScale;
+ if (normalizedScale > upperScale) {
+ normalizedScale = upperScale;
+ deltaScale = upperScale / origScale;
+ } else if (normalizedScale < lowerScale) {
+ normalizedScale = lowerScale;
+ deltaScale = lowerScale / origScale;
+ }
+
+ matrix.postScale((float) deltaScale, (float) deltaScale, focusX, focusY);
+ fixScaleTrans();
+ }
+
+ /**
+ * DoubleTapZoom calls a series of runnables which apply
+ * an animated zoom in/out graphic to the image.
+ * @author Ortiz
+ *
+ */
+ private class DoubleTapZoom implements Runnable {
+
+ private long startTime;
+ private static final float ZOOM_TIME = 500;
+ private float startZoom, targetZoom;
+ private float bitmapX, bitmapY;
+ private boolean stretchImageToSuper;
+ private AccelerateDecelerateInterpolator interpolator = new AccelerateDecelerateInterpolator();
+ private PointF startTouch;
+ private PointF endTouch;
+
+ DoubleTapZoom(float targetZoom, float focusX, float focusY, boolean stretchImageToSuper) {
+ setState(State.ANIMATE_ZOOM);
+ startTime = System.currentTimeMillis();
+ this.startZoom = normalizedScale;
+ this.targetZoom = targetZoom;
+ this.stretchImageToSuper = stretchImageToSuper;
+ PointF bitmapPoint = transformCoordTouchToBitmap(focusX, focusY, false);
+ this.bitmapX = bitmapPoint.x;
+ this.bitmapY = bitmapPoint.y;
+
+ //
+ // Used for translating image during scaling
+ //
+ startTouch = transformCoordBitmapToTouch(bitmapX, bitmapY);
+ endTouch = new PointF(viewWidth / 2, viewHeight / 2);
+ }
+
+ @Override
+ public void run() {
+ float t = interpolate();
+ double deltaScale = calculateDeltaScale(t);
+ scaleImage(deltaScale, bitmapX, bitmapY, stretchImageToSuper);
+ translateImageToCenterTouchPosition(t);
+ fixScaleTrans();
+ setImageMatrix(matrix);
+
+ //
+ // OnTouchImageViewListener is set: double tap runnable updates listener
+ // with every frame.
+ //
+ if (touchImageViewListener != null) {
+ touchImageViewListener.onMove();
+ }
+
+ if (t < 1f) {
+ //
+ // We haven't finished zooming
+ //
+ compatPostOnAnimation(this);
+
+ } else {
+ //
+ // Finished zooming
+ //
+ setState(State.NONE);
+ }
+ }
+
+ /**
+ * Interpolate between where the image should start and end in order to translate
+ * the image so that the point that is touched is what ends up centered at the end
+ * of the zoom.
+ * @param t
+ */
+ private void translateImageToCenterTouchPosition(float t) {
+ float targetX = startTouch.x + t * (endTouch.x - startTouch.x);
+ float targetY = startTouch.y + t * (endTouch.y - startTouch.y);
+ PointF curr = transformCoordBitmapToTouch(bitmapX, bitmapY);
+ matrix.postTranslate(targetX - curr.x, targetY - curr.y);
+ }
+
+ /**
+ * Use interpolator to get t
+ * @return
+ */
+ private float interpolate() {
+ long currTime = System.currentTimeMillis();
+ float elapsed = (currTime - startTime) / ZOOM_TIME;
+ elapsed = Math.min(1f, elapsed);
+ return interpolator.getInterpolation(elapsed);
+ }
+
+ /**
+ * Interpolate the current targeted zoom and get the delta
+ * from the current zoom.
+ * @param t
+ * @return
+ */
+ private double calculateDeltaScale(float t) {
+ double zoom = startZoom + t * (targetZoom - startZoom);
+ return zoom / normalizedScale;
+ }
+ }
+
+ /**
+ * This function will transform the coordinates in the touch event to the coordinate
+ * system of the drawable that the imageview contain
+ * @param x x-coordinate of touch event
+ * @param y y-coordinate of touch event
+ * @param clipToBitmap Touch event may occur within view, but outside image content. True, to clip return value
+ * to the bounds of the bitmap size.
+ * @return Coordinates of the point touched, in the coordinate system of the original drawable.
+ */
+ private PointF transformCoordTouchToBitmap(float x, float y, boolean clipToBitmap) {
+ matrix.getValues(m);
+ float origW = getDrawable().getIntrinsicWidth();
+ float origH = getDrawable().getIntrinsicHeight();
+ float transX = m[Matrix.MTRANS_X];
+ float transY = m[Matrix.MTRANS_Y];
+ float finalX = ((x - transX) * origW) / getImageWidth();
+ float finalY = ((y - transY) * origH) / getImageHeight();
+
+ if (clipToBitmap) {
+ finalX = Math.min(Math.max(finalX, 0), origW);
+ finalY = Math.min(Math.max(finalY, 0), origH);
+ }
+
+ return new PointF(finalX , finalY);
+ }
+
+ /**
+ * Inverse of transformCoordTouchToBitmap. This function will transform the coordinates in the
+ * drawable's coordinate system to the view's coordinate system.
+ * @param bx x-coordinate in original bitmap coordinate system
+ * @param by y-coordinate in original bitmap coordinate system
+ * @return Coordinates of the point in the view's coordinate system.
+ */
+ private PointF transformCoordBitmapToTouch(float bx, float by) {
+ matrix.getValues(m);
+ float origW = getDrawable().getIntrinsicWidth();
+ float origH = getDrawable().getIntrinsicHeight();
+ float px = bx / origW;
+ float py = by / origH;
+ float finalX = m[Matrix.MTRANS_X] + getImageWidth() * px;
+ float finalY = m[Matrix.MTRANS_Y] + getImageHeight() * py;
+ return new PointF(finalX , finalY);
+ }
+
+ /**
+ * Fling launches sequential runnables which apply
+ * the fling graphic to the image. The values for the translation
+ * are interpolated by the Scroller.
+ * @author Ortiz
+ *
+ */
+ private class Fling implements Runnable {
+
+ CompatScroller scroller;
+ int currX, currY;
+
+ Fling(int velocityX, int velocityY) {
+ setState(State.FLING);
+ scroller = new CompatScroller(context);
+ matrix.getValues(m);
+
+ int startX = (int) m[Matrix.MTRANS_X];
+ int startY = (int) m[Matrix.MTRANS_Y];
+ int minX, maxX, minY, maxY;
+
+ if (getImageWidth() > viewWidth) {
+ minX = viewWidth - (int) getImageWidth();
+ maxX = 0;
+
+ } else {
+ minX = maxX = startX;
+ }
+
+ if (getImageHeight() > viewHeight) {
+ minY = viewHeight - (int) getImageHeight();
+ maxY = 0;
+
+ } else {
+ minY = maxY = startY;
+ }
+
+ scroller.fling(startX, startY, (int) velocityX, (int) velocityY, minX,
+ maxX, minY, maxY);
+ currX = startX;
+ currY = startY;
+ }
+
+ public void cancelFling() {
+ if (scroller != null) {
+ setState(State.NONE);
+ scroller.forceFinished(true);
+ }
+ }
+
+ @Override
+ public void run() {
+
+ //
+ // OnTouchImageViewListener is set: TouchImageView listener has been flung by user.
+ // Listener runnable updated with each frame of fling animation.
+ //
+ if (touchImageViewListener != null) {
+ touchImageViewListener.onMove();
+ }
+
+ if (scroller.isFinished()) {
+ scroller = null;
+ return;
+ }
+
+ if (scroller.computeScrollOffset()) {
+ int newX = scroller.getCurrX();
+ int newY = scroller.getCurrY();
+ int transX = newX - currX;
+ int transY = newY - currY;
+ currX = newX;
+ currY = newY;
+ matrix.postTranslate(transX, transY);
+ fixTrans();
+ setImageMatrix(matrix);
+ compatPostOnAnimation(this);
+ }
+ }
+ }
+
+ @TargetApi(Build.VERSION_CODES.GINGERBREAD)
+ private class CompatScroller {
+ Scroller scroller;
+ OverScroller overScroller;
+ boolean isPreGingerbread;
+
+ public CompatScroller(Context context) {
+ if (VERSION.SDK_INT < VERSION_CODES.GINGERBREAD) {
+ isPreGingerbread = true;
+ scroller = new Scroller(context);
+
+ } else {
+ isPreGingerbread = false;
+ overScroller = new OverScroller(context);
+ }
+ }
+
+ public void fling(int startX, int startY, int velocityX, int velocityY, int minX, int maxX, int minY, int maxY) {
+ if (isPreGingerbread) {
+ scroller.fling(startX, startY, velocityX, velocityY, minX, maxX, minY, maxY);
+ } else {
+ overScroller.fling(startX, startY, velocityX, velocityY, minX, maxX, minY, maxY);
+ }
+ }
+
+ public void forceFinished(boolean finished) {
+ if (isPreGingerbread) {
+ scroller.forceFinished(finished);
+ } else {
+ overScroller.forceFinished(finished);
+ }
+ }
+
+ public boolean isFinished() {
+ if (isPreGingerbread) {
+ return scroller.isFinished();
+ } else {
+ return overScroller.isFinished();
+ }
+ }
+
+ public boolean computeScrollOffset() {
+ if (isPreGingerbread) {
+ return scroller.computeScrollOffset();
+ } else {
+ overScroller.computeScrollOffset();
+ return overScroller.computeScrollOffset();
+ }
+ }
+
+ public int getCurrX() {
+ if (isPreGingerbread) {
+ return scroller.getCurrX();
+ } else {
+ return overScroller.getCurrX();
+ }
+ }
+
+ public int getCurrY() {
+ if (isPreGingerbread) {
+ return scroller.getCurrY();
+ } else {
+ return overScroller.getCurrY();
+ }
+ }
+ }
+
+ @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
+ private void compatPostOnAnimation(Runnable runnable) {
+ if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) {
+ postOnAnimation(runnable);
+
+ } else {
+ postDelayed(runnable, 1000/60);
+ }
+ }
+
+ private class ZoomVariables {
+ public float scale;
+ public float focusX;
+ public float focusY;
+ public ScaleType scaleType;
+
+ public ZoomVariables(float scale, float focusX, float focusY, ScaleType scaleType) {
+ this.scale = scale;
+ this.focusX = focusX;
+ this.focusY = focusY;
+ this.scaleType = scaleType;
+ }
+ }
+
+ private void printMatrixInfo() {
+ float[] n = new float[9];
+ matrix.getValues(n);
+ Log.d(DEBUG, "Scale: " + n[Matrix.MSCALE_X] + " TransX: " + n[Matrix.MTRANS_X] + " TransY: " + n[Matrix.MTRANS_Y]);
+ }
+}
\ No newline at end of file
--- /dev/null
+/*\r
+ * The Alphanum Algorithm is an improved sorting algorithm for strings\r
+ * containing numbers. Instead of sorting numbers in ASCII order like\r
+ * a standard sort, this algorithm sorts numbers in numeric order.\r
+ *\r
+ * The Alphanum Algorithm is discussed at http://www.DaveKoelle.com\r
+ *\r
+ *\r
+ * This library is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU Lesser General Public\r
+ * License as published by the Free Software Foundation; either\r
+ * version 2.1 of the License, or any later version.\r
+ *\r
+ * This library is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+ * Lesser General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU Lesser General Public\r
+ * License along with this library; if not, write to the Free Software\r
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\r
+ *\r
+ */\r
+\r
+package third_parties.daveKoeller;\r
+import java.util.Comparator;\r
+\r
+import com.owncloud.android.datamodel.OCFile;\r
+\r
+/**\r
+ * This is an updated version with enhancements made by Daniel Migowski,\r
+ * Andre Bogus, and David Koelle\r
+ *\r
+ * To convert to use Templates (Java 1.5+):\r
+ * - Change "implements Comparator" to "implements Comparator<String>"\r
+ * - Change "compare(Object o1, Object o2)" to "compare(String s1, String s2)"\r
+ * - Remove the type checking and casting in compare().\r
+ *\r
+ * To use this class:\r
+ * Use the static "sort" method from the java.util.Collections class:\r
+ * Collections.sort(your list, new AlphanumComparator());\r
+ */\r
+public class AlphanumComparator implements Comparator<OCFile>\r
+{\r
+ private final boolean isDigit(char ch)\r
+ {\r
+ return ch >= 48 && ch <= 57;\r
+ }\r
+\r
+ /** Length of string is passed in for improved efficiency (only need to calculate it once) **/\r
+ private final String getChunk(String s, int slength, int marker)\r
+ {\r
+ StringBuilder chunk = new StringBuilder();\r
+ char c = s.charAt(marker);\r
+ chunk.append(c);\r
+ marker++;\r
+ if (isDigit(c))\r
+ {\r
+ while (marker < slength)\r
+ {\r
+ c = s.charAt(marker);\r
+ if (!isDigit(c))\r
+ break;\r
+ chunk.append(c);\r
+ marker++;\r
+ }\r
+ } else\r
+ {\r
+ while (marker < slength)\r
+ {\r
+ c = s.charAt(marker);\r
+ if (isDigit(c))\r
+ break;\r
+ chunk.append(c);\r
+ marker++;\r
+ }\r
+ }\r
+ return chunk.toString();\r
+ }\r
+\r
+ public int compare(OCFile o1, OCFile o2)\r
+ {\r
+ String s1 = (String)o1.getRemotePath().toLowerCase();\r
+ String s2 = (String)o2.getRemotePath().toLowerCase();\r
+\r
+ int thisMarker = 0;\r
+ int thatMarker = 0;\r
+ int s1Length = s1.length();\r
+ int s2Length = s2.length();\r
+\r
+ while (thisMarker < s1Length && thatMarker < s2Length)\r
+ {\r
+ String thisChunk = getChunk(s1, s1Length, thisMarker);\r
+ thisMarker += thisChunk.length();\r
+\r
+ String thatChunk = getChunk(s2, s2Length, thatMarker);\r
+ thatMarker += thatChunk.length();\r
+\r
+ // If both chunks contain numeric characters, sort them numerically\r
+ int result = 0;\r
+ if (isDigit(thisChunk.charAt(0)) && isDigit(thatChunk.charAt(0)))\r
+ {\r
+ // Simple chunk comparison by length.\r
+ int thisChunkLength = thisChunk.length();\r
+ result = thisChunkLength - thatChunk.length();\r
+ // If equal, the first different number counts\r
+ if (result == 0)\r
+ {\r
+ for (int i = 0; i < thisChunkLength; i++)\r
+ {\r
+ result = thisChunk.charAt(i) - thatChunk.charAt(i);\r
+ if (result != 0)\r
+ {\r
+ return result;\r
+ }\r
+ }\r
+ }\r
+ } else\r
+ {\r
+ result = thisChunk.compareTo(thatChunk);\r
+ }\r
+\r
+ if (result != 0)\r
+ return result;\r
+ }\r
+\r
+ return s1Length - s2Length;\r
+ }\r
+}\r
--- /dev/null
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+\f
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+\f
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+\f
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+\f
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+\f
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+\f
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+\f
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+\f
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+\f
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!