From 9a9b204ed535d68df0b7951736e93739897f6b64 Mon Sep 17 00:00:00 2001 From: davigonz Date: Tue, 7 Nov 2017 13:54:00 +0100 Subject: [PATCH] Update pictures/videos timestamps and refactor code --- res/values-af-rZA/strings.xml | 2 +- res/values-bg-rBG/strings.xml | 2 +- res/values-cs-rCZ/strings.xml | 2 +- res/values-da/strings.xml | 2 +- res/values-de-rDE/strings.xml | 2 +- res/values-de/strings.xml | 2 +- res/values-el/strings.xml | 2 +- res/values-en-rGB/strings.xml | 2 +- res/values-eo/strings.xml | 2 +- res/values-es-rMX/strings.xml | 2 +- res/values-es/strings.xml | 2 +- res/values-fa/strings.xml | 2 +- res/values-fi-rFI/strings.xml | 2 +- res/values-fr/strings.xml | 2 +- res/values-he/strings.xml | 2 +- res/values-is/strings.xml | 2 +- res/values-it/strings.xml | 2 +- res/values-ja-rJP/strings.xml | 2 +- res/values-ko/strings.xml | 2 +- res/values-lb/strings.xml | 2 +- res/values-nb-rNO/strings.xml | 2 +- res/values-nl/strings.xml | 2 +- res/values-nn-rNO/strings.xml | 2 +- res/values-pa/strings.xml | 2 +- res/values-pl/strings.xml | 2 +- res/values-pt-rBR/strings.xml | 2 +- res/values-pt-rPT/strings.xml | 2 +- res/values-ro/strings.xml | 2 +- res/values-ru/strings.xml | 2 +- res/values-sl/strings.xml | 2 +- res/values-sq/strings.xml | 2 +- res/values-sr/strings.xml | 2 +- res/values-sv/strings.xml | 2 +- res/values-th-rTH/strings.xml | 2 +- res/values-tr/strings.xml | 2 +- res/values-uk/strings.xml | 2 +- res/values-zh-rCN/strings.xml | 2 +- res/values-zh-rTW/strings.xml | 2 +- res/values/strings.xml | 2 +- res/xml/preferences.xml | 2 +- .../android/db/PreferenceManager.java | 40 +++--- .../services/SyncCameraFolderJobService.java | 115 +++++++++++++----- .../ui/activity/FileDisplayActivity.java | 4 +- .../android/ui/activity/Preferences.java | 70 +++++------ 44 files changed, 179 insertions(+), 130 deletions(-) diff --git a/res/values-af-rZA/strings.xml b/res/values-af-rZA/strings.xml index 99885fdc335..acc440ddb17 100644 --- a/res/values-af-rZA/strings.xml +++ b/res/values-af-rZA/strings.xml @@ -78,7 +78,7 @@ Details Land: Ligging: - Oplaaipad + Oplaaipad Voer ’n wagwoord in U moet ’n wagwoord invoer Stuur diff --git a/res/values-bg-rBG/strings.xml b/res/values-bg-rBG/strings.xml index 3dff882c0e9..7f4b5eb264a 100644 --- a/res/values-bg-rBG/strings.xml +++ b/res/values-bg-rBG/strings.xml @@ -294,7 +294,7 @@ Преглед на изображението Изображението не може да бъде показано %1$s не може да бъде копиран в локалната папка %2$s - Път за качване + Път за качване За съжаление споделянето не е включено на сървъра ви. Моля, свържете се с администратора. Неуспешен опит за споделяне. Моля, провери дали файла съществува. diff --git a/res/values-cs-rCZ/strings.xml b/res/values-cs-rCZ/strings.xml index 058ea38a46f..26198720443 100644 --- a/res/values-cs-rCZ/strings.xml +++ b/res/values-cs-rCZ/strings.xml @@ -303,7 +303,7 @@ Náhled obrázku Obrázek nelze zobrazit %1$s nelze zkopírovat do místního adresáře %2$s - Cesta pro nahrání + Cesta pro nahrání Je nám líto, ale sdílení není na vašem serveru povoleno. Kontaktujte svého správce systému. Nelze sdílet. Zkontrolujte prosím že soubor existuje diff --git a/res/values-da/strings.xml b/res/values-da/strings.xml index b47ee86ded0..cb630fb87d6 100644 --- a/res/values-da/strings.xml +++ b/res/values-da/strings.xml @@ -302,7 +302,7 @@ Forhåndsvisning af billede Dette billede kan ikke vises %1$s kunne ikke kopieres til %2$s lokale mappe - Sti til upload + Sti til upload Beklager, deling er ikke slået til på din server. Kontakt venligst din ⇥⇥administrator. Kan ikke dele. Tjek venligst om filen findes. diff --git a/res/values-de-rDE/strings.xml b/res/values-de-rDE/strings.xml index b9354b32137..687371dca7f 100644 --- a/res/values-de-rDE/strings.xml +++ b/res/values-de-rDE/strings.xml @@ -304,7 +304,7 @@ Bildvorschau Dieses Bild kann nicht angezeigt werden %1$s konnte nicht in den lokalen %2$s Ordner kopiert werden - Upload Pfad + Upload Pfad Entschuldigung, Freigaben sind auf Ihrem Server nicht aktiviert. Bitte kontaktieren Sie Ihren ⇥⇥Administrator. Teilen nicht möglich. Prüfen Sie, ob die Datei existiert diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml index 446f76d0732..8ef22e7dab2 100644 --- a/res/values-de/strings.xml +++ b/res/values-de/strings.xml @@ -304,7 +304,7 @@ Bildvorschau Dieses Bild kann nicht angezeigt werden %1$s konnte nicht in den lokalen %2$s Ordner kopiert werden - Speicherpfad + Speicherpfad Entschuldigung, Freigaben sind auf Deinem Server nicht aktiviert. Bitte kontaktiere Deinen ⇥⇥Administrator. Teilen nicht möglich. Prüfe, dass die Datei existiert diff --git a/res/values-el/strings.xml b/res/values-el/strings.xml index f6ad988a23c..35bcca9273a 100644 --- a/res/values-el/strings.xml +++ b/res/values-el/strings.xml @@ -304,7 +304,7 @@ Προεπισκόπηση εικόνας Αυτή η εικόνα δεν μπορεί να προβληθεί Το %1$s δεν μπόρεσε να αντιγραφεί στον τοπικό φάκελο %2$s - Διαδρομή μεταφόρτωσης + Διαδρομή μεταφόρτωσης Λυπούμαστε, ο διαμοιρασμός δεν επιτρέπεται στο διακομιστή σας. Παρακαλούμε επικοινωνείστε με το διαχειριστή σας. Αδύνατη η κοινή χρήση. Παρακαλώ ελέγξτε αν ο φάκελος υπάρχει diff --git a/res/values-en-rGB/strings.xml b/res/values-en-rGB/strings.xml index 003cb4c43cb..10b9e19d019 100644 --- a/res/values-en-rGB/strings.xml +++ b/res/values-en-rGB/strings.xml @@ -290,7 +290,7 @@ Image preview This image cannot be shown %1$s could not be copied to %2$s local folder - Upload path + Upload path Sorry, sharing is not enabled on your server. Please contact your administrator. Unable to share. Please check whether the file exists diff --git a/res/values-eo/strings.xml b/res/values-eo/strings.xml index d115ec4e38a..b69c0b495b8 100644 --- a/res/values-eo/strings.xml +++ b/res/values-eo/strings.xml @@ -192,7 +192,7 @@ Antaŭvido de bildo Ĉi tiu bildo ne povas montriĝi %1$s ne povis kopiiĝi al la loka dosierujo %2$s - Alŝutovojo + Alŝutovojo Enigu pasvorton Vi devas enigi pasvorton Sendi diff --git a/res/values-es-rMX/strings.xml b/res/values-es-rMX/strings.xml index a37c85ff084..46ca055a07f 100644 --- a/res/values-es-rMX/strings.xml +++ b/res/values-es-rMX/strings.xml @@ -304,7 +304,7 @@ Previsualización de imagen No se puede mostrar la imagen %1$s se pudo copiar a la carpeta local %2$s - Ruta de subida + Ruta de subida La función Compartir no está activada en su servidor. Contacte a su administrador. No se puede compartir. Revise si el archivo existe diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml index d73e1738d3e..5fd012de0b7 100644 --- a/res/values-es/strings.xml +++ b/res/values-es/strings.xml @@ -304,7 +304,7 @@ Previsualización de imagen No se puede mostrar la imagen %1$s se pudo copiar a la carpeta local %2$s - Ruta de subida + Ruta de subida La función Compartir no está activada en su servidor. Contacte a su administrador. No se puede compartir. Revise si el archivo existe diff --git a/res/values-fa/strings.xml b/res/values-fa/strings.xml index d6289e7beb5..253211fa9aa 100644 --- a/res/values-fa/strings.xml +++ b/res/values-fa/strings.xml @@ -303,7 +303,7 @@ پیش نمایش تصویر نمایش این عکس امکانپذیر نمی باشد کپی %1$s به پوشه محلی %2$s امکان پذیر نیست - مسیر بارگذاری + مسیر بارگذاری در حین اشتراک گذاری این فایل یا پوشه خطایی رخ داده است در حین حذف اشتراک گذاری این فایل یا پوشه خطایی رخ داده است یک رمزعبور را وارد کنید diff --git a/res/values-fi-rFI/strings.xml b/res/values-fi-rFI/strings.xml index e2f1e6bc9ca..fbdbb4b70e4 100644 --- a/res/values-fi-rFI/strings.xml +++ b/res/values-fi-rFI/strings.xml @@ -284,7 +284,7 @@ palvelimen versio Kuvan esikatselu Tätä kuvaa ei voi näyttää - Lähetyspolku + Lähetyspolku Jakaminen ei ole käytössä palvelimellasi. Ota yhteys ylläpitäjään. Jakaminen epäonnistui. Varmista, että tiedosto on olemassa diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml index 55739ff3e31..11be6d75583 100644 --- a/res/values-fr/strings.xml +++ b/res/values-fr/strings.xml @@ -309,7 +309,7 @@ Ci-dessous la liste des fichiers locaux, et les fichiers distants dans %5$s auxq Prévisualisation de l\'image Cette image ne peut pas être affichée %1$s n\'a pas pu être copié dans le dossier local %2$s - Chemin du dossier de téléversement + Chemin du dossier de téléversement Désolé, le partage n\'est pas disponible sur votre serveur. Veuillez contacter votre administrateur. Impossible de partager. Vérifiez que le fichier est bien présent Une erreur est survenue lors de la tentative de partage de ce fichier ou répertoire diff --git a/res/values-he/strings.xml b/res/values-he/strings.xml index 2e648b141ee..8889831227a 100644 --- a/res/values-he/strings.xml +++ b/res/values-he/strings.xml @@ -304,7 +304,7 @@ תצוגה מקדימה לתמונה תמונה זו לא ניתנת לצפייה %1$s לא ניתן להעתקה לתיקייה מקומית %2$s - נתיב העלאה + נתיב העלאה מצטערים, שיתוף אינו מורשה על השרת שלך. יש ליצור קשר עם ⇥⇥מנהל. לא ניתן לשתף. יש לבדוק אם הקובץ קיים diff --git a/res/values-is/strings.xml b/res/values-is/strings.xml index 65b11e5f1f5..74e90918103 100644 --- a/res/values-is/strings.xml +++ b/res/values-is/strings.xml @@ -302,7 +302,7 @@ Forskoðun myndar Ekki er hægt að birta myndina %1$s var ekki hægt að afrita í staðværu %2$s möppuna - Innsendingarslóð + Innsendingarslóð Því miður, deiling gagna er ekki virk á þjóninum. Hafðu samband við kerfisstjóra. Get ekki deilt. Athugaðu hvort skráin sé til diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml index 2fd9de8b253..a9a9e9243b0 100644 --- a/res/values-it/strings.xml +++ b/res/values-it/strings.xml @@ -304,7 +304,7 @@ Anteprima dell\'immagine Questa immagine non può essere mostrata %1$s non può essere copiato nella cartella locale %2$s - Percorso di caricamento + Percorso di caricamento Spiacenti, la condivisione non è abilitata sul tuo server. Contatta il tuo amministratore. Impossibile condividere. Assicurati che il file esista diff --git a/res/values-ja-rJP/strings.xml b/res/values-ja-rJP/strings.xml index 3712d98ab53..3c7b263bd78 100644 --- a/res/values-ja-rJP/strings.xml +++ b/res/values-ja-rJP/strings.xml @@ -303,7 +303,7 @@ イメージプレビュー この画像は表示できません %1$s は、ローカルフォルダー %2$s にコピーできませんでした。 - アップロードパス + アップロードパス すみませんが、サーバーで共有が有効になっていません。 管理者に問い合わせてください。 共有できません。ファイルがあるか確認してください。 diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml index 49efcf1df3c..6fad94e68ab 100644 --- a/res/values-ko/strings.xml +++ b/res/values-ko/strings.xml @@ -303,7 +303,7 @@ 사진 미리 보기 이 사진을 미리 볼 수 없습니다 %1$s을(를) 로컬 폴더 %2$s(으)로 복사할 수 없습니다 - 업로드 경로 + 업로드 경로 서버에서 공유가 비활성화되어 있습니다. 관리자에게 연락하십시오. 공유할 수 없습니다. 파일이 있는지 확인하십시오 이 파일이나 폴더를 공유하는 중 오류 발생 diff --git a/res/values-lb/strings.xml b/res/values-lb/strings.xml index 36f01532c87..d0802b223b6 100644 --- a/res/values-lb/strings.xml +++ b/res/values-lb/strings.xml @@ -270,7 +270,7 @@ Biller-Virschau Dëst Bild kann net ugewise ginn %1$s konnt net an de lokalen Dossier %2$s kopéiert ginn - Pad eroplueden + Pad eroplueden Pardon, Deelen ass net erlaabt op ärem Server. W.e.g. kontaktéier däin Administrateur. Konnt net gedeelt ginn. Kontrolléier w.e.g. ob de Fichier existéiert Beim Deele vun dësem Fichier oder Dossier ass e Feeler opgetrueden diff --git a/res/values-nb-rNO/strings.xml b/res/values-nb-rNO/strings.xml index 0f3acb1253d..f2de9cc384d 100644 --- a/res/values-nb-rNO/strings.xml +++ b/res/values-nb-rNO/strings.xml @@ -304,7 +304,7 @@ Bildeforhåndsvisning Dette bildet kan ikke vises %1$s kunne ikke kopieres til lokal mappe %2$s - Opplastings-sti + Opplastings-sti Beklager, deling er ikke skrudd på for din tjener. Ta kontakt med administratoren. Kan ikke dele. Sjekk om filen eksisterer. diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml index 6a67919f731..866a8e7bbfb 100644 --- a/res/values-nl/strings.xml +++ b/res/values-nl/strings.xml @@ -306,7 +306,7 @@ Hieronder staan de lokale bestanden en de externe bestanden in %5$s waar ze naar Afbeelding voorbeeld Deze afbeelding kan niet worden getoond %1$s kon niet worden gekopieerd naar de %2$s lokale map - Upload pad + Upload pad Sorry, delen is niet mogelijk op uw server. Neem contact op met uw beheerder. Kan dit niet delen. Controleer of dit bestand wel bestaat. diff --git a/res/values-nn-rNO/strings.xml b/res/values-nn-rNO/strings.xml index 897061c86db..75ddd203003 100644 --- a/res/values-nn-rNO/strings.xml +++ b/res/values-nn-rNO/strings.xml @@ -250,7 +250,7 @@ Førehandsvisning av bilde Dette bilete kan ikkje bli vist %1$s kan ikke bli kopiert til lokal katalog %2$s - Sti for opplasting + Sti for opplasting Send Tenaren brukte for lang tid på å svara Kontoar diff --git a/res/values-pa/strings.xml b/res/values-pa/strings.xml index 34cba358bcd..91d8a27b41c 100644 --- a/res/values-pa/strings.xml +++ b/res/values-pa/strings.xml @@ -159,7 +159,7 @@ ਫਾਈਲ ਅਪਵਾਦ ਦੋਵੇਂ ਰੱਖੋ ਚਿੱਤਰ ਝਲਕ - ਅੱਪਲੋਡ ਮਾਰਗ + ਅੱਪਲੋਡ ਮਾਰਗ ਇੱਕ ਪਾਸਵਰਡ ਭਰੋ ਤੁਹਾਨੂੰ ਇੱਕ ਪਾਸਵਰਡ ਦੇਣਾ ਪਵੇਗਾ ਭੇਜੋ diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml index 2ef11e0a390..e3fc0362557 100644 --- a/res/values-pl/strings.xml +++ b/res/values-pl/strings.xml @@ -304,7 +304,7 @@ Podgląd Ten obrazek nie może zostać wyświetlony %1$s nie może zostać skopiowany do lokalnego folderu %2$s - Ścieżka wysyłania + Ścieżka wysyłania Przepraszamy, ale współdzielenie nie jest włączone na Twoim serwerze. Proszę skontaktuj się z administratorem. Nie można udostępnić. Proszę sprawdzić, czy plik istnieje diff --git a/res/values-pt-rBR/strings.xml b/res/values-pt-rBR/strings.xml index aec202954f9..af7f6eb8058 100644 --- a/res/values-pt-rBR/strings.xml +++ b/res/values-pt-rBR/strings.xml @@ -304,7 +304,7 @@ Pré-visualização da imagem Esta imagem não pode ser mostrada %1$s não pôde ser copiado para pasta local %2$s - Caminho para envio + Caminho para envio Desculpe, o compartilhamento não está habilitado em seu servidor. Entre em contato com seu ⇥⇥ administrador. Não é possível compartilhar. Por favor verifique se o arquivo existe diff --git a/res/values-pt-rPT/strings.xml b/res/values-pt-rPT/strings.xml index d113d83ad2f..9a4d297c21b 100644 --- a/res/values-pt-rPT/strings.xml +++ b/res/values-pt-rPT/strings.xml @@ -302,7 +302,7 @@ Pré-Visualizar imagem Esta imagem não pode ser mostrada Não foi possível copiar %1$s para a pasta local %2$s - Caminho de envio + Caminho de envio Lamentamos mas não é possível partilhar através do seu servidor. Por favor contacte o seu administrador. Não é possível partilhar. Por favor verifique se o ficheiro existe Ocorreu um erro enquanto tentava partilhar este ficheiro ou pasta diff --git a/res/values-ro/strings.xml b/res/values-ro/strings.xml index a1dc228a78f..8cebded22e9 100644 --- a/res/values-ro/strings.xml +++ b/res/values-ro/strings.xml @@ -303,7 +303,7 @@ Previzualizare imagine Aceasta imagine nu poate fi arătată %1$s nu a putut fi copiat in dosarul local %2$s - Calea de încărcare + Calea de încărcare Ne pare rău, partajarea nu este activată pe server. Vă rugăm să contactați administratorul dvs. Imposibil de partajat. Te rugăm să verifici dacă există fișierul. A apărut o eroare în timp ce încerca să partajeze acest fișier sau folder diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml index 92adcc8278c..e0144615266 100644 --- a/res/values-ru/strings.xml +++ b/res/values-ru/strings.xml @@ -305,7 +305,7 @@ Предпросмотр Это изображение не может быть отображено %1$s невозможно скопировать в локальный каталог %2$s - Путь загрузки + Путь загрузки Механизм общего доступа не включен на данном сервере. Пожалуйста, свяжитесь с вашим ⇥⇥администратором. Невозможно поделиться. Убедитесь, что файл существует diff --git a/res/values-sl/strings.xml b/res/values-sl/strings.xml index 02d3fce9161..a4266511ae0 100644 --- a/res/values-sl/strings.xml +++ b/res/values-sl/strings.xml @@ -304,7 +304,7 @@ Predogled slike Te slike ni mogoče prikazati Datoteke %1$s ni mogoče kopirati v krajevno mapo %2$s - Mapa za odlaganje slik v oblaku + Mapa za odlaganje slik v oblaku Souporaba je na strežniku onemogočena. Možnost lahko spreminjajo le uporabniki s skrbniškimi dovoljenji. Souporaba ni mogoča. Preverite, ali datoteka obstaja. diff --git a/res/values-sq/strings.xml b/res/values-sq/strings.xml index ad4af87ecdc..09c2c01c1e2 100644 --- a/res/values-sq/strings.xml +++ b/res/values-sq/strings.xml @@ -301,7 +301,7 @@ Paraparje figure Kjo figurë nuk mund të shfaqet %1$s s\’u kopjua dot te dosja vendore %2$s - Shteg ngarkimesh + Shteg ngarkimesh Na ndjeni, ndarja me të tjerët s\’është e aktivizuar te shërbyesi juaj. Ju lutemi, lidhuni me përgjegjësin tuaj. S\’arrihet të ndahet me të tjerët. Ju lutemi, kontrolloni nëse ekziston apo jo kartela Ndodhi një gabim teksa përpiqej të ndahej me të tjerët kjo kartelë apo dosje diff --git a/res/values-sr/strings.xml b/res/values-sr/strings.xml index 823498ca04a..a3cea2067f5 100644 --- a/res/values-sr/strings.xml +++ b/res/values-sr/strings.xml @@ -270,7 +270,7 @@ Преглед слике Слика се не може приказати %1$s се не може копирати у локалну фасциклу %2$s - Путања отпремања + Путања отпремања Дељење није укључено на вашем серверу. Контактирајте администратора. Не могу да делим. Проверите да ли фајл постоји diff --git a/res/values-sv/strings.xml b/res/values-sv/strings.xml index 93f2678560e..3d7a3e64d6f 100644 --- a/res/values-sv/strings.xml +++ b/res/values-sv/strings.xml @@ -304,7 +304,7 @@ Förhandsvisa bild Denna bild kan inte visas %1$s kunde inte kopieras till %2$s lokal mapp - Uppladdningssökväg + Uppladdningssökväg Ledsen, delning är inte aktiverat på din server. Vänligen kontakta din administratör. Lyckades ej dela. Vänligen kontrollera om filen eisterar diff --git a/res/values-th-rTH/strings.xml b/res/values-th-rTH/strings.xml index 990e7f9bfb1..ddafc932a3c 100644 --- a/res/values-th-rTH/strings.xml +++ b/res/values-th-rTH/strings.xml @@ -303,7 +303,7 @@ แสดงรูปภาพตัวอย่าง ไม่สามารถแสดงรูปภาพนี้ได้ %1$s ไม่สามารถคัดลอกไปยังโฟลเดอร์ %2$s ในเครื่อง - ตำแหน่งพาธสำหรับอัพโหลด + ตำแหน่งพาธสำหรับอัพโหลด ขออภัยการแชร์ไม่ได้เปิดใช้งานบนเซิร์ฟเวอร์ของคุณ กรุณาติดต่อผู้ดูแลระบบ ไม่สามารถแชร์ กรุณาตรวจสอบว่ายังมีไฟล์นั้นอยู่ เกิดข้อผิดพลาดในขณะที่พยายามจะแชร์ไฟล์หรือโฟลเดอร์นี้ diff --git a/res/values-tr/strings.xml b/res/values-tr/strings.xml index 95314ee38b8..94f62833d90 100644 --- a/res/values-tr/strings.xml +++ b/res/values-tr/strings.xml @@ -299,7 +299,7 @@ Resim önizleme Bu resim gösterilemiyor %1$s, %2$s yerel klasörüne kopyalanamadı - Yükleme yolu + Yükleme yolu Üzgünüz, paylaşım sunucunuzda etkin değil. Lütfen yöneticinizle iletişime geçin. Paylaşma başarısız. Lütfen dosyanın mevcut olup olmadığını denetleyin diff --git a/res/values-uk/strings.xml b/res/values-uk/strings.xml index 29e35798540..f436359884d 100644 --- a/res/values-uk/strings.xml +++ b/res/values-uk/strings.xml @@ -303,7 +303,7 @@ Попередній перегляд зображення Не вдалося показати зображення %1$s неможливо скопіювати до %2$s - Шлях завантаження + Шлях завантаження На жаль, обмін не включений на вашому сервері. Будь ласка, зв\'яжіться з вашим адмінистратором. Неможливо поділитися. Будь ласка, перевірте, чи існує файл Виникла помилка при спробі поділитися файлом або текою diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml index e60cc89207a..a5927a74098 100644 --- a/res/values-zh-rCN/strings.xml +++ b/res/values-zh-rCN/strings.xml @@ -304,7 +304,7 @@ 图片预览 无法显示图片 无法复制 %1$s 到本地目录 %2$s - 上传路径 + 上传路径 抱歉,共享功能未启用。请联系管理员。 无法共享。请检查文件是否存在 共享文件或目录出错 diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml index d219e5929ea..7cfd080f5f2 100644 --- a/res/values-zh-rTW/strings.xml +++ b/res/values-zh-rTW/strings.xml @@ -288,7 +288,7 @@ 圖片預覽 無法顯示圖片 %1$s 無法被複製到本地資料夾 %2$s - 上傳路徑 + 上傳路徑 很抱歉, 您的伺服器並未開啟分享的功能. 請聯絡您的 伺服器管理員. 在分享檔案或資料夾時發生了錯誤 diff --git a/res/values/strings.xml b/res/values/strings.xml index 92d78437da0..8262c27e180 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -318,7 +318,7 @@ This image cannot be shown %1$s could not be copied to %2$s local folder - Upload path + Upload picture path Sorry, sharing is not enabled on your server. Please contact your administrator. diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml index c9dbbd9ca08..30a7d639253 100644 --- a/res/xml/preferences.xml +++ b/res/xml/preferences.xml @@ -27,7 +27,7 @@ android:title="@string/prefs_camera_picture_upload" /> + android:title="@string/prefs_camera_picture_upload_path_title" /> diff --git a/src/com/owncloud/android/db/PreferenceManager.java b/src/com/owncloud/android/db/PreferenceManager.java index 0302e17d106..558a2b84ac1 100644 --- a/src/com/owncloud/android/db/PreferenceManager.java +++ b/src/com/owncloud/android/db/PreferenceManager.java @@ -75,49 +75,49 @@ public static CameraUploadsConfiguration getCameraUploadsConfiguration(Context c CameraUploadsConfiguration result = new CameraUploadsConfiguration(); SharedPreferences prefs = getDefaultSharedPreferences(context); result.setEnabledForPictures( - prefs.getBoolean(PREF__CAMERA_PICTURE_UPLOADS_ENABLED, false) + prefs.getBoolean(PREF__CAMERA_PICTURE_UPLOADS_ENABLED, false) ); result.setEnabledForVideos( - prefs.getBoolean(PREF__CAMERA_VIDEO_UPLOADS_ENABLED, false) + prefs.getBoolean(PREF__CAMERA_VIDEO_UPLOADS_ENABLED, false) ); result.setWifiOnlyForPictures( - prefs.getBoolean(PREF__CAMERA_PICTURE_UPLOADS_WIFI_ONLY, false) + prefs.getBoolean(PREF__CAMERA_PICTURE_UPLOADS_WIFI_ONLY, false) ); result.setWifiOnlyForVideos( - prefs.getBoolean(PREF__CAMERA_VIDEO_UPLOADS_WIFI_ONLY, false) + prefs.getBoolean(PREF__CAMERA_VIDEO_UPLOADS_WIFI_ONLY, false) ); Account currentAccount = AccountUtils.getCurrentOwnCloudAccount(context); result.setUploadAccountName( - prefs.getString( - PREF__CAMERA_UPLOADS_ACCOUNT_NAME, - (currentAccount == null) ? "" : currentAccount.name - ) + prefs.getString( + PREF__CAMERA_UPLOADS_ACCOUNT_NAME, + (currentAccount == null) ? "" : currentAccount.name + ) ); String uploadPath = prefs.getString( PREF__CAMERA_PICTURE_UPLOADS_PATH, - context.getString(R.string.camera_upload_path) + OCFile.PATH_SEPARATOR + context.getString(R.string.camera_upload_path) + OCFile.PATH_SEPARATOR ); result.setUploadPathForPictures( - uploadPath.endsWith(File.separator) ? uploadPath : uploadPath + File.separator + uploadPath.endsWith(File.separator) ? uploadPath : uploadPath + File.separator ); uploadPath = prefs.getString( PREF__CAMERA_VIDEO_UPLOADS_PATH, - context.getString(R.string.camera_upload_path) + OCFile.PATH_SEPARATOR + context.getString(R.string.camera_upload_path) + OCFile.PATH_SEPARATOR ); result.setUploadPathForVideos( - uploadPath.endsWith(File.separator) ? uploadPath : uploadPath + File.separator + uploadPath.endsWith(File.separator) ? uploadPath : uploadPath + File.separator ); result.setBehaviourAfterUpload( - prefs.getString( - PREF__CAMERA_UPLOADS_BEHAVIOUR, - context.getResources().getStringArray(R.array.pref_behaviour_entryValues)[0] - ) + prefs.getString( + PREF__CAMERA_UPLOADS_BEHAVIOUR, + context.getResources().getStringArray(R.array.pref_behaviour_entryValues)[0] + ) ); result.setSourcePath( - prefs.getString( - PREF__CAMERA_UPLOADS_SOURCE, - CameraUploadsConfiguration.DEFAULT_SOURCE_PATH - ) + prefs.getString( + PREF__CAMERA_UPLOADS_SOURCE, + CameraUploadsConfiguration.DEFAULT_SOURCE_PATH + ) ); return result; } diff --git a/src/com/owncloud/android/services/SyncCameraFolderJobService.java b/src/com/owncloud/android/services/SyncCameraFolderJobService.java index a68b6d05bff..b59e1b07fe0 100644 --- a/src/com/owncloud/android/services/SyncCameraFolderJobService.java +++ b/src/com/owncloud/android/services/SyncCameraFolderJobService.java @@ -80,6 +80,9 @@ public class SyncCameraFolderJobService extends JobService implements OnRemoteOp private CameraUploadsSyncStorageManager mCameraUploadsSyncStorageManager; private OCCameraUploadSync mOOCCameraUploadSync; + private boolean mFirstPictureEnqueued; + private boolean mFirstVideoEnqueued; + @Override public boolean onStartJob(JobParameters jobParameters) { @@ -106,6 +109,9 @@ public boolean onStartJob(JobParameters jobParameters) { mCameraUploadsSyncStorageManager = new CameraUploadsSyncStorageManager(getContentResolver()); + mFirstPictureEnqueued = false; + mFirstVideoEnqueued = false; + return true; // True because we have a thread still running and requesting stuff to the server } @@ -194,12 +200,12 @@ public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationRe if (!result.isSuccess()) { - Log_OC.d(TAG, "Remote folder does not exist yet, uploading the files for the " + - "first time, if any"); - // Remote folder doesn't exist yet, first local files upload if (result.getCode() == RemoteOperationResult.ResultCode.FILE_NOT_FOUND) { + Log_OC.d(TAG, "Remote folder does not exist yet, uploading the files for the " + + "first time, if any"); + for (File localFile : localFiles) { handleNewFile(localFile); @@ -215,25 +221,7 @@ public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationRe mPerformedOperationsCounter++; - // User only requested to upload pictures - boolean mOnlyPictures = mConfig.isEnabledForPictures() && !mConfig.isEnabledForVideos(); - - // User only requested to upload videos - boolean mOnlyVideos = mConfig.isEnabledForVideos() && !mConfig.isEnabledForPictures(); - - // User requested upload both pictures and videos - boolean mPicturesAndVideos = mConfig.isEnabledForPictures() && mConfig.isEnabledForVideos(); - - // Check if requested operations have been performed - if (mOnlyPictures && mPerformedOperationsCounter == 1 || - mOnlyVideos && mPerformedOperationsCounter == 1 || - mPicturesAndVideos && mConfig.getUploadPathForPictures(). - equals(mConfig.getUploadPathForVideos()) && - mPerformedOperationsCounter == 1 || - mPicturesAndVideos && mPerformedOperationsCounter == 2) { - - finish(); - } + finishIfOperationsCompleted(); } /** @@ -313,7 +301,7 @@ private synchronized void handleNewFile(File localFile) { // Check file timestamp if (isImage && localFile.lastModified() <= mOOCCameraUploadSync.getPicturesLastSync() || isVideo && localFile.lastModified() <= mOOCCameraUploadSync.getVideosLastSync()) { - Log_OC.i(TAG, "File " + localPath + " too old, ignoring"); + Log_OC.i(TAG, "File " + localPath + " created before period to check, ignoring"); return; } @@ -323,6 +311,11 @@ private synchronized void handleNewFile(File localFile) { return; } + // Update timestamps once the first picture/video has been enqueued + if (!mFirstPictureEnqueued || !mFirstVideoEnqueued) { + updateTimestamps(isImage, isVideo); + } + TransferRequester requester = new TransferRequester(); requester.uploadNewFile( this, @@ -353,23 +346,79 @@ private synchronized void handleNewFile(File localFile) { } /** - * Unbind the service used for getting the pictures and videos from the server and notify the - * system that the job has finished + * Update pictures and videos timestamps to upload only the pictures and videos taken later + * than those timestamps + * @param isImage true if file is an image, false otherwise + * @param isVideo true if file is a video, false otherwise */ - private void finish() { + private void updateTimestamps(boolean isImage, boolean isVideo) { - Log_OC.d(TAG, "Finishing camera folder sync job"); + long picturesTimestamp = mOOCCameraUploadSync.getPicturesLastSync(); + long videosTimestamp = mOOCCameraUploadSync.getVideosLastSync(); - if (mOperationsServiceBinder != null) { - mOperationsServiceBinder.removeOperationListener(this); + if (isImage && !mFirstPictureEnqueued) { + + Log_OC.d(TAG, "Updating timestamp for pictures"); + + picturesTimestamp = System.currentTimeMillis(); + + mFirstPictureEnqueued = true; } - if (mOperationsServiceConnection != null) { - unbindService(mOperationsServiceConnection); - mOperationsServiceBinder = null; + if (isVideo && !mFirstVideoEnqueued) { + + Log_OC.d(TAG, "Updating timestamp for videos"); + + videosTimestamp = System.currentTimeMillis(); + + mFirstVideoEnqueued = true; } - jobFinished(mJobParameters, false); + OCCameraUploadSync newOCCameraUploadSync = new OCCameraUploadSync(picturesTimestamp, + videosTimestamp); + + newOCCameraUploadSync.setId(mOOCCameraUploadSync.getId()); + + mCameraUploadsSyncStorageManager.updateCameraUploadSync(newOCCameraUploadSync); + } + + /** + * Check if requested operations have finished. If so, unbind the service used for getting + * the pictures and videos from the server and finish the job + */ + private void finishIfOperationsCompleted() { + + // User only requested to upload pictures + boolean mOnlyPictures = mConfig.isEnabledForPictures() && !mConfig.isEnabledForVideos(); + + // User only requested to upload videos + boolean mOnlyVideos = mConfig.isEnabledForVideos() && !mConfig.isEnabledForPictures(); + + // User requested upload both pictures and videos + boolean mPicturesAndVideos = mConfig.isEnabledForPictures() && mConfig.isEnabledForVideos(); + + // Check if requested operations have been performed + if (mOnlyPictures && mPerformedOperationsCounter == 1 || + mOnlyVideos && mPerformedOperationsCounter == 1 || + mPicturesAndVideos && mConfig.getUploadPathForPictures(). + equals(mConfig.getUploadPathForVideos()) && + mPerformedOperationsCounter == 1 || + mPicturesAndVideos && mPerformedOperationsCounter == 2) { + + Log_OC.d(TAG, "Finishing camera folder sync job"); + + if (mOperationsServiceBinder != null) { + mOperationsServiceBinder.removeOperationListener(this); + } + + if (mOperationsServiceConnection != null) { + unbindService(mOperationsServiceConnection); + mOperationsServiceBinder = null; + } + + // Notify the system that the job has finished + jobFinished(mJobParameters, false); + } } /** diff --git a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java index cca9627c9b6..073402f007b 100644 --- a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java +++ b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java @@ -177,8 +177,8 @@ protected void onCreate(Bundle savedInstanceState) { builder.setPersisted(true); - // Execute job every 15 seconds - builder.setPeriodic(15000); + // Execute job every 30 seconds + builder.setPeriodic(30000); // Extra data PersistableBundle extras = new PersistableBundle(); diff --git a/src/com/owncloud/android/ui/activity/Preferences.java b/src/com/owncloud/android/ui/activity/Preferences.java index 3666239f289..bc167e4e7b4 100644 --- a/src/com/owncloud/android/ui/activity/Preferences.java +++ b/src/com/owncloud/android/ui/activity/Preferences.java @@ -317,17 +317,17 @@ public boolean onPreferenceClick(Preference preference) { mPrefCameraPictureUploadsWiFi = findPreference("camera_picture_uploads_on_wifi"); mPrefCameraPictureUploads = findPreference("camera_picture_uploads"); - toggleInstantPictureOptions(((CheckBoxPreference) mPrefCameraPictureUploads).isChecked()); + toggleCameraUploadsPictureOptions(((CheckBoxPreference) mPrefCameraPictureUploads).isChecked()); mPrefCameraPictureUploads.setOnPreferenceChangeListener(new OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { - boolean enableInstantPicture = (Boolean) newValue; - toggleInstantPictureOptions(enableInstantPicture); - toggleInstantUploadCommonOptions( + boolean enableCameraUploadsPicture = (Boolean) newValue; + toggleCameraUploadsPictureOptions(enableCameraUploadsPicture); + toggleCameraUploadsCommonOptions( ((CheckBoxPreference) mPrefCameraVideoUploads).isChecked(), - enableInstantPicture + enableCameraUploadsPicture ); return true; } @@ -353,14 +353,14 @@ public boolean onPreferenceClick(Preference preference) { mPrefCameraVideoUploadsWiFi = findPreference("camera_video_uploads_on_wifi"); mPrefCameraVideoUploads = findPreference("camera_video_uploads"); - toggleInstantVideoOptions(((CheckBoxPreference) mPrefCameraVideoUploads).isChecked()); + toggleCameraUploadsVideoOptions(((CheckBoxPreference) mPrefCameraVideoUploads).isChecked()); mPrefCameraVideoUploads.setOnPreferenceChangeListener(new OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { - toggleInstantVideoOptions((Boolean) newValue); - toggleInstantUploadCommonOptions( + toggleCameraUploadsVideoOptions((Boolean) newValue); + toggleCameraUploadsCommonOptions( (Boolean) newValue, ((CheckBoxPreference) mPrefCameraPictureUploads).isChecked()); return true; @@ -384,11 +384,11 @@ public boolean onPreferenceClick(Preference preference) { } }); } else { - Log_OC.e(TAG, "Lost preference instant_upload_source_path"); + Log_OC.e(TAG, "Lost preference camera_uploads_source_path"); } mPrefCameraUploadsBehaviour = findPreference("camera_uploads_behaviour"); - toggleInstantUploadCommonOptions( + toggleCameraUploadsCommonOptions( ((CheckBoxPreference) mPrefCameraVideoUploads).isChecked(), ((CheckBoxPreference) mPrefCameraPictureUploads).isChecked()); @@ -402,13 +402,13 @@ public boolean onPreferenceClick(Preference preference) { pAboutApp.setSummary(String.format(getString(R.string.about_version), appVersion)); } - loadInstantUploadPath(); - loadInstantUploadVideoPath(); - loadInstantUploadSourcePath(); + loadCameraUploadsPicturePath(); + loadCameraUploadsVideoPath(); + loadCameraUploadsSourcePath(); } - private void toggleInstantPictureOptions(Boolean value) { + private void toggleCameraUploadsPictureOptions(Boolean value) { if (value) { mPrefCameraUploadsCategory.addPreference(mPrefCameraPictureUploadsWiFi); mPrefCameraUploadsCategory.addPreference(mPrefCameraPictureUploadsPath); @@ -418,7 +418,7 @@ private void toggleInstantPictureOptions(Boolean value) { } } - private void toggleInstantVideoOptions(Boolean value) { + private void toggleCameraUploadsVideoOptions(Boolean value) { if (value) { mPrefCameraUploadsCategory.addPreference(mPrefCameraVideoUploadsWiFi); mPrefCameraUploadsCategory.addPreference(mPrefCameraVideoUploadsPath); @@ -428,7 +428,7 @@ private void toggleInstantVideoOptions(Boolean value) { } } - private void toggleInstantUploadCommonOptions(Boolean video, Boolean picture) { + private void toggleCameraUploadsCommonOptions(Boolean video, Boolean picture) { if (picture || video) { mPrefCameraUploadsCategory.addPreference(mPrefCameraUploadsSourcePath); mPrefCameraUploadsCategory.addPreference(mPrefCameraUploadsBehaviour); @@ -482,7 +482,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) { mPrefCameraPictureUploadsPath.setSummary( DisplayUtils.getPathWithoutLastSlash(mUploadPath) ); - saveInstantUploadPathOnPreferences(); + saveCameraUploadsPicturePathOnPreferences(); } else if (requestCode == ACTION_SELECT_UPLOAD_VIDEO_PATH && resultCode == RESULT_OK) { @@ -491,7 +491,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) { mPrefCameraVideoUploadsPath.setSummary( DisplayUtils.getPathWithoutLastSlash(mUploadVideoPath) ); - saveInstantUploadVideoPathOnPreferences(); + saveCameraUploadsVideoPathOnPreferences(); } else if (requestCode == ACTION_SELECT_SOURCE_PATH && resultCode == RESULT_OK) { @@ -499,7 +499,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) { mPrefCameraUploadsSourcePath.setSummary( DisplayUtils.getPathWithoutLastSlash(mSourcePath) ); - saveInstantUploadSourcePathOnPreferences(); + saveCameraUploadsSourcePathOnPreferences(); } else if (requestCode == ACTION_REQUEST_PASSCODE && resultCode == RESULT_OK) { @@ -679,59 +679,59 @@ private AppCompatDelegate getDelegate() { } /** - * Load upload path set on preferences + * Load upload picture path set on preferences */ - private void loadInstantUploadPath() { + private void loadCameraUploadsPicturePath() { SharedPreferences appPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); - mUploadPath = appPrefs.getString("instant_upload_path", getString(R.string.camera_upload_path)); + mUploadPath = appPrefs.getString("camera_picture_uploads_path", getString(R.string.camera_upload_path)); mPrefCameraPictureUploadsPath.setSummary( DisplayUtils.getPathWithoutLastSlash(mUploadPath) ); } /** - * Save the "Instant Upload Path" on preferences + * Save the "Upload picture path" on preferences */ - private void saveInstantUploadPathOnPreferences() { + private void saveCameraUploadsPicturePathOnPreferences() { SharedPreferences appPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); SharedPreferences.Editor editor = appPrefs.edit(); - editor.putString("instant_upload_path", mUploadPath); + editor.putString("camera_picture_uploads_path", mUploadPath); editor.commit(); } /** * Load upload video path set on preferences */ - private void loadInstantUploadVideoPath() { + private void loadCameraUploadsVideoPath() { SharedPreferences appPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); - mUploadVideoPath = appPrefs.getString("instant_video_upload_path", getString(R.string.camera_upload_path)); + mUploadVideoPath = appPrefs.getString("camera_video_uploads_path", getString(R.string.camera_upload_path)); mPrefCameraVideoUploadsPath.setSummary( DisplayUtils.getPathWithoutLastSlash(mUploadVideoPath) ); } /** - * Save the "Instant Video Upload Path" on preferences + * Save the "Upload video path" on preferences */ - private void saveInstantUploadVideoPathOnPreferences() { + private void saveCameraUploadsVideoPathOnPreferences() { SharedPreferences appPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); SharedPreferences.Editor editor = appPrefs.edit(); - editor.putString("instant_video_upload_path", mUploadVideoPath); + editor.putString("camera_video_uploads_path", mUploadVideoPath); editor.commit(); } /** * Load source path set on preferences */ - private void loadInstantUploadSourcePath() { + private void loadCameraUploadsSourcePath() { SharedPreferences appPrefs = PreferenceManager.getDefaultSharedPreferences(this); mSourcePath = appPrefs.getString( - "instant_upload_source_path", + "camera_uploads_source_path", CameraUploadsConfiguration.DEFAULT_SOURCE_PATH ); if (mPrefCameraUploadsSourcePath != null) { @@ -751,13 +751,13 @@ private void loadInstantUploadSourcePath() { } /** - * Save the "Instant Video Upload Path" on preferences + * Save the "Camera folder" path on preferences */ - private void saveInstantUploadSourcePathOnPreferences() { + private void saveCameraUploadsSourcePathOnPreferences() { SharedPreferences appPrefs = PreferenceManager.getDefaultSharedPreferences(this); SharedPreferences.Editor editor = appPrefs.edit(); - editor.putString("instant_upload_source_path", mSourcePath); + editor.putString("camera_uploads_source_path", mSourcePath); editor.commit(); }